/* Ropeway web app. A catalogue of your agents' work: off-white paper, near-black type, a floating bar,
   perforated cards with small tag pills. Black is the action color; Ropeway orange only marks "live" and links.
   Type: Helvetica Neue for display (light, large, tight), Inter for UI, Overpass Mono for pills and IDs. */

@font-face { font-family: "Inter"; src: url("/app/fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/app/fonts/inter-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/app/fonts/inter-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/app/fonts/inter-700.woff2") format("woff2"); font-weight: 700; 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: #FBFBFB; --surface: #FFFFFF; --sunk: #F3F3F4; --ink: #0A0A0A; --ink2: #3F3F46; --muted: #71717A;
  --line: #E8E8EA; --line-strong: #D8D8DC; --dots: #D4D4D8;
  --accent: #0A0A0A; --accent-ink: #FFFFFF; --accent-soft: #F1F1F2; --brand: #E35D00;
  --ok: #0B7A4B; --warn: #A15C00; --bad: #C42B2B;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --r-ctl: 10px; --r-panel: 12px; --r-bar: 16px;
  --float: 0 10px 30px rgba(10, 10, 10, .08), 0 2px 6px rgba(10, 10, 10, .05);
  --card-shadow: 0 1px 2px rgba(10, 10, 10, .04), 0 4px 14px rgba(10, 10, 10, .03);
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --display: "Helvetica Neue", Helvetica, Arial, "Inter", sans-serif;
  --mono: "Overpass Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0A0A0A; --surface: #121214; --sunk: #1A1A1D; --ink: #FAFAFA; --ink2: #D4D4D8; --muted: #9A9AA3;
    --line: #232327; --line-strong: #303036; --dots: #3A3A40;
    --accent: #FAFAFA; --accent-ink: #0A0A0A; --accent-soft: #1F1F23; --brand: #FF8A3D;
    --ok: #43C98F; --warn: #E9B04E; --bad: #FF7A72;
    --float: 0 12px 34px rgba(0, 0, 0, .5); --card-shadow: 0 1px 2px rgba(0, 0, 0, .4); 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 14.5px/1.55 var(--font); font-feature-settings: "kern", "cv11"; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration: none; }
p a, .doc a, li a:not([class]), dd a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
p a:hover, .doc a:hover, dd a:hover { text-decoration-color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 15px; height: 15px; }
.muted { color: var(--muted); } .ink2 { color: var(--ink2); } .t13 { font-size: 13px; } .t12 { font-size: 12px; }
.id { font: 600 12.5px/1 var(--mono); letter-spacing: .02em; color: var(--ink2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- shell: a quiet sidebar and a floating search bar ---- */
:root { --side: 240px; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 40; display: flex; flex-direction: column; gap: var(--s5);
        padding: calc(var(--s5) + env(safe-area-inset-top)) var(--s3) var(--s4); background: var(--canvas); border-right: 1px solid var(--line);
        transition: transform .2s ease; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 var(--s2); color: var(--ink); font: 600 17px/1 var(--display); letter-spacing: -.02em; text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: var(--s3); padding: 8px 10px; border-radius: 9px; color: var(--ink2); font-weight: 500; text-decoration: none; }
.nav a .i { color: var(--muted); }
.nav a:hover { background: var(--sunk); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--card-shadow); outline: 1px solid var(--line); }
.nav a[aria-current="page"] .i { color: var(--ink); }
.side-card { position: relative; margin-top: auto; padding: 16px 14px 14px; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface);
             box-shadow: var(--card-shadow); display: grid; gap: 6px; overflow: hidden; }
.side-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: radial-gradient(var(--dots) 1px, transparent 1.3px) 2px 1px / 5px 5px repeat-x; }
.side-card b { font-size: 13.5px; } .side-card p { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.side-card code { font: 600 11.5px var(--mono); color: var(--ink2); }
.side-foot { display: flex; gap: var(--s4); padding: 0 var(--s2); font-size: 12.5px; }
.side-foot a { color: var(--muted); text-decoration: none; } .side-foot a:hover { color: var(--ink); }
.main-col { margin-left: var(--side); min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; padding: calc(var(--s3) + env(safe-area-inset-top)) var(--s5) 0; }
.bar { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: var(--s3); height: 58px; padding: 0 var(--s3);
       background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
       border: 1px solid var(--line); border-radius: var(--r-bar); box-shadow: var(--float); }
.search { position: relative; display: flex; align-items: center; flex: 1; max-width: 520px; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; width: 16px; height: 16px; }
.search input { width: 100%; height: 38px; padding: 0 36px 0 34px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--canvas); }
.search input:focus { outline: none; border-color: var(--line-strong); background: var(--surface); }
.search kbd { position: absolute; right: 9px; font: 600 11px/1 var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; background: var(--surface); }
.top-actions { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }
.me { position: relative; }
.me > summary { list-style: none; cursor: pointer; border-radius: 50%; }
.me > summary::-webkit-details-marker { display: none; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--canvas); font-weight: 600; font-size: 14px; }
.me .menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line);
            border-radius: var(--r-panel); box-shadow: var(--float); display: grid; }
.me .menu a, .me .menu button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink2); background: none; border: 0;
            text-align: left; cursor: pointer; text-decoration: none; font-weight: 500; }
