/*
 * TAG Legal Desk v2.1, J154 wave 2 (atl_looks): the looks on the desk (js\v21_looks.js).
 * The atmosphere canvas behind the board, your own pointer (register J169: the browser's own cursor in your colour),
 * the 20 surfaces of the Director's file (its lines 46 and 170 to 203, on the desk's tokens) and the CSS half of its
 * interface recipes (its lines 47 and 191 to 205). Personal: only the person's own screen.
 * Surfaces: each one is an OPAQUE base built from desk tokens (--atl-sf-base, --atl-sf-shade: --solid mixed with a
 * little of the theme's own colours) with texture layers of alpha .08 at most, so every word on a card keeps its
 * contrast (tests\v21_looks.test.js proves --ink at 4.5 to 1 and --ink-2 at 3 to 1 over every base, shade and worst
 * texture in Light, Dark, Eucalypt, Harbour and every Canteen and Atelier theme). Frosted Glass is today's glass and
 * sets nothing; Quiet Outline keeps the glass fill and adds the outline. Never on the email paper, the welfare zones
 * or a sheet. High contrast, forced colours and print: all off. No inline style anywhere.
 */

/* ---------- the atmosphere behind the board (PLAN 1.4) ---------- */
#v21-atl-atmos { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; display: block; }
:root[data-theme="high_contrast"] #v21-atl-atmos,
:root[data-calm="on"] #v21-atl-atmos,
:root[data-quiet="on"] #v21-atl-atmos,
:root[data-v21-welfare="on"] #v21-atl-atmos,
:root[data-day-matters] #v21-atl-atmos,
:root[data-motion="reduced"] #v21-atl-atmos { display: none; }

/* ---------- your own pointer (J169: the browser's own cursor, your shape and colour) ---------- */
/* The value is set on the root by js\v21_looks.js (style.setProperty, --personal-cursor). The pointer play's
   displaced rule (html[data-v21-pvp="displaced"], cursor: none with !important) still wins while a bump glides.
   Only #app-main and its plain controls take the value. A control in a state the desk shows with its own cursor
   (disabled, busy, checking, held, sending, away, scheduled) is left out, and so is everything inside the email
   paper, a text area, the header, the practice band and the welfare zones: those containers are set to auto and their
   insides inherit it, so the desk's own rules there (not-allowed on a fixed block, default, progress, the button
   pointer) apply as they always did. The :not() sits inside :where() so the rule stays at (1,2,0). Forced colours:
   none of it. */
@media not all and (forced-colors: active) {
  :root[data-v21-mycursor="on"] #app-main,
  :root[data-v21-mycursor="on"] #app-main :where(button, a, label, summary, select, [role="button"], [role="tab"], [role="switch"], [role="checkbox"], [role="radio"], [role="menuitem"], [role="option"], [role="slider"], input[type="checkbox"], input[type="radio"], input[type="range"], input[type="button"], input[type="submit"], .card, .card-hit):where(:not(:disabled, [aria-disabled="true"], [aria-busy="true"], .is-checking, .is-held, .is-sending, .is-away, .is-scheduled, .paper *, [contenteditable] *, #hdr *, #pband *, #wf-slot *, #wf-over-job *, #wf-layer *)) {
    cursor: var(--personal-cursor, auto);
  }
  /* The email paper, the header, the practice band and the welfare zones: the computer's own pointer, set on the
     containers only and inherited by everything inside them (inside the paper the desk's own .paper [contenteditable]
     text cursor and its fixed and read only blocks' cursors then apply). */
  :root[data-v21-mycursor="on"] #app-main :where(.paper, #hdr, #pband, #wf-slot, #wf-over-job, #wf-layer) {
    cursor: auto;
  }
  /* Text boxes, and an editable area outside the paper, keep the text cursor (they would otherwise inherit your pointer
     from #app-main). */
  :root[data-v21-mycursor="on"] #app-main :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]), textarea, [contenteditable]:not([contenteditable="false"]):not(.paper *)):where(:not(:disabled)) {
    cursor: text;
  }
}

