:root {
  --ink: #f2eaff;
  --ink-soft: #c9bbd8;
  --muted: #9b8eaa;
  --accent: #800080;
  --accent-light: #a080c0;
  --line: rgba(160, 128, 192, .3);
  --surface-strong: #160d20;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #0a0616; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: radial-gradient(ellipse 88% 70% at 50% -18%, rgba(128, 0, 128, .34), transparent 65%), radial-gradient(ellipse 70% 75% at 100% 0%, rgba(74, 23, 84, .52), transparent 68%), linear-gradient(150deg, #1f0d2a 0%, #0f0919 45%, #0a0616 100%); background-attachment: fixed; font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body::before { display: none; }
body::after { content: ""; position: fixed; z-index: -1; inset: 0; pointer-events: none; opacity: .16; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E"); mix-blend-mode: soft-light; }
button, select, input { font: inherit; } button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { position: relative; z-index: 1; min-height: 100svh; display: flex; flex-direction: column; padding: 0 24px; }
.brand-header { display: flex; flex-direction: column; align-items: flex-start; padding-top: 17px; text-align: left; }
.brand-lockup { display: inline-flex; align-items: center; gap: 5px; }
.brand-mark-link { display: block; line-height: 0; }
.brand-logo { display: block; width: 22px; height: 22px; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; align-items: flex-start; }
.brand-name { display: block; color: var(--ink); font-family: var(--serif); font-size: 23px; font-weight: 600; line-height: .95; letter-spacing: -1px; text-decoration: none; }
.made-by { display: flex; align-items: center; gap: 3px; margin: 2px 0 0; color: var(--muted); font-size: 7px; font-weight: 400; letter-spacing: 0; line-height: 1; }
.made-by a { display: inline-flex; align-items: center; gap: 2px; border: 0; border-radius: 0; padding: 0; color: var(--ink-soft); font-size: 8px; font-weight: 500; text-decoration: none; }
.x-mark { display: none; }

.practice-stage { width: min(100%, 760px); flex: 1; display: flex; flex-direction: column; align-items: center; margin: 0 auto; padding: 58px 0 42px; }
.setup { display: flex; flex-direction: column; align-items: center; width: 100%; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 313px); padding: 4px; border: 1px solid rgba(160, 128, 192, .3); border-radius: 999px; background: rgba(10, 6, 22, .58); box-shadow: inset 0 1px 7px rgba(0, 0, 0, .34); }
.mode-option { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 38px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 14px; font-weight: 600; letter-spacing: -.25px; white-space: nowrap; }
.mode-option:hover { color: var(--ink); }
.mode-option.is-active { background: var(--accent); color: var(--ink); box-shadow: 0 0 0 3px rgba(128, 0, 128, .18); }
.mode-symbol { display: inline-block; min-width: 14px; color: var(--accent-light); font-size: 17px; line-height: 1; }
.mode-option.is-active .mode-symbol { color: var(--ink); }
.mode-description { min-height: 42px; max-width: 370px; margin: 12px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.45; text-align: center; }

.niche-control { position: relative; width: min(100%, 280px); margin-top: 4px; }
.niche-button { display: flex; align-items: center; width: 100%; min-height: 43px; padding: 0 14px; border: 1px solid rgba(160, 128, 192, .82); border-radius: 24px; background: rgba(15, 8, 23, .68); color: var(--ink); cursor: pointer; font-size: 14px; font-weight: 600; text-align: left; }
.niche-button[aria-expanded="true"] { border-color: var(--accent-light); background: rgba(74, 23, 84, .62); }
.niche-leading { width: 21px; margin-right: 8px; color: var(--accent-light); font-size: 18px; line-height: 1; text-align: center; }
.niche-chevron { margin-left: auto; color: var(--ink-soft); font-size: 17px; line-height: 1; transform: translateY(3px); }
.niche-menu { position: absolute; z-index: 5; top: calc(100% + 8px); left: 0; width: 100%; max-height: 300px; overflow-y: auto; padding: 5px; border: 1px solid rgba(160, 128, 192, .35); border-radius: 12px; background: rgba(22, 13, 32, .98); box-shadow: 0 18px 34px rgba(0, 0, 0, .48); }
.niche-menu::-webkit-scrollbar { width: 8px; } .niche-menu::-webkit-scrollbar-thumb { border-radius: 8px; background: rgba(180, 179, 165, .38); }
.niche-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 14px; font-weight: 600; text-align: left; }
.niche-option:hover, .niche-option.is-selected { background: rgba(74, 23, 84, .7); color: var(--ink); }
.niche-option-icon { width: 19px; font-size: 16px; text-align: center; }