.me .menu a:hover, .me .menu button:hover { background: var(--sunk); color: var(--ink); }
.menu-who { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.menu-btn { display: none !important; }
.scrim { display: none; }
main#view { max-width: 1120px; margin: 0 auto; padding: var(--s7) var(--s5) var(--s8); }
@media (max-width: 960px) {
  .side { transform: translateX(-104%); box-shadow: var(--float); background: var(--surface); }
  body.drawer .side { transform: none; }
  body.drawer .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 35; }
  .main-col { margin-left: 0; }
  .menu-btn { display: inline-flex !important; }
  .topbar { padding-left: var(--s4); padding-right: var(--s4); }
  .search kbd { display: none; } .top-actions .label { display: none; } .top-actions .btn.primary { width: 38px; padding: 0; }
  .bar { padding: 0 var(--s2); gap: var(--s2); }
  main#view { padding: var(--s6) 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: 400 36px/1.1 var(--display); letter-spacing: -0.03em; margin: 0; max-width: 34ch; }
.lede { margin: var(--s2) 0 0; color: var(--ink2); max-width: 64ch; }
h2 { font: 400 22px/1.25 var(--display); letter-spacing: -0.02em; 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); background: var(--surface); color: var(--ink);
       font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important; box-shadow: 0 1px 1px rgba(10, 10, 10, .03); }
.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) 82%, var(--canvas)); }
.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); box-shadow: var(--card-shadow); }
.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; } }

/* ---- home hero ---- */
.hero { position: relative; text-align: center; padding: var(--s6) 0 var(--s7); display: grid; justify-items: center; gap: var(--s4); }
.hero::before { content: ""; position: absolute; inset: -48px -40px 0; z-index: -1; pointer-events: none;
  background: radial-gradient(var(--dots) 1px, transparent 1.2px) 0 0 / 14px 14px;
  -webkit-mask-image: radial-gradient(60% 70% at 50% 40%, #000 0%, transparent 75%); mask-image: radial-gradient(60% 70% at 50% 40%, #000 0%, transparent 75%); opacity: .7; }
.stat-pill { display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font: 600 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); box-shadow: var(--card-shadow); }
.stat-pill .sep { width: 1px; height: 11px; background: var(--line-strong); }
.stat-pill .live { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.display { font: 400 clamp(40px, 6.4vw, 76px)/1 var(--display); letter-spacing: -0.045em; margin: 0; max-width: 14ch; text-wrap: balance; }
.display span { display: block; color: var(--muted); }
.display.sm { font-size: clamp(34px, 4.6vw, 52px); max-width: none; }
.hero-sub { margin: 0; max-width: 54ch; color: var(--ink2); font-size: 16px; }
.hero-search { position: relative; width: min(560px, 100%); margin-top: var(--s2); }
.hero-search .i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.hero-search input { width: 100%; height: 52px; padding: 0 18px 0 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  font-size: 15px; box-shadow: var(--float); }
.hero-search input:focus { outline: none; border-color: var(--line-strong); }
.chips { display: flex; gap: var(--s2); margin-top: var(--s4); max-width: 100%; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink2);
  font: 600 11px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; text-decoration: none; }
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--canvas); }

/* ---- bands: full-width sections with a headline and a "view all" pill ---- */
.band { padding: var(--s7) 0 var(--s2); }
.band + .band { border-top: 1px solid var(--line); }
.band-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.band-head h2 { font: 400 clamp(26px, 2.6vw, 32px)/1.15 var(--display); letter-spacing: -0.03em; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink2); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; box-shadow: var(--card-shadow); }
.pill-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.page-head { display: grid; gap: var(--s3); margin-bottom: var(--s6); }

/* ---- cards ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--s4); }
.card { position: relative; display: flex; flex-direction: column; gap: var(--s2); padding: 18px 18px 14px; min-width: 0; color: var(--ink); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--card-shadow); overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: radial-gradient(var(--dots) 1px, transparent 1.3px) 2px 1px / 5px 5px repeat-x; }
.card:hover { border-color: var(--line-strong); box-shadow: var(--float); }
@media (prefers-reduced-motion: no-preference) { .card:hover { transform: translateY(-1px); } }
.card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-title { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-go { color: var(--muted); width: 16px; height: 16px; }
.card:hover .card-go { color: var(--ink); }
.card-desc { margin: 0; color: var(--ink2); font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: auto; padding-top: var(--s2); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.pill { padding: 3px 7px; border: 1px solid var(--line-strong); border-radius: 5px; font: 600 10.5px/1.2 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--ink2);
  white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.card-stat { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mark { width: 26px; height: 26px; flex: none; border-radius: 7px; display: grid; place-items: center; overflow: hidden; background: var(--sunk); color: var(--ink2); }
.mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .bullet { width: 24px; height: 24px; }
.empty { padding: var(--s6) var(--s5); text-align: center; color: var(--ink2); }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } .band { padding-top: var(--s6); } .hero { padding-top: var(--s4); } }

/* sign in, in the same voice */
.auth { background: var(--canvas); }
.auth .panel { box-shadow: var(--float); border-radius: var(--r-bar); }
.auth h1 { font: 400 30px/1.1 var(--display); letter-spacing: -0.03em; }
