/* ============================================================================
   Tenish "Glass" skin. An Apple-style layer: frosted translucent surfaces over soft
   gradient light, large titles, filled fields, pill buttons, sheet modals.
   Reference: RadioNovel.Web theme.css + app-ios.css (rewritten, not copied).
   Themes: light (default), dark, high-contrast, swapped by [data-theme] on <html>.
   ============================================================================ */

:root {
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI Variable", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
    /* The logo's gradient: cyan, blue, violet. Everything accent-coloured comes from these. */
    --accent-0: #00b8ff;
    --accent-0-rgb: 0, 184, 255;
    --accent: #1a7dff;
    --accent-rgb: 26, 125, 255;
    --accent-2: #a45cff;
    --accent-2-rgb: 164, 92, 255;
    --accent-ink: #0a58c8;          /* accent for TEXT on light surfaces (>= 4.5:1) */
    --warm: #ff7a2f;
    --warm-rgb: 255, 122, 47;
    --warm-ink: #a8470a;
    --danger: #e5342b;
    --danger-ink: #b3180f;
    --ok: #1f9d55;
    --ok-ink: #11703a;

    --bg: #f2f2f7;
    --text: #1c1c1e;
    --muted: rgba(60, 60, 67, 0.72);
    --glass: rgba(255, 255, 255, 0.66);
    --glass-strong: rgba(255, 255, 255, 0.88);
    --hairline: rgba(60, 60, 67, 0.14);
    --fill: rgba(120, 120, 128, 0.12);
    --fill-hover: rgba(120, 120, 128, 0.2);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(31, 24, 90, 0.08);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.05), 0 18px 44px rgba(31, 24, 90, 0.16);
    --radius: 20px;
    --radius-sm: 12px;
    --ease: cubic-bezier(0.32, 0.72, 0, 1);
    --blur: blur(24px) saturate(1.7);
    --sidebar: 252px;
    --grad: linear-gradient(135deg, var(--accent-0) 0%, var(--accent) 48%, var(--accent-2) 100%);
    --canvas:
        radial-gradient(900px 560px at 6% -10%, rgba(var(--accent-rgb), 0.20), transparent 62%),
        radial-gradient(760px 520px at 104% 2%, rgba(var(--accent-2-rgb), 0.16), transparent 60%),
        radial-gradient(900px 600px at 50% 112%, rgba(var(--accent-0-rgb), 0.12), transparent 60%);
}

:root[data-theme="dark"] {
    --accent: #3aa7ff;
    --accent-rgb: 58, 167, 255;
    --accent-2: #b27dff;
    --accent-2-rgb: 178, 125, 255;
    --accent-ink: #7cc4ff;
    --warm: #ff9f4a;
    --warm-ink: #ffb77a;
    --danger-ink: #ff7b73;
    --ok-ink: #5fd68e;
    --bg: #07070b;
    --text: #f2f2f7;
    --muted: rgba(235, 235, 245, 0.66);
    --glass: rgba(34, 34, 46, 0.58);
    --glass-strong: rgba(42, 42, 56, 0.88);
    --hairline: rgba(255, 255, 255, 0.1);
    --fill: rgba(235, 235, 245, 0.1);
    --fill-hover: rgba(235, 235, 245, 0.18);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.6), 0 18px 44px rgba(0, 0, 0, 0.6);
}

:root[data-theme="contrast"] {
    --accent: #0033cc;
    --accent-rgb: 0, 51, 204;
    --accent-2: #0033cc;
    --accent-ink: #0033cc;
    --warm: #8a3a00;
    --warm-ink: #6e2d00;
    --bg: #ffffff;
    --text: #000000;
    --muted: #000000;
    --glass: #ffffff;
    --glass-strong: #ffffff;
    --hairline: #000000;
    --fill: #e6e6e6;
    --fill-hover: #cfcfcf;
    --shadow: none;
    --shadow-lift: none;
    --blur: none;
    --canvas: none;
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }
:root[data-theme="dark"] { color-scheme: dark; }
:root:not([data-theme="dark"]) { color-scheme: light; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    background-image: var(--canvas);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.005em;
    min-height: 100vh;
}

