/* Handoff web app. Design: a transit map for your agents.
   Agents are lines (each has one color, used only for that agent), drops are stations, handoffs are transfers.
   Type: Overpass (open-source highway signage face) throughout; Overpass Mono only for IDs people copy.
   Scales: type 12/13/15/17/20/24/30 · space 4/8/12/16/24/32/48 · radius 6 (controls) / 10 (panels). */

@font-face { font-family: "Overpass"; src: url("/app/fonts/overpass-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Overpass"; src: url("/app/fonts/overpass-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Overpass"; src: url("/app/fonts/overpass-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/app/fonts/archivo-var.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Overpass Mono"; src: url("/app/fonts/overpass-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Overpass Mono"; src: url("/app/fonts/overpass-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --canvas: #F6F7F9; --surface: #FFFFFF; --sunk: #EEF0F3; --ink: #000000; --ink2: #3D4451; --muted: #5F6775;
  --line: #DDE1E7; --line-strong: #C5CBD4; --accent: #C24E00; --accent-ink: #FFFFFF; --accent-soft: #FFF0E5;
  --ok: #0B7A4B; --warn: #985A00; --bad: #C42B2B;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-ctl: 6px; --r-panel: 10px; --side: 248px;
  --float: 0 10px 30px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .08);
  --font: "Archivo", ui-sans-serif, system-ui, sans-serif; --mono: "Overpass Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #07090C; --surface: #0E1218; --sunk: #161B23; --ink: #EEF1F6; --ink2: #C9D0DA; --muted: #8D96A5;
    --line: #1E252F; --line-strong: #2C3440; --accent: #FF8A3D; --accent-ink: #160A00; --accent-soft: #2A1709;
    --ok: #43C98F; --warn: #E9B04E; --bad: #FF7A72; --float: 0 12px 34px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 15px/1.5 var(--font); font-feature-settings: "kern"; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 16px; height: 16px; }
.muted { color: var(--muted); } .ink2 { color: var(--ink2); } .t13 { font-size: 13px; } .t12 { font-size: 12px; }
.id { font: 600 13px/1 var(--mono); letter-spacing: .01em; color: var(--ink2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- shell ---- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); display: flex; flex-direction: column; gap: var(--s5);
        padding: calc(var(--s4) + env(safe-area-inset-top)) var(--s3) var(--s4); background: var(--surface);
        border-right: 1px solid var(--line); z-index: 30; transition: transform .2s ease; }
.brand { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s2); color: var(--ink); font-weight: 700; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-ctl); color: var(--ink2); font-weight: 600; }
.nav a:hover { background: var(--sunk); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.side-foot { margin-top: auto; padding: var(--s3) var(--s3) 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.side-foot a { color: var(--muted); }
.main-col { margin-left: var(--side); min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr minmax(0, 580px) 1fr; align-items: center;
       gap: var(--s3); padding: calc(var(--s3) + env(safe-area-inset-top)) var(--s5) var(--s3);
       background: color-mix(in srgb, var(--canvas) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
       border-bottom: 1px solid var(--line); }
.search { grid-column: 2; position: relative; display: flex; align-items: center; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 40px; padding: 0 44px 0 40px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--surface); }
.search kbd { position: absolute; right: 10px; font: 600 12px/1 var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; }
.top-actions { grid-column: 3; justify-self: end; display: flex; gap: var(--s2); }
.top .menu-btn { display: none; }
.scrim { display: none; }
main#view { max-width: 1040px; margin: 0 auto; padding: var(--s6) var(--s5) var(--s7); }
@media (max-width: 880px) {
  .side { transform: translateX(-104%); box-shadow: var(--float); }
  body.drawer .side { transform: none; }
  body.drawer .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 25; }
  .main-col { margin-left: 0; }
  .top { grid-template-columns: auto 1fr auto; padding-left: var(--s3); padding-right: var(--s3); }
  .top .menu-btn { display: inline-flex; grid-column: 1; }
  .search { grid-column: 2; } .search kbd { display: none; } .search input { padding-right: 12px; }
  .top-actions { grid-column: 3; } .top-actions .label { display: none; }
  main#view { padding: var(--s5) var(--s4) var(--s7); }
}

/* ---- type + page structure ---- */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s1); font-size: 13px; color: var(--muted); margin-bottom: var(--s3); }
.crumbs a { color: var(--muted); } .crumbs .i { width: 14px; height: 14px; }
.page-title { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
h1 { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; margin: 0; max-width: 34ch; }
.lede { margin: var(--s2) 0 0; color: var(--ink2); max-width: 64ch; }
h2 { font-size: 17px; line-height: 1.3; font-weight: 700; margin: 0; }
.section { margin-top: var(--s6); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.section-head .count { color: var(--muted); font-weight: 600; margin-left: var(--s2); }

/* ---- controls ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: 38px; padding: 0 var(--s4);
       border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
       font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--sunk); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunk); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 32px; padding: 0 var(--s3); font-size: 13px; }
.btn.icon { width: 38px; padding: 0; } .btn.icon.sm { width: 32px; }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; min-height: 40px; padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  background: var(--surface); }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-repeat: no-repeat; background-position: right 12px center;
         background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235F6775' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); }
textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
label.field { display: grid; gap: var(--s1); font-size: 13px; font-weight: 600; color: var(--ink2); }
label.field .hint { font-weight: 400; color: var(--muted); }
form.stack { display: grid; gap: var(--s4); }
.error { color: var(--bad); font-size: 14px; }
.picker { display: grid; justify-items: center; gap: var(--s1); padding: var(--s5) var(--s4); border: 1.5px dashed var(--line-strong);
          border-radius: var(--r-panel); background: var(--canvas); text-align: center; cursor: pointer; position: relative; color: var(--ink2); }
.picker:hover { border-color: var(--accent); }
.picker b { color: var(--accent); } .picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.picked { display: grid; gap: 2px; font-size: 14px; color: var(--ink2); }
.progress { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* ---- panels and rows ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.panel.pad { padding: var(--s4) var(--s5); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s4); padding: var(--s3) var(--s4); color: var(--ink); }
a.row:hover { background: var(--canvas); text-decoration: none; }
.rows > li:first-child > .row { border-radius: var(--r-panel) var(--r-panel) 0 0; } .rows > li:last-child > .row { border-radius: 0 0 var(--r-panel) var(--r-panel); }
.row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row .sub { font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; display: grid; gap: 2px; justify-items: end; }
.lead { width: 44px; height: 44px; border-radius: 8px; background: var(--sunk); display: grid; place-items: center; overflow: hidden; color: var(--ink2); }
.lead img { width: 100%; height: 100%; object-fit: cover; display: block; }
.empty { padding: var(--s6) var(--s5); text-align: center; color: var(--ink2); }
.empty p { margin: var(--s1) 0 var(--s4); color: var(--muted); }
@media (max-width: 560px) { .row { grid-template-columns: auto minmax(0, 1fr); } .row .meta { grid-column: 2; justify-items: start; text-align: left; } }

/* agent "line bullets", like transit line markers */
.bullet { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font: 700 11px/1 var(--font); flex: none; }
.bullet.lg { width: 40px; height: 40px; font-size: 16px; }
.bullets { display: inline-flex; } .bullets .bullet { margin-left: -5px; box-shadow: 0 0 0 2px var(--surface); } .bullets .bullet:first-child { margin-left: 0; }
.agent { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 600; }

/* status: a dot plus a word, color is never the only signal */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.open, .status.claimed { color: var(--warn); } .status.done { color: var(--ok); } .status.declined, .status.expired { color: var(--bad); }

/* ---- feed ---- */
.day { font-size: 13px; font-weight: 700; color: var(--ink2); padding: var(--s4) var(--s4) var(--s2); }
.feed > li:first-child .day { padding-top: var(--s3); }
.ev { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: start; padding: var(--s3) var(--s4); color: var(--ink); }
a.ev:hover { background: var(--canvas); text-decoration: none; }
.ev .what { font-weight: 600; } .ev .when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.ev .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---- grids: projects, agents ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s4); }
.project { display: flex; flex-direction: column; overflow: hidden; color: var(--ink); }
.project:hover { border-color: var(--line-strong); text-decoration: none; }
.mosaic { aspect-ratio: 16 / 9; display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; gap: 1px; background: var(--line); overflow: hidden; }
.mosaic.one { grid-template-columns: 1fr; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0; background: var(--sunk); }
.mosaic .ph { grid-column: 1 / -1; display: grid; place-items: center; background: var(--sunk); color: var(--muted); }
.mosaic .ph .i { width: 32px; height: 32px; stroke-width: 1.4; }
.project .body { padding: var(--s3) var(--s4) var(--s4); display: grid; gap: var(--s1); }
.project .name { font-weight: 700; font-size: 17px; }
.agent-card { padding: var(--s4) var(--s5); display: grid; gap: var(--s4); color: var(--ink); }
.agent-card:hover { border-color: var(--line-strong); text-decoration: none; }
.agent-card .head { display: flex; align-items: center; gap: var(--s3); }
.agent-card .name { font-weight: 700; font-size: 17px; }
.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin: 0; }
.figures div { display: flex; flex-direction: column; } .figures dt { font-size: 13px; color: var(--muted); order: 2; } .figures dd { margin: 0; font-size: 20px; font-weight: 700; order: 1; }

/* ---- drop page ---- */
.drop-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin-top: var(--s3); color: var(--ink2); font-size: 14px; }
.drop-meta .sep { width: 1px; height: 14px; background: var(--line-strong); }
.idchip { display: inline-flex; align-items: center; gap: var(--s1); padding: 2px 2px 2px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--surface); }
.saved { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; padding: var(--s4) var(--s5); margin-bottom: var(--s5);
         border: 1px solid color-mix(in srgb, var(--ok) 40%, var(--line)); border-left: 4px solid var(--ok); border-radius: var(--r-panel); background: var(--surface); }
