/* Look copied from the Mac page (MeanVC2/ui/index.html), trimmed to what these screens use. */
:root {
  --bg:#fcfcfc; --side:#fafafa; --card:#ffffff; --hover:#f4f4f5; --line:#e4e4e7; --input:#d4d4d8;
  --ink:#18181b; --soft:#52525b; --accent:#2148d8; --accent:oklch(48.8% .217 264); --on-accent:#ffffff;
  --tint:#eef2ff; --ok:#047857; --ok-tint:#ecfdf5; --warn:#b42318; --warn-tint:#fef3f2;
  --font:-apple-system, BlinkMacSystemFont, "Inter Variable", "Segoe UI", system-ui, sans-serif;
  color-scheme:light;
}
* { box-sizing:border-box; }
html, body { height:100%; }
body { margin:0; background:var(--bg); color:var(--ink); font:15px/1.5 var(--font); -webkit-font-smoothing:antialiased; }
p, h1, h2, h3 { margin:0; }
[hidden] { display:none !important; }
.ic { width:18px; height:18px; flex:none; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
button, select, input, textarea { font:inherit; color:inherit; }
button { cursor:pointer; }
button:disabled { cursor:not-allowed; opacity:.5; }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

/* ---- frame: sidebar + one page at a time ---- */
.app { display:grid; grid-template-columns:244px minmax(0,1fr); height:100%; }
.nav { background:var(--side); border-right:1px solid var(--line); display:flex; flex-direction:column; gap:2px; padding:8px; overflow-y:auto; }
.brand { display:flex; align-items:center; gap:8px; padding:8px 8px 8px; font-weight:650; }
.brand .logo { width:28px; height:28px; border-radius:8px; background:var(--accent); color:var(--on-accent); display:flex; align-items:center; justify-content:center; flex:none; }
.grp { font-size:13px; font-weight:600; padding:16px 8px 4px; }
.nav a { display:flex; align-items:center; gap:8px; padding:8px 8px; border-radius:8px; border:1px solid transparent;
         color:inherit; text-decoration:none; font-weight:500; white-space:nowrap; }
.nav a:hover { background:var(--hover); }
.nav a.cur { background:var(--card); border-color:var(--line); box-shadow:0 1px 2px rgb(0 0 0 / .05); }
.nav a.cur .ic { color:var(--accent); }
.nav a .s { display:none; }
.nav a .dot { margin-left:auto; width:8px; height:8px; border-radius:50%; background:var(--ok); flex:none; }
.nav a .dot.busy { background:var(--accent); }
.foot { margin-top:auto; padding-top:8px; }
.status { display:flex; align-items:center; gap:8px; width:100%; text-align:left; padding:8px; border-radius:8px;
          border:1px solid var(--line); background:var(--card); font-weight:600; }
.status .lamp { width:10px; height:10px; border-radius:50%; border:2px solid var(--ink); flex:none; }
.status.on { border-color:var(--ok); background:var(--ok-tint); color:var(--ok); }
.status.on .lamp { background:var(--ok); border-color:var(--ok); }
.status span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

main { min-width:0; overflow-y:auto; display:flex; flex-direction:column; }
.top { position:sticky; top:0; z-index:5; min-height:52px; display:flex; align-items:center; gap:8px; padding:0 16px;
       background:var(--bg); border-bottom:1px solid var(--line); }
.top h1 { font-size:15px; font-weight:650; display:flex; align-items:center; gap:8px; min-width:0; }
.top h1 span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.top .status { width:auto; margin-left:auto; padding:4px 8px; border-radius:999px; font-size:14px; display:none; }
.icon-btn { width:32px; height:32px; border-radius:8px; border:0; background:none; display:flex; align-items:center; justify-content:center; flex:none; }
.icon-btn:hover { background:var(--hover); }
.page { width:100%; max-width:760px; margin:0 auto; padding:28px 20px 72px; display:flex; flex-direction:column; gap:16px; }
.page.wide { max-width:1120px; }
.lead { font-size:16px; }

/* compact sidebar: icons with a short name under each */
[data-mode=rail] .app { grid-template-columns:84px minmax(0,1fr); }
[data-mode=rail] .nav, [data-mode=tabs] .nav { align-items:stretch; }
[data-mode=rail] .brand span, [data-mode=tabs] .brand, [data-mode=rail] .grp, [data-mode=tabs] .grp { display:none; }
[data-mode=rail] .brand { justify-content:center; padding-bottom:8px; }
[data-mode=rail] .nav a, [data-mode=tabs] .nav a { flex-direction:column; gap:4px; padding:8px 2px; font-size:12px; position:relative; text-align:center; }
[data-mode=rail] .nav a .l, [data-mode=tabs] .nav a .l { display:none; }
[data-mode=rail] .nav a .s, [data-mode=tabs] .nav a .s { display:block; }
[data-mode=rail] .nav a .ic, [data-mode=tabs] .nav a .ic { width:20px; height:20px; }
[data-mode=rail] .nav a .dot, [data-mode=tabs] .nav a .dot { position:absolute; top:8px; right:16px; margin:0; }
[data-mode=rail] .sep { height:1px; background:var(--line); margin:8px 8px; }
[data-mode=rail] .foot .status span, [data-mode=tabs] .foot { display:none; }
[data-mode=rail] .foot .status { justify-content:center; }
/* pages across the top: also what a phone gets */
[data-mode=tabs] .app { grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); }
[data-mode=tabs] .nav { flex-direction:row; border-right:0; border-bottom:1px solid var(--line); overflow-x:auto; overflow-y:hidden; padding:8px 8px; gap:4px; }
[data-mode=tabs] .nav a { min-width:72px; flex:1 0 auto; }
[data-mode=tabs] .top .status { display:flex; }
[data-mode=tabs] #fold { display:none; }

