/* Completed controls (proposed design, 2026-10-28). Attributes belong to georeference-done-view.js: [data-gd-done]
   marks a control the engine disabled because its work is already done, [data-gd-label] holds the done wording.
   A done control reads as a quiet, settled record of what happened: muted text after a small check in the theme's
   ok colour, an ordinary cursor and no hover, instead of a greyed button that answers the pointer with "forbidden".
   Its own icon and [data-g] text are hidden while done (they stay in the DOM for the controller and flow layers).
   Lab tokens come from georeference-lab.css; Classic and Studio map onto their own palettes as in
   georeference-version-view.css. Selectors carry two ids so they outrank the station's disabled rules without
   !important. Size, position and the controller's disabled state are untouched. */

/* 1 · Tokens ------------------------------------------------------------------------------------------------------ */
#geoPage{
  --gd-text:var(--ink-3,#5c5f58);--gd-line:var(--rule,rgb(18 20 18/.11));--gd-ok:var(--ok,#12704f);--gd-surface:transparent;
}
:root[data-ui=classic]:not([data-lab-task=geo]) #geoPage{
  --gd-text:#97adaf;--gd-line:rgb(230 239 239/.14);--gd-ok:#62d9a3;
}
:root[data-ui=studio]:not([data-lab-task=geo]) #geoPage{
  --gd-text:var(--st-muted,#5d6b67);--gd-line:var(--st-line,rgb(20 32 29/.14));--gd-ok:var(--st-mint,#2fc79b);
}
:root[data-theme=light]:is([data-ui=classic],[data-ui=studio]):not([data-lab-task=geo]) #geoPage{
  --gd-text:var(--wb-subtle,#5f685d);--gd-line:var(--wb-border,#cbcfc7);--gd-ok:#12704f;
}

/* 2 · Done buttons: read this version, use on phones, save, nothing to force ---------------------------------------------------------- */
#geoPage :is(#load,#save,#useVersion,#forceSave)[data-gd-done]{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  border:1px solid var(--gd-line);background:var(--gd-surface);color:var(--gd-text);
  opacity:1;cursor:default;box-shadow:none;transform:none;
}
#geoPage :is(#load,#save,#useVersion,#forceSave)[data-gd-done]:hover{border-color:var(--gd-line);background:var(--gd-surface);color:var(--gd-text)}
#geoPage :is(#load,#save,#useVersion,#forceSave)[data-gd-done]>*{display:none}
#geoPage :is(#load,#save,#useVersion,#forceSave)[data-gd-done]::after{content:attr(data-gd-label);min-width:0;overflow-wrap:anywhere;font-weight:600}

/* The check: two strokes drawn by a rotated corner, sized with the text so it follows zoom and font size. */
#geoPage :is(#load,#save,#useVersion,#forceSave)[data-gd-done]::before,
#geoPage .geo-check:has(#activate)[data-gd-done]::before{
  content:"";flex:none;box-sizing:border-box;width:.4375em;height:.8125em;margin:0 .1875em .1875em;
  border:solid var(--gd-ok);border-width:0 .15em .15em 0;transform:rotate(45deg);
}

/* 3 · Done checkbox row: in use on devices ----------------------------------------------------------------------- */
/* min-height keeps the hidden 1.25rem box's row height, so marking the row done never shifts the panel. */
#geoPage .geo-check:has(#activate)[data-gd-done]{color:var(--gd-text);cursor:default;min-height:1.25rem}
#geoPage .geo-check:has(#activate)[data-gd-done]>*{display:none}
/* The check takes the box's column, so the row keeps its two-column alignment. */
#geoPage .geo-check:has(#activate)[data-gd-done]::before{justify-self:center;align-self:center;margin-block:0}
#geoPage .geo-check:has(#activate)[data-gd-done]::after{content:attr(data-gd-label);min-width:0;overflow-wrap:anywhere;font-weight:600}

/* 4 · The whole "Save & use" step is done: the maps hold exactly the version devices use. ------------------------ */
/* The step reads as a settled record: a done chip beside its heading, muted labels, and no control answers the
   pointer with "forbidden". The name field stays editable; editing it leaves this state through the engine. */
#geoPage .geo-panel-save > .geo-sectionbar[data-gd-done]{flex-wrap:wrap;gap:.375rem .75rem}
#geoPage .geo-panel-save > .geo-sectionbar[data-gd-done]::after{
  content:attr(data-gd-label);display:inline-flex;align-items:center;min-height:1.5rem;padding:.125rem .625rem;
  border:1px solid var(--gd-line);border-radius:999px;color:var(--gd-text);font-size:.75rem;font-weight:600;line-height:1.3;overflow-wrap:anywhere;
}
#geoPage .geo-panel-save[data-gd-panel] :is(label,h2){color:var(--gd-text)}
#geoPage .geo-panel-save[data-gd-panel] :is(#save,#forceSave,#activate,#versionName):disabled,
#geoPage .geo-panel-save[data-gd-panel] .geo-check:has(#activate:disabled),
#geoPage .geo-panel-save[data-gd-panel] [data-gd-done]{cursor:default}

@media (forced-colors:active){
  #geoPage :is(#load,#save,#useVersion,#forceSave)[data-gd-done]{border-color:GrayText;color:GrayText}
  #geoPage :is(#load,#save,#useVersion,#forceSave,.geo-check)[data-gd-done]::before{border-color:GrayText}
  #geoPage .geo-check:has(#activate)[data-gd-done]{color:GrayText}
}
