/* Camper BU22 demo – phone UI modelled on the real app (0.3.x/0.4 design: dark #0B0F14, cards #151B23, amber #F2A33A) */
.demo { background: radial-gradient(80% 60% at 30% 10%, rgba(242,163,58,.07), transparent 60%), var(--bg); border-top: 1px solid var(--line); }
.sim-label { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(242,163,58,.5); background: rgba(242,163,58,.08); color: #ffd39a; font-weight: 600; font-size: .86rem; margin-bottom: 18px; }
.sim-label svg { width: 16px; height: 16px; }
.demo-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
@media (max-width: 900px) { .demo-layout { grid-template-columns: 1fr; } .phone-col { justify-self: center; width: 100%; max-width: 380px; } }

/* ---------- phone frame ---------- */
.phone { --p-bg: #0b0f14; --p-card: #151b23; --p-card-2: #1b232d; --p-line: rgba(255,255,255,.07); --p-text: #e8ecf1; --p-muted: #8d98a5; --p-amber: #f2a33a; --p-red: #b4282d;
  position: relative; width: 100%; aspect-ratio: 9 / 19; max-height: 820px; border-radius: 46px; padding: 11px; background: linear-gradient(145deg, #2a313b, #11151b 40%, #232a33); box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 40px 80px -30px rgba(0,0,0,.8), 0 0 60px -20px rgba(242,163,58,.15); }
.phone::before { content: ""; position: absolute; top: 22px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #05070a; z-index: 5; box-shadow: 0 0 0 2px #151a20; }
.screen { position: relative; height: 100%; border-radius: 36px; overflow: hidden; background: var(--p-bg); color: var(--p-text); display: flex; flex-direction: column; font-size: 13px; line-height: 1.35; font-family: var(--font); }
.p-status { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 30px 20px 4px; font-size: 11.5px; font-weight: 600; color: #cfd6de; flex: none; }
.p-status .right { display: flex; gap: 8px; align-items: center; }
.p-status .sim-tag { font-size: 9.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #ffcf8f; background: rgba(242,163,58,.14); border: 1px solid rgba(242,163,58,.35); padding: 2px 6px; border-radius: 6px; }
.p-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 12px 12px; scrollbar-width: none; }
.p-body::-webkit-scrollbar { display: none; }
.p-view[hidden] { display: none !important; }
.p-head { display: flex; align-items: center; gap: 10px; padding: 8px 2px 12px; }
.p-head h3 { font: 600 16px var(--font); margin: 0; letter-spacing: -.01em; }
.p-head .app-ic { width: 26px; height: 26px; border-radius: 8px; background: rgba(242,163,58,.16); color: var(--p-amber); display: grid; place-items: center; }
.p-head .app-ic svg { width: 16px; height: 16px; }
.p-chip { margin-left: auto; font-size: 10.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: rgba(76,195,138,.14); color: #7fe0ae; }
.p-chip.wait { background: rgba(255,255,255,.08); color: #c5ced8; }
.p-chip.run { background: rgba(242,163,58,.16); color: #ffc272; }
.p-title { font: 600 19px var(--font); margin: 8px 2px 14px; }
.p-card { background: var(--p-card); border-radius: 16px; padding: 12px 14px; margin-bottom: 9px; }
.p-label { color: var(--p-muted); font-size: 11.5px; }
.p-hint { color: var(--p-muted); font-size: 10.5px; text-align: center; margin-top: 4px; }
.temp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0 2px; }
.temp-val { font: 600 40px/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.round { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--p-card-2); color: var(--p-text); font: 500 20px/1 var(--font); cursor: pointer; display: grid; place-items: center; flex: none; }
.round:hover { background: #24303c; }
.round.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }
.plan-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; }
.plan-row { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.seg { border: 1px solid var(--p-line); background: var(--p-card-2); color: var(--p-text); border-radius: 10px; height: 34px; min-width: 46px; padding: 0 10px; font: 600 12.5px var(--font); cursor: pointer; white-space: nowrap; }
.seg[aria-pressed="true"] { border-color: var(--p-amber); color: var(--p-amber); background: rgba(242,163,58,.1); }
.time-val { font: 600 20px/1 var(--display); min-width: 3.1em; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan-line { color: var(--p-muted); font-size: 11px; margin-top: 8px; }
.big-pct { font: 600 26px/1.1 var(--display); margin: 2px 0; font-variant-numeric: tabular-nums; }
.row-link { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: 0; color: #c8d0d9; font: 500 11.5px var(--font); padding: 10px 4px; cursor: pointer; text-align: left; }
.p-btn { display: block; width: 100%; border: 0; border-radius: 14px; height: 46px; font: 700 13px var(--font); letter-spacing: .04em; cursor: pointer; margin-top: 6px; }
.p-btn.start { background: var(--p-amber); color: #1c1203; }
.p-btn.start:hover { background: #f6b65d; }
.p-btn.stop { background: var(--p-red); color: #fff; }
.p-btn.stop:hover { background: #c9353a; }
.p-btn.dark { background: var(--p-card-2); color: var(--p-text); border: 1px solid var(--p-line); font-weight: 600; letter-spacing: 0; }
.run-top { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.run-top .right { text-align: right; }
.run-top .t-big { font: 600 34px/1 var(--display); font-variant-numeric: tabular-nums; }
.run-top .t-mid { font: 600 20px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.cycle { margin-top: 12px; }
.cycle-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--p-muted); gap: 8px; }
.cycle-head b { color: var(--p-text); font-weight: 600; text-align: right; }
.bar { height: 4px; border-radius: 4px; background: #252e39; margin: 7px 0 8px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0%; background: var(--p-amber); border-radius: 4px; transition: width .25s linear; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 9px; }
.mini-grid .p-card { margin: 0; min-height: 74px; }
.mini-val { font: 600 20px/1.2 var(--display); margin-top: 6px; font-variant-numeric: tabular-nums; }
.mini-sub { font-size: 10px; color: var(--p-muted); margin-top: 2px; }
.p-note { font-size: 11px; color: var(--p-amber); margin: 4px 2px 8px; display: flex; gap: 6px; }
.p-note.err { color: #ff8a8a; }
.p-note.ok { color: #82dfae; }
.animal-banner { border: 1px solid rgba(242,163,58,.4); background: rgba(242,163,58,.08); border-radius: 12px; padding: 9px 11px; font-size: 11px; color: #ffd8a3; margin-bottom: 8px; }

/* bottom nav */
.p-nav { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--p-line); background: #0d1218; padding: 6px 4px 14px; flex: none; }
.p-nav button { background: none; border: 0; color: #8b96a3; font: 500 10.5px var(--font); display: grid; justify-items: center; gap: 3px; padding: 6px 0; cursor: pointer; border-radius: 10px; }
.p-nav button svg { width: 20px; height: 20px; }
.p-nav button[aria-selected="true"] { color: var(--p-amber); font-weight: 600; }

/* settings */
.set-group { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--p-muted); margin: 14px 4px 6px; text-transform: uppercase; }
.set-card { background: var(--p-card); border-radius: 16px; overflow: hidden; }
.set-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--p-line); }
.set-row:last-child { border-bottom: 0; }
.set-row b { font-weight: 500; font-size: 13px; display: block; }
.set-row small { color: var(--p-muted); font-size: 10.5px; display: block; margin-top: 2px; line-height: 1.35; }
.set-row .val { font-size: 11.5px; font-weight: 600; color: #7fe0ae; }
.set-row .val.amber { color: var(--p-amber); }
.switch { width: 40px; height: 24px; border-radius: 999px; background: #39434f; border: 0; position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #c9d1da; transition: transform .2s, background .2s; }
.switch[aria-checked="true"] { background: rgba(242,163,58,.35); }
.switch[aria-checked="true"]::after { transform: translateX(16px); background: var(--p-amber); }
.km-row { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 4px 0 12px; }
.km-row .time-val { font-size: 19px; min-width: 4.2em; }
.sim-btn { width: 100%; text-align: left; background: none; border: 0; color: var(--p-text); font: 500 12.5px var(--font); cursor: pointer; padding: 0; }
.p-foot { color: var(--p-muted); font-size: 10px; text-align: center; margin: 12px 6px 4px; }

/* stats */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 9px; }
.tiles .p-card { margin: 0; padding: 10px 11px; }
.tiles b { font: 600 18px/1.1 var(--display); display: block; font-variant-numeric: tabular-nums; }
.tiles span { font-size: 10px; color: var(--p-muted); }
.chart svg { width: 100%; height: auto; display: block; }
.chart .ax { stroke: #2a3440; stroke-width: 1; }
.chart .ln { stroke: #7a8ca3; stroke-width: 1.5; fill: none; }
.chart text { fill: #7e8996; font-size: 8px; font-family: var(--font); }
.sess { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; }
.sess b { font-size: 12px; }
.sess .pct { font: 600 15px var(--display); text-align: right; }
.sess small { color: var(--p-muted); font-size: 10.5px; }
.src-tag { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 5px; margin-top: 4px; }
.src-tag.real { background: rgba(122,167,255,.14); color: #a9c3ff; }
.src-tag.sim { background: rgba(242,163,58,.14); color: #ffc272; }

/* night screen */
.night { position: absolute; inset: 0; background: #000; z-index: 4; display: flex; flex-direction: column; padding: 70px 22px 28px; color: #aab4c0; cursor: pointer; }
.night[hidden] { display: none; }
.night .clock { font: 300 68px/1 var(--display); text-align: center; color: #c9d1da; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.night .nstat { text-align: center; font-size: 11.5px; margin-top: 14px; min-height: 2.6em; }
.night .rows { margin-top: 40px; border-top: 1px solid #1a2028; }
.night .rows div { display: flex; justify-content: space-between; padding: 12px 2px; border-bottom: 1px solid #1a2028; font-size: 12px; }
.night .spacer { flex: 1; }
.night .nhint { font-size: 10.5px; text-align: center; color: #6e7884; margin-bottom: 10px; }
.night .p-btn.ghost { background: transparent; border: 1px solid #3a2224; color: #e06a6f; }

/* dialog inside phone */
.p-dialog { position: absolute; inset: 0; background: rgba(0,0,0,.6); z-index: 6; display: grid; place-items: center; padding: 18px; }
.p-dialog[hidden] { display: none; }
.p-dialog .box { background: #1a212a; border-radius: 20px; padding: 18px; max-height: 92%; overflow-y: auto; }
.p-dialog h4 { font: 600 15px var(--font); margin: 0 0 10px; }
.p-dialog p { font-size: 12px; color: #c3ccd6; margin: 0 0 10px; }
.p-dialog .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.p-dialog .acts button { border: 0; border-radius: 10px; padding: 10px 12px; font: 700 11.5px var(--font); cursor: pointer; background: transparent; color: #c3ccd6; }
.p-dialog .acts .primary { background: var(--p-amber); color: #1c1203; }

/* ---------- control panel ---------- */
.demo-panel { display: grid; gap: 16px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; min-width: 0; }
.panel h3 { font-size: 1.05rem; margin-bottom: 4px; }
.panel .muted { font-size: .9rem; }
.overnight { display: grid; gap: 14px; }
.overnight .btn { width: 100%; min-height: 54px; font-size: 1.02rem; }
.speed { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.speed span { color: var(--muted); font-size: .85rem; margin-right: 4px; }
.chip { border: 1px solid var(--line-2); background: transparent; color: var(--muted); border-radius: 999px; padding: 0 14px; min-height: 36px; font: 500 .85rem var(--font); cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); background: rgba(242,163,58,.08); }
.chip:hover { color: var(--text); }
.readouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.readouts div { background: var(--bg-2); padding: 12px 14px; min-width: 0; }
.readouts dt { font-size: .72rem; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; }
.readouts dd { margin: 4px 0 0; font: 600 1.15rem var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readouts dd small { font: 400 .78rem var(--font); color: var(--muted); }
@media (max-width: 1100px) { .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.climate-on { color: var(--green); }
.climate-off { color: var(--muted); }
.tl { position: relative; height: 38px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; margin-top: 4px; }
.tl .night-band { position: absolute; top: 0; bottom: 0; background: rgba(122,167,255,.09); border-left: 1px dashed rgba(122,167,255,.35); border-right: 1px dashed rgba(122,167,255,.35); }
.tl .prog { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, rgba(242,163,58,.05), rgba(242,163,58,.16)); border-right: 2px solid var(--amber); }
.tl .tick { position: absolute; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--green); }
.tl .tick.fail { background: #ff6b6b; top: 5px; bottom: 5px; }
.tl .tick.off { background: #8b96a3; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--faint); margin-top: 8px; }
.tl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tl-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--faint); margin-top: 4px; font-variant-numeric: tabular-nums; }
.log-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.log { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: #080b0f; font-size: .82rem; }
.log li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; padding: 7px 12px; border-bottom: 1px solid rgba(255,255,255,.04); }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--faint); font-family: var(--mono); font-size: .78rem; padding-top: 1px; }
.log .msg { color: #c6ced8; min-width: 0; overflow-wrap: anywhere; }
.log code { font-family: var(--mono); font-size: .7rem; padding: 1px 6px; border-radius: 5px; margin-right: 6px; background: rgba(255,255,255,.06); color: var(--muted); }
.log li.ok code { background: rgba(76,195,138,.14); color: #7fe0ae; }
.log li.warn code { background: rgba(232,176,74,.14); color: #f3c66f; }
.log li.err code { background: rgba(255,107,107,.15); color: #ff9b9b; }
.log li.car code { background: rgba(122,167,255,.15); color: #a9c3ff; }
.log li.sim code { background: rgba(200,140,255,.15); color: #d7b3ff; }
.log li.empty-row { display: block; }
.log .empty { display: block; padding: 18px; color: var(--faint); }
.summary { border: 1px solid rgba(76,195,138,.35); background: rgba(76,195,138,.06); border-radius: 14px; padding: 16px 18px; }
.summary[hidden] { display: none; }
.summary h4 { margin: 0 0 8px; font-size: 1rem; }
.summary ul { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: .9rem; display: grid; gap: 3px; }
.fault-row { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-foot { margin-top: 18px; color: var(--faint); font-size: .85rem; max-width: 80ch; }