h1, h2, h3, h4 { margin: 0 0 0.4em; letter-spacing: -0.025em; line-height: 1.15; }
h1 { font-size: 2.1rem; font-weight: 750; letter-spacing: -0.035em; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
h4 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
small, .small { font-size: 0.85rem; }
.muted { color: var(--muted); }
code, pre, kbd { font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace; font-size: 0.88em; }
code { background: var(--fill); padding: 0.1em 0.4em; border-radius: 6px; }
pre { background: var(--fill); padding: 1rem 1.1rem; border-radius: var(--radius-sm); overflow: auto; line-height: 1.5; margin: 0 0 1em; }
pre code { background: none; padding: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--glass-strong); padding: .5rem 1rem; border-radius: 999px; }
.skip:focus { left: 8px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; padding: 1.25rem 0.9rem; display: flex; flex-direction: column; gap: 0.25rem;
    background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-right: 1px solid var(--hairline);
}
.main { padding: 2rem clamp(1rem, 3vw, 2.75rem) 4rem; min-width: 0; max-width: calc(1920px - var(--sidebar)); width: 100%; margin-inline: auto; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; color: var(--text); padding: 0.25rem 0.6rem 1rem; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.45); }
.brand .mark svg { width: 18px; height: 18px; }
.brand span b { color: var(--accent-ink); font-weight: 800; }
.nav-group { margin: 0.9rem 0.7rem 0.3rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.nav-link {
    display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.7rem; border-radius: 11px; color: var(--text); font-weight: 560;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.nav-link:hover { background: var(--fill); text-decoration: none; }
.nav-link.active { background: rgba(var(--accent-rgb), 0.14); color: var(--accent-ink); }
.nav-link svg { width: 19px; height: 19px; flex: none; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.6rem; }
.balance { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 0.85rem; border-radius: 14px; background: var(--fill); font-weight: 600; }
.balance b { font-size: 1.1rem; letter-spacing: -0.02em; }
.topbar { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin: 0; color: var(--muted); }
.grid { display: grid; gap: 1rem; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 0.4rem; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 0.85rem; }
.grow { flex: 1 1 0; min-width: 0; }
.right { margin-left: auto; }
.hidden { display: none !important; }

/* ---------- surfaces ---------- */
.card {
    background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.35rem 1.5rem;
}
.card.lift { transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.card.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.card.flat { box-shadow: none; }
.card h3 { margin-bottom: 0.15rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.inset { background: var(--fill); border-radius: var(--radius-sm); padding: 0.9rem 1rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty svg { width: 36px; height: 36px; opacity: 0.5; margin-bottom: 0.5rem; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.58rem 1.2rem; border: 0; border-radius: 999px;
    font: inherit; font-weight: 620; letter-spacing: -0.01em; cursor: pointer; color: var(--text); background: var(--fill); text-decoration: none; white-space: nowrap;
    transition: transform 0.18s var(--ease), background-color 0.18s var(--ease), box-shadow 0.18s var(--ease), opacity 0.18s;
}
.btn:hover { background: var(--fill-hover); text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:focus-visible, .field:focus-visible, .nav-link:focus-visible, .seg button:focus-visible, .chip:focus-visible, a:focus-visible, summary:focus-visible { outline: 0; box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.35); }
.btn:disabled, .btn.disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15), 0 6px 18px rgba(var(--accent-rgb), 0.38); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15), 0 10px 26px rgba(var(--accent-rgb), 0.5); }
.btn.tint { background: rgba(var(--accent-rgb), 0.13); color: var(--accent-ink); }
.btn.tint:hover { background: rgba(var(--accent-rgb), 0.22); }
.btn.warm { background: rgba(var(--warm-rgb), 0.16); color: var(--warm-ink); }
.btn.danger { background: rgba(229, 52, 43, 0.13); color: var(--danger-ink); }
.btn.danger:hover { background: rgba(229, 52, 43, 0.24); }
.btn.plain { background: transparent; }
.btn.plain:hover { background: var(--fill); }
.btn.sm { padding: 0.32rem 0.8rem; font-size: 0.86rem; }
.btn.lg { padding: 0.85rem 1.7rem; font-size: 1.05rem; }
.btn.icon { padding: 0.45rem; width: 36px; height: 36px; }
.btn.icon.sm { width: 30px; height: 30px; padding: 0.3rem; }
.btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
label.lbl, .lbl { display: block; font-size: 0.8rem; font-weight: 650; color: var(--muted); margin-bottom: 0.3rem; }
.field {
    width: 100%; background: var(--fill); color: var(--text); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 0.62rem 0.9rem; font: inherit;
    transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s;
}
.field::placeholder { color: var(--muted); opacity: 0.8; }
.field:hover { background: var(--fill-hover); }
.field:focus { outline: 0; background: var(--glass-strong); border-color: rgba(var(--accent-rgb), 0.6); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18); }
textarea.field { resize: vertical; min-height: 5.5rem; }
select.field { appearance: none; padding-right: 2.2rem; 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 1l5 5 5-5' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.85rem center; }
select.field option { background: var(--glass-strong); color: var(--text); }
.field.sm { padding: 0.35rem 0.65rem; font-size: 0.88rem; border-radius: 10px; }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }
.err { color: var(--danger-ink); font-size: 0.88rem; margin-top: 0.4rem; }
.alert { padding: 0.75rem 1rem; border-radius: var(--radius-sm); background: rgba(229, 52, 43, 0.12); color: var(--danger-ink); font-weight: 560; }
.alert.info { background: rgba(var(--accent-rgb), 0.12); color: var(--accent-ink); }
.alert.ok { background: rgba(31, 157, 85, 0.14); color: var(--ok-ink); }
.alert.warn { background: rgba(var(--warm-rgb), 0.16); color: var(--warm-ink); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--fill-hover); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; border: 1px solid rgba(0, 0, 0, 0.12); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); transition: transform 0.15s var(--ease); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--fill-hover); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 1px solid rgba(0, 0, 0, 0.12); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
input[type="range"]:focus-visible { outline: 0; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.4); }

