/* Docket — 00-base: the Things-3-feel token contract, shell layout, the
   round completion checkbox, the toast, the magic-plus + its quick-find
   dialog. ONE light theme + ONE dark theme, chosen by prefers-color-scheme
   (no wardrobe). SF-stack typography, white/deep-gray cards, soft shadows,
   a blue accent and a yellow star, generous whitespace. */

:root {
  --bg: #f4f4f6;
  --panel: #ffffff;
  --panel-2: #fbfbfd;
  --ink: #1c1c1e;
  --ink-2: #6b6b70;
  --ink-3: #6a6a71; /* rebased 2026-07-21 (AIL r1 code-lane #10): was
    #9a9aa0, 2.80:1 on --panel — 2.37:1 on --line, the .dk-slot pill's
    own background, the worst-case surface -> 4.55:1 there. Same hue/
    sat, darker only. */
  --line: #ececee;
  --line-strong: #cfcfd4;
  --accent: #2b6cf6;
  --accent-soft: rgba(43, 108, 246, 0.12);
  --star: #ffc93c;
  --danger: #e5484d;
  --shadow-sm: 0 1px 2px rgba(20, 20, 30, 0.05), 0 1px 3px rgba(20, 20, 30, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 20, 40, 0.08), 0 1px 4px rgba(20, 20, 40, 0.06);
  --shadow-lg: 0 20px 60px rgba(15, 15, 35, 0.22);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 232px;
  --content-max: 720px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17171a;
    --panel: #232326;
    --panel-2: #2a2a2e;
    --ink: #f3f3f5;
    --ink-2: #a3a3ab;
    --ink-3: #98989e; /* rebased 2026-07-21 (AIL r2 code-lane: sol #1/fable
      F1): was #7a7a82, 3.04:1 on --line (the .dk-slot pill's own
      background, the worst-case surface among --line/--panel/--panel-2)
      -> 4.51:1 there (5.46 on --panel, 4.98 on --panel-2). Same hue,
      lighter only (a dark ground needs a LIGHTER foreground to gain
      contrast, the inverse of the light-mode rebase above). */
    --line: #313136;
    --line-strong: #45454c;
    --accent: #4b8bff;
    --accent-soft: rgba(75, 139, 255, 0.16);
    --star: #ffcf4d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

/* ---------------- app frame ---------------- */

#dk-app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

#dk-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 28px 14px;
  background: var(--panel-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.dk-wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.dk-wordmark .dk-logo {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
}

#dk-nav { display: flex; flex-direction: column; gap: 2px; }

.dk-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
  transition: background 0.14s ease;
}
.dk-nav-item:hover { background: var(--line); }
.dk-nav-item.active { background: var(--accent-soft); color: var(--accent); }
.dk-nav-glyph { width: 18px; text-align: center; color: var(--ink-3); font-size: 15px; }
.dk-nav-item.active .dk-nav-glyph { color: var(--accent); }
.dk-nav-item:first-child .dk-nav-glyph { color: var(--star); }

/* ---------------- main column ---------------- */

#dk-main {
  min-width: 0;
  display: flex;
  justify-content: center;
  padding: 40px 32px 120px;
}
#dk-view {
  width: 100%;
  max-width: var(--content-max);
}

.dk-viewhead { margin: 0 0 22px; }
.dk-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.dk-sub { margin: 5px 0 0; color: var(--ink-2); font-size: 14px; }

/* ---------------- list + rows ---------------- */

.dk-list { display: flex; flex-direction: column; }

.dk-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.14s ease;
}
.dk-row:hover { background: var(--panel); box-shadow: var(--shadow-sm); }

.dk-row-open {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: var(--radius-sm);
}
/* opus r1 F11: the atom-title link used the browser-default outline
   (auto 1px) while every other interactive control in the shell
   (.dk-check, #dk-plus, .dk-swatch, ...) carries the branded ring. */
