/* All Voices web app. Mobile-first, responsive, light/dark. */

:root {
  --bg: #fafafa;
  --warnbg: #fff6e0;
  --warn: #8a5a00;
  --errorbg: #fdecea;
  --surface: #ffffff;
  --surface2: #f0f2f5;
  --text: #1a1c1e;
  --muted: #5f6368;
  /* The brand's own colours, the same two the logo and the landing page use
     (ground #7A2BF0, mark #FFC53D). The app used to run on an unrelated
     indigo, so a customer crossing from the marketing page into the product
     met different buttons on the other side. */
  --primary: #7A2BF0;
  --primary-hover: #8a41f4;
  --primary-contrast: #ffffff;
  --brand-amber: #FFC53D;
  --brand-amber-hover: #ffd05c;
  --brand-amber-ink: #2b1a00;
  --setup-changed-bg: #fff6d9;
  --setup-changed-border: #b8860b;
  --setup-changed-ink: #6b4d00;
  /* The identity pair, fixed in both themes: the hero faces and the mark
     itself are these two colours whatever the page ground is. */
  --brand-purple-fixed: #7A2BF0;
  /* Functional, NOT brand: the translation under a line, and links. Kept
     teal so a translation stays visually distinct from brand furniture. */
  --accent: #0b7568; /* AA on --bg/--surface (5.3:1); #0e8f83 measured 3.8:1 */
  --accent-contrast: #ffffff;
  --error: #b3261e;
  --border: #dfe3e8;
  --radius: 10px;
  /* Height of the sticky top bar; anything else that sticks below it offsets
     by this rather than guessing. */
  --topbar-h: 55px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101418;
    --surface: #181c21;
    --surface2: #222830;
    --text: #e4e6e8;
    --muted: #9aa0a6;
    /* A tint of the brand purple that stays legible on a dark ground; the
       amber needs no lightening. */
    --primary: #b794ff;
    --primary-hover: #c9b0ff;
    --primary-contrast: #1c0b3a;
    --brand-amber: #FFC53D;
    --brand-amber-hover: #ffd05c;
    --brand-amber-ink: #2b1a00;
    --setup-changed-bg: #473600;
    --setup-changed-border: #FFC53D;
    --setup-changed-ink: #ffe3a3;
    --accent: #6fd6c9;
    --accent-contrast: #06302c;
    --error: #f2b8b5;
    /* These had no dark values, so the low-hours bar painted cream-on-brown
       over a dark page. */
    --warnbg: #33280a;
    --warn: #ffd98a;
    --errorbg: #3a1a18;
    --border: #303840;
  }
}

* { box-sizing: border-box; }
/* The hidden attribute must win over display:flex/grid on layout classes. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
}
a { color: var(--accent); text-decoration: none; }

#topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 900px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px;
}
#brand { font-weight: 700; font-size: 17px; white-space: nowrap; }
/* The brand must yield before the nav does: on a narrow phone the wordmark
 * was wrapping to two lines to make room for the session action. */
.brand-link { flex: 0 0 auto; }
/* On a phone the logo alone is the brand: the wordmark was clipping
   mid-word to make room for the nav, which looks broken. Tapping the logo
   still goes home. */

#nav { display: flex; gap: 4px; margin-inline-start: auto; }
#nav[hidden] { display: none; }
#nav a {
  padding: 6px 12px; border-radius: 999px; color: var(--text); font-size: 15px;
}
#nav a.active { background: var(--surface2); font-weight: 600; }
/* The session entry is an ACTION, not a place: a filled pill, visibly a
 * different kind of thing from the Meetings/Settings tabs. While a session
 * runs it turns into a live timer, which is also the way back to it. */
#nav a.nav-action {
  background: var(--primary); color: var(--primary-contrast); font-weight: 600;
  white-space: nowrap;
}
#nav a.nav-action.active { background: var(--primary); }
#nav a.nav-action.running { background: var(--error); font-variant-numeric: tabular-nums; }
#nav a.nav-action.running.paused { background: var(--muted); }

/* Ready state: what will happen, and the gesture that starts it. */
.session-heading { flex-wrap: nowrap; }
.session-heading h1 { min-width: 0; margin-block: 0.67em; }
.session-options-trigger {
  width: 44px; height: 44px; flex: 0 0 44px; padding: 0;
  display: inline-grid; place-items: center; border-radius: 50%;
  font-size: 26px; line-height: 1;
}
.ready-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 18px; margin: 8px 0 4px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
}
.ready-card .ready-body { margin: 0; color: var(--muted); max-width: 46ch; line-height: 1.5; }
.ready-language-setup {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  max-width: 100%; min-height: 44px; padding: 8px 16px;
  color: var(--accent); border: 1.5px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  font-weight: 700; white-space: normal; overflow-wrap: anywhere;
  text-align: center; line-height: 1.3;
}
.ready-language-setup.changed {
  color: var(--setup-changed-ink); border-color: var(--setup-changed-border);
  background: var(--setup-changed-bg);
}
.ready-card .ready-start { font-size: 17px; padding: 12px 26px; border-radius: 999px; }
.ready-card .ready-hours { font-size: 14px; }

/* Account and pre-meeting vocabulary. Logical alignment/padding keeps these
 * layouts native in RTL; controls wrap instead of clipping at large text. */