.prompt-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 228px; margin-top: 24px; text-align: center; }
.prompt-status { margin: 0 0 14px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 2.2px; text-transform: uppercase; }
.topic-text { max-width: 760px; margin: 0; color: var(--ink); font-family: var(--serif); font-size: clamp(48px, 6.8vw, 85px); font-weight: 600; line-height: .98; letter-spacing: -2.8px; }
.topic-text.is-spinning { color: var(--accent-light); animation: topic-reel .22s steps(2, end) infinite; }
@keyframes topic-reel { 0% { opacity: .55; transform: translateY(2px); } 50% { opacity: 1; transform: translateY(-1px); } 100% { opacity: .7; transform: translateY(1px); } }
.actions { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 15px; }
.primary-action, .secondary-action { min-height: 48px; border-radius: 25px; padding: 0 25px; cursor: pointer; font-size: 15px; font-weight: 700; letter-spacing: -.3px; }
.primary-action { border: 1px solid var(--accent); background: var(--accent); color: var(--ink); box-shadow: 0 10px 25px rgba(74, 23, 84, .32); }
.primary-action:hover { border-color: var(--accent-light); background: var(--accent-light); }
.secondary-action { border: 1px solid rgba(160, 128, 192, .24); background: rgba(10, 6, 22, .34); color: var(--muted); }
.secondary-action:not(:disabled) { color: var(--ink-soft); cursor: pointer; }
.secondary-action:not(:disabled):hover { border-color: rgba(160, 128, 192, .78); color: var(--ink); }
.secondary-action:disabled { cursor: not-allowed; }
.settings-action { display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid rgba(160, 128, 192, .3); border-radius: 50%; background: rgba(10, 6, 22, .34); color: var(--ink-soft); cursor: pointer; font-size: 18px; }
.settings-action:hover { border-color: var(--accent); color: var(--accent-light); }
.timer-panel { position: fixed; z-index: 15; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(10, 6, 22, .82); backdrop-filter: blur(12px); }
.timer-dialog { width: min(100%, 480px); padding: 24px 26px 27px; border: 1px solid rgba(160, 128, 192, .4); border-radius: 18px; background: rgba(22, 13, 32, .96); box-shadow: 0 28px 80px rgba(0, 0, 0, .5); text-align: center; }
.timer-dialog-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.timer-dialog-top .reset-button { justify-self: end; }
.timer-exit { justify-self: start; padding: 5px 0; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.timer-exit:hover, .reset-button:hover { color: var(--ink); }
.timer-kicker { margin: 34px 0 10px; color: var(--accent-light); font-size: 9px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.timer-topic { max-width: 400px; margin: 0 auto; color: var(--ink); font-family: var(--serif); font-size: clamp(27px, 4.3vw, 46px); font-weight: 600; line-height: 1.02; letter-spacing: -1.4px; }
.timer-ring { position: relative; width: 220px; height: 220px; margin: 24px auto 13px; }
.timer-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 6; }
.timer-ring-track { stroke: rgba(160, 128, 192, .2); }
.timer-ring-progress { stroke: var(--accent-light); stroke-linecap: round; stroke-dasharray: 603.19; stroke-dashoffset: 0; transition: stroke-dashoffset .3s linear; }
.timer-dialog .timer-display { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-size: 52px; }
.waveform-module { width: min(100%, 300px); margin: 15px auto 0; }
.waveform-visual { display: flex; align-items: center; justify-content: center; gap: 12px; }
.waveform-dot { display: block; width: 13px; height: 13px; flex: 0 0 13px; border-radius: 50%; background: rgba(223, 110, 85, .4); box-shadow: 0 0 0 4px rgba(223, 110, 85, .06); }
.waveform-dot.is-live { background: #ed655c; box-shadow: 0 0 0 4px rgba(237, 101, 92, .1), 0 0 18px rgba(237, 101, 92, .55); }
.waveform-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 0 25px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: 1.3px; }
.waveform-label.is-live { color: var(--accent-light); }
.waveform-level { color: var(--ink-soft); font-variant-numeric: tabular-nums; letter-spacing: .4px; }
.waveform-canvas { display: block; width: 252px; height: 48px; }
.reset-button, .close-button { border: 0; background: none; color: var(--ink-soft); cursor: pointer; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.timer-status { margin: 0; color: var(--muted); font-size: 12px; }
.timer-control { min-width: 130px; min-height: 43px; margin-top: 22px; padding: 0 20px; border: 1px solid var(--accent); border-radius: 23px; background: var(--accent); color: var(--ink); cursor: pointer; font-size: 14px; font-weight: 700; }
.timer-control:hover { background: var(--accent-light); border-color: var(--accent-light); }
.timer-actions { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 22px; }
.timer-actions .timer-control { margin-top: 0; }
.analysis-action { min-height: 43px; padding: 0 17px; border: 1px solid rgba(160, 128, 192, .5); border-radius: 23px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 14px; font-weight: 700; }
.analysis-action:hover { border-color: var(--accent-light); color: var(--ink); }
.confetti-canvas { position: fixed; z-index: 30; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.app-footer { display: flex; justify-content: space-between; gap: 20px; width: min(100%, 1120px); margin: auto auto 0; padding: 0 0 19px; color: rgba(212, 205, 190, .6); font-size: 11px; letter-spacing: .2px; }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(5, 11, 10, .68); backdrop-filter: blur(8px); }
.settings-modal { width: min(100%, 430px); border: 1px solid rgba(160, 128, 192, .56); border-radius: 18px; padding: 25px; background: var(--surface-strong); box-shadow: 0 24px 70px rgba(0, 0, 0, .5); }
.modal-topline { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.settings-modal h2 { margin: 28px 0 25px; color: var(--ink); font-family: var(--serif); font-size: 43px; font-weight: 600; }
.setting-row { border-top: 1px solid var(--line); padding: 19px 0; }
.setting-row label { display: flex; justify-content: space-between; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.setting-row output { color: var(--accent-light); }
input[type="range"] { width: 100%; margin: 18px 0 0; accent-color: var(--accent); cursor: pointer; }
.check-row { display: flex; align-items: center; gap: 11px; border-top: 1px solid var(--line); padding: 18px 0; color: var(--ink-soft); font-size: 13px; font-weight: 600; cursor: pointer; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); } .modal-save { margin-top: 13px; }

.analysis-backdrop { z-index: 25; }
.analysis-dialog { width: min(100%, 660px); height: min(720px, calc(100svh - 24px)); max-height: calc(100svh - 24px); overflow: hidden; padding: 21px 27px 22px; border: 1px solid rgba(160, 128, 192, .56); border-radius: 18px; background: rgba(22, 13, 32, .98); box-shadow: 0 28px 80px rgba(0, 0, 0, .55); }
.analysis-heading { margin: 22px 0 15px; }
.analysis-kicker { margin: 0 0 10px; color: var(--accent-light); font-size: 9px; font-weight: 700; letter-spacing: 2px; }
.analysis-heading h2 { max-width: 100%; margin: 0; color: var(--ink); font-family: var(--serif); font-size: clamp(29px, 4.2vw, 42px); font-weight: 600; line-height: 1; letter-spacing: -1.5px; }
.analysis-heading p:last-child { max-width: 560px; margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.analysis-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; border-top: 1px solid var(--line); padding-top: 14px; }
.metric-row { display: grid; gap: 5px; }
.metric-label { display: flex; align-items: baseline; justify-content: space-between; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.metric-label strong { color: var(--ink); font-size: 13px; }
.metric-track { height: 6px; overflow: hidden; border-radius: 99px; background: rgba(160, 128, 192, .18); }
.metric-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent-light); transition: width .6s ease-out; }
.metric-row:nth-child(2) .metric-track span { background: #d7b84f; }
.metric-row:nth-child(3) .metric-track span { background: #df6e55; }
.metric-track-neutral span { background: var(--ink-soft); }
.metric-row p { min-height: 15px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.25; }
.analysis-details { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 15px; border-top: 1px solid var(--line); padding-top: 13px; }
.analysis-details > div { display: grid; gap: 5px; }
.analysis-detail-label { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; }
.analysis-details strong { color: var(--ink); font-size: 20px; font-weight: 600; }
.transcript-block { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.transcript-block p { display: -webkit-box; overflow: hidden; margin: 6px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.analysis-insights { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.analysis-insights ul { display: grid; gap: 4px; margin: 6px 0 0; padding: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.3; list-style: none; }
.analysis-insights li::before { content: "✦"; margin-right: 7px; color: var(--accent-light); }

.analysis-page-body { overflow-y: auto; }
.analysis-page-shell { min-height: 100svh; padding: 0 28px; }
.analysis-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-top: 18px; }
.analysis-back-link { margin-top: 8px; color: var(--ink-soft); font-size: 12px; text-decoration: none; }
.analysis-back-link:hover { color: var(--ink); }
.analysis-page-main { width: min(100%, 960px); margin: 0 auto; padding: 72px 0 64px; }
.analysis-page-intro { margin-bottom: 30px; }
.analysis-page-intro h1 { max-width: 650px; margin: 8px 0 10px; color: var(--ink); font-family: var(--serif); font-size: clamp(42px, 6vw, 72px); font-weight: 600; line-height: .98; letter-spacing: -2.5px; }
.analysis-page-intro > p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.analysis-screen { width: 100%; padding: 27px 30px 30px; border: 1px solid rgba(160, 128, 192, .45); border-radius: 18px; background: rgba(22, 13, 32, .74); box-shadow: 0 26px 70px rgba(0, 0, 0, .22); }
.analysis-screen .analysis-heading { margin: 0 0 22px; }
.analysis-screen .analysis-heading h2 { max-width: 720px; font-size: clamp(31px, 4vw, 48px); }
.analysis-screen .analysis-metrics { gap: 16px 28px; }
.analysis-screen .analysis-details { margin-top: 20px; }
.analysis-screen .transcript-block { margin-top: 20px; }
.analysis-screen .analysis-insights { margin-top: 20px; }
@media (max-width: 600px) {
  .analysis-page-shell { padding: 0 16px; }
  .analysis-page-header { align-items: center; }
  .analysis-page-main { padding-top: 54px; }
  .analysis-page-intro h1 { letter-spacing: -1.7px; }
  .analysis-screen { padding: 22px 17px 24px; }
  .analysis-screen .analysis-metrics { gap: 12px; }
}

@media (max-width: 600px) {
  .app-shell { padding: 0 16px; } .brand-header { padding-top: 16px; } .brand-lockup { gap: 4px; } .brand-logo { width: 18px; height: 18px; } .brand-name { font-size: 19px; letter-spacing: -.8px; } .made-by { margin-top: 2px; font-size: 6px; } .made-by a { font-size: 7px; }
  .practice-stage { padding-top: 44px; } .mode-switch { width: min(100%, 330px); } .mode-option { padding: 0 8px; font-size: 13px; }
  .mode-description { max-width: 300px; font-size: 13px; } .prompt-stage { min-height: 205px; margin-top: 19px; }
  .topic-text { font-size: clamp(43px, 13vw, 66px); letter-spacing: -1.9px; } .actions { flex-wrap: wrap; max-width: 340px; }
  .app-footer { font-size: 10px; } .app-footer span:last-child { display: none; }
  .timer-dialog { padding: 21px 17px 23px; } .timer-ring { width: 198px; height: 198px; } .timer-dialog .timer-display { font-size: 47px; } .timer-actions { flex-wrap: wrap; } .analysis-dialog { padding: 21px 17px 23px; } .analysis-heading { margin-top: 25px; } .analysis-details { grid-template-columns: repeat(2, 1fr); gap: 7px; } .analysis-details strong { font-size: 17px; } .analysis-insights { grid-template-columns: 1fr; gap: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
