/* JDM Desk · appearance modes (dd, 25 Oct 2026). One palette per mode, written once, for the Frame and for the classic screens inside it.
   Names start --m-; frame.css and classic-frame.css read them. The swatch in the Look menu reads the same blocks (.sw[data-sw]).
   Rules: ink and the greys keep the same order in every mode (ink, t2, t3, mist); a surface is always lighter than the ground in dark modes and whiter in light modes; status colours keep their hue. Link (--m-link) is the colour of words that open something; it reaches 4.5 to 1 on every surface in every mode.
   Spec: spec/desk2/look-modes.md. Contrast pass (look-contrast-tokens.md): --m-ctl-line (controls, 3:1), --m-on-bad (error toast), --m-skeleton (loading bars), t3 raised in Light, Sand, Slate, Graphite. */
:root,:root[data-theme="light"],.sw[data-sw="light"]{
  --m-caret:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23646A6E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");--m-caret-hi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B2022' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --m-ink:#1B2022;--m-on-ink:#FAFAFA;--m-t2:#464C4F;--m-t3:#646A6E;--m-mist:#8A9095;
  --m-ground:#FAFAFA;--m-surface:#FFFFFF;--m-well:#F3F3F4;--m-sel:#E9EAEB;
  --m-line:#E4E5E6;--m-line-soft:#EEEFEF;--m-line-strong:#C9CCCE;
  --m-accent:#C2410C;--m-good:#2E8B57;--m-warn:#B07C24;--m-bad:#B03A2E;--m-smart:#4338CA;
  --m-good-bg:rgba(46,139,87,.10);--m-warn-bg:rgba(176,124,36,.12);--m-bad-bg:rgba(176,58,46,.10);
  --m-link:#1F5FBF;--m-link-bg:rgba(31,95,191,0.08);--m-link-line:rgba(31,95,191,0.4);
  --m-ctl-line:#868C90;--m-on-bad:#FFFFFF;--m-skeleton:#ECEDEE;
  --m-scrim:rgba(14,17,18,.42);--m-overlay:0 24px 64px rgba(14,17,18,.18),0 2px 6px rgba(14,17,18,.06);
  --m-hdr1:#0E1112;--m-hdr2:#2B3033;--m-tiles:none;color-scheme:light;
}
/* Sand: warm paper, low glare for long days. */
:root[data-theme="sand"],.sw[data-sw="sand"]{
  --m-caret:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23676053' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");--m-caret-hi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2325211C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --m-ink:#25211C;--m-on-ink:#FBF8F2;--m-t2:#4F4940;--m-t3:#676053;--m-mist:#9A9285;
  --m-ground:#F3EEE5;--m-surface:#FFFDF9;--m-well:#EBE5DA;--m-sel:#E3DCCD;
  --m-line:#E1DACD;--m-line-soft:#ECE6DA;--m-line-strong:#C9C0AF;
  --m-accent:#B83E0A;--m-good:#2B7A4B;--m-warn:#9C6B14;--m-bad:#A5382A;--m-smart:#4338CA;
  --m-good-bg:rgba(43,122,75,.11);--m-warn-bg:rgba(156,107,20,.13);--m-bad-bg:rgba(165,56,42,.10);
  --m-link:#1D58A6;--m-link-bg:rgba(29,88,166,0.09);--m-link-line:rgba(29,88,166,0.4);
  --m-ctl-line:#888175;--m-on-bad:#FFFFFF;--m-skeleton:#E6DFD2;
  --m-scrim:rgba(37,33,28,.42);--m-overlay:0 24px 64px rgba(37,33,28,.18),0 2px 6px rgba(37,33,28,.06);
  --m-hdr1:#1F1B16;--m-hdr2:#3A342B;--m-tiles:none;color-scheme:light;
}
/* Slate: a soft blue-grey dark, nowhere near black. The one to live in at night. */
:root[data-theme="slate"],.sw[data-sw="slate"]{
  --m-caret:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2396A0AA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");--m-caret-hi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E6EAED' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --m-ink:#E6EAED;--m-on-ink:#13181D;--m-t2:#B9C1C8;--m-t3:#96A0AA;--m-mist:#69747E;
  --m-ground:#13181D;--m-surface:#1A2026;--m-well:#232A31;--m-sel:#2D3740;
  --m-line:rgba(230,236,242,.12);--m-line-soft:rgba(230,236,242,.06);--m-line-strong:rgba(230,236,242,.26);
  --m-accent:#F2845C;--m-good:#5CB882;--m-warn:#D9A24A;--m-bad:#E0695C;--m-smart:#9AA0FF;
  --m-good-bg:rgba(46,139,87,.20);--m-warn-bg:rgba(176,124,36,.22);--m-bad-bg:rgba(176,58,46,.22);
  --m-link:#7DB1FF;--m-link-bg:rgba(125,177,255,0.13);--m-link-line:rgba(125,177,255,0.45);
  --m-ctl-line:#6A757F;--m-on-bad:#13181D;--m-skeleton:#28303A;
  --m-scrim:rgba(4,7,10,.62);--m-overlay:0 24px 64px rgba(0,0,0,.5),0 2px 6px rgba(0,0,0,.3);
  --m-hdr1:#1E2A35;--m-hdr2:#31465A;--m-tiles:invert(1) hue-rotate(180deg) brightness(.88) contrast(.9);color-scheme:dark;
}
/* Graphite: a neutral charcoal, no tint. */
:root[data-theme="graphite"],.sw[data-sw="graphite"]{
  --m-caret:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A3A6A9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");--m-caret-hi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ECEDEE' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --m-ink:#ECEDEE;--m-on-ink:#1C1D1F;--m-t2:#C3C5C7;--m-t3:#A3A6A9;--m-mist:#74777B;
  --m-ground:#1C1D1F;--m-surface:#242527;--m-well:#2D2E31;--m-sel:#393B3F;
  --m-line:rgba(255,255,255,.12);--m-line-soft:rgba(255,255,255,.06);--m-line-strong:rgba(255,255,255,.26);
  --m-accent:#F2845C;--m-good:#5CB882;--m-warn:#D9A24A;--m-bad:#E0695C;--m-smart:#9AA0FF;
  --m-good-bg:rgba(46,139,87,.20);--m-warn-bg:rgba(176,124,36,.22);--m-bad-bg:rgba(176,58,46,.22);
  --m-link:#80B2FF;--m-link-bg:rgba(128,178,255,0.13);--m-link-line:rgba(128,178,255,0.45);
  --m-ctl-line:#75787C;--m-on-bad:#1C1D1F;--m-skeleton:#323336;
  --m-scrim:rgba(0,0,0,.6);--m-overlay:0 24px 64px rgba(0,0,0,.5),0 2px 6px rgba(0,0,0,.3);
  --m-hdr1:#2A2B2E;--m-hdr2:#3F4146;--m-tiles:invert(1) hue-rotate(180deg) brightness(.92) contrast(.9);color-scheme:dark;
}
/* Black: the near-black the Desk had (id "dark"). For dim rooms and OLED screens. */
:root[data-theme="dark"],.sw[data-sw="dark"]{
  --m-caret:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A3A8AC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");--m-caret-hi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F2F3F3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --m-ink:#F2F3F3;--m-on-ink:#0E1112;--m-t2:#C9CDD0;--m-t3:#A3A8AC;--m-mist:#7C8286;
  --m-ground:#0B0D0E;--m-surface:#121516;--m-well:#1A1D1F;--m-sel:#262B2E;
  --m-line:rgba(250,250,250,.14);--m-line-soft:rgba(250,250,250,.07);--m-line-strong:rgba(250,250,250,.28);
  --m-accent:#F2845C;--m-good:#5CB882;--m-warn:#D9A24A;--m-bad:#E0695C;--m-smart:#9AA0FF;
  --m-good-bg:rgba(46,139,87,.20);--m-warn-bg:rgba(176,124,36,.22);--m-bad-bg:rgba(176,58,46,.22);
  --m-link:#7DB1FF;--m-link-bg:rgba(125,177,255,0.13);--m-link-line:rgba(125,177,255,0.45);
  --m-ctl-line:#656A6D;--m-on-bad:#0B0D0E;--m-skeleton:#1F2325;
  --m-scrim:rgba(0,0,0,.6);--m-overlay:0 24px 64px rgba(0,0,0,.55),0 2px 6px rgba(0,0,0,.35);
  --m-hdr1:#0E1112;--m-hdr2:#2B3033;--m-tiles:invert(1) hue-rotate(180deg) brightness(.82) contrast(.9);color-scheme:dark;
}
/* Contrast: white, black ink, strong lines. For bright rooms and for anyone who needs the edges sharp. */
:root[data-theme="contrast"],.sw[data-sw="contrast"]{
  --m-caret:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");--m-caret-hi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --m-ink:#000000;--m-on-ink:#FFFFFF;--m-t2:#1A1A1A;--m-t3:#333333;--m-mist:#595959;
  --m-ground:#FFFFFF;--m-surface:#FFFFFF;--m-well:#F0F0F0;--m-sel:#DCDCDC;
  --m-line:#6B6B6B;--m-line-soft:#A8A8A8;--m-line-strong:#000000;
  --m-accent:#9A3412;--m-good:#1B6B3F;--m-warn:#7A5200;--m-bad:#8E2018;--m-smart:#2E2A9E;
  --m-good-bg:rgba(27,107,63,.14);--m-warn-bg:rgba(122,82,0,.14);--m-bad-bg:rgba(142,32,24,.12);
  --m-link:#0A3FA8;--m-link-bg:rgba(10,63,168,0.1);--m-link-line:rgba(10,63,168,0.65);
  --m-ctl-line:#000000;--m-on-bad:#FFFFFF;--m-skeleton:#E0E0E0;
  --m-scrim:rgba(0,0,0,.55);--m-overlay:0 24px 64px rgba(0,0,0,.3),0 2px 6px rgba(0,0,0,.2);
  --m-hdr1:#000000;--m-hdr2:#1A1A1A;--m-tiles:none;color-scheme:light;
}
/* Swatch in the Look menu: a tiny Desk in the mode's own colours (rail, ground, two lines of text). */
.sw{position:relative;display:inline-block;flex:none;width:32px;height:22px;border-radius:4px;background:var(--m-ground);border:1px solid var(--m-line-strong);overflow:hidden}
.sw::before{content:"";position:absolute;inset-inline-start:0;top:0;bottom:0;width:8px;background:var(--m-surface);border-inline-end:1px solid var(--m-line)}
.sw::after{content:"";position:absolute;inset-inline-start:12px;top:5px;width:13px;height:3px;border-radius:1px;background:var(--m-ink);box-shadow:0 5px 0 var(--m-t3)}
.sw[data-sw="system"]{background:linear-gradient(135deg,#FAFAFA 50%,#13181D 50%);border-color:#8A9095}
.sw[data-sw="system"]::before,.sw[data-sw="system"]::after{display:none}
