/* Mobile-first: base rules target phones; wider screens are layered on with min-width queries. */

:root {
    --font-primary: "Inter", "Inter Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bg: #050505;
    --text: #fff;
    --text-dim: rgba(255, 255, 255, 0.7);
    --text-faint: rgba(255, 255, 255, 0.5);
    --accent-yellow: #ccc545;
    --accent-warm: #f2a51b;
    --accent-pink: #c2569a;
    --accent-violet: #7a4fd6;
    --grad-primary: linear-gradient(135deg, var(--accent-pink), var(--accent-violet));
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.3);
    --danger: #ff6b6b;
    --radius: 8px;
    --radius-lg: 16px;
    --tap: 48px; /* minimum touch target */
    --nav-h: 0px;   /* bottom tab bar height (phones, signed in) */
    --mini-h: 0px;  /* mini player height while it is docked */
    --header-h: 56px;
    --gutter: 16px;
    --motion-fast: 0.16s;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent-yellow); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding: 12px var(--gutter);
    padding-top: calc(12px + env(safe-area-inset-top));
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}
.brand-logo { display: block; height: 18px; width: auto; flex: none; }
.brand-product {
    padding-left: 10px;
    border-left: 1px solid var(--border-strong);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
}
.user-bar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.user-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--text-dim); }

/* ---------- Layout ---------- */
main {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    padding: 24px var(--gutter) calc(64px + var(--nav-h) + var(--mini-h) + env(safe-area-inset-bottom));
}
body.has-nav { --nav-h: 64px; }
body.has-mini { --mini-h: 76px; }
[tabindex="-1"]:focus { outline: none; }
.sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
mark { color: inherit; background: rgba(242, 165, 27, 0.35); border-radius: 3px; padding: 0 2px; }
.view { display: flex; flex-direction: column; gap: 20px; animation: reveal 0.4s var(--ease-out-expo); }
@keyframes reveal { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- Type ---------- */
.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}
h1 {
    font-size: clamp(32px, 9vw, 56px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin: 12px 0 14px;
}
.hl { color: var(--accent-warm); }
.lead { font-size: 16px; font-weight: 500; color: var(--text-dim); max-width: 56ch; }
.lead.small { font-size: 15px; }
.card-title { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 16px; }
.section-title { font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.hint { font-size: 13px; color: var(--text-faint); margin-top: 8px; }
.center { text-align: center; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; margin-bottom: 20px; }
.field label { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-dim); }
input[type="text"], input[type="search"], input[type="password"], input[type="tel"], input[type="email"], select {
    width: 100%;
    min-height: var(--tap);
    font: inherit;
    font-size: 16px; /* 16px avoids the iOS zoom-on-focus */
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    transition: border-color var(--motion-fast);
}
select option { background: #111; color: #fff; }
input[type="text"]:focus, input[type="search"]:focus, input[type="password"]:focus, input[type="tel"]:focus, input[type="email"]:focus, select:focus { outline: none; border-color: var(--accent-yellow); }
input::placeholder { color: var(--text-faint); }

.chips-input {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.chips-input:focus-within { border-color: var(--accent-yellow); }
.chips-input input { flex: 1 1 100%; min-width: 0; min-height: 40px; border: none; background: transparent; padding: 6px; }
.chips-input input:focus { border: none; }
.chips { display: contents; list-style: none; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 36px;
    padding: 2px 4px 2px 12px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
}
.chip button {
    width: 32px; height: 32px;
    border: none; border-radius: 50%;
    background: transparent; color: var(--text-dim);
    cursor: pointer; font-size: 18px; line-height: 1;
}

/* ---------- VIP ---------- */
.vip-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    margin-bottom: 20px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    opacity: 0.85;
    cursor: not-allowed;
}
.vip-title { font-size: 14px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.switch {
    flex: none;
    width: 40px; height: 22px; margin-top: 2px;
    border-radius: 999px;
    background: var(--border);
    position: relative;
}
.switch-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-faint); }
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
}
.badge-vip { color: #1a1500; background: linear-gradient(135deg, var(--accent-yellow), var(--accent-warm)); }
.vip-card {
    border-color: rgba(204, 197, 69, 0.4);
    background: linear-gradient(180deg, rgba(204, 197, 69, 0.08), var(--surface));
}
.vip-card .badge { margin-bottom: 12px; }
.vip-card .card-title { margin-bottom: 8px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: transform var(--motion-fast), opacity var(--motion-fast), background var(--motion-fast);
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--grad-primary); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; font-size: 16px; }
.btn-small { min-height: 40px; padding: 6px 14px; font-size: 13px; }

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--danger);
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.35);
}
.notice {
    display: flex; flex-direction: column; align-items: stretch; gap: 12px;
    padding: 12px 16px; margin-bottom: 16px;
    font-size: 14px;
    border-radius: var(--radius);
    background: rgba(204, 197, 69, 0.08);
    border: 1px solid rgba(204, 197, 69, 0.35);
}

