/* ===== Atölye: the poi app's one world (tokens from DESIGN.md; dark only, no accent colour) ===== */
:root {
  --bg: #0f1012; --panel: #16171a; --raise: #1d1f23; --field: #0c0d0f; --vp: #0a0b0c; --line: #24262b; --line2: #30333a;
  --fg: #e6e5e0; --on-fg: #111214; --mut: #9a9ba1; --faint: #7b7d84; --sel: #34363d; --off: #60626a;
  --L: #4fa3e3; --R: #e3934f; --warn: #e3b34f; --bad: #ef6b5f; --ok: #6bbf8e;
  --ui: "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", "Noto Sans", Roboto, sans-serif;
  --num: "JetBrains Mono", "JetBrainsMono Nerd Font", "SF Mono", "Cascadia Mono", ui-monospace, monospace;
  color-scheme: dark;
  scrollbar-color: var(--line2) var(--bg);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.6 var(--ui); -webkit-font-smoothing: antialiased; }
::selection { background: var(--sel); color: var(--fg); }
input, textarea { caret-color: var(--fg); }
a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--fg); }
:focus-visible { outline: 1.5px solid var(--fg); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
svg { flex: none; }
.n, .num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.n { font-size: .86em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--mut); }
.small { font-size: 12.5px; }
.desc { white-space: pre-wrap; }

/* ---------- type ---------- */
h1 { font-size: 30px; font-weight: 680; line-height: 1.15; letter-spacing: -.018em; margin: 4px 0 10px; text-wrap: balance; }
h2 { font-size: 21px; font-weight: 650; line-height: 1.25; letter-spacing: -.01em; margin: 40px 0 12px; text-wrap: balance; }
h3 { font-size: 15px; font-weight: 650; line-height: 1.35; margin: 0 0 6px; }
p { text-wrap: pretty; }
main { max-width: 1080px; margin: 0 auto; padding: 24px 32px 96px; }

