/* ============================================================
   Shared page kit v2 — "Design System v2" for every non-app page.
   Calm-dark language promoted from the approved /unreal look:
   flat bordered surfaces, color-mix tints, w600 editorial type,
   token-driven motion, per-section accent hues via data-sec.
   CONTRACT: existing class names are emitted from JS strings in
   kit.js and ~27 pages — selectors here may be restyled but NEVER
   renamed/removed (see scratchpad/contract-gate.mjs).
   Timing pairs: --dur-2 (.22s) must equal kit.js's modal-close &
   toast-out setTimeouts (220ms).
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400..800&family=JetBrains+Mono:wght@400..600&display=swap");

/* ---------- tokens ---------- */
:root, html[data-theme="dark"] {
  /* neutrals (values unchanged from v1 — theme-color metas & manifest stay valid) */
  --bg: #0a0c11; --bg-1: #11141b; --bg-2: #181c25; --bg-3: #1f2430;
  --line-soft: rgba(255,255,255,0.06);
  --line: rgba(255,255,255,0.11);
  --line-strong: rgba(255,255,255,0.20);
  --fg: #e9ecf3; --fg-1: #c6cbd6; --fg-2: #878d9a; --fg-3: #565d6a;
  /* accent — unified on the approved R1 periwinkle */
  --accent: #7c86ff; --accent-2: #9aa2ff; --accent-ink: #0b0d16;
  --ok: #4cc38a; --err: #f06363; --warn: #f0a050;
  /* scales (promoted from the R1 system) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r1: 8px; --r2: 12px; --r3: 16px; --r-full: 999px;
  --dur-1: .12s; --dur-2: .22s; --dur-3: .4s;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --elev-1: 0 4px 14px rgba(0,0,0,.18);
  --elev-2: 0 14px 40px rgba(0,0,0,.30);
  --elev-3: 0 22px 60px rgba(0,0,0,.55);
  --shadow: var(--elev-3); /* compat alias */
  --glass: color-mix(in srgb, var(--bg) 78%, transparent);
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* tint recipes — no raw accent rgba/hex outside this file */
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-wash: color-mix(in srgb, var(--accent) 9%, var(--bg-1));
  --accent-line: color-mix(in srgb, var(--accent) 30%, var(--line));
  --accent-ring: color-mix(in srgb, var(--accent) 45%, transparent);
}
html[data-theme="light"] {
  --bg: #f4f6fa; --bg-1: #ffffff; --bg-2: #eef1f6; --bg-3: #e4e8f0;
  --line-soft: rgba(15,20,40,0.07);
  --line: rgba(15,20,40,0.12);
  --line-strong: rgba(15,20,40,0.22);
  --fg: #171b26; --fg-1: #333a4a; --fg-2: #5d6575; --fg-3: #8b93a3;
  --accent: #5a61e8; --accent-2: #6f76ee; --accent-ink: #ffffff;
  --ok: #1a8f5c; --err: #d43d3d; --warn: #b06a10;
  --elev-1: 0 2px 10px rgba(30,40,80,.08);
  --elev-2: 0 10px 30px rgba(30,40,80,.12);
  --elev-3: 0 18px 50px rgba(30,40,80,.18);
}

