:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17201c;
  background: #f6f7f5;
  font-synthesis: none;
  line-height: 1.5;
  --ink: #17201c;
  --muted: #657069;
  --subtle: #eef1ee;
  --surface: #fff;
  --line: #dfe4df;
  --line-strong: #c7d0c9;
  --accent: #176a4b;
  --accent-strong: #105239;
  --accent-soft: #e9f4ee;
  --danger: #9a2929;
  --warning: #855a12;
  --radius-sm: 0.45rem;
  --radius-md: 0.75rem;
  --shadow-soft: 0 0.65rem 2rem rgb(21 45 34 / 7%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid #2b8664;
  outline-offset: 3px;
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
}

.app-brand,
.app-nav a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.app-header-actions,
.app-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-header > *,
.meeting-table td,
.workspace-heading {
  min-width: 0;
}

.current-user,
.meeting-table td,
.meeting-title-link,
.workspace-heading h1,
.source-delete-meeting,
.admin-dialog-target {
  overflow-wrap: anywhere;
}

.app-nav a[aria-current="page"] {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
  text-decoration: none;
}

.text-button,
.primary-button {
  min-height: 2.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.text-button {
  border: 1px solid var(--line-strong);
  color: #263d33;
  background: var(--surface);
}

.primary-button {
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
  font-weight: 650;
}

.text-button:hover:not(:disabled) {
  border-color: #9daba1;
  background: #f8faf8;
}

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

.danger-primary {
  border-color: var(--danger);
  background: var(--danger);
}

.danger-primary:hover:not(:disabled) {
  border-color: #741d1d;
  background: #741d1d;
}

.compact-button {
  min-height: 2.2rem;
  padding: 0.38rem 0.7rem;
  font-size: 0.86rem;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.page {
  width: min(74rem, 100%);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 3rem);
}

.centered-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1.5rem;
}

.message-panel {
  width: min(32rem, 100%);
  text-align: center;
}

.message-panel h1 {
  margin-bottom: 0.35rem;
}

.login-panel {
  width: min(26rem, 100%);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 1px solid #d8ded9;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 1rem 2.5rem rgb(31 56 45 / 8%);
}

.login-panel h1,
.page h1 {
  margin-top: 0;
}

.form-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-field input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #aebbb2;
  border-radius: 0.4rem;
  background: #fff;
}

.form-status {
  min-height: 1.5rem;
  margin-top: 1rem;
}

.error {
  color: #9b1c1c;
}

.muted,
.current-user {
  color: var(--muted);
}

.phase-placeholder {
  max-width: 48rem;
  padding: 1.25rem 0;
  border-top: 1px solid #d8ded9;
}

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

.dashboard-heading,
.section-heading,
.pagination,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-intro {
  margin-top: -0.65rem;
}

.upload-panel {
  margin: 1.5rem 0 2.25rem;
  padding: 1.1rem 1.25rem;
  border: 1px dashed #b9c8be;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f8fbf9, var(--accent-soft));
}

.upload-panel h2,
.google-connection-panel h2,
.section-heading h2 {
  margin: 0;
  font-size: 1.15rem;
}

.google-connection-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -1rem 0 2.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.google-connection-status {
  margin: 0.35rem 0 0;
}

.upload-form {
  display: flex;
  align-items: end;
  gap: 1rem;
  margin-top: 0.85rem;
}

.file-control,
.dashboard-controls label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 650;
}

.file-control {
  flex: 1;
}

.file-control input,
.dashboard-controls input,
.dashboard-controls select {
  min-height: 2.6rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
}