/* ---------- top bar ---------- */
#top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px 0 8px; padding-top: env(safe-area-inset-top); background: var(--panel); border-bottom: 1px solid var(--line); }
#top a { text-decoration: none; }
#pt-home, #home { display: inline-flex; align-items: center; min-height: 30px; padding: 0 3px; border-radius: 5px; font-size: 14px; font-weight: 700; letter-spacing: -.005em; color: var(--fg); white-space: nowrap; }
#pt-home { padding-left: 6px; }
#pt-home:hover, #home:hover { background: var(--raise); }
#top .crumb { color: var(--faint); font-size: 14px; }
.top-sep { flex: none; width: 1px; height: 20px; margin: 0 6px; background: var(--line2); }
#nav { display: flex; gap: 2px; }
.navbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 6px; color: var(--mut); font-size: 13px; white-space: nowrap; }
.navbtn:hover, .navbtn[aria-current="page"] { background: var(--raise); color: var(--fg); }
.navbtn .n { font-size: 11px; color: var(--warn); }
.top-spacer { flex: 1; min-width: 8px; }
.top-find { position: relative; flex: 0 1 240px; min-width: 150px; margin-right: 4px; }
.top-find svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
#q { width: 100%; height: 30px; padding: 0 10px 0 30px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); color: var(--fg); font: 13.5px var(--ui); }
#q::placeholder { color: var(--faint); }
#q:focus { outline: none; border-color: var(--mut); }
#find-btn { display: none; }
#unlock, #lang-btn, #find-btn { align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 6px; background: var(--raise); color: var(--fg); font: 13px var(--ui); cursor: pointer; white-space: nowrap; }
#unlock { display: inline-flex; color: var(--mut); }
#unlock:hover, #lang-btn:hover, #find-btn:hover { background: var(--sel); color: var(--fg); }
#lang-btn { display: inline-flex; height: 28px; min-width: 36px; padding: 0 9px; font-weight: 650; font-size: 12px; }
@media (max-width: 1080px) { .top-find { flex-basis: 190px; } }
@media (max-width: 960px) { #top .opt { display: none; } #unlock .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } #unlock { padding: 0; width: 32px; } }
@media (max-width: 760px) {
  #top { position: relative; flex-wrap: wrap; padding: 0 8px; padding-top: env(safe-area-inset-top); }
  #pt-home, #home { min-height: 46px; font-size: 15px; }
  .top-sep { display: none; }
  #find-btn { display: inline-flex; padding: 0; }
  #find-btn[aria-expanded="true"] { background: var(--sel); }
  #find-btn, #unlock, #lang-btn { width: 40px; height: 40px; min-width: 40px; }
  #adm { height: 40px; }
  .top-find { display: none; order: 25; flex: 1 0 100%; margin: 0 0 8px; }
  #top.searching .top-find { display: block; }
  #q { height: 40px; font-size: 16px; }
  #nav { order: 20; flex: 1 0 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; margin: 0 -2px; padding: 0 0 4px; }
  #top.searching #nav { padding-bottom: 6px; }
  #nav .navbtn { height: 40px; padding: 0 2px; font-size: 13.5px; }
}

/* ---------- feedback button + modal ---------- */
#fb-fab { position: fixed; right: 16px; bottom: 16px; z-index: 15; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 6px; background: rgba(22, 23, 26, .94); color: var(--mut); font: 13px var(--ui); cursor: pointer; }
#fb-fab:hover { background: var(--raise); color: var(--fg); }
body[data-page="edit"] #fb-fab, body[data-page="admin"] #fb-fab { display: none; }
@media (max-width: 620px) { #fb-fab { position: static; display: flex; margin: 0 auto 32px; height: 40px; padding: 0 16px; } }
.fb-backdrop { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 11, 12, .78); }
.fb-modal { width: 100%; max-width: 520px; max-height: calc(100dvh - 32px); overflow: auto; padding: 18px 20px 20px; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; }
.fb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fb-head h2 { margin: 0; font-size: 18px; }
.fb-sub { margin: 4px 0 0; font-size: 14px; color: var(--mut); }
.fb-lbl { display: block; margin: 16px 0 6px; font-size: 12.5px; color: var(--mut); }
.fb-modal textarea, .fb-modal input[type=text] { width: 100%; }
.fb-modal textarea { min-height: 110px; }
.fb-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.fb-ctx { margin: 0; font-size: 14px; }
@media (max-width: 620px) {
  .fb-backdrop { align-items: flex-end; padding: 8px; }
  .fb-modal { padding: 16px 16px max(16px, env(safe-area-inset-bottom)); max-height: calc(100dvh - 16px); }
  .fb-modal .seg { display: grid; grid-template-columns: 1fr 1fr; }
  .fb-modal .seg > button { height: auto; min-height: 40px; padding: 6px 8px; white-space: normal; line-height: 1.25; }
}

/* ---------- controls ---------- */
:where(button:not(.atl button), .btn) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 6px; background: var(--raise); color: var(--fg); font: 500 13px/1.2 var(--ui); text-decoration: none; white-space: nowrap; cursor: pointer; }
:where(button:not(.atl button), .btn):hover { background: var(--sel); }
:where(button:not(.atl button), .btn):where(.primary) { background: var(--fg); border-color: var(--fg); color: var(--on-fg); font-weight: 600; }
:where(button:not(.atl button), .btn):where(.primary):hover { background: #fff; }
:where(button:not(.atl button), .btn):where(.danger) { color: var(--bad); }
:where(button:not(.atl button)):disabled { opacity: .5; cursor: default; }
a.btn { color: var(--fg); text-decoration: none; }
a.btn.primary { color: var(--on-fg); }
.icon-btn { width: 32px; padding: 0 !important; }
.tog { height: 32px; padding: 0 12px; color: var(--mut); background: transparent; }
.tog[aria-pressed="true"] { background: var(--sel); color: var(--fg); }
.segw { display: flex; align-items: center; gap: 8px; }
.segl { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; background: var(--field); border: 1px solid var(--line); border-radius: 6px; }
.seg > button { height: 28px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--mut); font: 12.5px var(--ui); }
.seg > button:hover { background: transparent; color: var(--fg); }
.seg > button[aria-pressed="true"] { background: var(--sel); color: var(--fg); box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset; }
.seg > button .n { margin-left: 2px; font-size: 11px; color: var(--faint); }
.seg > button[aria-pressed="true"] .n { color: var(--mut); }
.selw { display: inline-flex; align-items: center; gap: 8px; }
:where(input[type=text], input[type=url], input[type=number], input[type=search], select, textarea) { height: 34px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); color: var(--fg); font: 14px/1.4 var(--ui); }
:where(input[type=text], input[type=url], input[type=number], input[type=search], select, textarea):focus { outline: none; border-color: var(--mut); }
:where(select) { appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%239a9ba1' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 10px; }
:where(textarea) { height: auto; min-height: 90px; padding: 8px 10px; line-height: 1.5; resize: vertical; }
::placeholder { color: var(--faint); opacity: 1; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--fg); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; margin: 0; }
input[type=color] { width: 40px; height: 32px; padding: 2px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); cursor: pointer; }
form label, .form label { display: block; margin: 14px 0 6px; font-size: 12.5px; color: var(--mut); }
form label a, .form label a { color: var(--mut); }
:is(form, .form) :where(input[type=text], input[type=url], input[type=number], input[type=search], select, textarea) { width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.row > * { flex: 1; min-width: 120px; }
.row > button, .row > .btn { flex: 0 0 auto; min-width: 0; }
.chk { display: flex !important; align-items: center; gap: 8px; margin: 10px 0 !important; color: var(--fg) !important; font-size: 14px !important; }
.hint { margin: 4px 0 0; font-size: 12.5px; color: var(--faint); }
.err { margin: 8px 0; color: var(--bad); font-size: 14px; white-space: pre-wrap; }
.err:empty { display: none; }
@media (max-width: 620px) {
  :where(button:not(.atl button), .btn) { min-height: 40px; height: auto; }
  .icon-btn { width: 40px; }
  input[type=color] { height: 40px; width: 48px; }
  .mv .mv-editbar .btn, .mv .mv-editbar button { height: 40px; }
  .tog { min-height: 40px; }
  .segw { flex-direction: column; align-items: stretch; gap: 4px; width: 100%; }
  .seg { display: flex; }
  .seg > button { flex: 1 1 auto; height: 40px; padding: 0 8px; font-size: 13.5px; }
  :where(input[type=text], input[type=url], input[type=number], input[type=search], select) { height: 40px; font-size: 16px; }
  :where(textarea) { font-size: 16px; }
  .selw { width: 100%; } .selw select { flex: 1; }
}

/* ---------- chips, swatches, state ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; line-height: 18px; padding: 0 7px; border: 1px solid var(--line2); border-radius: 4px; color: var(--mut); background: transparent; white-space: nowrap; text-decoration: none; vertical-align: middle; }
.chip.approved, .chip.verified, .chip.ok { color: var(--ok); border-color: rgba(107, 191, 142, .5); }
.chip.draft, .chip.warn { color: var(--warn); border-color: rgba(227, 179, 79, .5); }
.chip.bad { color: var(--bad); border-color: rgba(239, 107, 95, .5); }
.chip.unverified, .chip.inh { border-style: dashed; }
.chip .n { color: var(--faint); font-size: 10.5px; }
a.chip:hover { color: var(--fg); border-color: var(--mut); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.sw { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 3px; }
.fam-l { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- page frame ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0 0 6px; }
.crumbs .sep { color: var(--faint); font-size: 13px; }
a.back { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 8px; margin-left: -5px; border-radius: 5px; font-size: 13px; color: var(--mut); text-decoration: none; }
a.back:hover { background: var(--raise); color: var(--fg); }
.crumbs a.back + .sep + a.back { margin-left: 0; }
.ph { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; align-items: start; }
.ph > :not(.edbtns) { grid-column: 1; }
.ph > .edbtns { grid-column: 2; grid-row: 1 / span 3; align-self: center; display: flex; gap: 8px; }
.ph h1 { margin-bottom: 8px; }
.ph h1 + .ph-meta { margin-bottom: 4px; }
.ph h1.fam-h { display: flex; align-items: center; gap: 12px; }
.ph h1.fam-h .sw { width: 14px; height: 14px; border-radius: 4px; }
.ph-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0; font-size: 13.5px; color: var(--mut); }
.ph-meta .n { color: var(--fg); font-size: 12.5px; }
.lede { margin: 0 0 12px; max-width: 62ch; font-size: 17px; line-height: 1.55; color: var(--fg); }
.prose { max-width: 70ch; }
.prose p { margin: 0 0 14px; }
.doc { max-width: 820px; }
body[data-page="theory"] main, body[data-page="start"] main, body[data-page="doc"] main { max-width: 884px; }
.sec { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
.sec > h2, .sec-h { margin: 0 0 14px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sec-h .cnt, .cnt { font-family: var(--num); font-size: 12px; font-weight: 400; color: var(--faint); letter-spacing: 0; }
.sec > .intro { margin: -4px 0 16px; max-width: 70ch; font-size: 14.5px; color: var(--mut); }
.empty { margin: 0; padding: 14px 16px; border: 1px dashed var(--line2); border-radius: 8px; color: var(--mut); font-size: 14px; }
.more { margin: 4px 0 0; font-size: 14.5px; }
.more a { display: inline-flex; align-items: center; gap: 6px; }
.srcs { margin: 6px 0 0; padding-left: 20px; font-size: 14px; color: var(--mut); }
.srcs li { margin: 4px 0; }
.srcs li::marker { color: var(--faint); }
.edbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; padding: 8px 10px; border: 1px dashed var(--line2); border-radius: 8px; }
.edbar-l { font-size: 12.5px; color: var(--faint); margin-right: 4px; }
.edbar label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mut); }
.mp-legend { margin-top: 4px; }
.lvl { margin-top: 32px; }
.lvl > h2 { font-size: 17px; margin: 0 0 10px; }
@media (max-width: 620px) {
  main { padding: 14px 16px 48px; }
  h1 { font-size: 26px; }
  h2 { font-size: 19px; }
  .lede { font-size: 16px; }
  a.back { min-height: 40px; }
  .ph { grid-template-columns: minmax(0, 1fr); }
  .ph > .edbtns { grid-column: 1; grid-row: auto; margin-top: 12px; }
  .sec { margin-top: 36px; padding-top: 18px; }
}

/* ---------- reference list (rows: dot, name, what, meta) ---------- */
.rl { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.rl > li { position: relative; display: flex; align-items: stretch; }
.rl > li + li { border-top: 1px solid var(--line); }
.rl-row { flex: 1; min-width: 0; display: grid; grid-template-columns: 10px minmax(0, 15rem) minmax(0, 1fr) auto; align-items: baseline; gap: 2px 14px; min-height: 46px; padding: 11px 16px; color: var(--fg); text-decoration: none; }
a.rl-row:hover { background: var(--raise); }
.rl-row > .ln-dot, .rl-row > .rl-nodot { align-self: center; grid-row: 1; }
.rl-nodot { width: 9px; height: 9px; }
.rl-name { font-size: 14.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.rl-row.later .rl-name, .rl-row.unverified .rl-name { color: var(--mut); font-weight: 500; }
.rl-what { min-width: 0; font-size: 13.5px; line-height: 1.45; color: var(--mut); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rl-meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 12px; color: var(--faint); white-space: nowrap; }
.rl-meta .n { font-size: 11.5px; }
.rl-ix { align-self: baseline !important; font-size: 12px; color: var(--faint); }
.rl.ix .rl-row { grid-template-columns: 2.2ch minmax(0, 15rem) minmax(0, 1fr) auto; }
.rl-edit { display: flex; align-items: center; justify-content: center; width: 46px; flex: none; border-left: 1px solid var(--line); color: var(--faint); text-decoration: none; }
.rl-edit:hover { background: var(--raise); color: var(--fg); }
.rl-act { display: flex; align-items: center; padding: 0 12px 0 4px; flex: none; }
.rl-sub { display: block; font-weight: 400; color: var(--mut); font-size: 13px; }
@media (max-width: 760px) {
  .rl-row, .rl.ix .rl-row { grid-template-columns: 10px minmax(0, 1fr) auto; padding: 10px 14px; gap: 2px 12px; }
  .rl.ix .rl-row { grid-template-columns: 2.2ch minmax(0, 1fr) auto; }
  .rl-what { grid-column: 2 / -1; grid-row: 2; }
  .rl-meta { grid-column: 3; grid-row: 1; }
  .rl-what { -webkit-line-clamp: 3; }
  .mv-srcs a { display: inline-block; padding: 9px 0; }
  .rl-row.pr .rl-meta { display: none; }
  .rl-row.pr { grid-template-columns: 10px minmax(0, 1fr); }
  .ctls .tog { width: 100%; }
  .mp-legend { gap: 6px 14px; }
}

/* ---------- table ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 14px; }
.tbl th { padding: 9px 14px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { height: 46px; padding: 0 14px; border-top: 1px solid var(--line); }
.tbl tbody tr:first-child td { border-top: 0; }
.tbl .num { text-align: right; font-family: var(--num); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.tbl th.num { font-family: var(--ui); font-size: 11px; }
.tbl .num.z { color: var(--faint); }
.tbl tbody tr.go { cursor: pointer; }
.tbl tbody tr.go:hover { background: var(--raise); }
.tbl a.fam-a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; text-decoration: none; }
.tbl a.fam-a:hover { text-decoration: underline; text-decoration-color: var(--line2); }

/* ---------- home ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; margin-top: 32px; }
.home-grid > section > h2, .home-grid > aside > h2 { margin: 0 0 12px; }
.next { position: sticky; top: 64px; padding: 16px 18px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.next h2 { font-size: 17px; margin: 0 0 2px !important; }
.next .intro { margin: 0 0 10px; font-size: 13.5px; color: var(--mut); }
.next ul { list-style: none; margin: 0 -18px; padding: 0; border-top: 1px solid var(--line); }
.next li + li { border-top: 1px solid var(--line); }
.next a.nx { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 18px; text-decoration: none; }
.next a.nx:hover { background: var(--raise); }
.next a.nx .ln-dot { margin-top: 6px; }
.next .nx-name { flex: 1; min-width: 0; font-size: 14px; line-height: 1.35; }
.next .nx-name small { display: block; font-size: 12.5px; color: var(--mut); }
.next .n { font-size: 11.5px; color: var(--faint); }
.next .foot { margin: 12px 0 0; font-size: 13.5px; }
.next .note { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); font-size: 13.5px; color: var(--mut); }
.ed-note { margin: 10px 0 0; font-size: 12.5px; color: var(--faint); }
.addfam { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line2); border-radius: 8px; }
.addfam input[type=text] { flex: 1; min-width: 160px; }
@media (max-width: 900px) { .home-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; } .home-grid > aside { order: -1; position: static; } }
@media (max-width: 620px) { .tbl .opt { display: none; } .tbl th, .tbl td { padding-left: 12px; padding-right: 10px; } }

/* ---------- family ---------- */
.ctls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 22px 0 12px; }

/* ---------- theory terms ---------- */
.terms { margin: 0; border-top: 1px solid var(--line); }
.term { display: grid; grid-template-columns: minmax(0, 15ch) minmax(0, 1fr); gap: 4px 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.term dt { font-weight: 650; line-height: 1.4; }
.term dt a { text-decoration: none; }
.term dt a:hover { text-decoration: underline; text-decoration-color: var(--line2); }
.term dt .alt { display: block; font-weight: 400; font-size: 13px; color: var(--faint); }
.term dt .abbr { margin-left: 8px; font-weight: 400; color: var(--faint); }
.term dd { margin: 0; min-width: 0; }
.term dd p { margin: 0 0 8px; max-width: 68ch; font-size: 14.5px; color: var(--mut); }
.term dd p.cnt { margin: 6px 0 0; font-family: var(--ui); font-size: 12.5px; }
.term dd p.cnt .n { color: var(--mut); }
.vals { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 620px) { .term { grid-template-columns: minmax(0, 1fr); } .term dt a { display: inline-block; padding: 10px 0; margin: -10px 0; } .vals .chip, .chips .chip { line-height: 38px; padding: 0 12px; font-size: 13px; } .srcs a { display: inline-block; padding: 9px 0; } }

/* ---------- start ---------- */
.steps { list-style: none; margin: 32px 0 0; padding: 0; }
.step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 14px; padding: 24px 0 28px; border-top: 1px solid var(--line); }
.step-n { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line2); border-radius: 6px; font-size: 13px; color: var(--mut); }
.step h2 { margin: 1px 0 12px; }
.step p { margin: 0 0 14px; max-width: 64ch; }
.first { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.first-b { min-width: 0; flex: 1 1 260px; }
.first-b b { display: block; font-size: 16px; font-weight: 650; }
.first-b span { font-size: 14px; color: var(--mut); }
.doors { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.door { display: block; padding: 16px 18px; text-decoration: none; border-bottom: 1px solid var(--line); }
.door:nth-child(odd) { border-right: 1px solid var(--line); }
.door:nth-last-child(-n+2) { border-bottom: 0; }
.door:hover { background: var(--raise); }
.door-t { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 16px; font-weight: 650; }
.door-t svg { color: var(--faint); }
.door-d { display: block; margin-top: 4px; font-size: 14px; color: var(--mut); }
@media (max-width: 620px) {
  .step { grid-template-columns: 28px minmax(0, 1fr); gap: 0 12px; padding: 20px 0 22px; }
  .step > div > :not(h2) { margin-left: -40px; }
  .doors { grid-template-columns: 1fr; }
  .door:nth-child(odd) { border-right: 0; }
  .door:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .first .btn { width: 100%; }
}

/* ---------- progress ---------- */
.meter-l { margin: 18px 0 8px; font-size: 14px; color: var(--mut); }
.meter-l .n { font-size: 13px; color: var(--fg); }
.meter { height: 4px; border-radius: 2px; background: var(--raise); overflow: hidden; max-width: 520px; }
.meter i { display: block; height: 100%; background: var(--ok); }
.pg-fam { margin: 22px 0 8px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; }
.pg-fam .n { font-weight: 400; color: var(--faint); font-size: 11.5px; }
.tk { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px 0 8px; border: 1px solid var(--line2); border-radius: 4px; background: var(--field); color: var(--mut); font: 12.5px var(--ui); cursor: pointer; white-space: nowrap; }
.tk:hover { color: var(--fg); border-color: var(--mut); }
.tk-box { width: 12px; height: 12px; border: 1px solid var(--line2); border-radius: 3px; }
.tk.on { color: var(--ok); border-color: rgba(107, 191, 142, .5); background: rgba(107, 191, 142, .08); }
.tk.locked { color: var(--faint); border-style: dashed; }
.device { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 620px) { .tk { height: 40px; } .device > button { flex: 1 1 auto; } }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 40; max-width: calc(100vw - 32px); padding: 9px 14px; border-radius: 6px; background: var(--fg); color: var(--on-fg); font: 600 13.5px/1.4 var(--ui); }

/* ---------- editor (move, axis) ---------- */
body[data-page="edit"] main { max-width: 900px; }
.ed h2 { margin: 36px 0 4px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 17px; }
.ed h2:first-of-type { margin-top: 20px; }
.viz { position: relative; margin: 10px 0; background: var(--vp); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; color: var(--mut); }
.viz canvas { width: 100%; height: 320px; display: block; }
.viz .ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border-top: 1px solid var(--line); background: var(--panel); }
.viz .ctl label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--mut); }
.panel { margin: 10px 0; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.panel h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 14px; }
details.vcard { padding: 0; }
details.vcard > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 46px; padding: 6px 10px 6px 14px; cursor: pointer; list-style: none; }
details.vcard > summary::-webkit-details-marker { display: none; }
details.vcard > summary::before { content: ""; width: 6px; height: 6px; margin: 0 6px 0 0; border-right: 1.5px solid var(--mut); border-bottom: 1.5px solid var(--mut); transform: rotate(-45deg); transition: transform .12s; }
details.vcard[open] > summary::before { transform: rotate(45deg); }
details.vcard[open] > summary { border-bottom: 1px solid var(--line); }
details.vcard > summary .sumr { margin-left: auto; display: inline-flex; gap: 4px; }
.vbody { padding: 2px 14px 14px; }
.vcard details.vmotion { margin: 12px 0; }
.vcard details.vmotion > summary, details.srcdet > summary { cursor: pointer; padding: 6px 0; font-size: 13.5px; color: var(--mut); }
details.srcdet { margin: 14px 0 0; }
.pre { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.pre .chip { cursor: pointer; color: var(--fg); line-height: 26px; padding: 0 6px 0 9px; }
.pre .chip:hover { border-color: var(--mut); }
.sugg { max-height: 220px; overflow: auto; margin-top: 4px; background: var(--panel); border: 1px solid var(--line2); border-radius: 6px; }
.sugg div { padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13.5px; cursor: pointer; }
.sugg div:hover { background: var(--raise); }
.addopt { margin: 6px 0; padding: 10px; border: 1px dashed var(--line2); border-radius: 6px; }
fieldset.axval { margin: 0 0 10px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
select.bad { border-color: rgba(227, 179, 79, .6); }
.sticky { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; padding: 10px 0 max(10px, env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.dirtysum { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--mut); }
.dirtysum.dirty { color: var(--warn); }
.sticky button[disabled] { opacity: .45; cursor: not-allowed; }
.draftbar { margin: 0 0 14px; padding: 10px 12px; border: 1px solid rgba(227, 179, 79, .5); border-radius: 6px; background: rgba(227, 179, 79, .08); font-size: 14px; }
.draftbar > b { color: var(--warn); }

/* ---------- draft and feedback strips (move and entry pages) ---------- */
.draftstrip { display: flex; align-items: baseline; gap: 8px; margin: 8px 0; padding: 6px 10px; border: 1px solid rgba(227, 179, 79, .5); border-radius: 6px; background: rgba(227, 179, 79, .08); font-size: 13px; }
.draftstrip b { flex: none; color: var(--warn); }
.draftstrip .dtext { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.draftstrip.open { flex-wrap: wrap; }
.draftstrip.open .dtext { flex-basis: 100%; order: 3; white-space: pre-wrap; overflow: visible; }
.draftstrip .dtoggle { flex: none; margin-left: auto; padding: 0 8px; font-size: 12px; }
.draftstrip.fb-strip { border-color: var(--line2); background: var(--panel); }
.draftstrip.fb-strip b { color: var(--fg); }
.fbitem { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }

/* ---------- admin ---------- */
body[data-page="admin"] main { max-width: 1240px; }
.stats { display: flex; flex-wrap: wrap; margin: 16px 0 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stat { flex: 1 1 150px; padding: 10px 16px; border-right: 1px solid var(--line); text-align: left; }
.stat:last-child { border-right: 0; }
.stat b { display: block; font: 500 18px/1.3 var(--num); }
.stat span { font-size: 12.5px; color: var(--mut); }
.stat.ok b { color: var(--ok); } .stat.warn b { color: var(--warn); }
button.stat { all: unset; flex: 1 1 150px; padding: 10px 16px; cursor: pointer; }
button.stat:hover { background: var(--raise); }
button.stat:focus-visible { outline: 1.5px solid var(--fg); outline-offset: -2px; }
.tabs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 20px; margin: 22px 0 16px; border-bottom: 1px solid var(--line); }
.tabs > button { height: 40px; padding: 0 1px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--mut); font-size: 13.5px; }
.tabs > button:hover { background: none; color: var(--fg); }
.tabs > button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--fg); }
.tabs > button .n { margin-left: 6px; font-size: 11.5px; color: var(--faint); }
.tabs > .btn { margin: 0 0 6px auto; align-self: center; }
.adm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; }
.adm-bar input[type=search] { width: 240px; }
.adm-bar .cnt { margin-left: auto; }
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
table.admin { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.admin th, table.admin td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.admin tbody tr:last-child > td { border-bottom: 0; }
table.admin th { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
table.admin th.sortable { cursor: pointer; user-select: none; }
table.admin th.sortable:hover { color: var(--fg); }
table.admin td.num { text-align: right; font-family: var(--num); font-size: 12.5px; }
table.admin tbody tr:hover > td { background: rgba(29, 31, 35, .6); }
table.admin select, table.admin input[type=text], table.admin input[type=number] { height: 28px; font-size: 13px; }
table.admin .idl { font-family: var(--num); font-size: 11px; color: var(--faint); }
.act { display: inline-flex; gap: 4px; white-space: nowrap; }
.act-btn { height: 28px; padding: 0 9px; font-size: 12.5px; }
.bulk { position: sticky; top: 52px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; font-size: 13.5px; }
.bulk select { height: 32px; }
.quick-add { margin: 0 0 14px; padding: 0 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.quick-add > summary { cursor: pointer; padding: 11px 0; font-size: 13.5px; font-weight: 600; }
.quick-add[open] { padding-bottom: 14px; }
.quick-drawer td { padding: 14px !important; background: var(--raise); }
.agentbox { margin: 0 0 14px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; }
.fbcard { margin: 0 0 8px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.fbcard.needs { border-color: rgba(227, 179, 79, .55); }
.fbhead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; }
.fbhead .t { font-family: var(--num); font-size: 11.5px; color: var(--faint); }
.fbtext { max-width: 80ch; margin: 8px 0; white-space: pre-wrap; }
.fbagent { display: grid; gap: 4px; margin: 8px 0; padding: 10px 12px; background: var(--field); border: 1px solid var(--line); border-radius: 6px; font-size: 13.5px; }
.fbthread { display: grid; gap: 2px; margin: 6px 0; }
.fbactions { gap: 6px; margin-top: 8px; }
.fbactions > * { flex: 0 0 auto; }
.fbcomment textarea { width: 100%; min-height: 70px; margin-top: 8px; }
.adm-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 12px; }
.adm-filters > .btn, .adm-filters > button.primary { margin-left: auto; }

/* ===== Atölye: move page (#/t/<id>), scoped under body[data-page=move] and .mv ===== */
body[data-page="move"] main { max-width: 1240px; padding: 16px 32px 96px; }
.atl {
  --bg: #0f1012; --panel: #16171a; --raise: #1d1f23; --field: #0c0d0f; --vp: #0a0b0c; --line: #24262b; --line2: #30333a;
  --fg: #e6e5e0; --on-fg: #111214; --mut: #9a9ba1; --faint: #7b7d84; --sel: #34363d;
  --L: #4fa3e3; --R: #e3934f; --warn: #e3b34f; --bad: #ef6b5f; --ok: #6bbf8e;
  --ui: "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", "Noto Sans", Roboto, sans-serif;
  --num: "JetBrains Mono", "JetBrainsMono Nerd Font", "SF Mono", "Cascadia Mono", ui-monospace, monospace;
  color: var(--fg); font: 15px/1.6 var(--ui);
}
.atl ::selection { background: var(--sel); color: var(--fg); }
.atl a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.atl a:hover { text-decoration-color: var(--fg); }
.atl :focus-visible { outline: 1.5px solid var(--fg); outline-offset: 2px; border-radius: 3px; }
.atl button { font: inherit; color: inherit; background: none; border: 0; padding: 0; border-radius: 0; cursor: pointer; white-space: normal; }
.atl [hidden] { display: none !important; }
.atl .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.atl .n, .mv-code { font-family: var(--num); font-variant-numeric: tabular-nums; }
.atl .n { font-size: 12px; color: var(--fg); }
.mv-code { font-size: 11px; color: var(--faint); }

.mv-crumbs { margin: 2px 0 8px; }
.mv a.mv-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mut); text-decoration: none; padding: 4px 8px 4px 5px; margin-left: -5px; border-radius: 5px; }
.mv a.mv-back:hover { background: var(--raise); color: var(--fg); }
.mv-head h1 { font-size: 30px; font-weight: 680; line-height: 1.15; letter-spacing: -.018em; margin: 0 0 10px; text-wrap: balance; }
.mv-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 13px; color: var(--mut); }
.atl .chip { display: inline-block; font-size: 11.5px; line-height: 18px; padding: 0 7px; border-radius: 4px; border: 1px solid var(--line2); border-style: solid; color: var(--mut); margin: 0; background: transparent; }
.atl .chip.approved, .atl .chip.verified { color: var(--ok); border-color: rgba(107, 191, 142, .5); }
.atl .chip.draft { color: var(--warn); border-color: rgba(227, 179, 79, .5); }
.mv-aka { color: var(--faint); }
.mv .draftstrip { border: 1px solid rgba(227, 179, 79, .5); border-radius: 6px; background: rgba(227, 179, 79, .08); margin: 14px 0 0; padding: 6px 10px; }
.mv .draftstrip .dtoggle { font-size: 12px; color: var(--mut); padding: 0 6px; }
.mv .draftstrip .dtoggle:hover { color: var(--fg); }