.dk-row-open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.dk-row-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dk-row.is-done .dk-row-title { color: var(--ink-3); text-decoration: line-through; }
.dk-row-sub {
  font-size: 13px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dk-star { color: var(--star); }

.dk-slot {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  background: var(--line);
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.dk-row-x {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 6px;
  line-height: 1;
}
.dk-row-x:hover { background: var(--line); color: var(--ink); }

/* ---------------- the round completion checkbox ---------------- */

.dk-check {
  position: relative; /* anchors the coarse-pointer hit-slop below */
  flex: none;
  width: 22px; height: 22px;
  border: 1.75px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.1s ease;
}
.dk-check:hover { border-color: var(--accent); }
.dk-check:active { transform: scale(0.9); }
.dk-check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dk-check.done { background: var(--accent); border-color: var(--accent); }
/* finding #11: the round completion checkbox is the planner's most
   repeated action but was exactly 22x22px with no slop. Keep the drawn
   circle at 22px; expand the CLICKABLE area to 44x44 via an invisible
   ::after, per the finding's own suggested fix ("keep the drawn circle
   at 22px inside a 44x44 button box").
   AIL r2 (fable-render fresh finding, adjudication #4): the previous
   `@media (pointer: coarse)` gate left the TRUE (query-independent)
   target at 22x22 — unconditional now, so the region is a real 44x44
   regardless of how pointer type is detected. Geometry re-checked for
   overlap: .dk-check is 22px wide, .dk-row's flex gap to .dk-row-open
   is 12px, so .dk-row-open starts at x=34 from the check's left edge;
   the 44x44 slop is centered on the check's own center (x=11) and
   therefore ends at x=33 — 1px of clearance, no overlap. */
.dk-check::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}

.dk-check-tick {
  width: 13px; height: 13px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}
.dk-check.done .dk-check-tick { opacity: 1; }

.dk-check-tick path {
  stroke-dasharray: 20;
  stroke-dashoffset: 0;
}
.dk-check.just-checked .dk-check-tick path {
  animation: dk-draw 0.28s ease forwards;
}
@keyframes dk-draw {
  from { stroke-dashoffset: 20; }
  to { stroke-dashoffset: 0; }
}

/* Things-like: a just-checked Today row collapses out of the list */
.dk-row.checked-out {
  animation: dk-collapse 0.42s ease 0.5s forwards;
  overflow: hidden;
}
@keyframes dk-collapse {
  to { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dk-check, .dk-check:active, .dk-row { transition: none; }
  .dk-check.just-checked .dk-check-tick path { animation: none; }
  .dk-row.checked-out { animation: none; }
}

/* ---------------- empty states ---------------- */

.dk-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-2);
}
.dk-empty-title { font-size: 17px; font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.dk-empty a { color: var(--accent); }
.dk-inline-plus, .dk-empty .dk-inline-plus {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700;
  vertical-align: middle;
}

/* ---------------- the floating magic-plus ---------------- */

#dk-plus {
  position: fixed;
  right: 28px; bottom: 28px;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: grid; place-items: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  z-index: 40;
}
#dk-plus:hover { transform: translateY(-2px) scale(1.04); }
#dk-plus:active { transform: scale(0.94); }
#dk-plus:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  #dk-plus { transition: none; }
}

/* ---------------- quick-find dialog ---------------- */