/* ---------- per-section accent hues (single source of truth, incl. light) ---------- */
html[data-sec="hq"]                       { --accent: #4fc1dc; --accent-2: #83d6ea; --accent-ink: #06222b; }
html[data-theme="light"][data-sec="hq"]   { --accent: #0c7f9e; --accent-2: #2196b4; --accent-ink: #ffffff; }
html[data-sec="social"]                     { --accent: #e884a8; --accent-2: #f2abc4; --accent-ink: #2b0a16; }
html[data-theme="light"][data-sec="social"] { --accent: #c13d6d; --accent-2: #d2588a; --accent-ink: #ffffff; }
html[data-sec="coll"]                     { --accent: #d9b25c; --accent-2: #e8cc8a; --accent-ink: #241a05; }
html[data-theme="light"][data-sec="coll"] { --accent: #8f6a12; --accent-2: #a8842b; --accent-ink: #ffffff; }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans); color: var(--fg); background: var(--bg);
  background-image: radial-gradient(1100px 700px at 100% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
                    radial-gradient(900px 600px at -10% 110%, color-mix(in srgb, var(--accent-2) 8%, transparent), transparent 60%);
  background-attachment: fixed;
}
a { color: var(--accent); }
[hidden] { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }
.keyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
button:focus-visible, a:focus-visible, [role="button"]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- topbar (injected by Kit.topbar) ---------- */
.kit-bar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px;
  padding: 11px 20px; background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line);
}
.kit-bar .kb-home {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--fg-2);
  font-size: 13px; font-weight: 600; padding: 7px 10px; border-radius: var(--r1);
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.kit-bar .kb-home:hover { color: var(--fg); background: var(--bg-2); }
.kit-bar .kb-ic {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center; font-size: 15px;
  border-radius: var(--r1); background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.kit-bar .kb-title { font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; }
.kit-bar .kb-spacer { flex: 1; }
.kit-bar .kb-user { font-size: 12.5px; color: var(--fg-2); background: none; border: 0; cursor: pointer; font: inherit; padding: 6px 8px; border-radius: var(--r1); transition: color var(--dur-1), background var(--dur-1); }
.kit-bar .kb-user:hover { color: var(--fg); background: var(--bg-2); }

/* announcement banner (mounted by kit.js) */
.kit-announce {
  display: none; align-items: center; gap: 9px; margin: 12px 20px 0; padding: 10px 14px;
  border-radius: var(--r2); font-size: 13.5px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.kit-announce.show { display: flex; animation: k-pop var(--dur-2) var(--ease-out); }
.kit-announce button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 15px; }

/* site-wide search */
.kit-search { position: relative; }
.kit-search .ks-input { width: 190px; max-width: 40vw; height: 34px; padding: 0 12px; font: inherit; font-size: 13px; color: var(--fg); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r1); transition: width var(--dur-2) var(--ease), border-color var(--dur-1); }
.kit-search .ks-input:focus { outline: 0; border-color: color-mix(in srgb, var(--accent) 60%, transparent); width: 240px; }
.kit-search .ks-results { position: absolute; top: 40px; right: 0; width: 340px; max-width: 84vw; max-height: 60vh; overflow-y: auto; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--elev-2); padding: 6px; z-index: 60; animation: k-pop var(--dur-1) var(--ease-out); }
.ks-group { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); padding: 8px 8px 3px; }
.ks-item { display: block; padding: 7px 9px; border-radius: var(--r1); text-decoration: none; color: var(--fg); font-size: 13px; }
.ks-item:hover { background: var(--bg-2); }
.ks-item .ks-sub { display: block; font-size: 11px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ks-empty { padding: 12px; color: var(--fg-3); font-size: 13px; text-align: center; }
@media (max-width: 620px) { .kit-search { display: none; } }
.kit-main { max-width: 1280px; margin: 0 auto; padding: 26px clamp(20px, 2.4vw, 46px) 64px; }
.kit-main.wide { max-width: 1760px; }

/* ---------- buttons / inputs ---------- */
.kbtn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--fg);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r2); cursor: pointer;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-2) var(--ease);
}
.kbtn:hover { border-color: var(--accent-ring); background: color-mix(in srgb, var(--bg-3) 70%, var(--bg-2)); transform: translateY(-1px); }
.kbtn:active { transform: translateY(1px) scale(.98); }
.kbtn.primary { color: var(--accent-ink); background: var(--accent); border: 1px solid transparent; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 25%, transparent); }
.kbtn.primary:hover { background: var(--accent-2); border-color: transparent; }
.kbtn.danger { color: #fff; background: var(--err); border: 1px solid transparent; }
.kbtn.danger:hover { background: color-mix(in srgb, var(--err) 85%, #fff); border-color: transparent; }
.kbtn.ghost { background: none; border-color: transparent; color: var(--fg-2); }
.kbtn.ghost:hover { color: var(--fg); background: var(--bg-2); }
.kbtn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r1); }
.kbtn:disabled { opacity: .55; cursor: default; transform: none; }
.kinput, .ktextarea, .kselect {
  width: 100%; font: inherit; font-size: 13.5px; color: var(--fg);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.kinput:focus, .ktextarea:focus, .kselect:focus {
  outline: 0; border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}
.ktextarea { resize: vertical; min-height: 90px; }
input[type="file"].kinput { padding: 6px 8px; }
input[type="file"].kinput::file-selector-button {
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--fg);
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r1);
  padding: 5px 11px; margin-right: 10px; cursor: pointer;
  transition: border-color var(--dur-1) var(--ease);
}
input[type="file"].kinput::file-selector-button:hover { border-color: var(--accent-ring); }
.kfield { margin-bottom: 14px; }
.kfield > label { display: block; font-size: 12px; font-weight: 700; color: var(--fg-2); margin-bottom: 6px; }
.khint { font-size: 11.5px; color: var(--fg-3); margin-top: 5px; line-height: 1.45; }
.kcheck { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.kcheck input[type="checkbox"], .kcheck input[type="radio"] { accent-color: var(--accent); }

/* ---------- cards / tiles ---------- */
.kcard { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r3); padding: 18px; }
.kcard + .kcard { margin-top: 14px; }
.kcard h2 { margin: 0 0 4px; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.kcard .sub { font-size: 12.5px; color: var(--fg-3); }
.kcard-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.kcard-head .kch-t { min-width: 0; flex: 1; }
.kcard-head .kch-t h2 { margin: 0; }
.kcard-head .kch-sub { font-size: 12.5px; color: var(--fg-3); margin-top: 2px; }
.kcard-head .kch-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
a.ktile {
  display: flex; align-items: center; gap: 15px; padding: 18px; border-radius: var(--r3); text-decoration: none; color: inherit;
  background: var(--bg-1); border: 1px solid var(--line);
  transition: transform var(--dur-2) var(--ease-spring), border-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease);
}
a.ktile:hover { transform: translateY(-3px) scale(1.015); border-color: var(--accent-ring); box-shadow: var(--elev-2); }
.ktile .tic { width: 46px; height: 46px; border-radius: var(--r2); flex: none; display: grid; place-items: center; font-size: 24px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.ktile h3 { margin: 0; font-size: 15px; font-weight: 650; }
.ktile p { margin: 3px 0 0; font-size: 12.5px; color: var(--fg-2); line-height: 1.4; }
.ktile .tlock { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--fg-3); border: 1px solid var(--line); border-radius: var(--r-full); padding: 3px 8px; white-space: nowrap; }