/* first viewport: figure plate + variant table */
.mv-top { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; margin-top: 18px; align-items: start; }
.mv-top.single { grid-template-columns: minmax(0, 1fr) 300px; }
.mv-plate { margin: 0; min-width: 0; }
.mv-stage { position: relative; height: clamp(340px, 56vh, 600px); background: var(--vp); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mv-stage canvas { width: 100%; height: 100%; display: block; }
.mv-top.nomo .mv-stage { height: 300px; }
.mv-tag { position: absolute; left: 10px; top: 10px; display: flex; align-items: center; gap: 7px; max-width: calc(100% - 20px); padding: 4px 9px; border-radius: 5px; background: rgba(10, 11, 12, .78); font-size: 12.5px; }
.mv-tag b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-tag .mv-code { flex: none; }
.mv .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.mv .dot.L { background: var(--L); } .mv .dot.R { background: var(--R); }
.mv .mv-play { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 30px; display: grid; place-items: center; background: rgba(22, 23, 26, .9); border: 1px solid var(--line2); border-radius: 6px; color: var(--fg); }
.mv .mv-play:hover { background: var(--sel); }
.mv-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; text-align: center; color: var(--mut); font-size: 14px; }
.mv-empty p { margin: 0; }
.mv-plate figcaption { margin-top: 10px; }
.mv-transport { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.mv-segw { display: flex; align-items: center; gap: 8px; }
.mv-seglbl { font-size: 12.5px; color: var(--faint); }
.mv-seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--field); border: 1px solid var(--line); border-radius: 6px; }
.mv .mv-seg button { height: 26px; padding: 0 10px; border-radius: 4px; color: var(--mut); font-size: 12.5px; white-space: nowrap; }
.mv .mv-seg button:hover { color: var(--fg); }
.mv .mv-seg button[aria-pressed="true"] { background: var(--sel); color: var(--fg); box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset; }
.mv .mv-segw.num .mv-seg button { font-family: var(--num); font-size: 11.5px; }
.mv-hands { margin: 8px 0 0; font-size: 13px; color: var(--faint); }
.mv-hands .cL { color: var(--L); } .mv-hands .cR { color: var(--R); }
.mv-warn { margin: 6px 0 0; font-size: 13px; color: var(--warn); }

