:root {
  color-scheme: light;
  --canvas: #f5f5f8;
  --surface: #ffffff;
  --surface-soft: #f4f8fc;
  --surface-strong: #e9f0f7;
  --ink: #393939;
  --ink-soft: #5a5b5c;
  --muted: #8c8c8a;
  --line: #e6e6e6;
  --line-strong: #d1d0ce;
  --brand: #2f6ea3;
  --brand-strong: #185cb1;
  --brand-light: #5292c6;
  --brand-soft: #dbefff;
  --record: #c41a26;
  --record-soft: #fdeced;
  --danger: #c41a26;
  --warning: #f17d00;
  --warning-soft: #fdf0e2;
  --warning-text: #7c4400;
  --success: #22a855;
  --success-soft: #e9f6ef;
  --success-text: #157a3f;
  --gradient-header: linear-gradient(135deg, #185cb1 0%, #2f6ea3 30%, #4184bb 60%, #5292c6 100%);
  --gradient-accent: linear-gradient(135deg, #2f6ea3, #5292c6);
  --shadow: 0 8px 32px rgb(0 0 0 / 10%);
  --shadow-small: 0 0 6px #d8d8d8;
  --shadow-hover: 0 0 6px 4px #d8d8d8;
  --radius-large: 10px;
  --radius-medium: 8px;
  --radius-small: 5px;
  --sidebar-width: 286px;
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.6;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: 0.02em;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgb(82 146 198 / 50%);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-small);
  background: var(--brand-strong);
  color: #fff;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 18px 18px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius-large);
  background: var(--gradient-accent);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.button,
.icon-button,
.text-button,
.status-chip,
.source-tab,
.tab,
.readiness-summary {
  border: 0;
  background: none;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-weight: 700;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button svg,
.icon-button svg,
.text-button svg,
.tab svg,
.status-chip svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  transition: transform 150ms ease;
}

.button:hover:not(:disabled) svg,
.icon-button:hover:not(:disabled) svg {
  transform: scale(1.1);
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--brand);
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  background: var(--brand-strong);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--brand-light);
  background: var(--surface-soft);
  color: var(--brand);
}

.button-record {
  background: var(--record);
  color: #fff;
}

.button-record:hover:not(:disabled) {
  background: #a01620;
}

.button-stop,
.button-danger {
  background: var(--danger);
  color: #fff;
}

.button-danger-quiet {
  border-color: #f2c9cc;
  background: #fff8f8;
  color: var(--danger);
}

.button-block {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  transition: border-color 150ms ease, color 150ms ease;
}

.icon-button:hover:not(:disabled) {
  border-color: var(--brand-light);
  color: var(--brand);
}

.text-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 5px;
  padding: 5px 2px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.text-button:hover:not(:disabled) {
  color: var(--brand-strong);
}

.search-field {
  position: relative;
  display: block;
  margin: 14px 0 20px;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.search-field input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search-field input {
  min-height: 42px;
  padding: 9px 12px 9px 34px;
  background: var(--surface-soft);
}

.search-field input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(82 146 198 / 15%);
  outline: none;
}