.ready-terms {
  width: 100%; text-align: start; padding: 14px;
  background: var(--surface2); border-radius: 12px;
}
.ready-terms h2, .ready-terms h3 { margin: 0 0 8px; }
.ready-terms h3 { margin-top: 16px; font-size: 15px; }
.ready-term-subhead { margin-bottom: 8px; }
.term-list { display: flex; flex-direction: column; gap: 8px; }
.term-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px; align-items: center; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.term-row.disabled { opacity: 0.58; }
.term-row-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.term-row-copy strong, .term-row-copy span { overflow-wrap: anywhere; }
.term-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.term-row-toggle, .term-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.term-row-toggle { margin: 0; }
.term-row-toggle input, .term-switch input {
  width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--primary);
}
.term-active-list, .term-preview-entries, .term-dropped-list {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.term-active-entry, .term-preview-entry, .term-dropped-entry {
  max-width: 100%; padding: 5px 9px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); overflow-wrap: anywhere;
  white-space: normal;
}
.term-preview { display: flex; flex-direction: column; gap: 8px; }
.term-dropped-title { color: var(--error); margin-top: 5px; }
.term-dropped-entry { border-color: var(--error); color: var(--error); }
.term-empty { padding: 28px 16px; text-align: center; border: 1px dashed var(--border); border-radius: 10px; }
.term-field-hint { margin: -6px 0 2px; }
.term-editor { max-height: 90dvh; }
.term-editor-form {
  min-height: 0; overflow-y: auto; padding: 0 18px 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.term-editor-form .actions { padding-inline: 0; flex-wrap: wrap; }
.term-delete > p, .term-delete > .error-text { margin-inline: 18px; }
.session-options .session-option-icon {
  width: 32px; height: 32px; flex: 0 0 32px; display: inline-grid;
  place-items: center; border-radius: 9px; background: var(--surface2);
  color: var(--primary); font-weight: 700;
}
.session-options .session-option-copy {
  min-width: 0; display: flex; flex-direction: column; align-items: flex-start;
  gap: 2px; white-space: normal; overflow-wrap: anywhere;
}
.meeting-terms-draft { max-height: 88dvh; overflow: hidden; }
.meeting-terms-draft-content {
  min-height: 0; overflow-y: auto; padding: 0 18px 18px;
  scroll-padding-bottom: 24px;
}
.meeting-terms-draft-content > p:first-child { margin-top: 0; }
.meeting-terms-draft-content h4 { margin: 18px 0 8px; }
.meeting-term-preview-action { margin-top: 18px; }
.meeting-terms-draft .term-preview { margin-top: 10px; }
.sheet .meeting-terms-draft-actions { flex: none; }

@media (max-width: 600px) {
  .term-row { grid-template-columns: 1fr; }
  .term-row-actions { justify-content: flex-start; }
  .ready-terms { padding-inline: 10px; }
}

.container { max-width: 900px; margin: 0 auto; padding: 16px; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

h1 { font-size: 22px; margin: 8px 0 12px; }
h2 { font-size: 17px; margin: 20px 0 8px; color: var(--primary); }
.muted { color: var(--muted); font-size: 14px; }
.error-text { color: var(--error); font-size: 14px; }
.ok-text { color: var(--accent); font-size: 15px; font-weight: 600; margin: 0; }
/* The card the reader was sent to, so the promise they clicked is the thing
   they see first. */
.card.highlight { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
}
.card.clickable { cursor: pointer; }
.card.clickable:hover { background: var(--surface2); }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row .spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* A partner link is intentionally long and the money table keeps one column
 * per measure. Contain both inside the phone viewport: the link wraps, while
 * the table gets its own horizontal scroll surface instead of widening the
 * whole document. */
.partner-program-link-row { min-width: 0; }
.partner-program-link {
  flex: 1 1 220px; min-width: 0; max-width: 100%;
  overflow-wrap: anywhere; word-break: break-word;
}
.partner-program-table-wrap {
  max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.partner-program-table-wrap table { min-width: max-content; }

button, .btn {
  font: inherit; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
  padding: 9px 18px;
}
button.primary { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); font-weight: 600; }
button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
/* The one amber button, matching the landing page: the recommended pack.
   Everything else is purple, so the amber means "this is the one". */
button.primary.alt { background: var(--brand-amber); border-color: var(--brand-amber); color: var(--brand-amber-ink); }
button.primary.alt:hover { background: var(--brand-amber-hover); border-color: var(--brand-amber-hover); }
button.danger { color: var(--error); }
button:disabled { opacity: 0.45; cursor: default; }
button.small { padding: 5px 12px; font-size: 14px; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--primary); outline-offset: 2px;
}

input, textarea, select {
  font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
label { font-size: 13px; color: var(--muted); display: block; margin: 10px 0 4px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; font-size: 14px; cursor: pointer; user-select: none;
  background: var(--surface);
}
.chip.on { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.chip.static { cursor: default; }

.tag {
  display: inline-block; font-size: 12px; padding: 2px 8px;
  border-radius: 6px; background: var(--surface2); color: var(--muted);
}

.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 12px; overflow-x: auto; }
.tabs button {
  border: none; background: none; border-radius: 0; padding: 10px 14px;
  color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.active { color: var(--text); font-weight: 600; border-bottom-color: var(--primary); }

/* Finished-meeting navigation stays immediately below the app top bar while
 * its transcript/summary/notes/chat content uses the document scroll. Keep
 * this scoped: other tab rows may live inside their own scrolling surface. */
.meeting-tabs {
  position: sticky;
  top: var(--topbar-h);
  z-index: 19;
  background: var(--bg);
  margin-bottom: 0;
}
.meeting-tab-body { padding-top: 12px; }
.output-language-chip {
  min-height: 44px; max-width: 100%; margin-bottom: 12px;
  white-space: normal; text-align: start; line-height: 1.35;
  overflow-wrap: anywhere;
}
.settings-output-language { max-width: 480px; }
.settings-language-button {
  width: 100%; min-height: 48px; border-radius: 10px;
  text-align: start; overflow-wrap: anywhere;
}
.settings-industry-terms h2 { overflow-wrap: anywhere; }
.settings-industry-card {
  display: flex; flex-direction: column; gap: 14px;
}
.settings-industry-item {
  min-width: 0; display: flex; flex-direction: column;
  align-items: flex-start; gap: 8px;
}
.settings-industry-item + .settings-industry-item {
  border-block-start: 1px solid var(--border); padding-block-start: 14px;
}
.settings-industry-copy { margin: 0; overflow-wrap: anywhere; }
.settings-industry-action {
  min-height: 44px; max-width: 100%; white-space: normal;
  overflow-wrap: anywhere; text-align: start;
}

/* Reviewed industry topics. User text always uses dir=auto; layout uses
 * logical properties so RTL catalogues and long scripts keep the same order. */
.topic-list, .topic-review, .topic-batch, .topic-form,
.topic-concept-editor form { display: grid; gap: 12px; }
.topic-row { display: flex; align-items: center; gap: 16px; }
.topic-row-copy { min-width: 0; flex: 1; }
.topic-row-copy h2 { margin: 0 0 4px; overflow-wrap: anywhere; }
.topic-row-copy p { margin: 3px 0; overflow-wrap: anywhere; }
.topic-row.disabled, .topic-concept:not(.state-accepted) { opacity: .78; }
.topic-row-actions, .topic-concept-actions, .topic-batch-actions,
.topic-generation-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.topic-row-actions button, .topic-row-actions .btn,
.topic-concept-actions button, .topic-batch-actions button,
.topic-generation-actions button, .topic-language-choice {
  min-block-size: 44px;
}
.topic-language-group, .topic-edit-group {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  min-inline-size: 0;
}
.topic-language-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 12px; margin-block-start: 8px;
}
.topic-language-choice, .topic-check {
  display: flex; align-items: center; gap: 9px; padding: 6px;
  overflow-wrap: anywhere;
}
.topic-language-choice input, .topic-check input,
.topic-concept header > input { inline-size: 22px; block-size: 22px; flex: none; }
.topic-ai-note {
  border-inline-start: 4px solid var(--accent); padding-inline-start: 12px;
  overflow-wrap: anywhere;
}
.topic-generation { display: flex; gap: 12px; align-items: center; }
.topic-generation progress { inline-size: min(240px, 45vw); }
.topic-concept { display: grid; gap: 8px; }
.topic-heading, .topic-concept > header { flex-wrap: wrap; }
.topic-heading h1 { min-inline-size: 0; overflow-wrap: anywhere; }
.topic-concept h3 { margin: 6px 0 0; font-size: 1rem; }
.topic-form-list, .topic-mapping-list { margin: 0; padding-inline-start: 24px; }
.topic-form-list li, .topic-mapping-list li {
  margin-block: 5px; overflow-wrap: anywhere;
}
.topic-review-state, .topic-identity {
  border-radius: 999px; padding: 3px 8px; font-size: .82rem;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.topic-review-state.rejected { background: color-mix(in srgb, #b42318 12%, transparent); }
.topic-review-state.pending { background: color-mix(in srgb, #a15c00 14%, transparent); }
.topic-concept-editor .sheet, .topic-editor .sheet {
  max-block-size: min(92vh, 900px); overflow: auto;
}
.topic-edit-group input[type="text"], .topic-edit-group textarea,
.topic-edit-group select, .topic-form input[type="text"],
.topic-editor input[type="text"] { inline-size: 100%; }

@media (max-width: 640px), (min-resolution: 2dppx) and (max-width: 800px) {
  .topic-row { align-items: stretch; flex-direction: column; }
  .topic-row-actions, .topic-concept-actions, .topic-batch-actions,
  .topic-generation-actions { inline-size: 100%; }
  .topic-row-actions > *, .topic-concept-actions > *,
  .topic-batch-actions > *, .topic-generation-actions > * { flex: 1 1 130px; }
  .topic-language-grid { grid-template-columns: 1fr; }
}
.artifact-editor { max-width: 640px; }
.artifact-editor textarea {
  min-height: min(48dvh, 420px); margin: 0 18px; width: calc(100% - 36px);
}

.report-accuracy-notice { margin-bottom: 8px; overflow-wrap: anywhere; }
.report-template-picker {
  max-width: 680px; margin-bottom: 12px; overflow-wrap: anywhere;
}
.report-template-picker label {
  display: grid; gap: 6px; font-weight: 700;
}
.report-template-select {
  width: 100%; min-height: 48px; padding: 10px 12px; font: inherit;
  color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; white-space: normal;
}
.report-template-description { margin: 8px 0 0; line-height: 1.4; }
.report-template-reversible { margin: 4px 0 0; line-height: 1.4; }
.report-structure-preview > h2 { font-size: 18px; margin: 20px 0 10px; }
.report-preview-section h3 { margin: 0 0 8px; font-size: 17px; }
.meeting-ai-charge-notice { margin: 0 0 12px; overflow-wrap: anywhere; }
.report-progress {
  display: flex; align-items: center; gap: 10px; min-height: 48px;
}
.report-actions {
  align-items: stretch; margin-bottom: 10px; flex-wrap: wrap;
}
.report-actions button, .report-create-action {
  min-height: 44px; white-space: normal; overflow-wrap: anywhere;
}
.report-transcript-toggle {
  display: flex; align-items: center; gap: 10px; min-height: 48px;
  width: fit-content; max-width: 100%; cursor: pointer; overflow-wrap: anywhere;
}
.report-transcript-toggle input {
  width: 24px; height: 24px; flex: none; accent-color: var(--primary);
}
.report-transcript-hint { margin: 0 0 12px 34px; }
.report-section { margin-bottom: 12px; padding: 14px; overflow-wrap: anywhere; }
.report-table-wrap {
  max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain;
}
.report-table-wrap table {
  width: 100%; min-width: min(420px, 100%); border-collapse: collapse;
  table-layout: fixed; text-align: start;
}
.report-table-wrap th, .report-table-wrap td {
  padding: 8px; border: 1px solid var(--border); vertical-align: top;
  white-space: normal; overflow-wrap: anywhere;
}
.report-table-wrap th { background: var(--surface); font-weight: 700; }
.report-section-heading {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.report-section-heading h2 {
  flex: 1 1 180px; min-width: 0; margin: 0; font-size: 18px;
  overflow-wrap: anywhere;
}
.report-section-heading .spacer { flex: 1 1 auto; }
.report-section-heading button { min-height: 44px; white-space: normal; }
.report-section-body { min-width: 0; }
.report-section-title-editor {
  width: 100%; min-height: 44px; margin-bottom: 8px; font-weight: 700;
  overflow-wrap: anywhere;
}
.report-section-editor {
  width: 100%; min-height: 180px; resize: vertical; overflow-wrap: anywhere;
}
.report-editor-actions { justify-content: flex-end; margin-top: 8px; }
.report-editor-actions button { min-height: 44px; min-width: 96px; }
.report-dropped {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 18px 0 64px; padding-top: 12px; border-top: 1px solid var(--border);
}
.report-dropped h2 { flex: 1 0 100%; margin: 0; font-size: 16px; }
.report-dropped .chip {
  min-height: 44px; white-space: normal; text-align: start; overflow-wrap: anywhere;
}
[dir="rtl"] .report-transcript-hint { margin-left: 0; margin-right: 34px; }
[dir="rtl"] .report-section { text-align: right; }
[dir="rtl"] .report-template-picker,
[dir="rtl"] .report-template-select { text-align: right; }

/* live text-size setting (older/low-vision users). Applied to the live
 * transcript container. "m" is the base size and needs no rules; only the
 * TOP step is offered on wide viewports only. Mirrors liveFontScale in
 * LiveScreen.kt (x1.0 / x1.3 / x1.7 / x2.1 on the base). */
.live-font-l .seg .src { font-size: 21px; line-height: 1.4; }
.live-font-l .seg .tr { font-size: 19px; line-height: 1.4; }
.live-font-xl .seg .src { font-size: 27px; line-height: 1.35; }
.live-font-xl .seg .tr { font-size: 24px; line-height: 1.35; }
.live-font-xxl .seg .src { font-size: 34px; line-height: 1.3; }
.live-font-xxl .seg .tr { font-size: 30px; line-height: 1.3; }
.font-chip { align-items: center; }
.font-glyph { align-items: baseline; gap: 2px; }
.font-chip .a-small { font-size: 11px; }
.font-chip .a-big { font-size: 18px; font-weight: 700; }
.font-sample-l { font-size: 21px; }
.font-sample-xl { font-size: 26px; }
.font-sample-xxl { font-size: 32px; }

/* transcript segments */
.seg { display: flex; gap: 10px; padding: 7px 0; }
/* Whole-turn wash (P4). The padding moves INSIDE the wash so the tint reads
 * as a block, and the small radius keeps consecutive turns from fusing. */
.seg.washed { padding: 8px 10px; margin: 2px -10px; border-radius: 8px; }
/* P3: dim filler, mark key lines. Never hidden - a skim view can be added
 * later; for now the emphasis is always on. */
.seg.dim .src, .seg.dim .tr { opacity: 0.45; }
.seg.key { border-left: 2px solid var(--primary); padding-left: 8px; margin-left: -10px; }
.seg .bar { width: 3px; border-radius: 2px; flex: none; }
.seg .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg .speaker { font-weight: 600; padding: 1px 8px; border-radius: 6px; font-size: 12px; }
.seg .src { margin: 2px 0 0; }
.seg .tr { margin: 2px 0 0; color: var(--accent); font-size: 15px; }
.seg .editable-segment-text {
  min-height: 48px; margin-inline: -8px; padding: 10px 8px;
  border-radius: 8px; cursor: text; overflow-wrap: anywhere;
}
.seg .editable-segment-text:hover,
.seg .editable-segment-text:focus-visible { background: var(--surface2); }
.seg .human-edited-text {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--primary);
  text-underline-offset: 4px;
}
.human-edit-marker {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--primary); font-weight: 650;
}
.meeting-correction-action {
  min-height: 48px; white-space: normal; overflow-wrap: anywhere;
}
.seg.provisional { opacity: 0.6; }
.seg.summary-excluded { opacity: 0.72; }
.summary-pause-marker {
  display: flex; align-items: center; gap: 7px; margin: 10px 0 5px;
  padding: 6px 10px; border-radius: 8px; border: 1px dashed var(--border);
  color: var(--muted); font-size: 13px; font-weight: 650;
}
.summary-pause-marker.paused { border-color: var(--primary); }
.live-summary-pause-note { padding: 5px 2px 0; line-height: 1.4; }
.summary-pause-control[aria-pressed="true"] {
  color: var(--primary); border-color: var(--primary); background: var(--surface2);
}
.live-pip-unavailable { font-size: 13px; line-height: 1.35; }

/* Live controls sit below the app bar and remain reachable while a long
 * transcript scrolls. Critical actions are not attached to the mobile
 * browser's bottom edge, where Firefox Focus may overlay its own toolbar. */
.live-head {
  position: sticky; top: var(--topbar-h); z-index: 19;
  width: 100%; max-width: 100%; min-width: 0; contain: inline-size;
  background: var(--bg); padding: 6px 0 8px;
  border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.live-head:not(.active) { border-bottom-color: transparent; }
.live-status-block { display: grid; gap: 4px; min-width: 0; max-width: 100%; }
.rec-row {
  min-height: 44px; min-width: 0; max-width: 100%; flex-wrap: nowrap;
  justify-content: flex-start; gap: 8px; overflow: hidden;
}
.live-status {
  display: inline-flex; align-items: center; gap: 9px;
  flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hours-note {
  flex: 1 1 auto; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.live-control-row {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto; align-items: stretch; gap: 8px;
  width: 100%; max-width: 100%; min-width: 0; padding-top: 4px;
  flex-wrap: nowrap;
}
.live-control-row button {
  width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap; overflow: hidden;
}
.live-pause-action, .live-resume-action { grid-column: 1; grid-row: 1; }
.live-stop-action { grid-column: 2; grid-row: 1; }
.live-primary-icon { flex: none; }
.live-primary-label {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.live-mode-row {
  min-width: 0; max-width: 100%; flex-wrap: nowrap; gap: 6px;
  padding-top: 0; overflow: visible;
}
.live-mode-row .chip {
  flex: 1 1 0; min-width: 44px; max-width: none; min-height: 44px;
  margin-bottom: 0; padding-inline: 10px;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; text-align: start; line-height: 1.3;
  transform-origin: left center;
}
.live-mode-label {
  display: block; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.live-mode-lock { flex: none; }
.live-language-notice {
  margin-top: 8px; padding: 10px 12px;
  border: 1px solid var(--primary); border-radius: var(--radius);
  background: var(--surface2);
}
.live-language-notice-text { font-size: 14px; font-weight: 600; line-height: 1.4; }
.live-language-boundary { margin-top: 3px; line-height: 1.35; }
.live-language-notice-actions {
  align-items: stretch; gap: 6px; margin-top: 7px;
}
.live-language-notice-actions button {
  min-height: 44px; white-space: normal; text-align: center;
}
.language-mode-current { margin: 0 18px 6px; font-weight: 650; }
.language-mode-help { margin: 0 18px 10px; line-height: 1.4; }
.meeting-language-policy { margin-top: 7px; }
.live-mode-row .chip.auto-mode-cue {
  animation: auto-mode-cue 2.6s ease-out;
}
@keyframes auto-mode-cue {
  0%, 8% {
    transform: scale(1.07); color: var(--primary);
    border-color: var(--primary); background: var(--surface2);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 24%, transparent);
    font-weight: 700;
  }
  68% {
    transform: scale(1.07); color: var(--primary);
    border-color: var(--primary); background: var(--surface2);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 18%, transparent);
    font-weight: 700;
  }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .live-mode-row .chip.auto-mode-cue {
    animation: none; color: var(--primary); border-color: var(--primary);
    background: var(--surface2); box-shadow: 0 0 0 3px var(--primary);
    font-weight: 700;
  }
}
.live-config-row {
  display: flex; width: 100%; max-width: 100%; min-width: 0;
  flex-wrap: nowrap; gap: 8px; overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-inline: contain; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-block: 4px 8px; padding-inline: 0 28px; margin-bottom: 0;
}
.live-config-row::-webkit-scrollbar { display: none; }
.live-config-row .chip {
  flex: 0 0 auto; min-width: 0; max-width: min(170px, 70vw);
  min-height: 44px; padding: 7px 11px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.live-action-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.live-action-label {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.live-audience-chip { min-height: 44px; flex: 0 0 auto; }
.live-captions-action[aria-pressed="true"] {
  color: var(--primary); border-color: var(--primary); background: var(--surface2);
}
.live-pip-unavailable {
  flex: 0 0 auto; max-width: min(220px, 72vw); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.live-notes-pad textarea {
  width: calc(100% - 36px); min-height: min(42dvh, 320px);
  margin: 0 18px; overflow-wrap: anywhere;
}
@media (max-width: 360px) {
  .live-status .level { display: none; }
  .live-audience-chip {
    max-width: 132px; padding-inline: 10px; justify-content: center;
  }
  .live-audience-label {
    display: inline; max-width: 84px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
  }
  .live-language-notice-actions button { flex: 1 1 132px; }
}
[dir="rtl"] .live-mode-row .chip { transform-origin: right center; }
[dir="rtl"] .live-control-row,
[dir="rtl"] .live-config-row { direction: rtl; }
[dir="rtl"] .live-language-notice,
[dir="rtl"] .language-mode-current,
[dir="rtl"] .language-mode-help { text-align: right; }
.rec-dot {
  width: 10px; height: 10px; border-radius: 50%; background: #d33;
  animation: pulse 1.2s infinite alternate; display: inline-block;
}
@keyframes pulse { from { opacity: 0.35; } to { opacity: 1; } }
.level { display: inline-flex; gap: 2px; align-items: flex-end; height: 18px; }
.level i { width: 4px; background: var(--surface2); border-radius: 1px; display: block; }
.level i.on { background: var(--primary); }

.banner {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px;
  font-size: 14px;
}

/* chat */
.chat-log { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.msg { max-width: 85%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--primary); color: var(--primary-contrast); }
.msg.assistant { align-self: flex-start; background: var(--surface2); }
.msg.md { white-space: normal; overflow-wrap: anywhere; }
.msg.md > :first-child { margin-top: 0; }
.msg.md > :last-child { margin-bottom: 0; }
.streaming-answer { min-height: 42px; }
.stream-caret {
  display: inline-block; color: var(--muted); margin-inline-start: 2px;
  animation: chat-caret 0.8s steps(1) infinite;
}
@keyframes chat-caret { 50% { opacity: 0; } }
.chat-stop {
  min-width: 44px; min-height: 44px; padding: 0; border-radius: 50%;
  color: var(--muted); flex: 0 0 44px;
}

/* Assistant-is-answering indicator: three pulsing dots in an assistant bubble. */
.msg.typing { display: inline-flex; align-items: center; gap: 5px; padding: 14px 15px; }
.msg.typing .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: typing-dot 1.2s ease-in-out infinite;
}
.msg.typing .dot:nth-child(2) { animation-delay: 0.15s; }
.msg.typing .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-dot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* Composer stays visible while the log scrolls; input and Send share one line. */
.chat-composer {
  position: sticky; bottom: 0; z-index: 10;
  background: var(--bg);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
}
.chat-input-row { flex-wrap: nowrap; }
.chat-input-row textarea {
  flex: 1; width: auto; min-width: 0; min-height: 48px; max-height: 144px;
  resize: vertical;
}
.answer-language-row { display: flex; justify-content: flex-start; }
.answer-language-chip {
  min-height: 44px; max-width: 100%; white-space: normal;
  text-align: start; overflow-wrap: anywhere;
}
/* Keep the newest message clear of the sticky composer when scrolled into view. */
.chat-log > * { scroll-margin-bottom: 84px; }

@media (prefers-reduced-motion: reduce) {
  .stream-caret, .msg.typing .dot { animation: none; }
}

/* markdown-lite */
.md h3 { font-size: 16px; margin: 14px 0 4px; }
.md h4 { font-size: 15px; margin: 10px 0 3px; }
.md ul { margin: 4px 0; padding-inline-start: 22px; }
.md p { margin: 6px 0; }

.center { text-align: center; }
.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;
}

/* login */
.login-wrap {
  min-height: calc(100dvh - 120px);
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1100px 500px at 15% -10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 60%),
    radial-gradient(900px 480px at 110% 15%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 55%);
  border-radius: var(--radius);
}
.login-box {
  max-width: 400px; width: 100%; margin: 0 auto; padding: 28px 26px 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 10px 40px rgba(20, 24, 80, 0.10);
}
.login-logo { width: 84px; height: 84px; margin: 0 auto 4px; display: block; border-radius: 20px; }
.brand-title { letter-spacing: 0.5px; margin-top: 2px; }
button.ghost { background: none; border-color: var(--border); color: var(--muted); }
#brand-logo { width: 26px; height: 26px; border-radius: 7px; vertical-align: middle; margin-inline-end: 8px; }
.topbar-inner #brand { display: inline-flex; align-items: center; }
/* On a phone the logo alone is the brand: the wordmark was clipping mid-word
 * to make room for the session action, which reads as broken. Tapping the
 * logo still goes home. Specificity must match the rule above. */
@media (max-width: 560px) {
  .topbar-inner #brand { display: none; }
  .brand-link #brand-logo { margin-inline-end: 0; }
}
/* Keep the 26 px artwork visually small while its first-in-order link remains
 * a full touch target. Negative logical margins spend the top bar's existing
 * padding, so this does not make the chrome taller or move RTL spacing. */
.brand-link { display: inline-flex; align-items: center; color: inherit; }
.topbar-inner .brand-link {
  min-width: 44px; min-height: 44px; padding: 9px;
  margin-block: -9px; margin-inline-start: -9px; border-radius: 10px;
}
.brand-link:hover { opacity: 0.85; }

audio { width: 100%; margin: 6px 0; }

/* One meeting-level transport over the independently durable archive clips.
 * The native <audio> element is deliberately hidden: Firefox Focus rendered
 * every one-minute clip as another 0:00 player, exposing a storage boundary
 * instead of the recording. */
.meeting-audio-controls {
  display: grid; grid-template-columns: 46px minmax(100px, 1fr) auto;
  align-items: center; gap: 12px; margin-top: 10px;
}
.meeting-audio-play {
  width: 46px; height: 46px; padding: 0; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700;
}
.meeting-audio-seek { padding: 0; accent-color: var(--primary); }
.meeting-audio-clock {
  min-width: 92px; text-align: end; color: var(--muted);
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.meeting-audio-error { margin-top: 8px; }
.meeting-audio-media { display: none; }

@media (max-width: 480px) {
  .container { padding: 12px; padding-bottom: 110px; }
  #nav a { padding: 6px 9px; font-size: 14px; }
  /* Keep the action readable when three items must share a phone width. */
  #nav { gap: 2px; }
  #nav a.nav-action { padding: 6px 10px; }

  h1 { font-size: 19px; }
  /* Smaller nav padding here, so what sticks below the bar offsets less. */
  :root { --topbar-h: 49px; }
  .meeting-audio-controls {
    grid-template-columns: 46px minmax(80px, 1fr);
  }
  .meeting-audio-clock { grid-column: 2; text-align: start; }
}

/* A 320px layout is still a supported phone viewport. Keep every signed-in
 * destination reachable without making the whole page horizontally scroll. */
@media (max-width: 360px) {
  .topbar-inner { padding-inline: 8px; gap: 4px; }
  #brand-logo {
    width: 24px; height: 24px; margin-inline-end: 0;
  }
  #nav a { padding-inline: 6px; font-size: 13px; }
  #nav a.nav-action { padding-inline: 8px; }
  .topbar-inner #nav-share { width: 32px; margin-inline-start: 0; }
}

/* bottom sheet (language pickers) */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--surface); color: var(--text);
  width: 100%; max-width: 640px; max-height: 75dvh;
  border-radius: 16px 16px 0 0; padding: 14px 0 calc(10px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.sheet h3 { margin: 2px 18px 10px; font-size: 17px; }
/* The scroll area clears the bottom by more than any mobile browser's
 * overlaying toolbar. Firefox Focus (and similar privacy browsers) draw an
 * opaque bottom bar over fixed content WITHOUT shrinking the viewport, so the
 * last row of a bottom sheet - e.g. "Extra large" in the text-size picker -
 * landed under it: black on black and untappable (reported 2026-08-18). The
 * safe-area inset is 0 on those browsers, so a hard floor does the work. */
.sheet .rows {
  overflow-y: auto; flex: 1;
  padding-bottom: max(env(safe-area-inset-bottom), 56px);
  scroll-padding-bottom: 56px;
}
.sheet .row-item {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 12px 18px; cursor: pointer; font-size: 16px;
  color: var(--text);
}
.sheet button.row-item {
  width: 100%; border: 0; border-radius: 0; background: transparent;
  text-align: start;
}
.sheet .row-item:hover, .sheet .row-item:active,
.sheet .row-item:focus-visible { background: var(--surface2); }
.sheet .row-item .native {
  margin-inline-start: auto; color: var(--muted); font-size: 14px;
}
.sheet .row-item .tick { width: 22px; color: var(--primary); font-weight: 700; }
.sheet .actions { display: flex; gap: 10px; padding: 10px 18px 4px; }
.sheet .actions button { flex: 1; }
.language-setup-quick { max-width: 520px; }
.language-setup-quick .language-setup-sheet-row {
  min-height: 52px; align-items: center; white-space: normal;
  overflow-wrap: anywhere;
}
.language-setup-sheet-copy {
  min-width: 0; display: flex; flex-direction: column; align-items: flex-start;
  gap: 2px; line-height: 1.3;
}
.language-setup-sheet-copy strong,
.language-setup-sheet-copy span { text-align: start; overflow-wrap: anywhere; }
.language-setup-sheet-copy .muted { font-size: 13px; }
.language-setup-quick .actions button {
  min-height: 44px; white-space: normal; overflow-wrap: anywhere;
}
[dir="rtl"] .language-setup-sheet-copy { align-items: flex-end; }
.voice-sheet .row-item { cursor: default; }
.voice-sheet .actions { flex-wrap: wrap; }
.voice-speaker { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.voice-speaker strong { overflow-wrap: anywhere; }
.voice-status { color: var(--muted); font-size: 13px; }
.voice-status-enrolled { color: var(--accent); }
.voice-status-withdrawn { color: var(--error); }

/* The access-link capability is previewed before it can replace an account.
 * Keep the target account and both decisions readable at every supported
 * phone width; logical alignment/padding makes the same dialog RTL-safe. */
.access-link-confirmation { max-width: 430px; }
.access-link-confirmation-content {
  padding: 0 18px 6px; text-align: start; overflow-wrap: anywhere;
}
.access-link-account {
  display: flex; align-items: baseline; gap: 8px; margin: 4px 0 10px;
  min-width: 0;
}
.access-link-account strong { min-width: 0; overflow-wrap: anywhere; }
.access-link-confirmation .actions { flex-wrap: wrap; }
.access-link-confirmation .actions button {
  flex: 1 1 150px; min-width: 0; min-height: 48px;
  white-space: normal; overflow-wrap: anywhere;
}
[dir="rtl"] .access-link-confirmation-content { text-align: right; }

.correction-editor, .find-replace-sheet {
  max-height: 88dvh; overflow: hidden;
}
.correction-editor-content {
  overflow-y: auto; padding: 0 18px 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.correction-editor-content textarea { min-height: 112px; }
.correction-editor .actions, .find-replace-sheet .actions { flex-wrap: wrap; }
.correction-editor .actions button, .find-replace-sheet .actions button {
  flex: 1 1 140px; min-width: 0; min-height: 48px;
  white-space: normal; overflow-wrap: anywhere;
}
.machine-original {
  margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 9px; color: var(--muted); overflow-wrap: anywhere;
}
.machine-original summary { cursor: pointer; font-weight: 650; }
.machine-original div { margin-top: 8px; white-space: pre-wrap; }
.find-replace-results { margin-top: 10px; }
.find-replace-count { font-weight: 650; }
.correction-preview-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px; padding: 10px 0; border-top: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.correction-preview-row > div { grid-column: 1 / -1; color: var(--muted); }
.correction-undo-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.correction-undo-bar .spacer { flex: 1; }
[dir="rtl"] .correction-editor,
[dir="rtl"] .find-replace-sheet { text-align: right; }

/* One stable live-language picker. Its header and actions stay put while the
 * language list scrolls, so mode changes do not make the sheet jump. */
.language-mode-picker {
  height: min(88dvh, 720px); max-height: 88dvh; overflow: hidden;
}
.language-mode-content {
  display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0;
}
.language-mode-header { flex: none; padding-inline: 14px; }
.language-mode-picker .language-mode-current,
.language-mode-picker .language-mode-help { margin-inline: 4px; }
.language-mode-segments {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}
.language-mode-segment {
  min-width: 0; min-height: 48px; padding: 7px 5px; border-radius: 0;
  white-space: normal; overflow-wrap: anywhere; line-height: 1.25;
}
.language-mode-segment:first-child {
  border-start-start-radius: 999px; border-end-start-radius: 999px;
}
.language-mode-segment:last-child {
  border-start-end-radius: 999px; border-end-end-radius: 999px;
}
.language-mode-segment + .language-mode-segment { margin-inline-start: -1px; }
.language-mode-segment.active {
  position: relative; z-index: 1; color: var(--primary);
  border-color: var(--primary); background: var(--surface2); font-weight: 650;
}
.language-mode-body {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
  padding: 10px 14px 0;
}
.language-mode-pair-hint { margin: 0 4px 8px; }
.language-mode-pair-lists {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px; flex: 1; min-height: 160px;
}
.language-mode-pair-column {
  min-width: 0; min-height: 0; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.language-mode-pair-column-title {
  min-height: 56px; margin: 0; padding: 7px 8px;
  display: flex; flex-direction: column; justify-content: center;
  color: var(--primary); background: var(--surface2); line-height: 1.25;
  overflow-wrap: anywhere;
}
.language-mode-pair-column-title strong {
  color: var(--text); font-size: 14px; margin-top: 2px;
}
.language-mode-pair-column .language-mode-language-list {
  flex: 1; min-height: 0; padding-bottom: 16px;
}
.language-mode-pair-column .row-item {
  padding-inline: 8px; gap: 4px; align-items: flex-start;
  white-space: normal; overflow-wrap: anywhere;
}
.language-mode-pair-column .row-item .tick { width: 16px; flex: none; }
.language-mode-pair-column .row-item .native {
  display: none;
}
.language-mode-swap {
  min-height: 48px; margin-top: 4px; border: 0; color: var(--primary);
}
.language-mode-swap .swap-glyph { display: inline-block; margin-inline-end: 7px; }
.language-mode-pair > h4 { margin: 2px 4px 4px; font-size: 14px; }
.language-mode-recents {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 4px 7px;
  scrollbar-width: thin;
}
.language-mode-recents button {
  flex: 0 0 auto; min-height: 48px; max-width: 240px;
  padding: 7px 12px; white-space: normal;
}
.language-mode-empty { margin: 2px 4px 8px; }
.language-mode-picker .language-mode-language-list {
  min-height: 0; padding-bottom: 56px;
}
.language-mode-picker .language-mode-language-list .row-item { min-height: 48px; }
.language-mode-auto-toggle {
  width: 100%; min-height: 48px; margin: 0; padding-block: 4px;
  display: flex; align-items: center; cursor: pointer;
  justify-content: space-between; gap: 12px; color: var(--text); font-size: 16px;
}
.language-mode-auto-toggle input {
  width: 26px; height: 26px; flex: none; accent-color: var(--primary);
}
.language-mode-auto > p { margin: 6px 0; line-height: 1.45; }
.sheet .language-mode-actions {
  flex: none; display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-inline: 14px;
}
.sheet .language-mode-actions button {
  width: 100%; min-width: 0; min-height: 48px;
  white-space: normal; overflow-wrap: anywhere;
}
.sheet .language-mode-actions .language-mode-supporting-action {
  grid-column: 1 / -1;
}
[dir="rtl"] .language-mode-picker { text-align: right; }
[dir="rtl"] .language-mode-swap .swap-glyph { transform: scaleX(-1); }

/* floating "recording continues" pill (non-live views) */
#recpill {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 40;
  background: var(--error); color: var(--surface);
  border: none; font-weight: 600; font-size: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
#recpill.paused { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 8px 18px; border-radius: 999px; font-size: 14px;
  z-index: 60; opacity: 0; transition: opacity 0.2s; pointer-events: none;
  max-width: 90vw; text-align: center;
}
#toast.show { opacity: 0.92; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

[dir="rtl"] .output-language-chip,
[dir="rtl"] .answer-language-chip,
[dir="rtl"] .settings-language-button,
[dir="rtl"] .artifact-editor textarea { text-align: right; }

@media (max-width: 360px) {
  .output-language-chip, .answer-language-chip {
    width: 100%; justify-content: flex-start; padding-inline: 12px;
  }
  .report-template-picker { max-width: none; }
  .report-template-select { min-height: 52px; }
  .report-actions button { flex: 1 1 140px; }
  .report-section-heading .spacer { display: none; }
  .report-section-heading button { flex: 1 1 120px; }
  .report-editor-actions button { flex: 1 1 120px; }
  .chat-input-row { gap: 6px; }
  .chat-input-row button { padding-inline: 14px; }
  .sheet .row-item { padding-inline: 12px; }
  .access-link-confirmation-content { padding-inline: 12px; }
  .access-link-confirmation .actions { padding-inline: 12px; }
  .access-link-confirmation .actions button { flex-basis: 100%; }
}

/* copy buttons */
.copy-btn {
  border: none; background: none; color: var(--muted); cursor: pointer;
  padding: 2px 6px; font-size: 15px; border-radius: 6px; line-height: 1;
}
.copy-btn:hover { background: var(--surface2); color: var(--text); }
/* N5: per-line translation playback. Same quiet chrome as the copy button;
 * the active (speaking) state is the one moment it may stand out. */
.tts-btn { margin-left: 6px; font-size: 12px; vertical-align: middle; }
.tts-btn.tts-active { color: var(--accent, #7A2BF0); }
.msg-row { display: flex; align-items: flex-end; gap: 2px; }
.msg-row.user { flex-direction: row-reverse; align-self: flex-end; }
.msg-row.assistant { align-self: flex-start; }

/* Purchase page (#/get): trial and pack cards inside the login box. */
.get-box { max-width: 460px; }
.get-card { text-align: left; }
.get-card h2 { border: 0; padding: 0; }
.pack .pack-price { font-size: 20px; }
.check-row { gap: 8px; align-items: center; cursor: pointer; }
.check-row input { width: auto; margin: 0; }
.hours-value { font-size: 18px; }
.hours-note { font-variant-numeric: tabular-nums; }

/* Signed-in chrome before the bundle runs (see the inline script in app.html):
 * [hidden] would otherwise keep the navigation invisible for the first ~700 ms
 * of a page load, which looks exactly like the signed-out site. */
/* !important, because the [hidden] reset above is !important too: without
 * it this rule always lost and the whole mechanism was inert. */
html.signed-in #nav[hidden] { display: flex !important; }

/* Share lives in the top bar: it is the app's growth path, and at the bottom
 * of Settings nobody found it. Icon-only, so it costs no horizontal room. */
#nav-share {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 32px; padding: 0; margin-left: 2px;
  border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--muted);
}
#nav-share:hover { background: var(--surface2); color: var(--text); }

/* A balance is useful before it becomes low: keep it visible on Meetings,
 * Live and Settings instead of surfacing it only as an alarm. */
.balance-chip {
  display: inline-flex; align-items: center; min-height: 32px;
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface2); color: var(--text); font-size: 13px;
  font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* Personal referral sharing: QR is the primary in-person action, with the
 * system sheet and clipboard plainly available underneath. */
.referral-share {
  max-width: 480px; overflow-y: auto; align-items: stretch;
  padding: 18px 22px max(calc(18px + env(safe-area-inset-bottom)), 64px);
}
.referral-share h3, .referral-reward h3 { margin-inline: 0; }
.referral-benefit { margin: 0; font-size: 17px; line-height: 1.45; }
.referral-share-status { min-height: 44px; text-align: center; }
.referral-qr { display: flex; justify-content: center; margin: 6px 0 12px; }
.referral-qr svg {
  width: min(72vw, 300px); height: auto; padding: 8px;
  border-radius: 14px; background: #fff;
}
.referral-qr-fallback {
  display: block; width: min(72vw, 300px); height: auto;
  padding: 8px; margin: 6px auto 12px; border-radius: 14px; background: #fff;
}
.referral-url {
  display: block; min-height: 44px; padding: 9px 10px; margin: 0 0 8px;
  border-radius: 9px; background: var(--surface2); text-align: center;
  overflow-wrap: anywhere;
}
.sheet .referral-share-actions {
  flex-direction: column; align-items: stretch;
  gap: 8px; padding: 10px 0 4px;
}
.sheet .referral-share-actions button {
  flex: 0 0 auto; width: 100%; min-width: 0; min-height: 44px; height: auto;
  padding: 11px 16px; border-radius: 12px; line-height: 1.3;
  white-space: normal; overflow-wrap: anywhere;
}
.sheet .referral-share-actions .referral-share-primary { min-height: 48px; }
.sheet .referral-share-actions .referral-share-close {
  background: transparent; border-color: transparent; color: var(--muted);
}
.sheet .referral-share-actions .referral-share-close:hover {
  background: var(--surface2); color: var(--text);
}

/* Reward acknowledgement is intentionally celebratory without confetti or
 * blocking motion: amount first, current authoritative total second. */
.referral-reward {
  max-width: 440px; overflow-y: auto; text-align: center;
  padding: 20px 24px max(calc(20px + env(safe-area-inset-bottom)), 64px);
  border-top: 5px solid var(--brand-amber);
}
.referral-reward-amount {
  margin: 4px 0 8px; color: var(--primary);
  font-size: clamp(38px, 12vw, 54px); line-height: 1.05; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.referral-reward-reason { margin: 6px 0; font-size: 17px; }
.referral-reward-total {
  margin: 12px 0; padding: 12px; border-radius: 12px;
  background: var(--surface2); font-size: 17px;
}
.referral-reward-actions { padding-inline: 0 !important; }
.referral-reward-done { min-height: 46px; }

@media (max-width: 380px) {
  .referral-share, .referral-reward { padding-inline: 16px; }
  .balance-chip { padding-inline: 8px; }
}

/* The access link on the purchase page: it is the one thing the buyer has to
 * act on, so it is a link, not selectable text. */
/* Third-party sign-in buttons: the provider's mark sits beside the label. */
/* Pack ladder: the badged tier is the one the page recommends. */
.get-card.badged { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.pack-badge {
  display: inline-block; margin: -4px 0 6px; padding: 2px 9px;
  background: var(--primary); color: var(--primary-contrast);
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
.pack-rate { font-size: 13px; }

.signin-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }

.link-card { color: var(--primary); }
.link-card:hover { text-decoration: underline !important; }

/* P6: account detail under the balance. */
.acct-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 8px 0; font-size: 14px; }
.acct-kv .acct-k { color: var(--muted); }
.acct-chart-title { font-size: 13px; color: var(--muted); margin: 14px 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.acct-chart { display: flex; align-items: flex-end; gap: 3px; height: 44px; }
/* A few days should not stretch to full width; cap each column. */
.acct-bar-wrap { flex: 0 1 28px; display: flex; align-items: flex-end; }
.acct-bar { width: 100%; background: var(--primary); border-radius: 2px 2px 0 0; min-height: 3px; }
.acct-history { font-size: 14px; }
.acct-hrow { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px solid var(--border); }

/* P7: low-hours notice above the app. */
#lowhours { background: var(--warnbg); color: var(--warn);
  border-bottom: 1px solid var(--border); padding: 8px 16px; font-size: 14px;
  display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
#lowhours.out { background: var(--errorbg); color: var(--error); }
#lowhours .link { background: none; border: 0; color: inherit; font: inherit;
  text-decoration: underline; cursor: pointer; padding: 0; }

/* --- audience (N9) -------------------------------------------------------- */
.aud-sheet {
  max-width: 440px; overflow-y: auto;
  padding-inline: 18px; box-sizing: border-box;
  padding-bottom: max(calc(14px + env(safe-area-inset-bottom)), 64px);
}
.aud-qr { display: flex; justify-content: center; margin: 8px 0; }
.aud-qr svg { width: min(60vw, 260px); height: auto; background: #fff; border-radius: 12px; padding: 6px; }
.aud-join-card {
  text-align: center; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px; margin: 10px 0 14px;
}
.aud-join-instruction {
  margin: 0; font-size: 17px; line-height: 1.35; color: var(--text);
}
.aud-join-url {
  display: block; margin: 3px 0 8px; font-size: clamp(21px, 6vw, 27px);
  line-height: 1.2; font-weight: 800; color: var(--primary); overflow-wrap: anywhere;
}
.aud-code {
  text-align: center; font-size: clamp(38px, 12vw, 48px); font-weight: 800;
  letter-spacing: .12em; margin: 2px 0 0; font-variant-numeric: tabular-nums;
}
.aud-share-actions { justify-content: center; }
.aud-print { display: none; }

/* One hub-owned audience floor, rendered from the same revision in the
 * sticky live view and the audience sheet. Text accompanies every colour;
 * controls stay 48px and wrap instead of shrinking at large text/320px. */
.presenter-floor-panel {
  margin-top: 8px; padding: 10px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface2); min-width: 0;
}
.live-floor-panel { max-height: min(45dvh, 390px); overflow-y: auto; }
.sheet-floor-panel { margin: 8px 0 12px; flex: none; }
.presenter-floor-heading {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.presenter-floor-active {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px; padding: 10px; border-radius: 10px;
  background: var(--surface); border: 2px solid var(--error);
}
.presenter-floor-person {
  display: flex; flex-direction: column; min-width: 0;
  overflow-wrap: anywhere;
}
.presenter-floor-controls {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; flex-wrap: wrap;
}
.floor-control, .floor-headphones {
  min-height: 48px; min-width: 48px; padding: 9px 13px;
  white-space: normal; overflow-wrap: anywhere;
}
.floor-control.primary { background: var(--primary); color: var(--primary-contrast); }
.floor-control.danger { background: var(--error); color: var(--surface); border-color: var(--error); }
.floor-headphones {
  grid-column: 1 / -1; justify-self: stretch; text-align: start;
  background: transparent; color: var(--text); border-color: var(--border);
}
.floor-headphones[aria-pressed="true"] {
  border-color: var(--primary); color: var(--primary);
}
.floor-headphones-hint { grid-column: 1 / -1; font-size: 13px; line-height: 1.35; }
.floor-elapsed { font-variant-numeric: tabular-nums; font-weight: 700; }
.presenter-floor-queue { display: grid; gap: 8px; margin-top: 10px; }
.presenter-floor-hand {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 10px; padding-top: 8px;
  border-top: 1px solid var(--border);
}
.floor-language-warning {
  color: var(--error); font-size: 13px; line-height: 1.35;
}
.presenter-floor-empty { margin: 4px 0 0; }
@media (max-width: 420px) {
  .presenter-floor-active, .presenter-floor-hand { grid-template-columns: 1fr; }
  .presenter-floor-controls { justify-content: stretch; }
  .presenter-floor-controls .floor-control,
  .presenter-floor-hand .floor-control { width: 100%; }
}
@media print {
  body > *:not(.aud-print) { display: none !important; }
  .aud-print { display: block; text-align: center; padding-top: 8vh; }
  .aud-print-title { font-size: 34pt; font-weight: 700; margin-bottom: 24pt; }
  .aud-print-qr svg { width: 110mm; height: 110mm; }
  .aud-print-code { font-size: 44pt; font-weight: 700; letter-spacing: .14em; margin-top: 18pt; }
  .aud-print-url { font-size: 22pt; font-weight: 700; margin-top: 6pt; color: #222; }
  .aud-print-choose { font-size: 12pt; margin-top: 28pt; color: #444; }
}

/* Jump back to the live tail (double chevron) while scrolled up. */
.live-jump {
  position: fixed; right: 16px;
  bottom: max(calc(16px + env(safe-area-inset-bottom)), 72px); z-index: 30;
  width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: var(--accent, #7A2BF0); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.28);
}
.live-jump:active { transform: scale(.94); }

/* Documents: two compact input paths above a metadata-only list. Extracted
 * text gets its own scroll surface so a large result cannot widen the page. */
.document-entry-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px; align-items: start;
}
.document-entry-grid .card { margin: 0; min-width: 0; }
.document-form input[type="file"] { width: 100%; min-width: 0; }
.document-check { display: flex; gap: 9px; align-items: flex-start; }
.document-check input { flex: 0 0 auto; width: 20px; height: 20px; }
.document-help { margin: -4px 0 2px; }
.document-progress { width: 100%; min-height: 12px; margin-top: 14px; }
.document-live-status { min-height: 1.35em; overflow-wrap: anywhere; }
.document-list { display: flex; flex-direction: column; gap: 10px; }
.document-row {
  display: flex; gap: 14px; align-items: center; justify-content: space-between;
  margin: 0; min-width: 0;
}
.document-row-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.document-row-copy strong, .document-row-copy span { overflow-wrap: anywhere; }
.document-row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.document-warning { color: var(--warn); }
.document-empty { margin: 0; text-align: center; color: var(--muted); }
.document-viewer { margin-top: 18px; }
.document-viewer h2 { margin: 0; overflow-wrap: anywhere; }
.document-text {
  box-sizing: border-box; width: 100%; max-height: min(62vh, 680px);
  overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  padding: 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface2); color: var(--text); font: inherit;
  unicode-bidi: plaintext;
}
.document-term-review { margin-top: 18px; min-width: 0; }
.document-term-review h2 { margin: 0; }
.document-term-live { min-height: 1.35em; overflow-wrap: anywhere; }
.term-candidate-list { display: flex; flex-direction: column; gap: 10px; }
.term-candidate {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px; padding: 12px; min-width: 0;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface2);
}
.term-candidate:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.term-candidate-copy { min-width: 0; }
.term-candidate-copy h3 { margin: 0 0 5px; overflow-wrap: anywhere; }
.term-candidate-copy p { margin: 5px 0; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.term-candidate-snippet {
  margin: 8px 0; padding-inline-start: 10px;
  border-inline-start: 3px solid var(--border); overflow-wrap: anywhere;
  unicode-bidi: plaintext;
}
.term-candidate-actions {
  display: flex; align-items: flex-start; align-content: flex-start;
  justify-content: flex-end; gap: 7px; flex-wrap: wrap; max-width: 320px;
}

@media (max-width: 680px) {
  .document-entry-grid { grid-template-columns: minmax(0, 1fr); }
  .document-row { align-items: stretch; flex-direction: column; }
  .document-row-actions { justify-content: flex-start; }
  .document-row-actions button { min-height: 44px; }
  .term-candidate { grid-template-columns: minmax(0, 1fr); }
  .term-candidate-actions { justify-content: flex-start; max-width: none; }
  .term-candidate-actions button { min-height: 44px; }
}

@media (max-width: 380px) {
  .document-heading { align-items: flex-start; }
  .document-heading h1 { font-size: clamp(25px, 9vw, 32px); }
  .document-entry-grid .card, .document-row, .document-viewer,
  .document-term-review {
    padding-inline: 12px;
  }
}