.switch { position: relative; display: inline-block; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--fill-hover); transition: background-color 0.2s var(--ease); }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: transform 0.22s var(--ease); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.35); }
.check { display: flex; gap: 0.6rem; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 0.25rem; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }

.seg { display: inline-flex; background: var(--fill); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 0.38rem 0.95rem; border-radius: 9px; font: inherit; font-weight: 600; font-size: 0.9rem; color: var(--muted); cursor: pointer; transition: background-color 0.2s var(--ease), color 0.2s; }
.seg button.on { background: var(--glass-strong); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14); }

.chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.22rem 0.7rem; border-radius: 999px; font-size: 0.8rem; font-weight: 620; background: var(--fill); border: 0; color: var(--text); font-family: inherit; }
button.chip { cursor: pointer; }
button.chip:hover { background: var(--fill-hover); }
.chip.on { background: rgba(var(--accent-rgb), 0.18); color: var(--accent-ink); }
.chip.ok { background: rgba(31, 157, 85, 0.15); color: var(--ok-ink); }
.chip.warn { background: rgba(var(--warm-rgb), 0.18); color: var(--warm-ink); }
.chip.bad { background: rgba(229, 52, 43, 0.14); color: var(--danger-ink); }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--hairline); }
.table td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: rgba(var(--accent-rgb), 0.04); }
.scroll-x { overflow-x: auto; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--hairline); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 0.7rem 1rem; font: inherit; font-weight: 620; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* ---------- audio ---------- */
audio { width: 100%; height: 40px; border-radius: 999px; }
.player { display: flex; align-items: center; gap: 0.75rem; }
.player .btn.play { flex: none; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.bars i { width: 4px; border-radius: 3px; background: var(--grad); height: 8px; transition: height 0.08s linear; }

/* ---------- progress ---------- */
.progress { height: 8px; background: var(--fill-hover); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width 0.4s var(--ease); }
.progress.indeterminate i { width: 40%; animation: slide 1.2s var(--ease) infinite; }
@keyframes slide { from { margin-left: -40%; } to { margin-left: 100%; } }

/* ---------- toasts and modals ---------- */
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 200; max-width: min(380px, calc(100vw - 2rem)); }
.toast { background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--hairline); border-radius: 14px; padding: 0.8rem 1rem; box-shadow: var(--shadow-lift); font-weight: 560; animation: rise 0.3s var(--ease); }
.toast.bad { border-color: rgba(229, 52, 43, 0.5); }
.toast.ok { border-color: rgba(31, 157, 85, 0.5); }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

