/* ==========================================================================
   THE LIGHT/DARK SWITCH (admin/js/mode-switch.mjs), top right on the sign-in
   and the account, and the account's dark side (1–2 Nov 2026, the owner).
   ========================================================================== */
.mode-switch{
  position:fixed; z-index:60; top:max(14px, env(safe-area-inset-top)); right:max(16px, env(safe-area-inset-right));
  /* every global button rule undone: the switch is exactly its own size */
  -webkit-appearance:none; appearance:none; box-sizing:border-box; display:block;
  width:64px; height:32px; min-width:0; min-height:0; max-height:32px; margin:0; padding:0; border:0; border-radius:var(--tk-r-pill);
  font-size:0; line-height:0; cursor:pointer;
  /* SOLID: it stays put while the page scrolls under it, so nothing may read through it (CL-01, a11y-check) */
  background:var(--tk-line); color:var(--tk-grey-0a);
  box-shadow:inset 0 0 0 1px rgba(10,10,10,.10), inset 0 1px 2px rgba(10,10,10,.08);
  transition:background-color .25s ease, box-shadow .25s ease;
}
.mode-switch__knob{
  position:absolute; top:3px; left:3px; width:26px; height:26px; border-radius:50%;
  background:var(--tk-white); box-shadow:0 1px 2px rgba(10,10,10,.18), 0 4px 10px -3px rgba(10,10,10,.28);
  transition:transform .34s cubic-bezier(.3,1.35,.5,1), background-color .25s ease, box-shadow .25s ease;
}
.mode-switch svg{position:absolute; z-index:1; top:9px; width:14px; height:14px; transition:color .25s ease, opacity .25s ease}
.mode-switch__sun{left:9px; opacity:1}
/* THE ICON NOT CHOSEN IS A SOLID GREY (2 Nov): the grey that half its ink over the track drew, so nothing on the switch
   is faded (office-ink.mjs, "nothing faded") and it reads the same. */