/* ---------- grids / list rows ---------- */
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--min, 280px), 1fr)); gap: var(--s3); }
.krow { display: flex; align-items: center; gap: 11px; padding: 11px 6px; border-bottom: 1px solid var(--line); font-size: 13.5px; transition: background var(--dur-1) var(--ease); }
.krow:hover { background: color-mix(in srgb, var(--bg-2) 55%, transparent); }
.krow:last-child { border-bottom: 0; }
.krow .grow { flex: 1; min-width: 0; }
.krow .dim { color: var(--fg-3); font-size: 12px; }
.kdayhead { font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); padding: 14px 4px 6px; border-bottom: 1px solid var(--line-soft); }

/* ---------- pills / badges / stats ---------- */
.kpill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: var(--r-full); border: 1px solid var(--line);
  color: var(--fg-1); background: var(--bg-1); white-space: nowrap;
}
.kpill.sm { font-size: 10.5px; padding: 2px 8px; }
.kpill.acc  { background: color-mix(in srgb, var(--accent) 13%, transparent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); }
.kpill.ok   { background: color-mix(in srgb, var(--ok) 13%, transparent);   border-color: color-mix(in srgb, var(--ok) 35%, transparent);   color: var(--ok); }
.kpill.warn { background: color-mix(in srgb, var(--warn) 13%, transparent); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }
.kpill.err  { background: color-mix(in srgb, var(--err) 13%, transparent);  border-color: color-mix(in srgb, var(--err) 35%, transparent);  color: var(--err); }
.kpill.toggle { cursor: pointer; transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.kpill.toggle:hover { border-color: var(--accent-ring); }
.kpill.toggle.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.kbadge { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; padding: 3px 8px; border-radius: var(--r-full); border: 1px solid var(--line); color: var(--fg-2); background: var(--bg-1); }
.kstat { display: inline-flex; flex-direction: column; gap: 3px; min-width: 0; }
.kstat .ks-v { font-size: 28px; font-weight: 650; line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kstat .ks-l { font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
.kstat.sm .ks-v { font-size: 20px; }

/* ---------- toolbar / tabs ---------- */
.ktoolbar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-block: 0 var(--s4); }
.ktoolbar .kt-spacer { flex: 1; }
.ktoolbar .kinput { max-width: 220px; }
.ktabs { display: inline-flex; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-full); padding: 3px; gap: 2px; }
.ktabs button { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--fg-2); padding: 6px 14px; border-radius: var(--r-full); cursor: pointer; transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.ktabs button:hover { color: var(--fg); }
.ktabs button.on { background: var(--accent); color: var(--accent-ink); }

/* ---------- composer / empty states / skeleton ---------- */
.kcomposer { display: flex; gap: 8px; align-items: flex-start; }
.kcomposer .kinput, .kcomposer .ktextarea { flex: 1; }
.kempty { text-align: center; color: var(--fg-3); padding: 40px 10px; font-size: 13.5px; }
.kempty.rich { padding: 44px 16px; }
.kempty.rich .ke-ic { width: 52px; height: 52px; margin: 0 auto 12px; display: grid; place-items: center; font-size: 26px; border-radius: var(--r2); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.kempty.rich h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 650; color: var(--fg); }
.kempty.rich .khint { max-width: 400px; margin: 0 auto 14px; }
.kskeleton { display: flex; flex-direction: column; gap: 10px; }
.ksk-bar { height: 14px; border-radius: var(--r1); background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 42%, var(--bg-2) 60%); background-size: 300% 100%; animation: k-shimmer 1.4s var(--ease) infinite; }
.ksk-bar.xl { height: 28px; width: 55%; } .ksk-bar.lg { width: 85%; } .ksk-bar.md { width: 70%; } .ksk-bar.sm { width: 40%; }