.scrim { position: fixed; inset: 0; background: rgba(10, 10, 20, 0.38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 150; display: grid; place-items: center; padding: 1rem; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(560px, 100%); max-height: calc(100vh - 2rem); overflow: auto; background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--hairline); border-radius: 26px; box-shadow: var(--shadow-lift); padding: 1.5rem; animation: rise 0.3s var(--ease); }
.sheet.wide { width: min(820px, 100%); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 1rem; }
.sheet-head h3 { margin: 0; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* ---------- param rows (filter builder) ---------- */
.param { display: grid; grid-template-columns: 120px 1fr 90px; gap: 0.75rem; align-items: center; padding: 0.25rem 0; }
.param .name { font-size: 0.88rem; font-weight: 600; }
.param .field { text-align: right; }
.stage { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.75rem; background: var(--fill); border-radius: 14px; }
.stage.off { opacity: 0.5; }
.stage .grip { color: var(--muted); cursor: grab; display: grid; }
.stage .meta { flex: 1; min-width: 0; }
.stage .meta b { display: block; }
.stage .meta span { display: block; font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage.dragging { opacity: 0.4; }
.stage.over { box-shadow: 0 -3px 0 0 var(--accent); }

/* ---------- speech lines ---------- */
.line { display: grid; grid-template-columns: 28px 1fr; gap: 0.75rem; padding: 1rem; border-radius: 18px; background: var(--glass); border: 1px solid var(--hairline); box-shadow: var(--shadow); }
.line .num { width: 26px; height: 26px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; margin-top: 0.3rem; }
.line-tools { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.6rem; }
.line-tools .field { width: auto; min-width: 130px; flex: 1 1 140px; }
.line.playing { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.55), var(--shadow); }

/* ---------- public site ---------- */
.public-nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 1rem; padding: 0.7rem clamp(1rem, 4vw, 3rem); background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-bottom: 1px solid var(--hairline); }
.public-nav .links { display: flex; gap: 0.25rem; margin-left: 1.5rem; }
.public-nav .links a { padding: 0.4rem 0.8rem; border-radius: 999px; color: var(--text); font-weight: 560; }
.public-nav .links a:hover { background: var(--fill); text-decoration: none; }
.public-nav .brand { padding: 0; }
.hero { padding: clamp(3rem, 8vw, 6.5rem) clamp(1rem, 4vw, 3rem) 3rem; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3rem; align-items: center; max-width: 1240px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.5rem, 5.5vw, 4.2rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1.02; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.25rem; color: var(--muted); max-width: 34rem; margin: 1.2rem 0 2rem; }
.hero-art { position: relative; aspect-ratio: 1 / 1; border-radius: 36px; overflow: hidden; box-shadow: var(--shadow-lift); background: var(--grad); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Home splash: an animated "sound hub" behind the headline. Pure CSS and SVG; every colour comes from the theme, so it follows light, dark and contrast. */
.hero-wrap { position: relative; overflow: hidden; isolation: isolate; }
/* The splash is its own dark band in every theme but high contrast, so it stands apart from the page below it. The dark palette is redefined here,
   so the text, buttons and accents inside it all switch together. */
:root:not([data-theme="contrast"]) .hero-wrap {
    --accent: #3aa7ff; --accent-rgb: 58, 167, 255; --accent-2: #b27dff; --accent-2-rgb: 178, 125, 255; --accent-ink: #7cc4ff;
    --text: #f2f2f7; --muted: rgba(235, 235, 245, 0.72); --glass: rgba(34, 34, 46, 0.58); --glass-strong: rgba(42, 42, 56, 0.88);
    --hairline: rgba(255, 255, 255, 0.12); --fill: rgba(235, 235, 245, 0.12); --fill-hover: rgba(235, 235, 245, 0.2);
    color: var(--text);
    background: linear-gradient(165deg, #070b26 0%, #130c3d 52%, #091a3c 100%);
    box-shadow: inset 0 -1px 0 rgba(var(--accent-rgb), 0.35), 0 18px 50px -24px rgba(var(--accent-2-rgb), 0.5);
}
.hero-wrap .hero { padding-bottom: 7.5rem; }
.hero-eyebrow { display: flex; align-items: baseline; gap: 0.7rem; margin-bottom: 0.9rem; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.hero-eyebrow b { color: var(--accent-ink); }
.hero-eyebrow span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(520px 420px at 72% 46%, rgba(var(--accent-rgb), 0.16), transparent 70%),
        radial-gradient(420px 360px at 88% 72%, rgba(var(--accent-2-rgb), 0.12), transparent 70%); }
.hub { position: absolute; right: -3%; top: 50%; width: min(64vw, 860px); height: auto; transform: translateY(-52%); overflow: visible; }
.hub-orbit { fill: none; stroke: rgba(var(--accent-rgb), 0.3); stroke-width: 1.5; stroke-dasharray: 3 9; }
.hub-ripples circle { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; animation: hub-ripple 5.4s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; }
.hub-ripples circle:nth-child(2) { animation-delay: 1.8s; }
.hub-ripples circle:nth-child(3) { animation-delay: 3.6s; }
@keyframes hub-ripple { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(5); opacity: 0; } }
.hub-spokes line { stroke: rgba(var(--accent-rgb), 0.5); stroke-width: 2; stroke-dasharray: 2 12; stroke-linecap: round; animation: hub-flow 1.6s linear infinite; }
.hub-spokes line:nth-child(even) { animation-direction: reverse; }
@keyframes hub-flow { to { stroke-dashoffset: -28; } }
.hub-nodes circle { fill: rgba(var(--accent-rgb), 0.12); stroke: var(--accent); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: hub-node 3.6s ease-in-out infinite; animation-delay: calc(var(--n) * -0.6s); }
.hub-nodes text { fill: var(--accent-ink); font: 700 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0.01em; }
@keyframes hub-node { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); fill: rgba(var(--accent-rgb), 0.24); } }
.hub-core { filter: drop-shadow(0 0 22px rgba(var(--accent-rgb), 0.55)); animation: hub-breathe 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes hub-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.hub-eq rect { fill: #fff; transform-box: fill-box; transform-origin: center; animation: hub-eq 1.1s ease-in-out infinite; animation-delay: calc(var(--i) * -0.23s); }
@keyframes hub-eq { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1.5); } }
.hero-bars { position: absolute; left: 0; right: 0; bottom: 0; height: 110px; display: flex; align-items: flex-end; gap: 5px; padding: 0 3%; opacity: 0.3; }
.hero-bars i { flex: 1 1 auto; border-radius: 3px 3px 0 0; background: var(--grad); transform-origin: bottom; animation: hero-bar 2.6s ease-in-out infinite; }
@keyframes hero-bar { 0%, 100% { transform: scaleY(0.2); } 50% { transform: scaleY(1); } }
:root[data-theme="contrast"] .hero-bg { display: none; }
.band { max-width: 1240px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 3rem); }
.band h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); text-align: center; margin-bottom: 0.4rem; }
.band .sub { text-align: center; color: var(--muted); max-width: 40rem; margin: 0 auto 2.2rem; font-size: 1.1rem; }
.feature .art { aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; margin-bottom: 1rem; background: var(--fill); }
.feature .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature .ico { width: 44px; height: 44px; border-radius: 13px; background: var(--grad); color: #fff; display: grid; place-items: center; margin-bottom: 0.9rem; box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.35); }
.feature .ico svg { width: 22px; height: 22px; }
.footer { text-align: center; padding: 3rem 1rem; color: var(--muted); font-size: 0.9rem; }
.auth-wrap { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: min(430px, 100%); }
.docs { max-width: 920px; margin: 0 auto; padding: 2.5rem clamp(1rem, 4vw, 2rem) 4rem; }
.docs h2 { margin-top: 2.2rem; }
.docs .endpoint { display: flex; gap: 0.6rem; align-items: center; margin: 1.2rem 0 0.4rem; flex-wrap: wrap; }
.method { font-weight: 800; font-size: 0.78rem; padding: 0.15rem 0.55rem; border-radius: 7px; letter-spacing: 0.04em; }
.method.get { background: rgba(31, 157, 85, 0.16); color: var(--ok-ink); }
.method.post { background: rgba(var(--accent-rgb), 0.16); color: var(--accent-ink); }
.method.put { background: rgba(var(--warm-rgb), 0.18); color: var(--warm-ink); }
.method.delete { background: rgba(229, 52, 43, 0.15); color: var(--danger-ink); }

/* ---------- wizard ---------- */
.steps { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 0.55rem; padding: 0.4rem 0.9rem 0.4rem 0.45rem; border-radius: 999px; background: var(--fill); color: var(--muted); font-weight: 620; font-size: 0.9rem; }
.step i { width: 24px; height: 24px; border-radius: 50%; background: var(--fill-hover); display: grid; place-items: center; font-style: normal; font-size: 0.78rem; }
.step.on { background: rgba(var(--accent-rgb), 0.15); color: var(--accent-ink); }
.step.on i { background: var(--grad); color: #fff; }
.step.done i { background: var(--ok); color: #fff; }
.eq { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.eq .band-ctl { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 1rem 0.5rem; background: var(--fill); border-radius: 16px; }
.eq input[type="range"] { writing-mode: vertical-lr; direction: rtl; width: 28px; height: 150px; }
.eq input[type="range"]::-webkit-slider-runnable-track { width: 6px; height: auto; }
canvas.spectrum { width: 100%; height: 130px; border-radius: 14px; background: var(--fill); display: block; }
.drop { border: 2px dashed var(--hairline); border-radius: 20px; padding: 2.2rem 1rem; text-align: center; color: var(--muted); transition: border-color 0.2s, background-color 0.2s; cursor: pointer; }
.drop.over, .drop:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.06); }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.3; transform: scale(0.8); } }