/* ---------- surfaces (PLAN 1.5): the tokens ---------- */
:root[data-v21-surface] {
  --atl-sf-base: color-mix(in srgb, var(--solid) 90%, var(--atl-b, var(--accent)));
  --atl-sf-shade: color-mix(in srgb, var(--solid) 82%, var(--ink-3));
  --atl-sf-edge: color-mix(in srgb, var(--ink) 22%, transparent);
  --atl-sf-hl: rgb(255 255 255 / calc(var(--atl-finish, .65) * .08));
}
:root[data-v21-surface][data-atl-finish-off] { --atl-sf-hl: transparent; }

/* Every surface but Quiet Outline: an opaque base, no blur, a quiet edge. The board cards, the rail's glass, the
   header and the sideboard dock; never the email paper, a welfare zone or a sheet (none of them match). */
:root[data-v21-surface]:where(:not([data-v21-surface="quiet-outline"])) :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  background: var(--atl-sf-base);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  border-color: var(--atl-sf-edge);
}

/* ---------- surfaces: the 19 the file sells (Frosted Glass is today's glass) ---------- */
:root[data-v21-surface="smoked-glass"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  --atl-sf-base: color-mix(in srgb, var(--solid) 84%, var(--ink-3));
  background: linear-gradient(140deg, color-mix(in srgb, var(--solid) 90%, var(--ink-3)), var(--atl-sf-base));
}
:root[data-v21-surface="satin"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  background: linear-gradient(112deg, transparent 28%, var(--atl-sf-hl) 46%, transparent 62%),
    linear-gradient(117deg, var(--atl-sf-shade), var(--atl-sf-base) 23%, color-mix(in srgb, var(--atl-sf-base) 48%, var(--solid)) 42%, var(--atl-sf-base) 64%, var(--atl-sf-shade));
}
:root[data-v21-surface="porcelain"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  background: var(--atl-sf-base);
  box-shadow: inset 0 2px rgb(255 255 255 / .55), 0 5px 12px rgb(36 62 41 / .11);
}
:root[data-v21-surface="matte"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  background: var(--atl-sf-base); box-shadow: none; border-color: transparent;
}
:root[data-v21-surface="paper"] :is(#cards .card.g1, #rail .g1, .v21sb-dock) {
  background: var(--atl-sf-base); border-radius: 3px; box-shadow: 2px 3px 0 var(--atl-sf-edge);
}
:root[data-v21-surface="linen"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  background: repeating-linear-gradient(90deg, transparent 0 3px, color-mix(in srgb, var(--ink-2) 6%, transparent) 3px 4px),
    repeating-linear-gradient(0deg, transparent 0 3px, color-mix(in srgb, var(--ink-2) 5%, transparent) 3px 4px),
    var(--atl-sf-base);
}
:root[data-v21-surface="fine-mesh"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  background: radial-gradient(color-mix(in srgb, var(--ink) 8%, transparent) .55px, transparent .7px) 0 0 / 5px 5px, var(--atl-sf-base);
}
:root[data-v21-surface="carbon"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  background: repeating-linear-gradient(45deg, transparent 0 3px, rgb(0 0 0 / .07) 3px 6px), var(--atl-sf-base);
}
:root[data-v21-surface="contour"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  background: repeating-radial-gradient(ellipse at -10% 110%, transparent 0 13px, color-mix(in srgb, var(--ink) 8%, transparent) 14px 14.5px, transparent 15px 18px), var(--atl-sf-base);
}
:root[data-v21-surface="anodised"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  background: linear-gradient(125deg, color-mix(in srgb, var(--atl-b, var(--accent)) 20%, var(--atl-sf-base)), var(--atl-sf-shade) 44%, var(--atl-sf-base) 63%);
}
:root[data-v21-surface="brushed-metal"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  background: linear-gradient(112deg, transparent 28%, var(--atl-sf-hl) 46%, transparent 62%),
    repeating-linear-gradient(0deg, rgb(255 255 255 / .08) 0 1px, transparent 1px 3px),
    linear-gradient(108deg, var(--atl-sf-shade), var(--atl-sf-base) 25%, var(--solid) 48%, var(--atl-sf-shade) 69%, var(--atl-sf-base));
}
:root[data-v21-surface="pearlescent"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  background: linear-gradient(112deg, transparent 28%, var(--atl-sf-hl) 46%, transparent 62%),
    linear-gradient(115deg, color-mix(in srgb, var(--atl-sf-base) 88%, #b4c1cf), color-mix(in srgb, var(--atl-sf-base) 84%, #d5bcae) 35%, var(--solid) 49%, color-mix(in srgb, var(--atl-sf-base) 86%, #aebfc3) 72%, var(--atl-sf-base));
}
:root[data-v21-surface="prismatic-edge"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  border-color: transparent;
  background: linear-gradient(var(--atl-sf-base), var(--atl-sf-base)) padding-box,
    linear-gradient(120deg, var(--atl-a, var(--accent)), var(--atl-b, var(--accent)), var(--ink-3)) border-box;
}
:root[data-v21-surface="etched"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  background: var(--atl-sf-base); box-shadow: inset 0 0 0 5px var(--atl-sf-base), inset 0 0 0 6px var(--atl-sf-edge);
}
:root[data-v21-surface="inset"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  background: var(--atl-sf-base); box-shadow: inset 3px 3px 12px rgb(0 0 0 / .14), inset -2px -2px 6px rgb(255 255 255 / .04);
}
:root[data-v21-surface="soft-raised"] :is(#cards .card.g1, #rail .g1, .v21sb-dock) {
  background: var(--atl-sf-base); border-radius: 22px; box-shadow: 5px 7px 12px rgb(0 0 0 / .15), -2px -2px 9px rgb(255 255 255 / .04);
}
:root[data-v21-surface="soft-raised"] #hdr { background: var(--atl-sf-base); box-shadow: 0 5px 12px rgb(0 0 0 / .12); }
:root[data-v21-surface="editorial"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  background: var(--atl-sf-base); border: 0; border-top: 2px solid var(--atl-a, var(--accent)); border-bottom: 1px solid var(--atl-sf-edge); border-radius: 0; box-shadow: none;
}
:root[data-v21-surface="velvet"] :is(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) {
  background: radial-gradient(ellipse at 30% 20%, color-mix(in srgb, var(--atl-a, var(--accent)) 8%, var(--atl-sf-base)), var(--atl-sf-base) 70%);
  box-shadow: inset 0 0 22px rgb(0 0 0 / .09);
}
/* Quiet Outline keeps today's glass fill and adds the outline in the theme's colour. */
:root[data-v21-surface="quiet-outline"] :is(#cards .card.g1, #rail .g1, .v21sb-dock) {
  border: 1px solid var(--atl-a, var(--accent)); border-radius: 6px; box-shadow: none;
}
:root[data-v21-surface="quiet-outline"] #hdr { border-bottom: 1px solid var(--atl-a, var(--accent)); }

/* ---------- surfaces never hide the board's state cues ---------- */
/* A surface is a material, never a recolour. Nine surfaces set box-shadow on the cards at (1,4,0), which would beat
   the board's own cues at (0,2,0) to (0,3,0): the amber "Take a closer look" edge (desk.css .card.closer), my card's
   ring and glow and the checking card's (v21_colours.css .card.v21-mine, .card.v21-dc.is-checking) and a colleague's
   hue ring (.card.v21-hue). These come after the surfaces at (1,5,0) and (1,6,0), so the cue always shows; the
   surface's edge stays as a 1 px ring on a closer card. High contrast never has a surface (the script leaves
   data-v21-surface off), so its own solid rings in v21_colours.css are untouched. */
:root[data-v21-surface] #cards .card.g1.closer { box-shadow: inset 3px 0 0 var(--warn), 0 0 0 1px var(--atl-sf-edge); }
:root[data-v21-surface] #cards .card.g1.v21-mine,
:root[data-v21-surface] #cards .card.g1.v21-dc.is-checking {
  box-shadow: 0 0 0 2px var(--v21-mc, var(--brand)), 0 0 18px 2px color-mix(in srgb, var(--v21-mc, var(--brand)) 40%, transparent);
}
:root[data-v21-surface] #cards .card.g1.closer.v21-mine {
  box-shadow: inset 3px 0 0 var(--warn), 0 0 0 2px var(--v21-mc, var(--brand)), 0 0 18px 2px color-mix(in srgb, var(--v21-mc, var(--brand)) 40%, transparent);
}
:root[data-v21-surface] #cards .card.g1.v21-hue { box-shadow: 0 0 0 1px color-mix(in srgb, var(--v21-hc, transparent) 50%, var(--glass-rim)); }
:root[data-v21-surface] #cards .card.g1.closer.v21-hue {
  box-shadow: inset 3px 0 0 var(--warn), 0 0 0 1px color-mix(in srgb, var(--v21-hc, transparent) 50%, var(--glass-rim));
}