.dashboard-controls select {
  appearance: none;
  padding-right: 2.25rem;
  background-image:
    linear-gradient(45deg, transparent 50%, #526159 50%),
    linear-gradient(135deg, #526159 50%, transparent 50%);
  background-position: calc(100% - 0.95rem) 50%, calc(100% - 0.65rem) 50%;
  background-repeat: no-repeat;
  background-size: 0.32rem 0.32rem, 0.32rem 0.32rem;
}

.file-control input::file-selector-button {
  margin: -0.45rem 0.7rem -0.45rem -0.6rem;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-right: 1px solid var(--line);
  color: #263d33;
  background: var(--subtle);
  font-weight: 650;
  cursor: pointer;
}

.selected-file {
  min-height: 1.25rem;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-controls {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(10rem, auto) minmax(11rem, auto);
  gap: 0.8rem;
  margin: 1rem 0;
}

.list-status {
  min-height: 1.6rem;
  margin-bottom: 0.5rem;
}

.meeting-table-region {
  width: 100%;
  overflow-x: auto;
}

.meeting-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid #cbd4ce;
  border-bottom: 1px solid #cbd4ce;
  background: #fff;
  font-size: 0.92rem;
}

.meeting-table th,
.meeting-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid #e2e7e3;
  text-align: left;
  vertical-align: middle;
}

.meeting-table th {
  color: #526159;
  background: #f0f3f1;
  font-size: 0.78rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.meeting-table tbody tr:last-child td {
  border-bottom: 0;
}

.meeting-table tbody tr:hover {
  background: #fafcfb;
}

.meeting-title-link {
  display: inline-block;
  color: #173f30;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18rem;
}

.meeting-filename {
  display: block;
  max-width: 28rem;
  margin-top: 0.15rem;
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge,
.source-state {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.16rem 0.48rem;
  border: 1px solid #c5cec8;
  border-radius: 999px;
  color: #35473e;
  background: #f5f7f5;
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}

.status-processing {
  border-color: #b5c8ba;
  background: #eef5f0;
}

.status-error {
  border-color: #ddb8b8;
  background: #fff3f3;
}

.overflow-menu {
  position: relative;
}

.overflow-menu summary {
  display: inline-flex;
  min-height: 2.2rem;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border: 1px solid #bdc8c0;
  border-radius: 0.4rem;
  background: #fff;
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}

.overflow-menu summary::-webkit-details-marker {
  display: none;
}

.overflow-menu-items {
  position: absolute;
  z-index: 3;
  top: calc(100% + 0.3rem);
  right: 0;
  display: grid;
  min-width: 13rem;
  padding: 0.35rem;
  border: 1px solid #bdc8c0;
  border-radius: 0.45rem;
  background: #fff;
  box-shadow: 0 0.7rem 1.8rem rgb(31 56 45 / 16%);
}

.overflow-menu-items button {
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 0.3rem;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.overflow-menu-items button:hover,
.overflow-menu-items button:focus-visible {
  background: #eef2ef;
}

.danger-button {
  color: #9b1c1c;
}

.pagination {
  justify-content: center;
  margin-top: 1rem;
}

.storage-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.storage-intro {
  max-width: 46rem;
  margin-top: -0.65rem;
}

.storage-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.75rem 0 0.75rem;
}

.storage-total {
  padding: 1rem 1.1rem;
  border-left: 3px solid #bfd0c5;
  background: var(--surface);
}

.storage-total dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.storage-total dd {
  margin: 0.15rem 0 0;
  color: #173f30;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 750;
}

.storage-notices {
  min-height: 4rem;
  margin-bottom: 1rem;
}

.storage-calculated {
  margin: 0;
  font-size: 0.85rem;
}

.storage-list {
  margin-top: 1rem;
}

.storage-sort {
  min-width: 13rem;
}

.storage-created {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.78rem;
}

.storage-table td:nth-child(n + 4):nth-child(-n + 6) {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.source-unsafe {
  border-color: #ddb8b8;
  color: var(--danger);
  background: #fff3f3;
}

.source-missing,
.source-deleting {
  border-color: #decda8;
  color: var(--warning);
  background: #fff8e9;
}

.source-deleted {
  color: var(--muted);
  background: var(--subtle);
}

.source-delete-dialog {
  width: min(37rem, calc(100vw - 2rem));
}

.source-delete-meeting {
  color: #173f30;
  font-weight: 700;
}

.source-delete-warning {
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 3px solid #d3b26b;
}

.source-delete-warning p {
  margin: 0.55rem 0;
}

.admin-page {
  width: min(82rem, 100%);
}

.admin-heading h1 {
  margin-bottom: 0.2rem;
}

.admin-intro {
  max-width: 52rem;
  margin-top: 0;
}

.admin-tabs {
  margin-top: 1.75rem;
}

.admin-section {
  padding: 1.5rem 0 3rem;
}

.admin-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.admin-live-status {
  margin-top: 0.8rem;
}

.admin-users-table select,
.admin-form-dialog select {
  min-height: 2.4rem;
  padding: 0.42rem 2.15rem 0.42rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  appearance: none;
  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, transparent 50%, #526159 50%),
    linear-gradient(135deg, #526159 50%, transparent 50%);
  background-position: calc(100% - 0.9rem) 50%, calc(100% - 0.6rem) 50%;
  background-repeat: no-repeat;
  background-size: 0.3rem 0.3rem, 0.3rem 0.3rem;
}

.admin-user-note {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
}

.admin-user-actions {
  min-width: 14rem;
}

.admin-user-actions .compact-button {
  margin: 0.15rem;
}

.status-disabled {
  color: var(--muted);
  background: var(--subtle);
}

.admin-storage-totals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-storage-content h3 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1rem;
}

.admin-source-counts,
.admin-runtime-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.admin-source-counts div,
.admin-runtime-list div {
  padding: 0.8rem;
}

.admin-source-counts dt,
.admin-runtime-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.admin-source-counts dd,
.admin-runtime-list dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.admin-runtime-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-form-dialog,
.admin-confirm-dialog {
  width: min(35rem, calc(100vw - 2rem));
}

.admin-dialog-target {
  color: #173f30;
  font-weight: 700;
}

.rename-dialog {
  width: min(32rem, calc(100vw - 2rem));
  padding: 0;
  border: 0;
  border-radius: 0.7rem;
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 25%);
}

.rename-dialog::backdrop {
  background: rgb(13 24 19 / 55%);
}

.dialog-form {
  padding: 1.5rem;
}

.dialog-form h2 {
  margin-top: 0;
}

.dialog-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.meeting-placeholder-page {
  max-width: 58rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.meeting-placeholder-metadata {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid #d8ded9;
  border-bottom: 1px solid #d8ded9;
}

.meeting-placeholder-metadata dt {
  color: #59675f;
  font-size: 0.8rem;
  font-weight: 650;
}

.meeting-placeholder-metadata dd {
  margin: 0.15rem 0 0;
}

.processing-state {
  margin-top: 1.25rem;
  font-weight: 650;
}

.inline-retry {
  margin-left: 0.75rem;
}

.success {
  color: #215d44;
}

.warning {
  color: #855a12;
}

.meeting-workspace-page {
  width: min(80rem, 100%);
  padding-top: clamp(1.25rem, 3vw, 2.5rem);
}

.workspace-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.workspace-heading {
  min-width: 0;
}

.workspace-heading h1 {
  margin: 0.15rem 0 0;
  font-size: clamp(1.75rem, 4vw, 2.55rem);
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.eyebrow,
.placeholder-kicker {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.workspace-filename {
  max-width: 45rem;
  margin: 0.45rem 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.workspace-header-actions {
  display: grid;
  justify-items: end;
  gap: 0.65rem;
}

.workspace-export-mount:empty {
  display: none;
}

.workspace-metadata {
  display: flex;
  gap: 2rem;
  margin: 1rem 0 0;
}

.workspace-metadata dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workspace-metadata dd {
  margin: 0.12rem 0 0;
  font-size: 0.88rem;
}

.workspace-state {
  padding: 1rem 0;
}

.media-utility {
  display: grid;
  grid-template-columns: auto minmax(14rem, 34rem) minmax(8rem, auto);
  align-items: center;
  gap: 0.7rem 1rem;
  margin-top: 1rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.media-utility-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.media-player-mount {
  min-width: 0;
}

.source-audio {
  display: block;
  width: 100%;
  height: 2.5rem;
}

.source-video {
  display: block;
  width: min(28rem, 100%);
  max-height: min(16rem, 38vh);
  border-radius: var(--radius-sm);
  background: #111;
  object-fit: contain;
}

.media-utility-status {
  font-size: 0.82rem;
}

.meeting-workspace {
  margin-top: 1.65rem;
}

.workspace-tabs {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.workspace-tab {
  position: relative;
  min-height: 2.8rem;
  padding: 0.55rem 0.05rem;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 680;
  cursor: pointer;
}

.workspace-tab[aria-selected="true"] {
  color: var(--ink);
}

.workspace-tab[aria-selected="true"]::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
}

.workspace-panel {
  padding: 1.5rem 0 3rem;
}

.panel-heading {
  max-width: 48rem;
  margin-bottom: 1.35rem;
}

.panel-heading h2,
.feature-placeholder h2 {
  margin: 0;
  font-size: 1.15rem;
}

.panel-heading p,
.feature-placeholder p {
  margin: 0.3rem 0 0;
}

.transcript-list {
  width: min(58rem, 100%);
}

.transcript-segment {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
  content-visibility: auto;
  contain-intrinsic-size: auto 9rem;
}

.transcript-segment:last-child {
  border-bottom: 1px solid var(--line);
}

.transcript-segment.segment-evidence-focus {
  border-radius: var(--radius-sm);
  background: #f1f8f4;
  box-shadow: 0 0 0 0.35rem #f1f8f4;
}

.segment-gutter {
  display: grid;
  align-content: start;
  gap: 0.35rem;
}

.segment-time,
.segment-meta {
  color: var(--muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.timestamp-seek {
  width: fit-content;
  padding: 0;
  border: 0;
  border-bottom: 1px dotted #8b9990;
  background: transparent;
  cursor: pointer;
}

.timestamp-seek:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.speaker-button,
.segment-action {
  width: fit-content;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 680;
  text-align: left;
  cursor: pointer;
}

.segment-body {
  min-width: 0;
}

.segment-meta {
  display: flex;
  min-height: 1.15rem;
  align-items: center;
  gap: 0.45rem;
}

.language-label {
  text-transform: uppercase;
}

.edited-badge {
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  color: #3e5a4e;
  background: var(--accent-soft);
  font-size: 0.68rem;
  font-weight: 700;
}

.segment-text {
  margin: 0.3rem 0 0;
  font-size: 1rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.segment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.55rem;
}

.segment-action {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 620;
}

.original-asr {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.original-asr summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 650;
}

.original-asr p,
.conflict-server-text {
  padding-left: 0.85rem;
  border-left: 2px solid var(--line);
  white-space: pre-wrap;
}

.segment-editor textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.75rem;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
}

.segment-edit-status {
  min-height: 1.25rem;
  margin-top: 0.25rem;
  font-size: 0.76rem;
}

.correction-conflict {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid #bd8122;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: #fff8e9;
}

.feature-placeholder,
.empty-state {
  max-width: 42rem;
  padding: 2.5rem 0;
}

.workspace-dialog {
  width: min(30rem, calc(100vw - 2rem));
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 25%);
}

.workspace-dialog::backdrop {
  background: rgb(13 24 19 / 55%);
}

.derived-artifact-view {
  width: min(62rem, 100%);
}

.derived-controls {
  display: flex;
  align-items: end;
  gap: 0.8rem;
  margin-bottom: 0.65rem;
}

.compact-field {
  display: grid;
  min-width: 13rem;
  gap: 0.28rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.compact-field select,
.export-form select {
  min-height: 2.35rem;
  padding: 0.42rem 2.2rem 0.42rem 0.68rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, transparent 50%, #526159 50%),
    linear-gradient(135deg, #526159 50%, transparent 50%);
  background-position: calc(100% - 0.95rem) 50%, calc(100% - 0.65rem) 50%;
  background-repeat: no-repeat;
  background-size: 0.32rem 0.32rem, 0.32rem 0.32rem;
  appearance: none;
}

.segmented-control {
  display: inline-flex;
  margin-left: auto;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  background: var(--subtle);
}

.translation-mode-mount {
  margin-left: auto;
}

.segmented-control button {
  min-height: 2rem;
  padding: 0.3rem 0.65rem;
  border: 0;
  border-radius: calc(var(--radius-sm) - 0.12rem);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.segmented-control button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0.1rem 0.35rem rgb(21 45 34 / 12%);
  font-weight: 680;
}

.artifact-status {
  min-height: 1.5rem;
  margin-bottom: 0.7rem;
  font-size: 0.88rem;
}

.translation-segment {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.05rem 0;
  border-top: 1px solid var(--line);
  content-visibility: auto;
  contain-intrinsic-size: auto 8rem;
}

.translation-segment:last-child {
  border-bottom: 1px solid var(--line);
}

.translation-speaker {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 680;
}

.translation-body {
  min-width: 0;
}

.segment-language {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.translation-text {
  margin: 0;
  line-height: 1.7;
  white-space: pre-wrap;
}

.translation-text + .translation-text {
  margin-top: 0.75rem;
}

.translation-original,
.translation-derived {
  position: relative;
  padding-left: 5.6rem;
}

.translation-original::before,
.translation-derived::before {
  position: absolute;
  top: 0.08rem;
  left: 0;
  width: 4.7rem;
  color: var(--muted);
  content: attr(data-label);
  font-size: 0.7rem;
  font-weight: 720;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.translation-derived {
  padding-top: 0.75rem;
  border-top: 1px solid var(--subtle);
}

.translation-derived::before {
  top: 0.82rem;
  color: var(--accent);
}

.summary-brief {
  max-width: 50rem;
}

.coverage-warning {
  margin: 1rem 0 1.75rem;
  padding: 1rem 1.15rem;
  border-left: 3px solid #bd8122;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: #fff8e9;
}

.coverage-warning p {
  margin: 0.35rem 0;
}

.summary-section {
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
}

.summary-section h3 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

.summary-overview {
  max-width: 46rem;
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.72;
  white-space: pre-wrap;
}

.summary-list {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding-left: 1.25rem;
}

.summary-item-text {
  margin: 0;
  line-height: 1.6;
}

.summary-speakers {
  margin-top: 0.18rem;
  font-size: 0.78rem;
}

.summary-evidence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.5rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.evidence-button {
  padding: 0;
  border: 0;
  border-bottom: 1px dotted #8b9990;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
}

.export-dialog {
  width: min(34rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.export-form .form-field {
  margin-bottom: 0.8rem;
}

.export-form .form-field select {
  width: 100%;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.8rem 0;
}

.check-field input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.2rem 0 0;
  accent-color: var(--accent);
}

.speaker-identifier {
  margin-top: -0.5rem;
  font-size: 0.82rem;
}

@media (max-width: 64rem) {
  .app-header-actions {
    flex-wrap: wrap;
  }

  .dashboard-controls {
    grid-template-columns: minmax(12rem, 1fr) repeat(2, minmax(9rem, auto));
  }

  .admin-source-counts,
  .admin-runtime-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 48rem) {
  .app-header {
    align-items: flex-start;
  }

  .app-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .dashboard-controls {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-search {
    grid-column: 1 / -1;
  }

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

  .storage-list .meeting-table-region,
  .admin-users-region {
    overflow: visible;
  }

  .storage-table,
  .storage-table tbody,
  .storage-table tr,
  .storage-table td,
  .admin-users-table,
  .admin-users-table tbody,
  .admin-users-table tr,
  .admin-users-table td {
    display: block;
    width: 100%;
  }

  .storage-table,
  .admin-users-table {
    border: 0;
    background: transparent;
  }

  .storage-table thead,
  .admin-users-table thead {
    display: none;
  }

  .storage-table tr,
  .admin-users-table tr {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #d8ded9;
    border-radius: 0.5rem;
    background: #fff;
  }

  .storage-table td,
  .storage-table tbody tr:last-child td,
  .admin-users-table td,
  .admin-users-table tbody tr:last-child td {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.42rem 0;
    border: 0;
    white-space: normal;
  }

  .storage-table td::before,
  .admin-users-table td::before {
    color: #59675f;
    content: attr(data-label);
    font-size: 0.78rem;
    font-weight: 650;
  }

  .admin-users-table .admin-user-actions {
    display: grid;
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .admin-user-actions .compact-button {
    width: 100%;
    margin: 0.15rem 0;
  }

  .meeting-filename {
    overflow-wrap: anywhere;
    white-space: normal;
  }
}

@media (max-width: 42rem) {
  .app-header,
  .app-header-actions {
    align-items: flex-start;
  }

  .app-header {
    flex-direction: column;
  }

  .app-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .upload-form,
  .google-connection-panel,
  .dashboard-heading,
  .section-heading,
  .storage-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-controls,
  .meeting-placeholder-metadata,
  .storage-totals {
    grid-template-columns: 1fr;
  }

  .storage-heading > .text-button,
  .storage-sort {
    width: 100%;
  }

  .admin-section-actions,
  .admin-section-actions .text-button,
  .admin-section-actions .primary-button {
    width: 100%;
  }

  .admin-storage-totals,
  .admin-source-counts,
  .admin-runtime-list {
    grid-template-columns: 1fr;
  }

  .admin-users-table .admin-user-actions {
    display: grid;
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .admin-user-actions .compact-button {
    width: 100%;
    margin: 0.15rem 0;
  }

  .meeting-table-region {
    overflow: visible;
  }

  .meeting-table,
  .meeting-table tbody,
  .meeting-table tr,
  .meeting-table td {
    display: block;
    width: 100%;
  }

  .meeting-table {
    border: 0;
    background: transparent;
  }

  .meeting-table thead {
    display: none;
  }

  .meeting-table tr {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #d8ded9;
    border-radius: 0.5rem;
    background: #fff;
  }

  .meeting-table td,
  .meeting-table tbody tr:last-child td {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.42rem 0;
    border: 0;
  }

  .meeting-table td::before {
    color: #59675f;
    content: attr(data-label);
    font-size: 0.78rem;
    font-weight: 650;
  }

  .meeting-filename {
    white-space: normal;
  }

  .overflow-menu-items {
    right: auto;
    left: 0;
  }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .workspace-badges {
    justify-content: flex-start;
  }

  .workspace-header-actions {
    width: 100%;
    justify-items: start;
  }

  .workspace-metadata {
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
  }

  .workspace-tabs {
    gap: 1.1rem;
    overflow-x: auto;
  }

  .media-utility {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .source-video {
    max-height: min(14rem, 40vh);
  }

  .transcript-segment {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 1rem 0;
  }

  .translation-segment {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .derived-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-field {
    min-width: 0;
  }

  .segmented-control {
    width: 100%;
    margin-left: 0;
  }

  .translation-mode-mount {
    width: 100%;
    margin-left: 0;
  }

  .segmented-control button {
    flex: 1;
  }

  .translation-original,
  .translation-derived {
    padding-left: 0;
    padding-top: 1.4rem;
  }

  .translation-original::before,
  .translation-derived::before {
    top: 0;
  }

  .translation-derived::before {
    top: 0.75rem;
  }

  .segment-gutter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .segment-time {
    min-width: 5.5rem;
  }

  .segment-actions .compact-button {
    flex: 1 1 auto;
  }
}

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