/* ---------- modal / toast ---------- */
.koverlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(5,7,12,.66); backdrop-filter: blur(6px); opacity: 0; transition: opacity var(--dur-2) var(--ease); }
.koverlay.show { opacity: 1; }
.kmodal { width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r3); box-shadow: var(--elev-3); opacity: 0; transform: translateY(14px) scale(.96); transition: transform var(--dur-3) var(--ease-spring), opacity var(--dur-2) var(--ease); }
.koverlay.show .kmodal { opacity: 1; transform: none; }
.kmodal .kmhead { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.kmodal .kmhead h2 { margin: 0; font-size: 16px; font-weight: 650; flex: 1; }
.kmodal .kmbody { padding: 18px 20px; }
.kmodal .kmfoot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); }
.kmodal .kmfoot .left { margin-right: auto; }
.ktoasts { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.ktoast { display: flex; align-items: center; gap: 9px; max-width: 360px; padding: 11px 14px; font-size: 13px; border-radius: var(--r2); background: var(--bg-1); border: 1px solid var(--line); border-left: 3px solid var(--accent); box-shadow: var(--elev-2); animation: k-pop var(--dur-3) var(--ease-spring); }
.ktoast.ok { border-left-color: var(--ok); } .ktoast.err { border-left-color: var(--err); }
.ktoast.out { opacity: 0; transform: translateY(6px); transition: all var(--dur-2) var(--ease); }
@keyframes kt-in { from { opacity: 0; transform: translateY(8px); } } /* legacy name kept; superseded by k-pop */

/* ---------- hover preview pane (Kit.hovercard) ----------
   Grows out of the hovered element toward free screen space:
   transform-origin is set by JS to the anchored corner, so the
   pane "expands" downward/right (or up/left etc.) as appropriate. */
.khover {
  position: fixed; z-index: 150; max-width: 320px; min-width: 180px;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r2);
  box-shadow: var(--elev-2); padding: 12px 14px; pointer-events: none;
  opacity: 0; transform: scale(.9);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-3) var(--ease-out);
}
.khover.show { opacity: 1; transform: scale(1); }
.khover .kh-img { max-width: 100%; max-height: 190px; object-fit: cover; border-radius: var(--r1); margin-bottom: 9px; display: block; }
.khover .kh-t { font-weight: 650; font-size: 14px; margin-bottom: 3px; letter-spacing: -.01em; }
.khover .kh-sub { font-size: 12px; color: var(--fg-2); line-height: 1.55; overflow-wrap: anywhere; }
.khover dl { margin: 9px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12px; }
.khover dt { color: var(--fg-3); }
.khover dd { margin: 0; color: var(--fg-1); overflow-wrap: anywhere; }
.khover .kh-pills { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 9px; }

