/* ───────── marking prototype ───────── */
body.prototype { background: #000; color: #fff; min-height: 100vh; }

.proto-wrap {
  display: grid;
  grid-template-columns: 300px auto minmax(0, 1fr);
  gap: 28px 56px;
  align-items: start;
  padding: 24px 28px 40px;
  max-width: 1720px;
  margin: 0 auto;
}

/* ── guide rail ── */
.guide { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 14px; }
.guide h1 { margin: 4px 0 2px; font-size: 26px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.25; }
.guide .lede { margin: 0 0 6px; font-size: 14px; line-height: 1.6; color: rgba(255,255,255,.6); }
.flow { border-radius: 20px; background: #111; padding: 16px 16px 12px; border: 1px solid #1d1d1c; }
.flow.on { border-color: rgba(255,255,98,.45); }
.flow-head { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; }
.flow-head .num { font-size: 12px; font-weight: 700; color: var(--yellow); font-variant-numeric: tabular-nums; }
.flow-head .ttl { font-size: 15px; font-weight: 700; }
.steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.steps button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 8px; border-radius: 12px;
  text-align: left; font-size: 13px; font-weight: 500; color: rgba(255,255,255,.55);
}
.steps button:hover { background: #1a1a19; color: #fff; }
.steps .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #3a3936; }
.steps .done .dot { background: var(--g7); }
.steps .done { color: rgba(255,255,255,.75); }
.steps .cur { color: #fff; background: #1d1d1b; }
.steps .cur .dot { background: var(--yellow); box-shadow: 0 0 0 4px rgba(255,255,98,.18); }
.hint {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px 16px; border-radius: 16px; background: var(--yellow); color: #000;
  font-size: 14px; font-weight: 600; line-height: 1.5;
}
.hint .ic { flex: none; margin-top: 1px; }
.guide-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px;
  background: #161615; color: rgba(255,255,255,.8); font-size: 13px; font-weight: 600;
}
.tool-btn:hover { background: #222220; color: #fff; }
.tool-btn[aria-pressed="true"] { background: #fff; color: #000; }
.sync-box { display: none; padding: 14px 16px; border-radius: 16px; background: #111; font-size: 12.5px; line-height: 1.6; color: rgba(255,255,255,.7); }
.sync-box.open { display: block; }
.sync-box b { color: #fff; }
.sync-box a { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: #1b1b1a; color: var(--yellow); text-decoration: none; word-break: break-all; font-size: 12px; }
.sync-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255,255,255,.55); }
.sync-state i { width: 7px; height: 7px; border-radius: 50%; background: #444; }
.sync-state.live i { background: #4ade80; }

/* ── role switch ── */
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; border-radius: 20px; background: #111; border: 1px solid #1d1d1c; }
.role-switch button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 15px; text-align: left; color: rgba(255,255,255,.6); }
.role-switch button b { font-size: 15px; font-weight: 700; color: inherit; }
.role-switch button span { font-size: 11.5px; font-weight: 500; opacity: .75; }
.role-switch button:hover { color: #fff; }
.role-switch button[aria-pressed="true"] { background: var(--yellow); color: #000; }

/* which side is automated */
.auto-tag { display: none; height: 22px; padding: 0 9px; border-radius: 11px; background: #1d1d1b; color: rgba(255,255,255,.6); font-size: 11px; font-weight: 600; align-items: center; }
body:not(.role-worker) .mr-col .auto-tag, body.role-worker .phone-col .auto-tag { display: inline-flex; }
body.embed .auto-tag { display: none !important; }

/* worker role: big helmet first, small phone as a side monitor */
body.role-worker:not(.embed) .proto-wrap { grid-template-columns: 300px minmax(0, 1fr) auto; }
body.role-worker:not(.embed) .mr-col { order: 2; }
body.role-worker:not(.embed) .phone-col { order: 3; }
body.role-worker:not(.embed) .guide { order: 1; }

/* worker: hold-to-walk button on the helmet */
.walk-btn { position: absolute; right: 32px; bottom: 30px; display: inline-flex; align-items: center; gap: 12px; height: 64px; padding: 0 24px 0 14px; border-radius: 32px; background: var(--yellow); color: #000; font-size: 17px; font-weight: 700; text-align: left; touch-action: none; user-select: none; -webkit-user-select: none; }
.walk-btn .arr { width: 40px; height: 40px; border-radius: 50%; background: #000; color: var(--yellow); display: grid; place-items: center; transform: rotate(-90deg); }
.walk-btn small { display: block; font-size: 10.5px; font-weight: 600; opacity: .6; }
.walk-btn.on { background: #fff; }

/* ── stage columns ── */
.col-label { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.55); }
.col-label b { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 17px; font-weight: 700; letter-spacing: -0.03em; }
.col-label b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }
.phone-col { display: flex; flex-direction: column; align-items: center; }
.mr-col { min-width: 0; }

/* phone frame: design size 402×874, scaled by --ps */
.phone-shell { width: calc(402px * var(--ps, 1) + 20px); height: calc(874px * var(--ps, 1) + 20px); padding: 10px; border-radius: calc(56px * var(--ps, 1) + 10px); background: #1c1c1b; box-shadow: 0 0 0 1px #2a2a28, 0 40px 80px rgba(0,0,0,.6); }
.phone-clip { width: calc(402px * var(--ps, 1)); height: calc(874px * var(--ps, 1)); border-radius: calc(48px * var(--ps, 1)); overflow: hidden; }
.app {
  position: relative; width: 402px; height: 874px; transform: scale(var(--ps, 1)); transform-origin: 0 0;
  background: var(--base); color: #000; overflow: hidden; font-size: 15px;
}

/* MR frame: design size 874×402, scaled by --ms */
.mr-shell { width: 100%; aspect-ratio: 874 / 402; border-radius: 28px; overflow: hidden; background: #2b2a26; box-shadow: 0 0 0 1px #2a2a28, 0 30px 70px rgba(0,0,0,.5); }
.mr-shell { position: relative; }
.mr3d { position: absolute; inset: 0; }
.mr3d canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.mr3d canvas:active { cursor: grabbing; }
.mr-shell .mr { position: absolute; left: 0; top: 0; }
.mr-shell.has-3d .mr .env, .mr-shell.has-3d .mr svg.zones { opacity: 0; transition: opacity .8s; }
.mr-shell.has-3d .mr { pointer-events: none; }
.mr-shell.has-3d .mr button { pointer-events: auto; }
.mr-load { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px; border-radius: 15px; background: rgba(0,0,0,.6); color: rgba(255,255,255,.75); font-size: 12px; font-weight: 600; pointer-events: none; transition: opacity .4s; }
.mr-load i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,98,.25); border-top-color: var(--yellow); animation: spin 1s linear infinite; }
.mr-shell.has-3d .mr-load { opacity: 0; }
.mr-drag { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 3; height: 24px; padding: 0 12px; border-radius: 12px; background: rgba(0,0,0,.5); color: rgba(255,255,255,.7); font-size: 11px; font-weight: 600; display: none; align-items: center; pointer-events: none; }
.mr-shell.has-3d .mr-drag { display: inline-flex; animation: dragHint 6s forwards; }
@keyframes dragHint { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
.mr { position: relative; width: 874px; height: 402px; transform: scale(var(--ms, 1)); transform-origin: 0 0; overflow: hidden; color: #fff; font-size: 15px; }
.mr-notes { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mr-note { padding: 16px; border-radius: 18px; background: #111; font-size: 13px; line-height: 1.55; color: rgba(255,255,255,.62); }
.mr-note b { display: block; margin-bottom: 4px; font-size: 14px; color: #fff; }
.mr-note .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

@media (max-width: 1240px) {
  .proto-wrap { grid-template-columns: auto minmax(0, 1fr); }
  .guide { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
  .guide .intro, .guide .hint, .guide-tools, .sync-box, .role-switch { grid-column: 1 / -1; }
  body.role-worker:not(.embed) .proto-wrap { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (max-width: 860px) {
  .proto-wrap, body.role-worker:not(.embed) .proto-wrap { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 40px; gap: 22px; }
  .guide { grid-template-columns: 1fr; }
  .flow .steps { display: none; }
  .flow.on .steps { display: grid; }
  .mr-notes { grid-template-columns: 1fr; }
  .mr-shell { border-radius: 18px; }
}
/* single-device views (?view=app / ?view=helmet) */
body.view-app .guide, body.view-app .mr-col, body.view-helmet .guide, body.view-helmet .phone-col { display: none; }
body.view-app .proto-wrap, body.view-helmet .proto-wrap { grid-template-columns: minmax(0,1fr); justify-items: center; }
body.view-helmet .mr-col { width: 100%; }
body.view-helmet .mr-notes { display: none; }

/* embedded auto-play loop (project page) — looks like a screen recording */
body.embed { background: transparent; min-height: 0; overflow: hidden; }
body.embed .site-head, body.embed .guide, body.embed .col-label, body.embed .mr-notes, body.embed .mr-drag { display: none !important; }
body.embed .proto-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8%; align-items: center; height: 100vh; padding: 0 1px; max-width: none; }
body.embed.view-app .proto-wrap, body.embed.view-helmet .proto-wrap { display: block; height: auto; }
body.embed .phone-col { display: block; }
body.embed.view-helmet .phone-col, body.embed.view-app .mr-col { display: none; }
body.embed .mr-shell { border-radius: 18px; }
body.embed .phone-shell { width: calc(402px * var(--ps, 1)); height: calc(874px * var(--ps, 1)); padding: 0; background: none; box-shadow: none; border-radius: calc(44px * var(--ps, 1)); overflow: hidden; }
body.embed .phone-clip { border-radius: calc(44px * var(--ps, 1)); position: relative; }
body.embed.view-helmet .mr-shell { border-radius: 0; box-shadow: none; }
body.embed .app, body.embed .mr { pointer-events: none; }
.phone-clip { position: relative; }
/* idle nudge — next button rings after 5s without a tap */
.nudge { animation: nudge 1.3s ease-out infinite !important; }
@keyframes nudge {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 98, .95), 0 0 0 0 rgba(0, 0, 0, .55); }
  70% { box-shadow: 0 0 0 12px rgba(255, 255, 98, 0), 0 0 0 4px rgba(0, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 98, 0), 0 0 0 0 rgba(0, 0, 0, 0); }
}
.tapdot { position: absolute; z-index: 90; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(0,0,0,.18); border: 2px solid rgba(255,255,255,.9); box-shadow: 0 2px 10px rgba(0,0,0,.2); pointer-events: none; animation: tapdot .9s ease-out forwards; }
@keyframes tapdot { 0% { transform: scale(.4); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

/* ═════════ APP (manager) — Figma v4 ═════════ */
.app .sb { position: absolute; inset: 0 0 auto; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px 0 44px; font-size: 17px; font-weight: 600; z-index: 30; }
.app .sb .r { display: flex; gap: 6px; align-items: center; }
.app.dark-sb .sb { color: #fff; }
.scr { position: absolute; inset: 0; padding: 60px 20px 0; overflow: hidden; animation: scrIn .32s cubic-bezier(.2,.8,.2,1); }
@keyframes scrIn { from { opacity: 0; transform: translateX(14px); } }
.home-ind { position: absolute; left: 134px; bottom: 8px; width: 134px; height: 5px; border-radius: 3px; background: #000; z-index: 40; }
.app.dark-hi .home-ind { background: #fff; }

.row { display: flex; align-items: center; justify-content: space-between; }
.ibtn { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; position: relative; flex: none; }
.ibtn.blk { background: #000; color: var(--yellow); }
.ibtn .badge { position: absolute; top: 9px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: #000; border: 2px solid var(--surface); box-sizing: content-box; }
.ibtn .badge.red { background: var(--danger); }
.picker { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px 0 6px; border-radius: 24px; background: var(--surface); font-weight: 600; font-size: 16px; }
.picker.np { padding-left: 16px; }
.av { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--yellow); font-size: 13px; font-weight: 700; color: #000; flex: none; }
.av.blk { background: #000; color: #fff; }
.av.red { background: var(--danger); color: #fff; }
.av.sm { width: 28px; height: 28px; font-size: 10.5px; }
.av.lg { width: 48px; height: 48px; font-size: 15px; }
.h1 { margin: 0; font-size: 30px; font-weight: 600; line-height: 1.3; letter-spacing: -0.04em; }
.h2 { margin: 0; font-size: 26px; font-weight: 600; line-height: 1.3; letter-spacing: -0.04em; }
.sub { margin: 6px 0 0; font-size: 13px; color: var(--g7); }
.cap { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--g7); font-weight: 500; }
.pager { font-size: 13px; color: var(--g7); font-weight: 500; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 56px; border-radius: 28px; font-size: 16px; font-weight: 600; }
.btn.y { background: var(--yellow); color: #000; }
.btn.k { background: #000; color: #fff; }
.btn.g { background: var(--surface); color: var(--g8); }
.btn[disabled] { opacity: .4; cursor: default; }
.bottom-btns { position: absolute; left: 20px; right: 20px; bottom: 32px; display: flex; gap: 8px; }
.bottom-btns .btn { flex: 1; }
.bottom-btns .btn.narrow { flex: 0 0 130px; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 18px; background: #fff; font-size: 13px; font-weight: 600; color: #000; border: 1px solid var(--line); }
.chip.on { background: var(--yellow); border-color: var(--yellow); }
.chip.sm { height: 26px; padding: 0 10px; font-size: 11.5px; border: 0; }
.chip.k { background: #000; color: #fff; border-color: #000; }
.chip.dg { background: var(--danger); color: #fff; border-color: var(--danger); }
.chip.sf { background: var(--surface); border-color: var(--surface); color: var(--g8); }

/* tab bar */
.tabbar { position: absolute; left: 20px; right: 20px; bottom: 26px; height: 68px; border-radius: 34px; background: var(--surface); display: flex; align-items: center; justify-content: space-between; padding: 0 8px; z-index: 20; }
.tab { height: 52px; min-width: 64px; border-radius: 26px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--g8); font-size: 14px; font-weight: 600; padding: 0 18px; }
.tab.on { background: #000; color: #fff; }
.tab.on .ic { color: var(--yellow); }
.tab .lbl { display: none; }
.tab.on .lbl { display: inline; }

/* home */
.greet { margin-top: 30px; }
.hero { position: relative; margin-top: 36px; height: 200px; border-radius: 28px; background: var(--yellow); padding: 26px 24px; text-align: left; width: 100%; display: block; }
.hero .k { font-size: 12.5px; font-weight: 600; }
.hero .t { margin-top: 10px; font-size: 24px; font-weight: 600; line-height: 1.35; letter-spacing: -0.04em; }
.hero .p { position: absolute; left: 24px; bottom: 24px; font-size: 12.5px; font-weight: 600; }
.hero .go { position: absolute; right: 24px; bottom: 24px; width: 64px; height: 64px; border-radius: 50%; background: #000; color: var(--yellow); display: grid; place-items: center; }
.hero.live { background: #000; color: #fff; }
.hero.live .go { background: var(--yellow); color: #000; }
.hero.live .k { color: var(--yellow); display: flex; align-items: center; gap: 6px; }
.livedot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74,222,128,.6); animation: livep 1.6s infinite; }
@keyframes livep { 70% { box-shadow: 0 0 0 8px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }
.stats { margin-top: 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { height: 96px; border-radius: 24px; background: var(--surface); padding: 16px 18px; }
.stat b { font-size: 34px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.stat small { font-size: 13px; color: var(--g7); margin-left: 3px; }
.stat span { display: block; margin-top: 12px; font-size: 12.5px; color: var(--g8); }
.stat.warn b { color: var(--danger); }
.report { margin-top: 26px; height: 120px; border-radius: 28px; background: #000; color: #fff; padding: 22px 24px; position: relative; }
.report .k { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--yellow); }
.report .t { margin-top: 12px; font-size: 18px; font-weight: 600; }
.report .s { margin-top: 6px; font-size: 12.5px; color: var(--g7); }
.bars { position: absolute; right: 14px; bottom: 24px; display: flex; align-items: flex-end; gap: 4px; }
.bars i { width: 14px; border-radius: 4px; background: #2f2e2b; }
.bars i.y { background: var(--yellow); }

/* setup */
.card { border-radius: 20px; background: var(--surface); padding: 16px 18px; }
.card + .card { margin-top: 12px; }
.card .lab { display: flex; align-items: baseline; gap: 6px; font-size: 13px; font-weight: 600; }
.card .lab em { font-style: normal; font-size: 10px; font-weight: 600; color: var(--g6); letter-spacing: .04em; }
.card .lab .edit { margin-left: auto; font-size: 11px; color: var(--g7); font-weight: 500; }
.who { margin-top: 12px; display: flex; align-items: center; gap: 12px; }
.stack { display: flex; }
.stack .av { width: 30px; height: 30px; font-size: 9.5px; border: 2px solid var(--surface); margin-right: -8px; background: #fff; }
.stack .av:nth-child(1) { background: var(--yellow); }
.who b { display: block; font-size: 13px; font-weight: 600; }
.who span { font-size: 11px; color: var(--g7); }
.chips { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.field { margin-top: 12px; height: 40px; border-radius: 12px; background: #fff; display: flex; align-items: center; padding: 0 14px; font-size: 12.5px; color: var(--g8); }

/* sheet + dim */
.dim { position: absolute; inset: 0; background: rgba(0,0,0,.38); z-index: 25; animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 35; background: #000; color: #fff; border-radius: 32px 32px 0 0; padding: 22px 20px 0; animation: sheetUp .38s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: #3a3936; margin: -10px auto 14px; }
.sheet.light { background: #fff; color: #000; box-shadow: 0 -8px 30px rgba(0,0,0,.06); }
.sheet.light .grab { background: var(--line); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 14px; font-size: 12px; font-weight: 600; }
.pill.y { background: rgba(255,255,98,.16); color: var(--yellow); }
.pill.dg { background: var(--danger); color: #fff; height: 34px; padding: 0 14px; border-radius: 17px; font-size: 13px; }
.pill.k { background: #000; color: #fff; }
.pill .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* analyze */
.orb { position: relative; width: 150px; height: 150px; margin: 34px auto 28px; display: grid; place-items: center; }
.orb i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(255,255,98,.18); animation: ring 2.4s infinite ease-out; }
.orb i:nth-child(2) { animation-delay: .8s; }
.orb i:nth-child(3) { animation-delay: 1.6s; }
@keyframes ring { from { transform: scale(.45); opacity: 1; } to { transform: scale(1.05); opacity: 0; } }
.orb b { width: 58px; height: 58px; border-radius: 50%; background: var(--yellow); color: #000; display: grid; place-items: center; box-shadow: 0 0 0 10px rgba(255,255,98,.12), 0 0 40px rgba(255,255,98,.45); }
.alist { border-radius: 20px; background: #161615; padding: 16px 16px 14px; }
.aitem { display: flex; align-items: center; gap: 10px; height: 34px; font-size: 13px; color: #fff; }
.aitem .st { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.aitem.ok .st { background: var(--yellow); color: #000; }
.aitem.run .st { border: 2px solid var(--yellow); }
.aitem.run .st::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); }
.aitem.wait { color: var(--g8); }
.aitem.wait .st { border: 2px solid #2f2e2b; }
.aitem .v { margin-left: auto; font-size: 11.5px; color: var(--g7); font-variant-numeric: tabular-nums; }
.aitem.run .v { color: var(--yellow); }
.abar { margin-top: 10px; height: 4px; border-radius: 2px; background: #2a2a28; overflow: hidden; }
.abar i { display: block; height: 100%; background: var(--yellow); transition: width .2s linear; }

/* BIM map */
.bim { position: relative; border-radius: 20px; background: #fff; overflow: hidden; }
.bim .cell { position: absolute; background: #fff; border: 1.5px solid #dedad0; }
.bim .hall { position: absolute; background: #ece9e1; }
.bim .zone { position: absolute; border: 2px dashed var(--danger); background: rgba(255,74,43,.1); border-radius: 6px; transition: background .3s; }
.bim .zone.hot { background: rgba(255,74,43,.24); }
.bim .zone.y { border: 0; background: var(--yellow-2); border-radius: 8px; }
.bim .radius { position: absolute; border-radius: 50%; border: 1.5px dashed var(--danger); background: rgba(255,74,43,.07); }
.bim .pump { position: absolute; width: 14px; height: 14px; border-radius: 3px; background: #000; transform: translate(-50%,-50%); }
.bim .wk { position: absolute; transform: translate(-50%,-50%); width: 34px; height: 34px; border-radius: 50%; background: #000; color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 700; z-index: 2; transition: left .5s linear, top .5s linear, background .3s; }
.bim .wk.me { width: 26px; height: 26px; background: var(--yellow); color: #000; font-size: 9px; box-shadow: 0 0 0 4px rgba(255,255,98,.35); }
.bim .wk.me.caution { box-shadow: 0 0 0 6px rgba(255,255,98,.5); }
.bim .wk.me.danger { background: var(--danger); color: #fff; width: 34px; height: 34px; font-size: 10px; box-shadow: 0 0 0 14px rgba(255,74,43,.25); animation: hot 1.2s infinite; }
@keyframes hot { 50% { box-shadow: 0 0 0 22px rgba(255,74,43,.12); } }
.bim .num { position: absolute; transform: translate(-50%,-50%); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.bim .num.k { background: #000; color: #fff; }
.bim .num.r { background: #fff; color: var(--danger); border: 1.5px solid var(--danger); }
.bim .num.rr { background: var(--danger); color: #fff; }
.bim .edit { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: #000; color: #fff; display: grid; place-items: center; }

/* risk list */
.risk { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 14px; border-radius: 16px; background: #fff; }
.risk + .risk { margin-top: 8px; }
.risk .n { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 11px; color: var(--danger); font-weight: 700; flex: none; }
.risk b { display: block; font-size: 13.5px; font-weight: 600; }
.risk span { font-size: 11px; color: var(--g7); }
.risk .lv { margin-left: auto; height: 22px; padding: 0 10px; border-radius: 11px; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.risk .lv.hi { background: var(--danger); color: #fff; }
.risk .lv.md { background: var(--yellow); color: #000; }
.risk.new { animation: pop .4s; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

/* send */
.ybg { position: absolute; left: 0; right: 0; top: 0; height: 400px; background: var(--yellow); border-radius: 0 0 32px 32px; }
.bigcount { display: flex; align-items: baseline; gap: 6px; }
.bigcount b { font-size: 46px; font-weight: 500; line-height: 1; }
.bigcount span { font-size: 13px; font-weight: 600; }
.pdots { display: flex; gap: 4px; }
.pdots i { width: 22px; height: 6px; border-radius: 3px; background: rgba(0,0,0,.15); transition: background .3s, width .3s; }
.pdots i.on { background: #000; width: 28px; }
.wrow { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 14px 0 16px; border-radius: 16px; background: #fff; }
.wrow + .wrow { margin-top: 8px; }
.wrow b { font-size: 13.5px; font-weight: 600; }
.wrow em { font-style: normal; font-size: 11px; color: var(--g6); }
.wrow .s { margin-left: auto; }
.wst { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.wst.ok { background: #000; color: #fff; }
.wst.play { background: var(--yellow); color: #000; }
.wst.wait { background: var(--surface); color: var(--g7); }
.wst.play .ic { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* map screen */
.mapbg { position: absolute; left: 0; right: 0; top: 0; height: 620px; background: #f6f5f0; }
.map-area { position: absolute; left: 20px; right: 20px; top: 132px; height: 400px; }
.map-area .bim { position: absolute; inset: 0; background: transparent; border-radius: 0; overflow: visible; }
.mapsheet { position: absolute; left: 0; right: 0; top: 560px; bottom: 0; background: #fff; border-radius: 32px 32px 0 0; padding: 22px 20px; z-index: 15; box-shadow: 0 -10px 30px rgba(0,0,0,.05); }
.mapsheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: -10px auto 12px; }
.mcount { font-size: 13px; font-weight: 600; }
.mcount b { font-size: 26px; font-weight: 500; margin-right: 4px; }
.wcard { margin-top: 12px; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 14px; border-radius: 18px; background: var(--yellow); width: 100%; text-align: left; transition: background .3s, color .3s; }
.wcard b { display: block; font-size: 13.5px; font-weight: 600; }
.wcard span { font-size: 11px; color: var(--g8); }
.wcard.danger { background: var(--danger); color: #fff; }
.wcard.danger span { color: rgba(255,255,255,.85); }
.wcard.safe { background: var(--surface); }
.wcard .ic { margin-left: auto; }

/* worker detail */
.prof { margin-top: 24px; display: flex; align-items: center; gap: 14px; }
.prof b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -0.04em; }
.prof span { font-size: 12px; color: var(--g7); }
.loc { margin-top: 30px; display: flex; gap: 12px; align-items: center; border-radius: 20px; background: var(--surface); padding: 16px; }
.loc .t { flex: 1; }
.loc .t small { font-size: 11px; color: var(--g7); }
.loc .t b { display: block; margin: 4px 0 10px; font-size: 16px; font-weight: 600; line-height: 1.35; }
.mini { width: 120px; height: 100px; position: relative; border-radius: 12px; background: #fff; overflow: hidden; }
.fat { margin-top: 12px; border-radius: 24px; background: var(--yellow); padding: 18px; }
.fat .top { display: flex; align-items: flex-end; gap: 10px; }
.fat .top b { font-size: 52px; font-weight: 500; line-height: .9; letter-spacing: -0.04em; }
.fat .top small { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.fbars { margin-top: 18px; display: flex; align-items: flex-end; gap: 8px; height: 60px; }
.fbars i { flex: 1; border-radius: 6px; background: rgba(0,0,0,.12); }
.fbars i.k { background: #000; }
.fhrs { margin-top: 6px; display: flex; gap: 8px; font-size: 9.5px; color: var(--g8); }
.fhrs span { flex: 1; text-align: center; }

/* chat */
.chathead { display: flex; align-items: center; gap: 10px; }
.chathead .who2 b { display: block; font-size: 15px; font-weight: 600; }
.chathead .who2 span { font-size: 11px; color: var(--g7); }
.chathead .ibtn:last-child { margin-left: auto; }
.rcp { margin-top: 18px; display: flex; gap: 6px; }
.msgs { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.bub { max-width: 78%; padding: 12px 14px; border-radius: 18px; font-size: 13.5px; line-height: 1.5; animation: pop .3s; }
.bub.me { align-self: flex-end; background: var(--yellow); border-bottom-right-radius: 6px; }
.bub.you { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 6px; }
.bub .meta { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 10.5px; color: var(--g8); font-weight: 600; }
.bub .ai { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; font-size: 10.5px; color: var(--g7); font-weight: 600; }
.bub .big { font-size: 16px; font-weight: 600; line-height: 1.45; }
.bub .orig { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; color: var(--g8); }
.bub .orig i { width: 22px; height: 22px; border-radius: 50%; background: #000; color: var(--yellow); display: grid; place-items: center; }
.sysmsg { align-self: center; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 14px; background: #000; color: #fff; font-size: 11.5px; font-weight: 600; animation: pop .3s; }
.sysmsg .ic { color: var(--yellow); }
.voice { position: absolute; left: 0; right: 0; bottom: 0; height: 454px; background: #000; color: #fff; border-radius: 32px 32px 0 0; padding: 26px 20px 0; z-index: 20; animation: sheetUp .38s cubic-bezier(.2,.8,.2,1); }
.voice .said { margin-top: 18px; min-height: 64px; font-size: 21px; font-weight: 600; line-height: 1.45; letter-spacing: -0.03em; }
.voice .said .caret { display: inline-block; width: 2px; height: 22px; background: var(--yellow); vertical-align: -3px; margin-left: 2px; animation: blink .9s infinite; }
.voice .tr { margin-top: 16px; border-radius: 16px; background: #1d1d1b; padding: 14px 16px; min-height: 76px; transition: opacity .3s; }
.voice .tr small { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--yellow); font-weight: 600; }
.voice .tr p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: rgba(255,255,255,.85); }
.vctl { position: absolute; left: 0; right: 0; bottom: 46px; display: flex; align-items: center; justify-content: center; gap: 40px; }
.vctl .side { width: 48px; height: 48px; border-radius: 50%; background: #1d1d1b; display: grid; place-items: center; color: rgba(255,255,255,.8); }
.vctl .mic { width: 80px; height: 80px; border-radius: 50%; background: var(--yellow); color: #000; display: grid; place-items: center; box-shadow: 0 0 0 10px rgba(255,255,98,.16); }
.vctl .mic.rec { animation: micp 1.2s infinite; }
@keyframes micp { 50% { box-shadow: 0 0 0 18px rgba(255,255,98,.08); } }
.chatin { position: absolute; left: 20px; right: 20px; bottom: 28px; height: 60px; border-radius: 30px; background: var(--surface); display: flex; align-items: center; padding: 0 8px 0 20px; font-size: 13px; color: var(--g7); }
.chatin .mic { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; background: var(--yellow); color: #000; display: grid; place-items: center; }

.toast { position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); z-index: 60; max-width: 340px; width: max-content; padding: 12px 18px; border-radius: 22px; background: rgba(0,0,0,.86); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.45; text-align: center; animation: pop .25s; }

/* ═════════ MR helmet view ═════════ */
.mr .env { position: absolute; inset: 0; background: linear-gradient(180deg, #4d4a42 0%, #3a3832 50%, #2e2d29 100%); }
.mr .env .floor { position: absolute; left: 0; right: 0; top: 214px; bottom: 0; background: linear-gradient(180deg, #3a3833, #2a2925); clip-path: polygon(0 12%, 100% 0, 100% 100%, 0 100%); }
.mr .env .beam { position: absolute; left: 0; right: 0; top: 118px; height: 1.5px; background: rgba(255,255,255,.13); transform: rotate(-1.6deg); transform-origin: left; }
.mr .env .col { position: absolute; background: rgba(255,255,255,.1); }
.mr .scan { position: absolute; inset: 0; background: repeating-linear-gradient(180deg, rgba(255,255,255,.015) 0 2px, transparent 2px 4px); pointer-events: none; }
.mr svg.zones { position: absolute; inset: 0; width: 874px; height: 402px; }
.mr .z-y, .mr .z-r { opacity: 0; transition: opacity .45s; }
.mr.caution .z-y, .mr.danger .z-y { opacity: 1; }
.mr.danger .z-r { opacity: 1; }
.mr .vign { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; box-shadow: inset 0 0 120px rgba(255,74,43,.55); }
.mr.danger .vign { opacity: 1; animation: vg 1.2s infinite; }
@keyframes vg { 50% { opacity: .55; } }
.hud { position: absolute; display: flex; gap: 8px; align-items: center; }
.hpill { display: inline-flex; align-items: center; gap: 8px; height: 31px; padding: 0 14px; border-radius: 16px; background: rgba(0,0,0,.72); font-size: 12px; font-weight: 600; }
.hpill .d { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.hpill.y { background: var(--yellow); color: #000; font-weight: 800; height: 27px; }
.zpill { position: absolute; left: 200px; top: 300px; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 17px; font-size: 12.5px; font-weight: 700; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.mr.caution .zpill.c, .mr.danger .zpill.d { opacity: 1; transform: none; }
.zpill.c { background: var(--yellow); color: #000; left: 230px; top: 248px; }
.zpill.d { background: var(--danger); color: #fff; }
.zpill .ko { font-weight: 500; opacity: .75; font-size: 10.5px; }
.subt { position: absolute; left: 404px; top: 84px; width: 440px; padding: 18px 20px; border-radius: 22px; background: rgba(10,10,9,.88); animation: pop .35s; }
.subt .r1 { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 600; }
.subt .r1 .who { color: var(--yellow); }
.subt .r1 .pl { display: inline-flex; align-items: center; gap: 5px; color: rgba(255,255,255,.7); font-weight: 500; }
.subt .vi { margin-top: 8px; font-size: 20px; font-weight: 500; line-height: 1.4; letter-spacing: -0.01em; }
.subt .ko { margin-top: 6px; font-size: 11px; color: rgba(255,255,255,.5); }
.brief { position: absolute; left: 32px; top: 76px; width: 470px; padding: 18px 20px; border-radius: 22px; background: rgba(10,10,9,.9); animation: pop .35s; }
.brief .r1 { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--yellow); font-weight: 600; }
.brief h3 { margin: 8px 0 2px; font-size: 19px; font-weight: 600; }
.brief .ko { font-size: 10.5px; color: rgba(255,255,255,.45); font-weight: 500; }
.brief ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.brief li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.brief li i { width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; font-style: normal; display: grid; place-items: center; flex: none; }
.brief li i.m { background: var(--yellow); color: #000; }
.ok-btn { position: absolute; right: 32px; bottom: 30px; display: inline-flex; align-items: center; gap: 10px; height: 64px; padding: 0 26px; border-radius: 32px; background: var(--yellow); color: #000; font-size: 17px; font-weight: 700; box-shadow: 0 0 0 10px rgba(255,255,98,.18); }
.ok-btn small { font-size: 11px; font-weight: 600; opacity: .6; }
.done-chip { position: absolute; right: 32px; bottom: 36px; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 22px; background: rgba(0,0,0,.75); font-size: 13px; font-weight: 600; }
.done-chip .ic { color: var(--yellow); }
.idle { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; }
.idle .ring { width: 70px; height: 70px; margin: 0 auto 16px; border-radius: 50%; border: 3px solid rgba(255,255,98,.2); border-top-color: var(--yellow); animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.idle b { display: block; font-size: 18px; font-weight: 600; }
.idle span { display: block; margin-top: 6px; font-size: 12px; color: rgba(255,255,255,.5); }
.ptt { position: absolute; right: 32px; bottom: 30px; display: flex; align-items: center; gap: 14px; }
.ptt .reply { padding: 14px 20px; border-radius: 22px; background: var(--yellow); color: #000; font-size: 16px; font-weight: 600; animation: pop .3s; }
.ptt .cap2 { position: absolute; right: 90px; top: 100%; margin-top: 6px; white-space: nowrap; font-size: 11px; color: rgba(255,255,255,.55); }
.ptt .pbtn { width: 76px; height: 76px; border-radius: 50%; background: var(--yellow); color: #000; display: grid; place-items: center; box-shadow: 0 0 0 9px rgba(255,255,98,.28); flex: none; }
.ptt .pbtn.rec { animation: micp 1s infinite; }
.ptt .hint2 { font-size: 12px; color: rgba(255,255,255,.7); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