#dk-quickfind[hidden] { display: none; }
.qf-scrim {
  position: fixed; inset: 0;
  background: rgba(10, 10, 20, 0.34);
  backdrop-filter: blur(2px);
  z-index: 50;
}
.qf-panel {
  position: fixed;
  z-index: 51;
  left: 50%; top: 14vh;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px));
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.qf-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.qf-glyph {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; flex: none;
}
#qf-input {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  outline: none;
  min-width: 0;
}
.qf-close {
  flex: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
#qf-results { overflow-y: auto; padding: 8px; }
.qf-empty { padding: 22px; text-align: center; color: var(--ink-2); }

.qf-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink);
}
.qf-item[aria-selected="true"], .qf-item:hover { background: var(--accent-soft); }
.qf-plus {
  flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  color: var(--ink-3);
  display: grid; place-items: center; font-weight: 700;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.qf-item.added .qf-plus { background: var(--accent); border-color: var(--accent); color: #fff; }
.qf-item-main { min-width: 0; display: flex; flex-direction: column; }
.qf-item-title {
  font-size: 15px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qf-item-title mark { background: var(--star); color: #1c1c1e; border-radius: 3px; padding: 0 1px; }
.qf-item-sub { font-size: 12px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qf-item.just-added { animation: dk-pop 0.3s ease; }
@keyframes dk-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.015); background: var(--accent-soft); }
  100% { transform: scale(1); }
}
.qf-foot {
  display: flex; gap: 16px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12px;
}
@media (prefers-reduced-motion: reduce) {
  .qf-item.just-added { animation: none; }
  .qf-scrim { backdrop-filter: none; }
}

/* ---------------- toast ---------------- */

.dk-toast {
  position: fixed;
  left: 50%; bottom: 34px;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
}
.dk-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { .dk-toast { transition: opacity 0.2s ease; } }

/* ---------------- mobile bottom dock ---------------- */

#dk-dock { display: none; }

@media (max-width: 720px) {
  #dk-app { grid-template-columns: 1fr; }
  #dk-sidebar { display: none; }
  #dk-main { padding: 24px 16px 108px; }
  .dk-title { font-size: 26px; }

  /* F10 / stills Major: mobile task titles were truncating aggressively
     (~30 chars) beside the persistent right-hand .dk-slot pill / .dk-row-x
     remove control. Allow the title 2 lines, and push whichever trailing
     control is present onto its own row (indented under the title, past
     the checkbox) instead of squeezing it to one line's width. */
  .dk-row-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .dk-row { flex-wrap: wrap; align-items: flex-start; }
  .dk-row > .dk-slot,
  .dk-row > .dk-row-x {
    /* AIL r2 (sol #4/#4 regression): flex-basis:100% PLUS margin-left:34px
       made the outer flex size 100% + 34px, overflowing the row. The
       basis must already subtract the indent so basis + margin sums to
       exactly 100% of the row's content box (flex-wrap still forces this
       item onto its own line, same as before, since 100% - 34px is still
       wider than any remaining space on the title's line). */
    flex: 0 0 calc(100% - 34px);
    margin-left: 34px; /* checkbox width (22px) + row gap (12px) */
    margin-top: 2px;
  }

  #dk-dock {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    z-index: 30;
  }
  .dk-dock-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 7px 2px;
    color: var(--ink-2);
    font-size: 11px;
    font-weight: 500;
    border-radius: 8px;
  }
  .dk-dock-item.active { color: var(--accent); }
  .dk-dock-item:first-child .dk-nav-glyph { color: var(--star); }
  .dk-dock-item.active .dk-nav-glyph { color: var(--accent); }
  .dk-dock-glyph, .dk-dock-item .dk-nav-glyph { font-size: 17px; }
  #dk-plus { right: 18px; bottom: 78px; width: 52px; height: 52px; }
}

/* Docket — 05-themes: the THEME WARDROBE (5 packs over the default) and the
   sidebar-footer Appearance picker. Loads AFTER 00-base (globbed 05- sorts
   between 00- and 10-), so a pack's token overrides win the equal-specificity
   tie against the :root / prefers-color-scheme defaults purely by source order.

   Mechanism: documentElement carries data-dk-theme, stamped at boot from the
   DEVICE-LOCAL localStorage key wv:dk:theme (Store: "dk:theme"). That key is
   deliberately ABSENT from DK_SYNC_KEYS (70-sync.js) — the theme is per-device,
   never a synced preference, never in a PUT body. Default when unset is
   "things": the ONE id with NO block here on purpose, so data-dk-theme="things"
   matches nothing and the original light+dark :root wardrobe stays byte-for-byte
   intact (the pixel-parity contract, like tenet's "standard" skin).

   terminal + midnight are dark in BOTH OS modes (color-scheme: dark, no media
   gate). sunset / forest / plum ship a light base block PLUS a coherent
   prefers-color-scheme: dark counterpart. Body ink stays at or above 4.5:1 on
   its ground and accent-as-text stays at or above 4.5:1 on white in every
   light variant (sunset's accent was darkened from the brief hex to clear it —
   see the note on that pack). */

/* ---------------- terminal — green on black (dark in both modes) ---------- */