.mv-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mv-grid { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mv-grid th { font-size: 12px; font-weight: 600; color: var(--mut); text-align: left; padding: 8px 10px; line-height: 1.3; }
.mv-grid thead th, .mv-grid thead td { border-bottom: 1px solid var(--line); }
.mv-grid thead td, .mv-grid tbody th { width: 96px; }
.mv-grid tbody th { vertical-align: middle; border-top: 1px solid var(--line); }
.mv-grid td { padding: 0; height: 1px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); vertical-align: top; }
.mv-grid thead td { border-left: 0; }
.mv-grid tbody tr:first-child th, .mv-grid tbody tr:first-child td { border-top: 0; }
.mv-grid.norow tbody td:first-child, .mv-grid.norow thead th:first-child { border-left: 0; }
.mv-cellw { position: relative; height: 100%; min-height: 92px; display: flex; flex-direction: column; }
.mv .mv-cell { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; padding: 10px 10px 44px; text-align: left; }
.mv .mv-cell:hover { background: var(--raise); }
.mv .mv-cellw.on .mv-cell { background: var(--sel); }
.mv-cname { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--fg); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mv-cnote { font-size: 11.5px; color: var(--mut); }
.mv .mv-tick { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px 0 7px; border: 1px solid var(--line2); border-radius: 4px; background: var(--field); color: var(--mut); font-size: 12px; }
.mv .mv-tick:not(.on):not(.locked)::before { content: ""; width: 12px; height: 12px; border: 1px solid var(--line2); border-radius: 3px; }
.mv .mv-tick:hover { color: var(--fg); border-color: var(--mut); }
.mv .mv-tick.on { color: var(--ok); border-color: rgba(107, 191, 142, .5); background: rgba(107, 191, 142, .08); }
.mv .mv-tick.locked { color: var(--faint); border-style: dashed; }
.mv-none { text-align: center; color: var(--mut); font-size: 12px; }
.mv-none span { display: block; padding: 12px 8px; }
.mv-list { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mv-list li { position: relative; border-top: 1px solid var(--line); }
.mv-list li:first-child { border-top: 0; }
.mv .mv-li { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 10px 104px 10px 14px; text-align: left; }
.mv .mv-li:hover { background: var(--raise); }
.mv .mv-list li.on .mv-li { background: var(--sel); }
.mv-li .mv-code { color: var(--mut); }
.mv .mv-cellw.on .mv-cnote, .mv .mv-list li.on .mv-code { color: var(--fg); }
.mv .chip svg { vertical-align: -1px; }
.mv .mv-list .mv-tick { left: auto; right: 10px; top: 50%; bottom: auto; transform: translateY(-50%); }
.mv .mv-cur .mv-tick { position: static; margin-top: 8px; }
.mv-cur { padding: 2px 2px 0; }
.mv-cur-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.mv-cur-h b { font-size: 15px; font-weight: 650; }
.mv-state { margin: 4px 0 0; font-size: 13px; color: var(--mut); }
.mv-state.ok { color: var(--ok); }
.mv-count { margin: 2px 0 0; font-size: 13px; color: var(--faint); }
.mv-notes summary { cursor: pointer; font-size: 13px; color: var(--mut); margin-top: 6px; }
.mv-notes .desc { font-size: 14px; color: var(--mut); margin-top: 6px; }

/* below the fold: tree chain, then reading */
.mv-sec { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); }
.mv-sec h2 { font-size: 21px; font-weight: 650; line-height: 1.25; letter-spacing: -.01em; text-transform: none; color: var(--fg); margin: 0 0 14px; }
.mv .desc { white-space: pre-wrap; margin: 0; max-width: 70ch; color: var(--fg); }
.mv-muted { margin: 0; color: var(--mut); }
.mv-tips, .mv-srcs { margin: 0; padding-left: 20px; max-width: 70ch; }
.mv-tips li, .mv-srcs li { margin: 6px 0; }
.mv-tips li::marker, .mv-srcs li::marker { color: var(--faint); }
.mv-updated { margin: 40px 0 0; font-size: 13px; color: var(--faint); }
.mv .focus { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.mv .focus .col > .lbl { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 0 0 8px; }
.mv .focus a.node { display: block; margin: 0 0 6px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--fg); font-size: 14px; text-decoration: none; }
.mv .focus a.node:hover { background: var(--raise); }
.mv .focus a.node.self { background: var(--raise); border-color: var(--fg); font-weight: 600; }
.mv .focus a.node.done::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--ok); vertical-align: 1px; }
.mv .focus a.node.d2 { margin-left: 14px; font-size: 13px; color: var(--mut); opacity: 1; }
.mv .focus a.node .nsub { color: var(--faint); font-size: 12px; white-space: normal; }
.mv .focus .empty { padding: 10px 14px; border: 1px dashed var(--line2); border-radius: 6px; color: var(--mut); font-size: 14px; }
.mv-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; align-items: start; }
.mv-head > h1, .mv-head > .mv-meta { grid-column: 1; }
.mv .mv-editbar { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 8px; align-self: center; }
.mv .mv-editbar .btn, .mv .mv-editbar button { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 6px; background: var(--raise); color: var(--fg); font-size: 13px; font-weight: 600; text-decoration: none; }
.mv .mv-editbar .btn.primary { background: var(--fg); border-color: var(--fg); color: var(--on-fg); }
.mv .mv-editbar .btn.primary:hover { background: #fff; }
.mv .mv-editbar button:hover { background: var(--sel); }

@media (max-width: 980px) {
  .mv-top, .mv-top.single { grid-template-columns: minmax(0, 1fr); }
  .mv-stage { height: clamp(300px, 52vh, 520px); }
}
@media (max-width: 620px) {
  body[data-page="move"] main { padding: 8px 14px 96px; }
  .mv-head h1 { font-size: 26px; margin-bottom: 8px; }
  .mv-head { grid-template-columns: minmax(0, 1fr); }
  .mv .mv-editbar { grid-column: 1; grid-row: auto; margin-top: 10px; }
  .mv-top { gap: 12px; margin-top: 12px; }
  .mv-plate { display: contents; }
  .mv-stage { order: 1; height: max(220px, calc(100svh - 562px)); } /* 562 = header (2 rows) + title + table + toggle */
  .mv-side { order: 2; }
  .mv.w .mv-stage { height: max(200px, calc(100svh - 606px)); }
  .mv-top.nomo .mv-stage, .mv.w .mv-top.nomo .mv-stage { height: 180px; }
  .mv-plate figcaption { order: 3; margin-top: 0; }
  .mv-transport { gap: 8px; }
  .mv-transport .mv-seglbl { display: none; }
  .mv .mv-seg button { height: 40px; padding: 0 12px; }
  .mv .mv-play { width: 44px; height: 40px; }
  .mv a.mv-back { min-height: 40px; }
  .mv .mv-cell { padding-bottom: 56px; }
  .mv-segw.tog { gap: 10px; }
  .mv-segw.tog .mv-seglbl { display: block; flex: none; width: 76px; line-height: 1.25; }
  .mv-segw.tog .mv-seg { display: flex; flex: 1; } .mv .mv-segw.tog .mv-seg button { flex: 1; height: 40px; padding: 0 6px; }
  .mv-grid thead td, .mv-grid tbody th { width: 72px; }
  .mv-grid th { padding: 8px; font-size: 11.5px; }
  .mv-cellw { min-height: 100px; }
  .mv .mv-tick { height: 40px; }
  .mv .focus { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .mv-sec { margin-top: 36px; padding-top: 18px; }
}

/* ===== Atölye: map (#/tree), scoped under body[data-page=map] and .mp; family lanes (lanes.js) and the phone ladder ===== */
body[data-page="map"] main { max-width: 1320px; padding: 16px 32px 96px; }
.mp-head h1 { font-size: 30px; font-weight: 680; line-height: 1.15; letter-spacing: -.018em; margin: 6px 0 8px; }
.mp-lede { margin: 0; max-width: 72ch; color: var(--mut); }
.mp-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 18px 0 12px; }
.mp-q { width: 260px; height: 32px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); color: var(--fg); font: inherit; font-size: 14px; }
.mp-q::placeholder { color: var(--faint); }
.mp-q:focus { outline: none; border-color: var(--mut); }
.mp-segw { display: flex; align-items: center; gap: 8px; }
.mp-seglbl { font-size: 12.5px; color: var(--faint); }
.mp-seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--field); border: 1px solid var(--line); border-radius: 6px; }
.atl .mp-seg button { height: 26px; padding: 0 10px; border-radius: 4px; color: var(--mut); font-size: 12.5px; white-space: nowrap; }
.atl .mp-seg button:hover { color: var(--fg); }
.atl .mp-seg button[aria-pressed="true"] { background: var(--sel); color: var(--fg); box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset; }
.atl .mp-tog { height: 30px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 6px; color: var(--mut); font-size: 13px; }
.atl .mp-tog:hover { color: var(--fg); }
.atl .mp-tog[aria-pressed="true"] { background: var(--sel); color: var(--fg); }
.mp-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; font-size: 13px; color: var(--mut); }
.mp-legend span { display: inline-flex; align-items: center; gap: 7px; }
.ln-dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #60626a; }
.ln-dot.k-done, .ln-node.done .ln-dot { background: var(--ok); }
.ln-dot.k-open, .ln-node.open .ln-dot { background: var(--vp); box-shadow: inset 0 0 0 1.5px var(--fg); }
.ln-dot.k-later, .ln-node.later .ln-dot { background: #60626a; }
.ln-dot.k-unverified, .ln-node.unverified .ln-dot { background: transparent; box-shadow: none; border: 1.5px dashed var(--faint); box-sizing: border-box; }
.ln-node.unverified .ln-name, .mp-row.unverified .mp-rname { color: var(--mut); }

.mp-map { position: relative; }
.ln-head { position: sticky; top: var(--top-h, 56px); z-index: 3; display: flex; align-items: center; height: 30px; background: var(--bg); border-bottom: 1px solid var(--line); }
.ln-hl { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.ln-step { padding-left: 12px; font-size: 12px; color: var(--faint); }
.ln-step b { font: 400 12px var(--num); color: var(--mut); }
.ln-board { position: relative; }
.ln-lanes, .ln-nodes { position: absolute; inset: 0; }
.ln-lane { position: absolute; left: 0; right: 0; border-bottom: 1px solid var(--line); }
.ln-lane:nth-child(even) { background: rgba(22, 23, 26, .55); }
.ln-lname { position: absolute; left: 0; top: 10px; width: 128px; display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; font-size: 13px; line-height: 1.3; color: var(--fg); }
.ln-sw { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 3px; }
.ln-lcount { width: 100%; padding-left: 18px; font: 11px var(--num); color: var(--faint); }
.ln-links { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.ln-links path { stroke: #30333a; stroke-width: 1; opacity: .6; }
.ln-links path.off { opacity: .07; }
.ln-links path.lit { stroke-width: 1.6; opacity: .85; }
.atl .ln-node { position: absolute; height: 24px; display: flex; align-items: center; gap: 8px; padding: 0 6px; border-radius: 5px; text-align: left; font-size: 12.5px; color: var(--fg); }
.atl .ln-node:hover { background: var(--raise); }
.ln-node .ln-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-node.later .ln-name { color: var(--mut); }
.ln-node.dim { opacity: .4; }
.atl .ln-node.sel { background: var(--sel); }
.atl .ln-node.pre { background: rgba(227, 179, 79, .1); }
.ln-node.pre .ln-name { color: var(--warn); }
.ln-empty { padding: 24px 0; color: var(--mut); }
.ln-panel { position: sticky; bottom: 0; z-index: 4; display: flex; gap: 20px; align-items: flex-start; margin-top: 12px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; }
.ln-pmain { flex: 1; min-width: 0; }
.ln-ph { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ln-ph b { font-size: 16px; font-weight: 650; }
.ln-pfam { font-size: 13px; color: var(--mut); }
.ln-pstate { margin: 4px 0 0; font-size: 13px; color: var(--mut); }
.ln-pstate.done { color: var(--ok); } .ln-pstate.open { color: var(--fg); }
.ln-pdesc { margin: 6px 0 0; max-width: 80ch; font-size: 14px; color: var(--mut); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ln-prow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 8px; font-size: 13.5px; }
.ln-plbl { flex: none; width: 96px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.ln-ref { display: inline-flex; align-items: baseline; gap: 6px; }
.atl .ln-reflink { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.atl .ln-reflink:hover { text-decoration-color: var(--fg); }
.atl .ln-rm { font-size: 12px; color: var(--faint); }
.atl .ln-rm:hover { color: var(--fg); }
.ln-none { color: var(--mut); }
.ln-pact { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.atl .ln-primary { height: 30px; padding: 0 14px; border-radius: 6px; background: var(--fg); color: var(--on-fg); font-size: 13px; font-weight: 600; }
.atl .ln-primary:hover { background: #fff; }
.atl .ln-btn { height: 30px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 6px; background: var(--raise); color: var(--fg); font-size: 13px; }
.atl .ln-btn:hover { background: var(--sel); }
.atl .ln-btn.on { border-color: rgba(227, 179, 79, .55); color: var(--warn); }
.ln-prev { flex: 0 0 220px; height: 150px; background: var(--vp); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ln-prev canvas { width: 100%; height: 100%; display: block; }

/* phone ladder */
.mp-fam { height: 32px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); color: var(--fg); font: inherit; font-size: 14px; }
.mp-level { margin-top: 22px; }
.mp-level h2 { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 8px; font-size: 17px; font-weight: 650; letter-spacing: 0; text-transform: none; color: var(--fg); }
.mp-lcount { font: 12px var(--num); color: var(--faint); }
.mp-rows { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mp-rows li + li { border-top: 1px solid var(--line); }
.atl a.mp-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; color: var(--fg); text-decoration: none; }
.atl a.mp-row:hover { background: var(--raise); }
.mp-rname { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.35; }
.mp-row.later .mp-rname { color: var(--mut); }
.mp-rfam { max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--faint); }
.mp-none { margin: 0; font-size: 14px; color: var(--mut); }
@media (max-width: 900px) {
  body[data-page="map"] main { padding: 10px 14px 96px; }
  .mp-head h1 { font-size: 26px; }
  .mp-ctl { gap: 10px; }
  .mp-segw { width: 100%; }
  .mp-seglbl { display: none; }
  .mp-seg { display: flex; flex: 1; }
  .atl .mp-seg button { flex: 1; height: 40px; }
  .mp-fam { width: 100%; height: 40px; }
}
.mp-thin { margin: 18px 0 0; font-size: 14px; color: var(--mut); }

/* ?demo preview banner */
.demo-banner { margin: 0; padding: 8px 16px; background: rgba(227, 179, 79, .1); border-bottom: 1px solid rgba(227, 179, 79, .5); color: #e3b34f; font: 13px/1.4 "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", "Noto Sans", Roboto, sans-serif; text-align: center; }
.ln-nd { flex: none; margin-left: -4px; font: 11px var(--num); color: var(--faint); }

/* phone: standalone links in meta lines and footers get a 40px hit area (inline links inside sentences stay inline) */
@media (max-width: 760px) {
  .pg .ph-meta > a, .next .foot > a { display: inline-flex; align-items: center; min-height: 40px; }
  #top #home { display: inline-flex; align-items: center; min-width: 40px; }
}
.sec > .terms:last-child > .term:last-child, .sec > .terms > .term:last-child { border-bottom: 0; }
