/* All sizes are in rem: the whole interface scales with the screen.
   ~18px on a laptop, ~21px on a large monitor, 16px on a phone. */
:root {
  --bg: #0E0D0D; --panel: #161413; --panel-2: #121010; --line: #26211F; --line-2: #2E2826;
  --line-warm: #6A4334; --text: #F7F2EE; --text-2: #E2D9D3; --muted: #C4BAB3; --faint: #A3988F;
  --accent: #F0906F; --accent-2: #F5AE94; --peach: #F6C3A8; --warm: #2E1E18; --ok: #8FD3A0; --bad: #F59A9A;
  --grad: linear-gradient(90deg, #F2A07F, #DE7258);
  --logo: linear-gradient(90deg, #FBE7DA 0%, #F6C3A8 45%, #EE8F70 100%);
  --radius: 1.4rem;
  --max: 1680px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { font-size: clamp(16px, 0.75vw + 7px, 21px); }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 500 1rem/1.5 Manrope, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- frame ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { border-bottom: 1px solid var(--line); background: rgba(14, 13, 13, .92); position: sticky; top: 0; z-index: 6; backdrop-filter: blur(10px); }
.topbar-inner { max-width: var(--max); margin: 0 auto; padding: .7rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; }
.brand-mark { width: 2.6rem; height: 2.6rem; border-radius: .8rem; background: linear-gradient(135deg, #FBE0CF, #E5795D); color: #1A1210; display: grid; place-items: center; font-weight: 800; font-size: 1.35rem; box-shadow: 0 0 1.4rem rgba(240, 144, 111, .35); }
.brand-name { font-weight: 800; font-size: 1.75rem; letter-spacing: .06em; line-height: 1; background: var(--logo); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { color: var(--muted); font-size: 1rem; font-weight: 600; padding-left: .8rem; border-left: 1px solid var(--line-2); }
.live, .eyebrow { display: inline-flex; align-items: center; gap: .55rem; padding: .5rem 1rem; border: 1px solid var(--line-warm); border-radius: 999px; color: var(--accent-2); font-size: .8rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.eyebrow { border: 0; padding: 0; }
.dot { width: .55rem; height: .55rem; border-radius: 50%; background: #F08A6C; box-shadow: 0 0 .7rem #F08A6C; }
.live.idle .dot { background: var(--faint); box-shadow: none; }

.layout { flex: 1; display: flex; gap: 1.25rem; padding: 1.1rem 1.25rem 1.75rem; width: 100%; max-width: var(--max); margin: 0 auto; }
.sidebar { flex: 0 0 17rem; display: flex; flex-direction: column; gap: .8rem; position: sticky; top: 5rem; align-self: flex-start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.nav { padding: .6rem; display: flex; flex-direction: column; gap: .2rem; }
.nav a { display: flex; align-items: center; gap: .85rem; padding: .7rem .9rem; border-radius: 1rem; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 1.05rem; border: 1px solid transparent; }
.nav a:hover { background: #1C1917; }
.nav a svg { color: var(--faint); flex: 0 0 auto; width: 1.3rem; height: 1.3rem; }
.nav a.active { background: linear-gradient(90deg, #42291F, #26190F); border-color: var(--line-warm); color: var(--text); }
.nav a.active svg { color: var(--accent-2); }
.badge { margin-left: auto; padding: .05rem .6rem; border-radius: 999px; background: #42291F; color: var(--accent-2); font-size: .8rem; font-weight: 800; }
.soon-tag { margin-left: auto; padding: .1rem .55rem; border-radius: 999px; border: 1px solid var(--line-2); color: var(--faint); font-size: .72rem; font-weight: 700; }
.sources { padding: .95rem 1.05rem; display: flex; flex-direction: column; gap: .6rem; background: linear-gradient(160deg, #281813, var(--panel) 60%); border-color: #33261F; font-size: .95rem; color: var(--text-2); }
.row { display: flex; justify-content: space-between; gap: .5rem; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .muted { color: var(--faint); font-weight: 500; } .small { font-size: .88rem; }

/* ---------- content ---------- */
.view { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1.1rem; outline: none; }
.hero { border-radius: 1.8rem; border: 1px solid #33261F; background: radial-gradient(120% 140% at 100% 0%, #55301F 0%, #1E1613 48%, #151211 100%); padding: 1.7rem 2rem; display: flex; flex-direction: column; gap: .8rem; }
.hero > .live { align-self: flex-start; }
h1 { margin: 0; font-size: clamp(2rem, 3.4vw, 3.4rem); line-height: 1.06; font-weight: 800; letter-spacing: -.02em; }
h1 em, h2 em { font-style: normal; color: var(--accent); }
h2 { margin: 0; font-size: .9rem; font-weight: 800; letter-spacing: .13em; color: var(--muted); text-transform: uppercase; }
.lead { margin: 0; color: var(--muted); max-width: 46rem; font-size: 1.15rem; line-height: 1.55; }

.drops { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .8rem; }
.drop { position: relative; min-height: 9.5rem; border: 2px dashed var(--line-warm); border-radius: 1.5rem; background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; padding: 1.1rem; text-align: center; transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--accent); }
.drop.dim { border-color: #3D332E; background: var(--panel-2); }
.drop.dim:hover { border-color: #3D332E; }
.drop.over { border-color: var(--accent); background: #1E1512; }
.drop b { font-size: 1.25rem; }
.drop span { font-size: .95rem; }
.drop svg { width: 2.4rem; height: 2.4rem; color: var(--accent); }
.drop.dim svg { color: var(--faint); }
.drop-stack { display: flex; flex-direction: column; gap: .5rem; }
.drop-stack .drop { flex: 1; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .files { color: var(--accent-2); font-weight: 700; word-break: break-all; }

.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .8rem; }
.mode { text-align: left; display: flex; flex-direction: column; gap: .4rem; padding: 1.1rem 1.2rem; min-height: 6.8rem; border-radius: 1.4rem; background: var(--panel); border: 1px solid var(--line-2); transition: border-color .15s; }
.mode:hover:not(:disabled) { border-color: var(--line-warm); }
.mode b { font-size: 1.25rem; }
.mode span { color: var(--muted); font-size: 1rem; line-height: 1.45; }
.mode.on { background: linear-gradient(160deg, #42291F, #1C1512); border: 2px solid var(--accent); }
.mode:disabled { opacity: .55; cursor: not-allowed; }

.options { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; padding: 1rem 1.1rem; }
.field { display: flex; flex-direction: column; gap: .45rem; font-size: .85rem; color: var(--muted); font-weight: 700; }
.field select, .field input, .field textarea { min-height: 3.1rem; padding: .7rem 1rem; border-radius: .9rem; border: 1px solid #3A312D; background: var(--panel-2); color: var(--text); font-size: 1rem; font-weight: 600; }
.field textarea { min-height: 6rem; resize: vertical; }
.check { display: flex; align-items: center; gap: .6rem; min-height: 3.1rem; padding: 0 1.1rem; border-radius: 999px; border: 1px solid #3A312D; font-size: 1rem; font-weight: 600; color: var(--text-2); }
.check input { accent-color: var(--accent); width: 1.2rem; height: 1.2rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; min-height: 3.2rem; padding: .8rem 1.7rem; border-radius: 1rem; border: 1px solid var(--line-warm); background: transparent; color: var(--text); font-weight: 700; font-size: 1rem; }
.btn.primary { border: 0; background: var(--grad); color: #1A1210; font-weight: 800; font-size: 1.1rem; box-shadow: 0 .4rem 1.6rem rgba(222, 114, 88, .25); }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.small { min-height: 2.5rem; padding: .4rem 1rem; font-size: .9rem; border-radius: .75rem; }
.push { margin-left: auto; }

.progress { height: .45rem; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--grad); transition: width .4s; }
.progress.indeterminate > i { width: 30% !important; animation: slide 1.4s infinite ease-in-out; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }

.list { display: flex; flex-direction: column; gap: .8rem; }
.job { padding: 1rem 1.1rem; border-radius: 1.4rem; background: linear-gradient(160deg, #241713, var(--panel) 55%); border: 1px solid #2E2422; display: flex; flex-direction: column; gap: .8rem; }
.job-head { display: flex; align-items: center; gap: .9rem; }
.job-head svg { width: 1.5rem; height: 1.5rem; color: var(--accent-2); }
.thumb { width: 2.8rem; height: 3.7rem; border-radius: .7rem; background: linear-gradient(160deg, #6A3A28, #241815); flex: 0 0 auto; }
.job-title { display: flex; flex-direction: column; min-width: 0; }
.job-title b { font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-title span { color: var(--muted); font-size: .92rem; }
.job-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .95rem; }
.stage { color: var(--accent-2); font-weight: 700; }
.err { color: var(--bad); font-size: .95rem; }

.filters { display: flex; gap: .4rem; padding: .3rem; background: #181514; border: 1px solid var(--line-2); border-radius: 1rem; align-self: flex-start; }
.filters button { padding: .55rem 1.1rem; border-radius: .75rem; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 700; font-size: .95rem; }
.filters button.on { background: var(--warm); border-color: var(--line-warm); color: var(--accent-2); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .8rem; }
.tile { border-radius: 1.3rem; overflow: hidden; background: var(--panel); border: 1px solid var(--line-2); display: flex; flex-direction: column; }
.tile video { width: 100%; aspect-ratio: 9 / 16; background: #080606; object-fit: contain; display: block; }
.tile .meta { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; gap: .6rem; }
.tile .meta b { font-size: 1rem; line-height: 1.3; word-break: break-word; }
.tile .acts { display: flex; gap: .4rem; flex-wrap: wrap; }
.tag { align-self: flex-start; padding: .15rem .55rem; border-radius: 999px; background: var(--warm); color: var(--accent-2); font-size: .72rem; font-weight: 800; letter-spacing: .06em; }

.empty, .soon { padding: 3rem 1.5rem; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: .9rem; font-size: 1.05rem; }
.empty b { color: var(--text); font-size: 1.3rem; }
.soon { border-radius: 1.8rem; border: 1px solid #33261F; background: radial-gradient(120% 140% at 50% 0%, #432519, #161110 60%); padding: 2.8rem 1.5rem; }
.soon > .live { align-self: center; }
.soon h1 { font-size: clamp(1.9rem, 3vw, 3rem); }
.soon ul { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.soon li { padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); font-size: .95rem; font-weight: 600; }

.tabbar { display: none; }
.toast { position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%); max-width: calc(100% - 2rem); padding: .9rem 1.3rem; border-radius: 1rem; background: #261B17; border: 1px solid var(--line-warm); color: var(--text); font-size: 1rem; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 10; }
.toast.show { opacity: 1; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: 100%; max-width: 26rem; padding: 2rem; display: flex; flex-direction: column; gap: 1.1rem; }
.login-card h1 { font-size: 1.8rem; }
.error { color: var(--bad); margin: 0; }

/* ---------- phone / Telegram Mini App ---------- */
@media (max-width: 900px) {
  .topbar-inner { padding: .6rem .8rem; }
  .brand-mark { width: 2.3rem; height: 2.3rem; font-size: 1.15rem; }
  .brand-name { font-size: 1.45rem; }
  .brand-sub { display: none; }
  .live { font-size: .7rem; padding: .4rem .75rem; }
  .layout { padding: .75rem .75rem 6rem; }
  .sidebar { display: none; }
  .hero { padding: 1.2rem; border-radius: 1.3rem; }
  h1 { font-size: 1.9rem; }
  .lead { font-size: 1rem; }
  .drop { min-height: 7.5rem; }
  .options .btn.primary { width: 100%; margin-left: 0; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; padding: .5rem .4rem calc(.7rem + env(safe-area-inset-bottom)); background: rgba(18, 16, 16, .96); border-top: 1px solid var(--line); z-index: 5; backdrop-filter: blur(10px); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .3rem; color: var(--faint); text-decoration: none; font-size: .72rem; font-weight: 700; min-height: 3rem; justify-content: center; }
  .tabbar a svg { width: 1.45rem; height: 1.45rem; }
  .tabbar a.active { color: var(--accent); }
  .grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .toast { bottom: 6rem; }
}