/* ---------- Access screens (login / signup) ---------- */
body[data-view="login"] main, body[data-view="signup"] main { max-width: 1080px; }

.access-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s;
}
body[data-view="login"] .access-bg, body[data-view="signup"] .access-bg { opacity: 1; }
.glow { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.glow-pink { width: 70vmax; height: 70vmax; left: -25vmax; top: -20vmax; background: radial-gradient(circle, rgba(194, 86, 154, 0.55), transparent 65%); animation: drift-a 18s ease-in-out infinite alternate; }
.glow-violet { width: 65vmax; height: 65vmax; right: -25vmax; top: 10vmax; background: radial-gradient(circle, rgba(122, 79, 214, 0.55), transparent 65%); animation: drift-b 22s ease-in-out infinite alternate; }
.glow-yellow { width: 50vmax; height: 50vmax; left: 10vmax; bottom: -30vmax; background: radial-gradient(circle, rgba(242, 165, 27, 0.32), transparent 65%); animation: drift-c 26s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(12vmax, 8vmax) scale(1.1); } }
@keyframes drift-b { to { transform: translate(-10vmax, -6vmax) scale(1.15); } }
@keyframes drift-c { to { transform: translate(8vmax, -6vmax) scale(1.2); } }

.access-grid { display: grid; gap: 28px; align-items: center; }
.access-pitch { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; min-width: 0; }
.access-title { margin: 0; font-size: clamp(34px, 10vw, 60px); }
.access .lead { max-width: 46ch; }

.ribbon {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    padding: 9px 18px 9px 14px;
    overflow: hidden;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #1a1500;
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-warm));
    border-radius: 999px;
    box-shadow: 0 10px 34px -10px rgba(242, 165, 27, 0.7);
}
.ribbon::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #1a1500; }
.ribbon::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0; left: -40%;
    width: 30%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: skewX(-20deg);
    animation: shimmer 4.5s ease-in-out infinite;
}
@keyframes shimmer { 0%, 55% { left: -40%; } 100% { left: 130%; } }

.benefits { list-style: none; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.benefits li { position: relative; padding-left: 30px; font-size: 15px; font-weight: 600; color: var(--text-dim); }
.benefits li::before {
    content: "";
    position: absolute;
    left: 0; top: 2px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--grad-primary);
}
.benefits li::after {
    content: "";
    position: absolute;
    left: 7px; top: 6px;
    width: 5px; height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.eq { display: flex; align-items: center; gap: 4px; height: 56px; max-width: 100%; overflow: hidden; margin-top: 4px; }
.eq span {
    flex: none;
    width: 4px;
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--accent-warm), var(--accent-pink) 55%, var(--accent-violet));
    transform-origin: center;
    transform: scaleY(0.2);
    animation: eq-bounce 1.3s ease-in-out infinite;
    animation-delay: calc(var(--i) * -0.13s);
}
@keyframes eq-bounce { 0%, 100% { transform: scaleY(0.15); } 50% { transform: scaleY(1); } }