.file { overflow: hidden; }
.file-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.file-head .name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.file-head .name small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.file-body img, .file-body video { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; background: var(--sunk); }
.file-body audio { display: block; width: 100%; padding: var(--s3); }
.preview-btn { margin: var(--s3) var(--s4); }
.doc { padding: var(--s4) var(--s5); overflow-x: auto; overflow-wrap: anywhere; max-width: 78ch; line-height: 1.6; }
.doc h1, .doc h2, .doc h3 { line-height: 1.25; margin: 1.2em 0 .4em; max-width: none; } .doc h1 { font-size: 24px; } .doc h2 { font-size: 20px; } .doc h3 { font-size: 17px; }
.doc img { max-width: 100%; } .doc code { font-family: var(--mono); font-size: .9em; }
.doc table, .grid-t { border-collapse: collapse; font-size: 14px; }
.doc td, .doc th, .grid-t td, .grid-t th { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.grid-t th { background: var(--canvas); font-weight: 700; }
.scroll { overflow: auto; max-height: 70vh; }
pre { margin: 0; padding: var(--s4) var(--s5); overflow: auto; max-height: 70vh; font: 13px/1.6 var(--mono); }
pre code.hljs { padding: 0; background: transparent; }
.sheet-tabs { display: flex; flex-wrap: wrap; gap: var(--s2); padding: var(--s3) var(--s4) 0; }
.pages { display: grid; gap: var(--s2); padding: var(--s3); background: var(--sunk); }
.pages canvas { width: 100%; height: auto; display: block; background: #fff; border-radius: 3px; }
.page-frame { width: 100%; height: 70vh; border: 0; display: block; background: #fff; }
.clamp { max-height: 460px; overflow: hidden; position: relative; }
.clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 96px; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
.expand { display: flex; justify-content: center; padding: var(--s3); border-top: 1px solid var(--line); }
.facts { margin: 0; display: grid; grid-template-columns: minmax(120px, 180px) 1fr; }
.facts dt, .facts dd { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); margin: 0; }
.facts dt { color: var(--muted); font-size: 14px; } .facts dd { overflow-wrap: anywhere; }
.facts dt:first-of-type, .facts dt:first-of-type + dd { border-top: 0; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } .facts dd { border-top: 0; padding-top: 0; } }
details.disclose > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); cursor: pointer; font-weight: 600; list-style: none; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary .i { transition: transform .15s; } details.disclose[open] > summary .i { transform: rotate(90deg); }
details.disclose[open] > summary { border-bottom: 1px solid var(--line); }
.diffsum { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); font-size: 14px; color: var(--ink2); }
.diff { margin: 0; font: 12.5px/1.6 var(--mono); max-height: 60vh; overflow: auto; padding: var(--s2) 0; border-top: 1px solid var(--line); }
.diff div { padding: 0 var(--s4); white-space: pre-wrap; overflow-wrap: anywhere; }
.diff .a { background: color-mix(in srgb, var(--ok) 13%, transparent); } .diff .d { background: color-mix(in srgb, var(--bad) 13%, transparent); }
.diff .h { color: var(--muted); }