/* ---------- misc ---------- */
.voice-card { display: flex; flex-direction: column; gap: 0.7rem; }
.voice-card .top { display: flex; gap: 0.75rem; align-items: center; }
.avatar { width: 46px; height: 46px; border-radius: 15px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.1rem; background: var(--grad); }
.kv { display: grid; grid-template-columns: 9rem 1fr; gap: 0.4rem 1rem; }
.kv dt { color: var(--muted); font-weight: 560; }
.kv dd { margin: 0; word-break: break-all; }
.divider { height: 1px; background: var(--hairline); margin: 1.1rem 0; border: 0; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.kbd { background: var(--fill); padding: 0.05rem 0.4rem; border-radius: 6px; font-family: ui-monospace, monospace; font-size: 0.82em; }

@media (max-width: 1000px) {
    .hero { grid-template-columns: 1fr; text-align: center; }
    .hub { right: 50%; transform: translate(50%, -50%); width: min(120vw, 620px); opacity: 0.2; }
    .hero-bars { height: 70px; }
    .hero-eyebrow { justify-content: center; }
    .hero .lead { margin-left: auto; margin-right: auto; }
    .hero .row { justify-content: center; }
    .cols-3, .cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 120; left: 0; top: 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform 0.3s var(--ease); background: var(--glass-strong); }
    .sidebar.open { transform: none; box-shadow: var(--shadow-lift); }
    .topbar { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1rem; position: sticky; top: 0; z-index: 60; background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-bottom: 1px solid var(--hairline); }
    .topbar .brand { padding: 0; }
    .public-nav .links { display: none; }
    .param { grid-template-columns: 1fr; }
    .kv { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- page-specific layout ---------- */
.studio-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.sticky { position: sticky; top: 1rem; }
@media (max-width: 1100px) { .studio-grid { grid-template-columns: 1fr; } .sticky { position: static; } }
.vtable td.audio { min-width: 240px; }
.vtable audio { height: 36px; }
.id-cell { display: inline-flex; align-items: center; gap: 0.25rem; }
.id-cell code { max-width: 9.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.gchips { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.cand { display: flex; flex-direction: column; gap: 0.7rem; }
.cand.picked { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
@media (max-width: 1100px) { #builderGrid { grid-template-columns: 1fr !important; } #designGrid { grid-template-columns: 1fr !important; } }
.param { grid-template-columns: 110px minmax(0, 1fr) 128px; }
.line .field { text-overflow: ellipsis; }
.drop { display: block; }
.tabs { overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.vtable td:last-child { white-space: nowrap; }
.vtable td:first-child .row { flex-wrap: nowrap; }
.vtable td:first-child { min-width: 230px; }
.vtable td { vertical-align: middle; }
.asset audio { height: 36px; }
.asset .asset-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.mixer .stage .meta b { font-weight: 650; }
.check input[type="radio"] { accent-color: var(--accent); }
@media (max-width: 1100px) { #soundGrid, #musicGrid { grid-template-columns: 1fr !important; } }

/* ---------- AI Assist ---------- */
.assist-wrap { position: relative; }
.assist-wrap > .field { padding-bottom: 2.4rem; }
.assist-btn {
    position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
    padding: .3rem .7rem; border: 0; border-radius: 999px; font: inherit; font-size: .8rem; font-weight: 600; color: var(--accent-ink);
    background: rgba(var(--accent-rgb), 0.13); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: background .15s, transform .1s;
}
.assist-btn:hover { background: rgba(var(--accent-rgb), 0.24); }
.assist-btn:active { transform: scale(0.96); }
.assist-btn:focus-visible { outline: 0; box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.35); }
.assist-btn svg { width: 15px; height: 15px; }
.assist-results { display: grid; gap: .7rem; margin-top: .4rem; }
.assist-card { padding: .85rem 1rem; border-radius: var(--radius-sm); background: var(--fill); display: grid; gap: .45rem; }
.assist-text { white-space: pre-wrap; line-height: 1.45; }
.assist-text.mono { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.assist-tips { display: grid; gap: .2rem; margin-top: .6rem; }
.bad { color: var(--danger-ink); }

/* ---------- System status ---------- */
.status-btn { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .55rem .85rem; border: 0; border-radius: 14px; background: var(--fill); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; transition: background-color .2s; }
.status-btn:hover { background: var(--fill-hover); }
.status-btn:focus-visible { outline: 0; box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.35); }
.sdot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.sdot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(31, 157, 85, 0.22); }
.sdot.warn { background: #f0a020; box-shadow: 0 0 0 3px rgba(240, 160, 32, 0.25); }
.sdot.bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(229, 52, 43, 0.25); }
.status-banner { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-radius: var(--radius-sm); background: var(--fill); flex-wrap: wrap; }
.status-banner .muted { margin-left: auto; }
.status-list { display: grid; gap: .5rem; }
.status-row { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem .9rem; border-radius: var(--radius-sm); background: var(--fill); }
.status-row .sdot { margin-top: .4rem; }
.status-main { flex: 1; min-width: 0; display: grid; gap: .15rem; }
.status-state { font-size: .8rem; font-weight: 700; }
.status-state.online { color: var(--ok-ink); }
.status-state.degraded { color: var(--warm-ink); }
.status-state.unresponsive, .status-state.offline { color: var(--danger-ink); }
.status-state.unknown { color: var(--muted); }
.status-msg { color: var(--danger-ink); font-weight: 560; }
.status-queue { display: flex; gap: 1.4rem; flex-wrap: wrap; padding: .2rem .2rem 0; }
.status-queue b { font-size: 1.15rem; }
/* ---------- Choice cards (Quality) ---------- */
.qcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.qcard { position: relative; display: flex; flex-direction: column; gap: .2rem; text-align: left; padding: .8rem .9rem; border-radius: var(--radius-sm); border: 2px solid transparent; background: var(--fill); color: var(--text); font: inherit; cursor: pointer; transition: background-color .2s, border-color .2s, box-shadow .2s, transform .1s; }
.qcard:hover { background: var(--fill-hover); }
.qcard:active { transform: scale(0.98); }
.qcard:focus-visible { outline: 0; box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.35); }
.qcard .qlabel { font-size: 1.02rem; padding-right: 1.6rem; }
.qcard .qmodel { font-size: .78rem; font-weight: 600; color: var(--accent-ink); }
.qcard .qnote { font-size: .82rem; color: var(--muted); line-height: 1.3; }
.qcard .qmeta { font-size: .78rem; color: var(--muted); margin-top: auto; padding-top: .3rem; }
.qcard .qcheck { position: absolute; top: .55rem; right: .55rem; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--hairline); color: transparent; }
.qcard .qcheck svg { width: 13px; height: 13px; }
.qcard.on { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.14); box-shadow: 0 4px 18px rgba(var(--accent-rgb), 0.28); }
.qcard.on .qcheck { background: var(--grad); border-color: transparent; color: #fff; }
.qcard.on .qlabel { color: var(--accent-ink); }
.assist-wrap:has(> .field.hidden) { display: none; }

/* ---------- Brand logo ---------- */
.brand .logo { height: 26px; width: auto; display: block; }
.brand .logo-mark { display: none; width: 30px; height: 30px; border-radius: 9px; box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.35); }
.brand .logo-ondark { display: none; }
:root[data-theme="dark"] .brand .logo-ondark { display: block; }
:root[data-theme="dark"] .brand .logo-onlight { display: none; }
.sidebar .brand { justify-content: center; margin: 0 0.15rem 1.1rem; padding: 0.95rem 0.6rem; border-radius: 18px; border: 1px solid rgba(var(--accent-rgb), 0.2);
    background: linear-gradient(135deg, rgba(0, 184, 255, 0.17), rgba(164, 92, 255, 0.17));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 20px rgba(var(--accent-rgb), 0.14);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.sidebar .brand .logo { height: 24px; }
.topbar .brand .logo { display: none !important; }
.topbar .brand .logo-mark { display: block; }
.public-nav .brand .logo { height: 30px; }

/* ---------- Accent glow (the logo gradient, only where you are interacting) ---------- */
.card, .line, .sheet { transition: box-shadow .25s var(--ease), border-color .25s; }
.card:hover, .line:hover { border-color: rgba(var(--accent-rgb), 0.45); box-shadow: var(--shadow), 0 0 30px rgba(var(--accent-rgb), 0.2); }
.field:focus, .field:focus-visible { border-color: rgb(var(--accent-rgb)); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25), 0 0 20px rgba(var(--accent-rgb), 0.35); }
.sidebar .brand { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 22px rgba(var(--accent-rgb), 0.3); }
.qcard.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 22px rgba(var(--accent-rgb), 0.45); }
:root[data-theme="contrast"] .card:hover, :root[data-theme="contrast"] .line:hover, :root[data-theme="contrast"] .field:focus, :root[data-theme="contrast"] .sidebar .brand, :root[data-theme="contrast"] .qcard.on { box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .card, .line, .sheet { transition: none; } }

/* ---------- dialogue studio: a script of lines, each with a speaker ---------- */
.script { display: flex; flex-direction: column; gap: 0.35rem; }
.sline { border-radius: 16px; background: var(--glass); border: 1px solid var(--hairline); box-shadow: var(--shadow); padding: 0.55rem 0.7rem 0.55rem 0.55rem; transition: box-shadow .25s var(--ease), border-color .25s; }
.sline:focus-within { border-color: rgba(var(--accent-rgb), 0.5); }
.sline.rendered { background: var(--glass-strong); border-color: rgba(var(--accent-rgb), 0.28); }
.dl-row { justify-content: flex-end; margin-top: 0.4rem; }
.sline.playing { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.6), var(--shadow); }
.sline-main { display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; align-items: start; }
.speaker { display: inline-flex; align-items: center; gap: 0.4rem; max-width: 150px; min-width: 52px; border: 1px solid var(--hairline); background: var(--fill); color: var(--text); border-radius: 999px; padding: 0.2rem 0.65rem 0.2rem 0.25rem; font: inherit; font-size: 0.84rem; font-weight: 600; cursor: pointer; margin-top: 0.15rem; }
.speaker:hover { background: var(--fill-hover); }
.speaker:focus-visible { outline: 0; box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.35); }
.speaker .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 0.75rem; font-weight: 700; flex: none; }
.speaker .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.speaker.none .dot { background: var(--muted); }
.sline-text { width: 100%; resize: none; border: 0; background: transparent; color: inherit; font: inherit; font-size: 1.02rem; line-height: 1.45; padding: 0.3rem 0.1rem; overflow: hidden; min-height: 2.1rem; }
.sline-text:focus { outline: 0; }
.sline-text::placeholder { color: var(--muted); opacity: 0.7; }
.sline-more { margin-top: 0.7rem; padding-top: 0.7rem; border-top: 1px solid var(--hairline); }
.sline-more .line-tools { margin-top: 0; }
.sline .line-audio audio { width: 100%; height: 34px; margin-top: 0.5rem; }
.menu { position: fixed; z-index: 60; min-width: 190px; max-height: 320px; overflow: auto; background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--shadow-lift); padding: 0.3rem; }
.menu button { display: flex; align-items: center; gap: 0.55rem; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.92rem; padding: 0.45rem 0.6rem; border-radius: 9px; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: rgba(var(--accent-rgb), 0.14); outline: 0; }
.menu .sep { height: 1px; background: var(--hairline); margin: 0.25rem 0.2rem; }
.menu .swatch { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.cast-row { border: 1px solid var(--hairline); border-radius: 14px; padding: 0.6rem; background: var(--fill); }
.cast-head { display: grid; grid-template-columns: auto 1fr auto; gap: 0.5rem; align-items: center; }
.cast-head .swatch { width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font-weight: 700; font-size: 0.78rem; }
.cast-head .field { padding: 0.35rem 0.6rem; }
.cast-row .field.voice { margin-top: 0.5rem; }
.cast-row .count { font-size: 0.78rem; color: var(--muted); margin-top: 0.35rem; }
.cast-more { margin-top: 0.6rem; display: grid; gap: 0.5rem; }
.tl { position: relative; display: flex; gap: 2px; height: 34px; margin-top: 0.7rem; border-radius: 9px; overflow: hidden; background: var(--fill); }
.tl-b { border: 0; padding: 0; min-width: 3px; cursor: pointer; opacity: 0.85; color: #fff; font-size: 0.7rem; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tl-b:hover, .tl-b:focus-visible { opacity: 1; outline: 0; filter: brightness(1.12); }
.tl-b.on { opacity: 1; box-shadow: inset 0 0 0 2px #fff; }
.tl-gap { background: transparent; flex: none; }
.tl-head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); pointer-events: none; left: 0; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; margin-top: 0.5rem; font-size: 0.8rem; color: var(--muted); }
.tl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.35rem; vertical-align: -1px; }
#resultCard audio { width: 100%; margin-top: 0.4rem; }
.sline-tools { display: flex; align-items: center; gap: 0.1rem; margin-top: 0.1rem; }

