/* Rekvon AI — Studio app UI. Light iridescent product surface: warm cream, pink→violet
   accent gradient, glass cards. Palette matches the landing (frontend/index.html). */
*,*::before,*::after{box-sizing:border-box;margin:0}
:root{
  /* surface hierarchy: sidebar/card (near-white) < content bg (warm cream) */
  --side:#fffdfb; --bg:#f6f2ef; --panel:#fffdfb; --panel-2:#f8f2ff; --ink:#191521; --ink-2:#3a3442; --muted:#6f6773;
  --red:#eb4179; --red-2:#ff6f9c; --good:#1f9d63; --bad:#e0355c;
  --gold:#7a5cff; --gold-2:#9b82ff; /* "pro" tier accent — violet end of the brand gradient */
  --grad:linear-gradient(115deg,#eb4179,#7a5cff 55%,#ffab3d);
  --grad2:linear-gradient(115deg,#eb4179,#7a5cff);
  --line:rgba(25,21,33,.09); --line-2:rgba(25,21,33,.17);
  --glass:rgba(255,253,251,.62);
  --disp:"Gloock",Georgia,serif; --body:"Hanken",system-ui,sans-serif; --mono:"Mono",monospace; --deva:"Deva","Hanken",sans-serif;
}
html{-webkit-text-size-adjust:100%}
/* the hidden attribute must always win, even over display classes like .gate/.shell */
[hidden]{display:none !important}
body{color:var(--ink);font-family:var(--body);font-size:15px;line-height:1.5;-webkit-font-smoothing:antialiased;
  background:
    radial-gradient(50% 50% at 88% -8%, rgba(255,150,190,.28), transparent 62%),
    radial-gradient(48% 48% at -6% 8%, rgba(150,180,255,.22), transparent 62%),
    radial-gradient(46% 46% at 100% 100%, rgba(255,200,140,.18), transparent 62%),
    var(--bg)}
/* film grain, same material as the landing, dialed down for a working surface */
body::after{content:"";position:fixed;inset:0;z-index:2147483000;pointer-events:none;opacity:.02;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;border:none;cursor:pointer}
svg{display:block}
input,select,textarea{font:inherit;color:inherit}
input[type=range],input[type=checkbox]{accent-color:var(--red)}
::selection{background:var(--red);color:#fff}
.brand{font-family:var(--disp);font-size:1.4rem;letter-spacing:-.01em}
.brand span{color:var(--red)}
.cost{color:var(--ink);font-variant-numeric:tabular-nums}

/* buttons — tactile: gradient fill, machined highlight, real pressed state */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;border-radius:10px;font-weight:600;font-size:.92rem;
  padding:.6em 1.1em;transition:transform .15s ease,filter .15s ease,background .15s,border-color .15s,color .15s;white-space:nowrap}
.btn-solid{background:var(--grad2);color:#fff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35), 0 1px 2px rgba(70,45,90,.12), 0 10px 26px -14px rgba(235,65,121,.5)}
.btn-solid:hover{filter:brightness(1.08)}
.btn-solid:active{filter:brightness(.92);transform:translateY(1px);box-shadow:inset 0 1px 2px rgba(70,45,90,.10)}
.btn-line{border:1px solid var(--line-2);color:var(--ink);background:linear-gradient(180deg,rgba(25,21,33,.04),transparent);
  box-shadow:inset 0 1px 0 rgba(25,21,33,.05)}
.btn-line:hover{border-color:rgba(235,65,121,.6);color:var(--red-2)}
.btn-line:active{transform:translateY(1px)}
:where(button,a,input,select,textarea,summary):focus-visible{outline:2px solid var(--red);outline-offset:2px;border-radius:6px}
.btn-danger{color:var(--bad)}.btn-danger:hover{background:rgba(255,106,82,.12)}
.btn-sm{padding:.42em .8em;font-size:.82rem;border-radius:8px}
.btn-lg{padding:.75em 1.35em;font-size:1rem}
.btn:disabled{opacity:.45;cursor:not-allowed}
.full{width:100%}
/* visually-hidden label text that stays available to screen readers */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* toasts — bottom-right so they never collide with the topbar CTAs; column-reverse
   so newer toasts rise above older ones. z-index stays below the top-layer <dialog>,
   which renders above everything regardless, so dialog close buttons stay clickable. */
#toasts{position:fixed;bottom:4.7rem;right:1.1rem;z-index:200;display:flex;flex-direction:column-reverse;gap:.6rem}
.toast{background:linear-gradient(180deg,#fffdfb,#fdf9f6);border:1px solid var(--line-2);border-radius:12px;padding:.75rem 1.05rem;font-size:.9rem;
  box-shadow:inset 0 1px 0 rgba(25,21,33,.06), 0 18px 40px -18px rgba(70,45,90,.16);max-width:340px}
.toast.good{border-color:rgba(63,185,119,.5)}.toast.bad{border-color:rgba(255,106,82,.55)}

/* returning session: hide the gate until auth actually resolves (kills the
   signed-out flash for signed-in users; boot() lifts the class if signed out) */
.resuming .gate{visibility:hidden}

/* ===================== signed-out gate ===================== */
.gate{min-height:100vh;display:flex;flex-direction:column}
.gate-top{display:flex;align-items:center;justify-content:space-between;padding:1.5rem clamp(1.2rem,4vw,2.6rem)}
.ghost-link{color:var(--ink-2);font-size:.9rem}.ghost-link:hover{color:var(--ink)}
.gate-min{margin:auto;text-align:center;display:flex;flex-direction:column;align-items:center;padding:2rem}
.gate-min h1{font-family:var(--disp);font-size:clamp(2.1rem,4.5vw,3.2rem);letter-spacing:-.01em;margin:1.7rem 0 .6rem}
.gate-min p{color:var(--ink-2);max-width:40ch;margin-bottom:2.2rem}
.gate-alt{margin-top:1.2rem;color:var(--muted);font-size:.9rem;min-height:40px}
.gate-alt span{color:var(--ink);text-decoration:underline;text-underline-offset:3px}
.gate-alt:hover span{color:var(--red-2)}
.orb-mark{width:76px;height:76px;margin:0 auto 1.8rem;border-radius:50%;border:2px solid var(--red);display:grid;place-items:center;
  box-shadow:0 0 0 0 rgba(235,65,121,.35);animation:pulse 2.6s ease-in-out infinite}
.orb-mark span{width:20px;height:20px;border-radius:50%;background:var(--ink)}
@keyframes pulse{0%,100%{box-shadow:0 0 0 0 rgba(235,65,121,.3);transform:scale(1)}50%{box-shadow:0 0 0 14px rgba(235,65,121,0);transform:scale(1.05)}}
.gate-card h1{font-family:var(--disp);font-size:clamp(2rem,5vw,3rem);letter-spacing:-.01em;margin-bottom:.7rem}
.gate-card p{color:var(--ink-2);margin:0 auto 2rem;max-width:44ch}
.gate-actions{display:flex;gap:.8rem;justify-content:center;flex-wrap:wrap}

/* ===================== app shell ===================== */
.shell{display:grid;grid-template-columns:240px 1fr;min-height:100vh}
.side{position:sticky;top:0;height:100vh;display:flex;flex-direction:column;gap:1.3rem;padding:1.2rem 1rem;
  border-right:1px solid var(--line);background:var(--side)}
.side-brand{padding:.2rem .4rem}
.side-nav{display:flex;flex-direction:column;gap:.25rem}
.side-nav button{display:flex;align-items:center;gap:.7rem;width:100%;text-align:left;padding:.65rem .75rem;border-radius:10px;
  color:var(--ink-2);font-weight:500;font-size:.95rem;transition:background .2s,color .2s}
.side-nav button svg{width:19px;height:19px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.side-nav button:hover{background:rgba(25,21,33,.05);color:var(--ink)}
.side-nav button.active{background:linear-gradient(180deg,rgba(235,65,121,.17),rgba(235,65,121,.09));color:var(--red-2);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.5)}
.side-foot{margin-top:auto;display:flex;flex-direction:column;gap:1rem}
.engine{display:flex;align-items:center;gap:.5rem;font-size:.8rem;color:var(--muted);cursor:default;min-width:0}
.engine .dot{width:7px;height:7px;border-radius:50%;background:var(--good);flex:none}
.engine b{color:var(--ink-2);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.acct{display:flex;align-items:center;gap:.6rem;padding-top:1rem;border-top:1px solid var(--line)}
.avatar{width:34px;height:34px;border-radius:50%;background:var(--panel-2);border:1px solid var(--line-2);color:var(--ink-2);display:grid;place-items:center;font-weight:700;font-size:.9rem;flex:none}
.acct-email{font-size:.82rem;color:var(--ink-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.logout{color:var(--muted);min-width:40px;min-height:40px;display:grid;place-items:center}.logout:hover{color:var(--red)}
.logout svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

.content{width:100%;max-width:1280px;margin-inline:auto}
/* compact product topbar — view title + actions, no marketing greeting */
.topbar{position:sticky;top:0;z-index:30;display:flex;align-items:center;justify-content:space-between;gap:1rem;
  height:54px;padding:0 1.6rem;border-bottom:1px solid var(--line);background:rgba(255,253,251,.75);backdrop-filter:blur(8px)}
.tb-title{font-weight:600;font-size:.98rem}
.tb-actions{display:flex;align-items:center;gap:.55rem}
.view-pad{padding:1.4rem 1.6rem 2.5rem}
/* dashboard grid + panel headers */
.dash-grid{display:grid;grid-template-columns:1.7fr 1fr;gap:.9rem;margin-bottom:.9rem;align-items:start}
@media(max-width:900px){.dash-grid{grid-template-columns:1fr}}
.dash-side{display:flex;flex-direction:column;gap:.9rem}
.ph-sm{font-weight:600;font-size:.92rem}
.ph-meta{color:var(--muted);font-size:.8rem}
.ph-meta b{color:var(--ink);font-family:var(--mono);font-weight:500}
.btn-ghost-sm{color:var(--ink-2);font-size:.84rem;font-weight:500}.btn-ghost-sm:hover{color:var(--red)}
/* spark chart — single series, brand red (validated vs dark surface) */
.spark-bars{display:flex;align-items:flex-end;gap:3px;height:132px}
.sbar{flex:1;background:var(--red);border-radius:3px 3px 0 0;min-height:3px;position:relative;cursor:default}
.sbar.zero{background:rgba(25,21,33,.10)}
.sbar:hover{filter:brightness(1.2)}
.sbar .tip{position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%);background:var(--panel-2);
  border:1px solid var(--line-2);border-radius:8px;padding:.35rem .6rem;font-family:var(--mono);font-size:.7rem;color:var(--ink);
  white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s;z-index:5}
.sbar:hover .tip,.sbar:focus .tip,.sbar:focus-visible .tip{opacity:1}
.spark-axis{display:flex;justify-content:space-between;font-family:var(--mono);font-size:.68rem;color:var(--muted);
  border-top:1px solid var(--line);padding-top:.5rem;margin-top:.6rem}
/* sparse state: soft baseline (inset — no layout shift) + a friendly caption so the near-empty chart reads intentionally */
.spark-bars.sparse{box-shadow:inset 0 -1px 0 var(--line-2)}
.spark-note{color:var(--muted);font-size:.78rem;margin-top:.6rem}
/* engine card */
.engine-dot{width:8px;height:8px;border-radius:50%;background:var(--good);box-shadow:0 0 8px rgba(63,185,119,.6)}
.kv-list .kv{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;padding:.62rem 0;border-bottom:1px solid var(--line);font-size:.9rem}
.kv-list .kv:last-child{border-bottom:none;padding-bottom:0}
.kv-list .kv span{color:var(--ink-2)}
.kv-list .kv b{font-family:var(--mono);font-weight:500;font-size:.82rem;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:60%}
/* stat tile context line */
.stat-sub{color:var(--muted);font-size:.78rem;margin-top:.3rem}
/* activity right cluster */
.act-right{display:flex;align-items:center;gap:.6rem;flex:none}
/* roles & membership */
.role-line:empty{display:none}
.role-chip{display:inline-flex;align-items:center;border:1px solid var(--line-2);border-radius:999px;padding:.28em .85em;
  color:var(--ink-2);font-weight:600;font-size:.7rem;letter-spacing:.06em;text-transform:uppercase}
.role-chip.admin{background:var(--red);border-color:var(--red);color:#fff}
.role-chip.exp{color:var(--bad);border-color:rgba(255,106,82,.5)}
.pcount{margin-left:auto;background:var(--red);color:#fff;border-radius:999px;font-size:.68rem;font-weight:700;padding:.12em .6em}
/* members panel — a real data table */
.tablewrap{background:var(--panel);border:1px solid var(--line);border-radius:12px;overflow:auto}
.mtable{width:100%;border-collapse:collapse;font-size:.88rem}
.mtable th{text-align:left;font-weight:500;color:var(--muted);font-size:.76rem;padding:.7rem 1rem;border-bottom:1px solid var(--line);white-space:nowrap}
.mtable td{padding:.7rem 1rem;border-bottom:1px solid var(--line);vertical-align:middle}
.mtable tr:last-child td{border-bottom:none}
.mtable tr:hover td{background:rgba(25,21,33,.02)}
.mtable tr.pending td{background:rgba(235,65,121,.045)}
.memail{font-weight:600;white-space:nowrap}
.mmeta{color:var(--muted);font-size:.8rem;white-space:nowrap}
.mnote{color:var(--ink-2);font-style:italic;max-width:42ch}
.mact{display:flex;align-items:center;gap:.45rem;justify-content:flex-end;white-space:nowrap}
.mcredits{display:flex;align-items:center;gap:.7rem;font-size:.8rem;color:var(--ink-2);white-space:nowrap}
.mcredits b{color:var(--ink);font-family:var(--mono);font-weight:500}
.mcredits b.low{color:#c98a2b}
.mcredits b.zero{color:var(--bad)}
.creditbtn{font-size:.75rem;color:var(--gold);border:1px solid rgba(122,92,255,.35);border-radius:6px;padding:.15em .5em}
.creditbtn:hover{background:rgba(122,92,255,.12)}
.credit-in{display:flex;align-items:center;gap:1rem}
.credit-in input[type=number]{width:120px}
.credit-in input:disabled{opacity:.4}
.credit-in .toggle{margin:0;font-size:.85rem}
.voice-tier-sel{width:auto;min-width:0;padding:.32em .6em;font-size:.82rem;border-radius:8px}
/* admin: pending requests panel on the dashboard */
.preq{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:.65rem 0;border-bottom:1px solid var(--line);flex-wrap:wrap}
.preq:last-child{border-bottom:none;padding-bottom:0}
.preq .who b{font-weight:600}
.preq .who .note{color:var(--ink-2);font-size:.85rem;font-style:italic;margin-top:.1rem}
/* member: membership status card */
.mem-row{display:flex;justify-content:space-between;align-items:baseline;font-size:.88rem;margin-bottom:.55rem}
.mem-row span{color:var(--ink-2)}
.mem-row b{font-family:var(--mono);font-weight:500;font-size:.82rem}
.mem-track{height:6px;border-radius:999px;background:rgba(25,21,33,.1);overflow:hidden;margin:.35rem 0 .55rem}
/* progress/meter fills are gold (brand), not green — green is reserved for status pills + the engine dot */
.mem-fill{height:100%;border-radius:999px;background:linear-gradient(90deg,var(--gold),var(--gold-2));transition:width .3s}
.mem-fill.low{background:var(--bad)}
.mem-hint{color:var(--muted);font-size:.78rem}
/* pending view */
.pending-card{max-width:560px;margin:8vh auto 0;text-align:center;display:flex;flex-direction:column;gap:1.1rem;padding:2.3rem}
.pending-card h2{font-weight:600;font-size:1.3rem;letter-spacing:-.01em}
.pending-card p{color:var(--ink-2);font-size:.95rem}
.pending-card textarea{text-align:left}
/* expired banner */
.expire-banner{border:1px solid rgba(255,106,82,.45);background:rgba(255,106,82,.07);border-radius:16px;
  padding:1rem 1.2rem;margin-bottom:1.2rem;display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap}
.expire-banner b{color:var(--bad)}
.eb-form{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center}
.eb-form input{min-width:280px;flex:1}
.view{animation:fade .16s ease both}   /* product motion: state change, not choreography */
@keyframes fade{from{opacity:0}to{opacity:1}}

/* panels — glass material: translucent card over the iridescent mesh, soft lift shadow */
.panel,.stat,.tablewrap,.voice,.hist{
  background:var(--glass);backdrop-filter:blur(20px) saturate(1.4);-webkit-backdrop-filter:blur(20px) saturate(1.4);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7), 0 1px 3px rgba(70,45,90,.08), 0 8px 24px -18px rgba(70,45,90,.14)}
.panel{border:1px solid var(--line);border-radius:12px;padding:1.15rem 1.3rem}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.9rem}
.dl-group{display:flex;gap:.5rem;flex:none}
.panel-head.lg{margin-bottom:1.1rem}
.panel-head h2,.view>.panel-head h2{font-size:.98rem;font-weight:600}

/* dashboard stats */
.stat-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:.9rem;margin-bottom:.9rem}
.stat{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:.9rem 1.1rem}
.stat-label{display:flex;align-items:center;gap:.5rem;color:var(--ink-2);font-size:.8rem;font-weight:500}
.stat-label svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.stat-val{font-family:var(--mono);font-size:1.5rem;margin-top:.35rem;letter-spacing:-.02em}
.stat-val small{font-family:var(--body);font-size:.82rem;color:var(--ink-2)}
.stat-cost .stat-val{color:var(--ink)}
/* two-pool credits value: keep the number scale but let the pool labels breathe + not overflow */
.stat-cost .stat-val{font-size:1.28rem;white-space:nowrap}
.stat-cost .stat-val small{margin-left:.22rem}

/* activity */
.act{display:flex;align-items:center;gap:.9rem;padding:.85rem 0;border-bottom:1px solid var(--line)}
.act:last-child{border-bottom:none}
.act-ic{width:34px;height:34px;border-radius:9px;background:var(--panel-2);display:grid;place-items:center;color:var(--red);flex:none}
.act-main{flex:1;min-width:0}
.act-title{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.act-meta{color:var(--muted);font-size:.82rem}

/* chips */
.chip{display:inline-flex;align-items:center;gap:.42em;font-size:.72rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;
  padding:.28em .75em;border-radius:999px;border:1px solid var(--line-2);color:var(--ink-2);white-space:nowrap}
.chip::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}
.chip-ready,.chip-done{color:var(--good);border-color:rgba(63,185,119,.45);background:rgba(63,185,119,.08)}
.chip-pending,.chip-running,.chip-queued{color:var(--red-2);border-color:rgba(235,65,121,.4);background:rgba(235,65,121,.08)}
.chip-error{color:var(--bad);border-color:rgba(255,106,82,.5);background:rgba(255,106,82,.1)}

/* lists (voices + history) */
.grid-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:1.1rem}
#history-list{grid-template-columns:minmax(0,1fr);max-width:860px}
.voice{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:1.3rem}
.voice-top{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem}
.voice-name{font-weight:600;font-size:1.08rem}
.voice-meta{color:var(--muted);font-size:.82rem;margin-top:.15rem}
.voice-actions{margin-top:1rem;display:flex;justify-content:flex-end}
.hist{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:1.2rem 1.3rem;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.7rem 1rem;align-items:center}
.hist-main{min-width:0}
.hist-title{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hist-meta{color:var(--muted);font-size:.82rem;margin-top:.15rem}
.hist-right{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;justify-content:flex-end}
.hist-player{grid-column:1/-1}

.vgroup-h{font-weight:600;font-size:.92rem;color:var(--ink-2);margin:1.4rem 0 .8rem}
.vgroup-h:first-child{margin-top:0}
.vgroup-empty{border:1px dashed var(--line-2);border-radius:16px;padding:1.6rem;color:var(--ink-2);font-size:.92rem;max-width:520px}
/* 6. estimate row: credits cell reads as a caption, not a third jumbo number */
.est div:last-child b{font-size:.92rem;color:var(--ink-2);line-height:1.9}
/* playing state ring for preset auditions */
.sv-play.playing{box-shadow:0 0 0 3px rgba(122,92,255,.28)}

/* empty state */
.empty{text-align:center;padding:3rem 1rem;color:var(--ink-2)}
.empty h3{color:var(--ink);font-size:1.05rem;margin-bottom:.4rem;font-weight:600}
.empty-mark{display:inline-block;margin-bottom:1rem;opacity:.7}
.brand-mark{display:inline-flex;align-items:flex-end;gap:3px;height:22px}
.brand-mark i{width:3px;border-radius:2px;background:var(--red)}
.brand-mark i:nth-child(1){height:35%}.brand-mark i:nth-child(2){height:100%}.brand-mark i:nth-child(3){height:60%}.brand-mark i:nth-child(4){height:85%}.brand-mark i:nth-child(5){height:45%}
.brand-mark.lg{height:40px;gap:5px}.brand-mark.lg i{width:5px}

/* progress */
.prog{margin:.8rem 0 .2rem}
.prog-track{height:6px;border-radius:999px;background:rgba(25,21,33,.1);overflow:hidden}
.prog-fill{height:100%;background:linear-gradient(90deg,var(--red),var(--red-2));transform-origin:left;transition:transform .5s ease}
.prog-meta{display:flex;justify-content:space-between;font-size:.78rem;color:var(--ink-2);margin-top:.45rem}
.step-txt{color:var(--ink)}

/* studio */
.studio{display:grid;grid-template-columns:1fr 300px;gap:1.2rem;align-items:start}
/* aside is first in the DOM; pin columns so desktop layout is unchanged (mobile order is fixed via `order` below) */
.studio-main{display:flex;flex-direction:column;gap:1.1rem;grid-column:1;grid-row:1}  /* row pinned: col-2 aside otherwise pushes main to row 2 */
.studio-side{grid-column:2;grid-row:1}
.fld{display:flex;flex-direction:column;gap:.4rem}
.fld>span{font-size:.85rem;color:var(--ink-2);font-weight:500}
.fld>span em{font-style:normal;color:var(--muted)}
.lang-hint{font-size:.84rem;color:var(--ink-2);background:rgba(235,65,121,.08);border:1px solid rgba(235,65,121,.22);border-radius:10px;padding:.65rem .85rem;margin-top:-.3rem}
.lang-hint b{color:var(--red);font-weight:600}
/* studio mode switch: pink = clone (local), violet = professional (premium) */
.modeswitch{display:inline-flex;gap:.25rem;padding:.25rem;border:1px solid var(--line-2);border-radius:12px;background:rgba(25,21,33,.05);margin-bottom:.4rem}
.ms-opt{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem .95rem;border-radius:9px;font-weight:600;font-size:.9rem;color:var(--ink-2);transition:background .15s,color .15s}
.ms-opt:hover{color:var(--ink)}
.studio[data-mode="local"] .ms-opt[data-mode="local"]{background:linear-gradient(180deg,var(--red),var(--gold));color:#fff}
.studio[data-mode="sarvam"] .ms-opt[data-mode="sarvam"]{background:linear-gradient(180deg,var(--gold-2),var(--gold));color:#fff}
.pro-badge{font-size:.6rem;font-weight:700;letter-spacing:.08em;padding:.15em .5em;border-radius:999px;background:rgba(122,92,255,.22);color:var(--gold);border:1px solid rgba(122,92,255,.4)}
.studio[data-mode="sarvam"] .ms-opt[data-mode="sarvam"] .pro-badge{background:rgba(255,255,255,.28);color:#fff;border-color:transparent}
/* show the right fields per mode */
.studio[data-mode="local"] .sarvam-only{display:none}
.studio[data-mode="sarvam"] .local-only{display:none}
/* professional mode paints the Generate button + estimate accents gold */
.studio[data-mode="sarvam"] #generate-btn{background:linear-gradient(180deg,var(--gold-2),var(--gold));color:#fff}
.studio[data-mode="sarvam"] .slider span b{color:var(--gold)}
select,textarea,input[type=email],input[type=password],input[type=text],input[type=number]{
  background:linear-gradient(180deg,#fffdfb,#fffdfb);border:1px solid var(--line-2);border-radius:10px;
  padding:.7rem .85rem;font-size:.95rem;width:100%;transition:border-color .15s,box-shadow .15s;
  box-shadow:inset 0 1px 2px rgba(70,45,90,.10)}
select{appearance:none;-webkit-appearance:none;padding-right:2.5rem;cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236f6773' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right .9rem center}
select:focus,textarea:focus,input:focus{outline:none;border-color:var(--red);box-shadow:inset 0 1px 2px rgba(70,45,90,.10), 0 0 0 3px rgba(235,65,121,.16)}
textarea{resize:vertical;line-height:1.5;font-family:var(--body)}
.est{display:flex;gap:1.6rem}
.est div{display:flex;flex-direction:column}
.est b{font-family:var(--mono);font-size:1.25rem}
.est small{color:var(--muted);font-size:.75rem}
.studio-side h3{font-weight:600;font-size:.95rem;margin-bottom:1rem}
.slider{display:block;margin-bottom:1.2rem}
.slider span{display:flex;justify-content:space-between;font-size:.85rem;color:var(--ink-2);margin-bottom:.5rem}
.slider span b{color:var(--ink);font-family:var(--mono)}
.slider input[type=range]{width:100%}
.toggle{display:flex;align-items:center;gap:.6rem;font-size:.9rem;margin-top:.9rem;cursor:pointer}
.toggle input{width:auto}
.studio-job{margin:.2rem 0}
.studio-result{margin-top:.4rem}

/* waveform player (built by app.js) */
.wave-player{display:flex;align-items:center;gap:.8rem;margin-top:.9rem}
.wp-play{width:40px;height:40px;border-radius:50%;background:var(--red);color:#fff;display:grid;place-items:center;flex:none;transition:transform .2s,background .2s}
.wp-play:hover{transform:scale(1.07);background:var(--red-2)}
.wp-play svg{width:18px;height:18px;fill:currentColor}
.wp-canvas{flex:1;height:44px;min-width:0} /* width:100% + flex:1 double-sized the row and pushed the time out of the card */
.wp-time{font-family:var(--mono);font-size:.76rem;color:var(--ink-2);flex:none;text-align:right}

/* dialogs */
.dlg{border:none;background:transparent;padding:0;max-width:460px;width:calc(100% - 2rem);margin:auto;max-height:92vh}
.dlg[open]{display:block}
.dlg::backdrop{background:rgba(25,21,33,.72);backdrop-filter:blur(4px)}
.dlg form{background:linear-gradient(180deg,#fffdfb,#fdf9f6);border:1px solid var(--line-2);border-radius:18px;padding:1.9rem;position:relative;color:var(--ink);
  box-shadow:inset 0 1px 0 rgba(25,21,33,.06), 0 24px 70px -20px rgba(70,45,90,.18);display:flex;flex-direction:column;gap:1rem}
.dlg h2{color:var(--ink)}
.dlg-x{position:absolute;top:1.1rem;right:1.2rem;color:var(--muted);font-size:1rem}.dlg-x:hover{color:var(--ink)}
.dlg h2{font-weight:600;font-size:1.2rem;letter-spacing:-.01em}
.dlg-sub{color:var(--ink-2);font-size:.92rem;margin-top:-.5rem}
.dlg-hint{color:var(--muted);font-size:.82rem}
.err{color:var(--bad);font-size:.88rem}
.drop{display:flex;flex-direction:column;align-items:center;gap:.7rem;border:1.5px dashed var(--line-2);border-radius:14px;
  padding:1.8rem 1.6rem;text-align:center;color:var(--ink-2);cursor:pointer;user-select:none;-webkit-user-select:none;
  transition:border-color .2s,background .2s}
.drop:hover,.drop.over{border-color:var(--red);background:rgba(235,65,121,.06)}
.drop-ic{width:28px;height:28px;stroke:var(--red);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.drop u{color:var(--red);text-underline-offset:2px}
.drop.has-file{border-style:solid;border-color:var(--good);color:var(--ink)}
.drop.has-file .drop-ic{stroke:var(--good)}
#drop-text{margin:0;font-size:.92rem}

/* ---- premium material pass (shared with the landing's quality bar) ---- */
.topbar{background:rgba(255,253,251,.75);backdrop-filter:blur(14px) saturate(1.4);-webkit-backdrop-filter:blur(14px) saturate(1.4)}
.voice,.hist{transition:transform .18s ease,border-color .18s ease}
.voice:hover,.hist:hover{transform:translateY(-2px);border-color:var(--line-2)}
.stat{transition:border-color .18s ease}
.stat:hover{border-color:var(--line-2)}
.v-avatar{width:38px;height:38px;border-radius:10px;flex:none;display:grid;place-items:center;font-weight:700;font-size:1rem;color:var(--ink-2);
  background:var(--panel-2);border:1px solid var(--line-2)}
.voice-top{align-items:center}
.voice-id{display:flex;align-items:center;gap:.75rem;min-width:0}
.sbar{background:linear-gradient(180deg,var(--red-2),var(--red))}
.empty{padding:3.2rem 1rem}
.empty p{max-width:38ch;margin-inline:auto}
.wave-player{background:rgba(25,21,33,.05);border:1px solid var(--line);border-radius:10px;padding:.5rem .7rem;box-shadow:inset 0 1px 3px rgba(70,45,90,.10)}
.side-brand,.brand{user-select:none}
.gate-card{background:var(--glass);backdrop-filter:blur(20px) saturate(1.4);-webkit-backdrop-filter:blur(20px) saturate(1.4);border:1px solid rgba(255,255,255,.6);border-radius:20px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7), 0 30px 80px -30px rgba(70,45,90,.18);padding:3rem 2.6rem;max-width:560px}

/* account gear + support line (sidebar footer) */
.acct-gear{color:var(--muted);min-width:40px;min-height:40px;display:grid;place-items:center}.acct-gear:hover{color:var(--ink)}
.acct-gear svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.side-support{color:var(--muted);font-size:.78rem}.side-support:hover{color:var(--red)}
.eb-contact{width:100%;font-size:.82rem;color:var(--ink-2)}
.eb-contact a{color:var(--red);text-decoration:underline;text-underline-offset:2px}
#pending-contact a,#susp-contact a{color:var(--red);text-decoration:underline;text-underline-offset:2px}
.consent{align-items:flex-start;font-size:.86rem}
.consent input{margin-top:.15rem}
.cap-hint b{color:var(--red);font-weight:600}
/* credits tile → history link */
.stat-link{color:var(--red);font-size:.78rem;text-decoration:underline;text-underline-offset:2px;margin-left:.5rem}
.stat-link:hover{color:var(--red-2)}
/* cancelled renders read as neutral/terminal, not an error (B-5) */
.chip-cancelled,.chip-cancelling{color:var(--muted);border-color:var(--line-2);background:rgba(25,21,33,.04)}
.job-cancel-row{display:flex;justify-content:flex-end;margin-top:.5rem}
/* admin ops strip + activity (B-8) */
.ops-strip{display:grid;grid-template-columns:1.6fr 1fr;gap:.9rem;margin-bottom:1.1rem}
.ops-card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:1rem 1.15rem}
.ops-head{display:flex;justify-content:space-between;align-items:baseline;font-weight:600;font-size:.9rem;margin-bottom:.7rem}
.ops-head span{color:var(--muted);font-size:.8rem;font-weight:500}
.ops-queue{display:flex;flex-direction:column;gap:.5rem}
.ops-job{display:flex;align-items:center;gap:.6rem;font-size:.85rem;min-width:0}
.ops-job b{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ops-meta{color:var(--muted);font-size:.8rem;white-space:nowrap}
.ops-empty{color:var(--muted);font-size:.85rem}
.admin-activity{margin-top:1.1rem;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:.2rem 1.15rem}
.admin-activity summary{cursor:pointer;padding:.75rem 0;font-weight:600;font-size:.9rem;color:var(--ink-2);list-style:none}
.admin-activity summary::-webkit-details-marker{display:none}
.admin-activity summary::before{content:"▸";margin-right:.5rem;color:var(--muted)}
.admin-activity[open] summary::before{content:"▾"}
.admin-activity summary:hover{color:var(--ink)}
.admin-activity[open] summary{border-bottom:1px solid var(--line);margin-bottom:.3rem}
.ae-row{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;padding:.55rem 0;border-bottom:1px solid var(--line);font-size:.85rem}
.ae-row:last-child{border-bottom:none}
.ae-detail{color:var(--muted)}
.ae-meta{color:var(--muted);font-size:.78rem;white-space:nowrap}
/* credit history dialog (B-7) */
.credit-hist{display:flex;flex-direction:column;max-height:56vh;overflow:auto}
.ch-row{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:.62rem 0;border-bottom:1px solid var(--line)}
.ch-row:last-child{border-bottom:none}
.ch-main{display:flex;flex-direction:column;gap:.15rem;min-width:0}
.ch-main b{font-weight:600;font-size:.9rem}
.ch-meta{color:var(--muted);font-size:.78rem}
.ch-delta{display:flex;flex-direction:column;align-items:flex-end;font-family:var(--mono);font-weight:500;font-size:.92rem;white-space:nowrap}
.ch-delta.pos{color:var(--good)}.ch-delta.neg{color:var(--bad)}
.ch-bal{color:var(--muted);font-size:.72rem}

/* ===================== gate: audition + script (B1) ===================== */
.gate-body{flex:1;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:1.6rem;align-items:start;
  align-content:center; /* tall/wide screens: panels sit centered, not pinned to the top-left */
  padding:0 clamp(1.2rem,4vw,2.6rem) 3rem;max-width:1180px;margin:0 auto;width:100%}
.gate-body .gate-card{margin:0;text-align:left;max-width:none}
.gate-body .gate-card h1{margin-top:.4rem}
.gate-body .gate-card p{margin-inline:0;max-width:46ch}
.gate-body .orb-mark{margin-left:0}
.gate-script-fld{display:flex;flex-direction:column;gap:.45rem;text-align:left;margin-top:.4rem}
.gate-script-fld>span{font-size:.85rem;color:var(--ink-2);font-weight:500}
.gate-note{color:var(--muted);font-size:.8rem;margin:.5rem 0 1.3rem}
.gate-actions{justify-content:flex-start}
.gate-voices{background:var(--glass);backdrop-filter:blur(20px) saturate(1.4);-webkit-backdrop-filter:blur(20px) saturate(1.4);border:1px solid rgba(255,255,255,.6);border-radius:20px;
  padding:1.6rem;box-shadow:inset 0 1px 0 rgba(255,255,255,.7)}
.gv-head h2{font-family:var(--disp);font-size:1.3rem;letter-spacing:-.01em;margin-bottom:.25rem}
.gv-head p{color:var(--ink-2);font-size:.88rem;margin-bottom:1.1rem}
/* preset audition cards, shared gate + pending (B1/B9) */
.pv-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:.8rem}
.pv-card{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:.9rem 1rem;display:flex;flex-direction:column;gap:.7rem}
.pv-top{display:flex;align-items:center;gap:.6rem}
.pv-avatar{width:34px;height:34px;border-radius:10px;flex:none;display:grid;place-items:center;font-weight:700;font-size:.95rem;color:var(--ink-2);
  background:var(--panel-2);border:1px solid var(--line-2)}
.pv-id{min-width:0;flex:1}
.pv-name{font-weight:600;font-size:.96rem}
.pv-tag{color:var(--muted);font-size:.74rem}
.pv-langs{display:inline-flex;gap:.2rem;padding:.15rem;border:1px solid var(--line-2);border-radius:9px;background:rgba(25,21,33,.05);flex:none}
.pv-lang{padding:.28em .6em;border-radius:7px;font-size:.72rem;font-weight:600;color:var(--ink-2)}
.pv-lang.active{background:var(--red);color:#fff}
.pv-player{min-height:44px}

/* ===================== setup checklist (B2) ===================== */
.setup-card{margin-bottom:.9rem}
.setup-step{display:flex;align-items:center;gap:.85rem;padding:.75rem 0;border-bottom:1px solid var(--line);text-align:left}
.setup-step:last-child{border-bottom:none;padding-bottom:0}
.ss-check{width:26px;height:26px;border-radius:50%;flex:none;display:grid;place-items:center;border:1.5px solid var(--line-2);color:var(--muted);font-size:.8rem}
.setup-step.done .ss-check{background:var(--good);border-color:var(--good);color:#f6f2ef}
.ss-main{flex:1;min-width:0}
.ss-title{font-weight:600;font-size:.92rem}
.setup-step.done .ss-title{color:var(--ink-2)}
.ss-sub{color:var(--muted);font-size:.8rem}
.setup-pctbar{height:6px;border-radius:999px;background:rgba(25,21,33,.1);overflow:hidden;margin-bottom:1rem}
/* progress fill → gold (brand); the done-checkmarks below stay green as status marks */
.setup-pctbar i{display:block;height:100%;background:linear-gradient(90deg,var(--gold),var(--gold-2));border-radius:999px;transition:width .3s}

/* ===================== member credits card (B6) ===================== */
.cc-pool{margin-bottom:.9rem}
.cc-pool:last-of-type{margin-bottom:1rem}
.cc-row{display:flex;justify-content:space-between;align-items:baseline;font-size:.86rem;margin-bottom:.35rem}
.cc-row span{color:var(--ink-2)}
.cc-row b{font-family:var(--mono);font-weight:500;font-size:.82rem}
.cc-row b.low{color:var(--bad)}
.mem-fill.gold{background:linear-gradient(90deg,var(--gold),var(--gold-2))}
/* top-up dialog body (B6) */
.topup-price{font-family:var(--mono);font-size:1.6rem;color:var(--ink);margin:.2rem 0}
.topup-price small{font-family:var(--body);font-size:.8rem;color:var(--ink-2)}
#topup-body{display:flex;flex-direction:column;gap:.9rem}
#topup-body textarea{min-height:70px}
/* contact mailto reads as a link, consistent with the other support links (item 10) */
#topup-body a{color:var(--red);text-decoration:underline;text-underline-offset:2px}
#topup-body a:hover{color:var(--red-2)}
/* plan chip on the membership card (from account.plan) */
.plan-chip{display:inline-flex;align-items:center;border:1px solid rgba(122,92,255,.4);background:rgba(122,92,255,.12);
  color:var(--gold);border-radius:999px;padding:.1em .6em;font-size:.7rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;margin-right:.5rem}
/* 3-tier picker in the activation dialog */
.plan-pick{display:flex;flex-direction:column;gap:.55rem;margin:.2rem 0 .3rem}
.pp{display:grid;grid-template-columns:1fr auto;gap:.1rem .8rem;text-align:left;width:100%;
  border:1px solid var(--line-2);border-radius:12px;padding:.75rem .95rem;background:rgba(25,21,33,.05);
  transition:border-color .15s,background .15s;min-height:40px}
.pp:hover{border-color:rgba(235,65,121,.5)}
.pp.sel{border-color:var(--red);background:rgba(235,65,121,.07)}
.pp-name{font-weight:600;display:flex;align-items:center;gap:.55rem}
.pp-pop{font-style:normal;font-size:.62rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  background:var(--red);color:#fff;border-radius:999px;padding:.16em .6em}
.pp-price{font-family:var(--mono);font-size:1.05rem;grid-row:span 2;align-self:center}
.pp-price small{font-family:var(--body);font-size:.72rem;color:var(--muted)}
/* reserve two lines so a 1-line sub-line doesn't leave its card shorter than a wrapping neighbour (item 8) */
.pp-sub{grid-column:1;color:var(--muted);font-size:.78rem;min-height:2.2em}
.pp-delta{grid-column:1;color:var(--muted);font-size:.72rem;margin-top:.1rem;display:block}
/* richer plan cards inside the multi-step wizard */
.pp-out{grid-column:1/-1;font-size:.82rem;color:var(--ink);background:rgba(235,65,121,.06);
  border:1px solid rgba(235,65,121,.14);border-radius:9px;padding:.45rem .6rem;margin-top:.2rem}
.pp-save{grid-column:1/-1;font-size:.74rem;color:var(--good);margin-top:.2rem}
.pp-ideal{grid-column:1/-1;font-size:.72rem;color:var(--muted);font-style:italic;margin-top:.15rem}

/* ---- multi-step paywall wizard ------------------------------------------- */
#topup-dialog form{overflow-y:auto}
.pw-step{display:flex;flex-direction:column;gap:.9rem;animation:pwIn .3s ease}
@keyframes pwIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.pw-steps{display:flex;align-items:center;gap:.4rem}
.pw-steps .pw-lbl{font-family:var(--mono);font-size:.68rem;letter-spacing:.03em;color:var(--muted);white-space:nowrap;margin-right:.35rem}
.pw-steps .pw-dot{height:5px;flex:1;border-radius:3px;background:var(--line-2);transition:background .3s}
.pw-steps .pw-dot.on{background:var(--red)}
.pw-hero{text-align:center;display:flex;flex-direction:column;align-items:center;gap:.7rem;padding:.3rem 0 .1rem}
.pw-orb{width:56px;height:56px;border-radius:16px;display:grid;place-items:center;
  background:radial-gradient(120% 120% at 30% 20%,rgba(235,65,121,.28),rgba(235,65,121,.07));border:1px solid rgba(235,65,121,.35)}
.pw-orb svg{width:26px;height:26px;fill:none;stroke:var(--red);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.pw-h{font-family:var(--disp);font-size:1.45rem;line-height:1.15;letter-spacing:-.01em}
.pw-p{color:var(--ink-2);font-size:.92rem;max-width:36ch;margin:0 auto}
.pw-badge{display:inline-flex;align-items:center;gap:.4rem;font-size:.76rem;color:var(--red-2);
  border:1px solid rgba(235,65,121,.3);border-radius:999px;padding:.28rem .7rem;background:rgba(235,65,121,.06)}
.pw-badge svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.pw-benefits{list-style:none;display:flex;flex-direction:column;gap:.55rem;margin:.1rem 0 0}
.pw-benefits li{display:flex;gap:.6rem;align-items:flex-start;font-size:.9rem;color:var(--ink)}
.pw-benefits svg{width:16px;height:16px;flex:none;margin-top:1px;fill:none;stroke:var(--red);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.pw-nav{display:flex;align-items:center;gap:.6rem}
.pw-nav .pw-back{flex:none}
.pw-sum{border:1px solid var(--line-2);border-radius:14px;padding:.9rem 1.05rem;display:flex;flex-direction:column;gap:.55rem;
  background:linear-gradient(180deg,rgba(235,65,121,.05),transparent)}
.pw-sum-row{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;font-size:.9rem}
.pw-sum-row .k{color:var(--muted)}
.pw-sum-row .v{font-family:var(--mono);color:var(--ink)}
.pw-sum-row .v small{font-family:var(--body);font-size:.72rem;color:var(--muted)}
.pw-sum-total{border-top:1px solid var(--line);padding-top:.55rem}
.pw-sum-total .v{font-size:1.3rem}
.pw-note{display:flex;gap:.55rem;align-items:flex-start;font-size:.82rem;color:var(--ink-2);line-height:1.5;
  border:1px solid rgba(235,65,121,.16);border-radius:10px;padding:.55rem .7rem;background:rgba(235,65,121,.04)}
.pw-note svg{width:15px;height:15px;flex:none;margin-top:2px;fill:none;stroke:var(--red);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.pw-reassure{list-style:none;display:flex;flex-direction:column;gap:.45rem;margin:0}
.pw-reassure li{display:flex;gap:.55rem;align-items:flex-start;font-size:.84rem;color:var(--ink-2)}
.pw-reassure svg{width:15px;height:15px;flex:none;margin-top:1px;fill:none;stroke:var(--good);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}

/* payment-screenshot attach row */
.proof-attach{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap}
.proof-name{color:var(--muted);font-size:.8rem;overflow:hidden;text-overflow:ellipsis;max-width:220px;white-space:nowrap}

/* stat tile: warning tint (B7) */
.stat.stat-warn{border-color:rgba(255,106,82,.5);background:rgba(255,106,82,.07)}
.stat.stat-warn .stat-val{color:var(--bad)}
.stat.stat-warn .stat-sub{color:var(--bad)}

/* studio slider microlabels + hint (B5) */
.slider-ends{display:flex;justify-content:space-between;margin-top:.2rem}
.slider-ends i{font-style:normal;color:var(--muted);font-size:.72rem}
.slider-hint{color:var(--muted);font-size:.78rem;margin:-.4rem 0 1.1rem}
/* studio sample-script chip + credit warning (B3/B8) */
.fld-lbl-row{display:flex;align-items:center;justify-content:space-between;gap:.6rem}
.samplebtn{font-size:.76rem;font-weight:600;color:var(--ink-2);border:1px solid var(--line-2);border-radius:999px;padding:.25em .8em}
.samplebtn:hover{color:var(--ink);border-color:rgba(25,21,33,.3)}
.credit-warn{font-size:.84rem;color:var(--bad);background:rgba(255,106,82,.08);border:1px solid rgba(255,106,82,.35);border-radius:10px;padding:.6rem .85rem}
.msg-admin-link{display:block;text-align:center;font-size:.82rem;color:var(--ink-2);background:none;border:none;padding:.5rem 0 0;cursor:pointer;text-decoration:underline;text-underline-offset:2px}
.msg-admin-link:hover{color:var(--ink)}
.min-chips{display:flex;gap:.4rem;flex-wrap:wrap;margin-top:.5rem}
.chip-btn{font-size:.78rem;font-weight:600;color:var(--ink-2);border:1px solid var(--line-2);border-radius:999px;padding:.3em .85em;background:none;cursor:pointer}
.chip-btn:hover{border-color:rgba(122,92,255,.5);color:var(--ink)}

/* professional voice shelf (B4) */
.sv-shelf{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.6rem}
.sv-card{display:flex;align-items:center;gap:.55rem;background:linear-gradient(180deg,#fffdfb,#fffdfb);border:1px solid var(--line-2);
  border-radius:11px;padding:.6rem .7rem;cursor:pointer;text-align:left;transition:border-color .15s,background .15s}
.sv-card:hover{border-color:rgba(122,92,255,.55)}
.sv-card.sel{border-color:var(--gold);background:rgba(122,92,255,.1);box-shadow:inset 0 0 0 1px rgba(122,92,255,.35)}
.sv-play{width:30px;height:30px;border-radius:50%;flex:none;display:grid;place-items:center;background:var(--gold);color:#fff}
.sv-play svg{width:14px;height:14px;fill:currentColor}
.sv-play.playing{background:var(--gold-2)}
.sv-id{display:flex;flex-direction:column;min-width:0}
.sv-name{font-weight:600;font-size:.9rem;display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;min-width:0}
.sv-name-txt{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.q-badge{white-space:nowrap;flex:none}
.sv-tag{color:var(--muted);font-size:.72rem}
/* voice tier groups (Premium / Deluxe) + locked cards + quality badge */
.svgroup-h{font-weight:600;font-size:.82rem;color:var(--ink-2);margin:.9rem 0 .5rem;text-transform:uppercase;letter-spacing:.04em}
.svgroup-h:first-child{margin-top:0}
.sv-card.locked{cursor:pointer;opacity:.75}
.sv-card.locked:hover{border-color:rgba(122,92,255,.4);opacity:1}
.sv-card.locked .sv-play{background:var(--panel-2);color:var(--muted)}
.sv-lock{width:14px;height:14px;flex:none;color:var(--muted)}
.q-badge{display:inline-flex;align-items:center;font-size:.6rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase;
  padding:.1em .45em;border-radius:999px;flex:none}
.q-badge.q-ultra{background:var(--grad);color:#fff}
.q-badge.q-premium{background:none;border:1px solid var(--line-2);color:var(--ink-2)}
/* delivery-mode segmented control (v3 voices, sarvam mode only) */
.delivery-switch{flex-wrap:wrap;background:rgba(25,21,33,.05)}
.delivery-switch .ms-opt{padding:.4rem .75rem;font-size:.82rem}
.delivery-switch .ms-opt.sel{background:var(--grad2);color:#fff}

/* empty-state action buttons (B10) */
.empty-actions{display:flex;gap:.6rem;justify-content:center;flex-wrap:wrap;margin-top:1.2rem}
/* activity icons switch to stroked SVGs (B12) */
.act-ic svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

/* pending waiting room (B9) */
.wait-aside{margin-top:1.4rem;max-width:720px;margin-inline:auto}
.wait-steps{list-style:none;display:flex;flex-direction:column;gap:0;text-align:left;margin:.4rem 0 .4rem}
.wait-steps li{display:flex;gap:.85rem;padding:0 0 1.1rem;position:relative}
.wait-steps li:not(:last-child)::before{content:"";position:absolute;left:8px;top:20px;bottom:0;width:2px;background:var(--line-2)}
.wait-steps li.ws-done:not(:last-child)::before{background:var(--good)}
.ws-dot{width:18px;height:18px;border-radius:50%;flex:none;border:2px solid var(--line-2);background:var(--panel);margin-top:1px;z-index:1}
.ws-done .ws-dot{background:var(--good);border-color:var(--good)}
.ws-now .ws-dot{border-color:var(--red);box-shadow:0 0 0 4px rgba(235,65,121,.15)}
.wait-steps li b{font-weight:600;font-size:.92rem;display:block}
.wait-steps li small{color:var(--muted);font-size:.8rem}

/* ---- achievements / progress narrative (Phase 1) ---------------------------- */
.achieve-card{margin-bottom:.9rem}
.an-lead{font-size:.92rem;color:var(--ink-2);margin-bottom:.7rem}
.an-lead b{color:var(--ink);font-weight:600}
.an-bar{height:7px;border-radius:999px;background:rgba(25,21,33,.1);overflow:hidden}
.an-bar i{display:block;height:100%;background:linear-gradient(90deg,var(--red),var(--red-2));border-radius:999px;transition:width .45s ease}
.badge-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:.6rem;margin-top:1rem}
.badge{display:flex;align-items:center;gap:.7rem;padding:.7rem .8rem;border:1px solid var(--line);border-radius:11px;background:rgba(25,21,33,.02)}
.badge.earned{border-color:rgba(235,65,121,.4);background:linear-gradient(180deg,rgba(235,65,121,.09),transparent)}
.badge-ic{width:32px;height:32px;flex:none;border-radius:50%;display:grid;place-items:center;border:1px solid var(--line-2);color:var(--muted)}
.badge.earned .badge-ic{border-color:var(--red);color:var(--red);background:rgba(235,65,121,.12)}
.badge-ic svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.badge-label{font-weight:600;font-size:.88rem;color:var(--ink-2)}
.badge.earned .badge-label{color:var(--ink)}
.badge-note{color:var(--muted);font-size:.76rem;margin-top:.12rem;line-height:1.4}
/* ---- next-step insights strip ---------------------------------------------- */
.dash-insights{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:.6rem;margin-bottom:.9rem}
.insight{display:flex;align-items:flex-start;gap:.7rem;text-align:left;padding:.85rem .95rem;border:1px solid var(--line);border-radius:12px;
  background:linear-gradient(180deg,rgba(25,21,33,.03),transparent);transition:border-color .18s ease,transform .18s ease}
.insight:hover{border-color:rgba(235,65,121,.5);transform:translateY(-1px)}
.insight-ic{width:32px;height:32px;flex:none;border-radius:9px;background:var(--panel-2);display:grid;place-items:center;color:var(--red);
  transition:box-shadow .2s ease,background .2s ease}
.insight-ic svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.insight:hover .insight-ic{box-shadow:0 0 0 1px rgba(235,65,121,.35),0 0 14px rgba(235,65,121,.22);background:rgba(235,65,121,.1)}
.insight-main{display:flex;flex-direction:column;gap:.2rem;min-width:0;flex:1}
.insight-head{font-weight:600;font-size:.9rem}
.insight-body{color:var(--ink-2);font-size:.8rem;line-height:1.45}
.insight-go{color:var(--red);font-weight:600;flex:none;align-self:center;transition:transform .18s ease}
.insight:hover .insight-go{transform:translateX(3px)}
/* ---- "your wins" story cards (replaces the flat recent-renders list) --------- */
.story{padding:.9rem 0;border-bottom:1px solid var(--line)}
.story:last-child{border-bottom:none;padding-bottom:0}
.story:first-child{padding-top:0}
.story-head{display:flex;align-items:center;gap:.8rem}
.story-ic{width:34px;height:34px;flex:none;border-radius:9px;background:var(--panel-2);display:grid;place-items:center;color:var(--red)}
.story-ic svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.story-headmain{flex:1;min-width:0}
.story-title{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.story-meta{color:var(--muted);font-size:.82rem;margin-top:.1rem}
.story-chip{flex:none}
.story-play{margin-top:.7rem}
.story-tip{display:flex;align-items:flex-start;gap:.4rem;color:var(--ink-2);font-size:.8rem;margin-top:.65rem;line-height:1.45}
.story-tip svg{width:15px;height:15px;flex:none;margin-top:.12rem;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;color:var(--red)}
.story-actions{display:flex;gap:.55rem;flex-wrap:wrap;margin-top:.7rem}
/* ---- credit "why this matters" context ------------------------------------- */
.credit-context{border-top:1px solid var(--line);margin:.2rem 0 .9rem;padding-top:.75rem}
.ctx-row{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;font-size:.82rem;margin-bottom:.4rem}
.ctx-row span{color:var(--ink-2)}
.ctx-row b{font-weight:500;text-align:right}
.ctx-tip{color:var(--muted);font-size:.76rem;line-height:1.45;margin-top:.5rem}

/* responsive */
@media(max-width:900px){.ops-strip{grid-template-columns:1fr}}
@media(max-width:860px){.gate-body{grid-template-columns:1fr}}
@media(max-width:820px){
  /* RC1 — stop the grid track inflating to content min-width; let content shrink */
  .shell{grid-template-columns:minmax(0,1fr)}
  .side,.content{min-width:0;max-width:100vw}
  main.content{min-width:0}
  .stat-row,.dash-grid,.dash-side,.spark-bars,.act,.act-main,.hist,.hist-main,.ops-job,.studio,.studio-main,.tablewrap{min-width:0}
  /* slim sticky top bar: brand + account row, with a horizontal icon nav beneath (B-11) */
  .side{position:sticky;top:0;z-index:40;height:auto;flex-direction:row;flex-wrap:wrap;align-items:center;
    gap:.5rem 1rem;padding:.55rem .9rem;border-right:none;border-bottom:1px solid var(--line);background:var(--side)}
  .side-brand{padding:0;font-size:1.2rem}
  .side-nav{order:3;width:100%;flex-direction:row;flex-wrap:nowrap;gap:.15rem;overflow-x:auto}
  /* B13 — bottom-nav labels ≥12px; tighten padding so 5 tabs still fit at 360px */
  .side-nav button{flex:1;flex-direction:column;gap:.15rem;padding:.4rem .15rem;font-size:.75rem;text-align:center;justify-content:center;white-space:nowrap;min-width:0}
  .side-nav button svg{width:20px;height:20px}
  .side-foot{order:2;margin:0 0 0 auto;flex-direction:row;align-items:center;gap:.7rem;width:auto}
  .role-line,.side-support,.engine b{display:none}
  .acct{border-top:none;padding-top:0;gap:.4rem}
  .acct-email{display:none}
  .pcount{margin-left:.2rem}
  /* Studio: single column; aside is first in DOM, so pin visual order to put the form first */
  .studio{grid-template-columns:1fr}
  .studio-main{grid-column:auto;grid-row:auto;order:1}
  .studio-side{grid-column:auto;grid-row:auto;order:2}
  /* dashboard: stat tiles 2-up (1-up on the narrowest phones), chart never wider than its panel */
  .stat-row{grid-template-columns:repeat(2,minmax(0,1fr))}
  .spark-bars{width:100%}
  .sbar:first-child .tip{left:0;transform:none}
  .sbar:last-child .tip{left:auto;right:0;transform:none}
  /* M2/RC4 — Members: collapse the table into stacked cards, all actions reachable */
  .tablewrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .mtable,.mtable tbody,.mtable tr,.mtable td{display:block;width:100%}
  .mtable thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .mtable tr{border:1px solid var(--line);border-radius:12px;padding:.7rem .85rem;margin:.7rem;background:rgba(25,21,33,.02)}
  .mtable tr:last-child td{border-bottom:none}
  .mtable td{border-bottom:none;padding:.3rem 0}
  .memail,.mmeta,.mcredits,.mact{white-space:normal}
  .memail{word-break:break-word}
  .mnote{max-width:100%}
  .mact{justify-content:flex-start;flex-wrap:wrap;gap:.5rem}
  .mact .btn,.creditbtn{min-height:40px;display:inline-flex;align-items:center}
  .eb-form input{min-width:0}
  /* M10 — kill iOS zoom-on-focus */
  input,select,textarea{font-size:16px}
  /* M11 — tap targets */
  input[type=checkbox]{width:20px;height:20px}
  input[type=range]{height:28px}
  .dlg-x{width:40px;height:40px;display:flex;align-items:center;justify-content:center;top:.6rem;right:.7rem}
  #auth-pw-toggle{min-height:40px;display:inline-flex;align-items:center}
  /* new UI obeys the 40px tap-target rule (B13) */
  .pv-lang,.samplebtn{min-height:40px;display:inline-flex;align-items:center}
  .sv-card{min-height:56px}
  .sv-play,.pv-avatar{min-width:40px;min-height:40px}
  .setup-step{min-height:44px}
  /* gate/pending audition cards stack 1-up; professional-voice cards stay 2-up */
  .pv-grid{grid-template-columns:1fr}
  .sv-shelf{grid-template-columns:repeat(2,minmax(0,1fr))}
  .gate-body{padding-bottom:2rem}
  /* M13 — mobile-audit round 2 */
  .stat-cost .stat-val{white-space:normal}                       /* 13px page overflow at 390 */
  .hist{grid-template-columns:minmax(0,1fr)}                      /* action cluster starved the title to 0px */
  .hist-right{justify-content:flex-start}
  .act{flex-wrap:wrap}.act-right{margin-left:auto}
  #toasts{bottom:5.2rem}                                          /* clear the Generate CTA at page bottom */
  .btn-sm{min-height:44px}                                        /* Touch targets: 44px for accessibility */
  /* M12 — floor user-facing text at 12px */
  .spark-axis,.sbar .tip,.chip,.role-chip,.pro-badge,.pp-pop,.plan-chip,.pp-price small,.sv-tag{font-size:.75rem}
  /* toasts sit at the bottom (top nav is sticky up top, so no collision here); span the width
     safely on narrow phones instead of overflowing the viewport edge */
  #toasts{left:1.1rem;right:1.1rem}
  .toast{max-width:none}
}
@media(prefers-reduced-motion:reduce){.orb-mark{animation:none}.view{animation:none}}

/* ============ support chat (member <-> admin) ============ */
#chat-fab{position:fixed;right:1.1rem;bottom:1.1rem;z-index:210;width:52px;height:52px;border-radius:50%;
  border:1px solid var(--line);background:var(--red);cursor:pointer;display:grid;place-items:center;
  box-shadow:0 6px 22px rgba(70,45,90,.12)}
#chat-fab svg{width:24px;height:24px;fill:#fff}
#chat-fab:hover{filter:brightness(1.08)}
#chat-badge{position:absolute;top:-4px;right:-4px;min-width:19px;height:19px;border-radius:10px;background:#fff;
  color:var(--red);font-size:.7rem;font-weight:700;display:grid;place-items:center;padding:0 5px}
#chat-panel{position:fixed;right:1.1rem;bottom:5.4rem;z-index:210;width:min(360px,calc(100vw - 2.2rem));
  height:min(480px,70vh);display:flex;flex-direction:column;background:var(--panel,#fffdfb);
  border:1px solid var(--line);border-radius:16px;overflow:hidden;box-shadow:0 18px 50px rgba(70,45,90,.14)}
.chat-head{display:flex;align-items:center;gap:.6rem;padding:.7rem .9rem;border-bottom:1px solid var(--line)}
.chat-title{flex:1;min-width:0;display:flex;flex-direction:column}
.chat-title b{font-size:.95rem}
.chat-title small{color:var(--ink-2,#6f6773);font-size:.74rem}
#chat-close,#chat-back{background:none;border:0;color:var(--ink,#191521);font-size:1.15rem;cursor:pointer;padding:.2rem .4rem}
#chat-msgs{flex:1;overflow-y:auto;padding:.8rem;display:flex;flex-direction:column;gap:.45rem}
.chat-b{max-width:82%;padding:.5rem .75rem;border-radius:14px;font-size:.88rem;line-height:1.45;white-space:pre-wrap;word-break:break-word}
.chat-b.me{align-self:flex-end;background:var(--red);color:#fff;border-bottom-right-radius:4px}
.chat-b.them{align-self:flex-start;background:rgba(25,21,33,.08);border-bottom-left-radius:4px}
.chat-day{align-self:center;color:var(--ink-2,#6f6773);font-size:.7rem;margin:.3rem 0}
#chat-form{display:flex;gap:.5rem;padding:.6rem;border-top:1px solid var(--line)}
#chat-input{flex:1;min-width:0;background:rgba(25,21,33,.05);border:1px solid var(--line);border-radius:10px;
  color:var(--ink,#191521);padding:.55rem .7rem;font:inherit;font-size:16px}
#chat-list{flex:1;overflow-y:auto}
.chat-thread{display:flex;flex-direction:column;gap:.15rem;width:100%;text-align:left;background:none;border:0;
  border-bottom:1px solid var(--line);padding:.7rem .9rem;cursor:pointer;color:var(--ink,#191521)}
.chat-thread:hover{background:rgba(25,21,33,.05)}
.chat-thread .ct-top{display:flex;justify-content:space-between;gap:.6rem}
.chat-thread .ct-top b{font-size:.86rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-thread .ct-unread{background:var(--red);color:#fff;border-radius:9px;font-size:.68rem;font-weight:700;
  padding:.1rem .45rem;flex:none}
.chat-thread small{color:var(--ink-2,#6f6773);font-size:.76rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-empty{margin:auto;padding:1.5rem;text-align:center;color:var(--ink-2,#6f6773);font-size:.85rem}
/* mobile: chat becomes a full-screen sheet; the FAB hides while it's open (JS toggles .chat-open on body) */
@media (max-width:640px){
  #chat-panel{inset:0;width:auto;height:auto;max-width:none;border-radius:0}
  body.chat-open #chat-fab{display:none}
  /* Touch targets: 44px minimum for accessibility */
  .btn{min-height:44px;min-width:44px}
}

/* payment-confirmation veil (between checkout closing and backend confirmation) */
#pay-wait{position:fixed;inset:0;z-index:300;display:grid;place-items:center;
  background:rgba(25,21,33,.82);backdrop-filter:blur(7px)}
#pay-wait[hidden]{display:none}
.pw-card{display:flex;flex-direction:column;align-items:center;gap:.8rem;text-align:center;
  background:var(--panel,#fffdfb);border:1px solid var(--line);border-radius:18px;
  padding:2.2rem 2.6rem;max-width:320px}
.pw-card b{font-size:1.02rem}
.pw-card small{color:var(--ink-2,#6f6773);font-size:.8rem;line-height:1.5}
.pw-spin{width:34px;height:34px;border-radius:50%;border:3px solid rgba(25,21,33,.15);
  border-top-color:var(--red);animation:pwspin .8s linear infinite}
@keyframes pwspin{to{transform:rotate(360deg)}}