.glass {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03));
    border-color: rgba(255, 255, 255, 0.18);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 30px 80px -24px rgba(122, 79, 214, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.login-card { margin-top: 0; }
.access .login-card { width: 100%; max-width: 460px; margin: 0 auto; }
.login-title { margin: 6px 0 10px; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.login-card .lead { margin-bottom: 24px; }
.access-side { width: 100%; }
.done-mark {
    width: 56px; height: 56px; margin-bottom: 8px;
    display: grid; place-items: center;
    font-size: 28px; font-weight: 800; color: #fff;
    border-radius: 50%; background: var(--grad-primary);
}

/* ---------- Sign-up, password field and view switching ---------- */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 84px; }
.reveal {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    min-width: 72px;
    min-height: 40px;
    padding: 0 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    background: transparent;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}
.switch-view { margin-top: 16px; text-align: center; font-size: 14px; color: var(--text-dim); }
.link-button {
    display: inline;
    min-height: 40px;
    padding: 0 4px;
    font: inherit;
    font-weight: 600;
    color: var(--accent-warm);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.center-card .btn-block { margin-top: 16px; }

/* ---------- Admin ---------- */
.admin-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-color: rgba(204, 197, 69, 0.4);
    background: linear-gradient(180deg, rgba(204, 197, 69, 0.08), var(--surface));
}
.admin-card-title { font-size: 15px; font-weight: 800; }
.admin-card .hint { margin-top: 2px; }
.admin-card .btn { flex: none; }
.count {
    display: inline-block;
    min-width: 22px;
    margin-left: 8px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 800;
    line-height: 22px;
    text-align: center;
    color: #1a1500;
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-warm));
    border-radius: 999px;
}
.account-group { margin-top: 8px; }
.account-group + .account-group { margin-top: 24px; }
.account-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.account-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.account-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.account-main strong { font-weight: 600; overflow-wrap: anywhere; }
.account-phone { font-size: 14px; color: var(--text-dim); }
.account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.account-actions .btn:only-child { grid-column: 1 / -1; }

.badge-status { color: var(--text); background: var(--surface-hover); border: 1px solid var(--border); }
.badge-recording { color: #ffb3b3; border-color: rgba(255, 77, 77, 0.5); background: rgba(255, 77, 77, 0.12); }
.badge-processing { color: var(--accent-yellow); border-color: rgba(204, 197, 69, 0.5); background: rgba(204, 197, 69, 0.1); }
.badge-ready { color: #7be3b0; border-color: rgba(90, 209, 154, 0.5); background: rgba(90, 209, 154, 0.12); }
.badge-failed { color: var(--danger); border-color: rgba(255, 107, 107, 0.5); background: rgba(255, 107, 107, 0.1); }
.badge-new { color: #fff; background: var(--grad-primary); }

.ready-banner {
    display: flex; align-items: stretch;
    border: 1px solid rgba(204, 197, 69, 0.55);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(204, 197, 69, 0.14), rgba(194, 86, 154, 0.1));
}
.ready-open {
    flex: 1; min-width: 0; min-height: var(--tap);
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; text-align: left;
    font: inherit; font-size: 15px; font-weight: 600; color: var(--text);
    background: none; border: none; cursor: pointer;
}
.ready-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-yellow); box-shadow: 0 0 0 4px rgba(204, 197, 69, 0.25); }
.ready-close { flex: none; width: var(--tap); background: none; border: none; color: var(--text-dim); font-size: 22px; cursor: pointer; }

