/* Tynda AI — shared styles for the landing page and the app */
:root {
  --bg: #F4F7F6;
  --surface: #FFFFFF;
  --ink: #17323B;
  --muted: #4A5B62;
  --line: #DCE4E3;
  --line-soft: #E8EEED;
  --line-strong: #C9D6D4;
  --primary: #0B6E85;
  --primary-dark: #08566A;
  --primary-tint: #E3F1F4;
  --gold: #F2B632;
  --gold-tint: #FCEFC9;
  --gold-line: #E0A419;
  --gold-ink: #6B4A00;
  --danger: #C2312F;
  --danger-ink: #A3221F;
  --danger-line: #E7B6B5;
  --success-tint: #E2F3E8;
  --success-ink: #1D6B3A;
  --radius: 20px;
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
/* Room for the scrollbar is always kept, so pages and tabs of different height do not shift sideways */
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, svg { display: block; }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.mobile-only { display: none !important; }
@media (max-width: 900px) { .mobile-only { display: flex !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { max-width: 1200px; margin: 0 auto; padding-inline: 24px; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: -0.3px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 14px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-lg { min-height: 56px; padding: 0 30px; font-size: 17px; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 15px; border-radius: 12px; }
.btn-pill { border-radius: 999px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #FFFFFF; box-shadow: 0 8px 20px rgba(11,110,133,.22); }
.btn-primary:hover { background: var(--primary-dark); color: #FFFFFF; }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--primary); color: var(--ink); }
.btn-gold { background: var(--gold-tint); color: var(--gold-ink); border-color: #E9C766; }
.btn-gold:hover { background: #F9E3A6; color: var(--gold-ink); }
.btn-danger-outline { background: var(--surface); color: var(--danger-ink); border-color: var(--danger-line); }
.btn-danger-outline:hover { background: #FBEDED; color: var(--danger-ink); }
.btn-record { background: var(--danger); color: #FFFFFF; box-shadow: 0 10px 24px rgba(194,49,47,.28); }
.btn-record:hover { background: #A82826; color: #FFFFFF; }
.btn-icon { width: 44px; height: 44px; padding: 0; border-radius: 12px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.square { width: 12px; height: 12px; border-radius: 2px; background: currentColor; }

/* ---------- small pieces ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; padding: 6px 14px; border-radius: 999px; }
.chip-gold { background: var(--gold-tint); color: var(--gold-ink); }
.chip-teal { background: var(--primary-tint); color: var(--primary-dark); }
.chip-success { background: var(--success-tint); color: var(--success-ink); }
.chip-outline { border: 1px solid var(--line); color: var(--muted); font-size: 12px; letter-spacing: .6px; text-transform: uppercase; padding: 4px 10px; }
.time { flex: none; height: fit-content; font-family: var(--mono); font-size: 13px; color: var(--primary); background: var(--primary-tint); border-radius: 8px; padding: 4px 8px; white-space: nowrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo span { font-family: var(--display); font-weight: 700; font-size: 20px; }

.lang-switch { display: inline-flex; background: #EEF3F2; border-radius: 999px; padding: 4px; gap: 2px; }
.lang-switch button { min-height: 36px; min-width: 44px; padding: 0 12px; border: none; border-radius: 999px; background: transparent; color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--primary); color: #FFFFFF; }

.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; }
.input, .textarea {
  min-height: 48px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); font-weight: 400; font-size: 16px; width: 100%;
}
/* Honeypot field of the landing form: off-screen, not display:none (some bots skip hidden inputs) */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.textarea { padding: 12px 14px; resize: vertical; line-height: 1.6; }
.input:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,110,133,.15); }

.kz { background: var(--gold-tint); border-bottom: 2px solid var(--gold-line); padding: 1px 3px; border-radius: 4px; }
.ru { background: var(--primary-tint); border-bottom: 2px dashed var(--primary); padding: 1px 3px; border-radius: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 15px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 8px; }
.swatch { width: 16px; height: 16px; border-radius: 4px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #FFFFFF; padding: 12px 20px; border-radius: 12px; font-weight: 500; font-size: 15px;
  box-shadow: 0 12px 32px rgba(23,50,59,.25); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================= LANDING ================= */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.site-nav { display: flex; align-items: center; gap: 28px; font-weight: 500; font-size: 15px; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: none; }
.mobile-menu { display: none; }

.hero { padding-block: 96px 88px; display: flex; flex-wrap: wrap; align-items: center; gap: 64px; }
.hero-text { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 28px; align-items: flex-start; }
.hero h1 { font-size: clamp(30px, 4.2vw, 52px); line-height: 1.12; }
.hero p { font-size: 20px; line-height: 1.6; color: var(--muted); max-width: 540px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { flex: 1 1 380px; max-width: 520px; aspect-ratio: 1 / .82; border-radius: 32px; background: var(--primary-tint); display: flex; align-items: center; justify-content: center; gap: 28px; }
.mic-disc { width: 120px; height: 120px; border-radius: 50%; background: var(--primary); color: #FFFFFF; display: flex; align-items: center; justify-content: center; box-shadow: 0 16px 36px rgba(11,110,133,.3); }
.wave { display: flex; align-items: center; gap: 7px; }
.wave i { display: block; width: 9px; border-radius: 5px; background: var(--primary); }
.wave i.g { background: var(--gold); }

.facts { padding-bottom: 96px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.fact { padding: 28px; display: flex; flex-direction: column; gap: 8px; }
.fact strong { font-family: var(--display); font-size: 28px; color: var(--primary); }
.fact span { font-size: 16px; color: var(--muted); }

.band { background: var(--surface); border-block: 1px solid var(--line); }
.section { padding-block: 96px; }
.section h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.2; }
.section-lead { font-size: 18px; line-height: 1.65; color: var(--muted); }
.split { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.split > * { min-width: 0; }
.split-text { flex: 1 1 360px; display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }

.sample { flex: 1 1 520px; margin: 0; box-shadow: 0 24px 60px rgba(23,50,59,.10); border-radius: 24px; overflow: hidden; }
.sample-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.file-chip { display: flex; align-items: center; gap: 12px; }
.icon-box { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--primary-tint); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.sample-body { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.line { display: flex; gap: 14px; }
.line p { font-size: 18px; line-height: 1.8; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 40px; }
.step { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.step-n { width: 48px; height: 48px; border-radius: 14px; background: var(--primary); color: #FFFFFF; font-family: var(--display); font-weight: 700; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.step h3 { font-size: 21px; font-weight: 600; }
.step p { font-size: 16px; line-height: 1.6; color: var(--muted); }

.model { align-items: flex-start; }
.hours { display: flex; align-items: baseline; flex-wrap: wrap; gap: 14px; padding: 24px 28px; border-radius: 20px; background: var(--primary-tint); align-self: stretch; }
.hours strong { font-family: var(--display); font-size: 56px; color: var(--primary); line-height: 1; }
.hours span { font-size: 18px; }
.points { flex: 1 1 480px; display: flex; flex-direction: column; gap: 16px; }
.point { display: flex; gap: 18px; padding: 24px; background: var(--bg); border-radius: 20px; }
.point .check { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--gold-tint); color: var(--gold-ink); display: flex; align-items: center; justify-content: center; }
.point h3 { font-size: 19px; font-weight: 600; margin-bottom: 6px; }
.point p { font-size: 16px; line-height: 1.6; color: var(--muted); }

.privacy { margin-top: 72px; background: var(--primary); color: #FFFFFF; border-radius: 28px; padding: 48px; display: flex; flex-wrap: wrap; align-items: center; gap: 32px; }
.privacy .shield { flex: none; width: 72px; height: 72px; border-radius: 20px; background: rgba(255,255,255,.14); color: var(--gold); display: flex; align-items: center; justify-content: center; }
.privacy div { flex: 1 1 480px; display: flex; flex-direction: column; gap: 10px; }
.privacy h2 { font-size: 28px; }
.privacy p { font-size: 17px; line-height: 1.65; color: #E6F3F6; }

.contact { display: flex; flex-wrap: wrap; gap: 48px; }
.contact-info { flex: 1 1 360px; display: flex; flex-direction: column; gap: 18px; }
.contact-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; font-size: 17px; }
.contact-list span { display: flex; align-items: center; gap: 12px; }
.contact-form { flex: 1 1 480px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 18px; border-radius: 24px; }
.form-row { display: flex; flex-wrap: wrap; gap: 16px; }
.form-row .field { flex: 1 1 200px; }
.form-status { font-size: 15px; font-weight: 500; }
.form-status.ok { color: var(--success-ink); }
.form-status.err { color: var(--danger-ink); }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 28px; font-size: 14px; color: var(--muted); }
.site-footer .credits a { color: inherit; }

@media (max-width: 900px) {
  .site-nav, .header-actions .lang-switch { display: none; }
  .menu-toggle { display: inline-flex; }
  .mobile-menu { display: flex; flex-direction: column; padding: 8px 24px 20px; border-top: 1px solid var(--line); background: var(--surface); }
  .mobile-menu[hidden] { display: none !important; }
  .mobile-menu a { min-height: 52px; display: flex; align-items: center; font-size: 17px; font-weight: 500; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-soft); }
  .mobile-menu .lang-switch { margin-top: 16px; align-self: flex-start; display: inline-flex; }
}
@media (max-width: 600px) {
  .container { padding-inline: 20px; }
  .hero { padding-block: 40px 32px; gap: 32px; }
  .hero p { font-size: 17px; }
  .hero-actions, .hero-actions .btn { width: 100%; }
  .hero-art { aspect-ratio: auto; height: 180px; border-radius: 24px; gap: 20px; }
  .mic-disc { width: 84px; height: 84px; }
  .mic-disc svg { width: 36px; height: 36px; }
  .wave i { width: 7px; transform: scaleY(.7); }
  .facts { padding-bottom: 40px; }
  .fact { padding: 20px; }
  .fact strong { font-size: 24px; }
  .section { padding-block: 48px; }
  .sample-body { padding: 18px; }
  .line { flex-direction: column; gap: 8px; }
  .line p { font-size: 17px; }
  .steps { margin-top: 24px; gap: 14px; }
  .step { padding: 20px; }
  .hours strong { font-size: 44px; }
  .point { padding: 18px; }
  .privacy { margin-top: 40px; padding: 24px; border-radius: 22px; gap: 16px; }
  .privacy h2 { font-size: 20px; }
  .contact-form { padding: 20px; }
  .contact-form .btn { width: 100%; }
  .header-actions .btn:not(.btn-icon) { padding: 0 16px; }
}

/* ================= APP ================= */
.app { min-height: 100vh; display: flex; }
.sidebar { flex: none; width: 260px; background: var(--surface); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { padding: 0 8px; }
.sidebar .logo span { font-size: 18px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 28px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 12px; border: none; background: transparent; color: var(--muted); font-weight: 500; font-size: 15px; text-align: left; cursor: pointer; width: 100%; }
.nav-item:hover { background: var(--bg); }
.nav-item[aria-current="page"] { background: var(--primary-tint); color: var(--primary-dark); font-weight: 600; }
.user-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--bg); }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.user-card .who { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; font-weight: 600; }
.icon-link { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 10px; border: none; background: transparent; color: var(--muted); cursor: pointer; }
.icon-link:hover { background: var(--surface); color: var(--ink); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 40px; border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar h1 { font-size: 24px; }
.topbar p { font-size: 15px; color: var(--muted); margin-top: 4px; }
.mobile-bar { display: none; }
.tabbar { display: none; }
.view { padding: 40px; }

.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; }
.segmented button { min-height: 44px; padding: 0 22px; border: none; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; font-size: 15px; cursor: pointer; }
.segmented button[aria-selected="true"] { background: var(--primary); color: #FFFFFF; }

.record-wrap { display: flex; flex-direction: column; align-items: center; gap: 24px; }
/* min-height: "Record" and "Upload" are the same size, so switching tabs moves nothing */
.record-card { width: 100%; max-width: 760px; min-height: 520px; padding: 8px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; text-align: center; }
.mic-ring { width: 176px; height: 176px; border-radius: 50%; background: var(--primary-tint); display: flex; align-items: center; justify-content: center; }
.mic-ring .mic-disc { width: 128px; height: 128px; }
.timer { font-family: var(--mono); font-size: 44px; font-weight: 500; letter-spacing: 2px; }
.rec-live { color: var(--danger); display: inline-flex; align-items: center; gap: 8px; }
.rec-live .dot { width: 10px; height: 10px; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.meter { display: flex; align-items: center; gap: 6px; height: 120px; }
.meter i { display: block; width: 6px; border-radius: 3px; background: var(--primary); height: 8px; transition: height .08s; }
.meter i:nth-child(5n+3) { background: var(--gold); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.player { width: 100%; max-width: 520px; }
.live-transcript { width: 100%; border-top: 1px solid var(--line-soft); padding-top: 20px; text-align: left; }
.live-transcript #rec-transcript-wait { text-align: center; font-size: 14px; }
.live-transcript .fragments { padding: 0; gap: 14px; max-height: 320px; overflow-y: auto; }
.live-transcript .fragment p { font-size: 15px; line-height: 1.6; }
.dropzone { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 56px 24px; border: 2px dashed #9CC3CC; border-radius: 20px; background: #F2F8F9; text-align: center; transition: background-color .15s, border-color .15s; }
.dropzone.over { background: var(--primary-tint); border-color: var(--primary); }
.dropzone .upload-icon { width: 72px; height: 72px; border-radius: 20px; background: var(--surface); color: var(--primary); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(23,50,59,.08); }
.note { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.error-text { color: var(--danger-ink); font-weight: 500; }

.proc { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.proc-card { flex: 1 1 380px; min-width: 0; padding: 32px; border-radius: 24px; display: flex; flex-direction: column; gap: 24px; }
.progress { height: 12px; border-radius: 6px; background: var(--primary-tint); overflow: hidden; }
.progress div { height: 100%; width: 0; border-radius: 6px; background: var(--primary); transition: width .4s; }
.progress.indeterminate div { width: 30% !important; animation: slide 1.4s infinite ease-in-out; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.pct { font-family: var(--display); font-weight: 700; font-size: 28px; }
.stage { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--primary-dark); }
.stage .dot { width: 10px; height: 10px; background: var(--gold); }
/* Failed processing: the bar and the dot stop, nothing looks like it is still working */
.proc.failed .stage { color: var(--danger-ink); }
.proc.failed .stage .dot { background: var(--danger); }
.proc.failed .progress div { width: 0 !important; animation: none; }
.proc.failed .checklist li.active .mark::before { background: var(--danger); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.checklist li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.checklist li .mark { width: 20px; height: 20px; flex: none; display: flex; align-items: center; justify-content: center; }
.checklist li .mark::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #9AAEB3; }
.checklist li.done { color: var(--ink); }
.checklist li.done .mark::before { width: 12px; height: 7px; border-radius: 0; border: solid var(--primary); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -2px); }
.checklist li.active { color: var(--ink); font-weight: 600; }
.checklist li.active .mark::before { border: none; background: var(--gold); }
.live-card { flex: 2 1 480px; min-width: 0; border-radius: 24px; overflow: hidden; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 28px; border-bottom: 1px solid var(--line-soft); }
.card-head h2 { font-size: 18px; font-weight: 600; }
.fragments { padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.fragment { display: flex; gap: 16px; }
.fragment p { font-size: 17px; line-height: 1.75; white-space: pre-wrap; }
.fragment .textarea { flex: 1; min-width: 0; background: #F7FBFC; border-color: #9CC3CC; font-size: 17px; }
/* Speaker diarization: "Speaker N" above the text of each turn */
.frag-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.speaker { font-size: 14px; font-weight: 600; color: var(--primary-dark); }
.speaker.spk-even { color: var(--gold-ink); }
/* New recording: settings on the left, record / upload on the right */
/* One card: settings on the left, a divider, record / upload on the right; both halves have the card's full height */
.new-layout { display: grid; grid-template-columns: 384px minmax(0, 1fr); max-width: 1240px; border-radius: 24px; overflow: hidden; }
.record-main { display: flex; flex-direction: column; align-items: center; gap: 24px; min-width: 0; padding: 28px 32px; }
.settings-card { padding: 28px 24px 12px; border-right: 1px solid var(--line-soft); }
.settings-title { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
/* One setting: icon · name and state · (i) · switch; the explanation opens below on the whole width */
.setting { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; column-gap: 12px; padding: 16px 0; border-top: 1px solid var(--line-soft); }
.settings-title + .setting, .settings-title + .setting[hidden] + .setting { border-top: none; }
.setting-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-tint); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.setting-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setting-name { font-size: 15px; font-weight: 600; line-height: 1.3; }
.setting-state { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.info-btn { width: 32px; height: 32px; border: none; border-radius: 50%; background: transparent; color: #7C8E93; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.info-btn:hover, .info-btn[aria-expanded="true"] { background: var(--primary-tint); color: var(--primary); }
.setting-info { grid-column: 1 / -1; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: #F3F8F9; border: 1px solid #D5E7EB; font-size: 14px; line-height: 1.55; color: var(--ink); }
/* iOS-style switch */
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 44px; height: 26px; margin: 0; border-radius: 999px; background: #C9D6D4; cursor: pointer; transition: background .2s; flex: none; }
.switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(23, 50, 59, .3); transition: transform .2s; }
.switch:checked { background: var(--primary); }
.switch:checked::before { transform: translateX(18px); }
.switch:disabled { opacity: .5; cursor: default; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::before { transition: none; } }
/* Splitting accuracy: three choices under the name */
.setting-wide .info-btn { grid-column: 4; }
.choice { grid-column: 2 / -1; display: flex; gap: 4px; margin-top: 10px; padding: 4px; border-radius: 12px; background: #F1F5F4; }
.choice button { flex: 1; min-height: 36px; padding: 0 6px; border: none; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.choice button[aria-checked="true"] { background: var(--surface); color: var(--primary); box-shadow: 0 1px 4px rgba(23, 50, 59, .14); }
/* Turbo mode state: grey — off, gold blinking — starting, green — on */
.gpu-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #9AAEB3; }
#gpu-panel[data-state="starting"] .gpu-dot { background: var(--gold); animation: gpu-blink 1.2s ease-in-out infinite; }
#gpu-panel[data-state="ready"] .gpu-dot { background: #2E9B57; }
#gpu-panel[data-state="ready"] .setting-state { color: var(--success-ink); }
#gpu-panel[data-state="ready"] .setting-icon { background: var(--gold-tint); color: var(--gold-ink); }
@keyframes gpu-blink { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { #gpu-panel[data-state="starting"] .gpu-dot { animation: none; } }
.skeleton { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.skeleton span { height: 12px; border-radius: 6px; background: #EEF3F2; }

.journal { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.records { flex: 1 1 300px; min-width: 0; border-radius: 24px; overflow: hidden; }
.search { display: flex; align-items: center; gap: 10px; min-height: 46px; margin: 16px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 15px; }
.record-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 72px; padding: 14px 18px; border: none; border-top: 1px solid var(--line-soft); background: var(--surface); text-align: left; cursor: pointer; }
.record-item:hover { background: #F7FAF9; }
.record-item[aria-current="true"] { background: #F2F8F9; box-shadow: inset 4px 0 0 var(--primary); }
.record-item .meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.record-item .name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-item .sub { font-size: 13px; color: var(--muted); }
.empty { padding: 28px; color: var(--muted); font-size: 15px; }
.transcript { flex: 3 1 560px; min-width: 0; border-radius: 24px; overflow: hidden; }
.transcript .card-head { align-items: flex-start; padding: 24px 28px; }
.transcript h2 { font-size: 21px; }
.transcript .info { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin-top: 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; }
.edit-banner { padding: 14px 28px; background: #FFF8E6; border-bottom: 1px solid #F3E2B3; font-size: 14px; color: var(--gold-ink); }
.session-note { padding: 0 28px 24px; font-size: 13px; color: var(--muted); }
/* Listening: play button, timeline with each speaker's turns, current / total time */
.audio-player { display: flex; align-items: center; gap: 14px; padding: 16px 28px; border-bottom: 1px solid var(--line-soft); background: #FAFCFC; }
.player-btn { flex: none; width: 44px; height: 44px; border: none; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 6px 16px rgba(11, 110, 133, .25); }
.player-btn:hover { background: var(--primary-dark); }
.player-btn .pl-icon-pause, .player-btn.playing .pl-icon-play { display: none; }
.player-btn.playing .pl-icon-pause { display: block; }
.player-time { flex: none; font-family: var(--mono); font-size: 13px; color: var(--muted); min-width: 44px; text-align: center; }
.player-track { position: relative; flex: 1; min-width: 0; height: 28px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.pl-rail { position: relative; width: 100%; height: 12px; border-radius: 6px; background: var(--line-soft); overflow: hidden; }
.pl-segs, .pl-fill { position: absolute; inset: 0 auto 0 0; height: 100%; }
.pl-segs { width: 100%; }
.pl-seg { position: absolute; top: 0; height: 100%; background: #8CC6D3; }
.pl-seg.spk-even { background: #F5CF73; }
.pl-fill { width: 0; background: rgba(23, 50, 59, .22); pointer-events: none; }
.pl-head { position: absolute; top: 50%; left: 0; width: 18px; height: 18px; margin-left: -9px; margin-top: -9px; border-radius: 50%; background: var(--primary); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(23, 50, 59, .35); pointer-events: none; }
.player-gone { padding: 12px 28px; border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }

/* Rating of the recognised text: asks with a warm band, then calms down once rated */
.rating { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; padding: 18px 28px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(100deg, #FFF9EA 0%, #F3F9FA 100%); transition: background-color .3s; }
.rating.rated { background: #FAFCFC; }
.rating-ask { min-width: 0; }
.rating-q { font-weight: 600; font-size: 16px; }
.rating-hint { font-size: 13px; color: var(--muted); margin-top: 2px; }
.rating.rated .rating-hint { color: var(--success-ink); }
.rating-options { display: flex; gap: 10px; }
.rate-btn {
  --c: var(--primary); --tint: var(--primary-tint); --edge: var(--line-strong);
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px 0 12px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 15px; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, opacity .2s, box-shadow .15s, transform .15s;
}
.rate-btn svg { color: var(--c); transition: transform .2s; }
.rate-btn:hover { border-color: var(--edge); background: var(--tint); transform: translateY(-1px); }
.rate-btn:hover svg { transform: scale(1.08); }
.rate-btn:active { transform: translateY(0); }
.rate-good { --c: #2E9152; --tint: var(--success-tint); --edge: #9ED3B0; --ink-on: var(--success-ink); }
.rate-medium { --c: var(--gold-line); --tint: var(--gold-tint); --edge: #E9C766; --ink-on: var(--gold-ink); }
.rate-bad { --c: var(--danger); --tint: #FBEDED; --edge: var(--danger-line); --ink-on: var(--danger-ink); }
.rate-btn.selected { background: var(--tint); border-color: var(--c); color: var(--ink-on); box-shadow: 0 6px 16px -6px var(--c); }
.rating.rated .rate-btn:not(.selected) { opacity: .6; }
.rating.rated .rate-btn:not(.selected):hover { opacity: 1; }
.rate-btn.pop svg { animation: rate-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes rate-pop { 0% { transform: scale(1); } 40% { transform: scale(1.3) rotate(-8deg); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .rate-btn, .rate-btn svg { transition: none; }
  .rate-btn.pop svg { animation: none; }
}
.time-btn { border: none; cursor: pointer; }
.time-btn:hover { background: var(--primary); color: #fff; }
.fragment.now-playing { background: #EEF7F9; border-radius: 12px; box-shadow: 0 0 0 10px #EEF7F9; }

/* login */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-side { flex: 1 1 420px; background: var(--primary); color: #FFFFFF; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.auth-side .logo, .auth-side .logo:hover { color: #FFFFFF; }
.auth-side h2 { font-size: clamp(26px, 3vw, 36px); line-height: 1.2; max-width: 460px; }
.auth-side p { font-size: 17px; line-height: 1.6; color: #E6F3F6; max-width: 460px; margin-top: 20px; }
.auth-side .wave i { background: rgba(255,255,255,.55); width: 8px; }
.auth-side .wave i.g { background: var(--gold); }
.auth-main { flex: 1 1 520px; padding: 32px 24px 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.auth-main > .lang-switch { align-self: flex-end; background: var(--surface); border: 1px solid var(--line); }
.auth-form { width: 100%; max-width: 420px; padding: 40px; border-radius: 24px; box-shadow: 0 24px 60px rgba(23,50,59,.08); display: flex; flex-direction: column; gap: 22px; }
.auth-form h1 { font-size: 26px; }
.auth-form .input { min-height: 52px; font-size: 17px; letter-spacing: 1px; }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { display: none; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .mobile-bar .logo span { font-size: 17px; }
  .mobile-bar .lang-switch button { min-width: 38px; padding: 0 8px; }
  .topbar { padding: 20px 16px 4px; border: none; background: transparent; }
  .topbar .lang-switch { display: none; }
  .topbar h1 { font-size: 22px; }
  .view { padding: 16px 16px 104px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .tabbar .nav-item { flex: 1; flex-direction: column; justify-content: center; gap: 4px; min-height: 56px; font-size: 12px; padding: 0; text-align: center; }
  .tabbar .nav-item[aria-current="page"] { background: transparent; color: var(--primary); }
  .segmented { display: flex; width: 100%; }
  .segmented button { flex: 1; padding: 0 8px; }
  .record-card { min-height: 440px; gap: 22px; }
  .new-layout { grid-template-columns: 1fr; }
  .settings-card { padding: 16px 16px 4px; border-right: none; border-bottom: 1px solid var(--line-soft); }
  .record-main { padding: 20px 16px 24px; }
  .mic-ring { width: 148px; height: 148px; }
  .mic-ring .mic-disc { width: 108px; height: 108px; }
  .timer { font-size: 38px; }
  .proc-card { padding: 20px; }
  .fragments { padding: 16px; gap: 14px; }
  .fragment { flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; }
  .fragment .time { align-self: flex-start; }
  .fragment p { font-size: 16px; }
  .card-head, .transcript .card-head { padding: 16px; }
  .edit-banner { padding: 12px 16px; }
  .session-note { padding: 0 16px 16px; }
  .audio-player { padding: 12px 16px; gap: 10px; }
  .player-time { min-width: 0; font-size: 12px; }
  .player-gone { padding: 10px 16px; }
  .rating { padding: 14px 16px; }
  .rating-options { width: 100%; }
  .rate-btn { flex: 1 1 0; justify-content: center; padding: 0 10px; font-size: 14px; gap: 6px; }
  .fragment.now-playing { box-shadow: none; border-color: #9CC3CC; }
  .journal.has-selection .records { display: none; }
  .journal:not(.has-selection) .transcript { display: none; }
  .toolbar { width: 100%; }
  .toolbar .btn { flex: 1 1 auto; }
  .auth-side { padding: 28px 24px; gap: 24px; flex-basis: 100%; }
  .auth-side .wave { display: none; }
  .auth-form { padding: 24px; }
}