/* ---------- lightbox (Kit.lightbox) ---------- */
.klb { position: fixed; inset: 0; z-index: 220; display: grid; place-items: center; padding: 24px; background: rgba(4,6,10,.88); backdrop-filter: blur(8px); cursor: zoom-out; opacity: 0; transition: opacity var(--dur-2) var(--ease); }
.klb.show { opacity: 1; }
.klb img { max-width: 92vw; max-height: 86vh; border-radius: var(--r2); box-shadow: var(--elev-3); }
.klb .klb-cap { position: fixed; left: 0; right: 0; bottom: 18px; text-align: center; font-size: 12.5px; color: #cfd3e0; text-shadow: 0 1px 6px rgba(0,0,0,.8); pointer-events: none; }
.klb .klb-nav { position: fixed; top: 50%; transform: translateY(-50%); background: rgba(20,24,34,.7); color: #fff; border: 1px solid rgba(255,255,255,.15); border-radius: var(--r-full); width: 40px; height: 40px; font-size: 17px; cursor: pointer; display: grid; place-items: center; }
.klb .klb-prev { left: 14px; } .klb .klb-next { right: 14px; }

/* ---------- content pages / markdown ---------- */
.page-body { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r3); padding: 30px 34px; line-height: 1.7; font-size: 14.5px; }
.page-body > p, .page-body > ul, .page-body > ol, .page-body > h1, .page-body > h2, .page-body > h3, .page-body > blockquote { max-width: 70ch; }
.page-body h1 { font-size: 26px; font-weight: 600; margin: 4px 0 14px; letter-spacing: -.02em; text-wrap: balance; }
.page-body h2 { font-size: 18px; font-weight: 650; margin: 22px 0 8px; }
.page-body h3 { font-size: 15px; font-weight: 650; margin: 18px 0 6px; }
.page-body p { margin: 9px 0; color: var(--fg-1); }
.page-body ul { margin: 8px 0; padding-left: 22px; color: var(--fg-1); }
.page-body li { margin: 4px 0; }
.page-body img { max-width: 100%; border-radius: var(--r2); margin: 8px 0; }
.page-body hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.page-body code { font-family: var(--mono); background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: .92em; }
.page-body blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--accent-line); background: var(--accent-wash); border-radius: 0 var(--r1) var(--r1) 0; color: var(--fg-1); }

/* ---------- drag & drop (Kit.dnd) ---------- */
.kdragging { opacity: .4; }
.kdrop-over { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: var(--r1); }

