/* Torpas Cut - flat and clean. Colour-blind safe: blue + orange only, and every state also has an icon and a word. */
:root {
  --blue: #0072B2; --blue-soft: #e3f0f8; --orange: #E69F00; --orange-soft: #fdf3dc; --orange-ink: #7a5300;
  --ink: #111114; --mute: #6b6b76; --bg: #f4f4f6; --card: #ffffff; --line: #e3e3e8; --fill: #ececf0;
  --r: 16px; --tab: 62px;
}
@media (prefers-color-scheme: dark) {
  :root { --blue: #56B4E9; --blue-soft: #10283a; --orange: #E69F00; --orange-soft: #3a2a05; --orange-ink: #f3c860;
    --ink: #f4f4f6; --mute: #a0a0ab; --bg: #000000; --card: #1b1b1f; --line: #2c2c33; --fill: #26262c; }
}
* { box-sizing: border-box; touch-action: pan-x pan-y; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); overscroll-behavior-y: none; }
body { font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif; }
button, input, textarea, select { font: inherit; color: inherit; }
input, textarea, select { font-size: 16px; }                       /* 16px or more: iPhone never zooms into a field */
h1 { font-size: 30px; line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 20px; margin: 26px 0 10px; letter-spacing: -0.01em; }
p { margin: 0 0 8px; }
a { color: var(--blue); text-decoration: none; }
.wrap { max-width: 760px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 28px); }
.wrap.tabs { padding-bottom: calc(env(safe-area-inset-bottom) + var(--tab) + 28px); }
.top { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 10px; }
.top .back { width: 44px; height: 44px; margin-left: -10px; border: 0; background: none; display: grid; place-items: center; color: var(--blue); }
.top .grow { flex: 1; min-width: 0; }
.top .title { font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .sub { color: var(--mute); font-size: 13px; }
.mute { color: var(--mute); } .small { font-size: 13px; } .center { text-align: center; }
svg.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.s { width: 16px; height: 16px; }

.card { background: var(--card); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.card.tap { cursor: pointer; }
.card.tap:active { opacity: .7; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.list { background: var(--card); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
.list > .item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; min-height: 52px; border-top: 1px solid var(--line); cursor: pointer; }
.list > .item:first-child { border-top: 0; }
.list > .item:active { background: var(--fill); }
.list .chev { color: var(--mute); }
.poster { width: 100%; aspect-ratio: 16/9; border-radius: 12px; background: var(--fill) center/cover no-repeat; display: grid; place-items: center; color: var(--mute); margin-bottom: 10px; overflow: hidden; }
.thumb { width: 96px; height: 54px; border-radius: 8px; background: var(--fill) center/cover no-repeat; flex: none; }
.thumb.tallish { width: 54px; height: 96px; }

/* states: a shape + an icon + a word. Never colour alone. */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--fill); color: var(--ink); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.orange { background: var(--orange-soft); color: var(--orange-ink); border: 1px dashed var(--orange); }
.chip.line { background: none; border: 1px solid var(--line); color: var(--mute); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.scroll-x .pill { flex: none; white-space: nowrap; }
.scroll-x { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px 10px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.pill { flex: 0 1 auto; max-width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 20px; padding: 9px 14px; min-height: 40px; font-weight: 600; font-size: 15px; }
.pill.on { background: var(--blue); border-color: var(--blue); color: #fff; }
@media (prefers-color-scheme: dark) { .pill.on { color: #001018; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 0; background: var(--fill); font-weight: 650; font-size: 16px; cursor: pointer; }
.btn:active { opacity: .7; }
.btn.pri { background: var(--blue); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.pri { color: #001018; } }
.btn.warn { background: var(--orange-soft); color: var(--orange-ink); border: 1px dashed var(--orange); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.btn[disabled] { opacity: .45; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btns .btn { flex: 1; }
.btns.col { flex-direction: column; }
.btns.col .btn { flex: none; width: 100%; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select, .inp { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px; min-height: 48px; outline: none; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus, .inp:focus { border-color: var(--blue); }
.seg { display: flex; background: var(--fill); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 10px; min-height: 42px; font-weight: 600; }
.seg button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.14); color: var(--blue); }
.switch { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; }
.switch .box { width: 52px; height: 32px; border-radius: 16px; background: var(--fill); border: 2px solid var(--line); position: relative; flex: none; }
.switch .box::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--mute); transition: left .15s; }
.switch.on .box { background: var(--blue); border-color: var(--blue); }
.switch.on .box::after { left: 22px; background: #fff; }
.switch .word { font-weight: 700; min-width: 30px; }

.banner { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--r); padding: 14px; margin-bottom: 12px; background: var(--blue-soft); color: var(--ink); }
.banner.orange { background: var(--orange-soft); border: 1px dashed var(--orange); }
.banner .grow { flex: 1; min-width: 0; }
.bar { height: 10px; border-radius: 5px; background: var(--fill); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 5px; transition: width .4s; }
.spin { width: 20px; height: 20px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* bottom tabs */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: color-mix(in srgb, var(--card) 97%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar button { flex: 1; border: 0; background: none; height: var(--tab); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--mute); font-size: 11px; font-weight: 600; position: relative; }
.tabbar button.on { color: var(--blue); }
.tabbar button.on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--blue); }
.tabbar .dot { position: absolute; top: 9px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--orange); border: 2px solid var(--card); }

/* watch */
.player { background: #000; border-radius: 14px; overflow: hidden; margin: 0 -6px 12px; }
.player video { display: block; width: 100%; max-height: 72vh; background: #000; }
.now { display: flex; gap: 12px; align-items: center; }
.now .thumb { width: 80px; height: 45px; }
.acts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; }
.acts button { border: 0; background: var(--fill); border-radius: 12px; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 600; }
.acts button:active { opacity: .6; }

/* plan */
.chapter { margin-top: 18px; }
.chapter .head { display: flex; gap: 10px; align-items: baseline; }
.chapter .head b { font-size: 18px; }
.shot { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.shot:first-child { border-top: 0; }
.shot .t { width: 40px; flex: none; font-variant-numeric: tabular-nums; color: var(--mute); font-size: 13px; padding-top: 2px; }
.shot .why { font-weight: 600; }
.shot.live { background: var(--blue-soft); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 10px; border-top-color: transparent; }

/* chat */
.msgs { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 18px; background: var(--card); align-self: flex-start; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.you { align-self: flex-end; background: var(--blue); color: #fff; }
@media (prefers-color-scheme: dark) { .msg.you { color: #001018; } }
.msg.sys { align-self: center; background: none; color: var(--mute); font-size: 13px; padding: 2px 8px; text-align: center; }
.msg .learn { display: block; margin-top: 6px; font-size: 13px; opacity: .8; }
.msg .btn { margin-top: 8px; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + var(--tab)); z-index: 15; background: var(--bg); padding: 8px 12px; display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 20px; padding: 10px 14px; min-height: 44px; max-height: 120px; resize: none; outline: none; }
.composer .btn { min-height: 44px; border-radius: 22px; padding: 0 16px; }

/* clips */
.clip { display: flex; gap: 12px; padding: 12px; background: var(--card); border-radius: var(--r); margin-bottom: 10px; }
.clip .pic { width: 132px; flex: none; }
.clip .pic .ph { width: 132px; aspect-ratio: 16/9; border-radius: 10px; background: var(--fill) center/cover no-repeat; position: relative; overflow: hidden; display: grid; place-items: center; cursor: pointer; }
.clip .pic .ph.tallish { aspect-ratio: 9/16; width: 96px; margin: 0 auto; }
.clip .pic video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.clip .pic .play { width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.clip .use { display: flex; gap: 6px; margin-top: 8px; }
.clip .use button { flex: 1; min-height: 40px; border-radius: 10px; border: 2px solid var(--line); background: none; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.clip .use button.on.yes { background: var(--blue); border-color: var(--blue); color: #fff; }
.clip .use button.on.no { background: var(--orange-soft); border: 2px dashed var(--orange); color: var(--orange-ink); }

/* people bars */
.pbar { display: grid; grid-template-columns: 92px 1fr 48px; gap: 8px; align-items: center; margin: 7px 0; font-size: 14px; }
.pbar .track { height: 14px; border-radius: 7px; background: var(--fill); overflow: hidden; }
.pbar .track i { display: block; height: 100%; background: var(--blue); border-radius: 7px; }
.pbar .num { text-align: right; font-variant-numeric: tabular-nums; }

/* song bars */
.songbar { display: flex; height: 34px; border-radius: 9px; overflow: hidden; background: var(--fill); margin: 8px 0 4px; }
.songbar > div { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; min-width: 2px; white-space: nowrap; overflow: hidden; }
.songbar > div:nth-child(odd) { background: var(--blue); }
.songbar > div:nth-child(even) { background: var(--orange); color: #2b1d00; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,.12) 6px 8px); }

/* sheets (pop-ups from the bottom) */
.veil { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 10px 16px calc(env(safe-area-inset-bottom) + 20px); overscroll-behavior: contain; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h3 { margin: 0 0 12px; font-size: 20px; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + var(--tab) + 70px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 14px; z-index: 60; font-weight: 600; max-width: 88vw; text-align: center; }
.empty { text-align: center; color: var(--mute); padding: 26px 10px; }
.ver { display: flex; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); align-items: center; }
.ver:first-child { border-top: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
