@font-face { font-family: "Baloo Thambi 2"; src: url(/fonts/BalooThambi2-800.woff) format("woff"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Baloo Thambi 2"; src: url(/fonts/BalooThambi2-700.woff) format("woff"); font-weight: 700; font-display: swap; }
:root {
  --bg: #170a36; --bg2: #2a0f55; --card: #2d1760; --card2: #3a2176; --line: rgba(255, 214, 120, 0.22);
  --gold: #ffd36a; --gold2: #ffb52a; --text: #fff6e6; --muted: #cbb9ee; --ok: #46d37a; --red: #ff4d4d; --blue: #4f7cff;
  --tap: 56px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { font-size: 18px; }
body { margin: 0; background: radial-gradient(1200px 700px at 50% -10%, #4a1a8a 0%, var(--bg2) 40%, var(--bg) 100%) fixed; color: var(--text);
  font-family: "Baloo Thambi 2", "Noto Sans Tamil", "Tamil Sangam MN", "Latha", system-ui, sans-serif; font-weight: 700; line-height: 1.35; min-height: 100vh; }
header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(23, 10, 54, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
h1 { margin: 0; padding: 0 52px; font-size: 1.1rem; font-weight: 800; color: var(--gold); letter-spacing: 0.01em; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header .ghost { position: absolute; left: 6px; font-size: 2.2rem; line-height: 1; width: 44px; padding: 0; padding-bottom: 6px; }
main { padding: 16px 16px calc(120px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
button { font: inherit; color: inherit; border: 0; border-radius: 16px; min-height: var(--tap); padding: 0 20px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.45; cursor: default; }
.primary { background: linear-gradient(180deg, #ffd978, var(--gold2)); color: #3a1400; font-weight: 800; font-size: 1.05rem; box-shadow: 0 6px 24px rgba(255, 181, 42, 0.35); width: 100%; }
.big { min-height: 68px; font-size: 1.2rem; border-radius: 22px; }
.ghost { background: transparent; color: var(--gold); padding: 0 12px; min-height: 44px; font-size: 1rem; }
.soft { background: var(--card2); color: var(--text); font-size: 1rem; }
.danger { background: rgba(255, 77, 77, 0.16); color: #ffb3b3; font-size: 1rem; }
.rec { background: linear-gradient(180deg, #ff6a6a, #e01f1f); color: #fff; font-size: 1.2rem; width: 100%; min-height: 72px; border-radius: 22px; box-shadow: 0 8px 28px rgba(224, 31, 31, 0.4); }
.rec.on { animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 90, 0.6); } 50% { box-shadow: 0 0 0 16px rgba(255, 90, 90, 0); } }
.lead { color: var(--muted); font-size: 1rem; margin: 6px 0 18px; text-align: center; }
.hero { text-align: center; padding: 10px 0 6px; }
.hero .primary { margin: 0 auto; }
.sect { color: var(--gold); font-size: 1.1rem; margin: 22px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 16px; margin-bottom: 14px; }
.card.tap { cursor: pointer; display: flex; align-items: center; gap: 14px; }
.card .grow { flex: 1; min-width: 0; }
.card h2 { margin: 0; font-size: 1.2rem; color: var(--gold); }
.card .sub { color: var(--muted); font-size: 0.95rem; margin-top: 2px; }
.status { font-size: 1rem; white-space: nowrap; }
.status.ok { color: var(--ok); }
.status.wait { color: var(--muted); }
.chev { color: var(--gold); font-size: 1.6rem; opacity: 0.7; }
/* tabs */
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 2px 0 18px; }
.tab { flex-direction: column; gap: 2px; min-height: 64px; padding: 6px 4px; border-radius: 16px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); color: var(--muted); position: relative; }
.tab .num { font-size: 0.75rem; opacity: 0.8; }
.tab .lbl { display: flex; flex-direction: column; line-height: 1.1; }
.tab .lbl b { font-size: 0.85rem; color: var(--text); }
.tab .lbl small { font-size: 0.68rem; }
.tab.active { background: linear-gradient(180deg, #ffd978, var(--gold2)); border-color: transparent; color: #3a1400; }
.tab.active .lbl b, .tab.active .lbl small, .tab.active .num { color: #3a1400; }
.tab .badge { position: absolute; top: 6px; right: 6px; font-size: 0.72rem; background: rgba(0, 0, 0, 0.35); border-radius: 10px; padding: 1px 7px; }
.tab.active .badge { background: rgba(0, 0, 0, 0.18); }
.tab.locked { opacity: 0.4; }
/* panels */
.panelcard { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; }
.panelcard h2 { margin: 0 0 8px; color: var(--gold); font-size: 1.3rem; }
.formgrid { display: grid; gap: 12px; margin: 14px 0 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.actions .primary { width: auto; }
.actions a { display: contents; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 20px 0 14px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.facts div { background: rgba(0, 0, 0, 0.22); border-radius: 16px; padding: 12px 8px; text-align: center; display: grid; gap: 2px; }
.facts b { font-size: 1.3rem; color: var(--gold); }
.facts span { font-size: 0.8rem; color: var(--muted); }
.meta { color: var(--muted); font-size: 0.95rem; margin: 10px 0 0; text-align: center; }
/* audio rows */
.rows { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 56px 1fr; column-gap: 12px; align-items: center; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; cursor: pointer; }
.row img { grid-row: 1 / 4; width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)); }
.row .emoji { grid-row: 1 / 4; width: 56px; height: 56px; display: grid; place-items: center; font-size: 2rem; }
.row .name { font-size: 1.15rem; color: var(--gold); line-height: 1.2; }
.row .status { font-size: 0.9rem; margin: 3px 0; }
.row .sub { color: var(--muted); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.open { border-color: var(--gold2); background: var(--card2); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.panel { background: var(--card2); border: 1px solid var(--gold2); border-top: 0; border-radius: 0 0 20px 20px; padding: 16px; display: grid; gap: 12px; margin-top: -10px; }
.panel .hint { margin: 0; }
.hint { color: var(--muted); font-size: 0.95rem; text-align: center; margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.timer { font-size: 2.6rem; text-align: center; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
audio { width: 100%; height: 48px; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(23, 10, 54, 0.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line); z-index: 5; }
.bar .inner { max-width: 640px; margin: 0 auto; display: grid; gap: 6px; }
.bar .inner.row2 { grid-template-columns: 1fr auto; align-items: center; }
.bar .count { color: var(--muted); font-size: 0.95rem; }
.bar .primary { width: auto; font-size: 1rem; }
/* progress */
.progress { text-align: center; padding: 26px 18px; }
.progress .pct { font-size: 4.2rem; color: var(--gold); line-height: 1; font-weight: 800; }
.progress .step { font-size: 1.1rem; margin-top: 10px; }
.progress .note { color: var(--muted); font-size: 0.95rem; margin-top: 16px; }
.track { height: 14px; border-radius: 7px; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin: 18px 0; }
.track i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold2), #ffe9a8); border-radius: 7px; transition: width 0.6s; }
/* player + publish */
.player { width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; background: #000; display: block; border: 1px solid var(--line); }
.player.big { margin-top: 8px; }
.pubwrap { display: grid; gap: 18px; }
.pubhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.pubhead.top h2 { margin: 0; color: var(--gold); font-size: 1.3rem; flex: 1; }
.pubhead.top .primary { width: auto; }
.publabel { color: var(--gold); font-size: 0.95rem; flex: 1; }
.pubnote { color: var(--muted); font-size: 0.8rem; }
.copy { min-height: 40px; padding: 0 14px; font-size: 0.9rem; }
.pub { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px 14px; margin-bottom: 12px; }
textarea.pub { font: inherit; font-weight: 500; font-size: 0.95rem; line-height: 1.45; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); color: #fff; width: 100%; resize: vertical; display: block; margin: 0; }
textarea.pub:focus { outline: none; border-color: var(--gold2); }
.sumlist { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; margin-top: 12px; display: grid; gap: 8px; }
.sumrow { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 10px; align-items: center; font-size: 0.92rem; }
.sumrow img { width: 34px; height: 34px; object-fit: contain; }
.sumrow b { color: var(--gold); }
.stars { color: #ffd34a; letter-spacing: 0.05em; }
/* clips */
.clips { display: grid; gap: 16px; }
.clip { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px; display: grid; gap: 12px; }
.vplayer { width: 100%; max-width: 300px; aspect-ratio: 9 / 16; border-radius: 16px; background: #000; display: block; margin: 0 auto; border: 1px solid var(--line); }
.clipbody { display: grid; gap: 8px; }
.cliphead { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.cliphead img { width: 44px; height: 44px; object-fit: contain; }
.cliphead b { color: var(--gold); font-size: 1.05rem; }
.clip textarea.pub { font-size: 0.9rem; }
/* forms */
.field { display: grid; gap: 4px; }
.field span { font-size: 0.85rem; color: var(--muted); }
.field input { font: inherit; font-size: 1rem; padding: 11px 12px; border-radius: 14px; border: 2px solid var(--line); background: rgba(0, 0, 0, 0.25); color: #fff; width: 100%; color-scheme: dark; }
.field input::placeholder { color: rgba(203, 185, 238, 0.55); }
.field input:focus { outline: none; border-color: var(--gold2); }
.field input:disabled { opacity: 0.6; }
.pin { display: grid; gap: 14px; text-align: center; padding-top: 30px; }
.pin input { font: inherit; font-size: 2rem; text-align: center; letter-spacing: 0.4em; padding: 14px; border-radius: 18px; border: 2px solid var(--line); background: rgba(0, 0, 0, 0.25); color: #fff; width: 100%; }
.pin input:focus { outline: none; border-color: var(--gold2); }
.narrow { max-width: 420px; margin: 0 auto; }
input[type=date] { font: inherit; font-size: 1.05rem; padding: 11px 12px; border-radius: 14px; border: 2px solid var(--line); background: rgba(0, 0, 0, 0.25); color: #fff; width: 100%; color-scheme: dark; }
.err { color: #ffb3b3; text-align: center; }
.missing { background: rgba(255, 181, 42, 0.12); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; color: var(--text); font-size: 0.95rem; margin: 8px 0 12px; }
#toast { position: fixed; left: 50%; bottom: calc(130px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #111; color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 1rem; z-index: 9; max-width: 90vw; text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: grid; place-items: end center; z-index: 8; }
.modal .sheet { background: var(--card); border-radius: 26px 26px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); width: 100%; max-width: 640px; display: grid; gap: 12px; }
.modal h3 { margin: 0 0 6px; font-size: 1.25rem; color: var(--gold); text-align: center; }
.modal p { margin: 0; text-align: center; color: var(--text); }
/* laptop */
@media (min-width: 900px) {
  html { font-size: 17px; }
  main { max-width: 1120px; padding: 22px 28px 60px; }
  .bar .inner { max-width: 1064px; }
  h1 { font-size: 1.25rem; }
  .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
  .cards .card { margin: 0; }
  .tabs { gap: 10px; }
  .tab { flex-direction: row; min-height: 58px; gap: 10px; }
  .tab .lbl b { font-size: 1rem; }
  .tab .lbl small { font-size: 0.8rem; }
  .tab .badge { position: static; margin-left: auto; }
  .formgrid { grid-template-columns: 1fr 1fr; gap: 14px 18px; }
  .rows { grid-template-columns: 1fr 1fr; align-items: start; gap: 10px 14px; }
  .rows .panel { grid-column: 1 / -1; margin-top: -10px; }
  .pubwrap { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
  .tabs { grid-template-columns: repeat(5, 1fr); }
  .clips { grid-template-columns: repeat(auto-fill, minmax(500px, 1fr)); }
  .clip { grid-template-columns: 220px 1fr; align-items: start; }
  .vplayer { max-width: 220px; margin: 0; }
  .modal { place-items: center; }
  .modal .sheet { border-radius: 26px; max-width: 520px; }
  .player.big { max-width: 960px; margin: 8px auto 0; }
  .progress .pct { font-size: 5rem; }
}