/* ---------- motion ---------- */
@keyframes k-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes k-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes k-shimmer { from { background-position: 150% 0; } to { background-position: -150% 0; } }
.k-in { animation: k-rise var(--dur-3) var(--ease-out) backwards; }
.k-stagger > * { animation: k-rise-s .45s var(--ease-out) backwards; }
.k-stagger > *:nth-child(2) { animation-delay: 45ms; }
.k-stagger > *:nth-child(3) { animation-delay: 90ms; }
.k-stagger > *:nth-child(4) { animation-delay: 135ms; }
.k-stagger > *:nth-child(5) { animation-delay: 180ms; }
.k-stagger > *:nth-child(6) { animation-delay: 225ms; }
.k-stagger > *:nth-child(7) { animation-delay: 270ms; }
.k-stagger > *:nth-child(8) { animation-delay: 315ms; }
.k-stagger > *:nth-child(9) { animation-delay: 360ms; }
.k-stagger > *:nth-child(10) { animation-delay: 400ms; }
.k-stagger > *:nth-child(11) { animation-delay: 440ms; }
.k-stagger > *:nth-child(n+12) { animation-delay: 480ms; }

/* ---------- motion v2 (Vitality) — all opt-in, all under the reduced-motion kill-switch ---------- */
@keyframes k-rise-s { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes k-fadein { from { opacity: 0; transform: translateY(6px); } }
.k-fade { animation: k-fadein var(--dur-2) var(--ease-out); }
.k-lift { transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-2) var(--ease), border-color var(--dur-1) var(--ease); }
.k-lift:hover { transform: translateY(-3px); box-shadow: var(--elev-2); border-color: var(--accent-ring); }
@keyframes k-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.k-pulse { animation: k-pulse 1.2s ease-out 2; }
/* smooth expand/collapse: <div class="k-acc"><div class="k-acc-in">…</div></div>, toggle .open */
.k-acc { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-3) var(--ease); }
.k-acc.open { grid-template-rows: 1fr; }
.k-acc > .k-acc-in { overflow: hidden; min-height: 0; }
/* ambient hero wash — follows the page's section accent, both themes, pure CSS */
.khero-wash { position: relative; }
.khero-wash::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 180px; pointer-events: none; border-radius: inherit;
  background: radial-gradient(120% 150% at 16% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 62%); }
[data-theme="light"] .khero-wash::before { background: radial-gradient(120% 150% at 16% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 62%); }
.khero-wash > * { position: relative; }

/* ---------- curated dashboards (admin-arranged card sizes; V3) ---------- */
.kdash { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; grid-auto-flow: dense; }
.kdash > .kd-w, .kdash > .kd-b { grid-column: span 2; }
.kdash > .kd-t, .kdash > .kd-b { grid-row: span 2; }
@media (max-width: 700px) {
  /* span guard: on phones every card collapses to one column so spans can never overflow */
  .kdash > .kd-w, .kdash > .kd-b { grid-column: auto; }
  .kdash > .kd-t, .kdash > .kd-b { grid-row: auto; }
}
.kd-editing > * { position: relative; outline: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 3px; cursor: grab; }
.kd-editing > *:active { cursor: grabbing; }
.kd-ctl { position: absolute; top: 8px; right: 8px; display: flex; gap: 5px; z-index: 5; }
.kd-ctl button { font: inherit; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-full); border: 1px solid var(--line); background: var(--bg-1); color: var(--fg); cursor: pointer; box-shadow: var(--elev-1); }
.kd-ctl button:hover { border-color: var(--accent-ring); }
.kd-tray { border: 1px dashed var(--line-strong); border-radius: var(--r2); padding: 10px 12px; margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--fg-2); }
.kd-tray .kd-hiddenchip { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; border: 1px solid var(--line); border-radius: var(--r-full); padding: 4px 11px; background: var(--bg-2); color: var(--fg); cursor: pointer; }
.kd-tray .kd-hiddenchip:hover { border-color: var(--accent-ring); }

@media (max-width: 640px) { .kit-main { padding: 18px 12px 50px; } .page-body { padding: 22px 18px; } }

/* reduced motion: kill-switch for everything above (and page-local motion) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