.mode-switch__moon{right:9px; color:#787876}
.mode-switch:hover{background:var(--tk-line-2)}
/* the lit edge (owner rule 6, focus-check): the page's own --focus-edge, near-black on the light sheet, the composer's grey on the dark */
.mode-switch:focus-visible{outline:1px solid var(--focus-edge); outline-offset:3px}
:root[data-mode="dark"] .mode-switch{background:#1F1F1D; color:var(--tk-grey-f4); box-shadow:inset 0 0 0 1px var(--tk-white-a140), inset 0 1px 2px var(--tk-black-a500)}
:root[data-mode="dark"] .mode-switch:hover{background:#2A2A28}
:root[data-mode="dark"] .mode-switch__knob{transform:translateX(32px); background:var(--tk-grey-2a); box-shadow:inset 0 0 0 1px var(--tk-white-a120), 0 4px 10px -3px var(--tk-black)}
:root[data-mode="dark"] .mode-switch__sun{color:#8A8A88}
:root[data-mode="dark"] .mode-switch__moon{opacity:1; color:var(--tk-lime)}
@media (prefers-reduced-motion:reduce){ .mode-switch__knob{transition:none} }
@media (forced-colors:active){ .mode-switch{border:1px solid ButtonText} .mode-switch__knob{forced-color-adjust:none; background:Highlight} }
/* on a phone the sign-in's back link sits at the band's top right: it steps aside for the switch */
@media (max-width:1023px){ :root:not([data-theme="classic"]) #signin .auth-world__top{padding-right:72px} }

/* ── THE ACCOUNT, DARK: the posts' black; the cards a step up from the sheet, the words light ── */
:root[data-mode="dark"]:not([data-theme="classic"]):not([data-posts="off"]){
  --u-sheet:var(--tk-dark-sheet);
  --u-card:var(--tk-dark-card);
  --u-ink:var(--tk-dark-ink);
  --u-ink-2:var(--tk-dark-ink-2);
  --u-ink-3:var(--tk-dark-ink-3);
  --u-line:var(--tk-dark-line);
  --u-line-2:var(--tk-dark-line-2);
  --u-amber-ink:var(--tk-attn);
  --u-warn-ink:var(--tk-bad-dark);
  --u-ok-ink:var(--tk-ok-dark);
  --u-lift:var(--tk-lift-dark);
  --u-lift-hi:0 0 0 1px var(--tk-white-a080), 0 1px 0 var(--tk-white-a060) inset, 0 26px 56px -22px var(--tk-black-a900);
  --ac-paper:#141413;
  --ac-paper-ink:#F0F0EC;
  --ac-paper-ink-2:#BDBDB8;
  --ac-paper-hair:var(--tk-white-a120);
  --ac-paper-hair-2:rgba(255,255,255,.22);
  --ac-paper-rule:rgba(255,255,255,.24);
  --ac-paper-sunk:var(--tk-white-a045);
  --ac-paper-attn:var(--tk-attn);
  --ac-paper-attn-wash:rgba(232,192,122,.10);
  --u-on-ink:var(--tk-grey-0a);                     /* text on an ink-coloured surface: the ink is light here, so the text is dark */
  color-scheme:dark;
}
:root[data-mode="dark"]:not([data-theme="classic"]) body:has(.ac-top){background:var(--tk-grey-05)}
/* THE SHEET'S OWN TOKENS. account-pro.css points every --ac-* token the rooms read to a light value on .ac-wrap, several
   by hand (#1A1A1A words, #555555 muted, #F7F7F5 wells): set on .ac-wrap, they won over the dark ones above, and the
   rooms drew dark words on the dark sheet (2 Nov, the owner: "all pages in dark mode have flaws with text visibility").
   Here each is pointed back, on .ac-wrap itself. The rules that name a colour by hand have their dark side written
   from them by tools/account-dark.mjs (admin/css/account-dark.css, loaded just before this file). */
:root[data-mode="dark"]:not([data-theme="classic"]):not([data-posts="off"]) .ac-wrap{
  color-scheme:dark;
  --ac-surface-1:var(--tk-white-a035);
  --ac-surface-2:var(--tk-white-a060);
  --ac-hair-2:var(--tk-white-a120);
  --ac-hair-3:rgba(255,255,255,.42);
  --ac-text:#E4E4E0;
  --ac-muted:#B4B4B0;
  --ac-muted-2:#ACACA8;
  --ac-panel-hover:var(--tk-dark-well);
  --ac-paper-rule:rgba(255,255,255,.24);
  --ac-paper-hair-2:rgba(255,255,255,.22);
  --ac-paper-sunk:var(--tk-white-a045);
  --ac-paper-attn-wash:rgba(200,240,49,.10);
  --ac-raised-hover:var(--tk-dark-well);
  --ac-chip:var(--tk-dark-well);
  --ac-solid-hover:#DADAD6;
  --focus-edge:var(--tk-grey-8e);                   /* the lit edge on the dark, the composer's (owner rule 6) */
  --focus-halo:var(--tk-white-a140);
}
/* the ink buttons are light here: their hover a step down, not to black under dark words */
:root[data-mode="dark"]:not([data-theme="classic"]):not([data-posts="off"]) .ac-wrap :is(.ac-do, .ac-do--paper):not(.ac-do--quiet):not(.ac-do--lime):hover{background:#DADAD6}
/* the black pills (attention, the room's eyebrow) would sink into a dark card: a raised grey with a hairline */
:root[data-mode="dark"]:not([data-theme="classic"]):not([data-posts="off"]) .ac-wrap :is(.ac-pill--attn, .ac-ppill--attn){background:#2A2A28; color:#F4F4F0; box-shadow:inset 0 0 0 1px var(--tk-white-a140)}
/* the sheet: the posts' black, a little light at its head, the dot grid in white */
:root[data-mode="dark"]:not([data-theme="classic"]):not([data-posts="off"]) .ac-wrap{
  background-color:var(--tk-dark-sheet);
  background-image:radial-gradient(80% 560px at 50% 0, #1A1A18 0%, rgba(26,26,24,0) 100%);
}
:root[data-mode="dark"]:not([data-theme="classic"]):not([data-posts="off"]) .ac-wrap::before{
  background:radial-gradient(var(--tk-white-a070) 1.2px, transparent 1.4px) 0 0 / 32px 32px repeat;
}
:root[data-mode="dark"]:not([data-theme="classic"]):not([data-posts="off"]) .ac-ph:has(> .ac-ph__hi) .ac-ph__h{background:var(--tk-white-a060); box-shadow:inset 0 0 0 1px var(--tk-white-a160)}
/* the selected settings tab keeps its ink under the pointer (the dark hover written from the light one comes later) */
@media (min-width:821px){
  :root[data-mode="dark"]:not([data-theme="classic"]):not([data-posts="off"]) .ac-sub__a[aria-current="true"]:hover{background:var(--u-ink); color:var(--u-on-ink)}
}
/* a file's paper on the Files room: the light sheet's gradient, dark */
@media (min-width:768px){
  :root[data-mode="dark"]:not([data-theme="classic"]):not([data-posts="off"]) .ac-tb[aria-label="Your files"] .ac-tb__file .ac-file__t{
    background:linear-gradient(180deg,#22221F,#1A1A18); color:#D6D6D2; box-shadow:inset 0 0 0 1px var(--tk-white-a060);
  }
}

/* ── THE OFFICE, DARK (2 Nov 2026, the owner: "admin dash lacks dark/light toggle") ─────────────────────────────────
   office-pro.css puts the stage (.ofc-main, the dialogs it opens) on the light set, each token from a --u-* value or by
   hand. Dark, the --u-* values are pointed to the posts' black where the stage resolves them, so every token the light
   set names by --u-* follows; the ones it names by hand are given here. The island, the palette and the toasts are dark
   in both. office-dark.css (tools/dark-side.mjs) answers the rules that name a light colour by hand. */
@media screen{ /* on paper the Office prints as it always has (office-pro.css section 18) */
html:not([data-theme="classic"])[data-mode="dark"]:not([data-posts="off"]) :is(#office, #ads, #ebay) :is(.ofc-main, .ofc-compose-dlg, .ofc-stagepick, .ofc-daypick, .ofc-clientview__menu, .ofc-bell__panel, .ofc-drawer){
  color-scheme:dark;
  --u-sheet:var(--tk-dark-sheet);
  --u-card:var(--tk-dark-card);
  --u-ink:var(--tk-dark-ink);
  --u-ink-2:var(--tk-dark-ink-2);
  --u-ink-3:var(--tk-dark-ink-3);
  --u-line:var(--tk-dark-line);
  --u-line-2:var(--tk-dark-line-2);
  --u-edge:var(--tk-dark-edge);
  --u-edge-hi:var(--tk-dark-edge-hi);
  --u-on-ink:var(--tk-grey-0a);
  --u-lift:var(--tk-lift-dark);
  --o-bg:var(--tk-dark-sheet);
  --o-bg-2:var(--tk-dark-sheet);
  --o-panel:var(--tk-dark-card);
  --o-plane:var(--tk-dark-card);
  --o-plane-edge:#2A2A28;
  --o-plane-hover:var(--tk-dark-well);
  --o-inset:var(--tk-dark-well);
  --o-raised:var(--tk-dark-card);
  --o-sunk:var(--tk-dark-sheet);
  --o-hover:var(--tk-white-a050);
  --o-press:var(--tk-white-a090);
  --o-line:var(--tk-dark-line);
  --o-line-2:var(--tk-dark-line-2);
  --o-line-3:var(--tk-dark-edge);
  --o-line-4:var(--tk-dark-edge-hi);
  --o-text:var(--tk-dark-ink);
  --o-strong:var(--tk-dark-ink);
  --o-ink:var(--tk-dark-ink);
  --o-dim:var(--tk-dark-ink-2);
  --o-dim-2:#C4C4C0;
  --o-faint:var(--tk-dark-ink-3);
  --o-accent:var(--tk-dark-ink);
  --o-accent-hi:var(--tk-white);
  --o-accent-wash:var(--tk-white-a060);
  --o-on-accent:var(--tk-grey-0a);
  --o-link:var(--tk-dark-ink);
  --o-link-hi:var(--tk-white);
  --o-ok:var(--tk-ok-dark);
  --o-ok-bg:rgba(70,220,145,.14);
  --o-green-ink:var(--tk-ok-dark);
  --o-warn-ink:var(--tk-attn);
  --o-warn-bg:rgba(220,169,70,.14);
  --o-bad:var(--tk-bad-dark);
  --o-bad-bg:rgba(220,109,70,.16);
  --o-depth:var(--u-lift);
  --paper:var(--tk-dark-sheet);
  --paper-2:var(--tk-dark-sheet);
  --paper-3:var(--tk-dark-line);
  --in-bg:var(--tk-dark-sheet);
  --app-bg:var(--tk-dark-sheet);
  --app-surface:var(--tk-dark-card);
  --app-raised:var(--tk-dark-well);
  --app-text:var(--tk-dark-ink);
  --app-mute:var(--tk-dark-ink-3);
  --app-line:var(--tk-dark-line);
  --app-accent:var(--tk-dark-ink);
  --ink:var(--tk-dark-ink);
  --stone:var(--tk-dark-ink-3);
  --bone-mute:var(--tk-dark-ink-3);
  --bone-line:var(--tk-dark-line-2);
  --ok:var(--tk-ok-dark);
  --bad:var(--tk-bad-dark);
  --attn:var(--tk-attn);
  --of-bg:var(--tk-dark-sheet);
  --of-surface:var(--tk-dark-card);
  --of-raised:var(--tk-dark-well);
  --of-well:var(--tk-dark-well);
  --of-chrome:var(--tk-dark-card);
  --of-hair:var(--tk-dark-line);
  --of-hair-2:var(--tk-dark-line-2);
  --of-hair-3:var(--tk-dark-edge);
  --of-text-hi:var(--tk-dark-ink);
  --of-text:#E4E4E0;
  --of-text-2:var(--tk-dark-ink-2);
  --of-muted:#C0C0BC;
  --of-muted-2:#B4B4B0;
  --of-muted-3:var(--tk-dark-ink-3);
  --of-attn:var(--tk-attn);
  --of-attn-ink:var(--tk-attn);
  --focus-edge:var(--tk-grey-8e);                   /* the lit edge on the dark, the composer's (owner rule 6) */
  --focus-halo:var(--tk-white-a140);
  color:var(--tk-dark-ink);
}
/* the stage's own ground (office-pro.css draws it from --u-sheet on the frame's grid) */
html:not([data-theme="classic"])[data-mode="dark"]:not([data-posts="off"]) :is(#office, #ads, #ebay) .ofc-main{background-color:var(--tk-dark-sheet)}
}

/* The switch in the Office: in the header's row of actions, not over them (mode-switch.mjs puts it there). */
.mode-switch--inline{position:relative; top:auto !important; right:auto; z-index:auto; flex:none; align-self:center}
/* …AND DRAWN WITH THE ROW (5 Nov, fix-station). It stands first in a row whose actions (Jump to…, the bell, the page's
   own) each page shows only once it knows who is signed in. Drawn alone before them, it was pushed 250 to 400px left
   as they came, with the row's edge (station-check: the Workstation's and a record's layout shift). While the row's
   Jump to… still waits hidden, the switch waits with it, and the row comes whole, in one frame. */
#office .ofc-top__acts:has(> .ofc-jump[hidden]) > .mode-switch{display:none}
/* In the account's bar on a phone: a step smaller, a little room before Ask, on the bar's dark */
.mode-switch--bar{width:52px; height:28px; max-height:28px; margin-right:8px; background:var(--tk-grey-1a); color:var(--tk-grey-f4);
  box-shadow:inset 0 0 0 1px var(--tk-white-a120)}
.mode-switch--bar .mode-switch__knob{width:22px; height:22px; background:var(--tk-grey-3a); box-shadow:none}
.mode-switch--bar svg{top:7px; width:14px; height:14px}
.mode-switch--bar .mode-switch__sun{left:7px; opacity:1; color:var(--tk-grey-f4)}
.mode-switch--bar .mode-switch__moon{right:7px; color:#878787}
:root[data-mode="dark"] .mode-switch--bar .mode-switch__sun{color:#878787}
:root[data-mode="dark"] .mode-switch--bar{background:var(--tk-grey-1a)}
:root[data-mode="dark"] .mode-switch--bar .mode-switch__knob{transform:translateX(24px); background:var(--tk-grey-3a)}
/* THE CLIENT'S NAME STAYS WHOLE BESIDE IT (2 Nov). With the switch in the bar, "Harborview Dental" had 104px of its 123 at
   390 and 72 at 320, and lost its end to an ellipsis (account-phone-check: the header holds the client's whole name). It
   takes two lines there, a step smaller.
   …AND NEVER BREAKS A WORD (12 Nov, account-email-wrap): "a word longer than the column breaks" drew the address a
   client sees while their company is unread as "sam@wren-potter / y.exam / ple" at 390 and 320 (account-down-check,
   office-health 17). It wraps between words only; a word longer than the column is cut with an ellipsis, and a name of
   one word (an address) stays on one line, cut the same way (page-account.mjs paint marks it; the title holds it whole). */
:root .ac-top:has(.mode-switch--bar) .ac-top__co{white-space:normal; overflow:hidden; text-overflow:ellipsis; overflow-wrap:normal; word-break:normal; font-size:14px; line-height:17px}
:root .ac-top:has(.mode-switch--bar) .ac-top__co--one{white-space:nowrap}
@media (max-width:359.98px){ :root .ac-top:has(.mode-switch--bar) .ac-top__co{font-size:13px; line-height:16px} }
@media screen{
/* the stage's graph paper, in white at a breath */
html:not([data-theme="classic"])[data-mode="dark"]:not([data-posts="off"]) #office .ofc-main::before{
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M.5 0V32M0 .5H32' fill='none' stroke='%23FFFFFF' stroke-opacity='.04' stroke-width='1' shape-rendering='crispEdges'/%3E%3C/svg%3E") 0 0 / 32px 32px repeat;
}
}

/* In the Office's black phone bar: at its right, after the name (mode-switch.mjs) */
.ofc-phonebar .mode-switch{margin-left:auto; margin-right:0}
