/* ToneBump shared styles (extracted from the original inline <style> blocks,
   plus nav / flash / auth-form / dashboard-table additions for the web app). */
:root{
  --bg:#0f1020; --card:#191a2e; --card2:#21223b; --line:#2c2e4d;
  --txt:#ececf5; --muted:#9aa0c0; --brand:#8b5cf6; --brand2:#6366f1;
  --pos:#10b981; --neg:#f43f5e;
}
*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,sans-serif;
  background:radial-gradient(1200px 600px at 50% -10%, #1b1c34 0%, var(--bg) 60%);
  color:var(--txt); min-height:100dvh; line-height:1.5;
  padding:max(16px, env(safe-area-inset-top)) 14px calc(28px + env(safe-area-inset-bottom));
}
.wrap{ max-width:620px; margin:0 auto; }
a{ color:var(--brand); }

/* Top nav */
.nav{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; gap:10px; }
.nav .brand{ font-weight:800; letter-spacing:-.02em; color:var(--txt); text-decoration:none; font-size:1.05rem; }
.nav .links{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.nav .links a{ color:var(--muted); text-decoration:none; font-size:.86rem; }
.nav .links a:hover{ color:var(--txt); }
.nav form{ display:inline; }
.linkbtn{ background:none; border:none; color:var(--muted); cursor:pointer; font-size:.86rem; padding:0; }
.linkbtn:hover{ color:var(--txt); }

/* Flash messages */
.flashes{ list-style:none; padding:0; margin:0 0 14px; }
.flashes li{ padding:10px 14px; border-radius:12px; margin-bottom:8px; font-size:.86rem;
  border:1px solid var(--line); background:var(--card2); word-break:break-word; }
.flashes li.success{ border-color:#10b98155; }
.flashes li.error{ border-color:#f43f5e55; }
.flashes li.info{ border-color:#6366f155; }

/* Cards */
.card{ background:var(--card); border:1px solid var(--line); border-radius:20px; padding:18px; margin-bottom:16px; }
.card h2{ margin:0 0 4px; font-size:.95rem; font-weight:700; }
.card .hint{ margin:0 0 14px; font-size:.8rem; color:var(--muted); }

/* Waveform */
.viz{ position:relative; height:96px; border-radius:14px; overflow:hidden;
  background:var(--card2); border:1px solid var(--line); margin-bottom:14px; }
.viz canvas{ width:100%; height:100%; display:block; }
.viz .timer{ position:absolute; top:8px; right:12px; font-variant-numeric:tabular-nums;
  font-size:.78rem; color:var(--muted); font-weight:600; }
.viz .idle{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  color:var(--muted); font-size:.82rem; }

/* Buttons */
.btn{ font-size:.98rem; font-weight:700; padding:13px 16px; border-radius:13px; border:none;
  cursor:pointer; color:#fff; width:100%; transition:transform .08s ease, filter .15s ease;
  background:linear-gradient(135deg,var(--brand2),var(--brand)); }
.btn:active{ transform:scale(.98); }
.btn:disabled{ opacity:.45; cursor:not-allowed; }
.btn.rec{ background:linear-gradient(135deg,#f43f5e,#e11d48); }
.btn.rec.recording{ background:linear-gradient(135deg,#b91c1c,#7f1d1d); }
.btn.ghost{ background:transparent; border:1px solid var(--line); color:var(--txt); }
.btn.danger{ background:linear-gradient(135deg,#f43f5e,#e11d48); }
.btn.small{ width:auto; padding:8px 12px; font-size:.82rem; border-radius:10px; }
.row{ display:flex; gap:10px; }
.row .btn{ flex:1; }

/* File input */
.file-pick{ display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.file-pick label{ flex:1; padding:11px 14px; border-radius:12px; border:1px dashed var(--line);
  background:var(--card2); color:var(--muted); font-size:.85rem; cursor:pointer;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.file-pick input{ display:none; }

/* Form fields (auth) */
.field{ margin-bottom:14px; }
.field label{ display:block; font-size:.82rem; color:var(--muted); margin-bottom:6px; }
.field input[type=email], .field input[type=password], .field input[type=text]{
  width:100%; padding:12px 14px; border-radius:12px; border:1px solid var(--line);
  background:var(--card2); color:var(--txt); font-size:.95rem; }
.field .err{ color:var(--neg); font-size:.78rem; margin-top:6px; }
.checkrow{ display:flex; align-items:flex-start; gap:10px; font-size:.84rem; color:var(--txt); margin-bottom:14px; }
.checkrow input{ width:18px; height:18px; margin-top:1px; accent-color:var(--brand); }

/* Result */
#result .placeholder, .placeholder{ text-align:center; color:var(--muted); font-size:.9rem; padding:14px 6px; }
.verdict{ display:flex; align-items:center; gap:12px; font-size:clamp(1.15rem,5vw,1.5rem); font-weight:800; }
.dot{ width:14px; height:14px; border-radius:50%; flex:0 0 auto; }
.pos .dot{ background:var(--pos); box-shadow:0 0 0 5px rgba(16,185,129,.18); }
.neg .dot{ background:var(--neg); box-shadow:0 0 0 5px rgba(244,63,94,.18); }
.sub{ font-weight:500; opacity:.6; font-size:.62em; }
.bars{ margin-top:18px; }
.bar-row{ margin-bottom:14px; }
.bar-label{ display:flex; justify-content:space-between; font-size:.84rem; font-weight:600; margin-bottom:6px; }
.track{ height:12px; border-radius:999px; background:var(--card2); border:1px solid var(--line); overflow:hidden; }
.fill{ height:100%; border-radius:999px; width:0; transition:width .7s cubic-bezier(.2,.8,.2,1); }
.fill.p{ background:linear-gradient(90deg,#34d399,#10b981); }
.fill.n{ background:linear-gradient(90deg,#fb7185,#f43f5e); }
.meta{ margin-top:6px; font-size:.78rem; color:var(--muted); }
.disclaimer{ margin-top:14px; padding-top:14px; border-top:1px dashed var(--line);
  font-size:.76rem; color:var(--muted); }
.foot{ text-align:center; font-size:.74rem; color:var(--muted); margin-top:6px; }

/* Training progress + metrics */
.status{ font-size:.82rem; color:var(--muted); min-height:1.2em; }
.log{ margin-top:10px; max-height:150px; overflow:auto; font-size:.74rem; color:var(--muted);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; background:var(--card2);
  border:1px solid var(--line); border-radius:10px; padding:8px 10px; white-space:pre-wrap; }
.metrics{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:8px 0 14px; }
.metric{ background:var(--card2); border:1px solid var(--line); border-radius:12px; padding:10px 12px; }
.metric .k{ font-size:.72rem; color:var(--muted); }
.metric .v{ font-size:1.05rem; font-weight:800; }
.opt{ display:flex; align-items:center; gap:10px; font-size:.86rem; margin-bottom:10px; color:var(--txt); }
.opt input{ width:18px; height:18px; accent-color:var(--brand); }
.ok{ color:var(--pos); } .err{ color:var(--neg); }

/* Tables (dashboard + admin) */
.tbl{ width:100%; border-collapse:collapse; font-size:.84rem; }
.tbl th, .tbl td{ text-align:left; padding:10px 8px; border-bottom:1px solid var(--line); vertical-align:middle; }
.tbl th{ color:var(--muted); font-weight:600; font-size:.76rem; text-transform:uppercase; letter-spacing:.04em; }
.tag{ display:inline-block; padding:2px 9px; border-radius:999px; font-size:.72rem; font-weight:700; border:1px solid var(--line); }
.tag.green{ color:#34d399; border-color:#10b98155; }
.tag.red{ color:#fb7185; border-color:#f43f5e55; }
.tag.grey{ color:var(--muted); }
audio{ width:170px; height:34px; }
@media (max-width:420px){
  .card{ padding:15px; border-radius:18px; }
  .row{ flex-direction:column; }
  audio{ width:130px; }
}
