/* ---------- Shell ------------------------------------------------------------------------------ */

.shell {
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--inbox-w);
    grid-template-rows: var(--bar-h) minmax(0, 1fr) auto;
    grid-template-areas: "rail bar inbox" "rail stage inbox" "rail strip inbox";
    height: 100vh;
    overflow: hidden;
}
.shell.inbox-collapsed { --inbox-w: 48px; }
.lifted-shell { --tray-h: clamp(286px, 34vh, 340px); }
@media (max-height: 700px) { .lifted-shell { --tray-h: 256px; } }

/* Below 1440 the inbox folds to a strip unless the person opened it. In Lift the stage keeps its width: an opened
   inbox slides over the stage instead of taking a column. */
@media (max-width: 1439px) {
    .shell { --inbox-w: 48px; }
    .shell.inbox-open { --inbox-w: 320px; }
    .lifted-shell.inbox-open { --inbox-w: 48px; }
    .lifted-shell.inbox-open .inbox { position: fixed; top: 0; right: 0; bottom: 0; width: 320px; z-index: 76; box-shadow: -6px 0 0 var(--shadow); }
}
@media (max-width: 767px) { .shell { grid-template-columns: 0 1fr 0; } .rail, .inbox { display: none; } }

/* ---------- Deck rail -------------------------------------------------------------------------- */

.rail {
    grid-area: rail;
    display: flex; flex-direction: column; align-items: center; gap: var(--s2);
    padding: var(--s3) 0;
    border-right: 1px solid var(--hairline);
    background: var(--surface);
}
.wordmark {
    width: 40px; height: 40px; display: grid; place-items: center;
    background: var(--surface) url("/brand/icon-192.png") center/cover no-repeat; color: transparent;
    font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: -0.04em;
    clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
    text-decoration: none; margin-bottom: var(--s2);
}
.rail-spine {
    width: 44px; height: 44px; display: grid; place-items: center; position: relative;
    border: 1px solid var(--hairline); background: var(--bg); cursor: pointer; text-decoration: none;
    font-family: var(--font-mono); font-size: 10px; font-weight: 500;
    clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}
.rail-spine.active { border-color: var(--ink); background: var(--raised); }
.rail-spine.active::after { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; background: var(--accent); }
.rail-spine .mini { position: absolute; bottom: 5px; left: 7px; right: 7px; display: flex; gap: 1px; }
.rail-spine .mini i { flex: 1; height: 3px; background: var(--cat); }
/* Chamfered shapes clip an outline, so focus is drawn inside the edge: ink, then ground. */
.rail-spine:focus-visible, .wordmark:focus-visible, .cartridge:focus-visible, .key-button:focus-visible, .agg-link:focus-visible {
    outline: none; box-shadow: inset 0 0 0 2px var(--focus), inset 0 0 0 4px var(--bg);
}
.rail-spacer { flex: 1; }
.rail-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid transparent; background: none; cursor: pointer; border-radius: var(--radius); color: var(--ink-2); }
.rail-btn:hover { border-color: var(--hairline); color: var(--ink); }
.person-chip { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--ink); display: grid; place-items: center; font-family: var(--font-mono); font-size: 10px; background: var(--raised); cursor: pointer; padding: 0; }
.rail-pop { position: fixed; left: calc(var(--rail-w) + 8px); top: 120px; z-index: 95; width: 280px; display: grid; gap: var(--s3); padding: var(--s3); background: var(--raised); border: 1px solid var(--ink); box-shadow: 6px 6px 0 var(--shadow); }
.rail-pop h2 { margin: 0; }
.person-pop { top: auto; bottom: 12px; }
.person-pop form { display: contents; }

/* ---------- Console bar ------------------------------------------------------------------------ */

