/* Sentinel PTZ — light, calm, Apple-style. All colours live here as tokens. */
:root {
  --bg: #F4F6FB;
  --card: #FFFFFF;
  --ink: #0B1220;
  --ink-2: #4A5468;
  --ink-3: #8A93A6;
  --line: #E6EAF2;
  --blue: #1662F0;
  --blue-2: #3D82FF;
  --blue-soft: #E6EEFF;
  --green: #18B04A;
  --green-soft: #E5F7EB;
  --red: #EF3B36;
  --red-soft: #FDECEC;
  --orange: #FF9500;
  --purple: #8E5CF7;
  --teal: #12A3B5;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(30, 50, 90, .08);
  --shadow-lg: 0 20px 50px rgba(20, 30, 60, .22);
  --glass: rgba(18, 22, 30, .58);
  --r-lg: 22px;
  --r-md: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select { font: inherit; }
svg.ic { width: 22px; height: 22px; flex: none; display: block; }
.muted { color: var(--ink-3); }
.accent { color: var(--blue); }
b { font-weight: 650; }

/* ---------------- frame: phone width, centred on big screens ---------------- */
#app { position: relative; max-width: 480px; margin: 0 auto; min-height: 100dvh; overflow-x: hidden; }
main { position: relative; z-index: 1; padding: calc(var(--safe-t) + 18px) 16px calc(96px + var(--safe-b)); }
.wave { position: absolute; top: 0; right: 0; width: 100%; height: 230px; z-index: 0; pointer-events: none; }

/* ---------------- header ---------------- */
.top { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 46px; height: 46px; flex: none; }
.logo.big { width: 84px; height: 84px; margin: 0 auto 14px; }
.logo svg { width: 100%; height: 100%; display: block; }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: -.3px; line-height: 1.1; }
.brand-sub { font-size: 15px; color: var(--ink-2); margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.icon-btn svg.ic { width: 26px; height: 26px; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue-2); box-shadow: 0 0 0 2px var(--bg); }
.icon-btn.soft { background: var(--blue-soft); color: var(--blue); width: 38px; height: 38px; }
.icon-btn.soft svg.ic { width: 18px; height: 18px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--blue); background: radial-gradient(circle at 30% 25%, #fff, #E4ECFF 70%); box-shadow: 0 6px 18px rgba(40, 90, 200, .18), inset 0 0 0 1px rgba(255,255,255,.8); }
.avatar svg.ic { width: 28px; height: 28px; }

.greet { font-size: 28px; font-weight: 600; letter-spacing: -.5px; margin: 20px 0 6px; line-height: 1.15; }
.secure { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--ink-2); }
.shield svg.ic { width: 24px; height: 24px; }
.secure.warn { color: #B26A00; } .secure.bad { color: var(--red); } .secure.paused { color: var(--ink-3); }

/* ---------------- 3 status cards ---------------- */
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 22px 0 18px; }
.stat { display: flex; align-items: center; gap: 9px; text-align: left; background: rgba(255,255,255,.86); border-radius: var(--r-md); padding: 13px 10px; box-shadow: var(--shadow); min-width: 0; transition: transform .15s; }
.stat:active { transform: scale(.97); }
.stat b { display: block; font-size: 15px; font-weight: 650; white-space: nowrap; letter-spacing: -.2px; }
.stat small { display: flex; align-items: center; gap: 5px; font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.stat > span:last-child { min-width: 0; }
.stat-ic { flex: none; }
.stat-ic svg.ic { width: 30px; height: 30px; }
.stat-ic.green { color: var(--green); } .stat-ic.blue { color: #3C5BEB; }
.stat-ic.rec { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--red); }
.stat-ic.rec.off { border-color: var(--ink-3); }
.stat-ic.rec.live { box-shadow: 0 0 0 0 rgba(239,59,54,.5); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(239,59,54,0); } 100% { box-shadow: 0 0 0 0 rgba(239,59,54,0); } }
.led { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: var(--ink-3); }
.led.on { background: var(--green); } .led.off { background: #B8BFCC; } .led.red { background: var(--red); }

/* ---------------- segmented control ---------------- */
.seg { position: relative; display: flex; align-items: center; background: rgba(255,255,255,.9); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); margin-bottom: 20px; }
.seg-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 999px; font-size: 16.5px; font-weight: 500; color: var(--ink); transition: background .2s, color .2s; white-space: nowrap; }
.seg-btn svg.ic { width: 22px; height: 22px; }
.seg-btn.active { background: linear-gradient(180deg, #2A74FF, #1259E8); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(22, 98, 240, .35); }
.seg-sep { width: 1px; height: 24px; background: var(--line); }
.seg-btn.active + .seg-sep, .seg-sep:has(+ .seg-btn.active) { visibility: hidden; }
.seg.small { padding: 3px; margin: 8px 0 0; box-shadow: none; background: #EEF1F7; }
.seg.small button { flex: 1; height: 34px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.seg.small button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(20,30,60,.12); font-weight: 600; }

/* ---------------- camera cards ---------------- */
.cam { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #0c0f16; box-shadow: var(--shadow); margin-bottom: 18px; aspect-ratio: 16 / 9.4; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.cam-media, .cam-media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cam-media img { object-fit: cover; display: block; }
.cam-loading { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; color: #c9d2e3; font-size: 14px; background: radial-gradient(circle at 50% 40%, #1d2436, #0b0e15); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: #fff; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pill-name { position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: #fff; font-size: 15px; font-weight: 600; letter-spacing: -.1px; }
.pill-name .led { width: 11px; height: 11px; box-shadow: 0 0 0 2px rgba(255,255,255,.12); }
.pill-live { position: absolute; top: 10px; right: 10px; display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #fff; color: var(--red); font-size: 14px; font-weight: 700; letter-spacing: .3px; box-shadow: 0 0 0 1.5px rgba(239,59,54,.55), 0 4px 10px rgba(0,0,0,.18); }
.pill-live i { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: blink 1.4s infinite; }
.pill-live.off { color: var(--ink-3); box-shadow: 0 0 0 1.5px rgba(0,0,0,.1); } .pill-live.off i { background: var(--ink-3); animation: none; }
.pill-live.sm { font-size: 11px; padding: 3px 8px; top: 8px; right: 8px; }
@keyframes blink { 50% { opacity: .35; } }

.zoomcap { position: absolute; right: 10px; top: 50%; transform: translateY(-62%); width: 42px; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 999px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: #fff; transition: opacity .2s; }
.zoomcap button { width: 42px; height: 34px; display: grid; place-items: center; }
.zoomcap svg.ic { width: 22px; height: 22px; }
.zoomcap span#zoom-val { font-size: 13px; font-weight: 600; padding: 2px 0; }
.zoomcap.hide { opacity: 0; pointer-events: none; }

.toolbar { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 58px; display: flex; align-items: center; padding-left: 82px; padding-right: 6px; border-radius: 20px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: #fff; }
.tb-sep { width: 1px; height: 30px; background: rgba(255,255,255,.22); margin: 0 4px; }
.tb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 13px; font-weight: 500; height: 100%; justify-content: center; position: relative; color: #E8ECF5; }
.tb svg.ic { width: 24px; height: 24px; }
.tb.active { color: #4F95FF; }
.tb.active::after { content: ""; position: absolute; bottom: 0; left: 22%; right: 22%; height: 3px; border-radius: 3px; background: #3D82FF; box-shadow: 0 -4px 14px 2px rgba(61,130,255,.6); }
.tb-fs { flex: .7; }
.tb-fs svg.ic { width: 26px; height: 26px; }

/* joystick */
.joy { position: absolute; left: -4px; bottom: -6px; width: 84px; height: 84px; border-radius: 50%; background: rgba(20, 24, 33, .55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 2.5px rgba(255,255,255,.9), 0 6px 18px rgba(0,0,0,.3); touch-action: none; transition: opacity .2s, transform .2s; }
.joy.hide { opacity: 0; transform: scale(.7); pointer-events: none; }
.knob { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .15s; }
.knob.drag { transition: none; }
.joy-a { position: absolute; width: 26px; height: 26px; display: grid; place-items: center; color: #fff; }
.joy-a svg.ic { width: 17px; height: 17px; stroke-width: 2.6; }
.joy-a.up { top: 3px; left: 29px; } .joy-a.down { bottom: 3px; left: 29px; } .joy-a.left { left: 3px; top: 29px; } .joy-a.right { right: 3px; top: 29px; }

/* camera 2: add camera */
.cam.add { background: linear-gradient(160deg, #EAF0FB, #DCE5F5); }
.add-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(30,70,160,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(30,70,160,.06) 1px, transparent 1px); background-size: 28px 28px; mask-image: radial-gradient(circle at 50% 55%, #000 30%, transparent 85%); -webkit-mask-image: radial-gradient(circle at 50% 55%, #000 30%, transparent 85%); }
.cam.add .pill-name { background: rgba(255,255,255,.78); color: var(--ink-2); }
.add-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; padding: 26px 64px 10px; }
.add-center b { font-size: 17px; margin-top: 10px; } .add-center small { font-size: 13.5px; color: var(--ink-2); }
.add-plus { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, #2A74FF, #1259E8); box-shadow: 0 0 0 8px rgba(22,98,240,.12), 0 10px 22px rgba(22,98,240,.35); transition: transform .15s; }
.add-plus:active { transform: scale(.94); }
.add-plus svg.ic { width: 30px; height: 30px; stroke-width: 2.4; }
.add-plus.sm { width: 42px; height: 42px; box-shadow: 0 0 0 5px rgba(22,98,240,.1); }
.add-plus.sm svg.ic { width: 22px; height: 22px; }
.add-fs { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.6); color: #9AA5BA; }

/* full screen live view (iPhone fallback = fixed layer) */
.cam.fs { position: fixed; inset: 0; z-index: 50; border-radius: 0; margin: 0; aspect-ratio: auto; width: 100vw; height: 100dvh; }
.cam.fs .cam-media img { object-fit: contain; }
.cam:fullscreen { border-radius: 0; aspect-ratio: auto; }
.cam:fullscreen .cam-media img { object-fit: contain; }

/* ---------------- cards, lists ---------------- */
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card-h, .list-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.card-h b, .list-h b { font-size: 17px; }
.list-h { margin: 6px 4px 10px; }
.link { color: var(--blue); font-size: 15px; font-weight: 500; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 15px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); font-size: 14.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.chip small { color: var(--ink-3); margin-left: 6px; font-weight: 500; }
.chip.active { background: var(--ink); color: #fff; } .chip.active small { color: #AEB6C6; }

.tl { position: relative; height: 54px; border-radius: 12px; background: repeating-linear-gradient(90deg, #F1F4FA 0, #F1F4FA calc(100% / 24 - 1px), #E3E8F1 calc(100% / 24 - 1px), #E3E8F1 calc(100% / 24)); overflow: hidden; }
.tl-track { position: absolute; inset: 0; }
.tl-mark { position: absolute; top: 8px; bottom: 8px; min-width: 4px; border-radius: 3px; background: linear-gradient(180deg, #3D82FF, #1662F0); box-shadow: 0 2px 6px rgba(22,98,240,.35); }
.tl-mark:hover, .tl-mark:active { background: var(--orange); }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); }
.tl-now::before { content: ""; position: absolute; top: -1px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.tl-hours { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 6px; padding: 0 2px; font-variant-numeric: tabular-nums; }

.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px; background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow); text-align: left; width: 100%; transition: transform .12s; }
.row:active { transform: scale(.985); }
.thumb { position: relative; width: 112px; aspect-ratio: 16/9; border-radius: 11px; overflow: hidden; flex: none; background: #DDE3EE; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .dur { position: absolute; right: 5px; bottom: 5px; padding: 1px 6px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; opacity: .9; }
.thumb .play svg.ic { width: 26px; height: 26px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.row-main small { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }
.badge { padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--blue-soft); color: var(--blue); letter-spacing: .2px; }
.chev { color: #C2C8D3; } .chev svg.ic { width: 20px; height: 20px; }
.empty { text-align: center; padding: 34px 20px; color: var(--ink-3); font-size: 15px; background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow); }
.empty svg.ic { width: 34px; height: 34px; margin: 0 auto 10px; color: #C2CBDB; }

/* daily summary */
.summary { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 18px; margin-bottom: 18px; color: #fff; background: radial-gradient(circle at 100% 0, #5C96FF 0, transparent 55%), linear-gradient(150deg, #1A5CE8, #0E3FB8); box-shadow: 0 14px 30px rgba(22, 80, 220, .3); }
.sum-top { display: flex; justify-content: space-between; align-items: flex-start; }
.sum-top small { font-size: 14px; opacity: .85; font-weight: 500; }
.sum-big { font-size: 46px; font-weight: 700; letter-spacing: -1.5px; line-height: 1; margin-top: 6px; }
.sum-big span { font-size: 17px; font-weight: 500; letter-spacing: 0; opacity: .9; margin-left: 6px; }
.sum-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 12px; }
.sum-chips span { padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.16); font-size: 13px; font-weight: 500; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 64px; }
.bars i { flex: 1; border-radius: 3px 3px 1px 1px; background: rgba(255,255,255,.28); min-height: 3px; }
.bars i.hot { background: #fff; }
.bars-x { display: flex; justify-content: space-between; font-size: 11px; opacity: .75; margin-top: 5px; }
.sum-text { font-size: 14px; line-height: 1.45; opacity: .95; margin: 12px 0 0; }

/* ---------------- other pages ---------------- */
h1.large { font-size: 34px; font-weight: 700; letter-spacing: -.8px; margin: 8px 0 2px; }
.sub-title { margin: 0 0 18px; font-size: 15px; }
.cam-detail { padding: 0; overflow: hidden; }
.cd-media { position: relative; aspect-ratio: 16/9; background: #0c0f16; }
.cd-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cd-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px; }
.cd-head b { font-size: 18px; } .cd-head small { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; margin-top: 3px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); margin: 8px 16px; border-radius: 14px; overflow: hidden; }
.kv div { background: #F8FAFD; padding: 10px 12px; }
.kv small { display: block; font-size: 12px; color: var(--ink-3); } .kv b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.row-btns { display: flex; gap: 10px; padding: 8px 16px 16px; }
.add-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; }
.add-row > span:nth-child(2) { flex: 1; } .add-row b { display: block; font-size: 16px; } .add-row small { font-size: 13.5px; }

.ring-card { display: flex; align-items: center; gap: 18px; position: relative; }
.ring { width: 128px; height: 128px; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 13; stroke-linecap: round; }
.ring-bg { stroke: #EDF1F7; } .ring-sys { stroke: #C7D2E6; } .ring-rec { stroke: var(--blue); }
.ring-txt { position: absolute; left: 16px; width: 128px; text-align: center; }
.ring-txt b { display: block; font-size: 22px; letter-spacing: -.5px; } .ring-txt small { color: var(--ink-3); font-size: 13px; }
.legend { display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--ink-2); }
.legend div { display: flex; align-items: center; gap: 8px; } .legend b { color: var(--ink); margin-left: auto; padding-left: 8px; }
.sw { width: 10px; height: 10px; border-radius: 3px; } .sw.rec { background: var(--blue); } .sw.sys { background: #C7D2E6; } .sw.free { background: #EDF1F7; box-shadow: inset 0 0 0 1px #DCE2EC; }
.group-h { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); margin: 22px 6px 8px; }
.hint { font-size: 13px; color: var(--ink-3); margin: 10px 6px 0; line-height: 1.4; }
.day-size { font-size: 13.5px; color: var(--ink-2); }
.icon-del { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--red); background: var(--red-soft); }
.icon-del svg.ic { width: 18px; height: 18px; }

.group { background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }
.cell { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 14px; text-align: left; font-size: 16px; position: relative; }
.cell + .cell::before { content: ""; position: absolute; top: 0; left: 56px; right: 0; height: 1px; background: var(--line); }
.cell > span:nth-child(2) { flex: 1; }
.cell em { font-style: normal; color: var(--ink-3); font-size: 15px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell.col { flex-direction: column; align-items: stretch; padding-bottom: 12px; }
.cell-row { display: flex; align-items: center; gap: 12px; }
.cell.danger { color: var(--red); }
.cell-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.cell-ic svg.ic { width: 18px; height: 18px; }
.cell-ic.blue { background: var(--blue); } .cell-ic.green { background: var(--green); } .cell-ic.red { background: var(--red); }
.cell-ic.orange { background: var(--orange); } .cell-ic.purple { background: var(--purple); } .cell-ic.teal { background: var(--teal); } .cell-ic.gray { background: #8E8E93; }
.switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 999px; background: #E2E5EA; position: relative; transition: background .2s; flex: none; cursor: pointer; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.1); transition: transform .2s; }
.switch:checked { background: #34C759; } .switch:checked::after { transform: translateX(20px); }
.time-in { border: 0; background: #EEF1F7; border-radius: 9px; padding: 6px 10px; font-size: 16px; color: var(--ink); }
.foot { text-align: center; color: var(--ink-3); font-size: 12.5px; margin: 26px 0 0; }

/* ---------------- buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 14px; font-weight: 600; font-size: 16px; flex: 1; }
.btn svg.ic { width: 20px; height: 20px; }
.btn.primary { background: linear-gradient(180deg, #2A74FF, #1259E8); color: #fff; box-shadow: 0 8px 18px rgba(22,98,240,.3); }
.btn.soft { background: var(--blue-soft); color: var(--blue); }
.btn.gray { background: #EEF1F7; color: var(--ink); }
.btn.danger { background: var(--red); color: #fff; }
.btn.dark { background: rgba(255,255,255,.1); color: #fff; height: 40px; flex: none; font-size: 14px; padding: 0 14px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; }

/* ---------------- tab bar ---------------- */
.tabbar { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; display: flex; gap: 6px; padding: 10px 14px calc(10px + var(--safe-b)); background: rgba(255,255,255,.88); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); border-top: 1px solid rgba(0,0,0,.04); border-radius: 26px 26px 0 0; box-shadow: 0 -8px 30px rgba(20,30,60,.06); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 7px; border-radius: 18px; font-size: 13px; font-weight: 500; color: var(--ink-2); transition: background .2s, color .2s; }
.tab svg.ic { width: 27px; height: 27px; }
.tab.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }

/* ---------------- sheet + backdrop ---------------- */
.backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(10, 15, 30, .38); animation: fade .2s; }
.sheet { position: fixed; z-index: 61; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; max-height: 86dvh; overflow-y: auto; background: var(--bg); border-radius: 26px 26px 0 0; padding: 8px 18px calc(22px + var(--safe-b)); box-shadow: var(--shadow-lg); animation: up .28s cubic-bezier(.2,.9,.3,1.1); }
.grab { width: 38px; height: 5px; border-radius: 3px; background: #D3D8E2; margin: 0 auto 14px; }
.sheet h3 { font-size: 21px; margin: 2px 0 6px; letter-spacing: -.3px; }
.sheet p { color: var(--ink-2); font-size: 15px; line-height: 1.45; margin: 0 0 14px; }
.sheet .btns { display: flex; gap: 10px; margin-top: 16px; }
.sheet input[type=text], .sheet input[type=password], .login input { width: 100%; height: 50px; border-radius: 14px; border: 1px solid var(--line); background: #fff; padding: 0 14px; font-size: 17px; outline: none; color: var(--ink); }
.sheet input:focus, .login input:focus { border-color: var(--blue-2); box-shadow: 0 0 0 4px rgba(61,130,255,.15); }
.sheet .stack { display: flex; flex-direction: column; gap: 10px; }
.steps { margin: 0 0 6px; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; padding: 0 0 12px 38px; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.steps b { color: var(--ink); }
.preset { display: flex; align-items: center; gap: 12px; background: #fff; padding: 12px 14px; border-radius: 14px; box-shadow: var(--shadow); width: 100%; text-align: left; }
.preset > span:nth-child(2) { flex: 1; } .preset small { display: block; color: var(--ink-3); font-size: 13px; }
.preset .p-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #FFF4D6; color: #E09A00; }
.preset .p-ic svg.ic { width: 20px; height: 20px; }
.err { color: var(--red); font-size: 14px; min-height: 18px; margin: 8px 0 0; }
@keyframes up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes fade { from { opacity: 0; } }

/* ---------------- player ---------------- */
.player { position: fixed; inset: 0; z-index: 70; background: #07090E; color: #fff; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 10px) 0 calc(var(--safe-b) + 12px); animation: up2 .28s cubic-bezier(.2,.9,.3,1); overflow-y: auto; }
@keyframes up2 { from { transform: translateY(40px); opacity: 0; } }
.pl-top { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 10px; max-width: 900px; width: 100%; margin: 0 auto; }
.icon-btn.dark { background: rgba(255,255,255,.1); color: #fff; width: 40px; height: 40px; }
.icon-btn.dark svg.ic { width: 20px; height: 20px; }
.pl-title { text-align: center; } .pl-title b { display: block; font-size: 16px; } .pl-title small { color: #9AA3B5; font-size: 13px; }
.pl-video { width: 100%; max-width: 900px; margin: 0 auto; background: #000; aspect-ratio: 16/9; }
.pl-video video { width: 100%; height: 100%; display: block; background: #000; }
.pl-nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 4px; max-width: 900px; width: 100%; margin: 0 auto; }
.pl-nav .muted { color: #8D96A8; font-size: 13px; }
.pl-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px; max-width: 900px; width: 100%; margin: 0 auto; }
.pl-info div { background: rgba(255,255,255,.06); border-radius: 14px; padding: 10px 12px; }
.pl-info small { display: block; color: #8D96A8; font-size: 12px; } .pl-info b { font-size: 16px; font-variant-numeric: tabular-nums; }
.pl-actions { display: flex; gap: 10px; padding: 6px 16px; max-width: 900px; width: 100%; margin: 0 auto; }
.act { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; border-radius: 16px; background: rgba(255,255,255,.08); color: #fff; font-size: 13px; font-weight: 500; text-decoration: none; }
.act svg.ic { width: 22px; height: 22px; } .act.red { color: #FF6B66; }

/* ---------------- toast ---------------- */
.toast { position: fixed; z-index: 80; left: 50%; top: calc(var(--safe-t) + 10px); transform: translateX(-50%); width: calc(100% - 24px); max-width: 456px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 20px; background: rgba(255,255,255,.92); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); box-shadow: var(--shadow-lg); animation: drop .35s cubic-bezier(.2,.9,.3,1.2); text-align: left; }
.toast img { width: 64px; aspect-ratio: 16/9; object-fit: cover; border-radius: 9px; flex: none; }
.toast .t-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); flex: none; }
.toast b { display: block; font-size: 15px; } .toast small { font-size: 13.5px; color: var(--ink-2); }
@keyframes drop { from { transform: translate(-50%, -120%); } }

/* ---------------- login ---------------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 80% 0, #DCE8FF, transparent 50%), var(--bg); }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login h1 { font-size: 30px; margin: 0; letter-spacing: -.6px; }
.login p.muted { margin: 4px 0 28px; font-size: 16px; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

@media (min-width: 520px) { body { background: #E9EDF5; } #app { background: var(--bg); box-shadow: 0 0 60px rgba(20,30,60,.08); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
