:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #6b7280;
  --soft: #9ca3af;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --panel: #ffffff;
  --wash: #f9fafb;
  --app-bg: #ffffff;
  --control-bg: #f9fafb;
  --transcript-bg: #ffffff;
  --blue: #26338b;
  --red: #e1262f;
  --teal: #047857;
  --amber: #b45309;
  --green: #15803d;
  --shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
}

body[data-theme="soft"] {
  --ink: #17202a;
  --muted: #667085;
  --soft: #98a2b3;
  --line: #e7e3da;
  --line-strong: #d8d1c4;
  --panel: #fffdf8;
  --wash: #f6f3ec;
  --app-bg: #f8f5ee;
  --control-bg: #f3f0e8;
  --transcript-bg: #fffdf8;
  --blue: #243b76;
  --red: #b42318;
  --teal: #047857;
  --shadow: 0 12px 28px rgba(72, 58, 38, 0.09);
}

body[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e5e7eb;
  --muted: #9ca3af;
  --soft: #6b7280;
  --line: #273142;
  --line-strong: #384456;
  --panel: #111827;
  --wash: #0b1220;
  --app-bg: #080d18;
  --control-bg: #151f2e;
  --transcript-bg: #0f172a;
  --blue: #9db2ff;
  --red: #fb7185;
  --teal: #2dd4bf;
  --amber: #fbbf24;
  --green: #86efac;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--app-bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    opacity 120ms ease;
}

button:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: var(--line-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  outline: none;
}

input:focus,
select:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(38, 51, 139, 0.1);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.1;
}

h2 {
  font-size: 24px;
  line-height: 1.15;
}

h3 {
  font-size: 14px;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: 34px 1fr;
  background: var(--app-bg);
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  z-index: 20;
}

.topbar::before {
  display: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.local-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
  flex: 0 0 auto;
}

#serverSubtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 46vw;
  justify-content: flex-end;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-bg);
}

.theme-switch button {
  min-height: 28px;
  border: 0;
  border-radius: 0;
  padding: 0 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.theme-switch button.active {
  background: var(--ink);
  color: var(--panel);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--control-bg);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: var(--green);
}

.status-pill.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: var(--amber);
}

.status-pill.bad {
  background: #fff1f2;
  border-color: #fecdd3;
  color: var(--red);
}

.main-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

.side-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 12px 12px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.side-brand {
  display: grid;
  gap: 8px;
  place-items: start;
  padding: 2px 8px 14px;
}

.side-brand img {
  width: 188px;
  height: 52px;
  object-fit: contain;
}

.side-title {
  display: grid;
  gap: 3px;
}

.side-title strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.1;
}

.side-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.runtime-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin: 0 0 2px;
  padding: 12px;
}

.runtime-card strong {
  display: block;
  font-size: 14px;
}

.runtime-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.runtime-card .eyebrow {
  color: var(--soft);
  display: block;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.runtime-privacy {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  margin-top: 8px;
  min-height: 24px;
  padding: 0 8px;
  width: fit-content;
}

.runtime-dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  max-width: 560px;
  padding: 0;
  width: min(92vw, 560px);
}

.runtime-dialog::backdrop {
  background: rgba(12, 20, 28, 0.28);
}

.runtime-dialog form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.runtime-dialog h2,
.runtime-dialog p {
  margin: 0;
}

.runtime-dialog p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.runtime-options {
  display: grid;
  gap: 10px;
}

.runtime-options button {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: left;
}

.runtime-options button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
}

.runtime-options button.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.tabs {
  display: grid;
  gap: 6px;
}

.tab-btn {
  width: 100%;
  min-height: 40px;
  justify-content: flex-start;
  text-align: left;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.tab-btn.active {
  background: var(--control-bg);
  border-color: var(--control-bg);
  color: var(--ink);
}

.settings-drawer,
.more-tools {
  min-width: 0;
}

.settings-drawer {
  margin-top: auto;
  border-top: 1px solid #f0f0f0;
  padding-top: 10px;
}

.settings-drawer[open] {
  padding-bottom: 16px;
}

.settings-drawer summary,
.more-tools summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.settings-drawer summary {
  padding: 0 8px;
}

.settings-drawer summary:hover,
.more-tools summary:hover {
  background: #f9fafb;
}

.settings-panel {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 0;
}

.settings-panel h2 {
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
  color: #6b7280;
}

.quiet-btn {
  border-color: var(--line);
  background: #f9fafb;
  color: #374151;
}

.setup-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.gemini-actions {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
}

.key-actions {
  grid-template-columns: 1fr 88px;
  margin-top: -2px;
}

.settings-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.gemini-status.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #047857;
}

.gemini-status.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.gemini-status.bad {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.workspace {
  min-width: 0;
  min-height: 0;
  background: var(--transcript-bg);
  overflow: hidden;
}

.view {
  display: none;
  height: 100%;
  min-height: 0;
}

.view.active {
  display: grid;
  grid-template-rows: auto 1fr;
}

.tool-header {
  min-height: 74px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.tool-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.timer,
.room-badge {
  min-height: 38px;
  min-width: 126px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.record-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  background: var(--transcript-bg);
}

.meeting-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.95fr);
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--transcript-bg);
}

