/* Colour layer. Loaded last. Operate-mode tool whose content is colour, so the
   chrome stays quiet: graphite neutrals tinted a hair toward ink-blue, and one
   azure accent that means "selected / active / focused". Gradients keep the
   saturation; the interface does not compete with them. */

html.graphite63{
  --hue-ink:265;
  --accent:oklch(.8 .115 245);
  --accent-strong:oklch(.86 .1 245);
  --accent-ink:oklch(.2 .03 255);
  --accent-wash:oklch(.8 .115 245 / .16);
  --accent-line:oklch(.8 .115 245 / .55);
  --ok:oklch(.8 .13 160);
  --warn:oklch(.82 .13 80);
  --danger:oklch(.74 .15 25);

  --g-bg:oklch(.2 .006 var(--hue-ink));
  --g-panel:oklch(.245 .008 var(--hue-ink));
  --g-stage:oklch(.17 .006 var(--hue-ink));
  --g-field:oklch(.285 .009 var(--hue-ink));
  --g-hover:oklch(.35 .011 var(--hue-ink));
  --g-line:oklch(.42 .012 var(--hue-ink));
  --g-text:oklch(.96 .004 var(--hue-ink));
  --g-muted:oklch(.76 .012 var(--hue-ink));
  accent-color:var(--accent);
  caret-color:var(--accent);
}
html.graphite63 .rail59{background:oklch(.225 .007 var(--hue-ink))}

/* Browser surfaces */
html.graphite63 ::selection{background:oklch(.8 .115 245 / .38);color:var(--g-text)}
html.graphite63 :is(input,textarea,select){caret-color:var(--accent)}
html.graphite63 :is(input[type=checkbox],input[type=radio],progress){accent-color:var(--accent)}
html.graphite63 :is(#gallery-progress48,#export-progress48){accent-color:var(--accent)}
html.graphite63 *{scrollbar-color:oklch(.45 .012 var(--hue-ink)) transparent}

@media(forced-colors:none){
  /* Focus: one colour everywhere it is drawn by the shell. */
  html.graphite63 :is(button,[role=button],a,summary,select,input,[tabindex]):focus-visible,
  html.graphite63.studio59 #detail :is(button,summary,input,select,[tabindex]):focus-visible,
  html.graphite63.studio59 #palette-panel :where(.pal-shell) :is(button,summary,select,input):focus-visible,
  html.graphite63.studio59 #fields .tile:focus-visible,
  html.graphite63.studio59 #gallery-settings63 :is(button,summary):focus-visible,
  html.graphite63 #library-room63 button:focus-visible{
    outline-color:var(--accent);
  }

  /* Sliders: the filled run reads as "amount"; the empty run stays neutral. */
  html.graphite63.studio59 input[type=range]{
    --slider-fill60:var(--accent);
    --slider-empty60:oklch(.4 .012 var(--hue-ink));
    --slider-edge60:oklch(.52 .014 var(--hue-ink));
    --slider-rim60:oklch(.2 .006 var(--hue-ink));
    --slider-thumb60:oklch(.97 .004 var(--hue-ink));
    --slider-focus60:var(--accent-strong);
  }
}

/* Selection state: azure fill, dark ink. Replaces the grey/white pills so the
   current choice is findable at a glance across every panel. */
html.graphite63.studio59 #palette-panel #palette-count button[aria-pressed=true]{
  background:var(--accent);
  color:var(--accent-ink);
  border-color:transparent;
}

/* Toggles that are "on": tinted wash and an accent edge, text stays readable. */
html.studio59 #detail #canvas-tools45 button[aria-pressed=true],
html.studio59 #detail #editor-formats63 .focus-canvas59[aria-pressed=true],
html.studio59 #detail #editor-prop59 :is(.pin48,#compare-detail48)[aria-pressed=true],
html.graphite63.studio59 .gallery-toolbar59 :is(.data59,#compare-gallery48)[aria-pressed=true],
html.graphite63.studio59 .gallery-actions59 .settings-toggle63[aria-expanded=true]{
  background:var(--accent-wash);
  border-color:var(--accent-line);
  color:var(--accent-strong);
}

/* Palette presets and library selections. */
html.graphite63.studio59 #palette-panel #palette-presets .pal-choice[aria-pressed=true],
html.graphite63 #library-room63 .library-saved-card63[aria-pressed=true]{
  background:var(--accent-wash);
  border-color:var(--accent-line);
}
html.graphite63 :is(.library-card63,.library-ref63)[aria-pressed=true] .library-picture63{
  outline-color:var(--accent);
}

/* Current room in the dock/rail. */
html.graphite63.studio59 dialog.g-room63 .dock63 button[aria-current=page]{
  background:var(--accent-wash);
  color:var(--accent-strong);
  box-shadow:inset 0 -2px 0 var(--accent);
}

/* Status: informative colour always paired with text in the markup. */
html.graphite63 [role=status]:not(:empty){color:var(--g-muted)}
html.graphite63 [role=alert],html.graphite63 .error,html.graphite63 [aria-invalid=true]{color:var(--danger)}
html.graphite63 [aria-invalid=true]{border-color:var(--danger)}