[data-dk-theme="terminal"] {
  color-scheme: dark;
  --bg: #0a0d0a;
  --panel: #121712;
  --panel-2: #171c17;
  --ink: #eef5ee;
  --ink-2: #9aa89b;
  --ink-3: #808e81; /* rebased 2026-07-21 (AIL r2 gate sweep): was
    #7f8d80, 4.455:1 on --line (worst-case surface, just under the
    4.5:1 floor) -> 4.51:1. Same hue, lighter only. */
  --line: #1e261f;
  --line-strong: #2b352c;
  --accent: #26d95f;
  --accent-soft: rgba(38, 217, 95, 0.16);
  --star: #ffd34d;
  --danger: #ff6b6b;
}

/* ---------------- midnight — GitHub-dim blue (dark in both modes) ---------- */

[data-dk-theme="midnight"] {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c2129;
  --ink: #eef2f7;
  --ink-2: #9aa4b2;
  --ink-3: #86909d; /* rebased 2026-07-21 (AIL r2 sol Major #1 / fable F1):
    was #6b7583, 3.14:1 on --line (worst-case surface) -> 4.53:1. Same
    hue, lighter only. */
  --line: #222933;
  --line-strong: #313b48;
  --accent: #58a6ff;
  --accent-soft: rgba(88, 166, 255, 0.16);
  --star: #ffcf4d;
  --danger: #ff6b6b;
}

/* ---------------- sunset — warm paper + burnt orange ----------------
   NOTE: the brief's accent #e0662b resolves to ~3.2:1 as TEXT on white, below
   the 4.5:1 body-text floor (Docket uses --accent as nav-active + link text).
   The light accent is darkened to #b8501c (~5.0:1 on white, ~4.7:1 on the warm
   ground); the dark counterpart lightens the same family to #f5854a. */

[data-dk-theme="sunset"] {
  --bg: #faf6f1;
  --panel: #ffffff;
  --panel-2: #fbf6f0;
  --ink: #241d18;
  --ink-2: #6e5f54;
  --ink-3: #766559; /* rebased 2026-07-21 (AIL r1 #10): was #9c8a7c, 2.68:1 on
    --line (the .dk-slot pill's own background — the worst-case surface) ->
    4.51:1. Same hue/sat, darker only. */
  --line: #efe6db;
  --line-strong: #ddcdbd;
  --accent: #b8501c;
  --accent-soft: rgba(184, 80, 28, 0.12);
  --star: #f0b429;
  --danger: #d3402f;
}
@media (prefers-color-scheme: dark) {
  [data-dk-theme="sunset"] {
    color-scheme: dark;
    --bg: #1a1512;
    --panel: #221c17;
    --panel-2: #2a2219;
    --ink: #f6ede4;
    --ink-2: #b7a595;
    --ink-3: #9a8978; /* rebased 2026-07-21 (AIL r2 sol Major #1 / fable
      F1): was #8a7867, 3.61:1 on --line (worst-case surface) -> 4.53:1.
      Same hue, lighter only. */
    --line: #2c2419;
    --line-strong: #3d3225;
    --accent: #f5854a;
    --accent-soft: rgba(245, 133, 74, 0.18);
    --star: #f0b429;
    --danger: #ff6b6b;
  }
}

/* ---------------- forest — sage paper + pine green ---------------- */

[data-dk-theme="forest"] {
  --bg: #f1f5f1;
  --panel: #ffffff;
  --panel-2: #f6faf6;
  --ink: #18211b;
  --ink-2: #566459;
  --ink-3: #5f6c62; /* rebased 2026-07-21 (AIL r1 #10): was #8b998e, 2.46:1 on
    --line (worst-case surface) -> 4.54:1. Same hue/sat, darker only. */
  --line: #e4ebe4;
  --line-strong: #cdd8cf;
  --accent: #2e7d4f;
  --accent-soft: rgba(46, 125, 79, 0.12);
  --star: #e8a90c;
  --danger: #d3402f;
}
@media (prefers-color-scheme: dark) {
  [data-dk-theme="forest"] {
    color-scheme: dark;
    --bg: #121712;
    --panel: #19201a;
    --panel-2: #1f271f;
    --ink: #eaf1ea;
    --ink-2: #94a596;
    --ink-3: #859582; /* rebased 2026-07-21 (AIL r2 sol Major #1 / fable
      F1): was #72836f, 3.57:1 on --line (worst-case surface) -> 4.55:1.
      Same hue, lighter only. */
    --line: #232c23;
    --line-strong: #33402f;
    --accent: #3fa36b;
    --accent-soft: rgba(63, 163, 107, 0.16);
    --star: #e8b53c;
    --danger: #ff6b6b;
  }
}