.meeting-navigation {
  min-height: 0;
  flex: 1;
  overflow: auto;
  scrollbar-width: thin;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact-heading {
  padding: 0 6px 8px;
}

.section-heading h2,
.compact-heading h2 {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.count-badge,
.tab-count {
  display: inline-grid;
  min-width: 22px;
  min-height: 20px;
  place-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.meeting-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.meeting-list-button {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-medium);
  background: transparent;
  text-align: left;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.meeting-list-button:hover {
  background: var(--surface-soft);
}

.meeting-list-button.is-active {
  border-color: #b7d9f2;
  background: var(--brand-soft);
}

.meeting-list-title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meeting-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.meeting-list-status {
  overflow: hidden;
  max-width: 88px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-message {
  margin: 4px 6px;
  padding: 14px 10px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar-footer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.readiness-summary {
  display: grid;
  width: 100%;
  min-height: 54px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 6px;
  border-radius: var(--radius-medium);
  text-align: left;
  transition: background-color 150ms ease;
}

.readiness-summary:hover {
  background: var(--surface-soft);
}

.readiness-summary strong,
.readiness-summary small {
  display: block;
}

.readiness-summary strong {
  font-size: 12px;
}

.readiness-summary small,
.readiness-summary > span:last-child {
  color: var(--muted);
  font-size: 10px;
}

.local-note {
  margin: 8px 6px 0;
  color: var(--muted);
  font-size: 10px;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgb(140 140 138 / 12%);
}

.status-dot.status-ready {
  background: var(--success);
  box-shadow: 0 0 0 4px rgb(34 168 85 / 14%);
}

.status-dot.status-warning {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgb(241 125 0 / 14%);
}

.status-dot.status-error {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgb(196 26 38 / 12%);
}

.status-dot.status-checking {
  animation: checking-pulse 1.3s ease-in-out infinite;
}

.status-dot.status-muted {
  background: var(--muted);
}

.main-content {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid rgb(230 230 230 / 85%);
  background: rgb(245 245 248 / 90%);
  backdrop-filter: blur(16px);
}

.topbar-context {
  display: grid;
  gap: 1px;
  margin-right: auto;
}

.topbar-kicker {
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.topbar-context strong {
  max-width: min(55vw, 580px);
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-chip {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color 150ms ease, color 150ms ease;
}

.status-chip:hover {
  border-color: var(--brand-light);
  color: var(--brand);
}

.token-chip.has-token {
  border-color: #b7d9f2;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.view {
  width: min(100%, 1450px);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 58px) clamp(18px, 4vw, 52px) 72px;
}

.hero-copy {
  position: relative;
  overflow: hidden;
  max-width: 860px;
  margin: 0 auto clamp(18px, 3vw, 28px);
  padding: 20px 26px;
  border-radius: var(--radius-large);
  background: var(--gradient-header);
  color: #fff;
  box-shadow: var(--shadow-small);
}

.hero-copy::after {
  position: absolute;
  top: -110px;
  right: -50px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 255 255 / 15%) 0%, transparent 70%);
  content: "";
  pointer-events: none;
}

.eyebrow,
.step-label {
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin-bottom: 4px;
  font-size: 22px;
  line-height: 1.3;
}

.meeting-header h1 {
  margin-bottom: 12px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.16;
}

.hero-copy > p:last-child {
  margin-bottom: 0;
  color: rgb(255 255 255 / 86%);
  font-size: 13px;
}

.new-meeting-layout {
  display: grid;
  max-width: 860px;
  margin: 0 auto;
  gap: 16px;
}

.optional-mark {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
}

.local-footnote {
  margin: 16px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.card,
.audio-card,
.recording-card,
.error-card,
.results-workspace {
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.create-card {
  padding: clamp(20px, 3vw, 30px);
}

.card-heading,
.structured-heading,
.meeting-header,
.editor-toolbar,
.read-toolbar,
.dialog-header,
.dialog-actions,
.progress-copy,
.audio-card,
.recording-card,
.error-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.card-heading {
  margin-bottom: 24px;
}

.card-heading h2,
.audio-card h2,
.recording-card h2,
.dialog h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.card-heading h2,
.audio-card h2,
.dialog h2 {
  color: var(--brand);
}

.local-badge,
.status-badge,
.save-state {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.local-badge,
.save-state {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 17px;
}

.field > span {
  font-size: 13px;
  font-weight: 700;
}

.field small {
  color: var(--muted);
  font-size: 11px;
}

.field input,
.field select {
  min-height: 44px;
  padding: 9px 12px;
}

.field select[multiple] {
  min-height: 116px;
  padding: 6px;
}

.field select[multiple] option {
  padding: 7px 8px;
  border-radius: 4px;
}

.field textarea {
  min-height: 96px;
  padding: 11px 12px;
  line-height: 1.65;
  resize: vertical;
}

.source-fieldset {
  min-width: 0;
  margin: 10px 0 20px;
  padding: 0;
  border: 0;
}

.source-fieldset > legend {
  margin-bottom: 10px;
}

.source-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 13px;
}

.source-tab {
  display: grid;
  min-height: 72px;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 13px;
  row-gap: 3px;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-medium);
  background: var(--surface-soft);
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.source-tab:hover {
  border-color: var(--brand-light);
}

.source-tab-icon {
  display: grid;
  width: 38px;
  height: 38px;
  grid-row: 1 / span 2;
  place-items: center;
  align-self: center;
  border-radius: var(--radius-medium);
  background: var(--brand-soft);
  color: var(--brand);
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.source-tab-icon svg {
  width: 18px;
  height: 18px;
}

.source-tab:hover .source-tab-icon {
  transform: scale(1.06);
}

.source-tab strong {
  grid-column: 2;
  font-size: 14px;
}

.source-tab span {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}

.source-tab.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.source-tab.is-active .source-tab-icon {
  background: var(--gradient-accent);
  color: #fff;
}

.source-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--surface-soft);
}

.dropzone {
  position: relative;
  display: grid;
  min-height: 146px;
  place-items: center;
  align-content: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 22px;
  border: 1.5px dashed #a9c4da;
  border-radius: var(--radius-medium);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.dropzone:focus-within {
  outline: 3px solid rgb(82 146 198 / 50%);
  outline-offset: 3px;
}

.dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-title {
  font-size: 15px;
  font-weight: 700;
}

.dropzone-detail {
  color: var(--muted);
  font-size: 11px;
}

.selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid #b7d9f2;
  border-radius: var(--radius-medium);
  background: var(--brand-soft);
}

.selected-file strong,
.selected-file span {
  display: block;
}

.selected-file strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.selected-file span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 11px;
}

.live-intro {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 144px;
  padding: 16px;
  border-radius: var(--radius-medium);
  background: var(--surface);
}

.live-intro p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.live-orb {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: 12px solid var(--record-soft);
  border-radius: 50%;
  background: var(--record);
}

.switch-row {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0 4px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--surface-soft);
  cursor: pointer;
}

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row strong {
  font-size: 13px;
}

.switch-row small {
  max-width: 580px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.switch-row input {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  margin: 0;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: #b6bcc4;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.switch-row input::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgb(0 0 0 / 20%);
  content: "";
  transition: transform 150ms ease;
}

.switch-row input:checked {
  background: var(--brand);
}

.switch-row input:checked::after {
  transform: translateX(20px);
}

.advanced-settings {
  margin-top: 12px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
}

.advanced-settings summary {
  min-height: 48px;
  padding: 13px 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.advanced-settings[open] summary {
  margin-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.form-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-small);
  background: var(--record-soft);
  color: #8f1219;
  font-size: 12px;
}


.readiness-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.readiness-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 9px 2px;
  border-top: 1px solid var(--line);
}

.readiness-list li:first-child {
  border-top: 0;
}

.readiness-list strong,
.readiness-list small {
  display: block;
}

.readiness-list strong {
  font-size: 13px;
}

.readiness-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.meeting-view {
  display: grid;
  gap: 20px;
}

.meeting-header {
  align-items: flex-end;
  margin-bottom: 8px;
}

.meeting-header h1 {
  margin: 8px 0 8px;
  font-size: clamp(27px, 3vw, 40px);
}

.meeting-header p {
  margin: 0;
  color: var(--muted);
}

.meeting-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  background: var(--warning-soft);
  color: var(--warning-text);
}

.status-badge.status-completed {
  background: var(--success-soft);
  color: var(--success-text);
}

.status-badge.status-failed {
  background: var(--record-soft);
  color: var(--danger);
}

.status-badge.status-recording {
  background: var(--record-soft);
  color: var(--record);
}

.muted-text {
  color: var(--muted);
  font-size: 12px;
}

.meeting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.recovery-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.recording-card,
.error-card,
.audio-card {
  padding: 20px 22px;
}

.recording-card {
  align-items: center;
  border-color: #f0c3c6;
  background: #fffafa;
}

.recording-state {
  display: flex;
  align-items: center;
  gap: 14px;
}

.recording-state p,
.recording-card h2 {
  margin: 0;
}

.recording-state p {
  color: var(--muted);
  font-size: 12px;
}

.recording-dot {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--record);
  box-shadow: 0 0 0 7px rgb(196 26 38 / 12%);
  animation: recording-pulse 1.4s ease-in-out infinite;
}

.recording-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.recording-meter {
  position: relative;
  width: 84px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #f6d7d9;
}

.recording-meter span {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: var(--record);
  transition: width 80ms linear;
}

.recording-controls time {
  min-width: 55px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.live-transcript {
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
  padding: 11px 13px;
  border-radius: var(--radius-medium);
  background: #fff;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
  overscroll-behavior: contain;
}

.recording-card:has(.live-transcript) {
  flex-wrap: wrap;
}

.progress-card {
  padding: 24px;
}

.progress-copy {
  align-items: flex-end;
}

.progress-copy h2 {
  margin: 0 0 5px;
  font-size: 20px;
}

.progress-copy p:not(.step-label) {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.progress-copy > strong {
  color: var(--brand);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  margin: 20px 0 15px;
  border-radius: 999px;
  background: var(--surface-strong);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient-accent);
  transition: width 260ms ease;
}

.progress-steps {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-steps li {
  padding-top: 8px;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.progress-steps li.is-complete,
.progress-steps li.is-current {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.progress-steps li.is-current {
  font-weight: 700;
}

.error-card {
  border-color: #f0c3c6;
  background: #fffafa;
}

.error-card strong {
  color: var(--danger);
}

.error-card p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.upload-recovery-card {
  border-color: #f3d3a2;
  background: #fff8ef;
}

.upload-recovery-card strong {
  color: var(--warning-text);
}

.audio-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.3fr) minmax(250px, 1fr);
}

.audio-card audio {
  width: 100%;
  min-height: 44px;
}

.results-workspace {
  overflow: hidden;
}

.results-topline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 18px;
  border-bottom: 1px solid var(--line);
}

.results-topline .tabs {
  min-width: 0;
  flex: 1;
  border-bottom: 0;
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.tab {
  position: relative;
  display: inline-flex;
  min-height: 48px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 10px 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: color 150ms ease;
}

.tab:hover {
  color: var(--brand);
}

.tab::after {
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 3px;
  background: transparent;
  content: "";
}

.tab.is-active {
  color: var(--brand-strong);
}

.tab.is-active::after {
  background: var(--brand);
}

.tab.is-active .tab-count {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.tab-panel {
  padding: clamp(18px, 3vw, 28px);
}

.editor-form {
  display: grid;
  gap: 20px;
}

.read-toolbar {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.read-toolbar p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.read-toolbar > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.read-view {
  display: grid;
  gap: 22px;
}

.doc-header {
  display: grid;
  gap: 4px;
}

.doc-header strong {
  color: var(--ink);
  font-size: 18px;
}

.doc-header span {
  color: var(--ink-soft);
  font-size: 13px;
}

.doc-summary {
  margin: 0;
  padding: 14px 16px;
  border-left: 3px solid var(--brand-light);
  border-radius: 0 var(--radius-medium) var(--radius-medium) 0;
  background: var(--surface-soft);
  font-size: 14px;
  line-height: 1.8;
}

.doc-section h4 {
  display: inline-block;
  margin: 0 0 10px;
  padding-bottom: 4px;
  border-bottom: 3px solid var(--brand-light);
  color: var(--brand);
  font-size: 15px;
}

.doc-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-list li {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--surface-soft);
  font-size: 14px;
  line-height: 1.75;
}

.doc-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.convo-list {
  display: grid;
}

.convo-row {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 6px 14px;
  padding: 12px 2px;
  border-top: 1px solid var(--line);
}

.convo-row:first-child {
  border-top: 0;
  padding-top: 2px;
}

.convo-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.convo-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
}

.speaker-chip {
  display: inline-flex;
  max-width: 100%;
  overflow: hidden;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speaker-chip.spk-0 { background: #dbefff; color: #185cb1; }
.speaker-chip.spk-1 { background: #e2f5ea; color: #156b3f; }
.speaker-chip.spk-2 { background: #fdeedd; color: #93500a; }
.speaker-chip.spk-3 { background: #ece5f8; color: #5b3fa3; }
.speaker-chip.spk-4 { background: #ddf3f6; color: #0c6c7e; }
.speaker-chip.spk-5 { background: #fbe8e6; color: #9c3a2a; }

.action-read-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-medium);
  background: var(--surface-soft);
  font-size: 14px;
  line-height: 1.75;
}

.action-read-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: var(--muted);
  font-size: 12px;
}

.empty-cta {
  display: grid;
  gap: 12px;
  justify-items: center;
  margin: 0;
  padding: 38px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-medium);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.contract-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid #f3d3a2;
  border-radius: var(--radius-medium);
  background: #fff8ef;
}

.contract-notice strong {
  color: var(--warning-text);
}

.contract-notice p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.editor-toolbar {
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.editor-toolbar p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.template-meta {
  color: var(--ink-soft);
  font-weight: 700;
  white-space: nowrap;
}

.editor-toolbar > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.structured-sections {
  display: grid;
  gap: 24px;
}

.structured-section,
.speaker-editor {
  padding-top: 4px;
}

.structured-heading {
  align-items: flex-end;
  margin-bottom: 12px;
}

.structured-heading h3 {
  margin: 0 0 2px;
  padding-bottom: 4px;
  border-bottom: 3px solid var(--brand-light);
  color: var(--brand);
  font-size: 15px;
}

.structured-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.structured-list,
.action-item-list {
  display: grid;
  gap: 10px;
}

.structured-item,
.action-item {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--surface-soft);
}

.structured-item-fields,
.action-item-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.structured-item-fields .field,
.action-item-fields .field {
  margin: 0;
}

.structured-item-fields .field.is-wide,
.action-item-fields .field.is-wide {
  grid-column: 1 / -1;
}

.structured-item textarea,
.action-item textarea {
  min-height: 72px;
}

.remove-item-button {
  position: absolute;
  top: 8px;
  right: 10px;
  min-height: 36px;
  padding: 5px 6px;
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
}

.evidence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.evidence-label {
  align-self: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.evidence-button,
.time-button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #b7d9f2;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 700;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.evidence-button:hover,
.time-button:hover {
  border-color: var(--brand);
  background: #cbe6fd;
}

.speaker-name-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.speaker-name-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--surface-soft);
}

.speaker-alias {
  min-width: 76px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
}

.speaker-name-row input {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.utterance-list {
  display: grid;
  gap: 9px;
}

.utterance-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 13px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--surface-soft);
}

.utterance-meta {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  flex-direction: column;
}

.utterance-speaker {
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.utterance-row textarea {
  width: 100%;
  min-height: 72px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
  line-height: 1.6;
  resize: vertical;
}

.empty-panel {
  margin: 0;
  padding: 34px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-medium);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.file-card {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  transition: border-color 250ms ease, box-shadow 250ms ease, transform 250ms ease;
}

.file-card:hover {
  border-color: var(--brand-light);
  background: var(--surface);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.file-card strong,
.file-card small {
  display: block;
}

.file-card strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.file-card small,
.file-card > span:last-child {
  color: var(--muted);
  font-size: 10px;
}

.save-state.is-dirty {
  background: var(--warning-soft);
  color: var(--warning-text);
}

.save-state.is-saving {
  background: var(--surface-strong);
  color: var(--muted);
}

.dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  padding: 24px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgb(15 23 42 / 42%);
  backdrop-filter: blur(3px);
}

.dialog-small {
  width: min(480px, calc(100vw - 28px));
}

.dialog-header {
  align-items: flex-start;
  margin-bottom: 16px;
}

.dialog-summary {
  color: var(--ink-soft);
  font-size: 13px;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.dialog-actions.split-actions {
  justify-content: space-between;
}

.dialog-actions.split-actions > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.privacy-detail {
  margin-top: 14px;
  padding: 13px;
  border-radius: var(--radius-medium);
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 12px;
}

.toast-region {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(360px, calc(100vw - 32px));
  gap: 9px;
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 0;
  border-radius: var(--radius-medium);
  background: var(--brand-strong);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 12px;
}

.toast.toast-error {
  background: #9d1520;
}

.mobile-only,
.sidebar-backdrop {
  display: none;
}

.convo-row.is-flash,
.utterance-row.is-flash {
  animation: row-flash 1.6s ease;
}

@keyframes row-flash {
  0%, 45% { background-color: var(--brand-soft); }
}

@keyframes checking-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@keyframes recording-pulse {
  0%, 100% { box-shadow: 0 0 0 5px rgb(196 26 38 / 10%); }
  50% { box-shadow: 0 0 0 9px rgb(196 26 38 / 17%); }
}

@media (max-width: 1100px) {
  .audio-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  body.sidebar-open {
    overflow: hidden;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(var(--sidebar-width), calc(100vw - 42px));
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 40;
    inset: 0;
    display: block;
    background: rgb(15 23 42 / 45%);
  }

  .mobile-only {
    display: inline-grid;
    place-items: center;
  }

  .brand-row .brand {
    order: -1;
  }

  .topbar {
    min-height: 62px;
    padding: 9px 16px;
  }

  .topbar-kicker {
    display: none;
  }

  .status-chip {
    min-height: 40px;
    padding: 8px 10px;
  }

  .view {
    padding: 28px 16px 56px;
  }

  .hero-copy {
    margin-bottom: 20px;
    padding: 18px 18px;
  }

  .meeting-header,
  .recording-card,
  .error-card,
  .editor-toolbar,
  .read-toolbar,
  .contract-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .meeting-actions,
  .meeting-actions .button,
  .recovery-actions,
  .recovery-actions .button,
  .recording-controls,
  .editor-toolbar > div,
  .editor-toolbar .button,
  .read-toolbar > div,
  .read-toolbar .button {
    width: 100%;
  }

  .dialog-actions.split-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-actions.split-actions > div,
  .dialog-actions.split-actions .button {
    width: 100%;
  }

  .recording-controls {
    display: grid;
    grid-template-columns: minmax(70px, 1fr) auto;
  }

  .recording-controls .button {
    grid-column: 1 / -1;
  }

  .recording-meter {
    width: 100%;
  }

  .tabs {
    padding: 0 9px;
  }

  .results-topline {
    padding-right: 10px;
  }

  .tab-panel {
    padding: 18px;
  }

  .utterance-row {
    grid-template-columns: 1fr;
  }

  .utterance-meta {
    align-items: center;
    flex-direction: row;
  }

  .toast-region {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 560px) {
  .form-grid.two-columns,
  .source-tabs,
  .structured-item-fields,
  .action-item-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .source-tab {
    min-height: 64px;
  }

  .card-heading,
  .structured-heading,
  .progress-copy {
    align-items: flex-start;
  }

  .convo-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .convo-meta {
    flex-direction: row;
    align-items: center;
  }

  .card-heading,
  .structured-heading,
  .progress-copy {
    flex-direction: column;
  }

  .structured-heading .text-button {
    align-self: stretch;
    text-align: left;
  }

  .progress-steps {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-steps li:last-child {
    grid-column: 1 / -1;
  }

  .switch-row {
    align-items: flex-start;
  }

  .dialog {
    padding: 20px;
  }
}

@media (max-width: 360px) {
  #topbar-readiness-text,
  #api-token-status {
    display: none;
  }

  .status-chip {
    padding-inline: 12px;
  }

  .create-card,
  .progress-card,
  .audio-card,
  .recording-card,
  .error-card {
    padding: 17px;
  }

  .view,
  .topbar {
    padding-right: 12px;
    padding-left: 12px;
  }

  .tab-panel {
    padding: 15px;
  }
}

@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;
  }
}
