/* Agentdock shell + yard map.
   The app shell: a dark dock sidebar (nav, zones, dispatch queue) beside the page column from 1040px; a compact top bar
   with a menu below that. The homepage is the yard map (src/views.ts homePage): zones of top-down containers on a
   pannable plan, an overhead gantry, and the dispatch console as a bottom sheet. Spacing runs on an 8px rhythm. */
:root { --side: 248px; --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s6: 48px; --s8: 64px; --ground: #d3dcdd; --ground-2: #c6d0d2; --paint: rgba(255, 255, 255, 0.78); }

/* type scale: compact and operational, the map carries the page */
h1 { font-size: clamp(2.05rem, 3.6vw, 3.1rem); line-height: 0.98; }
h2 { font-size: clamp(1.45rem, 2.4vw, 2rem); }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.col { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.col > main { flex: 1; }
.side { display: none; }
.top { border-bottom: 1px solid var(--line-2); background: rgba(231, 236, 236, 0.94); backdrop-filter: saturate(1.2) blur(8px); }
.top-in { max-width: none; padding: 8px var(--s3); gap: var(--s2); min-height: 60px; }
.top-search { flex: 1; max-width: 460px; display: none; }
.top-search input { width: 100%; height: 40px; padding: 0 14px 0 38px; border: 1px solid var(--line-2); border-radius: var(--r-btn); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f7178' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5'/%3E%3C/svg%3E") 12px 50% / 17px no-repeat; font: inherit; font-size: 0.95rem; color: var(--ink); }
.top-search input:focus { outline: 2px solid var(--petrol); outline-offset: 1px; border-color: var(--petrol); }
.menu-guest { display: block; }
.menu-mobile { display: grid; }
.wrap, .wrap.wide { max-width: 1240px; padding: var(--s4) var(--s3) var(--s8); }

@media (min-width: 720px) { .top-search { display: block; } }
@media (min-width: 1040px) {
  .shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); background: linear-gradient(90deg, var(--night) var(--side), transparent 0); }
  .side { display: flex; flex-direction: column; gap: var(--s3); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: var(--s3) var(--s2) var(--s2); background: var(--night); color: var(--night-ink); border-right: 1px solid #000; scrollbar-width: thin; scrollbar-color: var(--night-line) transparent; }
  .top-brand { display: none; }
  .menu-guest { display: none; }
  .menu-mobile { display: none; }
  .top-in { justify-content: space-between; }
  .wrap, .wrap.wide { padding: var(--s4) var(--s4) var(--s8); }
}
.side :focus-visible { outline: 2px solid var(--buoy); outline-offset: 2px; }
.sd-brand { color: #fff; padding: 2px 8px 0; font-size: 1.6rem; }
.sd-nav { display: grid; gap: 2px; }
.sd-nav a, .sd-zone, .sd-queue a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: var(--r); color: var(--night-dim); text-decoration: none; font-weight: 650; font-size: 0.97rem; transition: background-color 0.15s, color 0.15s; }
.sd-nav a:hover, .sd-zone:hover, .sd-queue a:hover { background: var(--night-2); color: #fff; }
.sd-nav a[aria-current="page"] { background: var(--night-2); color: #fff; box-shadow: inset 3px 0 0 var(--buoy); }
.sd-block { border-top: 1px solid var(--night-line); padding-top: var(--s2); }
.sd-h { display: flex; align-items: center; gap: 8px; margin: 0 10px 8px; font: 500 0.68rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(234, 241, 242, 0.5); }
.sd-zones { display: grid; gap: 2px; }
.sd-zone b { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 3px; background: var(--cat); color: #fff; font: 600 0.72rem var(--mono); background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.16) 0 2px, transparent 2px 5px); }
.sd-zone span { flex: 1; min-width: 0; }
.sd-zone small, .sd-queue small { font: 500 0.7rem var(--mono); color: rgba(234, 241, 242, 0.66); }
.sd-zone.is-on { background: var(--night-2); color: #fff; }
.sd-live { width: 7px; height: 7px; border-radius: 50%; background: var(--buoy); animation: node-pulse 2.4s ease-in-out infinite; }
.sd-queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sd-queue a { font-size: 0.9rem; font-weight: 600; }
.sd-queue a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-queue i { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--good); }
.sd-queue .q-running i { background: var(--buoy); animation: node-pulse 1.2s ease-in-out infinite; }
.sd-queue .q-failed i { background: var(--bad); }
.sd-queue .q-new { animation: q-in 0.5s var(--ease); }
@keyframes q-in { from { opacity: 0; transform: translateX(-10px); } }
.sd-qempty { margin: 0 10px 10px; font-size: 0.86rem; line-height: 1.45; color: rgba(234, 241, 242, 0.56); }
.sd-more { display: inline-block; margin: 6px 10px 0; font-size: 0.86rem; color: var(--night-ink); }
.sd-join { margin: 0 10px; background: var(--buoy); border-color: var(--buoy); color: var(--night); }
.sd-foot { margin-top: auto; display: flex; align-items: center; gap: 14px; padding: var(--s2) 10px 0; border-top: 1px solid var(--night-line); }
.sd-foot a:not(.x-btn) { color: rgba(234, 241, 242, 0.56); font-size: 0.84rem; }
.sd-foot .x-btn { width: 36px; height: 36px; }

/* compact footer */
.foot { margin-top: 0; border-top: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink); }
.foot::before { display: none; }
.foot-in { max-width: 1240px; margin: 0; padding: var(--s3); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.foot-brand { gap: 10px; }
.foot-brand .mark { width: 30px; height: 30px; }
.foot-brand p { color: var(--muted); font-size: 0.9rem; }
.foot-brand strong { color: var(--ink); font: 800 1.15rem var(--display); margin-right: 6px; }
.foot-nav { border-top: 0; padding-top: 0; gap: 0 var(--s3); flex: 1; }
.foot-nav a { color: var(--ink-2); font-size: 0.92rem; padding: 12px 0; }
.foot-nav a:hover { color: var(--petrol-ink); }
.foot .x-btn { background: var(--ink); color: #fff; width: 40px; height: 40px; margin: 0; }
@media (min-width: 1040px) { .foot-in { padding: var(--s3) var(--s4); } }

/* ---------- yard map ---------- */
.ym-head { display: grid; gap: var(--s2) var(--s4); align-items: end; margin-bottom: var(--s3); }
.ym-head .eyebrow { margin-bottom: 10px; }
.ym-title { max-width: 16ch; }
.ym-lede { margin: 0; max-width: 54ch; color: var(--ink-2); font-size: 1.02rem; line-height: 1.5; }
@media (min-width: 900px) { .ym-head { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); } }

.ym-chips { display: flex; gap: var(--s1); overflow-x: auto; padding: 4px 2px 10px; margin: 0 -2px var(--s1); scrollbar-width: none; }
.ym-chips::-webkit-scrollbar { display: none; }
.ym-chips .chip { flex: none; cursor: pointer; font: inherit; font-weight: 650; font-size: 0.93rem; color: var(--ink); min-height: 44px; }
.ym-chips .chip i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 3px; background: var(--cat); color: #fff; font: 600 0.66rem var(--mono); font-style: normal; }
.ym-chips .chip small { font: 500 0.7rem var(--mono); color: var(--muted); }
.ym-chips .chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.ym-chips .chip.is-on small { color: var(--buoy); }

/* the plan: phones get a vertical flow, wide screens a pannable canvas (.is-canvas, set by app.js) */
.ym-map { position: relative; }
.ym-plane { display: grid; gap: var(--s3); }
.ym-gantry, .ym-tools, .ym-hint { display: none; }
.zone { position: relative; scroll-margin-top: 130px; }
.zone-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.zone-head h2 { font-size: 1.45rem; line-height: 1; }
.zone-head p { margin: 2px 0 0; font-size: 0.86rem; color: var(--muted); }
.zone-l { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--r); background: var(--cat); color: #fff; font: 800 1.5rem/1 var(--display); background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.14) 0 2px, transparent 2px 6px); }
.zone-n { margin-left: auto; font: 500 0.7rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.zone-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; }

/* a container from above */
.yb { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto; gap: 4px 10px; min-height: 112px; padding: 10px 12px 10px 14px; border: 0; border-radius: 3px; background: var(--cat); color: #fff; text-align: left; font: inherit; cursor: pointer; isolation: isolate; box-shadow: 0 2px 0 rgba(18, 32, 42, 0.25), 0 10px 18px -12px rgba(18, 32, 42, 0.55); transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); text-decoration: none; }
.yb-roof { position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 2px, rgba(0, 0, 0, 0.1) 2px 4px, transparent 4px 10px), linear-gradient(180deg, transparent 40%, rgba(8, 18, 24, 0.38)); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.16), inset 6px 0 0 rgba(0, 0, 0, 0.12); }
.yb-plate { white-space: nowrap; grid-column: 1; align-self: start; justify-self: start; display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 2px; background: rgba(255, 255, 255, 0.92); color: var(--ink); font: 600 0.66rem/1 var(--mono); letter-spacing: 0.06em; }
.yb-plate b { display: grid; place-items: center; min-width: 14px; height: 14px; border: 1px solid var(--ink); border-radius: 2px; font-weight: 600; }
.yb-art { grid-column: 2; grid-row: 1 / 3; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 4px; background: #fff; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.14); overflow: hidden; }
.yb-art .emblem { width: 46px; height: 46px; }
.yb-art .glyph { width: 22px; height: 22px; color: var(--cat); }
.yb-name { grid-column: 1 / -1; align-self: end; font: 800 1.32rem/1 var(--display); letter-spacing: -0.005em; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.yb-meta { grid-column: 1 / -1; justify-self: start; display: flex; gap: 10px; padding: 4px 6px; border-radius: 2px; background: rgba(8, 18, 24, 0.34); font: 500 0.74rem/1 var(--mono); letter-spacing: 0.03em; color: #fff; }
.yb-price { color: #fff; font-weight: 600; }
.yb:hover { transform: translateY(-3px); box-shadow: 0 2px 0 rgba(18, 32, 42, 0.25), 0 18px 24px -12px rgba(18, 32, 42, 0.6); }
.yb:focus-visible { outline: 3px solid var(--buoy); outline-offset: 3px; }
.yb.is-lift { transform: translateY(-6px) scale(1.02); box-shadow: 0 0 0 3px var(--buoy), 0 26px 30px -14px rgba(18, 32, 42, 0.7); z-index: 2; }
.yb-open { background: transparent; color: var(--ink-2); border: 2px dashed var(--line-2); box-shadow: none; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; gap: 2px 12px; }
.yb-open strong { font: 800 1.1rem var(--display); align-self: end; }
.yb-open .yb-meta { color: var(--muted); grid-column: 2; background: none; padding: 0; margin: 0; }
.yb-plus { grid-row: 1 / 3; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line-2); font: 600 1.3rem/1 var(--mono); color: var(--muted); }
.yb-open:hover { border-color: var(--petrol); color: var(--petrol-ink); box-shadow: none; }

.zone-gate { padding: var(--s2); border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); }
.zone-gate .zone-l { background: var(--ink); font-size: 1.1rem; background-image: none; }
.gate-key { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.gate-key li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; font-size: 0.92rem; line-height: 1.4; color: var(--ink-2); }
.gate-key b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--buoy); color: var(--night); font: 600 0.75rem var(--mono); }
.gate-key strong { color: var(--ink); }

/* mobile: chips stick under the top bar */
@media (max-width: 899px) {
  .ym-chips { position: sticky; top: 60px; z-index: 6; background: var(--bg); margin-left: calc(-1 * var(--s3)); margin-right: calc(-1 * var(--s3)); padding-left: var(--s3); padding-right: var(--s3); border-bottom: 1px solid var(--line); }
  .zone + .zone { padding-top: var(--s1); }
}

/* the canvas (from 900px, set by app.js as .is-canvas on .ym-map) */
.ym-map.is-canvas { height: clamp(480px, calc(100vh - 210px), 780px); border: 1px solid var(--line-2); border-radius: var(--r); background: var(--ground); overflow: hidden; touch-action: none; cursor: grab; user-select: none; }
.ym-map.is-canvas.is-drag { cursor: grabbing; }
.is-canvas .ym-view { position: absolute; inset: 0; }
.is-canvas .ym-plane { position: absolute; left: 0; top: 0; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 40px; padding: 44px 40px; transform-origin: 0 0; will-change: transform; transition: transform 0.7s var(--ease);
  background:
    linear-gradient(var(--paint), var(--paint)) 0 28px / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, var(--paint) 0 22px, transparent 22px 44px) 0 50% / 100% 2px no-repeat,
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(18, 32, 42, 0.05) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(18, 32, 42, 0.05) 39px 40px),
    var(--ground-2); }
.is-canvas.is-drag .ym-plane, .is-canvas.is-instant .ym-plane { transition: none; }
.is-canvas .zone { padding: 18px; border-radius: 4px; background: var(--ground); box-shadow: inset 0 0 0 2px var(--paint); }
.is-canvas .zone::before, .is-canvas .zone::after { content: ""; position: absolute; width: 18px; height: 18px; border: 3px solid var(--buoy); }
.is-canvas .zone::before { left: -6px; top: -6px; border-right: 0; border-bottom: 0; }
.is-canvas .zone::after { right: -6px; bottom: -6px; border-left: 0; border-top: 0; }
.is-canvas .zone-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.is-canvas .zone-gate { background: var(--surface); }
.is-canvas .zone-gate::before, .is-canvas .zone-gate::after { border-color: var(--ink); }
.is-canvas .ym-gantry { display: block; position: absolute; left: 0; top: 0; bottom: 0; width: 26px; z-index: 5; pointer-events: none; transform: translateX(-90px); transition: transform 0.75s var(--ease);
  background: repeating-linear-gradient(45deg, transparent 0 7px, rgba(18, 32, 42, 0.45) 7px 9px), linear-gradient(90deg, #e4561c 0 4px, var(--buoy) 4px 22px, #e4561c 22px);
  box-shadow: 14px 10px 0 rgba(18, 32, 42, 0.14); }
.is-canvas .ym-gantry::before, .is-canvas .ym-gantry::after { content: ""; position: absolute; left: -9px; right: -9px; height: 18px; background: var(--ink); border-radius: 2px; }
.is-canvas .ym-gantry::before { top: 6px; } .is-canvas .ym-gantry::after { bottom: 6px; }
.ym-trolley { position: absolute; left: -10px; top: 0; width: 46px; height: 34px; border-radius: 3px; background: var(--ink); box-shadow: inset 0 0 0 3px #26404d, 8px 8px 0 rgba(18, 32, 42, 0.2); transform: translateY(40px); transition: transform 0.75s var(--ease) 0.15s; }
.ym-trolley::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: var(--buoy); }
.ym-map.is-canvas + .ym-bar .ym-tools { display: flex; flex-direction: row; border: 1px solid var(--line-2); border-radius: var(--r-btn); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.ym-tools button { width: 44px; height: 40px; border: 0; background: none; font: 600 1.05rem var(--mono); color: var(--ink); cursor: pointer; }
.ym-tools button + button { border-left: 1px solid var(--line); }
.ym-tools button[data-zoom="fit"] { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; }
.ym-tools button:hover { background: var(--petrol-soft); }
.ym-bar { display: none; }
.ym-map.is-canvas + .ym-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); margin-top: 10px; }
.ym-map.is-canvas + .ym-bar .ym-hint { display: block; margin: 0; color: var(--muted); font: 500 0.66rem var(--mono); letter-spacing: 0.06em; pointer-events: none; }

/* ---------- the dispatch console: bottom sheet ---------- */
.sheet-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(15, 27, 34, 0.42); animation: fade 0.25s ease; }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: min(88vh, 760px); display: flex; flex-direction: column; background: var(--night); color: var(--night-ink); border-radius: 10px 10px 0 0; box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, 0.6); animation: sheet-up 0.42s var(--ease); }
.sheet[hidden], .sheet-scrim[hidden] { display: none; }
@media (min-width: 1040px) { .sheet { left: calc(var(--side) + 24px); right: 24px; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet-bar { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px 12px 8px 20px; }
.sheet-grip { position: absolute; left: 50%; top: 6px; width: 44px; height: 4px; margin-left: -22px; border-radius: 2px; background: var(--night-line); }
.sheet-t { font: 500 0.68rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--night-dim); display: inline-flex; align-items: center; gap: 8px; }
.sheet-t::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--buoy); }
.sheet-x { margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--night-line); border-radius: var(--r-btn); background: var(--night-2); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.sheet-x:hover { border-color: var(--buoy); }
.sheet :focus-visible { outline: 2px solid var(--buoy); outline-offset: 2px; }
.sheet-in { overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 24px; }
.sh-head { padding-bottom: var(--s2); border-bottom: 1px solid var(--night-line); }
.sh-band { display: flex; justify-content: space-between; gap: 10px; height: 26px; align-items: center; padding: 0 10px; border-radius: 3px; background: var(--cat) repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.16) 0 2px, transparent 2px 7px); font: 600 0.68rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: #fff; }
.sh-band b { margin-left: 5px; padding: 0 4px; border: 1px solid #fff; border-radius: 2px; }
.sh-id { display: flex; gap: 14px; margin-top: 14px; }
.sh-art { display: grid; place-items: center; width: 60px; height: 60px; flex: none; border-radius: var(--r); background: #fff; }
.sh-art .emblem { width: 56px; height: 56px; } .sh-art .glyph { width: 28px; height: 28px; color: var(--cat); }
.sh-name { font-size: clamp(1.6rem, 3vw, 2.1rem); color: #fff; }
.sh-tag { margin: 4px 0 0; color: var(--night-dim); font-size: 0.98rem; }
.sh-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font: 500 0.72rem var(--mono); color: var(--night-dim); }
.sh-facts span:first-child { color: var(--buoy); }
.sh-body { display: grid; gap: var(--s3); padding-top: var(--s3); }
@media (min-width: 820px) { .sh-body { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--s4); } }
.sh-step { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font: 500 0.7rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--night-dim); }
.sh-step b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--night-line); color: #fff; }
.sh-form .field label { color: var(--night-ink); }
.sh-form .field .opt { color: var(--night-dim); }
.sh-form input, .sh-form textarea, .sh-form select { background: var(--night-2); border-color: var(--night-line); color: #fff; }
.sh-form input::placeholder, .sh-form textarea::placeholder { color: rgba(234, 241, 242, 0.42); }
.sh-form .try-example { color: var(--buoy); }
.sheet .note { color: var(--night-dim); }
.sheet .note a { color: #fff; }
.sh-lab { margin: 0 0 8px; font-weight: 700; }
.sh-asks { margin: 0 0 18px; padding-left: 1.2em; color: var(--night-dim); line-height: 1.7; }
.sh-asks .opt { font: 500 0.68rem var(--mono); text-transform: uppercase; color: rgba(234, 241, 242, 0.45); }
.sh-guest .btn { background: var(--buoy); border-color: var(--buoy); color: var(--night); }
.sh-out .run-output { display: grid; gap: 12px; }
.sh-out .slip { color: var(--ink); }
.sh-wait { margin: 0; padding: 22px 18px; border: 1px dashed var(--night-line); border-radius: var(--r); color: var(--night-dim); font-size: 0.94rem; }
.run-output .slip ~ .sh-wait, .run-output .slip + .sh-wait { display: none; }
.sh-full { display: inline-block; margin-top: 16px; color: #fff; }
.sh-full:hover { color: var(--buoy); }
html.sheet-open { overflow: hidden; }

/* ---------- dock office (below the map) ---------- */
.office { display: grid; gap: var(--s3); margin-top: var(--s6); }
@media (min-width: 900px) { .office { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; } }
.of-panel { padding: var(--s3); border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.of-head { margin-bottom: var(--s2); }
.of-head h2 { font-size: 1.6rem; }
.of-list { list-style: none; margin: 0 0 var(--s2); padding: 0; display: grid; }
.of-list li + li { border-top: 1px solid var(--line); }
.of-row { display: grid; grid-template-columns: auto 8px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 0; text-decoration: none; }
.of-no { font: 500 0.72rem var(--mono); color: var(--muted); }
.of-sw { width: 8px; height: 30px; border-radius: 2px; background: var(--cat); }
.of-name strong { display: block; font-weight: 750; line-height: 1.2; }
.of-name small { font-size: 0.82rem; color: var(--muted); }
.of-pr { font: 600 0.8rem var(--mono); }
.of-row:hover strong { color: var(--petrol-ink); }
.of-row .pick-stamp { font-size: 0.6rem; }
.of-note { display: grid; gap: 4px; padding: 12px 0 12px 12px; text-decoration: none; box-shadow: inset 3px 0 0 var(--cat); margin: 6px 0; }
.of-note-top { display: flex; gap: 10px; align-items: baseline; }
.of-note-top .mono { font: 500 0.7rem var(--mono); color: var(--muted); }
.of-time { margin-left: auto; font-size: 0.78rem; color: var(--muted); }
.of-note-text { font-size: 0.9rem; color: var(--ink-2); line-height: 1.4; }
.of-note:hover strong { color: var(--petrol-ink); }
.of-p { margin: 0 0 var(--s2); color: var(--ink-2); font-size: 0.95rem; }
.hm-est-field { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin-bottom: 14px; }
.hm-est-field label { font-weight: 700; font-size: 0.92rem; }
.hm-est-field output { font: 600 0.9rem var(--mono); }
.hm-est-field input { grid-column: 1 / -1; width: 100%; accent-color: var(--petrol); height: 28px; }
.hm-est-lines { margin: 0 0 var(--s2); display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.hm-est-lines div { display: flex; justify-content: space-between; gap: 10px; }
.hm-est-lines dt { color: var(--muted); font-size: 0.9rem; }
.hm-est-lines dd { margin: 0; font: 600 0.9rem var(--mono); text-align: right; }
.hm-est-total dd span { font-size: 1.2rem; }
.hm-est-total small { display: block; font-weight: 400; color: var(--muted); font-size: 0.74rem; }

@media (max-width: 520px) {
  .wrap, .wrap.wide { padding: var(--s3) var(--s2) var(--s6); }
  .top-in { padding: 6px var(--s2); }
  .ym-chips { margin-left: calc(-1 * var(--s2)); margin-right: calc(-1 * var(--s2)); padding-left: var(--s2); padding-right: var(--s2); top: 56px; }
  .sheet-in { padding: 0 16px 20px; }
  .of-panel { padding: var(--s2); }
}
@media (prefers-reduced-motion: reduce) {
  .is-canvas .ym-plane, .ym-gantry, .ym-trolley, .yb { transition: none !important; }
  .sheet { animation: none; }
}
@media (max-width: 899px) and (min-width: 330px) {
  .zone-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .yb { min-height: 104px; padding: 9px 10px 9px 12px; }
  .yb-art { width: 36px; height: 36px; } .yb-art .emblem { width: 30px; height: 30px; }
  .yb-name { font-size: 1.12rem; }
  .yb-meta { gap: 7px; font-size: 0.64rem; }
  .yb-open { grid-template-columns: 1fr; grid-template-rows: auto auto auto; justify-items: start; align-content: center; gap: 4px; }
  .yb-open .yb-plus { grid-row: auto; width: 30px; height: 30px; }
  .yb-open .yb-meta { grid-column: 1; font-size: 0.62rem; }
}

.hm-est-field input[type=range] { -webkit-appearance: none; appearance: none; height: 44px; background: transparent; cursor: pointer; }
.hm-est-field input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--petrol) var(--fill, 30%), var(--line-2) 0); }
.hm-est-field input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line-2); }
.hm-est-field input[type=range]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--petrol); }
.hm-est-field input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: #fff; border: 3px solid var(--petrol); box-shadow: 0 2px 6px rgba(18, 32, 42, 0.3); }
.hm-est-field input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--petrol); }
.hm-est-field input[type=range]:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }
@media (max-width: 899px) {
  .ym-chips { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
}
@media (max-width: 559px) {
  .ym-lede { display: none; }
  .ym-title { font-size: 2rem; }
  .ym-head { margin-bottom: var(--s2); }
}
@media (max-width: 899px) { body.on-agents .top-search { visibility: hidden; } }
@media (min-width: 900px) { body.on-agents .xm-search { display: none; } .xm-rail { top: 76px !important; } }
.bay-plate { top: 76px !important; }
.slip-log .log-arg, .slip-body code { overflow-wrap: anywhere; }

.is-canvas .yb-meta { font-size: 0.8rem; }

/* dispatching not open yet (no live runtime configured) */
.not-open { display: grid; gap: 12px; justify-items: start; padding: var(--s2); border: 1px dashed var(--night-line); border-radius: var(--r); color: var(--night-dim); }
.not-open svg { width: 120px; height: auto; }
.not-open p { margin: 0; line-height: 1.5; }
.not-open strong { color: var(--night-ink); display: block; }
.not-open .e-wire { stroke: var(--night-line); stroke-width: 2; fill: none; }
.not-open .e-box, .not-open .e-card { fill: var(--night-2); stroke: var(--night-line); stroke-width: 2; }
.not-open .e-rib { stroke: var(--night-line); stroke-width: 2; }
.not-open .e-node { fill: var(--buoy); }
