html { -webkit-text-size-adjust: 100%; }
:root { padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
/* Layout: one-column phone cockpit, sticky header, cards per section, fixed bottom tab bar. Single dark look by choice. */
:root {
  --bg: #0a0d11; --card: #13171d; --line: #222831; --txt: #eef1f4; --mut: #8b939e;
  --strain: #1f9bff; --ok: #2fe06b;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: Inter, system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--txt); font: 15px/1.45 var(--body); padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.wrap { max-width: 720px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
header .wrap { padding-block: 14px 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#hTitle { font: 700 30px/1 var(--display); text-transform: uppercase; letter-spacing: .5px; margin: 0; }
#hDate { color: var(--mut); font-size: 13px; }
main .wrap { padding-block: 16px; }
section { display: none; flex-direction: column; gap: 14px; }
section.on { display: flex; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; }
.card > h2 { margin: 0 0 12px; font: 600 11px var(--body); letter-spacing: 1.5px; text-transform: uppercase; color: var(--mut); }
.num { font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; }
.mut { color: var(--mut); font-size: 13px; }
p.mut { margin: 0; }

.rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ring { text-align: center; min-width: 0; }
.ringwrap { position: relative; width: 100%; max-width: 120px; margin: 0 auto; aspect-ratio: 1; }
.ringwrap svg { width: 100%; height: 100%; display: block; }
.val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.val b { font: 700 28px/1 var(--display); font-variant-numeric: tabular-nums; }
.val small { color: var(--mut); font-size: 11px; margin-top: 2px; }
.lbl { margin-top: 6px; font: 600 11px var(--body); letter-spacing: 1.2px; text-transform: uppercase; color: var(--mut); }
.live .ringwrap { max-width: 200px; }
.live .val b { font-size: 54px; }
#strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 16px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 14px; }
.tile { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 11px; color: var(--mut); text-transform: uppercase; letter-spacing: .8px; min-width: 0; }
.tile b { display: block; color: var(--txt); font: 600 22px/1.15 var(--display); letter-spacing: 0; text-transform: none; margin-top: 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.hbar { margin-bottom: 12px; }
.hbar .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.hbar .tr, .zb { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.hbar .tr i, .zb i { display: block; height: 100%; border-radius: 4px; }
.zrow { display: grid; grid-template-columns: 34px 1fr 64px; gap: 10px; align-items: center; margin-bottom: 10px; }
.zlab { font: 700 12px var(--body); color: #0a0d11; border-radius: 6px; text-align: center; padding: 4px 0; }
.zbar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); }
.zbar i { display: block; height: 100%; }

.act { display: flex; gap: 12px; align-items: center; padding: 12px; margin-top: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.act:hover { border-color: #3a4350; }
.ico { width: 42px; height: 42px; flex: none; display: grid; place-items: center; font-size: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 50%; }
.act .main { flex: 1; min-width: 0; }
.act .t { font-weight: 600; }
.act .s { color: var(--mut); font-size: 13px; overflow-wrap: anywhere; }
.act .r { text-align: right; }
.act .r b { display: block; font: 700 26px/1 var(--display); color: var(--strain); }
.act .r span { font-size: 10px; color: var(--mut); text-transform: uppercase; letter-spacing: 1px; }
.badge { display: inline-block; margin: 8px 6px 0 0; padding: 2px 8px; border-radius: 999px; font: 600 11px var(--body); color: #0a0d11; }
.dayhead { margin: 18px 0 0; font: 600 11px var(--body); letter-spacing: 1.2px; text-transform: uppercase; color: var(--mut); }
.dayhead:first-child { margin-top: 0; }
.item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item > div { min-width: 0; }

.form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.form .full { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--mut); min-width: 0; }
input, select, textarea { width: 100%; background: var(--bg); color: var(--txt); border: 1px solid var(--line); border-radius: 9px; padding: 10px; font: 15px var(--body); }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--strain); outline-offset: 1px; }
button { font: 600 14px var(--body); border: 0; border-radius: 10px; padding: 11px 16px; cursor: pointer; background: var(--strain); color: #fff; }
button.ghost { background: transparent; color: var(--txt); border: 1px solid var(--line); padding: 7px 12px; }
button.ghost:hover { border-color: #3a4350; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { background: var(--bg); color: var(--mut); border: 1px solid var(--line); padding: 7px 14px; }
.seg button.on { background: var(--strain); color: #fff; border-color: var(--strain); }
.msg { font-size: 13px; color: var(--ok); margin-top: 8px; min-height: 1em; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

#slBars { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-bottom: 20px; }
#slBars > div { flex: 1; border-radius: 6px 6px 0 0; position: relative; min-height: 4px; }
#slBars span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--mut); }

.vwrap { position: relative; background: #000; border-radius: 10px; overflow: hidden; }
.vstage { position: relative; margin: 0 auto; transform-origin: 0 0; max-width: 100%; }
.vwrap video { display: block; width: 100%; height: 100%; }
.vbadge { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.65); color: #fff; font: 600 12px var(--body); padding: 4px 8px; border-radius: 6px; pointer-events: none; }
.jog { margin-top: 8px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background-color: var(--bg); background-image: repeating-linear-gradient(90deg, #2f3742 0 2px, transparent 2px 14px); display: grid; place-items: center; cursor: ew-resize; touch-action: none; user-select: none; }
.jog span { background: var(--bg); padding: 2px 10px; border-radius: 6px; font-size: 12px; color: var(--mut); }
button.ghost.on { background: var(--strain); border-color: var(--strain); color: #fff; }
#vCan { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#vSeek { padding: 0; accent-color: var(--strain); }

#sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.6); display: none; align-items: flex-end; justify-content: center; }
#sheet.on { display: flex; }
#sheetIn { background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; width: 100%; max-width: 720px; max-height: 88vh; overflow-y: auto; padding: 12px max(16px, env(safe-area-inset-left, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)); }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); }
.tabbar .in { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.tabbar button { background: none; color: var(--mut); padding: 6px 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font: 500 10px var(--body); border-radius: 8px; min-width: 0; }
.tabbar button span { font-size: 18px; line-height: 1; filter: grayscale(1) opacity(.7); }
.tabbar button.on { color: var(--txt); background: var(--bg); }
.tabbar button.on span { filter: none; }
.demo { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px dashed #3a4350; border-radius: 12px; padding: 12px 14px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font: 600 11px var(--body); color: #0a0d11; white-space: nowrap; }
.phrow, .bodyrow { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bodyrow { grid-template-columns: 1fr 90px auto; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.bv { text-align: right; } .bv .num { font-size: 24px; } .bv small { color: var(--mut); margin-left: 3px; font-size: 12px; } .bv .chip { display: block; margin-top: 4px; text-align: center; }
.tl { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: center; margin-bottom: 5px; font-size: 11px; color: var(--mut); }
.tt { position: relative; height: 12px; background: var(--bg); border-radius: 6px; }
.tt i { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: #8fb3d1; }
.tlax { position: relative; height: 14px; margin: 4px 0 0 52px; font-size: 10px; color: var(--mut); }
.tlax span { position: absolute; transform: translateX(-50%); }
.sub { margin: 18px 0 8px; font: 600 11px var(--body); letter-spacing: 1.2px; text-transform: uppercase; color: var(--mut); }
.cks { display: flex; flex-wrap: wrap; gap: 8px; }
label.ck { flex-direction: row; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--txt); cursor: pointer; }
.ck input { width: auto; margin: 0; accent-color: var(--strain); }
.need { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 14px; }
.need b { text-align: right; font-variant-numeric: tabular-nums; }
.tip { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tip i { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.thumbs img { height: 72px; border-radius: 8px; border: 1px solid var(--line); }
.found { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 14px; margin-top: 12px; font-size: 13px; }
.found span { color: var(--mut); } .found b { color: var(--txt); font-variant-numeric: tabular-nums; }
.tblwrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; }
.tblwrap table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.tblwrap th, .tblwrap td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tblwrap th { font: 600 10px var(--body); letter-spacing: 1px; text-transform: uppercase; color: var(--mut); background: var(--card); }
.tblwrap th:first-child, .tblwrap td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; border-right: 1px solid var(--line); }
.tblwrap td b { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.tblwrap td small { font-size: 11px; font-variant-numeric: tabular-nums; }
.tblwrap tfoot td { border-top: 2px solid var(--line); border-bottom: 0; }
.tblwrap tbody tr:last-child td { border-bottom: 0; }
.up { color: #2fe06b; } .dn { color: #ff3b4f; } .eq { color: var(--mut); }
#slBars { padding-top: 18px; height: 160px; }
#slBars > div { display: flex; flex-direction: column-reverse; background: none !important; }
#slBars em { display: block; width: 100%; }
#slBars em:last-child { border-radius: 6px 6px 0 0; }
#slBars b { position: absolute; top: -16px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--mut); font-weight: 500; }
@media (max-width: 420px) { .val b { font-size: 22px; } .form { grid-template-columns: 1fr; } .bodyrow { grid-template-columns: 1fr auto; } .bodyrow svg { display: none; } }
.form.c3 { grid-template-columns: repeat(3, 1fr); }
.form.auto { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.auth { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: grid; place-items: center; overflow-y: auto;
  padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.authbox { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.or { text-align: center; color: var(--mut); font-size: 12px; }
button.link { background: none; color: var(--mut); padding: 4px 0; text-decoration: underline; font-weight: 500; align-self: flex-start; }