/* two-column public sections stack on narrow screens */
@media (max-width: 900px) { #filterBand { grid-template-columns: 1fr !important; } }

/* pricing and billing: plan cards */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.plan { position: relative; display: flex; flex-direction: column; gap: 0.4rem; padding: 1.4rem; }
.plan h3 { margin: 0; font-size: 1.3rem; }
.plan.featured { box-shadow: 0 0 0 2px var(--accent); }
.plan.chosen { box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px rgba(var(--accent-rgb), 0.25); }
.plan-flag { position: absolute; top: 0.9rem; right: 0.9rem; }
.plan-tag { margin: 0; min-height: 2.4em; }
.plan-price { display: flex; align-items: baseline; gap: 0.35rem; margin: 0.4rem 0; }
.plan-price .amt { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.04em; }
.plan-price .per { color: var(--muted); }
.plan-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; color: var(--muted); }
.plan-list li::before { content: "\2713"; color: var(--accent); font-weight: 800; margin-right: 0.5rem; }
.plan .btn { width: 100%; justify-content: center; }
@media (max-width: 1000px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .plans { grid-template-columns: 1fr; } }
/* inside the app the plan cards use the same type scale as the other pages (the public pricing page keeps the larger marketing sizes) */
.main .plan { padding: 1.1rem; gap: 0.3rem; }
.main .plan h3 { font-size: 1.15rem; }
.main .plan-tag { min-height: 0; }
.main .plan-price { margin: 0.2rem 0 0.4rem; }
.main .plan-price .amt { font-size: 1.7rem; letter-spacing: -0.03em; }
.main .plan-list { font-size: 0.92rem; gap: 0.35rem; margin-bottom: 0.8rem; }