.bar {
    grid-area: bar;
    display: flex; align-items: center; gap: var(--s3);
    padding: 0 var(--s4);
    border-bottom: 1px solid var(--hairline);
    background: var(--surface);
    min-width: 0;
}
.crumbs { display: flex; align-items: baseline; gap: var(--s2); white-space: nowrap; flex: 0 1 auto; min-width: 140px; overflow: hidden; }
.crumbs .org { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumbs .deck-name { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 72px; margin: 0; }
.crumbs .sep { color: var(--ink-3); flex: none; }
.version-chip { font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--hairline); padding: 1px 6px; border-radius: var(--radius); color: var(--ink-2); flex: none; white-space: nowrap; }
@media (max-width: 1279px) { .crumbs .org, .crumbs .sep, .crumbs .role-chip { display: none; } }
.bar-spacer { flex: 1; }
.search-trigger {
    display: flex; align-items: center; gap: var(--s3); height: 32px; min-width: 220px; padding: 0 var(--s3); flex: none;
    border: 1px solid var(--field-border); background: var(--bg); cursor: pointer; color: var(--ink-2); border-radius: var(--radius);
}
/* Below 1600 the search field folds to its key, so the zoom switch never leaves the bar. */
@media (max-width: 1599px) { .search-trigger { min-width: 0; padding: 0 var(--s1); } .search-trigger .search-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
.lens-rings { display: flex; gap: var(--s1); align-items: center; flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.lens-rings input { flex: none; }
.lens-ring {
    height: 26px; padding: 0 10px; border: 1.5px solid var(--accent); border-radius: 13px; background: transparent; white-space: nowrap; flex: none;
    font-family: var(--font-mono); font-size: 10px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.lens-ring.add { border-style: dashed; border-color: var(--ink-3); color: var(--ink-2); }
.lens-ring .x { color: var(--ink-3); }
.zoom-switch { display: flex; border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; flex: none; }
.presence { flex: none; }
.zoom-switch button { height: 30px; padding: 0 var(--s3); border: 0; background: var(--bg); cursor: pointer; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.zoom-switch button.on { background: var(--accent); color: var(--accent-ink); }

.draft-bar {
    display: flex; align-items: center; gap: var(--s2); height: 30px; padding: 0 3px 0 var(--s2); flex: none;
    border: 1px dashed var(--accent); border-radius: var(--radius); background: var(--raised); white-space: nowrap;
    font-family: var(--font-text); letter-spacing: 0; text-transform: none; color: var(--ink);
}
.draft-bar .count { font-family: var(--font-mono); font-size: 11px; }
.draft-bar.stale { border-color: var(--sig-you-line); }
.presence { display: flex; }
.presence span { width: 26px; height: 26px; margin-left: -6px; border-radius: 50%; border: 1.5px solid var(--surface); background: var(--ink); color: var(--bg); display: grid; place-items: center; font-family: var(--font-mono); font-size: 10px; }
.presence span.lifted { box-shadow: 0 0 0 2px var(--sig-you); }

/* ---------- Stage (the spine surface) ---------------------------------------------------------- */

.stage-area {
    grid-area: stage;
    position: relative;
    overflow: auto;
    min-width: 0; min-height: 0;
    background: var(--bg);
}
.stage-area:focus-visible { outline-offset: -2px; }
.stage-area.lifted {
    background-color: var(--bg);
    background-image: radial-gradient(var(--hairline) 1px, transparent 1.2px);
    background-size: 24px 24px;
}
.camera { transform-origin: 0 0; transition: transform 420ms var(--ease-settle), opacity 300ms; }
.camera.zooming-out { transform: scale(0.42); opacity: 0; }

.spine {
    display: flex; align-items: stretch; gap: 0;
    padding: var(--s6) var(--s6) var(--s12) var(--s4);
    min-height: 100%;
    width: max-content;
}

/* Channel ports: half discs on the spine edges. */
.edge { display: flex; flex-direction: column; gap: var(--s3); justify-content: flex-start; padding-top: 72px; width: 28px; flex: none; position: relative; }
.edge .edge-dock { position: absolute; inset: 60px 0 auto 0; height: 140px; }
.port {
    width: 24px; height: 44px; background: var(--surface); border: 1.5px solid var(--ink); position: relative; cursor: grab;
    display: grid; place-items: center;
}
.port.intake { border-radius: 0 22px 22px 0; border-left: 0; }
.port.outlet { border-radius: 22px 0 0 22px; border-right: 0; margin-left: 6px; }
.port .port-label { position: absolute; top: 50%; transform: translateY(-50%) rotate(-90deg); font-family: var(--font-mono); font-size: 10px; white-space: nowrap; letter-spacing: 0.08em; text-transform: uppercase; }
.port.intake .port-label { left: -34px; }
.port.outlet .port-label { right: -34px; }
.port.glow { border-color: var(--sig-you-line); box-shadow: 0 0 10px var(--sig-you); }

/* Stage plate: tall plate, 45-degree chamfer top-left, category color on the chamfer edge. */
.plate {
    --pad: var(--s3);
    position: relative;
    width: var(--col-w);
    flex: none;
    display: flex; flex-direction: column;
    background: var(--hairline);
    clip-path: polygon(var(--chamfer-plate) 0, 100% 0, 100% 100%, 0 100%, 0 var(--chamfer-plate));
    padding: 1px;
    transition: transform var(--t-settle) var(--ease-settle), opacity var(--t-settle);
}
.plate-inner {
    position: relative; flex: 1; display: flex; flex-direction: column;
    background: var(--surface);
    clip-path: polygon(calc(var(--chamfer-plate) - 0.5px) 0, 100% 0, 100% 100%, 0 100%, 0 calc(var(--chamfer-plate) - 0.5px));
    min-height: 420px;
}
.plate .chamfer-edge { position: absolute; left: 0; top: 0; width: 14px; height: 14px; pointer-events: none; z-index: 2; }
.plate .chamfer-edge line { stroke: var(--cat); stroke-width: 4; }
.plate.empty-spine { background: repeating-linear-gradient(135deg, var(--hairline) 0 6px, transparent 6px 10px); }
.plate.canceled .plate-inner { background-image: repeating-linear-gradient(135deg, transparent 0 7px, var(--grid) 7px 8px); }
.plate-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: var(--s2); padding: var(--s4) var(--pad) var(--s2) var(--s6); border-bottom: 1px solid var(--hairline); position: relative; }
.plate-head .count { font-family: var(--font-display); font-size: 64px; font-weight: 600; line-height: 0.82; letter-spacing: -0.05em; }
.plate-head .count.zero { color: var(--ink-3); }
.plate-head .name { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin-top: var(--s2); display: flex; gap: var(--s2); align-items: center; }
.plate-head .cat-tag { font-family: var(--font-mono); font-size: 10px; padding: 1px 5px; border: 1px solid var(--cat); color: var(--ink); text-transform: uppercase; letter-spacing: 0.06em; }
.plate-head .wip { font-family: var(--font-mono); font-size: 10px; color: var(--ink-2); }
.plate-head .wip.over { color: var(--sig-alarm-text); }
.plate-pucks { display: flex; gap: var(--s1); flex-wrap: wrap; justify-content: flex-end; align-items: center; min-height: 36px; }
.plate-body { flex: 1; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3) 7px var(--s6); position: relative; }
.plate.drop-valid .plate-inner { background: var(--raised); }
.plate.drop-valid { background: var(--ink); }
.plate.drop-invalid { opacity: 0.55; }
.plate.drop-hot { background: var(--ink); }
.plate.drop-hot .plate-inner { background: var(--raised); box-shadow: inset 0 0 0 2px var(--ink); }
.plate-empty { border: 1px dashed var(--hairline); color: var(--ink-2); padding: var(--s4); text-align: center; font-size: 12px; }
.plate .fold {
    position: absolute; right: 0; top: 0; width: 24px; height: 24px; border: 0; padding: 0; cursor: pointer; z-index: 3;
    background: linear-gradient(225deg, var(--bg) 50%, var(--ink-3) 50%);
    opacity: 0.55; transition: opacity var(--t-settle);
}
.plate:hover .fold, .plate:focus-within .fold, .lifted .plate .fold, .plate .fold:focus-visible { opacity: 1; }
.plate .fold:focus-visible { outline-offset: -3px; }
.plate:focus-visible { outline: none; background: var(--focus); }
.plate:focus-visible > .plate-inner { box-shadow: inset 0 0 0 2px var(--focus); }
.plate.draft-changed { background: none; }
.plate.draft-changed::before { content: ""; position: absolute; inset: 0; border: 1px dashed var(--ink); pointer-events: none; z-index: 4; clip-path: inherit; }
.plate.selected .plate-inner { box-shadow: inset 0 0 0 2px var(--ink); }

/* Reflex tabs: small triangles on plate edges. */
.reflex-row { display: flex; gap: 0; position: absolute; top: 0; z-index: 3; }
.reflex-row.enter { left: 16px; }
.reflex-row.exit { right: 26px; }
/* The triangle is 12px; the button around it is a 24px target. */
.reflex-tab { width: 24px; height: 24px; background: none; cursor: pointer; border: 0; padding: 0; position: relative; display: grid; place-items: center; }
.reflex-tab::before { content: ""; width: 12px; height: 12px; background: var(--ink); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.reflex-row.exit .reflex-tab::before { clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.reflex-tab.draft::before { background: repeating-linear-gradient(135deg, var(--ink) 0 2px, transparent 2px 4px); }
.reflex-tab:focus-visible { outline-offset: -2px; }
.reflex-tab.tray-reflex { width: 26px; height: 26px; }
.reflex-tab.tray-reflex::before { width: 22px; height: 22px; }
.stage-edge-dock { position: absolute; top: 0; height: 26px; width: 44%; z-index: 5; }
.stage-edge-dock.enter { left: 14px; }
.stage-edge-dock.exit { right: 4px; }

/* Seams and gates: narrow keys, a bar with a diamond head, between plates. */
.seam { width: 30px; flex: none; position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 112px; gap: var(--s3); }
.seam::before { content: ""; position: absolute; top: 20px; bottom: 20px; left: 50%; border-left: 1px solid var(--hairline); }
.lifted .seam::before { border-left-style: dashed; border-left-color: var(--ink-3); }
.seam-dock { position: absolute; inset: 60px 2px 60px 2px; z-index: 5; }
.gate-key { position: relative; width: 24px; height: 64px; cursor: pointer; background: none; border: 0; padding: 0; z-index: 6; }
.gate-key .shaft { position: absolute; left: 10px; top: 14px; width: 4px; bottom: 0; background: var(--ink); }
.gate-key .head { position: absolute; left: 5px; top: 0; width: 14px; height: 14px; background: var(--ink); transform: rotate(45deg); }
.gate-key.failing .head, .gate-key.failing .shaft { background: var(--sig-alarm); }
.gate-key.draft .head, .gate-key.draft .shaft { background: transparent; outline: 1.5px dashed var(--ink); }
.gate-key .gate-label { position: absolute; left: 50%; top: 72px; transform: translateX(-50%); writing-mode: vertical-rl; white-space: nowrap; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.seam .gate-key + .gate-key { margin-top: 90px; }

/* Agent puck: circle, two-letter monogram, runtime ring. */
.puck {
    --ring: var(--hairline);
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center; position: relative; flex: none;
    background: var(--raised); color: var(--ink);
    border: 2px solid var(--ink);
    box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--ring);
    font-family: var(--font-mono); font-size: 10px; font-weight: 500;
    cursor: grab; padding: 0;
}
.puck.small { width: 24px; height: 24px; font-size: 10px; border-width: 1.5px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--ring); }
.puck.working { --ring: var(--sig-live-line); }
.puck.working::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--sig-live-line); animation: orbit 1.8s linear infinite; }
.puck.waiting { --ring: var(--sig-you-line); }
.puck.offline { --ring: var(--ink-3); background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--hairline) 3px 4px); }
.puck.draft { border-style: dashed; }
.puck .tools { position: absolute; bottom: -8px; right: -10px; display: flex; gap: 1px; }
@keyframes orbit { to { transform: rotate(360deg); } }