/* ---------- Recording ---------- */
.record-card { text-align: center; padding: 28px 20px; }
.record-card .eyebrow { justify-content: center; }
.record-title { font-size: 18px; font-weight: 600; color: var(--text-dim); margin: 8px 0 0; overflow-wrap: anywhere; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff4d4d; animation: pulse 1.4s infinite; }
.rec-dot.paused { background: var(--text-faint); animation: none; }
@keyframes pulse { 50% { opacity: 0.25; } }
.timer { font-size: clamp(60px, 22vw, 96px); font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1.1; margin: 20px 0; }
.meter { display: flex; align-items: center; justify-content: center; gap: 3px; height: 64px; margin-bottom: 24px; overflow: hidden; }
.meter span { width: 4px; min-height: 4px; border-radius: 2px; background: var(--grad-primary); transition: height 0.08s linear; }
.record-actions { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.record-actions .btn { width: 100%; min-height: 56px; font-size: 16px; }

/* ---------- Processing ---------- */
.center-card { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.spinner {
    width: 36px; height: 36px; border-radius: 50%;
    border: 3px solid var(--border); border-top-color: var(--accent-yellow);
    animation: spin 1s linear infinite; margin-bottom: 12px;
}
.spinner.small { width: 16px; height: 16px; border-width: 2px; margin: 0; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-line { color: var(--text-dim); font-size: 14px; }

/* ---------- Meeting ---------- */
.summary-overview { font-size: 16px; font-weight: 500; color: var(--text-dim); margin-bottom: 20px; }
.summary-section { margin-top: 20px; }
.summary-section h3 { font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-yellow); margin-bottom: 8px; }
.summary-section ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.summary-section li { position: relative; padding-left: 18px; font-size: 15px; color: var(--text-dim); }
.summary-section li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-warm); }
.owner { font-weight: 800; color: var(--text); }
.ts {
    display: inline-block; margin-right: 6px; padding: 1px 8px;
    font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
    color: var(--text-dim); background: var(--surface-hover); border-radius: 999px;
}
button.ts { font-family: inherit; border: 1px solid var(--border); cursor: pointer; min-height: 28px; position: relative; }
button.ts::after { content: ""; position: absolute; inset: -9px -4px; } /* 44px touch target without changing the layout */
button.ts:hover { color: var(--text); border-color: var(--accent-yellow); }