/* ---- the transit map (signature) ---- */
.map { overflow-x: auto; padding: var(--s3) var(--s2) var(--s2); }
.map svg { display: block; }
.map .rail { fill: none; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.map .lane-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.map .stop { stroke-width: 4; fill: var(--surface); }
.map .stop.cur { stroke-width: 6; }
.map .lane-name { font: 700 12px var(--font); fill: var(--muted); }
.map .stop-name { font: 600 13px var(--font); fill: var(--ink); }
.map .stop-meta { font: 400 12px var(--font); fill: var(--muted); }
.map a:hover .stop-name { fill: var(--accent); }
.map a:focus { outline: none; } .map a:focus-visible .stop { stroke-width: 8; }
@media (prefers-reduced-motion: no-preference) {
  .map.draw .rail { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: rail-in .9s cubic-bezier(.3, .7, .2, 1) forwards; animation-delay: var(--delay); }
  .map.draw .station { opacity: 0; animation: stop-in .3s ease forwards; animation-delay: var(--delay); }
}
@keyframes rail-in { to { stroke-dashoffset: 0; } }
@keyframes stop-in { to { opacity: 1; } }

/* project tree */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree { padding: var(--s2); }
.tree ul { margin-left: 23px; padding-left: var(--s3); border-left: 2px solid var(--line); }
.tnode { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: var(--s2) var(--s3); border-radius: var(--r-ctl); color: var(--ink); }
.tnode:hover { background: var(--canvas); text-decoration: none; }
.tnode .t { font-weight: 600; } .tnode .s { font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--sunk); border-radius: 8px; }
.seg a { padding: 4px 12px; border-radius: var(--r-ctl); color: var(--ink2); font-weight: 600; font-size: 14px; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.filters { display: flex; flex-wrap: wrap; gap: var(--s1); }
.filters a { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink2); font-size: 13px; font-weight: 600; }
.filters a:hover { text-decoration: none; background: var(--sunk); }
.filters a[aria-current="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* ---- settings ---- */
.settings { display: grid; gap: var(--s4); }
.set { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: var(--s5); padding: var(--s5); }
.set > header p { margin: var(--s1) 0 0; color: var(--muted); font-size: 14px; }
.set > div { display: grid; gap: var(--s3); align-content: start; }
@media (max-width: 760px) { .set { grid-template-columns: 1fr; gap: var(--s3); padding: var(--s4); } }
.kv { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.kv:first-child { border-top: 0; padding-top: 0; }
.meter { height: 8px; border-radius: 4px; background: var(--sunk); overflow: hidden; } .meter div { height: 100%; background: var(--accent); }
.codebox { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s2) var(--s2) var(--s2) var(--s3); background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-ctl); }
.codebox code { flex: 1; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 6px; }
.tag { font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 2px 6px; }