/* ---- parts ---- */
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; }
.card > h2 { font-size:15px; font-weight:650; padding:16px 16px 0; display:flex; align-items:center; gap:8px; }
.card > h2 + .row { border-top:0; }
.pad { padding:16px; display:flex; flex-direction:column; gap:12px; }
.row { display:flex; align-items:center; gap:16px; padding:12px 16px; border-top:1px solid var(--line); }
.row:first-child { border-top:0; }
.row .txt { flex:1; min-width:0; }
.row .txt b { display:flex; align-items:center; gap:8px; font-weight:550; }
.row .txt p { color:var(--soft); font-size:14px; }
.row .txt p:empty { display:none; }
.row select { width:250px; max-width:46vw; }
@media (max-width:560px) { .row.stack { flex-direction:column; align-items:stretch; gap:8px; } .row.stack select { width:100%; max-width:none; } .row.stack .seg { align-self:flex-start; } }
select, input[type=text], textarea { background:var(--card); border:1px solid var(--input); border-radius:8px; padding:8px 8px; min-height:36px; }
textarea { width:100%; min-height:96px; resize:vertical; }
input[type=text] { width:100%; }
label { font-weight:550; }
.field { display:flex; flex-direction:column; gap:4px; }
.sw { width:38px; height:22px; border-radius:999px; border:0; background:var(--input); position:relative; flex:none; padding:0; transition:background .15s; }
.sw::after { content:""; position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgb(0 0 0 / .25); transition:translate .15s; }
.sw.sel { background:var(--accent); }
.sw.sel::after { translate:16px 0; }
.seg { display:inline-flex; background:var(--hover); border-radius:8px; padding:2px; gap:2px; flex-wrap:wrap; }
.seg button { border:0; background:none; border-radius:6px; padding:4px 12px; font-weight:500; }
.seg button.sel { background:var(--card); box-shadow:0 0 0 1px var(--line), 0 1px 2px rgb(0 0 0 / .06); font-weight:650; }
.btn { display:inline-flex; align-items:center; gap:8px; min-height:36px; padding:0 16px; border-radius:8px; border:1px solid var(--input);
       background:var(--card); font-weight:550; text-decoration:none; color:inherit; white-space:nowrap; }