.transcript-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.transcript-head .card-title { margin: 0; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; color: var(--text-dim); cursor: pointer; }
.check input { accent-color: var(--accent-pink); width: 20px; height: 20px; flex: none; }
.transcript { list-style: none; }
.seg { display: grid; grid-template-columns: 56px 1fr; gap: 6px 10px; padding: 14px 8px; margin: 0 -8px; border-top: 1px solid var(--border); border-radius: var(--radius); transition: background var(--motion-fast); }
.seg:first-child { border-top: none; }
.seg.is-playing { background: rgba(204, 197, 69, 0.1); box-shadow: inset 3px 0 0 var(--accent-yellow); }
.seg-time { font-size: 12px; font-weight: 600; color: var(--text-faint); font-variant-numeric: tabular-nums; padding-top: 10px; }
button.seg-time {
    align-self: start; width: 100%; min-height: 44px; padding: 0 4px;
    font-family: inherit; color: var(--text-dim);
    background: var(--surface); border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
}
button.seg-time:hover { color: var(--text); border-color: var(--accent-yellow); }
.seg-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.seg-speaker {
    align-self: flex-start;
    width: auto; max-width: 100%;
    min-height: 40px;
    padding: 4px 12px;
    font-size: 14px; font-weight: 600;
    border-radius: 999px;
}
.seg-speaker.assigned { color: #1a1500; background: var(--accent-yellow); border-color: transparent; }
.seg-text { font-size: 15px; color: var(--text); overflow-wrap: anywhere; }

/* ---------- Upload status, background processing, progress ---------- */
.record-card .alert { margin: 12px 0; text-align: left; }
.record-card .btn#recRetry { width: 100%; margin-bottom: 12px; }
.processing-card .notice, .processing-card .alert { width: 100%; text-align: left; margin: 8px 0 0; }
.processing-card .btn { margin-top: 12px; }
.proc-done { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.proc-done .benefits { margin: 4px auto 8px; align-self: center; max-width: 100%; }
.proc-done .btn { margin-top: 0; }
.progress-card .lead { margin-bottom: 8px; }
.progress-card .alert { width: 100%; text-align: left; }
.bar { width: 100%; max-width: 360px; height: 8px; margin: 12px 0 4px; overflow: hidden; border-radius: 999px; background: var(--surface-hover); }
.bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad-primary); transition: width 0.5s var(--ease-out-expo); }
.bar.indeterminate span { width: 40%; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- Toast ---------- */
.toast {
    position: fixed; left: 50%; z-index: 40; bottom: calc(24px + var(--nav-h) + var(--mini-h) + env(safe-area-inset-bottom)); transform: translateX(-50%);
    max-width: calc(100vw - 32px);
    padding: 12px 20px; font-size: 14px; font-weight: 600; text-align: center;
    background: #fff; color: #050505; border-radius: 999px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

/* ---------- Hover only on devices that have it ---------- */
@media (hover: hover) {
    .btn:hover:not(:disabled) { background: var(--surface-hover); }
    .btn-primary:hover:not(:disabled) { background: var(--grad-primary); opacity: 0.9; }
    .chip button:hover { background: var(--border); color: var(--text); }
    .ready-open:hover { background: var(--surface-hover); }
}

/* ---------- Tablets and up ---------- */
@media (min-width: 600px) {
    :root { --gutter: 24px; }

    .site-header { padding-bottom: 16px; }
    .brand-logo { height: 20px; }
    .user-name { max-width: 200px; font-size: 14px; }

    main { padding-top: 40px; }
    .view { gap: 24px; }

    h1 { margin: 12px 0 16px; }
    .lead { font-size: 17px; }

    .card { padding: 28px; }

    .chips-input input { flex: 1 1 160px; }

    .notice { flex-direction: row; align-items: center; justify-content: space-between; }

    .account-card { flex-direction: row; align-items: center; justify-content: space-between; }
    .account-actions { display: flex; flex: none; }
    .account-actions .btn:only-child { grid-column: auto; }

    .record-card { padding: 40px 28px; }
    .record-actions { flex-direction: row; justify-content: center; }
    .record-actions .btn { width: auto; min-width: 180px; }

    .transcript-head { flex-direction: row; align-items: center; justify-content: space-between; }
    .seg { grid-template-columns: 60px 1fr; gap: 6px 12px; }
}

@media (min-width: 900px) {
    .access-grid { grid-template-columns: minmax(0, 1.15fr) minmax(380px, 460px); gap: 64px; min-height: calc(100dvh - 190px); }
    .access .login-card { margin: 0 0 0 auto; }
    .access-title { font-size: clamp(48px, 5.4vw, 68px); }
    .eq { height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .eq span { transform: scaleY(calc(0.25 + var(--i) * 0.06)); }
    .bar.indeterminate span { width: 100%; }
    .sk { background: var(--surface-hover) !important; }
}

/* ---------- Access screen on phones: the form comes first, the pitch follows ---------- */
@media (max-width: 899px) {
    .access-grid { display: flex; flex-direction: column; gap: 20px; }
    .access-pitch { display: contents; }
    .access .ribbon { order: 1; align-self: flex-start; }
    .access .access-title { order: 2; font-size: clamp(30px, 9vw, 44px); }
    .access .access-pitch > .lead { display: none; }
    .access .login-card, .access .signup-card { order: 3; }
    .access .benefits { order: 4; }
    .access .eq { order: 5; }
}

/* ---------- App navigation ---------- */
.rec-pill {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 0 14px;
    font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums;
    color: #ffd0d0; text-decoration: none;
    background: rgba(255, 77, 77, 0.14);
    border: 1px solid rgba(255, 77, 77, 0.55);
    border-radius: 999px;
}
.rec-pill.is-paused .rec-dot { background: var(--text-faint); animation: none; }
.site-header.has-pill .brand-product { display: none; }

.app-nav { display: none; }
body.has-nav .bottom-nav { display: grid; }

.nav-item {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    min-height: 44px;
    color: var(--text-dim); text-decoration: none;
    font-size: 11px; font-weight: 600;
    transition: color var(--motion-fast), background var(--motion-fast);
}
.nav-icon { width: 24px; height: 24px; display: block; }
.nav-icon-wrap { position: relative; display: inline-flex; }
.nav-badge {
    position: absolute; top: -6px; right: -12px;
    min-width: 18px; padding: 0 5px;
    font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
    color: #1a1500;
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-warm));
    border-radius: 999px;
}
.nav-item[aria-current="page"] { color: var(--text); }

.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    grid-auto-flow: column; grid-auto-columns: 1fr;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom));
    padding: 0 8px env(safe-area-inset-bottom);
    background: rgba(5, 5, 5, 0.92);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
}
.bottom-nav .nav-item { flex-direction: column; gap: 2px; padding: 6px 4px; }
.bottom-nav .nav-item[aria-current="page"]::before {
    content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 3px;
    background: var(--grad-primary); border-radius: 0 0 4px 4px;
}
.bottom-nav .nav-item[aria-current="page"] .nav-icon { color: var(--accent-warm); }