/* Tool chip: small hexagon. */
.chip {
    width: 16px; height: 14px; background: var(--ink); display: inline-block; flex: none;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.chip.big { width: 34px; height: 28px; display: grid; place-items: center; color: var(--bg); font-family: var(--font-mono); font-size: 10px; }
.chip.approval { background: var(--sig-you); }

/* Docks: only valid docks light up, as outlines of the module's own silhouette. */
[data-dock] { transition: background var(--t-settle), outline-color var(--t-settle); }
.dragging [data-dock].dock-valid { outline: 1.5px dashed var(--accent); outline-offset: -2px; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.dragging [data-dock].dock-hot { outline: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.dragging [data-dock].dock-invalid { outline: 1px dotted var(--ink-3); outline-offset: -2px; }
.keyboard-holding [data-dock].dock-valid { outline: 1.5px dashed var(--accent); outline-offset: -2px; }
.keyboard-holding [data-dock].dock-focus { outline: 2px solid var(--sig-you); background: color-mix(in srgb, var(--sig-you) 18%, transparent); }
.spine-slot { width: 14px; flex: none; position: relative; }
.spine-slot .spine-dock { position: absolute; inset: 20px -6px 20px -6px; z-index: 5; }
.dragging.holding-stage .spine-slot, .keyboard-holding.holding-stage .spine-slot { width: 44px; transition: width var(--t-settle) var(--ease-settle); }
.pulse-dock { outline: 2px solid var(--sig-you); outline-offset: -2px; animation: breathe 1.6s ease-in-out infinite; }

/* Lift mode: cards shrink and dim so the structure shows through. */
.lifted .card { opacity: 0.2; transform: scale(0.94); pointer-events: none; }
.lifted .plate { filter: none; }
.lifted .plate-inner { background: var(--surface); }
.board-dim .card { transition: opacity var(--t-settle), transform var(--t-settle); }

/* ---------- Cards ------------------------------------------------------------------------------ */

.card {
    position: relative;
    width: var(--card-w);
    background: var(--hairline);
    padding: 1px;
    clip-path: polygon(var(--chamfer-card) 0, 100% 0, 100% 100%, 0 100%, 0 var(--chamfer-card));
    cursor: pointer;
    transition: opacity var(--t-settle), transform var(--t-settle) var(--ease-settle);
    user-select: none;
}
.card-inner {
    background: var(--raised);
    clip-path: polygon(calc(var(--chamfer-card) - 0.5px) 0, 100% 0, 100% 100%, 0 100%, 0 calc(var(--chamfer-card) - 0.5px));
    padding: var(--s2) var(--s3) var(--s2) var(--s3);
    display: grid; gap: 6px;
    position: relative;
}
.card .chamfer-edge { position: absolute; left: 0; top: 0; width: 10px; height: 10px; z-index: 2; pointer-events: none; }
.card .chamfer-edge line { stroke: var(--cat); stroke-width: 3; }
.card:hover { background: var(--ink-3); }
.card:focus-visible { outline: none; background: var(--focus); }
.card:focus-visible .card-inner { box-shadow: inset 0 0 0 2px var(--focus); }
.card.selected { background: var(--ink); }
.card-top { display: flex; align-items: center; gap: var(--s2); }
.card-key { font-family: var(--font-mono); font-size: 10px; color: var(--ink-2); white-space: nowrap; }
.card-due { white-space: nowrap; font-size: 10px; }
.card-prio { font-family: var(--font-mono); font-size: 10px; margin-left: auto; }
.card-prio.p0 { color: var(--sig-alarm-text); }
.card-title { font-size: 15px; line-height: 1.3; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; gap: var(--s1); flex-wrap: wrap; align-items: center; }
.tag { font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--hairline); padding: 0 5px; line-height: 16px; color: var(--ink-2); }
.card-run { display: flex; align-items: center; gap: var(--s2); border-top: 1px solid var(--hairline); padding-top: 6px; font-size: 12px; min-width: 0; }
.card-run .run-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.card-run .cost { font-family: var(--font-mono); font-size: 10px; color: var(--ink-2); flex: none; white-space: nowrap; }
.card .last { font-family: var(--font-mono); font-size: 10px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card-foot { display: flex; align-items: center; gap: var(--s3); font-family: var(--font-mono); font-size: 10px; color: var(--ink-2); min-width: 0; }
.card-inner > * { min-width: 0; }
.card .corner-tab { position: absolute; right: 0; top: 0; width: 14px; height: 14px; clip-path: polygon(0 0, 100% 0, 100% 100%); z-index: 3; }
.card.waiting .corner-tab { background: var(--sig-you-line); }
.card.failed .corner-tab { background: var(--sig-alarm); }
.card .blocked-band { height: 8px; margin: -8px -12px 2px; background-image: repeating-linear-gradient(135deg, var(--sig-alarm) 0 4px, transparent 4px 8px); opacity: 0.8; }
.card .taint { width: 10px; height: 10px; flex: none; }
.card .taint path { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.card.ghost { background: none; outline: 1.5px dashed var(--ink); opacity: 0.8; }
.card.ghost .card-inner { background: transparent; }
.card.drag-source { opacity: 0.25; }

/* Run trace: 2px phosphor light travelling around the border; speed follows event rate. */
.trace { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; overflow: visible; }
.trace rect {
    fill: none; stroke: var(--sig-live); stroke-width: 2;
    stroke-dasharray: 48 952; stroke-dashoffset: 0;
    filter: drop-shadow(0 0 3px var(--sig-live));
    animation: trace var(--trace-period, 3600ms) linear infinite;
}
.trace.waiting rect { stroke: var(--sig-you-line); filter: drop-shadow(0 0 3px var(--sig-you)); animation-duration: 9000ms; stroke-dasharray: 1000 0; animation-name: breathe; }
:root[data-theme="light"] .trace rect, :root[data-theme="contrast"] .trace rect { stroke: var(--sig-live-line); filter: none; }
:root[data-theme="light"] .trace.waiting rect, :root[data-theme="contrast"] .trace.waiting rect { stroke: var(--sig-you-line); }
@keyframes trace { to { stroke-dashoffset: -1000; } }
@media (prefers-reduced-motion: reduce) { .trace rect, .trace.waiting rect { animation: none; stroke-dasharray: 1000 0; } }
:root[data-motion="calm"] .trace rect, :root[data-motion="calm"] .trace.waiting rect { animation: none; stroke-dasharray: 1000 0; }

/* ---------- Telemetry strip and Tray ----------------------------------------------------------- */

.strip {
    grid-area: strip;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s6);
    height: var(--strip-h); padding: 0 var(--s4);
    border-top: 1px solid var(--hairline); background: var(--surface);
}
.strip-left, .strip-right { display: flex; align-items: center; gap: var(--s6); min-width: 0; }
.strip-left { overflow-x: auto; scrollbar-width: none; }
.quota .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1439px) { .strip-right { gap: var(--s4); } .strip .quota + .quota { display: none; } }
@media (max-width: 1179px) { .strip .quota { display: none; } }
.strip-right { justify-content: flex-end; }
.lift-handle {
    display: grid; justify-items: center; gap: 2px; background: none; border: 0; cursor: pointer; padding: var(--s2) var(--s4);
}
.lift-handle .grip { width: 64px; height: 8px; border: 1.5px solid var(--ink); border-radius: 4px; position: relative; }
.lift-handle .grip::after { content: ""; position: absolute; left: 12px; right: 12px; top: 2px; border-top: 1px solid var(--ink); }
.lift-handle:hover .grip { background: var(--ink); }
.mini-bays { display: flex; gap: var(--s2); align-items: center; }
.mini-bay { display: grid; gap: 3px; padding: 5px 6px; border: 1px solid var(--hairline); background: var(--bg); cursor: pointer; }
.mini-bay .lights { display: flex; gap: 3px; }
.mini-bay .lights .light { width: 6px; height: 6px; }
.mini-bay .n { font-family: var(--font-mono); font-size: 10px; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-bay.empty { border-style: dashed; color: var(--ink-2); display: flex; align-items: center; font-size: 11px; gap: 6px; }
.stat { display: grid; gap: 0; }
.stat .v { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.stat .k { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); white-space: nowrap; }
.stat .v.you { color: var(--sig-you-text); }
.quota { display: grid; gap: 3px; width: 140px; }

.tray {
    grid-area: strip;
    height: var(--tray-h);
    border-top: 1px solid var(--accent);
    background: var(--raised);
    display: grid; grid-template-rows: auto auto minmax(0, 1fr);
    min-width: 0; min-height: 0;
    animation: tray-up var(--t-settle) var(--ease-settle);
}
.tray-head { display: flex; align-items: stretch; gap: var(--s3); border-bottom: 1px solid var(--hairline); padding: 0 var(--s2) 0 var(--s4); min-width: 0; }
@keyframes tray-up { from { transform: translateY(40px); opacity: 0; } }
.tray-tabs { display: flex; gap: 0; align-items: stretch; flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.tray-tabs button { flex: none; white-space: nowrap; background: none; border: 0; border-bottom: 2px solid transparent; padding: var(--s2) var(--s3); cursor: pointer; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.tray-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tray-hint { flex: 1 1 180px; min-width: 0; align-self: center; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.tray-head .lift-handle { flex: none; }
.tray-body { display: flex; gap: var(--s4); padding: var(--s3) var(--s4); overflow: auto; align-items: flex-start; min-height: 0; }
.tray-item {
    display: grid; justify-items: center; gap: var(--s2); padding: var(--s3); min-width: 92px;
    border: 1px solid transparent; background: none; cursor: grab; border-radius: var(--radius); touch-action: none;
}
.tray-item:hover, .tray-item:focus-visible { border-color: var(--hairline); background: var(--surface); }
.tray-item.holding { border-color: var(--sig-you-line); background: var(--surface); }
.tray-item .t-name { font-size: 12px; font-weight: 500; }
.tray-item .t-sub { font-family: var(--font-mono); font-size: 10px; color: var(--ink-2); max-width: 120px; text-align: center; }
.mini-plate { width: 48px; height: 64px; background: var(--surface); border: 1px solid var(--ink); position: relative; clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); }
.mini-plate::before { content: ""; position: absolute; left: -2px; top: -2px; width: 16px; height: 16px; background: linear-gradient(135deg, transparent 45%, var(--cat) 45% 60%, transparent 60%); }
.mini-key { width: 14px; height: 54px; position: relative; }
.mini-key::before { content: ""; position: absolute; left: 1px; top: 0; width: 12px; height: 12px; background: var(--ink); transform: rotate(45deg); }
.mini-key::after { content: ""; position: absolute; left: 5px; top: 12px; bottom: 0; width: 4px; background: var(--ink); }
.remove-zone { margin-left: auto; align-self: stretch; min-width: 140px; padding: var(--s2); text-align: center; border: 1px dashed var(--ink-3); display: grid; place-items: center; color: var(--ink-2); font-size: 12px; }

/* Drag ghost */
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; will-change: transform; filter: drop-shadow(4px 4px 0 var(--shadow)); }
.drag-ghost.snapping { transition: transform 160ms var(--ease-spring); }
.drag-reason { position: fixed; z-index: 1001; background: var(--ink); color: var(--bg); font-family: var(--font-mono); font-size: 10px; padding: 4px 8px; pointer-events: none; max-width: 280px; }
