/* 『ラインの向こう側』 — the management screen (loaded after kit.css). Light, clean, industrial:
   safety orange for actions, teal for people, colour + icon + text for every status. */
:root {
  --bg: #e9edf1;
  --panel: #ffffff;
  --panel2: #f6f8fa;
  --ink: #1d2730;
  --dim: #66737e;
  --line: #d7dde3;
  --accent: #e46f1a;
  --accent-d: #c45a0e;
  --teal: #1f7a8c;
  --ok: #2e8a56;
  --warn: #c98a0c;
  --bad: #c8412c;
  --info: #2f6fb0;
  --gold: #d9a21a;
  --shadow: 0 1px 2px rgba(20, 30, 40, 0.08), 0 6px 18px rgba(20, 30, 40, 0.08);
  --top: 56px;
  --nav: 74px;
  --side: 330px;
  --log: 128px;
}
html, body { background: var(--bg); color: var(--ink); font-family: 'BIZ UDPGothic', 'Hiragino Sans', 'Yu Gothic', sans-serif; font-size: calc(14px * var(--fs)); }
body { overscroll-behavior: none; }
b, strong { font-weight: 700; }
.num, .clock, .tb-kpis b { font-variant-numeric: tabular-nums; }
.screen { position: fixed; inset: 0; }
.btn { border-radius: 9px; border-color: #c4ccd4; background: #fff; }
.btn:hover:not(:disabled) { background: #f2f5f8; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.primary:hover:not(:disabled) { background: var(--accent-d); }
.btn.teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.danger { color: var(--bad); border-color: #e6b3aa; }
.btn.ghosty { background: transparent; border-color: transparent; color: var(--dim); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.82em; background: #eef1f4; color: var(--dim); border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { background: #e3f3ea; color: var(--ok); border-color: #b9e0c9; }
.chip.warn { background: #fdf3dc; color: #9a6a06; border-color: #f0d79a; }
.chip.bad { background: #fbe6e2; color: var(--bad); border-color: #efbdb4; }
.chip.info { background: #e4eef9; color: var(--info); border-color: #bcd3ee; }
.chip.lv { background: #fff4d6; color: #8a6400; border-color: #ecd28c; }
.up { color: var(--ok); }
.down { color: var(--bad); }
.flat { color: var(--dim); }
.muted { color: var(--dim); }

/* ---- title ---- */
#title { overflow-y: auto; background: #1a232b; }
.title-art { position: fixed; inset: 0; background: linear-gradient(115deg, #2a3a46, #6b5a42); background-size: cover; background-position: center; }
.title-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 28, 35, 0.88) 0%, rgba(20, 28, 35, 0.72) 46%, rgba(20, 28, 35, 0.2) 100%); }
.title-box { position: relative; max-width: 640px; padding: 48px 40px 40px; color: #f3f1ec; }
.kicker { letter-spacing: 0.12em; color: #f2b27a; font-weight: 700; margin: 0 0 6px; }
.logo { font-family: 'Zen Kaku Gothic New', sans-serif; font-weight: 900; font-size: clamp(44px, 9vw, 78px); line-height: 1.05; margin: 0 0 14px; letter-spacing: 0.02em; text-shadow: 0 3px 18px rgba(0, 0, 0, 0.4); }
.lead { font-size: 1.15em; line-height: 1.8; margin: 0 0 16px; }
.lead b { color: #ffc58f; }
.goal-card { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 14px; padding: 10px 14px; margin: 0 0 12px; }
.goal-h { font-weight: 700; color: #ffd39a; margin-bottom: 6px; }
.goal-list { display: flex; flex-wrap: wrap; gap: 6px; }
.goal-list span { background: rgba(255, 255, 255, 0.14); border-radius: 999px; padding: 3px 10px; font-size: 0.92em; }
.title-lv { line-height: 1.7; color: #e6e2d8; }
.title-modes { display: grid; gap: 10px; margin: 18px 0 10px; }
.title-modes .mode { text-align: left; font: inherit; color: #fff; background: var(--accent); border: none; border-radius: 14px; padding: 14px 18px; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.title-modes .mode:hover { background: var(--accent-d); }
.title-modes .mode.alt { background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.3); }
.title-modes .mode b { display: block; font-size: 1.12em; }
.title-modes .mode span { font-size: 0.88em; opacity: 0.9; }
#continue { margin: 6px 0 8px; }
#continue .dim { color: #cdd3d8; }
#title .dim { color: #b9c2c9; }
.title-points { padding-left: 1.1em; line-height: 1.75; color: #e7e3da; }
.title-points b { color: #ffd39a; }
.disclaimer { font-size: 0.8em; color: #aab3ba; line-height: 1.6; margin-top: 18px; }

/* ---- app grid ---- */
#app { display: grid; grid-template-columns: var(--nav) 1fr var(--side); grid-template-rows: var(--top) 1fr var(--log); grid-template-areas: 'top top top' 'nav stage side' 'nav log side'; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 12px; padding: 0 10px; background: #1f2a33; color: #eef2f5; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); z-index: 4; min-width: 0; }
.tb-time { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tb-menu { font: inherit; font-size: 20px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid #3a4853; background: #26333d; color: #fff; cursor: pointer; }
.tb-date { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.tb-date b { font-size: 1.02em; }
.tb-date .clock { font-size: 1.35em; font-weight: 700; color: #ffd39a; }
.tb-date .chip { background: #31404b; border-color: #44535e; color: #dfe6ea; }
.tb-run { display: flex; align-items: center; gap: 6px; }
.play { width: 44px; height: 38px; border-radius: 10px; border: none; background: var(--accent); color: #fff; font-size: 18px; cursor: pointer; }
.play.on { background: #3a4853; }
.speeds { display: flex; border: 1px solid #3a4853; border-radius: 10px; overflow: hidden; }
.speeds button { font: inherit; font-size: 0.86em; padding: 7px 8px; border: none; background: #26333d; color: #c9d3da; cursor: pointer; min-width: 34px; }
.speeds button.on { background: #e8eef2; color: #1f2a33; font-weight: 700; }
.tb-run .ghosty { color: #c9d3da; }
.tb-kpis { display: flex; gap: 14px; flex: 1; justify-content: center; min-width: 0; overflow: hidden; }
.tb-kpis .k { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; cursor: default; }
.tb-kpis .k small { font-size: 0.72em; color: #9fb0bc; }
.tb-kpis .k b { font-size: 1.04em; }
.tb-kpis .k b.down { color: #ff9a86; }
.tb-kpis .k b.up { color: #8fe0b0; }
.tb-right { display: flex; align-items: center; gap: 8px; }
.lvchip { font: inherit; display: flex; flex-direction: column; align-items: stretch; gap: 2px; background: #2c3a45; border: 1px solid #44535e; color: #ffe2a8; border-radius: 10px; padding: 4px 10px; cursor: pointer; min-width: 120px; text-align: left; }
.lvchip .lvbar { height: 4px; border-radius: 3px; background: #44535e; overflow: hidden; }
.lvchip .lvbar i { display: block; height: 100%; background: var(--gold); }
.lvchip small { font-size: 0.72em; color: #b8c4cc; }
.bell { position: relative; font: inherit; font-size: 18px; width: 40px; height: 38px; border-radius: 10px; border: 1px solid #3a4853; background: #26333d; cursor: pointer; }
.bell i { position: absolute; top: -4px; right: -4px; background: var(--bad); color: #fff; font-size: 11px; font-style: normal; border-radius: 999px; padding: 1px 6px; font-weight: 700; }
.bell.ring { animation: ring 0.9s ease-in-out 2; }
@keyframes ring { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.walk { background: var(--teal); color: #fff; border-color: var(--teal); font-weight: 700; margin: 0; }
.walk:hover:not(:disabled) { background: #186473; }

.side-nav { grid-area: nav; display: flex; flex-direction: column; gap: 2px; padding: 6px 4px; background: #fff; border-right: 1px solid var(--line); overflow-y: auto; z-index: 3; }
.side-nav button { font: inherit; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 2px; border: none; background: transparent; border-radius: 10px; cursor: pointer; color: var(--dim); position: relative; }
.side-nav button span { font-size: 20px; line-height: 1.1; }
.side-nav button b { font-size: 0.78em; font-weight: 700; }
.side-nav button:hover { background: #f1f4f7; color: var(--ink); }
.side-nav button.on { background: #fff1e6; color: var(--accent-d); }
.side-nav button .dot { position: absolute; top: 4px; right: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); }
.side-nav button.locked { opacity: 0.45; }

#stage { grid-area: stage; position: relative; overflow: hidden; background: #dfe4e9; min-width: 0; min-height: 0; }
#v2d, #v3d { position: absolute; inset: 0; }
#c2d, #c3d { width: 100%; height: 100%; display: block; touch-action: none; }
.floorbar { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 4px; background: rgba(255, 255, 255, 0.92); padding: 4px; border-radius: 12px; box-shadow: var(--shadow); }
.floorbar button { font: inherit; min-width: 40px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; }
.floorbar button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.floorbar button.locked { color: #aab3ba; background: #f1f3f5; }
.layers { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; background: rgba(255, 255, 255, 0.92); padding: 6px; border-radius: 12px; box-shadow: var(--shadow); max-width: 170px; }
.layers label { display: flex; align-items: center; gap: 6px; font-size: 0.86em; cursor: pointer; white-space: nowrap; }
.layers .lg { display: inline-block; width: 18px; height: 4px; border-radius: 2px; }
.layers .lh { font-size: 0.78em; color: var(--dim); font-weight: 700; }
.zoombar { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 4px; }
.zoombar button { font: inherit; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); cursor: pointer; font-size: 16px; }
.mission { position: absolute; left: 10px; top: 10px; width: min(380px, calc(100% - 200px)); background: rgba(255, 255, 255, 0.97); border-radius: 14px; box-shadow: var(--shadow); border-left: 5px solid var(--accent); padding: 10px 12px 10px 12px; line-height: 1.6; }
.mission .mh { display: flex; align-items: center; gap: 8px; font-size: 0.8em; color: var(--dim); }
.mission .mh .chip { font-weight: 700; }
.mission .mt { font-weight: 700; font-size: 1.05em; margin: 2px 0; }
.mission .mx { font-size: 0.92em; }
.mission .mhint { margin-top: 4px; font-size: 0.86em; background: #fff4e8; padding: 4px 8px; border-radius: 8px; color: #8a4a12; }
.mission .mfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.mission .mfoot button { font: inherit; font-size: 0.8em; border: none; background: none; color: var(--dim); cursor: pointer; text-decoration: underline; }
.mission.min .mx, .mission.min .mfoot, .mission.min .goals + .mx { display: none; }
.mission.min .mhint { margin-top: 2px; }
.mission .goals { margin: 4px 0 0; padding: 0; list-style: none; font-size: 0.88em; }
.mission .goals li { padding: 1px 0; }
.mission .goals li.done { color: var(--ok); text-decoration: line-through; }
.mission .goals li.failed { color: var(--bad); }
.buildbar { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: rgba(31, 42, 51, 0.95); color: #fff; padding: 6px 8px 6px 12px; border-radius: 12px; display: flex; gap: 6px; align-items: center; box-shadow: var(--shadow); max-width: calc(100% - 20px); flex-wrap: wrap; justify-content: center; }
.buildbar .btn { margin: 0; padding: 5px 10px; font-size: 0.86em; }
.buildbar .why { font-size: 0.85em; color: #ffd39a; }
.buildbar .why.bad { color: #ff9a86; }

.side { grid-area: side; background: #fff; border-left: 1px solid var(--line); overflow-y: auto; overflow-x: hidden; padding: 10px 12px 16px; z-index: 3; }
.side h3 { margin: 4px 0 6px; font-size: 1.08em; display: flex; align-items: center; gap: 8px; }
.side h4 { margin: 12px 0 4px; font-size: 0.92em; color: var(--dim); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.side .close-sheet { display: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 0.92em; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; }
.bar { height: 8px; border-radius: 4px; background: #e8ecf0; overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; background: var(--teal); }
.bar.warn i { background: var(--warn); }
.bar.bad i { background: var(--bad); }
.bar.ok i { background: var(--ok); }
.barrow { display: grid; grid-template-columns: 6.2em 1fr minmax(3em, auto); gap: 6px; align-items: center; font-size: 0.86em; margin: 3px 0; }
.barrow span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.cardlist { display: flex; flex-direction: column; gap: 6px; }
.ccard { border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; background: var(--panel2); cursor: pointer; }
.ccard:hover { border-color: #b9c4cd; }
.ccard .t { font-weight: 700; display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.ccard .t small { font-weight: 400; color: var(--dim); }
.ccard .s { font-size: 0.84em; color: var(--dim); }
.actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.actions .btn { margin: 0; }
.face { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: #dde3e8; flex: none; }
.face.sm { width: 34px; height: 34px; border-radius: 9px; }
.person-head { display: flex; gap: 10px; align-items: center; }
.person-head .nm { font-weight: 700; font-size: 1.1em; }
.zones { display: flex; flex-direction: column; gap: 3px; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.zones label { display: flex; gap: 6px; align-items: center; font-size: 0.9em; }
.zones label small { color: var(--dim); }
.cat-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.cat-tabs button { font: inherit; font-size: 0.82em; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.cat-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.catalog { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.eqcard { font: inherit; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 2px; position: relative; }
.eqcard:hover:not(:disabled) { border-color: var(--accent); }
.eqcard.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(228, 111, 26, 0.25); }
.eqcard:disabled { opacity: 0.5; cursor: default; }
.eqcard .ic { font-size: 18px; }
.eqcard .nm { font-weight: 700; font-size: 0.9em; line-height: 1.3; }
.eqcard .pr { font-size: 0.8em; color: var(--dim); }
.eqcard .lock { position: absolute; right: 6px; top: 6px; font-size: 0.72em; color: #8a6400; background: #fff4d6; border-radius: 6px; padding: 0 5px; }

.logbar { grid-area: log; background: #fff; border-top: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; z-index: 2; }
.log-tabs { display: flex; gap: 4px; padding: 4px 8px 2px; align-items: center; }
.log-tabs button { font: inherit; font-size: 0.78em; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--dim); }
.log-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.log-tabs .spacer { flex: 1; }
.log { list-style: none; margin: 0; padding: 0 8px 6px; overflow-y: auto; flex: 1; font-size: 0.9em; }
.log li { padding: 2px 4px; border-bottom: 1px dashed #edf0f3; display: flex; gap: 8px; align-items: baseline; cursor: default; border-radius: 6px; }
.log li.go { cursor: pointer; }
.log li.go:hover { background: #f4f7fa; }
.log li time { color: var(--dim); font-size: 0.86em; flex: none; font-variant-numeric: tabular-nums; }
.log li.voice span { color: #1f5f6c; }
.log li.bad span { color: var(--bad); font-weight: 700; }
.log li.warn span { color: #8a5a00; }
.log li.ok span { color: var(--ok); }
.log li.level span { color: #8a6400; font-weight: 700; }

/* ---- windows: wider, cleaner ---- */
.win { border-radius: 16px; background: #fff; border-color: var(--line); }
.win-title { color: var(--ink); font-family: 'Zen Kaku Gothic New', 'BIZ UDPGothic', sans-serif; font-weight: 900; }
.sec { color: var(--ink); border-bottom: 2px solid #eef1f4; }
.win.wide { width: min(1120px, 97vw); }
.win-body { line-height: 1.65; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.92em; }
table.tbl th, table.tbl td { padding: 5px 6px; border-bottom: 1px solid #edf0f3; text-align: left; vertical-align: top; }
table.tbl th { color: var(--dim); font-weight: 700; font-size: 0.88em; background: #f7f9fb; position: sticky; top: 0; }
table.tbl td.r, table.tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tblwrap { overflow-x: auto; }
.offer { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; align-items: start; }
.offer.trial { border-color: #f0b07c; background: #fffaf4; }
.offer.locked { opacity: 0.6; }
.offer img, .offer .ph { width: 96px; height: 72px; border-radius: 8px; object-fit: cover; background: #e8ecef; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.offer .on { font-weight: 700; font-size: 1.02em; }
.offer .meta { font-size: 0.86em; color: var(--dim); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.offer .money { text-align: right; white-space: nowrap; }
.offer .money b { font-size: 1.1em; }
.offers { display: flex; flex-direction: column; gap: 8px; }
.est { background: #f7f9fb; border-radius: 12px; padding: 10px 12px; }
.est .big { font-size: 1.3em; font-weight: 700; }
.alert { border-radius: 10px; padding: 7px 10px; margin: 6px 0; font-size: 0.92em; }
.alert.bad { background: #fbe6e2; color: #8a2a1a; }
.alert.warn { background: #fdf3dc; color: #7a5200; }
.alert.ok { background: #e3f3ea; color: #1f6a40; }
.alert.info { background: #e4eef9; color: #234f80; }
.stages { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 0.86em; }
.stages .st { padding: 2px 8px; border-radius: 8px; background: #eef2f5; border: 1px solid var(--line); }
.stages .st.miss { background: #fbe6e2; border-color: #efbdb4; color: var(--bad); }
.stages .ar { color: var(--dim); }

/* the daily report: before -> after, colour and a plain sentence */
.rep-sum { font-size: 1.08em; line-height: 1.7; padding: 10px 12px; border-radius: 12px; background: #f4f7fa; border-left: 5px solid var(--teal); margin-bottom: 10px; }
.rep-sum.bad { border-left-color: var(--bad); background: #fdf1ee; }
.rep-sum.good { border-left-color: var(--ok); background: #eef8f2; }
.kgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kbox { background: #f7f9fb; border-radius: 12px; padding: 8px 10px; border: 1px solid #edf0f3; }
.kbox small { display: block; color: var(--dim); font-size: 0.8em; }
.kbox b { font-size: 1.25em; font-variant-numeric: tabular-nums; }
.kbox .ba { font-size: 0.8em; color: var(--dim); }
.kbox.good { background: #eef8f2; border-color: #c9e8d6; }
.kbox.bad { background: #fdf1ee; border-color: #f2cdc5; }
.causes { display: flex; height: 22px; border-radius: 6px; overflow: hidden; margin: 6px 0; }
.causes i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.84em; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; background: var(--c); vertical-align: -1px; }
.notes { list-style: none; padding: 0; margin: 6px 0; }
.notes li { padding: 4px 8px; border-radius: 8px; margin: 3px 0; font-size: 0.92em; }
.notes li.bad { background: #fdf1ee; color: #8a2a1a; }
.notes li.warn { background: #fdf6e6; color: #7a5200; }
.notes li.ok { background: #eef8f2; color: #1f6a40; }

/* incident dialog */
.evhead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.sev { letter-spacing: 1px; color: var(--bad); }
.evbox { background: #f7f9fb; border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.evbox h5 { margin: 0 0 2px; font-size: 0.86em; color: var(--dim); }
.choice { display: block; width: 100%; text-align: left; font: inherit; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; margin: 6px 0; background: #fff; cursor: pointer; }
.choice:hover { border-color: var(--accent); background: #fffaf4; }
.choice .ct { font-weight: 700; }
.choice .ce { font-size: 0.85em; color: var(--dim); display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; }
.choice .tag { font-size: 0.75em; border-radius: 6px; padding: 0 6px; margin-right: 6px; }
.tag.contain { background: #e4eef9; color: var(--info); }
.tag.safe_workaround { background: #fdf3dc; color: #8a5a00; }
.tag.systemic_fix { background: #e3f3ea; color: var(--ok); }

/* level up */
.lvup { text-align: center; }
.lvup .art { width: 100%; height: 170px; border-radius: 12px; background: #e8ecef center/cover; margin-bottom: 10px; }
.lvup .big { font-family: 'Zen Kaku Gothic New', sans-serif; font-weight: 900; font-size: 1.9em; color: #8a6400; }
.unlocks { text-align: left; background: #fffaf0; border: 1px solid #f0dfb6; border-radius: 12px; padding: 8px 12px; margin: 8px 0; }
.conds { list-style: none; padding: 0; margin: 4px 0; }
.conds li { padding: 3px 0; display: flex; gap: 8px; align-items: center; }
.conds li .bar { flex: 1; max-width: 160px; }
.conds li.ok { color: var(--ok); }

/* 3D HUD */
.hud3d { position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; max-width: min(440px, 70%); }
.hud3d .card { background: rgba(255, 255, 255, 0.93); border-radius: 12px; padding: 7px 10px; box-shadow: var(--shadow); pointer-events: auto; font-size: 0.92em; line-height: 1.55; }
.hud3d .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.hud3d .btn { margin: 0; padding: 4px 9px; font-size: 0.86em; }
.minimap { position: absolute; right: 10px; top: 10px; border-radius: 12px; box-shadow: var(--shadow); background: #fff; }
#v3d #prompt { position: absolute; }
#v3d #crosshair { position: absolute; }
.marker3d { position: absolute; pointer-events: none; transform: translate(-50%, -100%); }
#touch #t-buttons { grid-template-columns: repeat(2, auto); }

/* ---- small screens: nav at the bottom, side panel as a sheet, compact top bar ---- */
@media (max-width: 1100px) {
  :root { --side: 300px; }
  .tb-kpis .k.opt { display: none; }
}
@media (max-width: 900px) {
  :root { --top: 52px; --log: 92px; }
  #app { grid-template-columns: 1fr; grid-template-rows: var(--top) 1fr var(--log) 58px; grid-template-areas: 'top' 'stage' 'log' 'nav'; }
  .side-nav { flex-direction: row; border-right: none; border-top: 1px solid var(--line); overflow-x: auto; padding: 3px; gap: 0; }
  .side-nav button { flex: 1 0 54px; padding: 4px 0; }
  .side-nav button span { font-size: 18px; }
  .side { position: fixed; left: 0; right: 0; bottom: 58px; max-height: 62vh; border-left: none; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18); transform: translateY(calc(100% + 80px)); transition: transform 0.22s; z-index: 6; }
  .side.open { transform: none; }
  .side .close-sheet { display: block; position: sticky; top: -10px; margin: -10px -12px 6px; padding: 6px; text-align: center; background: #fff; border: none; width: calc(100% + 24px); font: inherit; color: var(--dim); }
  .hide-s { display: none; }
  .tb-kpis .k.opt2 { display: none; }
  .lvchip { min-width: 0; }
  .lvchip small { display: none; }
  .mission { width: calc(100% - 20px); top: auto; bottom: 56px; }
  .layers { top: 10px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .kgrid { grid-template-columns: repeat(2, 1fr); }
  .offer { grid-template-columns: 64px 1fr; }
  .offer img, .offer .ph { width: 64px; height: 52px; }
  .offer .money { grid-column: 1 / -1; text-align: left; }
}
@media (max-width: 600px) {
  .topbar { gap: 6px; padding: 0 6px; }
  .tb-date b { display: none; }
  .tb-date .chip { display: none; }
  .speeds button { min-width: 28px; padding: 6px 5px; }
  #tb-skip { display: none; }
  .tb-kpis { gap: 8px; justify-content: flex-end; }
  .tb-kpis .k.opt3 { display: none; }
  .lvchip { padding: 3px 6px; font-size: 0.86em; }
  .bell { width: 34px; }
  .tb-menu { width: 34px; }
  .walk { padding: 6px 9px; }
  .title-box { padding: 30px 16px 30px; }
  .layers { max-width: 46px; overflow: hidden; }
  .layers.open { max-width: 170px; }
  .layers label span.t { display: none; }
  .layers.open label span.t { display: inline; }
  .catalog { grid-template-columns: 1fr 1fr; }
  .win-wrap { padding: 4px; }
}
@media (max-width: 420px) {
  .tb-kpis .k.opt4 { display: none; }
  .speeds button:nth-child(4) { display: none; }
}
/* tabs inside windows */
.hb-tabs { display: flex; gap: 4px; border-bottom: 2px solid #eef1f4; flex-wrap: wrap; }
.hb-tab { font: inherit; border: none; background: transparent; padding: 7px 12px; border-radius: 9px 9px 0 0; cursor: pointer; color: var(--dim); font-weight: 700; }
.hb-tab.on { background: #fff1e6; color: var(--accent-d); box-shadow: inset 0 -3px 0 var(--accent); }
.hb-tab .cnt { margin-left: 6px; background: #eef1f4; color: var(--dim); border-radius: 999px; padding: 0 7px; font-size: 0.8em; }

/* toasts below the top bar, clear of the side panel */
#toasts { top: calc(var(--top) + 8px); right: calc(var(--side) + 12px); }
#title:not(.hidden) ~ #hud #toasts { right: 12px; }
@media (max-width: 900px) {
  #toasts { right: 8px; left: 8px; align-items: stretch; max-width: none; }
}
@media (max-width: 600px) {
  .speeds button:not(.on) { display: none; }
  .speeds button.on { min-width: 40px; }
  .tb-date .clock { font-size: 1.1em; }
  .lvchip .lvn { display: none; }
  .lvchip { min-width: 0; padding: 3px 8px; }
  .bell { display: none; }
  .tb-kpis .k.opt2, .tb-kpis .k.opt { display: none; }
  .tb-kpis .k small { font-size: 0.66em; }
  .layers label { display: none; }
  .layers.open label { display: flex; }
  .layers { padding: 6px 8px; }
}

/* the 3D walk: touch controls inside the view; on phones the view takes the log and nav rows too */
#v3d #touch { position: absolute; }
@media (max-width: 900px) {
  #app.mode3d { grid-template-rows: var(--top) 1fr 0 0; }
  #app.mode3d .logbar, #app.mode3d .side-nav { display: none; }
}