.top-nav { order: 3; width: 100%; gap: 4px; margin: 0 0 -12px; }
.top-nav .nav-item { flex-direction: row; gap: 8px; padding: 0 16px; font-size: 14px; border-bottom: 2px solid transparent; }
.top-nav .nav-icon { width: 20px; height: 20px; }
.top-nav .nav-badge { position: static; margin-left: 2px; }
.top-nav .nav-icon-wrap { gap: 0; }
.top-nav .nav-item[aria-current="page"] { border-bottom-color: var(--accent-warm); }
@media (hover: hover) { .nav-item:hover { color: var(--text); } }

/* ---------- Mis reuniones ---------- */
.page-head { display: flex; flex-direction: column; gap: 12px; }
.page-title { font-size: clamp(28px, 8vw, 40px); margin: 6px 0 0; }
.page-head .hint { margin-top: 4px; }
.page-head .btn { text-decoration: none; }

.list-tools { display: flex; flex-direction: column; gap: 12px; }
.search { position: relative; }
.search > svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.search input[type="search"] { padding-left: 44px; padding-right: 48px; -webkit-appearance: none; appearance: none; }
.search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear {
    position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; font-size: 22px; line-height: 1;
    color: var(--text-dim); background: none; border: none; border-radius: 50%; cursor: pointer;
}
.search-inline { margin-bottom: 12px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
    min-height: 44px; padding: 0 16px;
    font: inherit; font-size: 14px; font-weight: 600; color: var(--text-dim);
    background: var(--surface); border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
    transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast);
}
.filter-chip[aria-pressed="true"] { color: #fff; background: var(--grad-primary); border-color: transparent; }
.chip-count { margin-left: 4px; font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0.8; }

.meeting-grid { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.mcard {
    position: relative; min-width: 0;
    display: flex; flex-direction: column; gap: 8px;
    padding: 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    transition: border-color var(--motion-fast), background var(--motion-fast), transform var(--motion-fast);
}
.mcard.is-new { border-color: rgba(204, 197, 69, 0.55); background: linear-gradient(180deg, rgba(204, 197, 69, 0.08), var(--surface)); }
.mcard-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.mcard-title {
    font-size: 17px; font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* The title link stretches over the whole card, so the card is one big real link (ctrl/cmd-click works). */
.mcard-link { color: inherit; text-decoration: none; }
.mcard-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.mcard-link:focus-visible { outline: none; }
.mcard-link:focus-visible::after { outline: 2px solid var(--accent-yellow); outline-offset: 2px; }
.mcard-meta { font-size: 13px; color: var(--text-faint); }
.mchips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.mchip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 10px; font-size: 12px; font-weight: 600; color: var(--text-dim); background: var(--surface-hover); border: 1px solid var(--border); border-radius: 999px; }
.mchip.more { color: var(--text-faint); }
.mcard-progress .bar { max-width: none; margin: 4px 0; }
.mcard-status { font-size: 13px; color: var(--accent-yellow); }
.mcard-status.is-error { color: var(--danger); overflow-wrap: anywhere; }
.mcard-preview, .mcard-snippet {
    font-size: 14px; color: var(--text-dim); overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mcard-snippet { padding: 6px 10px; border-left: 2px solid var(--accent-warm); background: rgba(242, 165, 27, 0.06); border-radius: 0 6px 6px 0; }
.meta-chip { display: inline-block; padding: 2px 10px; font-size: 12px; font-weight: 600; color: var(--text-faint); border: 1px solid var(--border); border-radius: 999px; }
.mcard-actions { position: relative; z-index: 2; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: auto; padding-top: 4px; }
.mcard-delete { min-height: 44px; padding: 0 10px; font: inherit; font-size: 13px; color: var(--text-faint); background: none; border: none; cursor: pointer; }
@media (hover: hover) {
    .mcard:hover { background: var(--surface-hover); border-color: var(--border-strong); }
    .mcard-delete:hover { color: var(--danger); }
}

.mcard.skeleton { min-height: 168px; gap: 12px; }
.sk {
    display: block; border-radius: 6px;
    background: linear-gradient(90deg, var(--surface) 0%, var(--surface-hover) 50%, var(--surface) 100%);
    background-size: 200% 100%;
    animation: sk-move 1.4s ease-in-out infinite;
}
.sk-badge { width: 70px; height: 20px; border-radius: 999px; }
.sk-title { width: 70%; height: 22px; }
.sk-line { width: 100%; height: 14px; }
.sk-line.short { width: 55%; }
@keyframes sk-move { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.state-card {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 40px 20px; text-align: center;
    border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
}
.state-card .hint { margin-top: 0; max-width: 40ch; }
.state-card .btn { margin-top: 8px; text-decoration: none; }
.state-title { font-size: 18px; font-weight: 800; overflow-wrap: anywhere; }
.state-art { width: 160px; height: 64px; margin-bottom: 8px; }

/* ---------- Meeting page: header and tabs ---------- */
.meeting-top { display: contents; }
.meeting-head { display: flex; flex-direction: column; gap: 12px; }
.back-link {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 2px;
    min-height: 44px; margin-left: -6px; padding: 0 8px 0 0;
    font-size: 14px; font-weight: 600; color: var(--text-dim); text-decoration: none;
}
.back-link svg { width: 20px; height: 20px; }
.back-link:hover { color: var(--text); }
.meeting-head-main { min-width: 0; }
.meeting-title { font-size: clamp(24px, 6.5vw, 36px); margin: 0; overflow-wrap: anywhere; }
.meeting-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; font-size: 14px; color: var(--text-dim); }
.meeting-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-danger { color: #ffb3b3; border-color: rgba(255, 107, 107, 0.4); }

.subtabs {
    position: sticky; top: var(--header-h); z-index: 8;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
    padding: 4px;
    background: rgba(12, 12, 12, 0.94);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1px solid var(--border); border-radius: 14px;
}
.subtab {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 8px;
    font: inherit; font-size: 14px; font-weight: 600; color: var(--text-dim);
    background: transparent; border: none; border-radius: 10px; cursor: pointer;
    transition: background var(--motion-fast), color var(--motion-fast);
}
.subtab svg { width: 18px; height: 18px; flex: none; }
.subtab[aria-selected="true"] { color: #fff; background: var(--grad-primary); }
@media (hover: hover) { .subtab[aria-selected="false"]:hover { color: var(--text); background: var(--surface-hover); } }
@media (max-width: 380px) { .subtab svg { display: none; } }

#panels, .panel { display: flex; flex-direction: column; gap: 20px; }
.panel:focus-visible { outline-offset: 4px; border-radius: var(--radius-lg); }
.transcript-options { display: flex; flex-direction: column; }
#summaryEmpty { margin-bottom: 0; }

/* ---------- Audio player ---------- */
.player-time { display: flex; justify-content: space-between; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.seek {
    -webkit-appearance: none; appearance: none;
    display: block; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer;
}
.seek:disabled { cursor: default; opacity: 0.5; }
.seek::-webkit-slider-runnable-track {
    height: 6px; border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-violet)) no-repeat 0 0 / var(--fill, 0%) 100%, var(--surface-hover);
}
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: #fff; border: none; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.seek::-moz-range-track { height: 6px; border-radius: 999px; background: var(--surface-hover); }
.seek::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--accent-pink); }
.seek::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: none; }
.seek:focus-visible { outline: none; }
.seek:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent-yellow); outline-offset: 2px; }
.seek:focus-visible::-moz-range-thumb { outline: 2px solid var(--accent-yellow); outline-offset: 2px; }