/* ---- editors ---- */
.editor { overflow: hidden; }
.ed-tools, .ed-tabs { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.ed-stage { padding: var(--s3); display: grid; place-items: center; background: var(--sunk); }
.ed-wrap { position: relative; max-width: 100%; line-height: 0; }
.ed-wrap canvas { max-width: 100%; max-height: 64vh; width: auto; height: auto; display: block; }
.ed-over { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-height: none !important; }
.swatches { display: inline-flex; gap: var(--s2); }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; padding: 0; }
.sw.on { box-shadow: 0 0 0 2px var(--accent); }
.code-edit { width: 100%; min-height: 60vh; border: 0; border-radius: 0; padding: var(--s4) var(--s5); background: var(--surface); resize: vertical; font: 13px/1.6 var(--mono); }
.code-edit:focus { outline: none; }

/* ---- feedback: skeletons, dialog, toast ---- */
.sk { background: var(--sunk); border-radius: 4px; }
.sk-line { height: 12px; margin: 6px 0; } .sk-title { height: 30px; width: 40%; margin-bottom: var(--s5); }
@media (prefers-reduced-motion: no-preference) {
  .sk { background: linear-gradient(90deg, var(--sunk) 0%, var(--line) 50%, var(--sunk) 100%); background-size: 200% 100%; animation: sk 1.4s ease infinite; }
}
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }
dialog.dlg { border: 1px solid var(--line); border-radius: var(--r-panel); padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--float); }
dialog.dlg::backdrop { background: rgba(0, 0, 0, .4); }
dialog.dlg .dbody { padding: var(--s5); display: grid; gap: var(--s2); } dialog.dlg h2 { font-size: 20px; }
dialog.dlg .dbody p { margin: 0; color: var(--ink2); }
dialog.dlg .dfoot { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s4) var(--s5); border-top: 1px solid var(--line); }
#toast { position: fixed; left: 50%; bottom: calc(var(--s5) + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
         display: flex; align-items: center; gap: var(--s2); background: var(--ink); color: var(--surface); padding: var(--s2) var(--s4); border-radius: 8px; font-size: 14px; box-shadow: var(--float); }
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--s4); }
.auth .panel { width: 100%; max-width: 400px; padding: var(--s6); }
.auth .brand { padding: 0; margin-bottom: var(--s5); }
.legal-links { margin-top: var(--s5); font-size: 13px; color: var(--muted); display: flex; gap: var(--s4); justify-content: center; }
.legal-links a { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

@media (max-width: 560px) { .drop-meta .sep { display: none; } .drop-meta { gap: 6px 14px; } }