/* ---------------- plum — lilac paper + violet ---------------- */

[data-dk-theme="plum"] {
  --bg: #f7f5fa;
  --panel: #ffffff;
  --panel-2: #f8f5fb;
  --ink: #1e1826;
  --ink-2: #665a73;
  --ink-3: #6f657c; /* rebased 2026-07-21 (AIL r1 #10): was #948aa0, 2.70:1 on
    --line (worst-case surface) -> 4.51:1. Same hue/sat, darker only. */
  --line: #ece7f2;
  --line-strong: #d7cee3;
  --accent: #7842dc; /* rebased 2026-07-21 (AIL r3 lane G, fable-render
    finding #1): was #8250df. .dk-nav-item.active pairs this against
    --accent-soft (below) composited over the sidebar's own ground
    (--panel-2) — that composite was 4.00:1, under the small-text AA
    floor (the r2 wardrobe rebase only ever touched --ink-3 x line/panel
    pairs, never this accent-on-tint pair). Same hue, darker only ->
    4.56:1 on the same composite. --accent-soft's rgb channels moved with
    it so the nav tint and the active-item text stay the same hue. */
  --accent-soft: rgba(120, 66, 220, 0.12);
  --star: #f2b83e;
  --danger: #d3402f;
}
@media (prefers-color-scheme: dark) {
  [data-dk-theme="plum"] {
    color-scheme: dark;
    --bg: #151020;
    --panel: #1d1729;
    --panel-2: #241d33;
    --ink: #f3eefb;
    --ink-2: #a99ab9;
    --ink-3: #91859e; /* rebased 2026-07-21 (AIL r2 sol Major #1 / fable
      F1): was #7d6f8c, 3.37:1 on --line (worst-case surface) -> 4.51:1.
      Same hue, lighter only. */
    --line: #281f38;
    --line-strong: #392e4d;
    --accent: #9d7bea;
    --accent-soft: rgba(157, 123, 234, 0.18);
    --star: #f2c04e;
    --danger: #ff6b6b;
  }
}

/* "things" has NO block on purpose — data-dk-theme="things" matches nothing and
   the original light+dark :root wardrobe stays exactly as-is. */

/* ==========================================================================
   The Appearance picker — a sidebar-footer row opening a swatch sheet.
   ========================================================================== */

.dk-sidebar-foot { margin-top: auto; }

.dk-appearance {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease;
}
.dk-appearance:hover { background: var(--line); }
.dk-appearance:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dk-appearance-glyph { width: 18px; text-align: center; color: var(--ink-3); font-size: 15px; }
.dk-appearance-name { flex: 1; min-width: 0; }
.dk-appearance-dot {
  flex: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid var(--line-strong);
}