/* ---------- card motion (PLAN 1.9): the CSS half; js\v21_looks.js drives the rest ---------- */
:root[data-v21-recipe] #cards .card { transform-style: preserve-3d; }
:root[data-v21-recipe="tilt-card"] #cards .card, :root[data-v21-recipe="fine-tilt"] #cards .card, :root[data-v21-recipe="deep-tilt"] #cards .card,
:root[data-v21-recipe="magnetic-label"] #board-wrap button, :root[data-v21-recipe="magnetic-label"] #sheet-root .sheet button {
  transition: transform calc(.18s * (.35 + .65 * var(--atl-interface, .6))) cubic-bezier(.2,.8,.2,1);
}
:root[data-v21-recipe="parallax-inlay"] #cards .card :where(.l1, .l2) {
  transition: transform calc(.18s * (.35 + .65 * var(--atl-interface, .6))) cubic-bezier(.2,.8,.2,1); position: relative;
}
/* pointer-sheen and edge-follow: a light that follows the pointer (the file's line 47, its 191 to 194). It lies on the
   card's material and under the words: the card is its own stacking context (desk.css .card, contain: paint), so
   z-index -1 puts the light above the card's own background and below its glyph, text and side, as the my card glow
   in v21_colours.css does (at z-index 0 it painted over the words). In Dark and its Atelier themes the file's accent
   at 16 percent, at Finish 1 on Pearlescent or Brushed Metal, took --ink-2 below 3 to 1, so there the light is
   held to .6 of its strength (tests\v21_looks.test.js, the surface contrast proof, composites it in every theme). */