.control-surface,
.transcript-shell,
.session-list {
  background: var(--panel);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.control-surface {
  display: grid;
  align-content: start;
  gap: 15px;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.capture-toolbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) auto minmax(240px, 1fr);
  align-items: end;
  gap: 14px;
  padding: 12px 18px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}

.room-row,
.button-row,
.export-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.capture-fields label,
.room-row label {
  flex: 1 1 160px;
}

.capture-actions {
  justify-content: center;
}

.capture-actions button {
  min-width: 112px;
}

.capture-tools {
  justify-self: end;
  width: min(420px, 100%);
}

.capture-status {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 150px minmax(210px, 1fr);
  align-items: center;
  gap: 10px;
}

.title-input input {
  min-height: 44px;
  font-size: 16px;
  font-weight: 800;
}

.meter {
  width: 100%;
  height: 116px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--control-bg);
}

.mini-meter {
  height: 46px;
}

.primary-btn {
  border-color: #ef4444;
  background: #ef4444;
  color: #ffffff;
}

.primary-btn:hover:not(:disabled) {
  border-color: #dc2626;
  background: #dc2626;
}

.secondary-btn {
  background: var(--control-bg);
}

.danger-btn {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.compact button,
.export-row button,
.capture-actions button {
  min-height: 34px;
  font-size: 13px;
}

.more-tools {
  align-self: start;
}

.more-tools summary {
  justify-content: center;
  width: fit-content;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.more-tools[open] summary {
  margin-bottom: 8px;
  background: #f9fafb;
}

.secondary-tools {
  align-items: end;
  padding: 8px 0 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.compact-field {
  min-width: 126px;
  flex: 0 0 126px;
}

.compact-field select {
  min-height: 34px;
}

.live-line {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--control-bg);
  line-height: 1.4;
}

.status-stack {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.capture-mode {
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.transcript-shell {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.raw-transcript-shell {
  border-right: 1px solid var(--line);
}

.insight-shell {
  background: #ffffff;
}

.list-header {
  position: relative;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.list-header h3 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.list-header span {
  position: absolute;
  right: 18px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.insight-header {
  justify-content: center;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel-tab {
  min-height: 34px;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  color: #6b7280;
  font-size: 13px;
}

.panel-tab + .panel-tab {
  border-left: 1px solid var(--line);
}

.panel-tab.active {
  background: var(--control-bg);
  color: var(--blue);
}

.segment-list {
  min-height: 0;
  overflow: auto;
  padding: 22px 30px 96px;
}

.segment-list.empty::before {
  content: "Chưa có transcript.";
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
}

.live-feed,
.translation-feed {
  width: min(760px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.live-line-item,
.translation-line {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
}

.line-time {
  padding-top: 3px;
  color: #a1a1aa;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.line-text,
.translation-text {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #1f2937;
  line-height: 1.72;
}

.line-text {
  font-size: 18px;
  font-weight: 520;
}

.translation-text {
  font-size: 16px;
}

.live-line-item.is-live .line-text {
  color: #4b5563;
}

.live-line-item.is-live .line-text::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-radius: 999px;
  background: #ef4444;
  vertical-align: middle;
}

.line-speaker {
  display: block;
  margin-bottom: 3px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 760;
}

.translation-line.pending .translation-text {
  color: var(--muted);
}

.provider-chip {
  display: block;
  width: fit-content;
  min-height: 22px;
  margin-top: 8px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f9fafb;
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
}

.translation-warning {
  display: block;
  margin-top: 7px;
  color: #b45309;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.45;
}

.insight-tab-panel {
  display: none;
}

.insight-tab-panel.active {
  display: block;
}

.summary-panel.active {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.summary-actions {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}

.summary-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.meeting-summary {
  min-height: 0;
  overflow: auto;
  padding: 26px 34px 80px;
  color: #1f2937;
  line-height: 1.68;
}

.meeting-summary.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.summary-document {
  width: min(900px, 100%);
  margin: 0 auto;
}

.summary-document h3,
.summary-document h4,
.summary-document h5 {
  margin: 22px 0 10px;
  color: #111827;
  line-height: 1.25;
}

.summary-document h3 {
  font-size: 22px;
}

.summary-document h4 {
  font-size: 18px;
}

.summary-document h5 {
  font-size: 15px;
}

.summary-document p,
.summary-document li,
.summary-table {
  color: #374151;
}

.summary-document p {
  margin: 0 0 10px;
}

.summary-document ul {
  margin: 8px 0 14px;
  padding-left: 22px;
}

.summary-table-wrap {
  width: 100%;
  overflow: auto;
  margin: 12px 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.45;
}

.summary-table th,
.summary-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.summary-table th {
  background: var(--control-bg);
  font-weight: 850;
}

.summary-table tr:last-child td {
  border-bottom: 0;
}

.summary-block {
  width: min(820px, 100%);
  margin: 0 auto 22px;
}

.summary-block h4 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 18px;
}

.summary-block p,
.summary-block li {
  color: #374151;
}

.summary-block ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.segment-card {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 0;
  margin: 0;
  background: transparent;
}

.segment-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 9px;
}

.segment-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.segment-text {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #f9fafb;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.segment-text.translation {
  background: #fff7ed;
  border-left: 3px solid #f59e0b;
}

.segment-text small {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-weight: 800;
}

.history-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.import-workspace-btn {
  align-items: center;
  color: #374151;
  display: inline-flex;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  width: auto;
}

.history-tools {
  padding: 10px 18px 0;
}

.session-list {
  overflow: auto;
  padding: 12px;
  border-right: 1px solid var(--line);
}

.session-item {
  width: 100%;
  min-height: 70px;
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 10px;
  margin-bottom: 7px;
  border: 1px solid transparent;
  background: #ffffff;
}

.session-item.active {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.session-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.session-item small {
  color: var(--muted);
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(360px, calc(100vw - 32px));
  z-index: 50;
  display: grid;
  gap: 8px;
}

.toast {
  padding: 12px 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--ink);
  line-height: 1.35;
}

.toast.ok {
  border-color: #bbf7d0;
}

.toast.warn {
  border-color: #fde68a;
}

.toast.bad {
  border-color: #fecdd3;
}

.context-status {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--control-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

input[type="file"] {
  padding: 7px 8px;
}

.compact-feed {
  background: var(--transcript-bg);
}

.segment-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  background: transparent;
}

.segment-meta {
  display: block;
  margin: 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.4;
}

.segment-meta span {
  display: block;
}

.segment-meta span + span {
  display: none;
}

.segment-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  min-width: 0;
}

.segment-text {
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.66;
  overflow-wrap: anywhere;
}

.segment-text.translation {
  border-left: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

.segment-text small {
  display: none;
}

body[data-theme="dark"] button,
body[data-theme="dark"] input,
body[data-theme="dark"] select {
  border-color: var(--line);
  background: var(--control-bg);
  color: var(--ink);
}

body[data-theme="dark"] button:hover:not(:disabled) {
  background: #1f2937;
  border-color: var(--line-strong);
}

body[data-theme="dark"] .primary-btn {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

body[data-theme="dark"] .danger-btn {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.3);
  color: #fda4af;
}

body[data-theme="dark"] .line-text,
body[data-theme="dark"] .translation-text,
body[data-theme="dark"] .meeting-summary,
body[data-theme="dark"] .summary-document p,
body[data-theme="dark"] .summary-document li,
body[data-theme="dark"] .summary-document h3,
body[data-theme="dark"] .summary-document h4,
body[data-theme="dark"] .summary-document h5,
body[data-theme="dark"] .summary-table,
body[data-theme="dark"] .summary-block p,
body[data-theme="dark"] .summary-block li {
  color: var(--ink);
}

body[data-theme="dark"] .translation-text,
body[data-theme="dark"] .segment-text.translation {
  color: #cbd5e1;
}

body[data-theme="dark"] .translation-warning {
  color: #fbbf24;
}

body[data-theme="dark"] .provider-chip,
body[data-theme="dark"] .secondary-tools,
body[data-theme="dark"] .live-line,
body[data-theme="dark"] .context-status,
body[data-theme="dark"] .summary-table th {
  background: var(--control-bg);
}

body[data-theme="dark"] .gemini-status.ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(22, 101, 52, 0.18);
  color: #bbf7d0;
}

body[data-theme="dark"] .gemini-status.warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(120, 53, 15, 0.2);
  color: #fde68a;
}

body[data-theme="dark"] .gemini-status.bad {
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(136, 19, 55, 0.22);
  color: #fecdd3;
}

@media (max-width: 1180px) {
  .capture-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .capture-status {
    grid-template-columns: 1fr;
  }

  .mini-meter {
    height: 58px;
  }
}

@media (max-width: 1080px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
  }

  .topbar-actions {
    padding-right: 0;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tabs {
    grid-template-columns: repeat(3, 1fr);
  }

  .record-layout,
  .meeting-layout,
  .history-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .raw-transcript-shell {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 34px;
    align-items: stretch;
    justify-content: flex-end;
    padding: 4px 12px;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .theme-switch button {
    min-height: 26px;
    padding: 0 7px;
  }

  .tool-header {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row,
  .export-row,
  .capture-actions {
    width: 100%;
  }

  .button-row button,
  .export-row button,
  .capture-actions button {
    flex: 1 1 130px;
  }

  .tabs {
    grid-template-columns: 1fr;
  }

  .segment-body {
    grid-template-columns: 1fr;
  }

  .live-line-item,
  .translation-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .segment-list,
  .meeting-summary {
    padding-inline: 18px;
  }
}