.player-controls { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 4px 0 16px; }
.icon-btn {
    position: relative; flex: none;
    display: inline-grid; place-items: center;
    width: 48px; height: 48px;
    color: var(--text); background: transparent;
    border: 1px solid var(--border-strong); border-radius: 50%; cursor: pointer;
    transition: transform var(--motion-fast), background var(--motion-fast);
}
.icon-btn:active { transform: scale(0.95); }
.icon-btn svg { width: 24px; height: 24px; display: block; }
.skip-btn { border-color: transparent; }
.skip-btn svg { width: 34px; height: 34px; }
.skip-btn span { position: absolute; font-size: 10px; font-weight: 800; }
.play-btn { width: 72px; height: 72px; background: var(--grad-primary); border-color: transparent; }
.play-btn svg { width: 30px; height: 30px; }
.ico-pause { display: none !important; }
.is-playing .ico-play { display: none !important; }
.is-playing .ico-pause { display: block !important; }
.ico-spin { display: none; position: absolute; inset: -5px; border: 3px solid transparent; border-top-color: var(--accent-yellow); border-radius: 50%; animation: spin 1s linear infinite; }
.is-loading .ico-spin { display: block; }

.rate-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 12px; }
.rate-btn {
    min-width: 64px; min-height: 44px; padding: 0 12px;
    font: inherit; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-dim);
    background: var(--surface); border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
}
.rate-btn[aria-pressed="true"] { color: #fff; background: var(--grad-primary); border-color: transparent; }
.audio-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }

.parts-hint { margin: -8px 0 12px; }
.parts-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.part-item {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
}
.part-item.is-current { border-color: rgba(204, 197, 69, 0.55); background: linear-gradient(180deg, rgba(204, 197, 69, 0.08), transparent); }
.part-main { display: flex; flex-direction: column; min-width: 0; }
.part-time { margin-top: 0; font-variant-numeric: tabular-nums; }
.part-actions { display: flex; gap: 8px; }
a.btn { text-decoration: none; }

/* ---------- Mini player ---------- */
.mini-player {
    position: fixed; z-index: 19;
    left: 8px; right: 8px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px);
    display: flex; align-items: center; gap: 8px;
    min-height: 60px; padding: 6px 8px 8px;
    overflow: hidden;
    background: rgba(24, 24, 28, 0.96);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border: 1px solid var(--border-strong); border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.mini-play { background: var(--grad-primary); border-color: transparent; }
.mini-play svg { width: 22px; height: 22px; }
.mini-close { border-color: transparent; color: var(--text-dim); }
.mini-info { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 44px; justify-content: center; color: var(--text); text-decoration: none; }
.mini-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-time { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-faint); }
.mini-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--surface-hover); }
.mini-bar span { display: block; height: 100%; width: 0; background: var(--grad-primary); }

@media (min-width: 600px) {
    .page-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
    .transcript-options { flex-direction: row; flex-wrap: wrap; gap: 4px 20px; }
    .part-item { flex-wrap: nowrap; }
}

@media (min-width: 900px) {
    body.has-nav { --nav-h: 0px; }
    body.has-nav .top-nav { display: flex; }
    body.has-nav .bottom-nav { display: none; }
    body.has-mini { --mini-h: 80px; }
    main { max-width: 960px; }
    body[data-view="login"] main, body[data-view="signup"] main { max-width: 1080px; }
    .meeting-grid { grid-template-columns: 1fr 1fr; }
    .mini-player { bottom: 16px; left: 50%; right: auto; width: min(928px, calc(100% - 48px)); transform: translateX(-50%); }

    /* The page header (title, meta, actions) and the tabs stay in view while the content scrolls. */
    .meeting-top {
        display: block; position: sticky; top: var(--header-h); z-index: 9;
        margin: -16px 0 0; padding: 16px 0 12px;
        background: rgba(5, 5, 5, 0.92);
        -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    }
    .meeting-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "back back" "main actions"; align-items: end; gap: 4px 16px; margin-bottom: 12px; }
    .back-link { grid-area: back; }
    .meeting-head-main { grid-area: main; min-width: 0; }
    .meeting-actions { grid-area: actions; }
    .subtabs { position: static; }
}