#dk-theme-pop[hidden] { display: none; }
#dk-theme-pop { position: fixed; inset: 0; z-index: 55; }
.dk-theme-scrim { position: fixed; inset: 0; background: rgba(10, 10, 20, 0.34); }
.dk-theme-sheet {
  position: fixed;
  left: 14px;
  bottom: 20px;
  z-index: 56;
  width: min(260px, calc(100vw - 28px));
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}
.dk-theme-title {
  margin: 4px 8px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.dk-swatch {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.dk-swatch:hover { background: var(--panel-2); }
.dk-swatch[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.dk-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dk-swatch-dot {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
}
.dk-swatch-name { flex: 1; min-width: 0; }
.dk-swatch-check { flex: none; color: var(--accent); opacity: 0; font-size: 14px; }
.dk-swatch[aria-pressed="true"] .dk-swatch-check { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .dk-appearance { transition: none; }
}

/* Docket — 10-views: per-view styling. Projects (progress pie + step
   checklist), Logbook (day groups), and the minimal reader pane. */

/* ---------------- progress pie (Projects) ---------------- */

.dk-pie {
  width: 34px; height: 34px;
  flex: none;
  transform: rotate(-90deg);
}
.dk-pie-track {
  fill: none;
  stroke: var(--line);
  stroke-width: 3;
}
.dk-pie-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s ease;
}
.dk-pie.full .dk-pie-fill { stroke: var(--star); }
@media (prefers-reduced-motion: reduce) { .dk-pie-fill { transition: none; } }

/* ---------------- Projects ---------------- */

.dk-projects { display: flex; flex-direction: column; gap: 20px; }

.dk-project {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 16px;
}
.dk-project-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.dk-project-heading { min-width: 0; }
.dk-project-title { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.dk-project-sub { margin: 3px 0 0; font-size: 13px; color: var(--ink-2); }

.dk-project-steps { border-top: 1px solid var(--line); padding-top: 6px; }

.dk-step-note { color: var(--ink-2); }
.dk-step-diamond {
  flex: none;
  width: 22px; text-align: center;
  color: var(--ink-3);
  font-size: 12px;
}
.dk-step-note .dk-row-sub { text-transform: capitalize; }

/* ---------------- Today slot rows ---------------- */

#dk-today-list .dk-row { border-bottom: 1px solid var(--line); border-radius: 0; }
#dk-today-list .dk-row:last-child { border-bottom: 0; }
#dk-today-list .dk-row:hover { border-radius: var(--radius-sm); }

/* ---------------- Anytime ---------------- */

#dk-anytime-list .dk-row { border-bottom: 1px solid var(--line); border-radius: 0; }
#dk-anytime-list .dk-row:last-child { border-bottom: 0; }

/* ---------------- Logbook ---------------- */

.dk-logbook { display: flex; flex-direction: column; gap: 24px; }
.dk-logday-label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dk-logday-count {
  font-weight: 600;
  color: var(--ink-3);
  background: var(--line);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11px;
}
.dk-logday .dk-row { opacity: 0.9; }
.dk-logday .dk-check { pointer-events: auto; }

/* ---------------- minimal reader ---------------- */

.dk-reader {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px 28px 30px;
}
.dk-back {
  display: inline-block;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 14px;
}
.dk-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 10px;
}
.dk-byline a { color: var(--accent); }
.dk-sep { color: var(--ink-3); }
.dk-headline {
  margin: 0 0 14px;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.dk-conns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.dk-conn {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  max-width: 100%;
}
.dk-conn:hover { border-color: var(--accent); }
.dk-conn.dead { opacity: 0.6; }
.dk-conn-type { color: var(--ink-3); text-transform: uppercase; font-weight: 600; font-size: 10px; }
.dk-conn-title {
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px;
}

.dk-reader-body { font-size: 16.5px; line-height: 1.68; color: var(--ink); }
.dk-reader-body h2, .dk-reader-body h3, .dk-reader-body h4 {
  font-weight: 650; letter-spacing: -0.01em; margin: 1.4em 0 0.4em;
}
.dk-reader-body h2 { font-size: 18px; }
.dk-reader-body h3 { font-size: 16px; }
.dk-reader-body p { margin: 0 0 1em; }
.dk-reader-body ul, .dk-reader-body ol { margin: 0 0 1em; padding-left: 1.3em; }
.dk-reader-body li { margin: 0.25em 0; }
.dk-reader-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.dk-reader-body code {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.9em;
}
.dk-reader-body blockquote {
  margin: 1em 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--line-strong);
  color: var(--ink-2);
}
.dk-reader-body .wl { color: var(--accent); }
.dk-reader-body .wl-dead { color: var(--ink-3); }

.dk-reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.dk-act {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  border-radius: 22px;
  padding: 8px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.dk-act:hover { border-color: var(--accent); }
.dk-act.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.dk-act-check.on { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-reduced-motion: reduce) { .dk-act { transition: none; } }

@media (max-width: 720px) {
  .dk-reader { padding: 18px 16px 24px; }
  .dk-headline { font-size: 22px; }
  .dk-reader-body { font-size: 16px; }
}