:root[data-v21-recipe="pointer-sheen"] #cards .card:not(.show-checking)::after,
:root[data-v21-recipe="edge-follow"] #cards .card:not(.show-checking)::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(210px at var(--atl-mx, 50%) var(--atl-my, 30%), color-mix(in srgb, var(--atl-a, var(--accent)) 16%, transparent), transparent 72%);
  opacity: var(--atl-finish, .65);
}
:root[data-theme="dark"][data-v21-recipe="pointer-sheen"] #cards .card:not(.show-checking)::after { opacity: calc(var(--atl-finish, .65) * .6); }
:root[data-v21-recipe="edge-follow"] #cards .card:not(.show-checking)::after {
  border: 1px solid transparent; padding: 1px;
  background: radial-gradient(100px at var(--atl-mx, 50%) var(--atl-my, 30%), var(--atl-a, var(--accent)), transparent 70%) border-box;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
}
/* underline-glide: the card's first line gains an underline that grows to 80 percent. */
:root[data-v21-recipe="underline-glide"] #cards .card .l1 { position: relative; }
:root[data-v21-recipe="underline-glide"] #cards .card .l1::after {
  content: ""; position: absolute; bottom: -3px; left: 0; height: 1px; width: 0; background: var(--brand-text);
  transition: width calc(.45s * (.35 + .65 * var(--atl-interface, .6))) cubic-bezier(.2,.8,.2,1);
}
:root[data-v21-recipe="underline-glide"] #cards .card:hover .l1::after,
:root[data-v21-recipe="underline-glide"] #cards .card:focus-within .l1::after { width: 80%; }
/* border-draw: the border draws itself across in .6 s. */
:root[data-v21-recipe="border-draw"] #cards .card:not(.show-checking)::after {
  content: ""; position: absolute; inset: 0; border: 1px solid var(--brand-text); border-radius: inherit; pointer-events: none;
  clip-path: inset(0 100% 0 0); transition: clip-path calc(.6s * (.35 + .65 * var(--atl-interface, .6))) cubic-bezier(.2,.8,.2,1);
}
:root[data-v21-recipe="border-draw"] #cards .card:hover::after,
:root[data-v21-recipe="border-draw"] #cards .card:focus-within::after { clip-path: inset(0 0 0 0); }
/* focus-brackets: corner brackets on focus or hover, added to the focus ring (never in place of it). */
:root[data-v21-recipe="focus-brackets"] #cards .card:not(.show-checking)::after {
  content: ""; position: absolute; inset: 6px; border: 1px solid var(--brand-text); pointer-events: none; opacity: 0;
  clip-path: polygon(0 0,20% 0,20% 3%,3% 3%,3% 25%,0 25%,0 0,100% 0,100% 25%,97% 25%,97% 3%,80% 3%,80% 0,100% 0,100% 100%,80% 100%,80% 97%,97% 97%,97% 75%,100% 75%,100% 100%,0 100%,0 75%,3% 75%,3% 97%,20% 97%,20% 100%,0 100%);
  transition: opacity calc(.2s * (.35 + .65 * var(--atl-interface, .6)));
}
:root[data-v21-recipe="focus-brackets"] #cards .card:hover::after,
:root[data-v21-recipe="focus-brackets"] #cards .card:focus-within::after { opacity: 1; }
/* metal-sweep: a light band crosses a card the moment it becomes yours (the span is added and taken away by the
   script; aria-hidden). */