.btn:hover:not(:disabled) { background:var(--hover); }
.btn.sq { width:48px; padding:0; justify-content:center; }
.vh { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.btn.pri { background:var(--accent); border-color:transparent; color:var(--on-accent); }
.btn.pri:hover:not(:disabled) { background:var(--accent); filter:brightness(1.1); }
.btns { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.pill { font-size:13px; font-weight:650; color:var(--ok); background:var(--ok-tint); border-radius:999px; padding:2px 8px; white-space:nowrap; }
.pill.blue { color:var(--accent); background:var(--tint); }
.warn { color:var(--warn); font-weight:550; }
.ok { display:flex; gap:8px; align-items:center; font-weight:650; color:var(--ok); font-size:17px; }
.ok .ic { width:24px; height:24px; }
.bar { height:8px; border-radius:999px; overflow:hidden; background:var(--hover); }
.bar > i { display:block; height:100%; width:0; background:var(--accent); border-radius:999px; transition:width .12s linear; }
.bar.green > i { background:var(--ok); }

/* the big on/off button with its words beside it */
.hero { display:flex; align-items:center; gap:24px; padding:24px; }
.hero .say { flex:1; min-width:0; display:flex; flex-direction:column; gap:8px; }
.hero h2 { font-size:22px; font-weight:700; letter-spacing:-.01em; line-height:1.25; }
.disc { width:92px; height:92px; border-radius:50%; border:0; background:var(--accent); color:var(--on-accent); flex:none;
        display:flex; align-items:center; justify-content:center; transition:filter .12s; padding:0; }
.disc .ic { width:36px; height:36px; }
.disc:hover:not(:disabled) { filter:brightness(1.12); }
.disc.on { background:var(--ok); box-shadow:0 0 0 5px var(--ok-tint), 0 0 0 6px var(--ok); }
.disc:disabled { background:var(--hover); color:var(--ink); opacity:1; border:1px dashed var(--input); }
@media (max-width:560px) { .hero { flex-direction:column; text-align:center; } .hero .say { align-items:center; } }
.levels { display:grid; grid-template-columns:auto minmax(0,1fr); gap:8px 12px; align-items:center; padding:0 24px 20px; font-weight:550; font-size:14px; }

/* each setting is a tile, and its control is drawn as the thing it adjusts */
.tiles { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap:12px; }
.set { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; display:flex; flex-direction:column; gap:12px; min-width:0; --empty:var(--line); }
.set[data-kind=onoff] { grid-column:1 / -1; }
.set .head { display:flex; justify-content:space-between; align-items:center; gap:12px; min-height:28px; }
.set .head label, .set .head > b { font-weight:600; }
.set output { font-weight:700; font-size:17px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.set.moved output, .set.moved .step b { color:var(--accent); }
.set small { font-size:14px; color:var(--soft); }
.set small b { color:var(--ink); font-weight:550; white-space:nowrap; }
.dia { display:inline-block; width:8px; height:8px; rotate:45deg; background:var(--ink); margin:0 8px 0 4px; }
/* a real slider lies invisibly over each drawing, so dragging, clicking and the arrow keys all work */
.ctl { position:relative; padding:12px 12px 0; }
.ctl input[type=range] { position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; cursor:pointer; -webkit-appearance:none; appearance:none; }
.ctl input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; width:24px; height:40px; }
.ctl:has(input:focus-visible) { outline:2px solid var(--accent); outline-offset:4px; border-radius:8px; }
.art { position:relative; height:40px; }
.fill { position:absolute; inset:0 auto 0 0; width:calc(var(--p) * 100%); background:var(--accent); }
.hand { position:absolute; top:0; bottom:0; left:calc(var(--p) * 100%); width:4px; translate:-50% 0; border-radius:4px; background:var(--ink); }
.knob { position:absolute; top:50%; left:calc(var(--p) * 100%); width:20px; height:20px; translate:-50% -50%; border-radius:50%; background:var(--card); border:2px solid var(--ink); box-shadow:0 1px 2px rgb(0 0 0 / .2); }
.ctl:hover .knob { border-color:var(--accent); }
.norm { position:absolute; top:-12px; left:calc(var(--n) * 100%); width:8px; height:8px; translate:-50% 0; rotate:45deg; background:var(--ink); }
/* volume: a wedge that grows as it gets louder */
.wedge { position:absolute; inset:0; background:var(--empty); clip-path:polygon(0 100%, 0 80%, 100% 0, 100% 100%); }
/* how much, in percent: a thick bar that fills */
.pbar { position:absolute; inset:8px 0; border-radius:8px; background:var(--empty); overflow:hidden; }
/* a loudness level: meter bars with a pointer on top */
.leds { position:absolute; inset:12px 0 0; display:flex; gap:4px; }
.leds i { flex:1; border-radius:2px; background:var(--empty); }
.leds i.on { background:var(--accent); }
.ptr { position:absolute; top:0; left:calc(var(--p) * 100%); width:12px; height:8px; translate:-50% 0; background:var(--ink); clip-path:polygon(0 0, 100% 0, 50% 100%); }
/* between two ends, or either side of zero: a thin line with a round knob */
.line { position:absolute; left:0; right:0; top:16px; height:8px; border-radius:4px; background:var(--empty); overflow:hidden; }
.zero { position:absolute; top:8px; height:24px; width:2px; translate:-50% 0; background:var(--ink); }
.ends { display:flex; justify-content:space-between; gap:12px; font-size:13px; font-weight:550; padding-top:4px; }
/* a length of time: a ruler */
.rule { position:absolute; inset:8px 0; border-radius:4px; background:var(--empty); overflow:hidden; }
.scale { position:relative; height:24px; font-size:12px; font-variant-numeric:tabular-nums; }
.scale span { position:absolute; top:8px; translate:-50% 0; line-height:16px; }
.scale span::before { content:""; position:absolute; left:50%; top:-4px; width:1px; height:4px; background:var(--ink); }
/* fade in: the sound rising from nothing to full */
.ramp { position:absolute; inset:0; border-radius:4px; background:var(--empty); overflow:hidden; }
.ramp i { position:absolute; inset:0; background:var(--accent); clip-path:polygon(0 100%, calc(var(--p) * 100%) 0, 100% 0, 100% 100%); }
/* rumble cut: the low end of the sound, with the removed part struck out */
.band { position:absolute; inset:8px 0; border-radius:4px; background:var(--accent); overflow:hidden; }
.gone { position:absolute; inset:0 auto 0 0; width:calc(var(--p) * 100%); background:var(--warn-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M-2 2l4-4M0 8l8-8M6 10l4-4' stroke='%23b42318' stroke-width='1.5'/%3E%3C/svg%3E"); }
/* on or off, and a few numbered choices: pills */
.onoff, .nums { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0, 1fr); gap:4px; padding:4px; border:1px solid var(--input); border-radius:999px; background:var(--card); }
.onoff { width:152px; flex:none; }
.onoff button, .nums button { border:0; background:none; border-radius:999px; min-height:32px; padding:0 8px; font-weight:600; }
.onoff button:hover, .nums button:hover { background:var(--hover); }
.onoff button.sel, .nums button.sel { background:var(--accent); color:var(--on-accent); }
.onoff button.sel:first-child { background:var(--ink); color:var(--card); }
/* a count of slices: boxes you fill */
.pips { display:flex; gap:4px; }
.pips button, .pips i { flex:1; min-width:0; height:36px; border-radius:6px; border:1px solid var(--input); background:var(--card); padding:0; }
.pips button.on { background:var(--accent); border-color:var(--accent); }
.pips i { border-style:dashed; background:none; }
/* a limit: a number with less and more */
.step { display:flex; align-items:center; gap:12px; }
.step button { width:40px; height:40px; border-radius:50%; border:1px solid var(--input); background:var(--card); font-size:22px; line-height:1; padding:0; flex:none; }
.step button:hover:not(:disabled), .quick button:hover { background:var(--hover); }
.step b { flex:1; text-align:center; font-size:24px; font-weight:700; font-variant-numeric:tabular-nums; }
.quick { display:flex; flex-wrap:wrap; gap:8px; }
.quick button { border:1px solid var(--input); background:var(--card); border-radius:999px; padding:4px 12px; font-weight:550; }
.quick button.sel { background:var(--accent); border-color:var(--accent); color:var(--on-accent); }
.pair { display:flex; gap:8px; align-items:center; }
.pair input { flex:1; min-width:0; }
.msg:empty { display:none; }

/* ---- additions for the shared web / phone screens ---- */
body { overscroll-behavior:none; }
.app { height:100dvh; }
main { position:relative; }
input[type=password], input[type=url] { width:100%; background:var(--card); border:1px solid var(--input); border-radius:8px; padding:8px; min-height:40px; }
.soft { color:var(--soft); }
.hint { color:var(--soft); font-size:14px; }
.hint:empty { display:none; }
.login { max-width:400px; margin:12vh auto 0; padding:0 16px; display:flex; flex-direction:column; gap:16px; }
.login .brand { padding:0; font-size:17px; }
.btn.block { width:100%; justify-content:center; min-height:40px; }
.row .btn { flex:none; }
.voice-row select { width:250px; max-width:46vw; }
.voice-row .pick { display:flex; gap:8px; align-items:center; flex:none; }
@media (max-width:560px) { .voice-row { flex-direction:column; align-items:stretch; gap:8px; } .voice-row .pick { width:100%; } .voice-row .pick select { flex:1; width:auto; max-width:none; min-width:0; } }
/* the edit page: tab row, before/after, and a bar that keeps Save in reach */
.tabs-row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.ab { display:flex; flex-wrap:wrap; gap:8px; }
.ab .btn .ic { width:15px; height:15px; fill:currentColor; }
.ab .btn.on { border-color:var(--accent); color:var(--accent); background:var(--tint); }
.notebar { height:6px; border-radius:999px; background:var(--hover); overflow:hidden; }
.notebar > i { display:block; height:100%; width:0; background:var(--warn); }
.savebar { position:sticky; bottom:0; z-index:4; margin-top:auto; background:var(--bg); border-top:1px solid var(--line); }
.savebar .in { max-width:1120px; margin:0 auto; padding:12px 20px; display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.savebar .state { flex:1 1 160px; min-width:0; font-weight:550; }
.savebar .state.dirty { color:var(--accent); }
.set .choice { display:flex; flex-wrap:wrap; gap:8px; }
.set.off { opacity:.45; }
.set .unused { font-size:13px; color:var(--soft); }
/* pop-up sheets and the small message at the bottom */
.scrim { position:fixed; inset:0; background:rgb(0 0 0 / .3); z-index:30; }
.sheet { position:fixed; z-index:31; left:50%; top:50%; translate:-50% -50%; width:min(460px, calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow-y:auto;
         background:var(--card); border:1px solid var(--line); border-radius:12px; box-shadow:0 10px 28px rgb(0 0 0 / .16); padding:20px; display:flex; flex-direction:column; gap:12px; }
.sheet h2 { font-size:17px; font-weight:650; }
.sheet ol { margin:0; padding-left:20px; display:flex; flex-direction:column; gap:8px; }
#toast { position:fixed; left:50%; bottom:88px; translate:-50% 0; z-index:40; background:var(--ink); color:var(--card); padding:8px 16px; border-radius:8px; font-weight:550; max-width:calc(100vw - 32px); }
#toast.err { background:var(--warn); color:#fff; }
@media (max-width:560px) { .savebar .in { padding:8px 16px; } .savebar .state { flex-basis:100%; font-size:14px; } }

/* the Voices page: one row per voice */
.vrow { display:flex; align-items:center; gap:12px; padding:12px 16px; border-top:1px solid var(--line); flex-wrap:wrap; }
.vrow:first-child { border-top:0; }
.vrow .ava { width:34px; height:34px; border-radius:50%; background:var(--hover); display:flex; align-items:center; justify-content:center; flex:none; }
.vrow.cur .ava { background:var(--accent); color:var(--on-accent); }
.vrow .what { flex:1 1 160px; min-width:0; }
.vrow .what b { display:flex; align-items:center; gap:8px; font-weight:600; overflow-wrap:anywhere; }
.vrow .what span { font-size:14px; color:var(--soft); }
.vrow .acts { display:flex; gap:8px; flex-wrap:wrap; }
.vrow .acts .btn { min-height:34px; padding:0 12px; }
.vrow form { flex:1 1 100%; display:flex; gap:8px; flex-wrap:wrap; }
.vrow form input { flex:1 1 180px; min-width:0; }
.vrow .ask { flex:1 1 100%; display:flex; gap:8px; align-items:center; flex-wrap:wrap; background:var(--warn-tint); border-radius:8px; padding:8px 12px; }
.vrow .ask p { flex:1 1 200px; color:var(--warn); font-weight:550; }
.btn.danger { border-color:var(--warn); color:var(--warn); }
.btn.danger.fill { background:var(--warn); color:#fff; }
.tag.in { color:var(--ok); border-color:var(--ok); margin-left:0; }

/* recordings (copied from the Mac page) */
.btn.rec .ic { color:var(--warn); }
.btn.rec.on { background:var(--warn-tint); border-color:var(--warn); color:var(--warn); }
.btn.rec.on .ic { animation:recblink 1.2s steps(2, jump-none) infinite; }
@keyframes recblink { 50% { opacity:.25; } }
@media (prefers-reduced-motion: reduce) { .btn.rec.on .ic { animation:none; } }
.take { border-top:1px solid var(--line); }
.take:first-child { border-top:0; }
.take > button { width:100%; display:flex; align-items:center; gap:12px; padding:12px 16px; border:0; background:none; text-align:left; color:inherit; }
.take > button:hover { background:var(--hover); }
.take > button .txt { flex:1; min-width:0; }
.take > button .txt b { display:block; font-weight:550; }
.take > button .txt span { display:block; color:var(--soft); font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.take > button .chev { transition:rotate .15s; flex:none; }
.take.open > button .chev { rotate:180deg; }
.take .more { padding:0 16px 16px; display:flex; flex-direction:column; gap:12px; }
.take .play { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px; }
@media (max-width:560px) { .take .play { grid-template-columns:minmax(0, 1fr); } }
.take .play label { display:block; font-weight:550; font-size:14px; margin-bottom:4px; }
.take audio { width:100%; height:36px; }
.take .words { display:grid; grid-template-columns:auto minmax(0, 1fr); gap:4px 12px; }
.take .words time { color:var(--soft); font-variant-numeric:tabular-nums; }
.take .words p.out { color:var(--soft); font-size:14px; }
.take h3 { font-size:14px; font-weight:650; }
.ava { width:34px; height:34px; border-radius:50%; background:var(--hover); display:flex; align-items:center; justify-content:center; flex:none; }
.empty { display:flex; flex-direction:column; align-items:center; gap:8px; padding:44px 16px; text-align:center; }
.empty .ava { width:56px; height:56px; } .empty .ava .ic { width:26px; height:26px; }
