/* Labnest's demo, for the web. The page around it is plain; the app inside follows the app's own look:
   rounded system type, a dark theme with two glows, and an accent pair that changes with the tab. */

:root {
  --page: #0b0d14;
  --page-ink: #e9e8f2;
  --page-muted: #9a99ab;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--page); color: var(--page-ink); font-family: var(--rounded); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
img { max-width: 100%; }
.noscript { text-align: center; padding: 40px 16px; }

/* The page: an introduction beside the phone on wide screens, the app alone on phones. */
.page {
  min-height: 100%;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 48px; padding: 24px 16px;
  background: radial-gradient(60% 50% at 20% 10%, #16203a 0%, transparent 70%), radial-gradient(50% 50% at 90% 90%, #24163a 0%, transparent 70%), var(--page);
}
.intro { max-width: 340px; display: flex; flex-direction: column; gap: 14px; }
.intro h1 { font-size: 34px; line-height: 1.1; margin: 6px 0 0; text-wrap: balance; letter-spacing: -0.01em; }
.intro p { margin: 0; color: var(--page-muted); line-height: 1.5; font-size: 15.5px; }
.intro p.tries { color: var(--page-ink); }
.intro .small { font-size: 13px; }
.back { display: inline-flex; align-items: center; gap: 10px; color: var(--page-ink); text-decoration: none; font-weight: 600; }
.back img { width: 32px; height: 32px; border-radius: 8px; }
.store { align-self: flex-start; background: #fff; color: #0b0d14; text-decoration: none; font-weight: 700; padding: 12px 18px; border-radius: 999px; }

.device {
  height: min(852px, calc(100dvh - 48px)); aspect-ratio: 393 / 852; max-width: 100%;
  border-radius: 58px; padding: 11px; background: #050507;
  box-shadow: 0 0 0 1.5px #2a2a33, 0 40px 90px rgba(0, 0, 0, 0.55);
  position: relative;
}
.app { --top: 54px; --bottom: 0px; width: 100%; height: 100%; border-radius: 47px; overflow: hidden; position: relative; isolation: isolate; container-type: inline-size; }

/* Phones and iPads: the app fills the screen. */
@media (max-width: 640px), (pointer: coarse) {
  html, body { overflow: hidden; height: 100%; }
  .page { display: block; padding: 0; height: 100dvh; min-height: 0; }
  .intro { display: none; }
  .device { height: 100%; width: 100%; aspect-ratio: auto; border-radius: 0; padding: 0; box-shadow: none; background: none; }
  .app { border-radius: 0; --top: env(safe-area-inset-top, 20px); --bottom: env(safe-area-inset-bottom, 0px); }
  .app .statusbar { display: none; }
}
@media (max-height: 560px) and (min-width: 641px) { .intro { display: none; } }

.switcher { display: inline-flex; align-self: flex-start; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.switcher button { padding: 8px 16px; border-radius: 999px; font-weight: 650; color: var(--page-muted); }
.switcher button[aria-pressed="true"] { background: #fff; color: #0b0d14; }

/* The iPad frame on a computer: landscape, with the introduction above it. */
body.pad .page { flex-direction: column; gap: 18px; }
body.pad .intro { max-width: min(1194px, 100%); flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
body.pad .intro h1 { font-size: 24px; margin: 0; }
body.pad .intro p:not(.tries), body.pad .intro .back { display: none; }
body.pad .intro p.tries { flex: 1 1 340px; font-size: 14px; }
body.pad .switcher, body.pad .store { align-self: center; }
body.pad .device { height: auto; aspect-ratio: 1194 / 834; width: min(1194px, calc(100vw - 32px), calc((100dvh - 150px) * 1.4317)); border-radius: 42px; padding: 13px; }
body.pad .app { border-radius: 30px; --top: 30px; }
body.pad .statusbar { height: 30px; padding: 2px 28px 0; font-size: 14px; }
body.pad .statusbar svg { width: 16px; height: 16px; }

/* ---------- The app ---------- */

.app {
  --bg: #0a0d18; --glowA: #0f766e; --glowB: #5b21b6;
  --surface: rgba(24, 28, 44, 0.86); --raised: rgba(255, 255, 255, 0.07); --stroke: rgba(255, 255, 255, 0.07);
  --ink: #f4f4f8; --muted: rgba(235, 235, 245, 0.6); --faint: rgba(235, 235, 245, 0.35);
  --good: #34d399; --warn: #fbbf24; --bad: #f87171;
  --a1: #2dd4bf; --a2: #8b5cf6;
  --bar: rgba(30, 34, 52, 0.78);
  font-family: var(--rounded); color: var(--ink); background: var(--bg); font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.app[data-theme="ember"] { --bg: #140c0a; --glowA: #9a3412; --glowB: #7f1d1d; --surface: rgba(40, 24, 20, 0.86); --bar: rgba(48, 30, 24, 0.8); }
.app[data-theme="midnight"] { --bg: #05070d; --glowA: #1e3a8a; --glowB: #0f172a; --surface: rgba(18, 22, 36, 0.9); --bar: rgba(22, 26, 40, 0.85); }
.app[data-theme="porcelain"] {
  --bg: #f2f2f6; --glowA: #99f6e4; --glowB: #ddd6fe; --surface: rgba(255, 255, 255, 0.92); --raised: rgba(0, 0, 0, 0.05);
  --stroke: rgba(0, 0, 0, 0.06); --ink: #12131a; --muted: rgba(60, 60, 67, 0.65); --faint: rgba(60, 60, 67, 0.35);
  --good: #059669; --warn: #d97706; --bad: #dc2626; --bar: rgba(255, 255, 255, 0.85);
}
.app[data-mood="media"] { --a1: #fb7185; --a2: #f59e0b; }
.app[data-mood="network"] { --a1: #22d3ee; --a2: #3b82f6; }
.app[data-mood="home"] { --a1: #f59e0b; --a2: #34d399; }
.app[data-mood="servers"] { --a1: #a78bfa; --a2: #6366f1; }

.backdrop { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 38% at 0% 0%, color-mix(in srgb, var(--a1) 30%, transparent), transparent 70%),
              radial-gradient(70% 38% at 100% 0%, color-mix(in srgb, var(--a2) 32%, transparent), transparent 70%), var(--bg);
  transition: background 0.5s; }

.statusbar { position: absolute; top: 0; left: 0; right: 0; height: 54px; z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: 6px 34px 0 40px; font-weight: 600; font-size: 16px; pointer-events: none; }
.statusbar .sb-icons { display: flex; gap: 6px; align-items: center; }
.statusbar svg { width: 18px; height: 18px; }

.app { --padtop: calc(var(--top) + 4px); --side: 16px; }
.scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: var(--padtop) var(--side) calc(var(--bottom) + 104px); scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }
.screen { display: flex; flex-direction: column; gap: 14px; animation: rise 0.28s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.screen.push { animation: slide 0.28s ease-out; }
@keyframes slide { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }

/* Top bar: back or menu on the left, search and settings on the right. */
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 46px; }
.capsule { display: flex; gap: 2px; background: var(--raised); border: 1px solid var(--stroke); border-radius: 999px; padding: 3px; backdrop-filter: blur(12px); }
.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; color: var(--a1); }
.iconbtn.solo { background: var(--raised); border: 1px solid var(--stroke); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn:active { transform: scale(0.92); }
h1.title { font-size: 34px; font-weight: 800; margin: 2px 0 0; letter-spacing: -0.01em; }
.subtitle { color: var(--muted); margin-top: -10px; font-size: 15px; }

/* Cards and rows */
.card { background: var(--surface); border: 1px solid var(--stroke); border-radius: 22px; padding: 14px 16px; backdrop-filter: blur(20px); }
.card.tap, .tap { cursor: pointer; transition: transform 0.15s; }
.card.tap:active, .tap:active { transform: scale(0.98); }
.row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row .grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b { font-weight: 650; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.sm { font-size: 13px; }
.xs { font-size: 12px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 2px -4px; }
.section-title h2 { font-size: 21px; font-weight: 750; margin: 0; }
.section-title button { color: var(--a1); font-weight: 600; font-size: 15px; }
.list { display: flex; flex-direction: column; }
.list > .item { padding: 11px 0; border-bottom: 1px solid var(--stroke); }
.list > .item:last-child { border-bottom: 0; }

.badge { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.badge svg { width: 19px; height: 19px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--good); }
.dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); } .dot.off { background: var(--faint); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap; background: var(--raised); color: var(--muted); }
.pill.good { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.pill svg { width: 13px; height: 13px; }

.track { height: 6px; border-radius: 99px; background: var(--raised); overflow: hidden; }
.track > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--a1), var(--a2)); transition: width 0.9s linear; }
.track.good > i { background: var(--good); } .track.warn > i { background: var(--warn); } .track.bad > i { background: var(--bad); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 999px; font-weight: 700; background: linear-gradient(90deg, var(--a1), var(--a2)); color: #fff; }
.btn.soft { background: color-mix(in srgb, var(--a1) 16%, transparent); color: var(--a1); }
.btn.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.btn.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.btn.good { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.btn.small { padding: 7px 13px; font-size: 14px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(0.97); }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px; background: var(--raised); border: 1px solid var(--stroke); font-weight: 650; white-space: nowrap; flex: none; }
.chip svg { width: 17px; height: 17px; }
.chip.on { background: linear-gradient(90deg, color-mix(in srgb, var(--a1) 85%, transparent), color-mix(in srgb, var(--a2) 85%, transparent)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--a1) 30%, transparent); }
.chip .count { background: var(--bad); color: #fff; border-radius: 99px; font-size: 12px; padding: 1px 7px; }
.chip.small { padding: 6px 12px; font-size: 14px; }
.chip .n { color: var(--muted); font-weight: 600; }
.chip.on .n { color: rgba(255, 255, 255, 0.8); }

/* Overview */
.hero { border-radius: 22px; padding: 14px 16px; color: #fff; background: linear-gradient(100deg, var(--a1), var(--a2)); display: flex; align-items: center; gap: 12px; box-shadow: 0 12px 30px color-mix(in srgb, var(--a2) 30%, transparent); }
.hero.attn { background: linear-gradient(100deg, #f59e0b, #ef4444); box-shadow: 0 12px 30px rgba(239, 68, 68, 0.3); }
.hero svg.seal { width: 30px; height: 30px; flex: none; }
.hero .t { font-weight: 750; font-size: 18px; }
.hero .s { font-size: 13.5px; opacity: 0.85; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--stroke); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.stat .v { font-size: 30px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 14px; }
.stat .note { color: var(--warn); font-size: 13px; font-weight: 650; margin-top: -4px; }
.demo-note { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: color-mix(in srgb, var(--a1) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--a1) 30%, transparent); }
.demo-note svg { width: 22px; height: 22px; color: var(--a1); flex: none; }
.demo-note a { color: var(--a1); font-weight: 700; text-decoration: none; white-space: nowrap; }

.playing { position: relative; overflow: hidden; border-radius: 22px; padding: 14px; display: flex; gap: 14px; align-items: center; min-height: 126px; border: 1px solid var(--stroke); background: #111; color: #fff; }
.playing .wash { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(22px) brightness(0.5) saturate(1.2); pointer-events: none; }
.playing > *:not(.wash) { position: relative; }
.playing .art { width: 78px; height: 104px; border-radius: 12px; background-size: cover; background-position: center; flex: none; }
.playing .who { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; opacity: 0.9; }
.avatar { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.playing .track { background: rgba(255, 255, 255, 0.25); margin-top: 8px; }
.playing .track > i { background: #fff; }
.stopbtn { width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); display: grid; place-items: center; flex: none; }
.stopbtn svg { width: 16px; height: 16px; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { border-radius: 22px; padding: 14px; min-height: 134px; display: flex; flex-direction: column; gap: 8px; text-align: left; background: var(--surface); border: 1px solid var(--stroke); position: relative; transition: transform 0.15s, background 0.3s; }
.tile:active { transform: scale(0.97); }
.tile .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--tone, var(--a1)) 18%, transparent); color: var(--tone, var(--a1)); }
.tile .ic svg { width: 21px; height: 21px; }
.tile .name { font-weight: 700; font-size: 16px; margin-top: 4px; }
.tile .state { color: var(--muted); font-size: 13.5px; margin-top: auto; }
.tile .big { font-size: 24px; font-weight: 800; color: var(--tone, var(--ink)); margin-top: auto; }
.tile.lit { background: linear-gradient(135deg, var(--a1), var(--a2)); color: #fff; border-color: transparent; }
.tile.lit .ic { background: rgba(255, 255, 255, 0.25); color: #fff; }
.tile.lit .state { color: rgba(255, 255, 255, 0.85); }

/* Posters */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
.shelf { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.shelf > * { flex: 0 0 112px; width: 112px; min-width: 0; }
.poster { container-type: inline-size; position: relative; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; background: #222 center / cover; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }
.poster.sq { aspect-ratio: 1; }
.poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(0, 0, 0, 0.72)); }
.poster .letters { position: absolute; left: 8cqw; right: 8cqw; bottom: 8cqw; z-index: 1; color: #fff; font-family: "Didot", "Bodoni 72", "Playfair Display", Georgia, serif; font-weight: 800; text-transform: uppercase; font-size: clamp(4px, 13cqw, 17px); line-height: 0.98; letter-spacing: 0.01em; }
.poster .letters small { display: block; font-family: var(--rounded); font-size: clamp(3px, 7cqw, 9px); font-weight: 600; margin-top: 4px; opacity: 0.85; letter-spacing: 0.08em; }
.poster .tag { position: absolute; top: 7px; left: 7px; z-index: 1; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: rgba(0, 0, 0, 0.6); color: #fff; }
.cap { margin-top: 6px; font-weight: 600; font-size: 14px; }
.cap small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }

/* Detail page */
.detail-hero { position: relative; margin: calc(-1 * var(--padtop)) calc(-1 * var(--side)) 0; height: 330px; background: center / cover; }
.detail-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, 0.25), transparent 30%, color-mix(in srgb, var(--bg) 55%, transparent) 70%, var(--bg)); }
.detail-head { display: flex; gap: 14px; align-items: flex-end; margin-top: -120px; position: relative; z-index: 1; }
.detail-head .poster { width: 116px; flex: none; }
.detail-head h1 { margin: 0; font-size: 25px; line-height: 1.15; }
.floating-top { position: absolute; top: calc(var(--top) + 4px); left: 16px; right: 16px; display: flex; justify-content: space-between; z-index: 5; pointer-events: none; }
.floating-top > * { pointer-events: auto; }
.floating-top .iconbtn { background: rgba(0, 0, 0, 0.4); color: #fff; backdrop-filter: blur(10px); }
.ratings { display: flex; gap: 8px; flex-wrap: wrap; }
.tagline { color: var(--a1); font-weight: 650; font-size: 16px; line-height: 1.35; }
.prose { color: var(--muted); line-height: 1.5; margin: 0; }
.cast { display: flex; gap: 14px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.cast > div { flex: 0 0 78px; text-align: center; font-size: 12px; }
.cast .face { width: 70px; height: 70px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; font-weight: 700; color: var(--muted); margin: 0 auto 6px; font-size: 18px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; text-align: right; }

/* Network */
.ring-card { display: flex; gap: 16px; align-items: center; }
.ring { width: 132px; height: 132px; position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .c b { font-size: 24px; }
.kv { display: grid; gap: 10px; }
.kv .row b { font-size: 18px; display: block; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; margin-top: 10px; }
.bars > div { flex: 1; display: flex; flex-direction: column-reverse; border-radius: 3px; overflow: hidden; }
.bars i { display: block; }
.bars .al { background: color-mix(in srgb, var(--ink) 28%, transparent); }
.bars .bl { background: var(--a1); }
.legend { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.bar-row .track { grid-column: 1 / -1; height: 5px; }
.query { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--stroke); }
.query.new { animation: flash 0.8s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--a1) 18%, transparent); } to { background: transparent; } }

/* Servers */
.mons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.mons > div { background: var(--raised); border-radius: 12px; padding: 8px 10px; display: flex; align-items: center; gap: 7px; font-size: 14px; min-width: 0; }
.meter { display: grid; gap: 5px; margin-top: 10px; }
.meter .row { justify-content: space-between; font-size: 14px; }
.ups-ring { width: 58px; height: 58px; border-radius: 50%; border: 5px solid var(--good); display: grid; place-items: center; color: var(--good); flex: none; }
.ups-ring svg { width: 22px; height: 22px; }
.container-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--stroke); }
.container-row:last-child { border-bottom: 0; }
.glyph { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; flex: none; position: relative; }
.glyph .dot { position: absolute; right: -2px; bottom: -2px; border: 2px solid var(--surface); width: 12px; height: 12px; }
.stack-head { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.stack-head h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.logs { background: #05060a; color: #cfd3dc; border-radius: 14px; padding: 12px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; line-height: 1.55; white-space: pre; overflow-x: auto; max-height: 50vh; }

/* Car */
.car-hero { text-align: left; }
.car-hero .pct { font-size: 56px; font-weight: 800; line-height: 1; }
.car-hero .track { height: 10px; position: relative; overflow: visible; margin-top: 12px; }
.car-hero .limit { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; }
.ctrls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ctrl { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ctrl .ic { width: 58px; height: 58px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; color: var(--ink); transition: background 0.2s; }
.ctrl.on .ic { background: linear-gradient(135deg, var(--a1), var(--a2)); color: #fff; }
.ctrl .ic svg { width: 24px; height: 24px; }

/* Tab bar */
.tabbar { position: absolute; left: 12px; right: 12px; bottom: calc(var(--bottom) + 10px); height: 64px; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); padding: 4px; border-radius: 999px; background: var(--bar); border: 1px solid var(--stroke); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 600; border-radius: 999px; color: var(--ink); position: relative; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--a1); background: var(--raised); }
.tab .count { position: absolute; top: 3px; left: calc(50% + 6px); background: var(--bad); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 6px; line-height: 17px; }

/* Sheets, dialogs, toast */
.scrim { position: absolute; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.45); animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 88%; overflow-y: auto; background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 16px calc(var(--bottom) + 24px); animation: up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1); border-top: 1px solid var(--stroke); }
.sheet::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 9px; background: var(--faint); margin: 0 auto 12px; }
@keyframes up { from { transform: translateY(100%); } }
.sheet h2 { margin: 0 0 4px; font-size: 22px; }
.sheet .stack { display: flex; flex-direction: column; gap: 12px; }
.dialog { position: absolute; left: 10px; right: 10px; bottom: calc(var(--bottom) + 10px); z-index: 41; display: flex; flex-direction: column; gap: 8px; animation: up 0.25s cubic-bezier(0.2, 0.9, 0.3, 1); }
.dialog .group { background: var(--surface); backdrop-filter: blur(30px); border-radius: 16px; overflow: hidden; border: 1px solid var(--stroke); }
.dialog .head { padding: 14px 16px; text-align: center; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--stroke); }
.dialog .head b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 3px; }
.dialog button { display: block; width: 100%; padding: 16px; font-size: 18px; color: var(--a1); border-bottom: 1px solid var(--stroke); }
.dialog button:last-child { border-bottom: 0; }
.dialog button.destructive { color: var(--bad); }
.dialog button.cancel { font-weight: 700; }
.toast { position: absolute; top: calc(var(--top) + 8px); left: 50%; transform: translateX(-50%); z-index: 50; background: var(--surface); border: 1px solid var(--stroke); backdrop-filter: blur(30px); padding: 10px 16px; border-radius: 999px; font-weight: 650; font-size: 14px; display: flex; gap: 8px; align-items: center; white-space: nowrap; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); animation: drop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1); max-width: calc(100% - 32px); }
.toast svg { width: 18px; height: 18px; color: var(--good); flex: none; }
.toast span { overflow: hidden; text-overflow: ellipsis; }
@keyframes drop { from { transform: translate(-50%, -30px); opacity: 0; } }
.search { display: flex; align-items: center; gap: 8px; background: var(--raised); border-radius: 14px; padding: 10px 12px; }
.search svg { width: 18px; height: 18px; color: var(--muted); }
.search input { flex: 1; background: none; border: 0; outline: 0; font-size: 16px; min-width: 0; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 24px; }
.stepper .v { font-size: 44px; font-weight: 800; min-width: 120px; text-align: center; }
.stepper button { width: 54px; height: 54px; border-radius: 50%; background: var(--raised); font-size: 26px; font-weight: 700; }
.slider { width: 100%; accent-color: var(--a1); height: 28px; }
.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.themes button { border-radius: 16px; padding: 8px; display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 650; border: 2px solid transparent; }
.themes button.on { border-color: var(--a1); }
.themes i { width: 100%; aspect-ratio: 1; border-radius: 12px; display: block; }

/* ---------- iPad layout (the app's regular width): tabs on top, cards in two columns ---------- */
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; align-items: start; }
.cols > div { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.reqs { display: flex; flex-direction: column; gap: 12px; }
.app.wide { --padtop: calc(var(--top) + 64px); --side: 28px; }
.app.wide .scroll { padding-bottom: calc(var(--bottom) + 40px); }
.app.wide .screen { max-width: 1120px; margin: 0 auto; }
.app.wide .screen.subpage { max-width: 860px; }
.app.wide .tabbar { top: calc(var(--top) + 8px); bottom: auto; left: 50%; right: auto; transform: translateX(-50%); height: 48px; display: flex; gap: 2px; }
.app.wide .tab { flex-direction: row; gap: 7px; padding: 0 14px; font-size: 14.5px; white-space: nowrap; }
@container (max-width: 900px) { .app.wide .tab { padding: 0 10px; font-size: 13.5px; gap: 5px; } }
.app.wide .tab svg { width: 20px; height: 20px; }
.app.wide .tab .count { position: static; }
.app.wide .topbar { position: absolute; top: calc(var(--top) + 8px - var(--padtop)); left: 0; right: 0; height: 48px; min-height: 0; pointer-events: none; }
.app.wide .screen { position: relative; }
.app.wide .topbar > * { pointer-events: auto; }
.app.wide .topbar > .b { display: none; }
.app.wide h1.title { margin-top: 10px; }
.app.wide .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.app.wide .tiles { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.app.wide .cols .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.app.wide .grid3 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
.app.wide .reqs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.app.wide .chips, .app.wide .cast { margin: 0; padding: 2px 0; }
.app.wide .shelf { margin: 0; padding: 0 0 4px; }
.app.wide .shelf > * { flex-basis: 128px; width: 128px; }
.app.wide .detail-hero { height: 440px; }
.app.wide .detail-head .poster { width: 150px; }
.app.wide .detail-head h1 { font-size: 32px; }
.app.wide .bars { height: 170px; }
.app.wide .sheet { left: 0; right: 0; margin: 0 auto; width: min(560px, 92%); top: 7%; bottom: auto; max-height: 86%; border-radius: 26px; border: 1px solid var(--stroke); padding-bottom: 24px; animation: pop 0.25s cubic-bezier(0.2, 0.9, 0.3, 1); }
.app.wide .sheet::before { display: none; }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } }
.app.wide .dialog { left: 0; right: 0; margin: 0 auto; width: 340px; bottom: auto; top: 26%; animation: pop 0.2s ease-out; }
.app.wide .toast { top: calc(var(--top) + 66px); }

@media (prefers-reduced-motion: reduce) { .app *, .app *::before { animation: none !important; transition: none !important; } }
.app.wide .floating-top { top: calc(var(--top) + 8px - var(--padtop)); left: 0; right: 0; }
.app.wide .screen.subpage .detail-hero { border-radius: 0 0 28px 28px; }