.v21atl-sweep {
  position: absolute; inset: -50%; pointer-events: none; z-index: 0;
  background: linear-gradient(110deg, transparent 39%, rgb(255 255 255 / .5) 49%, transparent 60%);
  opacity: var(--atl-finish, .65); transform: translateX(-70%);
}
/* spring-tabs: the marker that springs from the old tab to the new one. */
:root[data-v21-recipe="spring-tabs"] .v21c-tabs { position: relative; }
.v21atl-tabmark { position: absolute; border-radius: 8px; background: var(--brand-soft); pointer-events: none; z-index: 0; }
/* number-arrival: the aria-hidden twin counts; the real number (read once by a screen reader) keeps its place. */
.v21atl-num-hold { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.v21atl-twin { font-variant-numeric: tabular-nums; }

/* ---------- the Settings rows: Saved looks ---------- */
.atl-saved { display: grid; gap: 8px; margin: 12px 0 0; }
.atl-saved-h { margin: 0; font-size: .9375rem; }
.atl-saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.atl-saved-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.atl-saved-n { flex: 1 1 10em; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.atl-saved-form { display: grid; gap: 6px; max-width: 360px; }
.atl-saved-form input { min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--edge-strong); background: var(--solid); color: var(--ink); }
.atl-saved [aria-disabled="true"] { opacity: .6; cursor: not-allowed; }

/* ---------- High contrast, forced colours, print: all off ---------- */
:root[data-theme="high_contrast"] :where(#cards .card, #rail .g1, #hdr, .v21sb-dock)::after { background: none; }
:root[data-theme="high_contrast"] .v21atl-sweep, :root[data-theme="high_contrast"] .v21atl-tabmark { display: none; }
@media (forced-colors: active) {
  #v21-atl-atmos, .v21atl-sweep, .v21atl-tabmark { display: none !important; }
  :root[data-v21-surface] :where(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) { background: Canvas !important; border: 1px solid CanvasText !important; box-shadow: none !important; }
  :root[data-v21-recipe] #cards .card::after { display: none !important; }
}
@media print {
  #v21-atl-atmos, .v21atl-sweep, .v21atl-tabmark, .v21atl-twin { display: none !important; }
  .v21atl-num-hold { position: static !important; width: auto; height: auto; clip: auto; }
  :root[data-v21-surface] :where(#cards .card.g1, #rail .g1, #hdr, .v21sb-dock) { background: #FFFFFF !important; box-shadow: none !important; }
  :root[data-v21-recipe] #cards .card::after { display: none !important; }
}
