:root {
  --ink: #17272b;
  --muted: #6b7d80;
  --line: #dce7e5;
  --paper: #ffffff;
  --canvas: #f3f7f5;
  --teal: #0f5960;
  --teal-dark: #103b42;
  --mint: #e7f3ee;
  --lime: #c7e76d;
  --amber: #c88719;
  --amber-soft: #fff3d8;
  --red: #bd4b3f;
  --red-soft: #fbe9e5;
  --blue: #3776a8;
  --blue-soft: #eaf3fa;
  --shadow: 0 18px 42px rgba(22, 48, 49, 0.08);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

/* G / Floating Spatial: the device is the primary object, everything else orbits it. */
.spatial-admin, .spatial-worker { --spatial-ink: #172b30; --spatial-muted: #728387; --spatial-canvas: #e7efeb; --spatial-paper: #f8faf5; --spatial-hot: #ef7352; --spatial-acid: #d8ed8e; --spatial-line: rgba(23,43,48,.18); color: var(--spatial-ink); font-family: "Segoe UI", "Microsoft YaHei", sans-serif; }
.spatial-stage, .spatial-worker-stage { position: relative; min-height: 760px; overflow: hidden; padding: 25px 34px 28px; background: radial-gradient(circle at 83% 13%, rgba(255,255,255,.92), transparent 25%), linear-gradient(135deg, #dbe8e0, #f2f4ee 53%, #dce8ec); }
.spatial-stage::before, .spatial-worker-stage::before { content: ""; position: absolute; inset: -22%; pointer-events: none; background: repeating-linear-gradient(112deg, transparent 0 85px, rgba(255,255,255,.2) 86px 87px); transform: rotate(-5deg); }
.spatial-header, .spatial-worker-header { position: relative; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.spatial-brand { display: flex; align-items: center; gap: 10px; }
.spatial-brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 12px 4px 12px 4px; color: #183237; background: var(--spatial-acid); font-weight: 900; box-shadow: 5px 5px 0 rgba(239,115,82,.14); }
.spatial-brand strong, .spatial-brand span { display: block; }
.spatial-brand strong { font-size: 13px; letter-spacing: -.04em; }
.spatial-brand span { margin-top: 3px; color: var(--spatial-muted); font: 700 8px ui-monospace, monospace; letter-spacing: .1em; }
.spatial-command { display: flex; align-items: center; gap: 4px; padding: 5px; border: 1px solid rgba(255,255,255,.8); border-radius: 999px; background: rgba(255,255,255,.42); box-shadow: 0 8px 22px rgba(25,56,58,.08); backdrop-filter: blur(16px); }
.spatial-page .spatial-command { max-width: min(760px, 60vw); overflow-x: auto; scrollbar-width: none; }
.spatial-page .spatial-command::-webkit-scrollbar { display: none; }
.spatial-command button { min-height: 30px; border: 0; border-radius: 999px; padding: 6px 11px; color: var(--spatial-muted); background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.spatial-command button.is-active, .spatial-command button:hover { color: var(--spatial-ink); background: #fff; box-shadow: 0 4px 10px rgba(25,56,58,.1); }
.spatial-command button b { margin-left: 4px; color: var(--spatial-hot); }
.spatial-user { display: flex; align-items: center; gap: 7px; color: var(--spatial-muted); font: 700 9px ui-monospace, monospace; white-space: nowrap; }
.spatial-user button { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; color: var(--spatial-muted); background: rgba(255,255,255,.52); cursor: pointer; }
.spatial-user > b { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #376c63; background: rgba(216,237,142,.68); font-size: 9px; }
.spatial-live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #69af78; box-shadow: 0 0 0 3px rgba(105,175,120,.16); }
.spatial-index { position: absolute; z-index: 5; top: 130px; left: 34px; color: rgba(23,43,48,.46); font: 700 9px ui-monospace, monospace; letter-spacing: .16em; writing-mode: vertical-rl; transform: rotate(180deg); }
.spatial-title { position: absolute; z-index: 4; top: 134px; left: 12%; max-width: 410px; }
.spatial-title small, .spatial-worker-title small, .spatial-drawer-head small, .spatial-worker-timeline small { color: var(--spatial-hot); font: 700 9px ui-monospace, monospace; letter-spacing: .17em; }
.spatial-title h1, .spatial-worker-title h1 { margin: 10px 0 0; color: var(--spatial-ink); font-size: clamp(42px, 6vw, 76px); line-height: .88; letter-spacing: -.085em; }
.spatial-title h1 em { color: var(--spatial-hot); font-style: normal; }
.spatial-title p { max-width: 280px; margin: 17px 0 0; color: var(--spatial-muted); font-size: 11px; line-height: 1.6; }
.spatial-specimen, .spatial-worker-specimen { position: absolute; z-index: 2; top: 152px; right: 16%; width: min(52vw, 590px); height: 360px; overflow: hidden; border: 1px solid rgba(255,255,255,.82); border-radius: 29px 8px 31px 11px; background: #214f53; box-shadow: 0 33px 65px rgba(25,61,60,.22); transform: rotate(2.5deg); transition: transform .6s cubic-bezier(.2,.8,.2,1), box-shadow .6s ease; }
.spatial-specimen:hover, .spatial-worker-specimen:hover { transform: rotate(0deg) translateY(-7px); box-shadow: 0 42px 78px rgba(25,61,60,.27); }
.spatial-specimen img, .spatial-worker-specimen img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.86) contrast(1.06); }
.spatial-specimen-shade { position: absolute; inset: 0; background: linear-gradient(122deg, rgba(23,63,67,.62), transparent 50%, rgba(11,39,41,.18)), linear-gradient(180deg, transparent 56%, rgba(7,29,31,.75)); }
.spatial-specimen-code { position: absolute; right: 18px; bottom: 17px; color: rgba(240,248,226,.76); font: 700 9px ui-monospace, monospace; letter-spacing: .16em; }
.spatial-specimen-name { position: absolute; left: 22px; bottom: 19px; color: #fff; }
.spatial-specimen-name small, .spatial-specimen-name strong { display: block; }
.spatial-specimen-name small { margin-bottom: 6px; color: rgba(255,255,255,.73); font: 700 9px ui-monospace, monospace; }
.spatial-specimen-name strong { font-size: 27px; letter-spacing: -.07em; }
.spatial-sticker { position: absolute; z-index: 6; top: 270px; right: 10%; min-width: 115px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.86); border-radius: 13px; background: rgba(255,255,255,.76); box-shadow: 0 14px 26px rgba(27,61,61,.14); transform: rotate(-8deg); }
.spatial-sticker small, .spatial-sticker strong, .spatial-sticker span { display: block; }
.spatial-sticker small { color: var(--spatial-hot); font: 700 8px ui-monospace, monospace; letter-spacing: .12em; }
.spatial-sticker strong { margin-top: 5px; font-size: 22px; letter-spacing: -.08em; }
.spatial-sticker strong i { color: var(--spatial-muted); font-size: 10px; font-style: normal; }
.spatial-sticker .status { margin-top: 6px; padding: 0; background: transparent; }
.spatial-drawer, .spatial-worker-drawer { position: absolute; z-index: 7; right: 28px; bottom: 132px; width: min(360px, 32%); padding: 17px; border: 1px solid rgba(255,255,255,.84); border-radius: 20px; background: rgba(250,252,247,.68); box-shadow: 0 25px 55px rgba(30,63,63,.17); backdrop-filter: blur(22px); }
.spatial-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.spatial-drawer-head h2 { margin: 7px 0 0; color: var(--spatial-ink); font-size: 22px; letter-spacing: -.07em; }
.spatial-drawer-head button { display: grid; width: 29px; height: 29px; place-items: center; border: 0; border-radius: 8px; color: var(--spatial-muted); background: rgba(255,255,255,.72); cursor: pointer; }
.spatial-drawer > p { margin: 11px 0 0; color: var(--spatial-muted); font-size: 10px; line-height: 1.5; }
.spatial-doc-list { display: grid; gap: 6px; margin-top: 14px; }
.spatial-doc-list button { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 9px; border: 1px solid rgba(255,255,255,.72); border-radius: 10px; color: var(--spatial-ink); background: rgba(255,255,255,.58); text-align: left; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.spatial-doc-list button:hover { transform: translateX(3px); background: #fff; }
.spatial-doc-list i { width: 7px; height: 7px; border-radius: 50%; background: var(--spatial-acid); box-shadow: 0 0 0 1px #95ae5e; }
.spatial-doc-list button:nth-child(2) i { background: var(--spatial-hot); box-shadow: 0 0 0 1px var(--spatial-hot); }
.spatial-doc-list span { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.spatial-doc-list b { color: var(--spatial-muted); font: 700 8px ui-monospace, monospace; }
.spatial-empty { padding: 12px; color: var(--spatial-muted); font-size: 10px; }
.spatial-drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; }
.spatial-link { border: 0; padding: 0; color: #2f7d70; background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.spatial-round { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; color: var(--spatial-ink); background: rgba(255,255,255,.68); cursor: pointer; }
.spatial-rail { position: absolute; z-index: 7; top: 210px; right: 30px; display: grid; gap: 8px; }
.spatial-rail button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; color: var(--spatial-muted); background: rgba(255,255,255,.48); cursor: pointer; transition: transform .2s ease, background .2s ease; }
.spatial-rail button:hover, .spatial-rail button.is-active { color: var(--spatial-ink); background: #fff; transform: scale(1.12); }
.spatial-orbit { position: absolute; z-index: 1; border: 1px solid rgba(47,125,112,.28); border-radius: 50%; pointer-events: none; }
.orbit-one { top: 102px; right: 3%; width: 640px; height: 515px; transform: rotate(-18deg); }
.orbit-two { top: 245px; right: 24%; width: 530px; height: 315px; border-color: rgba(239,115,82,.2); transform: rotate(24deg); }
.spatial-timeline { position: absolute; z-index: 6; right: 11%; bottom: 31px; left: 10%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 15px 13px; border: 1px solid rgba(255,255,255,.74); border-radius: 16px; background: rgba(255,255,255,.47); backdrop-filter: blur(16px); }
.spatial-timeline-line { position: absolute; top: 27px; right: 18px; left: 18px; height: 1px; background: rgba(29,72,72,.25); }
.spatial-point { position: relative; z-index: 1; border: 0; padding: 0 8px; background: transparent; text-align: center; cursor: pointer; }
.spatial-point i { display: block; width: 12px; height: 12px; margin: 0 auto 7px; border: 3px solid var(--spatial-canvas); border-radius: 50%; background: var(--spatial-hot); box-shadow: 0 0 0 1px var(--spatial-hot); }
.spatial-point:nth-of-type(3) i { background: var(--spatial-acid); box-shadow: 0 0 0 1px #92aa59; }
.spatial-point:nth-of-type(4) i { background: #a8d5df; box-shadow: 0 0 0 1px #6ca4b2; }
.spatial-point.is-alert i { background: #fff; box-shadow: 0 0 0 1px var(--spatial-hot); }
.spatial-point small, .spatial-point strong, .spatial-point span { display: block; }
.spatial-point small { color: var(--spatial-hot); font: 700 8px ui-monospace, monospace; letter-spacing: .08em; }
.spatial-point strong { margin-top: 4px; font-size: 9px; }
.spatial-point span { margin-top: 4px; color: var(--spatial-muted); font-size: 8px; }
.spatial-bottom { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 24px 34px 34px; background: #f4f6f1; }
.spatial-bottom small { color: var(--spatial-hot); font: 700 9px ui-monospace, monospace; letter-spacing: .13em; }
.spatial-bottom h2 { margin: 7px 0 0; font-size: 20px; letter-spacing: -.06em; }
.spatial-device-strip { display: flex; gap: 9px; }
.spatial-device-strip button { position: relative; width: 72px; height: 72px; overflow: hidden; border: 1px solid rgba(23,43,48,.12); border-radius: 11px 3px 11px 3px; padding: 0; background: #d8e3df; cursor: pointer; transition: transform .2s ease, border-color .2s ease; }
.spatial-device-strip button:hover, .spatial-device-strip button.is-selected { transform: translateY(-5px); border-color: var(--spatial-hot); }
.spatial-device-strip img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.7); }
.spatial-device-strip span, .spatial-device-strip b { position: absolute; left: 6px; right: 6px; color: #fff; text-align: left; text-shadow: 0 1px 4px #183237; }
.spatial-device-strip span { top: 6px; font: 700 7px ui-monospace, monospace; }
.spatial-device-strip b { bottom: 6px; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.spatial-signal-card, .spatial-trace-note { position: absolute; z-index: 6; padding: 11px 12px; border: 1px solid rgba(255,255,255,.76); border-radius: 11px 4px 11px 4px; background: rgba(255,255,255,.58); box-shadow: 0 15px 28px rgba(30,63,63,.1); backdrop-filter: blur(15px); }
.spatial-signal-card { top: 290px; left: 7%; transform: rotate(-5deg); }
.spatial-trace-note { top: 540px; left: 17%; transform: rotate(3deg); }
.spatial-signal-card small, .spatial-signal-card strong, .spatial-signal-card span, .spatial-signal-card button, .spatial-trace-note small, .spatial-trace-note b, .spatial-trace-note span { display: block; }
.spatial-signal-card small, .spatial-trace-note small { color: var(--spatial-hot); font: 700 8px ui-monospace, monospace; letter-spacing: .11em; }
.spatial-signal-card strong { margin-top: 3px; font-size: 26px; letter-spacing: -.08em; }
.spatial-signal-card span, .spatial-trace-note span { margin-top: 2px; color: var(--spatial-muted); font-size: 9px; }
.spatial-signal-card button { margin-top: 8px; border: 0; padding: 0; color: #2f7d70; background: transparent; font-size: 9px; font-weight: 800; cursor: pointer; }
.spatial-trace-note b { margin-top: 5px; font-size: 11px; }

.spatial-page-stage { position: relative; min-height: 100vh; overflow: hidden; padding: 25px 34px 45px; background: radial-gradient(circle at 86% 5%, rgba(255,255,255,.92), transparent 24%), linear-gradient(135deg, #dbe8e0, #f2f4ee 53%, #dce8ec); }
.spatial-page-stage::before { content: ""; position: absolute; inset: -20%; pointer-events: none; background: repeating-linear-gradient(112deg, transparent 0 85px, rgba(255,255,255,.2) 86px 87px); transform: rotate(-5deg); }
.spatial-page-header { position: relative; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.spatial-page-index { position: absolute; z-index: 5; top: 143px; left: 34px; color: rgba(23,43,48,.46); font: 700 9px ui-monospace, monospace; letter-spacing: .16em; writing-mode: vertical-rl; transform: rotate(180deg); }
.spatial-page-label { position: relative; z-index: 2; margin: 74px 0 0 9%; color: var(--spatial-hot); font: 700 9px ui-monospace, monospace; letter-spacing: .16em; }
.spatial-page-heading { position: relative; z-index: 2; margin: 8px 0 22px 9%; max-width: 580px; }
.spatial-page-heading small { color: var(--spatial-hot); font: 700 9px ui-monospace, monospace; letter-spacing: .16em; }
.spatial-page-heading h1 { margin: 7px 0 0; color: var(--spatial-ink); font-size: clamp(36px, 5vw, 62px); letter-spacing: -.08em; }
.spatial-page-heading p { max-width: 520px; margin: 10px 0 0; color: var(--spatial-muted); font-size: 11px; line-height: 1.55; }
.spatial-page-canvas { position: relative; z-index: 2; max-width: 1430px; margin: 0 auto; padding: 21px 21px 29px; border: 1px solid rgba(255,255,255,.8); border-radius: 25px 8px 25px 8px; background: rgba(255,255,255,.38); box-shadow: 0 25px 55px rgba(30,63,63,.09); backdrop-filter: blur(18px); }
.spatial-page-orbit { position: absolute; top: -80px; right: 4%; width: 440px; height: 250px; border: 1px solid rgba(47,125,112,.2); border-radius: 50%; transform: rotate(-15deg); pointer-events: none; }
.spatial-page-content { position: relative; z-index: 1; }
.spatial-page-content .content { max-width: none; padding: 0; }
.spatial-page-content .page-intro { display: flex; justify-content: flex-end; margin: 0 0 16px; padding: 0; border: 0; }
.spatial-page-content .page-intro > div:first-child { display: none; }
.spatial-page-content .page-intro .actions { margin-left: auto; }
.spatial-page-content .metric-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.spatial-page-content .metric, .spatial-page-content .panel, .spatial-page-content .template-card, .spatial-page-content .binding-card, .spatial-page-content .readiness-card, .spatial-page-content .archive-device-card, .spatial-page-content .file-card { border-color: rgba(255,255,255,.82); border-radius: 15px 5px 15px 5px; background: rgba(255,255,255,.58); box-shadow: 0 13px 26px rgba(30,63,63,.07); backdrop-filter: blur(12px); }
.spatial-page-content .panel-head { border-bottom-color: rgba(23,43,48,.1); background: rgba(255,255,255,.22); }
.spatial-page-content .metric { transform: rotate(-.4deg); transition: transform .25s ease, box-shadow .25s ease; }
.spatial-page-content .metric:nth-child(even) { transform: rotate(.55deg); }
.spatial-page-content .metric:hover { transform: translateY(-5px) rotate(0); box-shadow: 0 20px 36px rgba(30,63,63,.12); }
.spatial-page-content .task-row, .spatial-page-content .data-table tbody tr { background: rgba(255,255,255,.3); transition: background .2s ease, transform .2s ease; }
.spatial-page-content .task-row:hover, .spatial-page-content .data-table tbody tr:hover { background: rgba(255,255,255,.76); transform: translateX(4px); }
.spatial-page-content .data-table th { background: rgba(255,255,255,.34); color: var(--spatial-muted); border-bottom-color: rgba(23,43,48,.12); }
.spatial-page-content .data-table { border-collapse: separate; border-spacing: 0 5px; }
.spatial-page-content .data-table th { border-bottom: 0; background: transparent; }
.spatial-page-content .data-table td { border-top: 1px solid rgba(255,255,255,.78); border-bottom: 1px solid rgba(255,255,255,.78); background: rgba(255,255,255,.32); }
.spatial-page-content .data-table td:first-child { border-left: 1px solid rgba(255,255,255,.78); border-radius: 10px 0 0 10px; }
.spatial-page-content .data-table td:last-child { border-right: 1px solid rgba(255,255,255,.78); border-radius: 0 10px 10px 0; }
.spatial-page-content .toolbar { padding: 0 4px; }
.spatial-page-float { position: absolute; z-index: 5; top: 245px; right: 32px; display: grid; gap: 4px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.75); border-radius: 10px 3px 10px 3px; background: rgba(255,255,255,.56); box-shadow: 0 14px 24px rgba(30,63,63,.08); transform: rotate(4deg); }
.spatial-page-float small { color: var(--spatial-hot); font: 700 8px ui-monospace, monospace; letter-spacing: .11em; }
.spatial-page-float strong { font-size: 20px; letter-spacing: -.07em; }
.spatial-page-float strong i { color: var(--spatial-muted); font-size: 8px; font-style: normal; }
.spatial-page-float span { color: var(--spatial-muted); font-size: 9px; }

.spatial-admin ~ .modal-backdrop, .spatial-page ~ .modal-backdrop, .spatial-worker ~ .modal-backdrop { background: rgba(22,48,49,.27); backdrop-filter: blur(9px); }
.spatial-admin ~ .modal-backdrop .modal, .spatial-page ~ .modal-backdrop .modal, .spatial-worker ~ .modal-backdrop .modal { max-width: 560px; border: 1px solid rgba(255,255,255,.82); border-radius: 22px 7px 22px 7px; background: rgba(250,252,247,.78); box-shadow: 0 30px 80px rgba(18,48,50,.25); backdrop-filter: blur(24px); }
.spatial-admin ~ .modal-backdrop .modal-head, .spatial-page ~ .modal-backdrop .modal-head, .spatial-worker ~ .modal-backdrop .modal-head { border-bottom-color: rgba(23,43,48,.1); background: rgba(255,255,255,.22); }
.spatial-admin ~ .modal-backdrop .modal-body, .spatial-page ~ .modal-backdrop .modal-body, .spatial-worker ~ .modal-backdrop .modal-body { background: transparent; }
.spatial-admin ~ .modal-backdrop .snapshot, .spatial-page ~ .modal-backdrop .snapshot, .spatial-worker ~ .modal-backdrop .snapshot { padding: 12px; border: 1px solid rgba(255,255,255,.72); border-radius: 13px 4px 13px 4px; background: rgba(255,255,255,.48); }

@media (prefers-reduced-motion: no-preference) {
  .spatial-specimen, .spatial-worker-specimen { transform: translate(calc(var(--mx, 0) * 1px), calc(var(--my, 0) * 1px)) rotate(calc(2.5deg + var(--my, 0) * .04deg)); animation: spatial-object-in .8s cubic-bezier(.2,.8,.2,1) both, spatial-breathe 7s ease-in-out 1s infinite; }
  .spatial-worker-specimen { transform: translate(calc(var(--mx, 0) * 1px), calc(var(--my, 0) * 1px)) rotate(calc(2.5deg + var(--my, 0) * .04deg)); }
  .spatial-title, .spatial-worker-title { animation: spatial-copy-in .65s ease both; }
  .spatial-drawer, .spatial-worker-drawer { animation: spatial-drawer-in .7s .12s cubic-bezier(.2,.8,.2,1) both; }
  .spatial-sticker, .spatial-signal-card, .spatial-trace-note { animation: spatial-float-in .65s .2s ease both; }
  .spatial-point { animation: spatial-point-in .5s ease both; }
  .spatial-point:nth-child(3) { animation-delay: .08s; }.spatial-point:nth-child(4) { animation-delay: .16s; }.spatial-point:nth-child(5) { animation-delay: .24s; }
  .spatial-timeline-line { transform-origin: left; animation: spatial-line-in 1.1s .25s ease both; }
  .spatial-page-heading, .spatial-page-canvas { animation: spatial-copy-in .55s ease both; }
  @keyframes spatial-object-in { from { opacity: 0; transform: translate(34px, 18px) rotate(7deg) scale(.96); } to { opacity: 1; } }
  @keyframes spatial-breathe { 0%, 100% { margin-top: 0; } 50% { margin-top: -5px; } }
  @keyframes spatial-copy-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes spatial-drawer-in { from { opacity: 0; transform: translateY(28px) rotate(2deg); } to { opacity: 1; transform: translateY(0) rotate(0); } }
  @keyframes spatial-float-in { from { opacity: 0; transform: translateY(15px) rotate(-3deg); } to { opacity: 1; } }
  @keyframes spatial-point-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes spatial-line-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

.spatial-worker-stage { min-height: 900px; }
.spatial-worker-title { position: absolute; z-index: 4; top: 142px; left: 10%; max-width: 360px; }
.spatial-worker-title h1 { font-size: clamp(38px, 6vw, 68px); }
.spatial-worker-title p { margin: 13px 0 0; color: var(--spatial-muted); font-size: 11px; }
.spatial-worker-code { display: flex; align-items: center; gap: 9px; color: var(--spatial-muted); font: 700 9px ui-monospace, monospace; }
.spatial-worker-code .spatial-round { margin-left: 6px; }
.spatial-worker-index { position: absolute; top: 136px; left: 28px; color: rgba(23,43,48,.46); font: 700 9px ui-monospace, monospace; letter-spacing: .16em; writing-mode: vertical-rl; transform: rotate(180deg); }
.spatial-worker-specimen { top: 177px; right: 21%; width: min(48vw, 565px); height: 340px; }
.spatial-worker-hours { position: absolute; right: 20px; top: 19px; padding: 9px 11px; border: 1px solid rgba(255,255,255,.7); border-radius: 9px 3px 9px 3px; background: rgba(20,58,60,.54); color: #fff; backdrop-filter: blur(12px); }
.spatial-worker-hours small, .spatial-worker-hours strong { display: block; }
.spatial-worker-hours small { color: rgba(255,255,255,.7); font: 700 8px ui-monospace, monospace; }
.spatial-worker-hours strong { margin-top: 5px; font-size: 19px; letter-spacing: -.07em; }
.spatial-worker-hours i { color: var(--spatial-acid); font-size: 9px; font-style: normal; }
.spatial-worker-status { position: absolute; z-index: 6; top: 430px; left: 10%; display: flex; align-items: center; gap: 9px; max-width: 330px; padding: 9px 11px; border: 1px solid rgba(255,255,255,.7); border-radius: 9px 3px 9px 3px; background: rgba(255,255,255,.58); backdrop-filter: blur(13px); }
.spatial-worker-status span { color: var(--spatial-muted); font-size: 9px; line-height: 1.4; }
.spatial-worker-drawer { right: 9%; bottom: 310px; width: min(350px, 34%); }
.spatial-worker-timeline { position: absolute; z-index: 6; right: 9%; bottom: 83px; left: 9%; padding: 15px 17px; border: 1px solid rgba(255,255,255,.74); border-radius: 16px; background: rgba(255,255,255,.48); backdrop-filter: blur(17px); }
.spatial-timeline-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.spatial-timeline-head h2 { margin: 5px 0 0; font-size: 20px; letter-spacing: -.07em; }
.spatial-worker-events { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 13px; }
.spatial-worker-event { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px; border: 1px solid rgba(255,255,255,.68); border-radius: 9px 3px 9px 3px; color: var(--spatial-ink); background: rgba(255,255,255,.56); text-align: left; cursor: pointer; }
.spatial-worker-event > i { width: 8px; height: 8px; border-radius: 50%; background: var(--spatial-acid); box-shadow: 0 0 0 1px #92aa59; }
.spatial-worker-event > i.is-bad { background: var(--spatial-hot); box-shadow: 0 0 0 1px var(--spatial-hot); }
.spatial-worker-event strong, .spatial-worker-event small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spatial-worker-event strong { font-size: 10px; }
.spatial-worker-event small { margin-top: 4px; color: var(--spatial-muted); font-size: 8px; }
.spatial-worker-actions { position: absolute; z-index: 8; right: 9%; bottom: 22px; left: 9%; display: flex; align-items: center; gap: 9px; }
.spatial-worker-primary { display: flex; align-items: center; gap: 9px; min-height: 47px; flex: 1; border: 1px solid rgba(241,255,239,.4); border-radius: 10px 4px 10px 4px; padding: 0 15px; color: #172726; background: var(--spatial-acid); box-shadow: 0 15px 28px rgba(17,50,43,.2); font-weight: 800; text-align: left; cursor: pointer; }
.spatial-worker-primary span { flex: 1; color: rgba(23,39,38,.62); font-size: 9px; font-weight: 600; }

@media (max-width: 820px) {
  .spatial-stage, .spatial-worker-stage { min-height: 920px; padding: 17px 15px 20px; }
  .spatial-command { position: absolute; top: 52px; left: 0; right: 0; justify-content: center; }
  .spatial-page .spatial-command { max-width: none; justify-content: flex-start; }
  .spatial-user { margin-left: auto; }
  .spatial-user > span:not(.spatial-live-dot), .spatial-user button { display: none; }
  .spatial-index, .spatial-worker-index { top: 125px; left: 8px; }
  .spatial-title, .spatial-worker-title { top: 130px; left: 11%; max-width: 280px; }
  .spatial-title h1, .spatial-worker-title h1 { font-size: 45px; }
  .spatial-specimen, .spatial-worker-specimen { top: 230px; right: 7%; width: 86%; height: 275px; }
  .spatial-sticker { top: 395px; right: 7%; }
  .spatial-drawer, .spatial-worker-drawer { right: 7%; bottom: 310px; width: 86%; }
  .spatial-rail { top: 123px; right: 15px; }
  .spatial-timeline { right: 7%; bottom: 27px; left: 7%; }
  .spatial-bottom { display: block; padding: 22px 15px 28px; }
  .spatial-device-strip { margin-top: 15px; overflow-x: auto; padding-bottom: 5px; }
  .spatial-worker-title p { font-size: 10px; }
  .spatial-worker-specimen { top: 222px; height: 250px; }
  .spatial-worker-status { top: 490px; left: 11%; right: 11%; max-width: none; }
  .spatial-worker-drawer { bottom: 330px; }
  .spatial-worker-timeline { right: 7%; bottom: 88px; left: 7%; }
  .spatial-worker-events { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spatial-worker-actions { right: 7%; bottom: 27px; left: 7%; }
  .spatial-page-stage { padding: 17px 15px 35px; }
  .spatial-page-label { margin-top: 74px; margin-left: 8%; }
  .spatial-page-heading { margin-left: 8%; }
  .spatial-page-canvas { padding: 14px; border-radius: 19px 5px 19px 5px; }
  .spatial-page-float { top: 250px; right: 15px; }
}
@media (max-width: 480px) {
  .spatial-stage, .spatial-worker-stage { min-height: 860px; }
  .spatial-brand span { display: none; }
  .spatial-title h1, .spatial-worker-title h1 { font-size: 39px; }
  .spatial-specimen { top: 218px; height: 220px; }
  .spatial-worker-specimen { top: 216px; height: 220px; }
  .spatial-sticker { top: 351px; padding: 9px 11px; }
  .spatial-drawer { bottom: 270px; }
  .spatial-timeline { grid-template-columns: repeat(2, 1fr); gap: 13px 0; padding: 12px 6px; }
  .spatial-timeline-line { display: none; }
  .spatial-point span { font-size: 7px; }
  .spatial-bottom h2 { font-size: 17px; }
  .spatial-worker-stage { min-height: 910px; }
  .spatial-worker-status { top: 450px; }
  .spatial-worker-drawer { bottom: 285px; }
  .spatial-worker-timeline { bottom: 92px; }
  .spatial-worker-events { grid-template-columns: 1fr; max-height: 120px; overflow: hidden; }
  .spatial-worker-primary { min-height: 52px; }
  .spatial-worker-status { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .spatial-specimen, .spatial-worker-specimen, .spatial-device-strip button, .spatial-doc-list button, .spatial-rail button { transition: none; }
}

/* Live field layer: dense enough for an operations glance, still spatial. */
.spatial-dynamics { position: absolute; z-index: 7; top: 535px; left: 7%; width: min(53%, 650px); padding: 12px 13px 10px; border: 1px solid rgba(255,255,255,.78); border-radius: 16px 5px 16px 5px; background: rgba(255,255,255,.42); box-shadow: 0 18px 34px rgba(30,63,63,.1); backdrop-filter: blur(18px); }
.spatial-dynamics-head, .spatial-dynamics-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spatial-dynamics-head small { display: block; color: var(--spatial-hot); font: 700 8px ui-monospace, monospace; letter-spacing: .13em; }
.spatial-dynamics-head strong { display: block; margin-top: 4px; font-size: 16px; letter-spacing: -.06em; }
.spatial-dynamics-head > span { display: flex; align-items: center; gap: 6px; color: var(--spatial-muted); font: 700 8px ui-monospace, monospace; }
.spatial-live-track { display: flex; gap: 7px; margin-top: 10px; overflow-x: auto; padding: 1px 1px 5px; scrollbar-width: none; touch-action: pan-x; scroll-snap-type: x mandatory; }
.spatial-live-track::-webkit-scrollbar, .spatial-device-strip::-webkit-scrollbar, .worker-subnav::-webkit-scrollbar { display: none; }
.spatial-live-card { display: grid; grid-template-columns: 38px minmax(102px,1fr) auto; align-items: center; gap: 8px; min-width: 210px; padding: 8px; border: 1px solid rgba(255,255,255,.75); border-radius: 10px 3px 10px 3px; color: var(--spatial-ink); background: rgba(255,255,255,.6); text-align: left; cursor: pointer; scroll-snap-align: center; transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease; }
.spatial-live-card:hover, .spatial-live-card.is-selected { transform: translateY(-3px); border-color: rgba(239,115,82,.62); background: rgba(255,255,255,.9); box-shadow: 0 9px 18px rgba(30,63,63,.12); }
.live-card-photo { position: relative; display: block; width: 38px; height: 38px; overflow: hidden; border-radius: 8px 2px 8px 2px; background: #bdd2cb; }
.live-card-photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.75) contrast(1.05); }
.live-card-photo i { position: absolute; right: 4px; bottom: 4px; width: 7px; height: 7px; border: 2px solid rgba(255,255,255,.82); border-radius: 50%; background: var(--spatial-hot); }
.live-card-photo i.is-running { background: #69af78; box-shadow: 0 0 0 3px rgba(105,175,120,.2); animation: spatial-live-pulse 1.8s ease-in-out infinite; }
.live-card-copy, .live-card-metric { min-width: 0; }
.live-card-copy b, .live-card-copy small, .live-card-copy em, .live-card-metric strong, .live-card-metric small, .live-card-metric em { display: block; }
.live-card-copy b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.live-card-copy small, .live-card-copy em, .live-card-metric small, .live-card-metric em { margin-top: 3px; color: var(--spatial-muted); font-size: 8px; font-style: normal; white-space: nowrap; }
.live-card-copy em { color: #3d8377; }
.live-card-metric { text-align: right; }
.live-card-metric strong { font-size: 16px; letter-spacing: -.08em; }
.live-card-metric em { color: var(--spatial-hot); }
.spatial-dynamics-foot { margin-top: 5px; color: var(--spatial-muted); font-size: 8px; }
.spatial-dynamics-foot button { border: 0; padding: 0; color: #2f7d70; background: transparent; font-size: 9px; font-weight: 800; cursor: pointer; }
.spatial-dynamics.is-swipe-next, .spatial-device-strip.is-swipe-next, .worker-subnav.is-swipe-next { animation: spatial-swipe-next .18s ease both; }
.spatial-dynamics.is-swipe-prev, .spatial-device-strip.is-swipe-prev, .worker-subnav.is-swipe-prev { animation: spatial-swipe-prev .18s ease both; }

/* Small tools is a category surface, not another data table. */
.small-tools-view { position: relative; min-height: 450px; }
.small-tools-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 3px 7px 20px; }
.small-tools-intro > div:first-child { max-width: 640px; }
.small-tools-intro small, .small-tool-copy > small { color: var(--spatial-hot); font: 700 8px ui-monospace, monospace; letter-spacing: .14em; }
.small-tools-intro h2 { margin: 8px 0 0; font-size: clamp(28px, 4vw, 48px); line-height: .95; letter-spacing: -.08em; }
.small-tools-intro h2 em { color: var(--spatial-hot); font-style: normal; }
.small-tools-intro p { max-width: 500px; margin: 12px 0 0; color: var(--spatial-muted); font-size: 11px; line-height: 1.55; }
.small-tools-orbit { display: grid; width: 108px; min-width: 108px; height: 108px; place-content: center; border: 1px solid rgba(47,125,112,.35); border-radius: 50%; outline: 1px solid rgba(239,115,82,.22); outline-offset: 9px; color: var(--spatial-muted); text-align: center; transform: rotate(8deg); }
.small-tools-orbit span, .small-tools-orbit small { font: 700 7px ui-monospace, monospace; letter-spacing: .1em; }
.small-tools-orbit strong { margin: 3px 0; color: var(--spatial-ink); font-size: 30px; letter-spacing: -.1em; }
.small-tools-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 11px; }
.small-tool-card { overflow: hidden; border: 1px solid rgba(255,255,255,.82); border-radius: 17px 5px 17px 5px; background: rgba(255,255,255,.56); box-shadow: 0 15px 30px rgba(30,63,63,.08); backdrop-filter: blur(14px); transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease; }
.small-tool-card:hover { transform: translateY(-7px) rotate(-.4deg); box-shadow: 0 24px 42px rgba(30,63,63,.15); }
.small-tool-art { position: relative; height: 145px; overflow: hidden; background: #27585a; }
.small-tool-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(17,45,47,.6), transparent 60%), linear-gradient(0deg, rgba(7,29,31,.6), transparent 55%); }
.small-tool-art img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.7) contrast(1.08); transition: transform .6s ease; }
.small-tool-card:hover .small-tool-art img { transform: scale(1.08); }
.small-tool-art span, .small-tool-art i { position: absolute; z-index: 1; color: #fff; }
.small-tool-art span { top: 12px; left: 13px; font: 700 8px ui-monospace, monospace; letter-spacing: .13em; }
.small-tool-art i { right: 13px; bottom: 12px; display: grid; width: 33px; height: 33px; place-items: center; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; background: rgba(255,255,255,.16); }
.small-tool-copy { padding: 15px; }
.small-tool-copy h3 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.07em; }
.small-tool-copy p { min-height: 32px; margin: 7px 0 0; color: var(--spatial-muted); font-size: 10px; line-height: 1.45; }
.small-tool-meta { display: grid; gap: 4px; margin-top: 13px; padding-top: 10px; border-top: 1px solid rgba(23,43,48,.1); }
.small-tool-meta span, .small-tool-meta b { display: block; font-size: 9px; }
.small-tool-meta span { color: var(--spatial-ink); font-weight: 700; }
.small-tool-meta b { color: var(--spatial-muted); font-weight: 500; }
.small-tool-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; }
.small-tool-card.tone-lime .small-tool-art { background: #526e43; }.small-tool-card.tone-blue .small-tool-art { background: #416d79; }.small-tool-card.tone-hot .small-tool-art { background: #975b49; }
.small-tools-note { display: flex; align-items: center; gap: 13px; margin: 15px 7px 0; padding: 10px 12px; border: 1px solid rgba(255,255,255,.7); border-radius: 10px 3px 10px 3px; background: rgba(255,255,255,.4); color: var(--spatial-muted); font-size: 9px; }
.small-tools-note span { display: flex; align-items: center; gap: 6px; }.small-tools-note strong { color: var(--spatial-ink); }.small-tools-note button { margin-left: auto; border: 0; padding: 0; color: #2f7d70; background: transparent; font-size: 9px; font-weight: 800; cursor: pointer; }

@keyframes spatial-live-pulse { 0%, 100% { box-shadow: 0 0 0 2px rgba(105,175,120,.12); } 50% { box-shadow: 0 0 0 6px rgba(105,175,120,0); } }
@keyframes spatial-swipe-next { from { opacity: .66; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spatial-swipe-prev { from { opacity: .66; transform: translateX(-14px); } to { opacity: 1; transform: translateX(0); } }

@media (max-width: 820px) {
  .spatial-dynamics { top: 535px; left: 7%; width: 86%; }
  .spatial-live-track { margin-right: -1px; margin-left: -1px; }
  .spatial-live-card { min-width: 235px; }
  .small-tools-grid { grid-template-columns: 1fr; }
  .small-tools-intro { margin-top: 0; }
  .small-tool-art { height: 125px; }
  .small-tools-note { align-items: flex-start; flex-wrap: wrap; }
  .small-tools-note button { width: 100%; margin-left: 0; }
  .worker-subnav { display: flex; overflow-x: auto; justify-content: flex-start; gap: 7px; padding-bottom: 4px; touch-action: pan-x; scroll-snap-type: x mandatory; }
  .worker-subnav .worker-tab { min-width: 118px; flex: 0 0 auto; scroll-snap-align: center; }
  .spatial-stage { min-height: 1080px; }
  .spatial-drawer { top: 700px; right: 7%; bottom: auto; }
  .spatial-timeline { bottom: 24px; }
}

@media (max-width: 480px) {
  .spatial-stage { min-height: 1080px; }
  .spatial-dynamics { top: 455px; }
  .spatial-dynamics-head strong { font-size: 14px; }
  .spatial-live-card { min-width: 224px; }
  .spatial-trace-note { display: none; }
  .spatial-drawer { top: 680px; bottom: auto; }
  .spatial-timeline { bottom: 22px; }
  .small-tools-intro { gap: 10px; }
  .small-tools-orbit { width: 78px; min-width: 78px; height: 78px; outline-offset: 6px; }
  .small-tools-orbit strong { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .spatial-live-card, .small-tool-card, .small-tool-art img { transition: none; }
  .live-card-photo i.is-running { animation: none; }
}

/* 3D archive layer: one restrained stage, one inspector, one material fallback. */
.skip-link { position: fixed; z-index: 100; top: 10px; left: 12px; padding: 10px 14px; color: #fff; background: var(--teal-dark); border-radius: 6px; transform: translateY(-160%); transition: transform .18s ease; }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.task-row { position: relative; }
.task-row-hitarea { position: absolute; z-index: 1; inset: 0 76px 0 0; border: 0; padding: 0; background: transparent; cursor: pointer; }
.task-row-hitarea:focus-visible { outline: 2px solid var(--teal); outline-offset: -3px; }
.task-row > :not(.task-row-hitarea) { position: relative; z-index: 2; pointer-events: none; }
.task-row .row-actions, .task-row .row-actions * { pointer-events: auto; }
.model-viewer-host { position: relative; isolation: isolate; width: 100%; height: 100%; min-height: 330px; overflow: hidden; border: 1px solid rgba(255,255,255,.62); border-radius: 15px 5px 15px 5px; background: radial-gradient(circle at 72% 22%, rgba(216,237,142,.48), transparent 24%), linear-gradient(135deg, #dceae3, #edf4ee 54%, #d5e2df); }
.model-viewer-host::before { content: ""; position: absolute; z-index: -1; inset: 12% -10% 18%; border: 1px solid rgba(23,56,59,.12); border-radius: 50%; transform: rotate(-13deg); pointer-events: none; }
.model-viewer-host.is-loading::after { content: "BUILDING SCENE"; position: absolute; top: 50%; left: 50%; color: rgba(23,56,59,.55); font: 700 9px ui-monospace, monospace; letter-spacing: .17em; transform: translate(-50%, -50%); animation: model-loading-pulse 1.2s ease-in-out infinite; }
.model-viewer-canvas { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.model-viewer-canvas:active { cursor: grabbing; }
.model-viewer-fallback { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; overflow: hidden; background: #d6e4df; transition: opacity .35s ease; }
.model-viewer-fallback img { width: 100%; height: 100%; object-fit: cover; opacity: .62; filter: saturate(.72) contrast(1.05); }
.model-fallback-copy { position: absolute; right: 18px; bottom: 42px; left: 18px; display: grid; gap: 4px; max-width: 280px; color: #fff; text-shadow: 0 1px 10px rgba(23,56,59,.4); }
.model-fallback-copy small, .model-viewer-code, .model-viewer-status { font: 700 8px ui-monospace, monospace; letter-spacing: .13em; }
.model-fallback-copy small { color: var(--spatial-acid); }
.model-fallback-copy strong { font-size: 20px; }
.model-fallback-copy span { font-size: 9px; line-height: 1.45; color: rgba(255,255,255,.78); }
.model-viewer-host.is-model-ready .model-viewer-fallback { opacity: 0; pointer-events: none; }
.model-viewer-grid { position: absolute; z-index: 0; right: -12%; bottom: -22%; left: -12%; height: 52%; opacity: .42; background: linear-gradient(rgba(23,56,59,.13) 1px, transparent 1px), linear-gradient(90deg, rgba(23,56,59,.13) 1px, transparent 1px); background-size: 26px 26px; transform: perspective(260px) rotateX(62deg); transform-origin: bottom; pointer-events: none; }
.model-viewer-shadow { position: absolute; z-index: 1; bottom: 15%; left: 50%; width: 44%; height: 13%; border-radius: 50%; background: rgba(23,56,59,.17); filter: blur(18px); transform: translateX(-50%); pointer-events: none; }
.model-viewer-head { position: absolute; z-index: 5; top: 14px; right: 15px; left: 15px; display: flex; align-items: center; justify-content: space-between; gap: 8px; pointer-events: none; }
.model-viewer-diagnostic { position: absolute; z-index: 7; right: 15px; bottom: 55px; max-width: min(62%, 390px); padding: 7px 9px; border: 1px solid rgba(239,115,82,.32); border-radius: 7px 2px 7px 2px; color: #8a3f31; background: rgba(255,246,239,.88); box-shadow: 0 8px 18px rgba(104,61,44,.08); font: 700 9px/1.35 ui-monospace, monospace; }
.model-viewer-code { color: rgba(23,56,59,.66); }
.model-viewer-status { padding: 6px 8px; border: 1px solid rgba(255,255,255,.7); border-radius: 999px; color: #285e53; background: rgba(249,251,246,.62); backdrop-filter: blur(12px); letter-spacing: .05em; }
.model-viewer-controls { position: absolute; z-index: 6; right: 14px; bottom: 14px; display: flex; gap: 5px; padding: 5px; border: 1px solid rgba(255,255,255,.68); border-radius: 10px 3px 10px 3px; background: rgba(249,251,246,.72); backdrop-filter: blur(14px); }
.model-viewer-controls button { display: grid; min-width: 30px; min-height: 30px; place-items: center; border: 0; border-radius: 6px 2px 6px 2px; color: #285e53; background: transparent; font-size: 9px; font-weight: 800; cursor: pointer; transition: background .18s ease, transform .18s ease; }
.model-viewer-controls button:hover, .model-viewer-controls button:focus-visible { background: var(--spatial-acid); transform: translateY(-1px); }
.model-viewer-hint { position: absolute; z-index: 5; bottom: 20px; left: 15px; color: rgba(23,56,59,.56); font: 700 8px ui-monospace, monospace; letter-spacing: .06em; pointer-events: none; }
.model-hotspot { position: absolute; z-index: 8; top: var(--hotspot-y); left: var(--hotspot-x); display: flex; align-items: center; gap: 6px; border: 0; padding: 0; color: var(--spatial-ink); background: transparent; transform: translate(-50%, -50%); cursor: pointer; }
.model-hotspot i { display: block; width: 12px; height: 12px; border: 3px solid rgba(249,251,246,.9); border-radius: 50%; background: var(--spatial-acid); box-shadow: 0 0 0 3px rgba(216,237,142,.35); animation: model-hotspot-pulse 1.8s ease-in-out infinite; }
.model-hotspot.is-warning i { background: var(--spatial-hot); box-shadow: 0 0 0 3px rgba(239,115,82,.25); }
.model-hotspot.is-danger i { background: #c64940; box-shadow: 0 0 0 3px rgba(198,73,64,.25); }
.model-hotspot span { max-width: 110px; padding: 5px 7px; border: 1px solid rgba(255,255,255,.75); border-radius: 6px 2px 6px 2px; color: #17383b; background: rgba(249,251,246,.8); box-shadow: 0 7px 14px rgba(23,56,59,.12); font-size: 9px; white-space: nowrap; opacity: 0; transform: translateX(-4px); transition: opacity .18s ease, transform .18s ease; }
.model-hotspot:hover span, .model-hotspot:focus-visible span { opacity: 1; transform: translateX(0); }
.spatial-model-specimen .model-viewer-host { min-height: 100%; border: 0; border-radius: inherit; }
.spatial-model-specimen .spatial-specimen-name { z-index: 10; }
.spatial-model-specimen .model-viewer-hint { display: none; }
.mobile-model-photo .model-viewer-host { position: absolute; inset: 0; min-height: 0; border: 0; border-radius: inherit; }
.mobile-model-photo > small, .mobile-model-photo > b { position: absolute; z-index: 10; }
.mobile-model-photo > small { top: 13px; left: 15px; }
.mobile-model-photo > b { right: 17px; bottom: 15px; }

.model-studio-view { display: grid; gap: 18px; }
.model-studio-hero { display: flex; align-items: end; justify-content: space-between; gap: 22px; padding: 4px 5px 8px; }
.model-studio-hero > div:first-child { max-width: 700px; }
.model-studio-hero small, .model-studio-panel-head small, .inspector-section > small, .inspector-section-head small { color: var(--spatial-hot); font: 700 8px ui-monospace, monospace; letter-spacing: .15em; }
.model-studio-hero h2 { margin: 8px 0 0; font-size: clamp(28px, 4vw, 52px); line-height: .98; letter-spacing: -.08em; }
.model-studio-hero h2 em { color: var(--spatial-hot); font-style: normal; }
.model-studio-hero p { max-width: 610px; margin: 11px 0 0; color: var(--spatial-muted); font-size: 11px; line-height: 1.55; }
.model-studio-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.model-studio-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .72fr); gap: 12px; }
.model-studio-stage-panel, .model-studio-inspector { min-width: 0; border: 1px solid rgba(255,255,255,.82); border-radius: 17px 5px 17px 5px; background: rgba(255,255,255,.5); box-shadow: 0 16px 32px rgba(30,63,63,.08); backdrop-filter: blur(15px); }
.model-studio-panel-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 16px 17px 12px; }
.model-studio-panel-head h3 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.07em; }
.model-studio-panel-head .select { width: min(240px, 50%); }
.model-studio-stage-panel .model-viewer-host { height: clamp(390px, 51vh, 560px); min-height: 390px; border-radius: 0; border-right: 0; border-left: 0; }
.model-studio-stage-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 17px 14px; color: var(--spatial-muted); font-size: 9px; }
.model-studio-inspector { padding: 17px; }
.inspector-section + .inspector-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(23,56,59,.12); }
.manifest-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(23,56,59,.09); font-size: 10px; }
.manifest-row span { color: var(--spatial-muted); }
.manifest-row strong { overflow: hidden; max-width: 160px; color: var(--spatial-ink); font: 700 10px ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.inspector-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inspector-section-head h3 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.06em; }
.hotspot-list { display: grid; gap: 6px; margin-top: 12px; }
.hotspot-list-row { display: grid; grid-template-columns: 9px minmax(0, 1fr) 12px; align-items: center; gap: 9px; width: 100%; border: 1px solid rgba(255,255,255,.7); border-radius: 8px 3px 8px 3px; padding: 10px; color: var(--spatial-ink); background: rgba(249,251,246,.62); text-align: left; cursor: pointer; transition: transform .2s ease, background .2s ease; }
.hotspot-list-row:hover { background: rgba(216,237,142,.45); transform: translateX(3px); }
.hotspot-list-row > i { width: 8px; height: 8px; border-radius: 50%; background: var(--spatial-acid); box-shadow: 0 0 0 1px #96b265; }
.hotspot-list-row > i.is-warning { background: var(--spatial-hot); box-shadow: 0 0 0 1px var(--spatial-hot); }
.hotspot-list-row > i.is-danger { background: #c64940; box-shadow: 0 0 0 1px #c64940; }
.hotspot-list-row strong, .hotspot-list-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hotspot-list-row strong { font-size: 10px; }.hotspot-list-row small { margin-top: 3px; color: var(--spatial-muted); font-size: 8px; }
.hotspot-list-row { grid-template-columns: minmax(0, 1fr) auto; padding: 0 6px 0 0; cursor: default; }
.hotspot-list-row:hover { transform: none; }
.hotspot-list-row.is-disabled { opacity: .62; }
.hotspot-list-main { display: grid; grid-template-columns: 9px minmax(0, 1fr) 12px; align-items: center; gap: 9px; min-width: 0; border: 0; padding: 10px 4px 10px 10px; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.hotspot-list-main > i { width: 8px; height: 8px; border-radius: 50%; background: var(--spatial-acid); box-shadow: 0 0 0 1px #96b265; }
.hotspot-list-main > i.is-warning { background: var(--spatial-hot); box-shadow: 0 0 0 1px var(--spatial-hot); }
.hotspot-list-main > i.is-danger { background: #c64940; box-shadow: 0 0 0 1px #c64940; }
.hotspot-list-main strong, .hotspot-list-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hotspot-list-main strong { font-size: 10px; }.hotspot-list-main small { margin-top: 3px; color: var(--spatial-muted); font-size: 8px; }
.model-empty, .inspector-note { color: var(--spatial-muted); font-size: 9px; line-height: 1.55; }
.inspector-note { display: flex; align-items: flex-start; gap: 7px; margin-top: 22px; padding: 10px; border-left: 2px solid var(--spatial-acid); background: rgba(216,237,142,.2); }
.model-version-rail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.model-version-card { display: grid; gap: 5px; min-height: 110px; border: 1px solid rgba(255,255,255,.78); border-radius: 11px 3px 11px 3px; padding: 13px; color: var(--spatial-ink); background: rgba(255,255,255,.52); text-align: left; cursor: pointer; transition: transform .22s ease, background .22s ease, border-color .22s ease; }
.model-version-card:hover, .model-version-card.is-current { border-color: rgba(239,115,82,.58); background: rgba(255,255,255,.85); transform: translateY(-3px); }
.model-version-card span { color: var(--spatial-hot); font: 700 8px ui-monospace, monospace; letter-spacing: .12em; }.model-version-card strong { font-size: 13px; }.model-version-card small, .model-version-card em { color: var(--spatial-muted); font-size: 9px; font-style: normal; }.model-version-card em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-kicker { color: var(--spatial-hot); font: 700 8px ui-monospace, monospace; letter-spacing: .14em; }
.hotspot-drawer-hero { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; padding: 13px; border: 1px solid rgba(216,237,142,.65); border-radius: 11px 3px 11px 3px; background: rgba(216,237,142,.24); }
.hotspot-drawer-hero > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 9px 3px 9px 3px; color: #285e53; background: var(--spatial-acid); }.hotspot-drawer-hero div { min-width: 0; flex: 1; }.hotspot-drawer-hero strong, .hotspot-drawer-hero small { display: block; }.hotspot-drawer-hero small { margin-top: 4px; color: var(--spatial-muted); font-size: 9px; }
@keyframes model-loading-pulse { 0%, 100% { opacity: .35; letter-spacing: .13em; } 50% { opacity: .85; letter-spacing: .2em; } }
@keyframes model-hotspot-pulse { 0%, 100% { transform: scale(.86); opacity: .74; } 50% { transform: scale(1.12); opacity: 1; } }

@media (max-width: 900px) {
  .model-studio-grid { grid-template-columns: 1fr; }
  .model-studio-inspector { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .inspector-section + .inspector-section { margin-top: 0; padding-top: 0; border-top: 0; }
  .inspector-note { grid-column: 1 / -1; margin-top: 0; }
}
@media (max-width: 620px) {
  .model-viewer-host { min-height: 280px; }
  .model-viewer-diagnostic { right: 10px; bottom: 52px; max-width: 78%; font-size: 8px; }
  .model-viewer-hint { display: none; }
  .model-viewer-controls { right: 10px; bottom: 10px; }
  .model-viewer-controls button { min-width: 34px; min-height: 34px; }
  .model-studio-hero { display: grid; align-items: start; }.model-studio-hero h2 { font-size: 31px; }.model-studio-actions { width: 100%; }.model-studio-actions .btn { flex: 1; justify-content: center; }
  .model-studio-panel-head { display: grid; }.model-studio-panel-head .select { width: 100%; }.model-studio-stage-panel .model-viewer-host { height: 330px; min-height: 330px; }
  .model-studio-inspector { display: block; }.inspector-section + .inspector-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(23,56,59,.12); }.model-version-rail { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .model-hotspot i, .model-viewer-host.is-loading::after { animation: none; }
  .model-hotspot span, .model-viewer-controls button, .hotspot-list-row, .model-version-card { transition: none; }
}

/* Keep the desktop asset rail content-sized instead of letting its parent stretch it. */
@media (min-width: 821px) {
  .spatial-bottom { flex: none; min-height: 0; height: auto; padding: 16px 34px 20px; }
  .spatial-bottom > div:first-child { flex: 1 1 auto; }
  .spatial-device-strip { flex: 0 0 auto; }
}

/* Full-browser layout: use the available canvas instead of leaving a narrow island in the middle. */
@media (min-width: 1400px) {
  .spatial-stage { min-height: clamp(760px, calc(100vh - 96px), 900px); padding: 28px 4vw 24px; }
  .spatial-header, .spatial-page-header { gap: 24px; }
  .spatial-command { gap: 7px; padding: 7px; }
  .spatial-command button { min-height: 34px; padding: 8px 14px; font-size: 11px; }
  .spatial-title { top: clamp(140px, 15vh, 176px); left: 6vw; max-width: 520px; }
  .spatial-title h1 { font-size: clamp(58px, 5.2vw, 94px); }
  .spatial-title p { max-width: 360px; font-size: 13px; }
  .spatial-specimen { top: clamp(150px, 15vh, 190px); right: 20%; width: min(47vw, 780px); height: clamp(380px, 43vh, 470px); }
  .spatial-sticker { top: clamp(270px, 30vh, 330px); right: 11%; }
  .spatial-signal-card { top: clamp(300px, 34vh, 360px); left: 5vw; }
  .spatial-trace-note { top: clamp(500px, 56vh, 580px); right: 27vw; left: auto; }
  .spatial-drawer { right: 4vw; bottom: clamp(150px, 18vh, 180px); width: min(420px, 23vw); }
  .spatial-dynamics { top: clamp(500px, 56vh, 580px); left: 5vw; width: min(50vw, 780px); }
  .spatial-live-card { min-width: 230px; padding: 10px; }
  .spatial-timeline { right: 5vw; bottom: 24px; left: 5vw; padding: 18px 16px; }
  .spatial-bottom { padding: 18px 5vw 24px; }
  .spatial-bottom h2 { font-size: clamp(22px, 1.5vw, 28px); }
  .spatial-device-strip button { width: 90px; height: 90px; }

  .spatial-page-stage { padding: 28px 4vw 46px; }
  .spatial-page-label, .spatial-page-heading { margin-left: 4vw; }
  .spatial-page-heading { max-width: 720px; }
  .spatial-page-heading h1 { font-size: clamp(48px, 4.5vw, 76px); }
  .spatial-page-canvas { width: 100%; max-width: none; margin: 0; padding: 26px 28px 34px; }
  .spatial-page-content .grid-2-1 { grid-template-columns: minmax(0, 1.7fr) minmax(360px, .9fr); }
  .spatial-page-content .grid-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Device-first scan surface: the QR destination is an archive and activity view. */
.scan-kicker { margin: 0 0 5px; color: var(--lime) !important; font: 600 10px/1.2 Consolas, monospace; letter-spacing: .09em; text-transform: uppercase; }
.worker-subnav-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.device-overview-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 14px; margin-bottom: 18px; }
.overview-sheet { position: relative; overflow: hidden; padding: 19px; border: 1px solid rgba(23,60,67,.12); border-radius: 14px; background: rgba(251,252,250,.78); box-shadow: 0 12px 30px rgba(23,60,67,.06); backdrop-filter: blur(12px); }
.overview-sheet::before { content: ""; position: absolute; top: 0; right: 0; width: 78px; height: 3px; background: var(--lime); }
.overview-inspections::before { background: var(--blue); }
.sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-kicker { display: block; color: var(--blue); font: 600 9px/1.2 Consolas, monospace; letter-spacing: .13em; }
.sheet-heading h2 { margin: 5px 0 0; color: var(--teal-dark); font-size: 17px; letter-spacing: -.02em; }
.overview-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 15px; }
.overview-facts div { padding: 11px 12px; border: 1px solid rgba(23,60,67,.09); border-radius: 8px 3px 8px 3px; background: rgba(236,245,241,.66); }
.overview-facts span, .overview-facts strong { display: block; }
.overview-facts span { color: var(--muted); font-size: 9px; }
.overview-facts strong { overflow: hidden; margin-top: 6px; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.overview-facts .tone-good { color: #347d61; }
.overview-facts .tone-bad { color: var(--red); }
.material-stack { display: grid; gap: 7px; }
.material-chip, .inspection-event { width: 100%; border: 1px solid rgba(23,60,67,.10); background: rgba(255,255,255,.68); text-align: left; }
.material-chip { display: grid; grid-template-columns: 30px minmax(0, 1fr) 18px; align-items: center; gap: 9px; padding: 10px; border-radius: 8px 3px 8px 3px; color: var(--ink); transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.material-chip:hover { transform: translateX(3px); border-color: rgba(14,91,87,.28); background: #fff; }
.material-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 7px; color: var(--teal); background: #e2efea; }
.material-chip strong, .material-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-chip strong { font-size: 11px; }
.material-chip small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.material-arrow { color: var(--blue); }
.missing-materials { display: flex; align-items: center; gap: 7px; margin-top: 11px; padding: 9px 10px; border-radius: 7px; color: var(--amber); background: var(--amber-soft); font-size: 10px; }
.missing-materials span { flex: 1; }
.inspection-rail { position: relative; display: grid; gap: 5px; }
.inspection-rail::before { content: ""; position: absolute; top: 9px; bottom: 9px; left: 7px; width: 1px; background: rgba(14,91,87,.18); }
.inspection-event { position: relative; display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 11px 4px; border: 0; border-bottom: 1px solid rgba(23,60,67,.08); background: transparent; color: var(--ink); }
.inspection-event:last-child { border-bottom: 0; }
.inspection-event:hover { background: rgba(232,243,238,.64); }
.event-dot { z-index: 1; display: block; width: 8px; height: 8px; border: 2px solid var(--paper); border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px currentColor; }
.event-dot.good { color: #4d9b79; background: #4d9b79; }
.event-dot.bad { color: var(--red); background: var(--red); }
.event-main strong, .event-main small { display: block; }
.event-main strong { font-size: 11px; }
.event-main small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.next-check { display: flex; align-items: center; gap: 9px; margin-top: 13px; padding: 11px; border: 1px dashed rgba(14,91,87,.25); border-radius: 8px 3px 8px 3px; background: rgba(224,240,233,.58); }
.next-check.done { border-color: rgba(77,155,121,.28); background: rgba(230,246,234,.58); }
.next-check-icon { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 50%; color: var(--teal); background: #d5e9df; font-weight: 800; }
.next-check span:nth-child(2) { min-width: 0; flex: 1; }
.next-check small, .next-check strong { display: block; }
.next-check small { color: var(--muted); font-size: 9px; }
.next-check strong { margin-top: 4px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.worker-primary-action { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; width: 100%; min-height: 54px; margin-top: 17px; padding: 0 17px; border: 1px solid rgba(241,255,239,.28); border-radius: 10px 4px 10px 4px; color: #172726; background: var(--lime); box-shadow: 0 15px 28px rgba(17,50,43,.22); font-weight: 800; text-align: left; transition: transform .18s ease, box-shadow .18s ease; }
.worker-primary-action:hover { transform: translateY(-2px); box-shadow: 0 19px 34px rgba(17,50,43,.28); }
.worker-primary-action span { flex: 1; color: rgba(23,39,38,.62); font-size: 10px; font-weight: 600; }
.worker-primary-action svg:last-child { opacity: .65; }

@media (max-width: 720px) {
  .device-overview-grid { grid-template-columns: 1fr; gap: 11px; }
  .overview-sheet { padding: 16px; border-radius: 12px 4px 12px 4px; }
  .worker-subnav-five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .worker-subnav-five .worker-tab:nth-child(4), .worker-subnav-five .worker-tab:nth-child(5) { grid-column: span 1; }
}

@media (max-width: 560px) {
  .worker-shell { padding-bottom: 10px; }
  .scan-card { border-radius: 12px 4px 12px 4px; }
  .scan-card h2 { font-size: 18px; }
  .worker-subnav-five { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .worker-subnav-five .worker-tab:first-child { grid-column: span 2; }
  .worker-subnav-five .worker-tab { min-height: 42px; }
  .overview-facts { gap: 7px; }
  .overview-facts div { padding: 10px; }
  .worker-primary-action { margin-left: 0; width: 100%; }
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 252px; background: var(--teal-dark); color: #eef8f5; padding: 26px 16px 18px; display: flex; flex-direction: column; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--lime); display: grid; place-items: center; color: var(--teal-dark); font-weight: 900; font-size: 18px; }
.brand-copy strong { display: block; font-size: 16px; letter-spacing: .02em; }
.brand-copy span { display: block; margin-top: 4px; font-size: 11px; color: #a9c6c1; }
.nav-section { margin: 10px 9px 8px; color: #719694; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.nav { display: grid; gap: 4px; }
.nav button { width: 100%; border: 0; color: #bed4d0; background: transparent; border-radius: 10px; padding: 11px 12px; display: flex; align-items: center; gap: 11px; text-align: left; font-size: 13px; transition: .18s ease; }
.nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav button.active { background: #1b555b; color: #fff; box-shadow: inset 3px 0 var(--lime); }
.nav .count { margin-left: auto; min-width: 21px; height: 21px; border-radius: 7px; display: grid; place-items: center; background: #d66a51; color: #fff; font-size: 10px; font-weight: 700; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 16px 10px 0; color: #9dbbb6; font-size: 11px; line-height: 1.55; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #7dd391; margin-right: 6px; }

.main-shell { min-width: 0; flex: 1; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; background: rgba(255,255,255,.84); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.breadcrumb { color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: var(--ink); font-size: 15px; margin-left: 7px; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.mode-toggle { display: inline-flex; gap: 3px; padding: 4px; border: 1px solid var(--line); background: var(--canvas); border-radius: 10px; }
.mode-toggle button { border: 0; background: transparent; color: var(--muted); padding: 7px 10px; border-radius: 7px; font-size: 11px; display: flex; align-items: center; gap: 6px; }
.mode-toggle button.active { background: var(--paper); color: var(--teal-dark); box-shadow: 0 2px 7px rgba(22,48,49,.08); font-weight: 700; }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--paper); border-radius: 9px; color: var(--muted); display: grid; place-items: center; }
.icon-btn:hover { color: var(--teal); border-color: #a8c8c3; }
.user-pill { display: flex; align-items: center; gap: 9px; padding-left: 6px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--mint); color: var(--teal); display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.user-pill strong { display: block; font-size: 12px; }
.user-pill span { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }

.content { padding: 32px 34px 56px; max-width: 1540px; margin: 0 auto; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-weight: 800; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 0; font-size: 28px; line-height: 1.15; letter-spacing: -.03em; }
.page-intro p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.actions { display: flex; align-items: center; gap: 9px; }
.btn { border: 1px solid transparent; border-radius: 9px; padding: 10px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 700; transition: .18s ease; white-space: nowrap; }
.btn-primary { color: #fff; background: var(--teal); }
.btn-primary:hover { background: #0a454b; transform: translateY(-1px); }
.btn-secondary { color: var(--teal); background: var(--paper); border-color: var(--line); }
.btn-secondary:hover { border-color: #9dc3bd; background: #fbfefd; }
.btn-danger { color: var(--red); background: var(--red-soft); border-color: #f2cac2; }
.btn-sm { padding: 7px 10px; font-size: 11px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 20px; }
.metric { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; padding: 17px 18px; min-height: 121px; position: relative; overflow: hidden; }
.metric::after { content: ""; position: absolute; right: -18px; bottom: -22px; width: 88px; height: 88px; border: 1px solid #e3eeeb; border-radius: 50%; }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.metric-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--mint); color: var(--teal); display: grid; place-items: center; }
.metric-value { margin: 13px 0 4px; font-size: 28px; line-height: 1; letter-spacing: -.04em; }
.metric-foot { color: var(--muted); font-size: 10px; }
.metric-foot strong { color: var(--teal); }
.metric.alert .metric-icon { color: var(--red); background: var(--red-soft); }
.metric.warning .metric-icon { color: var(--amber); background: var(--amber-soft); }

.grid-2-1 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .95fr); gap: 18px; }
.grid-1-1 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.panel-head { min-height: 61px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.panel-title { display: flex; align-items: center; gap: 10px; }
.panel-title h2 { margin: 0; font-size: 14px; }
.panel-title p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.panel-body { padding: 18px; }
.text-link { color: var(--teal); font-size: 11px; border: 0; background: transparent; font-weight: 700; padding: 4px; }
.text-link:hover { text-decoration: underline; }

.task-list { display: grid; }
.task-row { display: grid; grid-template-columns: 37px minmax(0, 1.5fr) 104px 100px 78px; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid #edf2f0; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #fbfdfc; }
.task-index { width: 27px; height: 27px; border-radius: 8px; background: var(--canvas); color: var(--muted); display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.task-name { min-width: 0; }
.task-name strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-name span { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 5px; background: #e8efed; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.progress-meta { margin-top: 5px; color: var(--muted); font-size: 10px; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 7px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-ok { color: #328363; background: #eaf6ee; }
.status-warn { color: var(--amber); background: var(--amber-soft); }
.status-danger { color: var(--red); background: var(--red-soft); }
.status-info { color: var(--blue); background: var(--blue-soft); }
.status-neutral { color: var(--muted); background: var(--canvas); }

.alert-list { display: grid; gap: 9px; }
.alert-item { display: grid; grid-template-columns: 31px minmax(0,1fr) auto; gap: 10px; align-items: start; padding: 11px; background: #fbfdfc; border: 1px solid #edf2f0; border-radius: 10px; }
.alert-mark { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; }
.alert-mark.critical { background: var(--red-soft); color: var(--red); }
.alert-mark.warning { background: var(--amber-soft); color: var(--amber); }
.alert-mark.info { background: var(--blue-soft); color: var(--blue); }
.alert-item strong { display: block; font-size: 11px; }
.alert-item p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.alert-item time { color: #9aa9a7; font-size: 10px; white-space: nowrap; }

.snapshot { display: grid; gap: 12px; }
.snapshot-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11px; }
.snapshot-row span { color: var(--muted); }
.snapshot-row strong { font-size: 12px; }
.mini-bars { display: flex; align-items: end; gap: 7px; height: 82px; padding: 9px 3px 0; border-bottom: 1px solid var(--line); }
.mini-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 5px; height: 100%; }
.mini-bar span { width: 100%; max-width: 25px; border-radius: 5px 5px 0 0; background: #bcded4; min-height: 8px; }
.mini-bar.active span { background: var(--teal); }
.mini-bar label { color: var(--muted); font-size: 9px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #9aa9a7; }
.input, .select, .textarea { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 9px 10px; outline: 0; font-size: 11px; }
.search .input { padding-left: 31px; width: 218px; }
.input:focus, .select:focus, .textarea:focus { border-color: #8ebdb7; box-shadow: 0 0 0 3px rgba(88, 155, 143, .1); }
.select { min-width: 115px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th { text-align: left; color: #859592; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fbfdfc; white-space: nowrap; }
.data-table td { padding: 14px 16px; font-size: 11px; border-bottom: 1px solid #edf2f0; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdfc; }
.device-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.device-thumb { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: #daeae5; }
.device-cell strong, .person-cell strong { display: block; font-size: 11px; }
.device-cell span, .person-cell span { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-actions .icon-btn { width: 29px; height: 29px; border: 0; background: transparent; }

.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; }
.template-card { border: 1px solid var(--line); border-radius: 11px; padding: 15px; background: #fbfdfc; }
.template-card:hover { border-color: #9bc4bd; }
.template-top { display: flex; justify-content: space-between; gap: 10px; }
.template-top strong { font-size: 13px; }
.template-top span { color: var(--muted); font-size: 10px; }
.template-card p { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 9px 0 14px; }
.template-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 11px; border-top: 1px solid var(--line); }
.template-count { font-size: 11px; font-weight: 800; }
.template-count span { color: var(--muted); font-weight: 400; }
.cycle-tabs { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 2px; }
.cycle-tab { border: 1px solid var(--line); background: var(--paper); color: var(--muted); border-radius: 8px; padding: 8px 12px; font-size: 11px; white-space: nowrap; }
.cycle-tab.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.item-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.item-row { display: grid; grid-template-columns: 27px minmax(0, 1.4fr) minmax(180px, 1fr) 80px 48px; align-items: center; gap: 10px; min-height: 55px; padding: 9px 12px; border-bottom: 1px solid #edf2f0; }
.item-row:last-child { border-bottom: 0; }
.item-no { color: #a1b2ae; font-size: 10px; font-weight: 800; }
.item-row strong { display: block; font-size: 11px; }
.item-row span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.switch { width: 30px; height: 18px; padding: 2px; border: 0; border-radius: 99px; background: #cad8d5; display: flex; align-items: center; }
.switch span { width: 14px; height: 14px; border-radius: 50%; background: white; transition: .18s; }
.switch.on { background: var(--teal); justify-content: flex-end; }

.archive-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.file-card { position: relative; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.file-card-actions { position: absolute; top: 10px; right: 10px; }
.file-card-actions .icon-btn { width: 28px; height: 28px; color: var(--muted); background: rgba(255,255,255,.72); }
.file-card-actions .icon-btn:hover { color: var(--danger, #ef7352); background: #fff; }
.file-icon { width: 35px; height: 35px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; margin-bottom: 14px; }
.file-card strong { display: block; font-size: 12px; }
.file-card p { margin: 6px 0 13px; color: var(--muted); font-size: 10px; }
.file-meta { padding-top: 10px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }

.worker-shell { max-width: 680px; margin: 0 auto; }
.worker-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.worker-brand { display: flex; gap: 10px; align-items: center; }
.worker-brand .brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
.worker-brand strong { font-size: 14px; }
.worker-brand span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.scan-card { padding: 14px; background: var(--teal-dark); border-radius: 13px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.scan-card h2 { font-size: 14px; margin: 0 0 5px; }
.scan-card p { margin: 0; color: #b4cfca; font-size: 10px; }
.scan-card .btn { background: var(--lime); color: var(--teal-dark); }
.worker-device { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; margin-bottom: 15px; }
.worker-device-cover { height: 150px; position: relative; background: #b9d0ca; overflow: hidden; }
.worker-device-cover img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.78); }
.worker-device-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(16,59,66,.72)); }
.device-cover-text { position: absolute; left: 17px; right: 17px; bottom: 14px; z-index: 1; color: white; display: flex; align-items: end; justify-content: space-between; }
.device-cover-text h2 { margin: 0 0 5px; font-size: 19px; }
.device-cover-text p { margin: 0; font-size: 10px; color: #dbebe7; }
.device-summary { display: grid; grid-template-columns: repeat(3,1fr); padding: 13px 17px; gap: 10px; }
.device-summary div { border-right: 1px solid var(--line); }
.device-summary div:last-child { border-right: 0; }
.device-summary span { display: block; color: var(--muted); font-size: 10px; }
.device-summary strong { display: block; margin-top: 5px; font-size: 12px; }
.worker-subnav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 13px; padding: 4px; background: #e7efec; border-radius: 10px; }
.worker-tab { border: 0; background: transparent; color: var(--muted); border-radius: 7px; padding: 9px 7px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; }
.worker-tab.active { background: var(--paper); color: var(--teal); box-shadow: 0 2px 7px rgba(22,48,49,.08); font-weight: 800; }
.worker-file-list, .worker-history { display: grid; gap: 9px; }
.worker-file { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfc; }
.worker-file .file-icon { flex-shrink: 0; margin: 0; }
.worker-file-main { min-width: 0; flex: 1; }
.worker-file-main strong { display: block; font-size: 12px; }
.worker-file-main span, .worker-file-main small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.worker-file-main small { color: var(--amber); }
.history-row { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfc; }
.history-mark { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; color: var(--teal); background: var(--mint); }
.history-row strong { display: block; font-size: 11px; }
.history-row span { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.form-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.form-head { padding: 17px; border-bottom: 1px solid var(--line); }
.form-head h2 { margin: 0; font-size: 15px; }
.form-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.form-item { padding: 16px 17px; border-bottom: 1px solid #edf2f0; }
.form-item:last-child { border-bottom: 0; }
.form-item-title { display: flex; justify-content: space-between; gap: 14px; }
.form-item-title strong { font-size: 12px; line-height: 1.5; }
.form-item-title span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.segmented { display: flex; gap: 7px; margin-top: 11px; }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 9px 8px; text-align: center; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 11px; }
.segmented input:checked + span.good { background: #e9f6ee; border-color: #a3d4b7; color: #31815d; font-weight: 800; }
.segmented input:checked + span.bad { background: var(--red-soft); border-color: #e6aaa0; color: var(--red); font-weight: 800; }
.form-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 11px; }
.form-label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.form-actions { padding: 15px 17px; background: #fbfdfc; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sign-note { color: var(--muted); font-size: 10px; }

.settings-grid { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(280px,.9fr); gap: 18px; }
.policy-list { display: grid; gap: 9px; }
.policy-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 12px 13px; background: #fbfdfc; border: 1px solid #edf2f0; border-radius: 9px; }
.policy-row strong { display: block; font-size: 11px; }
.policy-row span { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.policy-value { color: var(--teal); font-weight: 800; font-size: 12px; white-space: nowrap; }
.table-note { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.muted-text { color: var(--muted); font-size: 10px; }
.binding-inline { display: block; max-width: 180px; color: var(--teal); font-size: 10px; line-height: 1.45; }
.binding-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.binding-card, .readiness-card, .archive-device-card { border: 1px solid var(--line); border-radius: 11px; background: #fbfdfc; padding: 14px; }
.binding-card-head, .readiness-head, .archive-device-foot, .archive-device-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.binding-card-head strong, .readiness-head strong, .archive-device-card strong { font-size: 12px; }
.binding-card-head span, .readiness-head span, .archive-device-card span { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.binding-list { display: grid; gap: 8px; margin-top: 12px; }
.binding-list > span { display: grid; gap: 4px; padding: 9px; border: 1px solid #e7efec; border-radius: 8px; background: #fff; }
.binding-list b { font-size: 11px; }
.binding-list small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.binding-list .status { width: max-content; }
.readiness-card.ready { border-color: #b7dfc7; background: #f5fbf7; }
.readiness-card.blocked { border-color: #f0c1b9; background: #fff9f7; }
.readiness-list { display: grid; gap: 7px; margin-top: 12px; }
.readiness-list span { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 10px; }
.worker-status { margin-bottom: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fbfdfc; }
.worker-status.ready { border-color: #b7dfc7; background: #f5fbf7; }
.worker-status.blocked { border-color: #f0c1b9; background: #fff9f7; }
.worker-status-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.worker-status-head strong { display: block; font-size: 12px; }
.worker-status-head span { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.worker-status-list { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 11px; }
.worker-status-list span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.worker-subnav-four { grid-template-columns: repeat(4, 1fr); }
.linked-form-strip { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 11px; }
.linked-form-strip span { color: var(--muted); font-size: 10px; }
.linked-form-strip b { padding: 5px 7px; border-radius: 6px; background: var(--mint); color: var(--teal); font-size: 10px; }
.archive-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.archive-facts div { padding: 10px; border: 1px solid #e7efec; border-radius: 8px; background: #fbfdfc; }
.archive-facts span, .archive-facts strong { display: block; }
.archive-facts span { color: var(--muted); font-size: 10px; }
.archive-facts strong { margin-top: 5px; font-size: 11px; }
.archive-section-title { padding-top: 14px; margin: 12px 0 9px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 800; font-size: 11px; }
.issue-list { display: grid; gap: 9px; }
.issue-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #fbfdfc; }
.issue-mark { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; }
.issue-mark.danger { color: var(--red); background: var(--red-soft); }
.issue-mark.info { color: var(--blue); background: var(--blue-soft); }
.issue-row strong, .issue-row span { display: block; }
.issue-row strong { font-size: 11px; }
.issue-row span { color: var(--muted); font-size: 10px; margin-top: 4px; line-height: 1.4; }
.archive-device-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.archive-device-meta { margin: 13px 0; padding: 9px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.archive-device-meta span { margin: 0; }
.archive-device-foot .text-link { padding: 0; }
.readiness-inline { display: grid; gap: 4px; margin-top: 16px; padding: 11px; border-radius: 8px; }
.readiness-inline.ready { background: #eef9f1; color: #328363; }
.readiness-inline.blocked { background: var(--red-soft); color: var(--red); }
.readiness-inline strong { font-size: 11px; }
.readiness-inline span { font-size: 10px; line-height: 1.45; }
.modal-note { padding: 10px; border-radius: 8px; color: var(--muted); background: var(--canvas); font-size: 10px; line-height: 1.45; }

.modal-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(16, 38, 41, .45); display: grid; place-items: center; padding: 18px; }
.modal { width: min(540px, 100%); max-height: min(720px, 92vh); overflow: auto; background: var(--paper); border-radius: 15px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; }
.modal-form { display: grid; gap: 13px; }
.modal-form .form-label { font-size: 11px; color: var(--ink); font-weight: 700; }
.modal-form .input, .modal-form .select, .modal-form .textarea { width: 100%; margin-top: 6px; font-weight: 400; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }

.empty { padding: 38px 20px; text-align: center; color: var(--muted); font-size: 12px; }
.mobile-only { display: none; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; padding: 12px 16px; color: #fff; background: var(--teal-dark); border: 1px solid rgba(255,255,255,.1); border-radius: 9px; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1120px) {
  .sidebar { width: 212px; }
  .topbar, .content { padding-left: 24px; padding-right: 24px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .archive-grid { grid-template-columns: repeat(2,1fr); }
  .template-grid { grid-template-columns: repeat(2,1fr); }
  .binding-grid, .archive-device-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .sidebar { width: 66px; padding: 18px 10px; }
  .brand { padding: 0 4px 22px; }
  .brand-copy, .nav-section, .nav button span, .nav .count, .sidebar-foot { display: none; }
  .nav button { justify-content: center; padding: 11px 0; }
  .nav button.active { box-shadow: none; }
  .grid-2-1, .grid-1-1, .settings-grid { grid-template-columns: 1fr; }
  .binding-grid, .archive-device-grid { grid-template-columns: 1fr; }
  .content { padding: 24px 18px 45px; }
  .topbar { padding: 0 18px; }
  .top-actions { gap: 8px; }
  .user-pill > div:last-child { display: none; }
  .page-intro { align-items: flex-start; flex-direction: column; }
  .task-row { grid-template-columns: 28px minmax(0,1fr) 78px; }
  .task-row > :nth-child(3), .task-row > :nth-child(4) { display: none; }
}
@media (max-width: 560px) {
  .sidebar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; height: 59px; z-index: 20; padding: 5px 6px; }
  .brand, .sidebar-foot, .nav-section { display: none; }
  .nav { display: flex; justify-content: space-around; }
  .nav button { flex: 1; padding: 8px 4px; display: grid; gap: 2px; place-items: center; font-size: 9px; }
  .nav button span { display: block; font-size: 9px; }
  .nav button.active { background: #1b555b; }
  .main-shell { padding-bottom: 59px; }
  .topbar { height: 66px; }
  .breadcrumb span { display: none; }
  .breadcrumb strong { margin-left: 0; font-size: 13px; }
  .mode-toggle button { padding: 6px; }
  .mode-toggle button span { display: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .metric { min-height: 108px; padding: 13px; }
  .metric-value { font-size: 24px; }
  h1 { font-size: 23px; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search .input { width: 100%; }
  .filters { width: 100%; }
  .filters .select { flex: 1; }
  .template-grid, .archive-grid { grid-template-columns: 1fr; }
  .item-row { grid-template-columns: 20px minmax(0,1fr) 34px; }
  .item-row > :nth-child(3), .item-row > :nth-child(4) { display: none; }
  .worker-shell { width: 100%; }
  .scan-card { align-items: flex-start; flex-direction: column; }
  .scan-card .btn { width: 100%; }
  .device-summary { grid-template-columns: 1fr 1fr; }
  .device-summary div:nth-child(2) { border-right: 0; }
  .device-summary div:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 10px; }
  .form-inline { grid-template-columns: 1fr; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .btn { width: 100%; }
  .worker-subnav-four { grid-template-columns: repeat(2, 1fr); }
  .archive-facts { grid-template-columns: 1fr; }
}

/* Art direction: field ledger meets editorial control room. */
:root {
  --ink: #183538;
  --muted: #718184;
  --line: #d5e1dc;
  --paper: #fffdf8;
  --canvas: #f0f4f0;
  --teal: #0e5b57;
  --teal-dark: #0b3438;
  --mint: #e2efe8;
  --lime: #d0ee6c;
  --amber: #bd7a20;
  --amber-soft: #fff1d5;
  --red: #bd5144;
  --red-soft: #f9e8e2;
  --blue: #3f7082;
  --blue-soft: #e9f1f3;
  --shadow: 0 16px 38px rgba(18, 52, 52, .07);
}

html { background: var(--canvas); }
body {
  background-color: var(--canvas);
  background-image: linear-gradient(rgba(14, 91, 87, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(14, 91, 87, .035) 1px, transparent 1px);
  background-size: 32px 32px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  border: 12px solid rgba(255, 253, 248, .28);
}

#app { position: relative; z-index: 1; }
.app-shell { position: relative; }
.sidebar {
  position: relative;
  width: 238px;
  padding: 30px 15px 20px;
  background: var(--teal-dark);
  box-shadow: 8px 0 28px rgba(9, 42, 45, .10);
}
.sidebar::after {
  content: "FIELD / 01";
  position: absolute;
  right: 14px;
  bottom: 88px;
  color: rgba(208, 238, 108, .38);
  font-size: 9px;
  letter-spacing: .16em;
  writing-mode: vertical-rl;
}
.brand { padding: 0 10px 32px; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 6px 13px 6px 13px;
  box-shadow: 5px 5px 0 rgba(208, 238, 108, .18);
}
.brand-copy strong { font-size: 17px; letter-spacing: .04em; }
.brand-copy span { color: #b7cfca; letter-spacing: .04em; }
.nav-section { margin-top: 6px; color: #82a39e; letter-spacing: .18em; }
.nav { gap: 5px; }
.nav button {
  border-radius: 7px;
  border-left: 1px solid transparent;
  padding: 12px 12px;
  letter-spacing: .02em;
}
.nav button:hover { background: rgba(255,255,255,.07); }
.nav button.active {
  background: #1a5557;
  border-left-color: var(--lime);
  box-shadow: inset 4px 0 var(--lime), 0 7px 17px rgba(4, 28, 30, .12);
}
.nav .count { border-radius: 5px; background: #d96b50; }
.sidebar-foot { border-top-color: rgba(208, 238, 108, .23); }

.topbar {
  height: 72px;
  padding: 0 38px;
  background: rgba(255, 253, 248, .86);
  border-bottom-color: var(--line);
}
.breadcrumb { letter-spacing: .02em; }
.breadcrumb strong { font-size: 16px; letter-spacing: .01em; }
.mode-toggle { border-radius: 7px; background: #edf3ef; }
.mode-toggle button { border-radius: 5px; }
.mode-toggle button.active { color: var(--teal-dark); box-shadow: 0 3px 8px rgba(16, 59, 66, .11); }
.icon-btn { border-radius: 6px; background: var(--paper); }
.avatar { border-radius: 6px 11px 6px 11px; }

.content { padding: 42px 38px 68px; }
.page-intro {
  position: relative;
  margin-bottom: 30px;
  padding-bottom: 19px;
  border-bottom: 1px solid rgba(14, 91, 87, .16);
}
.page-intro::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 72px;
  height: 3px;
  background: var(--lime);
}
.eyebrow { letter-spacing: .2em; color: var(--teal); }
h1 { font-size: 31px; letter-spacing: 0; font-weight: 800; }
.page-intro p { max-width: 640px; line-height: 1.65; }
.actions { gap: 8px; }
.btn { border-radius: 6px; padding: 10px 15px; letter-spacing: .02em; }
.btn-primary { background: var(--teal); box-shadow: 0 5px 12px rgba(14, 91, 87, .15); }
.btn-primary:hover { background: #084d4a; transform: translateY(-1px); }
.btn-secondary { background: var(--paper); }

.metric-grid { gap: 15px; margin-bottom: 22px; }
.metric {
  min-height: 126px;
  border-radius: 8px;
  padding: 18px 19px;
  box-shadow: 0 5px 16px rgba(20, 54, 54, .035);
}
.metric::after { border-color: #d9e9e1; }
.metric::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 38px;
  height: 3px;
  background: var(--teal);
}
.metric:nth-child(2)::before { background: #66a98c; }
.metric:nth-child(3)::before { background: var(--red); }
.metric:nth-child(4)::before { background: var(--amber); }
.metric-icon { border-radius: 5px 9px 5px 9px; }
.metric-value { font-size: 30px; letter-spacing: 0; }

.grid-2-1, .grid-1-1, .settings-grid { gap: 20px; }
.panel {
  border-radius: 8px;
  box-shadow: 0 7px 22px rgba(20, 54, 54, .035);
}
.panel-head { min-height: 66px; padding: 17px 20px; }
.panel-title { gap: 12px; }
.panel-title h2 { font-size: 14px; letter-spacing: .02em; }
.panel-title p { line-height: 1.5; }
.text-link { color: var(--teal); letter-spacing: .02em; }
.text-link:hover { color: var(--teal-dark); }
.task-row {
  min-height: 69px;
  padding: 12px 20px;
  border-bottom-color: #e9f0ed;
}
.task-row:hover { background: #f6fbf7; }
.task-index { border-radius: 5px 8px 5px 8px; background: #edf4ef; }
.status { border-radius: 4px; letter-spacing: .02em; }
.alert-item { border-radius: 6px; }
.alert-item:hover { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(20,54,54,.06); }

.toolbar { margin-bottom: 17px; }
.input, .select, .textarea { border-radius: 6px; background: rgba(255,253,248,.84); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 91, 87, .11); }
.data-table th { padding: 13px 17px; background: #f4f8f4; color: #59716f; letter-spacing: .12em; }
.data-table td { padding: 15px 17px; }
.data-table tbody tr:hover { background: #f7fbf7; }
.device-thumb { border-radius: 5px 10px 5px 10px; }
.row-actions .icon-btn { border-radius: 5px; }

.template-grid { gap: 16px; }
.template-card, .binding-card, .readiness-card, .archive-device-card, .file-card {
  border-radius: 7px;
  background: rgba(255, 253, 248, .78);
}
.template-card { position: relative; overflow: hidden; }
.template-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--lime);
}
.cycle-tab { border-radius: 5px; }
.cycle-tab.active { background: var(--teal); box-shadow: 0 5px 12px rgba(14,91,87,.14); }
.item-list { border-radius: 7px; }
.item-row { min-height: 59px; padding: 10px 13px; }
.item-no { color: var(--teal); }

.archive-grid { gap: 15px; }
.file-card { transition: transform .18s ease, box-shadow .18s ease; }
.file-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.file-icon { border-radius: 5px 10px 5px 10px; }
.binding-list > span { border-radius: 6px; background: rgba(255,253,248,.9); }
.readiness-card { border-left-width: 3px; }

.worker-shell { max-width: 710px; padding-top: 12px; }
.worker-top { margin-bottom: 23px; }
.worker-brand .brand-mark { border-radius: 5px 10px 5px 10px; box-shadow: 4px 4px 0 rgba(14,91,87,.10); }
.scan-card {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  padding: 20px 21px;
  border-radius: 8px;
  border-left: 4px solid var(--lime);
  box-shadow: 0 12px 24px rgba(11,52,56,.12);
}
.scan-card::after {
  content: "SCAN / LOG / VERIFY";
  position: absolute;
  right: 18px;
  bottom: 14px;
  color: rgba(208,238,108,.38);
  font-size: 9px;
  letter-spacing: .17em;
}
.scan-card h2 { font-size: 16px; letter-spacing: .02em; }
.scan-card p { max-width: 390px; line-height: 1.6; }
.scan-card .btn { position: relative; z-index: 1; border-radius: 5px; box-shadow: 4px 4px 0 rgba(255,255,255,.08); }
.worker-device { border-radius: 8px; box-shadow: var(--shadow); }
.worker-device-cover { height: 178px; }
.worker-device-cover img { filter: saturate(.7) contrast(1.08); }
.device-cover-text { left: 20px; right: 20px; bottom: 17px; }
.device-cover-text h2 { font-size: 22px; letter-spacing: .01em; }
.device-summary { padding: 16px 20px; }
.worker-status { border-radius: 7px; border-left-width: 3px; }
.worker-subnav {
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  background: rgba(224, 239, 232, .82);
  border-radius: 7px;
}
.worker-tab { border-radius: 5px; padding: 10px 7px; }
.form-panel { border-radius: 8px; box-shadow: var(--shadow); }
.form-head { padding: 20px; }
.form-head h2 { font-size: 17px; letter-spacing: .01em; }
.form-item { padding: 18px 20px; }
.form-item-title strong { font-size: 13px; }
.segmented { gap: 8px; }
.segmented span { border-radius: 5px; padding: 11px 8px; }
.form-actions { padding: 17px 20px; background: #f4f8f4; }
.form-actions .btn-primary { min-width: 152px; }

.modal-backdrop { background: rgba(10, 38, 40, .52); }
.modal { border-radius: 9px; box-shadow: 0 24px 70px rgba(6, 31, 34, .22); }
.modal-head { padding: 19px 21px; }

@media (max-width: 820px) {
  .content { padding: 28px 24px 50px; }
  .topbar { padding: 0 24px; }
  .sidebar { width: 70px; }
}

@media (max-width: 560px) {
  body { background-size: 24px 24px; }
  body::before { border-width: 6px; }
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    height: 62px;
    padding: 5px 7px;
    background: rgba(255, 253, 248, .96);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 22px rgba(18, 52, 52, .08);
  }
  .nav button { color: #7a8b89; border-radius: 5px; }
  .nav button.active { color: var(--teal-dark); background: var(--mint); box-shadow: inset 0 3px var(--lime); }
  .main-shell { padding-bottom: 62px; }
  .topbar { height: 70px; padding: 0 17px; }
  .content { padding: 26px 15px 42px; }
  .page-intro { padding-bottom: 15px; margin-bottom: 23px; }
  h1 { font-size: 25px; }
  .metric { border-radius: 7px; }
  .metric-value { font-size: 26px; }
  .scan-card { min-height: 148px; padding: 18px; }
  .scan-card::after { right: 14px; bottom: 10px; }
  .worker-device-cover { height: 165px; }
  .device-cover-text h2 { font-size: 20px; }
  .worker-subnav { position: sticky; top: 70px; z-index: 5; }
  .form-panel { border-radius: 7px; }
  .form-head, .form-item, .form-actions { padding-left: 16px; padding-right: 16px; }
  .form-actions .btn-primary { min-width: 0; }
  .toast { right: 14px; bottom: 76px; left: 14px; text-align: center; }
}

@media (min-width: 99999px) {
/* Industrial control room direction: cool alloy, graphite, one oxide-orange signal. */
:root {
  --ink: #172326;
  --muted: #69777a;
  --line: #d6dfdf;
  --paper: #fbfcfa;
  --canvas: #e7ecec;
  --teal: #173c43;
  --teal-dark: #101a1d;
  --mint: #e5eeec;
  --lime: #f2794b;
  --amber: #bb7b2e;
  --amber-soft: #fff1dc;
  --red: #c64c42;
  --red-soft: #fbe9e5;
  --blue: #2d6875;
  --blue-soft: #e7f1f3;
  --shadow: 0 22px 55px rgba(19, 39, 42, .11);
  font-family: Bahnschrift, "Arial Narrow", "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
}

html { background: var(--canvas); }
body {
  min-width: 320px;
  background-color: var(--canvas);
  background-image: linear-gradient(rgba(23, 60, 67, .042) 1px, transparent 1px), linear-gradient(90deg, rgba(23, 60, 67, .042) 1px, transparent 1px);
  background-size: 32px 32px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.36);
}

#app { position: relative; z-index: 1; }
.app-shell { max-width: 1680px; margin: 0 auto; }

.sidebar {
  width: 230px;
  padding: 25px 13px 18px;
  background: var(--teal-dark);
  box-shadow: 10px 0 30px rgba(11, 27, 30, .13);
}
.sidebar::after { display: none; }
.brand { padding: 0 10px 30px; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 11px 4px 11px 4px;
  background: var(--lime);
  color: var(--teal-dark);
  box-shadow: 5px 5px 0 rgba(242,121,75,.22);
}
.brand-copy strong { color: #f6fbf9; font-size: 17px; letter-spacing: .01em; }
.brand-copy span { color: #91a8aa; letter-spacing: .05em; }
.nav-section { margin: 6px 9px 9px; color: #70888a; font-size: 10px; letter-spacing: .2em; }
.nav { gap: 5px; }
.nav button {
  min-height: 42px;
  border-radius: 7px;
  border-left: 2px solid transparent;
  padding: 11px 12px;
  color: #adc0c0;
  letter-spacing: .015em;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.nav button:hover { color: #fff; background: rgba(255,255,255,.075); transform: translateX(2px); }
.nav button.active {
  color: #fff;
  background: #1c4b51;
  border-left-color: var(--lime);
  box-shadow: inset 4px 0 var(--lime), 0 9px 20px rgba(6, 22, 25, .16);
}
.nav .count { border-radius: 5px; background: var(--lime); color: #172326; }
.sidebar-foot { border-top-color: rgba(242,121,75,.28); color: #91a8aa; }
.status-dot { background: #7cd19e; box-shadow: 0 0 0 4px rgba(124,209,158,.13); }

.main-shell { background: rgba(231,236,236,.72); }
.topbar {
  height: 70px;
  padding: 0 38px;
  background: rgba(251,252,250,.82);
  border-bottom-color: rgba(23,35,38,.11);
  box-shadow: 0 1px 0 rgba(255,255,255,.7);
}
.breadcrumb { color: #788588; font-size: 11px; letter-spacing: .02em; }
.breadcrumb strong { color: var(--ink); font-size: 15px; }
.mode-toggle { border-radius: 7px; background: #e6eceb; border-color: #d5dfde; }
.mode-toggle button { min-height: 32px; border-radius: 5px; }
.mode-toggle button.active { color: var(--ink); background: var(--paper); box-shadow: 0 4px 12px rgba(23,35,38,.11); }
.icon-btn { border-radius: 7px; border-color: var(--line); background: rgba(251,252,250,.85); }
.icon-btn:hover { color: var(--lime); border-color: var(--lime); background: #fff; }
.avatar { border-radius: 7px 4px 7px 4px; background: var(--lime); color: var(--teal-dark); }
.user-pill strong { font-size: 12px; }

.content { max-width: 1500px; padding: 38px 38px 64px; }
.page-intro {
  position: relative;
  align-items: flex-end;
  margin-bottom: 28px;
  padding-bottom: 21px;
  border-bottom: 1px solid rgba(23,60,67,.14);
}
.page-intro::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 82px;
  height: 3px;
  background: var(--lime);
}
.eyebrow { color: var(--blue); font-size: 10px; letter-spacing: .19em; }
h1 { color: var(--teal-dark); font-size: 34px; font-weight: 800; letter-spacing: -.035em; }
.page-intro p { max-width: 630px; line-height: 1.6; }
.actions { gap: 8px; }
.btn { min-height: 42px; border-radius: 7px; padding: 10px 15px; letter-spacing: .01em; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { color: #1a2223; background: var(--lime); box-shadow: 0 8px 18px rgba(242,121,75,.22); }
.btn-primary:hover { color: #172326; background: #ff8659; box-shadow: 0 11px 22px rgba(242,121,75,.3); transform: translateY(-1px); }
.btn-secondary { color: var(--teal); border-color: var(--line); background: rgba(251,252,250,.84); }
.btn-secondary:hover { color: var(--teal-dark); border-color: var(--teal); background: #fff; transform: translateY(-1px); }
.btn-danger { color: var(--red); background: var(--red-soft); }

.metric-grid { gap: 12px; margin-bottom: 20px; }
.metric {
  min-height: 128px;
  padding: 18px 19px;
  border: 1px solid rgba(23,60,67,.13);
  border-radius: 12px;
  background: rgba(251,252,250,.82);
  box-shadow: 0 8px 25px rgba(23,60,67,.055);
}
.metric::before { background: var(--lime); }
.metric::after { border-color: rgba(23,60,67,.11); }
.metric:nth-child(2)::before, .metric:nth-child(3)::before, .metric:nth-child(4)::before { background: var(--lime); }
.metric-head { font-size: 10px; letter-spacing: .02em; }
.metric-icon { border-radius: 7px; background: #e3eee9; color: var(--teal); }
.metric-value { margin-top: 16px; color: var(--teal-dark); font: 600 31px/1 Consolas, "SFMono-Regular", monospace; letter-spacing: -.06em; }
.metric-foot { font-size: 10px; }
.metric-foot strong { color: var(--teal); }
.metric.alert .metric-icon { color: var(--red); background: var(--red-soft); }
.metric.warning .metric-icon { color: var(--amber); background: var(--amber-soft); }

.grid-2-1, .grid-1-1, .settings-grid { gap: 16px; }
.panel {
  border: 1px solid rgba(23,60,67,.13);
  border-radius: 12px;
  background: rgba(251,252,250,.9);
  box-shadow: 0 10px 28px rgba(23,60,67,.045);
}
.panel-head { min-height: 68px; padding: 17px 20px; border-bottom-color: rgba(23,60,67,.11); }
.panel-title { gap: 12px; }
.panel-title h2 { color: var(--teal-dark); font-size: 14px; letter-spacing: .015em; }
.panel-title p { line-height: 1.45; }
.panel-body { padding: 19px 20px; }
.text-link { color: var(--blue); }
.text-link:hover { color: var(--lime); }
.task-row { min-height: 70px; padding: 13px 20px; border-bottom-color: rgba(23,60,67,.09); transition: background .18s ease, transform .18s ease; }
.task-row:hover { background: #f2f7f5; transform: translateX(2px); }
.task-index { border-radius: 6px; background: #e7eeec; color: var(--blue); font: 600 10px Consolas, monospace; }
.task-name strong { font-size: 12px; }
.progress { background: #e2e9e7; }
.progress > span { background: var(--lime); }
.status { border-radius: 5px; }
.status-ok { color: #347d61; background: #e5f3e9; }
.status-warn { color: #a66c27; background: var(--amber-soft); }
.status-danger { color: var(--red); background: var(--red-soft); }
.status-info { color: var(--blue); background: var(--blue-soft); }
.alert-list { gap: 8px; }
.alert-item { border-radius: 9px; border-color: rgba(23,60,67,.10); background: #f7faf8; transition: transform .18s ease, box-shadow .18s ease; }
.alert-item:hover { transform: translateY(-2px); box-shadow: 0 9px 20px rgba(23,60,67,.08); }

.toolbar { margin-bottom: 17px; }
.input, .select, .textarea { min-height: 40px; border-radius: 7px; border-color: var(--line); background: rgba(251,252,250,.92); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(242,121,75,.16); }
.data-table { min-width: 760px; }
.data-table th { padding: 13px 17px; color: #657578; background: #eef3f1; border-bottom-color: var(--line); letter-spacing: .1em; }
.data-table td { padding: 15px 17px; border-bottom-color: rgba(23,60,67,.09); }
.data-table tbody tr { transition: background .18s ease; }
.data-table tbody tr:hover { background: #f1f6f4; }
.device-thumb { border-radius: 8px; }
.row-actions .icon-btn { border-radius: 6px; }

.template-grid, .archive-grid { gap: 14px; }
.template-card, .binding-card, .readiness-card, .archive-device-card, .file-card { border-radius: 12px; background: rgba(251,252,250,.8); border-color: rgba(23,60,67,.12); }
.template-card::before { background: var(--lime); }
.cycle-tab { min-height: 40px; border-radius: 7px; }
.cycle-tab.active { color: #1b2324; background: var(--lime); box-shadow: 0 7px 15px rgba(242,121,75,.2); }
.item-list { border-radius: 10px; }
.item-row { min-height: 61px; padding: 10px 14px; }
.item-no { color: var(--lime); font: 600 10px Consolas, monospace; }
.file-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.file-icon { border-radius: 8px; color: var(--teal); background: #e5efec; }
.binding-list > span { border-radius: 9px; background: #f3f7f5; }
.readiness-card { border-left-width: 3px; }

.worker-shell { max-width: 720px; padding-top: 16px; }
.worker-top { margin-bottom: 25px; }
.worker-brand .brand-mark { border-radius: 10px 4px 10px 4px; box-shadow: 4px 4px 0 rgba(242,121,75,.18); }
.scan-card {
  min-height: 142px;
  padding: 22px 23px;
  border-radius: 12px;
  border-left: 4px solid var(--lime);
  background: var(--teal-dark);
  box-shadow: 0 16px 32px rgba(14,28,31,.18);
}
.scan-card::after { color: rgba(242,121,75,.38); }
.scan-card h2 { font-size: 17px; }
.scan-card p { color: #abc0bf; line-height: 1.6; }
.scan-card .btn { min-height: 44px; color: #1b2324; background: var(--lime); box-shadow: 5px 5px 0 rgba(255,255,255,.08); }
.worker-device { border-radius: 12px; box-shadow: var(--shadow); }
.worker-device-cover { height: 206px; }
.worker-device-cover img { filter: saturate(.78) contrast(1.08); }
.worker-device-cover::after { background: linear-gradient(180deg, transparent 38%, rgba(12,28,31,.82)); }
.device-cover-text { left: 22px; right: 22px; bottom: 19px; }
.device-cover-text h2 { font-size: 25px; }
.device-summary { padding: 18px 22px; }
.worker-status { border-radius: 9px; border-left-width: 3px; }
.worker-subnav { gap: 5px; padding: 5px; border-radius: 10px; background: #dfe9e6; }
.worker-tab { min-height: 44px; border-radius: 7px; padding: 11px 7px; }
.worker-tab.active { color: #1b2425; background: var(--lime); box-shadow: 0 5px 12px rgba(242,121,75,.18); }
.form-panel { border-radius: 12px; box-shadow: var(--shadow); }
.form-head { padding: 22px; }
.form-head h2 { font-size: 18px; }
.form-item { padding: 19px 22px; }
.form-item-title strong { font-size: 13px; }
.segmented { gap: 8px; }
.segmented span { min-height: 44px; display: grid; place-items: center; border-radius: 7px; padding: 11px 8px; }
.segmented input:checked + span { color: #1b2324; background: var(--lime); border-color: var(--lime); }
.form-actions { padding: 18px 22px; background: #edf3f1; }
.form-actions .btn-primary { min-width: 160px; }

.modal-backdrop { background: rgba(12, 26, 29, .62); backdrop-filter: blur(5px); }
.modal { border-radius: 12px; box-shadow: 0 28px 80px rgba(8,22,25,.3); }
.modal-head { padding: 19px 22px; }
.modal-body { padding: 22px; }
.toast { right: 26px; bottom: 26px; border-radius: 8px; background: var(--teal-dark); box-shadow: 0 18px 36px rgba(8,22,25,.24); }

button, .btn, .nav button, .worker-tab, .cycle-tab, .icon-btn, .text-link, .task-row, .data-table tbody tr { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, .worker-tab:focus-visible { outline: 3px solid rgba(242,121,75,.45); outline-offset: 2px; }

@media (prefers-reduced-motion: no-preference) {
  .metric, .panel, .worker-device, .scan-card { animation: control-room-rise .42s ease both; }
  .metric:nth-child(2), .grid-2-1 .panel:nth-child(2), .grid-1-1 .panel:nth-child(2) { animation-delay: 70ms; }
  .metric:nth-child(3) { animation-delay: 120ms; }
  .metric:nth-child(4) { animation-delay: 170ms; }
  @keyframes control-room-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition-duration: .01ms !important; }
}

@media (max-width: 1120px) {
  .sidebar { width: 210px; }
  .content, .topbar { padding-left: 25px; padding-right: 25px; }
  .content { padding-top: 30px; }
}
@media (max-width: 820px) {
  .sidebar { width: 70px; padding: 18px 10px; }
  .brand { padding: 0 4px 23px; }
  .brand-copy, .nav-section, .nav button span, .nav .count, .sidebar-foot { display: none; }
  .nav button { justify-content: center; padding: 11px 0; }
  .nav button.active { box-shadow: inset 3px 0 var(--lime); }
  .content { padding: 27px 20px 50px; }
  .topbar { padding: 0 20px; }
  .page-intro { align-items: flex-start; flex-direction: column; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; }
  .grid-2-1, .grid-1-1, .settings-grid { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: 28px minmax(0,1fr) 78px; }
  .task-row > :nth-child(3), .task-row > :nth-child(4) { display: none; }
}
@media (max-width: 560px) {
  body { background-size: 24px 24px; }
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    z-index: 20;
    width: 100%;
    height: 64px;
    padding: 5px 6px;
    background: rgba(16,26,29,.96);
    border-top: 1px solid rgba(242,121,75,.24);
    box-shadow: 0 -10px 28px rgba(12,26,29,.16);
  }
  .brand, .sidebar-foot, .nav-section { display: none; }
  .nav { display: flex; justify-content: space-around; gap: 3px; }
  .nav button { flex: 1; min-height: 54px; padding: 7px 3px; display: grid; gap: 2px; place-items: center; border-left: 0; border-radius: 7px; color: #91a8aa; font-size: 9px; }
  .nav button span { display: block; overflow: hidden; max-width: 54px; white-space: nowrap; text-overflow: ellipsis; font-size: 9px; }
  .nav button.active { color: #fff; background: #1c4b51; box-shadow: inset 0 -3px var(--lime); }
  .main-shell { padding-bottom: 64px; }
  .topbar { height: 68px; padding: 0 15px; }
  .breadcrumb span { display: none; }
  .breadcrumb strong { margin-left: 0; font-size: 13px; }
  .top-actions { gap: 7px; }
  .top-actions .icon-btn { width: 38px; height: 38px; }
  .user-pill > div:last-child { display: none; }
  .mode-toggle button { padding: 7px; }
  .mode-toggle button span { display: none; }
  .content { padding: 25px 15px 38px; }
  h1 { font-size: 27px; }
  .page-intro { padding-bottom: 17px; margin-bottom: 22px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { min-height: 112px; padding: 14px; border-radius: 10px; }
  .metric-value { font-size: 26px; }
  .actions .btn { min-height: 44px; padding: 9px 10px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search .input { width: 100%; }
  .filters { width: 100%; }
  .filters .select { flex: 1; min-width: 0; }
  .template-grid, .archive-grid { grid-template-columns: 1fr; }
  .worker-shell { width: 100%; padding-top: 8px; }
  .scan-card { min-height: 164px; padding: 19px; align-items: flex-start; flex-direction: column; }
  .scan-card .btn { width: 100%; }
  .worker-device-cover { height: 178px; }
  .device-cover-text h2 { font-size: 21px; }
  .worker-subnav { position: sticky; top: 68px; z-index: 5; }
  .form-head, .form-item, .form-actions { padding-left: 16px; padding-right: 16px; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .btn-primary { min-width: 0; }
  .toast { right: 14px; bottom: 78px; left: 14px; text-align: center; }
}

/* Keep every admin destination reachable on narrow screens without shrinking tap targets. */
@media (max-width: 560px) {
  .sidebar .nav {
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .sidebar .nav::-webkit-scrollbar { display: none; }
  .sidebar .nav button {
    flex: 0 0 72px;
  }
}
}

/* Proportional canvas pass: let each route occupy the browser surface without
   turning wide screens into a centered, undersized island. */
:root {
  --spatial-gutter: clamp(16px, 4vw, 78px);
  --spatial-vert-pad: clamp(16px, 2.6vh, 30px);
  --spatial-radius: clamp(16px, 1.4vw, 27px);
}

.spatial-admin,
.spatial-page,
.spatial-worker {
  min-height: 100svh;
}

.spatial-stage,
.spatial-worker-stage {
  box-sizing: border-box;
  min-height: clamp(680px, calc(100dvh - clamp(108px, 12vh, 136px)), 900px);
  padding: var(--spatial-vert-pad) var(--spatial-gutter) clamp(18px, 2.8vh, 34px);
}

@media (min-width: 821px) {
  /* The asset rail follows the stage. Do not leave the admin root taller than
     the two visible surfaces combined on tall desktop screens. */
  .spatial-admin {
    min-height: 0;
  }

  .spatial-stage {
    min-height: 0;
    height: max(640px, calc(100dvh - clamp(112px, 13.5vh, 156px)));
  }
}

.spatial-header,
.spatial-worker-header,
.spatial-page-header {
  min-height: clamp(42px, 5.2vh, 58px);
}

.spatial-title {
  top: clamp(118px, 14vh, 176px);
  left: clamp(68px, 8vw, 154px);
  max-width: min(31vw, 520px);
}

.spatial-title h1,
.spatial-worker-title h1 {
  font-size: clamp(44px, 5.2vw, 94px);
}

.spatial-specimen,
.spatial-worker-specimen {
  top: clamp(128px, 14.5vh, 190px);
  right: clamp(112px, 17vw, 330px);
  width: min(47vw, 800px);
  height: clamp(320px, 43vh, 500px);
}

.spatial-sticker {
  top: clamp(235px, 29vh, 330px);
  right: clamp(62px, 9vw, 170px);
}

.spatial-signal-card {
  top: clamp(260px, 32vh, 360px);
  left: clamp(54px, 5vw, 100px);
}

.spatial-trace-note {
  top: clamp(430px, 54vh, 580px);
  left: clamp(140px, 16vw, 310px);
}

.spatial-drawer {
  right: var(--spatial-gutter);
  bottom: clamp(138px, 17vh, 180px);
  width: min(23vw, 420px);
}

.spatial-dynamics {
  top: clamp(438px, 55vh, 580px);
  left: var(--spatial-gutter);
  width: min(50vw, 780px);
}

.spatial-timeline {
  right: var(--spatial-gutter);
  bottom: clamp(18px, 2.8vh, 30px);
  left: var(--spatial-gutter);
  min-height: clamp(82px, 9vh, 112px);
  box-sizing: border-box;
}

.spatial-bottom {
  box-sizing: border-box;
  min-height: clamp(108px, 12vh, 138px);
  padding: clamp(16px, 2vh, 24px) var(--spatial-gutter) clamp(18px, 2.6vh, 30px);
}

.spatial-device-strip {
  max-width: 52vw;
  overflow-x: auto;
  padding-bottom: 5px;
  scrollbar-width: none;
  touch-action: pan-x;
  scroll-snap-type: x proximity;
}

.spatial-device-strip::-webkit-scrollbar {
  display: none;
}

.spatial-live-card {
  position: relative;
}

.spatial-telemetry-band {
  position: absolute;
  z-index: 6;
  right: var(--spatial-gutter);
  bottom: clamp(150px, 12vh, 200px);
  left: var(--spatial-gutter);
  display: grid;
  grid-template-columns: minmax(170px, .8fr) minmax(180px, 1.2fr) minmax(320px, 1.45fr);
  align-items: center;
  gap: clamp(18px, 2.2vw, 42px);
  min-height: 78px;
  box-sizing: border-box;
  padding: 13px clamp(14px, 1.4vw, 24px);
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 14px 4px 14px 4px;
  background: rgba(246,250,245,.56);
  box-shadow: 0 18px 36px rgba(30,63,63,.09);
  backdrop-filter: blur(18px);
}

.spatial-telemetry-head small,
.spatial-telemetry-head strong,
.spatial-telemetry-head span {
  display: block;
}

.spatial-telemetry-head small {
  color: var(--spatial-hot);
  font: 700 8px ui-monospace, monospace;
  letter-spacing: .14em;
}

.spatial-telemetry-head strong {
  margin-top: 5px;
  font-size: 16px;
  letter-spacing: -.06em;
}

.spatial-telemetry-head span {
  margin-top: 3px;
  color: var(--spatial-muted);
  font-size: 9px;
}

.spatial-telemetry-wave {
  display: flex;
  align-items: end;
  gap: clamp(4px, .45vw, 8px);
  height: 42px;
  padding: 0 5px;
  border-bottom: 1px solid rgba(23,43,48,.18);
}

.spatial-telemetry-wave i {
  display: block;
  flex: 1;
  height: var(--signal-height);
  min-width: 4px;
  border-radius: 99px 99px 2px 2px;
  background: linear-gradient(180deg, var(--spatial-hot), #d8ed8e);
  opacity: .74;
  transform-origin: bottom;
}

.spatial-telemetry-readout {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(13px, 1.5vw, 30px);
}

.spatial-telemetry-readout span {
  display: grid;
  gap: 3px;
}

.spatial-telemetry-readout b {
  font-size: 20px;
  letter-spacing: -.08em;
}

.spatial-telemetry-readout small {
  color: var(--spatial-muted);
  font-size: 8px;
  white-space: nowrap;
}

.spatial-telemetry-readout button {
  border: 0;
  padding: 8px 0 8px 12px;
  border-left: 1px solid rgba(23,43,48,.14);
  color: #2f7d70;
  background: transparent;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.spatial-device-strip button {
  flex: 0 0 clamp(72px, 5.2vw, 98px);
  width: clamp(72px, 5.2vw, 98px);
  height: clamp(72px, 5.2vw, 98px);
  scroll-snap-align: center;
}

.spatial-page-stage {
  box-sizing: border-box;
  min-height: 100svh;
  padding: var(--spatial-vert-pad) var(--spatial-gutter) clamp(22px, 3vh, 42px);
  display: flex;
  flex-direction: column;
}

.spatial-page-label {
  margin-top: clamp(40px, 7vh, 78px);
  margin-left: clamp(34px, 8vw, 154px);
}

.spatial-page-heading {
  width: min(100%, 720px);
  margin-left: clamp(34px, 8vw, 154px);
  margin-bottom: clamp(16px, 2vh, 24px);
}

.spatial-page-heading h1 {
  font-size: clamp(40px, 4.5vw, 76px);
}

.spatial-page-canvas {
  width: 100%;
  max-width: none;
  flex: 0 1 auto;
  min-height: 0;
  margin: 0;
  box-sizing: border-box;
  padding: clamp(18px, 1.8vw, 30px);
  border-radius: var(--spatial-radius);
  display: flex;
  align-items: stretch;
  isolation: isolate;
  transform: perspective(1500px) rotateX(calc((var(--my, 0) + var(--tilt-y, 0)) * .012deg)) rotateY(calc((var(--mx, 0) + var(--tilt-x, 0)) * -.012deg));
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s ease;
}

.spatial-page-canvas::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255,255,255,.34), transparent 34%, rgba(216,237,142,.1) 72%, rgba(255,255,255,.4));
  background-size: 220% 100%;
  animation: spatial-paper-shift 12s ease-in-out infinite alternate;
  pointer-events: none;
}

.spatial-page-content {
  flex: 1 1 auto;
  min-width: 0;
}

.spatial-page-content .content {
  min-height: 100%;
}

.spatial-page-pulse {
  display: grid;
  grid-template-columns: minmax(220px, .85fr) repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 9px;
  margin-top: clamp(18px, 2.4vh, 30px);
  padding-top: 14px;
  border-top: 1px solid rgba(23,43,48,.12);
}

.spatial-page-pulse-lead,
.spatial-pulse-card {
  min-height: 88px;
  box-sizing: border-box;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 13px 4px 13px 4px;
  background: rgba(255,255,255,.38);
}

.spatial-page-pulse-lead {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.spatial-page-pulse-lead small,
.spatial-pulse-copy small {
  color: var(--spatial-hot);
  font: 700 8px ui-monospace, monospace;
  letter-spacing: .13em;
}

.spatial-page-pulse-lead strong {
  margin-top: 6px;
  color: var(--spatial-ink);
  font-size: 13px;
  letter-spacing: -.05em;
}

.spatial-page-pulse-lead span {
  margin-top: 5px;
  color: var(--spatial-muted);
  font-size: 9px;
  line-height: 1.4;
}

.spatial-pulse-card {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 8px;
  color: var(--spatial-ink);
  text-align: left;
  cursor: pointer;
  transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s ease, background .28s ease;
}

.spatial-pulse-card:hover,
.spatial-pulse-card:focus-visible {
  transform: translateY(-4px) rotate(-.25deg);
  background: rgba(255,255,255,.78);
  box-shadow: 0 16px 28px rgba(30,63,63,.1);
}

.spatial-pulse-card:active { transform: translateY(-1px) scale(.985); }
.spatial-pulse-card.tone-good { border-color: rgba(105,175,120,.38); }
.spatial-pulse-card.tone-warn { border-color: rgba(239,115,82,.5); }
.spatial-pulse-index { align-self: start; color: var(--spatial-muted); font: 700 9px ui-monospace, monospace; }
.spatial-pulse-copy { min-width: 0; }
.spatial-pulse-copy small, .spatial-pulse-copy strong, .spatial-pulse-copy em { display: block; }
.spatial-pulse-copy strong { margin-top: 5px; font-size: 22px; letter-spacing: -.08em; }
.spatial-pulse-copy em { overflow: hidden; margin-top: 4px; color: var(--spatial-muted); font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.spatial-pulse-arrow { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: #2f7d70; background: rgba(216,237,142,.42); }
.spatial-page-floor { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; padding: 10px 3px 0; color: var(--spatial-muted); font: 700 8px ui-monospace, monospace; letter-spacing: .04em; }
.spatial-page-floor span { display: flex; align-items: center; gap: 7px; }
.spatial-page-floor strong { color: var(--spatial-ink); font: 800 9px ui-monospace, monospace; }
.spatial-page-floor button { border: 0; padding: 0; color: #2f7d70; background: transparent; font-size: 9px; font-weight: 800; cursor: pointer; }

.spatial-page-content .task-row {
  min-height: clamp(58px, 6.2vh, 78px);
}

.spatial-page-content .data-table tbody tr {
  height: clamp(58px, 6.4vh, 82px);
}

.spatial-page-content .panel,
.spatial-page-content .metric,
.spatial-page-content .template-card,
.spatial-page-content .archive-device-card,
.spatial-page-content .binding-card {
  transition: transform .32s cubic-bezier(.2,.8,.2,1), box-shadow .32s ease, background .32s ease;
}

.spatial-page-content .panel:hover,
.spatial-page-content .template-card:hover,
.spatial-page-content .archive-device-card:hover,
.spatial-page-content .binding-card:hover {
  transform: translateY(-5px) rotate(-.2deg);
  box-shadow: 0 24px 44px rgba(30,63,63,.13);
}

.spatial-page-float {
  top: clamp(210px, 23vh, 270px);
  right: clamp(16px, 2vw, 34px);
  animation: spatial-float-drift 5.5s ease-in-out infinite;
}

.spatial-command button {
  position: relative;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.spatial-command button:hover {
  transform: translateY(-2px);
}

.spatial-command button.is-active::after {
  content: "";
  position: absolute;
  right: 20%;
  bottom: -5px;
  left: 20%;
  height: 2px;
  border-radius: 99px;
  background: var(--spatial-hot);
  box-shadow: 0 0 12px rgba(239,115,82,.45);
  animation: spatial-nav-pulse 2.2s ease-in-out infinite;
}

@media (min-width: 821px) {
  .spatial-page-content .toolbar {
    position: sticky;
    top: 12px;
    z-index: 4;
    padding: clamp(8px, 1vh, 13px) clamp(8px, .8vw, 14px);
    border: 1px solid rgba(255,255,255,.62);
    border-radius: 12px 4px 12px 4px;
    background: rgba(248,251,247,.5);
    backdrop-filter: blur(14px);
  }
}

@media (max-width: 1399px) and (min-width: 821px) {
  .spatial-stage,
  .spatial-worker-stage {
    min-height: clamp(650px, calc(100dvh - 104px), 760px);
  }

  .spatial-specimen,
  .spatial-worker-specimen {
    right: 12%;
    width: min(49vw, 650px);
    height: clamp(300px, 43vh, 390px);
  }

  .spatial-drawer {
    width: min(31vw, 360px);
  }

  .spatial-dynamics {
    top: clamp(400px, 60vh, 535px);
    width: min(55vw, 650px);
  }

  .spatial-timeline {
    min-height: 82px;
  }
}

/* Tall desktop composition: turn the extra vertical canvas into a layered
   editorial feed instead of leaving the archive drawer stranded at the foot. */
@media (min-width: 821px) and (min-height: 900px) {
  .spatial-specimen,
  .spatial-worker-specimen {
    top: clamp(150px, 13.8vh, 220px);
    height: clamp(390px, 40vh, 580px);
  }

  .spatial-dynamics {
    top: clamp(520px, 50vh, 720px);
    width: min(50vw, 860px);
  }

  .spatial-drawer {
    top: clamp(520px, 53vh, 760px);
    right: clamp(28px, 4vw, 78px);
    bottom: auto;
    width: min(25vw, 460px);
  }

  .spatial-trace-note {
    top: clamp(500px, 47vh, 680px);
    left: clamp(200px, 22vw, 420px);
  }

  .spatial-timeline {
    bottom: clamp(22px, 2.8vh, 34px);
  }

  .spatial-bottom {
    border-top: 1px solid rgba(255,255,255,.72);
    background: rgba(248,250,246,.86);
  }
}

@media (max-width: 820px) {
  .spatial-stage,
  .spatial-worker-stage {
    min-height: 1040px;
    padding: 17px 15px 20px;
  }

  .spatial-command {
    position: absolute;
    top: 52px;
    right: 0;
    left: 0;
    justify-content: center;
  }

  .spatial-page .spatial-command {
    max-width: none;
    justify-content: flex-start;
  }

  .spatial-title,
  .spatial-worker-title {
    top: 130px;
    left: 11%;
    max-width: 280px;
  }

  .spatial-title h1,
  .spatial-worker-title h1 {
    font-size: 45px;
  }

  .spatial-specimen,
  .spatial-worker-specimen {
    top: 230px;
    right: 7%;
    width: 86%;
    height: 275px;
  }

  .spatial-sticker {
    top: 395px;
    right: 7%;
  }

  .spatial-signal-card {
    top: 395px;
    left: 7%;
  }

  .spatial-trace-note {
    top: 620px;
    left: 12%;
  }

  .spatial-dynamics {
    top: 535px;
    right: 7%;
    left: 7%;
    width: auto;
  }

  .spatial-drawer {
    top: 700px;
    right: 7%;
    bottom: auto;
    width: 86%;
  }

  .spatial-timeline {
    right: 7%;
    bottom: 24px;
    left: 7%;
  }

  .spatial-bottom {
    display: block;
    padding: 22px 15px 28px;
  }

  .spatial-device-strip {
    max-width: none;
    margin-top: 15px;
  }

  .spatial-page-stage {
    min-height: 100svh;
    padding: 17px 15px 35px;
  }

  .spatial-page-canvas {
    min-height: 0;
    flex: 0 0 auto;
    padding: 14px;
  }

  .spatial-page-pulse {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 16px;
  }

  .spatial-page-pulse-lead,
  .spatial-pulse-card {
    min-height: 72px;
  }

  .spatial-page-pulse-lead { padding: 11px; }
  .spatial-page-pulse-lead strong { font-size: 12px; }
  .spatial-pulse-card { grid-template-columns: 22px minmax(0, 1fr) 24px; padding: 11px; }
  .spatial-pulse-copy strong { font-size: 20px; }
  .spatial-pulse-arrow { width: 24px; height: 24px; }
  .spatial-page-floor { align-items: flex-start; flex-wrap: wrap; gap: 8px 14px; padding-top: 8px; }
  .spatial-page-floor button { margin-left: auto; }

  .spatial-page-content .task-row,
  .spatial-page-content .data-table tbody tr {
    height: auto;
    min-height: 58px;
  }

  .spatial-device-strip {
    max-width: none;
  }

  .spatial-telemetry-band {
    display: none;
  }
}

@media (max-width: 480px) {
  .spatial-stage,
  .spatial-worker-stage {
    min-height: 1080px;
  }

  .spatial-title h1,
  .spatial-worker-title h1 {
    font-size: 39px;
  }

  .spatial-specimen {
    top: 218px;
    height: 220px;
  }

  .spatial-worker-specimen {
    top: 216px;
    height: 220px;
  }

  .spatial-sticker {
    top: 351px;
    padding: 9px 11px;
  }

  .spatial-signal-card {
    top: 351px;
  }

  .spatial-trace-note {
    display: none;
  }

  .spatial-dynamics {
    top: 455px;
  }

  .spatial-drawer {
    top: 680px;
    width: 86%;
  }

  .spatial-timeline {
    bottom: 22px;
  }

  .spatial-page-heading h1 {
    font-size: clamp(36px, 12vw, 52px);
  }

  .spatial-page-float {
    top: 220px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .spatial-telemetry-wave i {
    animation: spatial-telemetry-breathe 2.4s ease-in-out infinite alternate;
  }

  .spatial-telemetry-wave i:nth-child(2n) { animation-delay: 180ms; }
  .spatial-telemetry-wave i:nth-child(3n) { animation-delay: 340ms; }

  @keyframes spatial-telemetry-breathe {
    from { opacity: .42; transform: scaleY(.72); }
    to { opacity: .92; transform: scaleY(1); }
  }
}

@media (prefers-reduced-motion: no-preference) {
  .spatial-page-content .panel,
  .spatial-page-content .metric,
  .spatial-page-content .task-row,
  .spatial-page-content .data-table tbody tr {
    animation: spatial-row-in .5s cubic-bezier(.2,.8,.2,1) both;
  }

  .spatial-page-content .task-row:nth-child(2),
  .spatial-page-content .data-table tbody tr:nth-child(2) { animation-delay: 60ms; }
  .spatial-page-content .task-row:nth-child(3),
  .spatial-page-content .data-table tbody tr:nth-child(3) { animation-delay: 120ms; }
  .spatial-page-content .task-row:nth-child(4),
  .spatial-page-content .data-table tbody tr:nth-child(4) { animation-delay: 180ms; }

  @keyframes spatial-row-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes spatial-paper-shift {
    from { background-position: 0 0; }
    to { background-position: 100% 0; }
  }

  @keyframes spatial-float-drift {
    0%, 100% { transform: rotate(4deg) translateY(0); }
    50% { transform: rotate(2deg) translateY(-6px); }
  }

  @keyframes spatial-nav-pulse {
    0%, 100% { opacity: .55; transform: scaleX(.82); }
    50% { opacity: 1; transform: scaleX(1); }
  }

  .spatial-live-card::after {
    content: "";
    position: absolute;
    right: 8px;
    bottom: 5px;
    left: 8px;
    height: 1px;
    background: linear-gradient(90deg, var(--spatial-hot), transparent 74%);
    transform-origin: left;
    animation: spatial-signal-scan 2.8s ease-in-out infinite;
  }

  @keyframes spatial-signal-scan {
    0%, 100% { opacity: .26; transform: scaleX(.35); }
    50% { opacity: .78; transform: scaleX(1); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .spatial-page-canvas,
  .spatial-page-float,
  .spatial-page-canvas::before,
  .spatial-command button.is-active::after {
    animation: none;
    transition: none;
  }
}

/* Phone spatial layer: sensor values are deliberately capped to a small
   movement so the archive stays readable while the image gains depth. */
.spatial-stage,
.spatial-worker-stage,
.spatial-page-stage {
  --tilt-x: 0;
  --tilt-y: 0;
}

@media (max-width: 820px) and (prefers-reduced-motion: no-preference) {
  .spatial-specimen,
  .spatial-worker-specimen {
    transform: translate(calc(var(--mx, 0) * 1px + var(--tilt-x, 0) * 1px), calc(var(--my, 0) * 1px + var(--tilt-y, 0) * 1px)) rotate(calc(2.5deg + var(--tilt-x, 0) * .12deg));
    transition: transform .7s cubic-bezier(.2,.8,.2,1), box-shadow .7s ease;
  }

  .spatial-drawer,
  .spatial-worker-drawer {
    transform: translate(calc(var(--tilt-x, 0) * .65px), calc(var(--tilt-y, 0) * .65px));
    transition: transform .8s cubic-bezier(.2,.8,.2,1), box-shadow .5s ease;
  }

  .spatial-dynamics,
  .spatial-worker-timeline {
    transform: translate(calc(var(--tilt-x, 0) * .45px), calc(var(--tilt-y, 0) * .45px));
    transition: transform .9s cubic-bezier(.2,.8,.2,1), box-shadow .5s ease;
  }

  .spatial-sticker {
    transform: translate(calc(var(--tilt-x, 0) * .8px), calc(var(--tilt-y, 0) * .8px)) rotate(calc(-8deg + var(--tilt-x, 0) * .1deg));
    transition: transform .75s cubic-bezier(.2,.8,.2,1);
  }

  .spatial-signal-card,
  .spatial-trace-note {
    transform: translate(calc(var(--tilt-x, 0) * .5px), calc(var(--tilt-y, 0) * .5px)) rotate(-5deg);
    transition: transform .8s cubic-bezier(.2,.8,.2,1);
  }
}

/* Latest trace is a compact event in the visual route, not a full-width note. */
.spatial-trace-note { display: none; }
.spatial-trace-card {
  position: absolute;
  z-index: 7;
  top: clamp(430px, 43vh, 560px);
  left: clamp(250px, 24vw, 450px);
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 10px;
  width: min(280px, 22vw);
  min-height: 76px;
  box-sizing: border-box;
  padding: 12px 13px;
  border: 1px solid rgba(255,255,255,.84);
  border-left: 3px solid var(--spatial-hot);
  border-radius: 16px 5px 16px 5px;
  color: var(--spatial-ink);
  background: rgba(250,252,247,.74);
  box-shadow: 0 18px 34px rgba(30,63,63,.13);
  backdrop-filter: blur(18px);
  text-align: left;
  cursor: pointer;
  transform: rotate(-1.5deg);
  transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s ease, background .28s ease;
}

.spatial-trace-card::after {
  content: "";
  position: absolute;
  bottom: -18px;
  left: 24px;
  width: 1px;
  height: 18px;
  background: linear-gradient(var(--spatial-hot), transparent);
  opacity: .65;
}

.spatial-trace-card:hover,
.spatial-trace-card:focus-visible {
  background: rgba(255,255,255,.92);
  box-shadow: 0 24px 42px rgba(30,63,63,.18);
  transform: translateY(-4px) rotate(0deg);
}

.spatial-trace-card:active { transform: translateY(-1px) scale(.985); }
.spatial-trace-card.tone-danger { border-left-color: var(--spatial-hot); }
.spatial-trace-card.tone-neutral { border-left-color: #a8d5df; }
.trace-card-mark { display: grid; justify-items: center; gap: 6px; align-self: stretch; padding-top: 2px; border-right: 1px solid rgba(23,43,48,.1); }
.trace-card-mark i { width: 9px; height: 9px; border: 3px solid rgba(239,115,82,.18); border-radius: 50%; background: var(--spatial-hot); box-shadow: 0 0 0 1px var(--spatial-hot); }
.tone-good .trace-card-mark i { background: #69af78; border-color: rgba(105,175,120,.2); box-shadow: 0 0 0 1px #69af78; }
.trace-card-mark b { color: var(--spatial-muted); font: 700 8px ui-monospace, monospace; }
.trace-card-copy { min-width: 0; }
.trace-card-copy small, .trace-card-copy strong, .trace-card-copy em { display: block; }
.trace-card-copy small { overflow: hidden; color: var(--spatial-hot); font: 700 8px ui-monospace, monospace; letter-spacing: .1em; text-overflow: ellipsis; white-space: nowrap; }
.trace-card-copy strong { margin-top: 6px; font-size: 17px; letter-spacing: -.07em; }
.trace-card-copy em { margin-top: 4px; color: var(--spatial-muted); font-size: 9px; font-style: normal; }
.trace-card-arrow { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; color: #2f7d70; background: rgba(216,237,142,.54); }

@media (max-width: 820px) {
  .spatial-trace-card { top: 610px; left: 10%; width: 44%; min-height: 68px; }
}

@media (max-width: 480px) {
  .spatial-trace-card { display: none; }
}

@media (max-width: 820px) and (prefers-reduced-motion: no-preference) {
  .spatial-trace-card {
    transform: translate(calc(var(--tilt-x, 0) * .45px), calc(var(--tilt-y, 0) * .45px)) rotate(calc(-1.5deg + var(--tilt-x, 0) * .08deg));
    animation: spatial-float-in .65s .2s ease both;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .spatial-trace-card { animation: spatial-float-in .65s .2s ease both; }
}

@media (prefers-reduced-motion: reduce) {
  .spatial-trace-card { transition: none; transform: none; animation: none; }
}

/* Archive refresh: content-first scan surface with a restrained glass control layer. */
.spatial-mobile-shell {
  --archive-ink: #102d32;
  --archive-muted: #6c8183;
  --archive-paper: rgba(250, 252, 247, .82);
  --archive-line: rgba(16, 45, 50, .12);
  color: var(--archive-ink);
}

.spatial-mobile-archive {
  min-height: 100dvh;
  height: auto;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: clamp(18px, 2.4vw, 30px);
  overflow: hidden;
  padding: clamp(20px, 3vw, 44px) var(--spatial-gutter) calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 8% 8%, rgba(255,255,255,.9), transparent 23%),
    radial-gradient(circle at 90% 26%, rgba(187,225,216,.48), transparent 25%),
    linear-gradient(132deg, #dce9e3 0%, #f4f4ed 54%, #dce7ea 100%);
}

.spatial-mobile-archive::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .38;
  background: repeating-linear-gradient(116deg, transparent 0 96px, rgba(255,255,255,.24) 97px 98px);
}

.mobile-archive-top,
.mobile-archive-kicker,
.mobile-archive-hero,
.mobile-surface-dock,
.mobile-archive-body,
.mobile-archive-actionbar {
  position: relative;
  z-index: 1;
}

.mobile-archive-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.mobile-archive-top-actions { display: flex; align-items: center; gap: 9px; color: var(--archive-muted); font: 700 10px ui-monospace, monospace; letter-spacing: .08em; }
.mobile-archive-top-actions .spatial-round { margin-left: 6px; }
.mobile-archive-kicker { color: var(--spatial-hot); font: 700 10px ui-monospace, monospace; letter-spacing: .16em; }

.mobile-archive-hero { display: grid; grid-template-columns: minmax(230px, .74fr) minmax(360px, 1.26fr); align-items: center; gap: clamp(24px, 5vw, 90px); min-height: clamp(340px, 49vh, 520px); }
.mobile-archive-hero-copy { align-self: center; max-width: 440px; }
.mobile-archive-hero-copy p { margin: 0 0 12px; color: var(--spatial-hot); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.mobile-archive-hero-copy h1 { margin: 0; max-width: 8ch; font-size: clamp(42px, 6.2vw, 92px); line-height: .9; letter-spacing: -.08em; }
.mobile-archive-hero-copy span { display: block; margin-top: 18px; color: var(--archive-muted); font-size: 13px; line-height: 1.55; }
.mobile-archive-photo { position: relative; min-height: clamp(290px, 40vh, 430px); overflow: hidden; border: 1px solid rgba(255,255,255,.9); border-radius: 30px 8px 30px 8px; background: #1e5154; box-shadow: 0 30px 66px rgba(20,61,62,.2); transform: rotate(1.2deg); transition: transform .55s cubic-bezier(.2,.8,.2,1), box-shadow .55s ease; }
.mobile-archive-photo:hover { transform: translateY(-5px) rotate(0deg); box-shadow: 0 38px 76px rgba(20,61,62,.27); }
.mobile-archive-photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.82) contrast(1.06); }
.mobile-archive-photo-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,39,42,.04) 25%, rgba(10,39,42,.74) 100%); }
.mobile-archive-photo small { position: absolute; top: 17px; left: 18px; color: rgba(255,255,255,.78); font: 700 9px ui-monospace, monospace; letter-spacing: .12em; }
.mobile-archive-photo b { position: absolute; right: 19px; bottom: 18px; color: #fff; font-size: clamp(28px, 4vw, 54px); letter-spacing: -.08em; }
.mobile-archive-photo b i { color: var(--spatial-acid); font-size: 12px; font-style: normal; letter-spacing: 0; }
.mobile-archive-health { display: flex; align-items: center; gap: 10px; max-width: 340px; margin-top: -26px; margin-left: 10%; padding: 11px 13px; border: 1px solid rgba(255,255,255,.82); border-radius: 12px 4px 12px 4px; background: rgba(250,252,247,.72); box-shadow: 0 18px 32px rgba(30,63,63,.1); backdrop-filter: blur(18px); }
.mobile-archive-health span { color: var(--archive-muted); font-size: 10px; line-height: 1.35; }

.mobile-surface-dock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; max-width: 760px; padding: 7px; border: 1px solid rgba(255,255,255,.8); border-radius: 18px 5px 18px 5px; background: rgba(248,251,247,.54); box-shadow: 0 16px 34px rgba(30,63,63,.08); backdrop-filter: blur(20px); }
.mobile-surface-tab { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 12px; border: 1px solid transparent; border-radius: 12px 4px 12px 4px; color: var(--archive-muted); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; touch-action: manipulation; transition: color .2s ease, background .2s ease, transform .2s ease, border-color .2s ease; }
.mobile-surface-tab:hover, .mobile-surface-tab:focus-visible { color: var(--archive-ink); background: rgba(255,255,255,.55); border-color: rgba(255,255,255,.7); }
.mobile-surface-tab:active { transform: scale(.97); }
.mobile-surface-tab.is-active { color: var(--archive-ink); background: rgba(255,255,255,.84); border-color: rgba(255,255,255,.9); box-shadow: 0 7px 16px rgba(30,63,63,.08); }

.mobile-archive-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.mobile-archive-sheet { min-width: 0; padding: clamp(16px, 2vw, 24px); border: 1px solid rgba(255,255,255,.84); border-radius: 20px 6px 20px 6px; background: var(--archive-paper); box-shadow: 0 18px 40px rgba(30,63,63,.08); backdrop-filter: blur(16px); }
.mobile-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mobile-sheet-head small { color: var(--spatial-hot); font: 700 9px ui-monospace, monospace; letter-spacing: .14em; }
.mobile-sheet-head h2 { margin: 7px 0 0; font-size: clamp(20px, 2.2vw, 30px); letter-spacing: -.07em; }
.mobile-fact-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 22px; padding: 11px 0; border-top: 1px solid var(--archive-line); border-bottom: 1px solid var(--archive-line); }
.mobile-fact-row span, .mobile-fact-row b { display: block; color: var(--archive-muted); font-size: 10px; line-height: 1.4; }
.mobile-fact-row b { margin-top: 3px; color: var(--archive-ink); font-size: 12px; }
.mobile-material-list, .mobile-trace-list { display: grid; gap: 7px; margin-top: 13px; }
.mobile-material-row, .mobile-trace-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 24px; align-items: center; gap: 9px; min-height: 54px; padding: 8px; border: 1px solid rgba(16,45,50,.08); border-radius: 12px 4px 12px 4px; color: var(--archive-ink); background: rgba(255,255,255,.5); text-align: left; cursor: pointer; transition: background .2s ease, transform .2s ease, border-color .2s ease; }
.mobile-material-row:hover, .mobile-trace-row:hover, .mobile-material-row:focus-visible, .mobile-trace-row:focus-visible { border-color: rgba(82,139,126,.35); background: rgba(255,255,255,.86); transform: translateY(-2px); }
.mobile-material-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px 3px 9px 3px; color: #27786c; background: rgba(216,237,142,.46); }
.mobile-material-row strong, .mobile-material-row small, .mobile-trace-row strong, .mobile-trace-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-material-row strong, .mobile-trace-row strong { font-size: 11px; }
.mobile-material-row small, .mobile-trace-row small { margin-top: 4px; color: var(--archive-muted); font-size: 9px; }
.mobile-trace-row { grid-template-columns: 9px minmax(0, 1fr) auto; }
.mobile-trace-row > i { width: 8px; height: 8px; border-radius: 50%; background: #6fb27d; box-shadow: 0 0 0 3px rgba(111,178,125,.16); }
.mobile-trace-row > i.is-bad { background: var(--spatial-hot); box-shadow: 0 0 0 3px rgba(239,115,82,.14); }
.mobile-missing-note { display: flex; align-items: center; gap: 7px; margin-top: 12px; padding: 9px 10px; border-radius: 9px 3px 9px 3px; color: #b8543b; background: rgba(239,115,82,.1); font-size: 10px; }
.mobile-next-task { display: grid; grid-template-columns: 30px minmax(0, 1fr) 22px; align-items: center; gap: 9px; width: 100%; margin-top: 13px; padding: 10px; border: 1px solid rgba(216,237,142,.72); border-radius: 12px 4px 12px 4px; color: var(--archive-ink); background: rgba(216,237,142,.35); text-align: left; cursor: pointer; }
.mobile-next-task > span:first-child { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: rgba(255,255,255,.65); }
.mobile-next-task small, .mobile-next-task strong { display: block; }
.mobile-next-task small { color: #55705d; font-size: 9px; }
.mobile-next-task strong { margin-top: 3px; font-size: 11px; }

.mobile-archive-actionbar { display: flex; gap: 9px; align-items: center; }
.mobile-primary-action { display: flex; align-items: center; gap: 10px; min-height: 54px; flex: 1; padding: 0 15px; border: 1px solid rgba(241,255,239,.55); border-radius: 14px 5px 14px 5px; color: #172726; background: var(--spatial-acid); box-shadow: 0 16px 30px rgba(17,50,43,.16); font-weight: 900; text-align: left; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; touch-action: manipulation; }
.mobile-primary-action:hover, .mobile-primary-action:focus-visible { box-shadow: 0 21px 36px rgba(17,50,43,.22); transform: translateY(-2px); }
.mobile-primary-action:active { transform: scale(.985); }
.mobile-primary-action > span { flex: 1; font-size: 12px; }
.mobile-primary-action small { display: block; margin-top: 3px; color: rgba(23,39,38,.6); font-size: 9px; }

.spatial-mobile-shell .panel { border: 1px solid rgba(255,255,255,.84); border-radius: 20px 6px 20px 6px; background: rgba(250,252,247,.82); box-shadow: 0 18px 40px rgba(30,63,63,.08); backdrop-filter: blur(16px); }

@media (max-width: 820px) {
  .spatial-mobile-archive { gap: 14px; padding: max(14px, env(safe-area-inset-top)) 14px calc(86px + env(safe-area-inset-bottom)); }
  .mobile-archive-top-actions small { display: none; }
  .mobile-archive-kicker { font-size: 9px; }
  .mobile-archive-hero { display: grid; grid-template-columns: 1fr; gap: 12px; min-height: 0; }
  .mobile-archive-hero-copy { order: 1; }
  .mobile-archive-hero-copy p { margin-bottom: 8px; font-size: 10px; }
  .mobile-archive-hero-copy h1 { max-width: 10ch; font-size: clamp(38px, 13vw, 60px); }
  .mobile-archive-hero-copy span { margin-top: 10px; font-size: 11px; }
  .mobile-archive-photo { order: 2; min-height: 245px; border-radius: 24px 6px 24px 6px; }
  .mobile-archive-photo b { font-size: 34px; }
  .mobile-archive-health { order: 3; margin: -25px 10px 0; max-width: none; }
  .mobile-surface-dock { grid-template-columns: repeat(4, minmax(76px, 1fr)); max-width: none; overflow-x: auto; scroll-snap-type: x proximity; }
  .mobile-surface-tab { min-height: 46px; scroll-snap-align: start; }
  .mobile-surface-tab span { font-size: 10px; }
  .mobile-archive-body { grid-template-columns: 1fr; gap: 10px; }
  .mobile-archive-sheet { padding: 15px; border-radius: 16px 5px 16px 5px; }
  .mobile-sheet-head h2 { font-size: 21px; }
  .mobile-fact-row { margin-top: 16px; }
  .mobile-archive-actionbar { position: sticky; bottom: 0; z-index: 5; margin: 0 -1px; padding: 9px; border: 1px solid rgba(255,255,255,.84); border-radius: 17px 5px 17px 5px; background: rgba(248,251,247,.72); box-shadow: 0 -12px 26px rgba(30,63,63,.1); backdrop-filter: blur(20px); }
  .mobile-primary-action { min-height: 52px; }
}

@media (max-width: 420px) {
  .mobile-archive-photo { min-height: 216px; }
  .mobile-fact-row { gap: 5px; }
  .mobile-fact-row span, .mobile-fact-row b { font-size: 9px; }
  .mobile-material-row, .mobile-trace-row { min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-archive-photo, .mobile-surface-tab, .mobile-material-row, .mobile-trace-row, .mobile-primary-action { transition: none; transform: none; }
}

.scan-reminder-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(17, 43, 43, .32); backdrop-filter: blur(15px) saturate(1.08); animation: scan-reminder-fade .22s ease both; }
.scan-reminder { position: relative; width: min(470px, 100%); overflow: hidden; padding: 19px; border: 1px solid rgba(255,255,255,.86); border-radius: 26px 8px 26px 8px; color: var(--spatial-ink); background: rgba(248, 252, 247, .82); box-shadow: 0 30px 90px rgba(19, 54, 54, .26), 0 2px 0 rgba(255,255,255,.72) inset; backdrop-filter: blur(26px) saturate(1.12); animation: scan-reminder-rise .5s cubic-bezier(.2,.8,.2,1) both; }
.scan-reminder::after { content: ""; position: absolute; top: 0; right: 0; width: 42%; height: 1px; background: rgba(255,255,255,.92); transform: rotate(-18deg) translate(5px, 18px); transform-origin: right center; }
.scan-reminder-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; color: var(--spatial-muted); }
.scan-reminder-head small { flex: 1; font: 700 9px ui-monospace, monospace; letter-spacing: .16em; }
.scan-reminder-head .spatial-round { width: 31px; height: 31px; }
.scan-reminder-icon { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(239,115,82,.35); border-radius: 11px 3px 11px 3px; color: var(--spatial-hot); background: rgba(239,115,82,.11); }
.scan-reminder-intro { position: relative; z-index: 1; margin: 22px 0 16px; }
.scan-reminder-eyebrow { color: var(--spatial-hot); font: 800 9px ui-monospace, monospace; letter-spacing: .16em; }
.scan-reminder-intro h2 { max-width: 13ch; margin: 7px 0 8px; font-size: clamp(25px, 5vw, 38px); line-height: .98; letter-spacing: -.06em; }
.scan-reminder-intro p { max-width: 36em; margin: 0; color: var(--spatial-muted); font-size: 11px; line-height: 1.55; }
.scan-reminder-list { position: relative; z-index: 1; display: grid; gap: 7px; max-height: 230px; overflow: auto; padding: 4px; margin: 0 -4px; }
.scan-reminder-task { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 58px; padding: 8px 10px 8px 8px; border: 1px solid rgba(23,43,48,.1); border-radius: 14px 4px 14px 4px; background: rgba(255,255,255,.62); }
.scan-reminder-task.is-overdue { border-color: rgba(239,115,82,.28); background: rgba(255,244,239,.7); }
.scan-reminder-task-mark { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px 3px 10px 3px; color: var(--spatial-muted); background: rgba(216,237,142,.42); }
.scan-reminder-task.is-overdue .scan-reminder-task-mark { color: var(--spatial-hot); background: rgba(239,115,82,.12); }
.scan-reminder-task strong, .scan-reminder-task small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-reminder-task strong { font-size: 11px; }
.scan-reminder-task small { margin-top: 4px; color: var(--spatial-muted); font-size: 9px; }
.scan-reminder-task .status { flex-shrink: 0; }
.scan-reminder-foot { position: relative; z-index: 1; display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(23,43,48,.1); }
.scan-reminder-foot .btn { min-height: 42px; }
.scan-reminder-foot .btn-primary { box-shadow: 0 13px 26px rgba(17,50,43,.18); }

@keyframes scan-reminder-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes scan-reminder-rise { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 640px) {
  .scan-reminder-backdrop { align-items: end; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
  .scan-reminder { width: 100%; padding: 17px 16px 15px; border-radius: 27px 7px 18px 7px; }
  .scan-reminder-intro { margin-top: 18px; }
  .scan-reminder-intro h2 { max-width: 11ch; font-size: 31px; }
  .scan-reminder-list { max-height: 34vh; }
  .scan-reminder-foot { display: grid; grid-template-columns: 1fr 1.18fr; }
  .scan-reminder-foot .btn { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .scan-reminder-backdrop, .scan-reminder { animation: none; }
}

/* Final overview polish: keep the title in its own reading lane and use the
   unused middle of the stage as a quiet, animated engineering field. */
.spatial-stage {
  isolation: isolate;
  background:
    radial-gradient(circle at 78% 12%, rgba(255,255,255,.9), transparent 22%),
    linear-gradient(132deg, #dceae2 0%, #f4f5ef 51%, #dce9ec 100%);
}

.spatial-field {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  color: rgba(31, 104, 99, .48);
}

.field-grid,
.field-scan,
.field-track,
.field-node,
.field-label {
  position: absolute;
  display: block;
}

.field-grid {
  inset: -18%;
  opacity: .42;
  background-image:
    linear-gradient(rgba(47,125,112,.085) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47,125,112,.085) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(560px) rotateX(54deg) rotateZ(-8deg) translate3d(0, 0, 0);
  transform-origin: center bottom;
  mask-image: linear-gradient(180deg, transparent 5%, #000 32%, #000 78%, transparent 100%);
  animation: spatial-field-grid-drift 20s linear infinite;
}

.field-scan {
  top: 24%;
  left: -8%;
  width: 116%;
  height: 1px;
  opacity: .62;
  background: linear-gradient(90deg, transparent, rgba(239,115,82,.6) 35%, rgba(216,237,142,.8) 55%, transparent 82%);
  box-shadow: 0 0 18px rgba(239,115,82,.23);
  animation: spatial-field-scan 8s ease-in-out infinite;
}

.field-track {
  height: 1px;
  border-top: 1px dashed rgba(47,125,112,.3);
  transform-origin: left center;
  opacity: .72;
}

.field-track::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 10%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--spatial-hot);
  box-shadow: 0 0 0 4px rgba(239,115,82,.1), 0 0 13px rgba(239,115,82,.44);
  animation: spatial-field-dash 5.5s linear infinite;
}

.field-track-a { top: 58%; left: 4%; width: 40%; transform: rotate(-10deg); }
.field-track-b { top: 45%; left: 43%; width: 33%; transform: rotate(17deg); border-color: rgba(239,115,82,.28); }
.field-track-c { top: 72%; left: 56%; width: 34%; transform: rotate(-7deg); }
.field-track-b::after { animation-delay: -2.2s; background: #69af78; }
.field-track-c::after { animation-delay: -3.6s; }

.field-node {
  width: 8px;
  height: 8px;
  border: 1px solid rgba(47,125,112,.62);
  border-radius: 50%;
  background: rgba(246,250,245,.78);
  box-shadow: 0 0 0 5px rgba(47,125,112,.08);
  animation: spatial-field-pulse 4.6s ease-in-out infinite;
}

.field-node-a { top: 54%; left: 41%; }
.field-node-b { top: 69%; left: 78%; animation-delay: -1.5s; border-color: rgba(239,115,82,.66); }
.field-node-c { top: 31%; left: 86%; animation-delay: -3s; }

.field-label {
  color: rgba(23,83,80,.4);
  font: 700 8px ui-monospace, monospace;
  letter-spacing: .16em;
}

.field-label-a { top: 51%; left: 45%; }
.field-label-b { top: 74%; left: 80%; color: rgba(239,115,82,.48); }
.field-label-c { top: 34%; right: 7%; writing-mode: vertical-rl; }

@keyframes spatial-field-grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 64px 64px, 64px 64px; }
}

@keyframes spatial-field-scan {
  0%, 100% { opacity: .18; transform: translateY(-34px); }
  50% { opacity: .7; transform: translateY(230px); }
}

@keyframes spatial-field-dash {
  from { transform: translateX(0); opacity: .25; }
  12%, 76% { opacity: 1; }
  to { transform: translateX(260px); opacity: .1; }
}

@keyframes spatial-field-pulse {
  0%, 100% { transform: scale(.82); opacity: .42; }
  50% { transform: scale(1.18); opacity: .92; }
}

@media (min-width: 821px) {
  .spatial-title {
    z-index: 8;
    top: clamp(128px, 14.5vh, 168px);
    left: clamp(68px, 7.4vw, 130px);
    width: min(39vw, 560px);
    max-width: none;
  }

  .spatial-title h1 {
    max-width: 8ch;
    font-size: clamp(52px, 5.1vw, 86px);
    line-height: 1.02;
    letter-spacing: 0;
    text-wrap: balance;
  }

  .spatial-title h1 em {
    display: block;
    margin-top: .02em;
    white-space: nowrap;
  }

  .spatial-title p {
    max-width: 340px;
    margin-top: 20px;
    line-height: 1.7;
  }

  .spatial-specimen {
    z-index: 3;
    top: clamp(128px, 14.5vh, 190px);
    right: clamp(100px, 13vw, 270px);
    width: min(46vw, 760px);
    height: clamp(320px, 42vh, 470px);
  }

  .spatial-sticker {
    top: clamp(238px, 29vh, 330px);
    right: clamp(58px, 7.4vw, 150px);
  }

  .spatial-signal-card {
    top: clamp(390px, 44vh, 470px);
    left: clamp(68px, 6vw, 112px);
    transform: rotate(-3deg);
  }

  .spatial-trace-card {
    top: clamp(410px, 45vh, 500px);
    left: clamp(220px, 23vw, 430px);
  }

  .spatial-dynamics {
    top: clamp(505px, 57vh, 610px);
  }
}

@media (max-width: 820px) {
  .spatial-field { opacity: .6; }
  .field-grid { background-size: 46px 46px; }
  .field-track-a { top: 53%; left: -8%; width: 72%; }
  .field-track-b { top: 42%; left: 42%; width: 58%; }
  .field-track-c, .field-label-c { display: none; }
  .field-label-a { top: 49%; left: 13%; }
  .field-label-b { top: 68%; left: 67%; }
  .spatial-title h1,
  .spatial-worker-title h1 {
    line-height: 1.02;
    letter-spacing: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .field-grid,
  .field-scan,
  .field-track::after,
  .field-node {
    animation: none;
  }
}

@media (max-width: 820px) {
  .spatial-title {
    top: 130px;
    left: 11%;
    max-width: calc(100% - 22%);
  }

  .spatial-title h1 {
    max-width: none;
    font-size: clamp(39px, 11.5vw, 50px);
  }

  .spatial-title h1 em { white-space: nowrap; }
  .spatial-title p { max-width: 250px; margin-top: 14px; }
  .spatial-specimen { top: 320px; }
  .spatial-signal-card { top: 355px; }
  .spatial-dynamics { top: 560px; }
  .spatial-drawer { top: 740px; bottom: auto; }
}
