@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #090a09;
  --surface: #101211;
  --surface-2: #151817;
  --panel: #1a1e1c;
  --border: #2a302d;
  --border-strong: #404a45;
  --text: #e5ebe7;
  --muted: #a0aba4;
  --subtle: #727d76;
  --coral: #f28f84;
  --coral-dim: #9b5b55;
  --green: #7fb894;
  --amber: #cfa05a;
  --danger: #d06d58;
  --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --bc-ui-font: var(--font-sans);
  --bc-mono-font: var(--font-mono);
  --text-xs: 11px;
  --text-sm: 12px;
  --text-ui: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  --line-tight: 1.12;
  --line-ui: 1.35;
  --line-body: 1.52;

  /* JUDGMENT: spacing + radius tokens added per Phase 2.3 audit. Existing
     rules can stay on magic numbers; new layout work should reach for these
     so spacing stays consistent as more surfaces are reshaped. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--line-body);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-chrome {
  position: sticky;
  top: 0;
  z-index: 300;
  display: grid;
  grid-template-columns: minmax(0, min(1440px, calc(100vw - 48px)));
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  height: 40px;
  min-height: 40px;
  padding: 0;
  background: rgba(10, 10, 10, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  max-width: 100%;
  overflow: visible;
}

.brand-lockup {
  grid-area: 1 / 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--coral);
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-word {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text);
}

.top-nav {
  grid-area: 1 / 1;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  font-family: var(--font-mono);
  font-size: var(--text-ui);
  color: var(--muted);
}

.top-nav form {
  margin: 0;
}

.top-nav a {
  padding: 6px 9px;
  border: 1px solid transparent;
}

.support-trigger {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.support-trigger:hover,
.support-trigger:focus-visible,
.support-trigger[aria-expanded="true"] {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.support-trigger:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.support-trigger svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.support-trigger-beacon {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  background: var(--coral);
  border: 1px solid rgba(9, 10, 9, 0.95);
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(242, 143, 132, 0.18);
}

.support-trigger-beacon[hidden] {
  display: none;
}

.super-admin-shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 28px auto 64px;
}

.super-admin-header,
.super-admin-current,
.super-admin-search,
.super-admin-banner {
  display: flex;
  gap: var(--space-4);
}

.super-admin-header {
  align-items: end;
  justify-content: space-between;
  margin-bottom: var(--space-7);
}

.super-admin-kicker,
.admin-table small,
.admin-table span {
  color: var(--muted);
}

.super-admin-kicker,
.admin-pill {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.super-admin-kicker {
  margin: 0 0 var(--space-1);
  text-transform: uppercase;
}

.super-admin-header h1 {
  margin: 0;
  letter-spacing: 0;
  font-size: var(--text-3xl);
  line-height: var(--line-tight);
}

.super-admin-note {
  margin: var(--space-1) 0 0;
  color: var(--muted);
}

.admin-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
}

.admin-table td > strong,
.admin-table td > span,
.admin-table td > small,
.admin-row-link {
  display: block;
}

.admin-row-link {
  color: var(--text);
  font-weight: 700;
}

.admin-row-link:hover {
  color: var(--coral);
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 3px 8px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.super-admin-current {
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.super-admin-search {
  align-items: center;
  margin-bottom: var(--space-4);
}

.super-admin-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 var(--space-3);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.super-admin-search input:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.super-admin-search input[type="submit"],
.admin-inline-button,
.super-admin-banner-button {
  min-height: 36px;
  padding: 0 var(--space-3);
  color: var(--text);
  font: inherit;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.super-admin-banner {
  position: sticky;
  top: 40px;
  z-index: 250;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: var(--space-2) var(--space-4);
  color: var(--text);
  background: #231f17;
  border-bottom: 1px solid var(--amber);
}

.super-admin-banner a {
  color: var(--coral);
}

.super-admin-banner form {
  margin: 0;
}

@media (max-width: 860px) {
  .super-admin-header,
  .super-admin-current,
  .super-admin-search,
  .super-admin-banner {
    flex-direction: column;
    align-items: stretch;
  }
}

.identity-menu {
  position: relative;
  height: 40px;
}

.identity-menu[open] {
  z-index: 120;
}

.identity-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  min-height: 40px;
  max-width: 220px;
  padding: 0 0 0 10px;
  color: var(--text);
  font-family: var(--font-mono);
  list-style: none;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border-strong);
  border-radius: 0;
  cursor: pointer;
}

.identity-trigger::-webkit-details-marker {
  display: none;
}

.identity-trigger:hover,
.identity-menu[open] .identity-trigger {
  border-color: var(--coral);
  background: transparent;
}

.identity-avatar {
  display: none;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #191111;
  font-size: var(--text-xs);
  font-weight: 800;
  background: var(--coral);
  border-radius: 50%;
}

.identity-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: var(--text-ui);
  font-weight: 650;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-caret {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}

.identity-popover {
  position: absolute;
  z-index: 310;
  top: 40px;
  right: 0;
  display: grid;
  gap: 8px;
  width: min(280px, calc(100vw - 28px));
  padding: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.identity-card {
  display: grid;
  gap: 2px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--border);
}

.identity-card strong,
.identity-card span,
.identity-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-card strong {
  font-size: var(--text-ui);
}

.identity-card span,
.identity-card small {
  color: var(--muted);
  font-size: var(--text-sm);
}

.identity-context {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  background: color-mix(in srgb, var(--surface) 74%, #000);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.identity-context[hidden] {
  display: none;
}

.identity-context-label {
  color: var(--coral);
  font: 700 10px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0;
}

.identity-context strong,
.identity-context small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-context strong {
  color: var(--text);
  font-size: var(--text-ui);
}

.identity-context small {
  color: var(--muted);
  font-size: var(--text-sm);
}

.identity-menu-links {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.identity-menu-links a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.identity-menu-links a:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

.identity-menu-links .danger-link {
  color: var(--danger);
}

.identity-menu-links .danger-link:hover {
  background: rgba(208, 109, 88, 0.12);
  border-color: rgba(208, 109, 88, 0.2);
}

.settings-danger-copy {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.settings-danger-link {
  display: inline-block;
  width: fit-content;
  padding: 8px 12px;
  color: var(--danger);
  border: 1px solid rgba(208, 109, 88, 0.4);
  text-decoration: none;
  font-weight: 800;
}

.settings-danger-link:hover,
.settings-danger-link:focus-visible {
  background: rgba(208, 109, 88, 0.12);
  border-color: var(--danger);
}

.identity-signout {
  width: 100%;
  padding: 8px 10px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
}

.identity-signout:hover {
  color: var(--danger);
  background: rgba(208, 109, 88, 0.12);
  border-color: rgba(208, 109, 88, 0.2);
}

.nav-button:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}

.nav-button {
  padding: 6px 9px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  font: inherit;
  cursor: pointer;
}

.flash-stack {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 200;
  display: grid;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.flash {
  margin: 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.flash-notice {
  border-color: rgba(126, 196, 154, 0.5);
}

.flash-alert {
  border-color: rgba(215, 112, 85, 0.55);
}

.verify-email-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: rgba(215, 169, 85, 0.12);
  border-bottom: 1px solid rgba(215, 169, 85, 0.45);
  font-size: 0.9rem;
}

.verify-email-resend {
  background: none;
  border: 1px solid var(--border-strong);
  padding: 4px 10px;
  cursor: pointer;
  font: inherit;
}

.app-page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: start;
  padding: clamp(20px, 3vw, 34px) 0 var(--space-4);
  border-bottom: 1px solid var(--border);
}

.app-page-title {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.app-page-title h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(28px, 2.7vw, 40px);
  line-height: var(--line-tight);
}

.app-page-meta {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-md);
  line-height: var(--line-ui);
}

.app-page-header .app-page-actions {
  align-self: start;
  padding-top: 2px;
}

.project-page-header {
  border-bottom: 0;
}

.project-page-header .app-page-title {
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--space-2) 10px;
}

.project-page-header .eyebrow,
.project-page-header h1 {
  grid-column: 1 / -1;
}

.project-page-header .app-page-meta {
  white-space: nowrap;
}

.project-page-description {
  display: -webkit-box;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-assistant-nudge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  margin: var(--space-5) 0 var(--space-2);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.project-assistant-nudge h2 {
  margin: 0;
  font-size: var(--text-xl);
  line-height: var(--line-tight);
}

.project-assistant-nudge p:not(.eyebrow) {
  max-width: 72ch;
  margin: var(--space-1) 0 0;
  color: var(--muted);
  line-height: var(--line-body);
}

.upload-ai-strip,
.settings-ai-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  margin-top: var(--space-5);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.settings-ai-guide {
  margin-top: 0;
  margin-bottom: var(--space-2);
}

.upload-ai-strip h2 {
  margin: 2px 0 5px;
  font-size: var(--text-xl);
  line-height: var(--line-tight);
}

.upload-ai-strip p:not(.eyebrow),
.settings-ai-guide span {
  max-width: 72ch;
  margin: 0;
  color: var(--muted);
  line-height: var(--line-body);
}

.settings-ai-guide > div {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.settings-ai-guide strong {
  color: var(--text);
  font-size: var(--text-md);
}

.app-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

.app-page-actions > .button-primary,
.app-page-actions > .button-secondary {
  min-height: 44px;
  padding: 0 14px;
  text-align: center;
  white-space: normal;
  line-height: 1.15;
}

.app-page-actions bitterclip-upload-link-share {
  min-width: 0;
}

.first-run {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 28px;
  padding: 44px 36px 36px;
}

.first-run-copy {
  min-height: 390px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  margin: 0;
  color: var(--coral);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: var(--space-5);
  font-size: var(--text-3xl);
  line-height: var(--line-tight);
  letter-spacing: 0;
}

h2 {
  margin-bottom: var(--space-3);
  font-size: var(--text-2xl);
  line-height: var(--line-tight);
}

h3 {
  margin-bottom: var(--space-2);
  font-size: var(--text-lg);
  line-height: var(--line-tight);
}

.lede {
  max-width: 680px;
  color: var(--muted);
  font-size: var(--text-md);
  line-height: var(--line-body);
}

.reference-docs {
  display: grid;
  gap: var(--space-7);
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.reference-hero {
  display: grid;
  gap: var(--space-4);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}

.reference-hero h1 {
  margin: 0;
}

.reference-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-md);
}

.reference-hero-actions,
.operation-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.reference-link-button,
.operation-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
}

.reference-link-button {
  color: var(--text);
  font-weight: 700;
}

.reference-section {
  display: grid;
  gap: var(--space-4);
}

.reference-section h2,
.reference-section h3,
.reference-section h4 {
  margin: 0;
}

.reference-muted {
  max-width: 760px;
  color: var(--muted);
}

.reference-grid,
.operation-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.reference-grid > div,
.operation-doc {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.operation-list {
  display: grid;
  gap: var(--space-7);
}

.operation-doc {
  display: grid;
  gap: var(--space-4);
}

.operation-doc header {
  display: grid;
  gap: var(--space-2);
}

.operation-doc header p {
  max-width: 880px;
  margin: 0;
  color: var(--muted);
}

.operation-name {
  color: var(--coral) !important;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
}

.operation-meta span {
  min-height: 28px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.operation-errors p,
.operation-example p {
  margin: 0;
  color: var(--muted);
}

.reference-docs pre {
  overflow-x: auto;
  margin: var(--space-2) 0 0;
  padding: var(--space-3);
  color: var(--text);
  font-size: var(--text-sm);
  background: #050605;
  border: 1px solid var(--border);
}

.reference-docs code {
  font-family: var(--font-mono);
}

.clip-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.button-primary,
.button-secondary,
.button-danger,
.button-disabled {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--text-ui);
  font-weight: 700;
  line-height: 1;
}

.button-primary,
.button-secondary,
.button-danger {
  cursor: pointer;
}

.button-primary {
  background: var(--coral);
  color: #1c1110;
  border-color: var(--coral);
}

.button-secondary {
  color: var(--text);
  background: var(--surface);
}

.button-danger {
  color: var(--danger);
  background: transparent;
  border-color: rgba(208, 109, 88, 0.55);
}

.button-danger:hover {
  background: rgba(208, 109, 88, 0.12);
}

.button-disabled {
  color: var(--muted);
  background: #0d0f0e;
  border-color: var(--border);
  cursor: not-allowed;
}

.button-primary:disabled,
.button-secondary:disabled,
.button-danger:disabled {
  color: var(--subtle);
  background: #0d0f0e;
  border-color: var(--border);
  cursor: not-allowed;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.choice-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  color: var(--text);
  font-size: var(--text-ui);
  font-weight: 800;
  line-height: var(--line-ui);
}

.choice-control input[type="checkbox"] {
  display: grid;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  place-content: center;
  appearance: none;
  margin: 0;
  background: #080a09;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.choice-control input[type="checkbox"]::before {
  width: 8px;
  height: 8px;
  background: var(--coral);
  border-radius: 2px;
  content: "";
  transform: scale(0);
  transition: transform 120ms ease;
}

.choice-control input[type="checkbox"]:checked {
  border-color: var(--coral);
  background: rgba(242, 143, 132, 0.12);
}

.choice-control input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.choice-control input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.choice-control.is-disabled {
  color: var(--subtle);
}

.choice-control input[type="checkbox"]:disabled {
  background: #0d0f0e;
  border-color: var(--border);
  cursor: not-allowed;
}

/* Global keyboard focus indicator. Every button + role=button surface needs
   a visible focus ring; the only previous focus styles were on a couple of
   specific rows (.bc-source-row, .bc-source-discard). Everything else was
   invisible to keyboard users. */
summary:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.settings-page {
  display: grid;
  gap: var(--space-7);
  width: min(1180px, calc(100vw - 48px));
  max-width: none;
  margin: 0 auto;
  min-height: calc(100vh - 160px);
  align-items: start;
  padding: 0 0 var(--space-8);
}

.settings-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.settings-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.settings-danger-panel {
  border-color: rgba(208, 109, 88, 0.45);
}

.settings-delete-summary {
  display: grid;
  gap: 10px;
}

.settings-delete-summary div {
  display: grid;
  gap: 3px;
}

.settings-delete-summary span {
  color: var(--muted);
}

.settings-section-heading {
  display: grid;
  gap: 4px;
}

.settings-section-heading h2 {
  margin: 0;
  font-size: 22px;
}

.settings-target-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.settings-target-form .settings-note {
  grid-column: 1 / -1;
}

.settings-target-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-defaults-form {
  display: grid;
  gap: 14px;
}

.settings-defaults-form fieldset {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-defaults-form legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.settings-checkbox-grid label {
  display: flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: #090b0a;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 800;
}

.settings-checkbox-grid input {
  flex: 0 0 auto;
}

.settings-channel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.settings-channel-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.settings-channel-row strong,
.settings-channel-row span {
  overflow-wrap: anywhere;
}

.settings-channel-row span {
  color: var(--muted);
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: var(--space-8);
  align-items: center;
  width: min(100%, 1040px);
  min-height: calc(100vh - 96px);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.auth-copy {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.auth-copy h1 {
  margin: 0;
}

.auth-copy .lede {
  max-width: 520px;
  margin: 0;
}

.auth-panel {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
}

.auth-form {
  display: grid;
  gap: var(--space-4);
}

.auth-form label {
  display: grid;
  gap: var(--space-2);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 800;
  text-transform: uppercase;
}

.auth-form input:not([type="hidden"]) {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  color: var(--text);
  background: #0b0d0c;
  border: 1px solid var(--border-strong);
  font: inherit;
  font-size: var(--text-base);
  text-transform: none;
}

.auth-form input:not([type="hidden"]):focus {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
  border-color: var(--coral);
}

.auth-form .wide-action {
  min-height: 44px;
  justify-content: center;
  font-size: var(--text-ui);
}

.button-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 9px 10px;
  color: var(--text);
  background: #0b0d0c;
  border: 1px solid var(--border-strong);
  font: inherit;
  font-size: var(--text-ui);
  font-weight: 800;
  text-decoration: none;
}

.button-google svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.button-google:hover,
.button-google:focus-visible {
  border-color: var(--coral);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 800;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

.settings-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-field code {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  color: var(--text);
  background: #090b0a;
  border: 1px solid var(--border);
  font: inherit;
  text-transform: none;
}

.settings-field code {
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 12px;
}

.settings-field input,
.settings-field select,
.settings-field textarea,
.settings-target-form input[type="text"] {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 10px;
  color: var(--text);
  background: #090b0a;
  border: 1px solid var(--border-strong);
  font: inherit;
  text-transform: none;
}

.settings-field textarea {
  resize: vertical;
  line-height: var(--line-normal);
}

.settings-field input:focus,
.settings-field select:focus,
.settings-field textarea:focus,
.settings-target-form input[type="text"]:focus {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
  border-color: var(--coral);
}

.settings-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.settings-page-compact {
  gap: var(--space-7);
}

.settings-copy-compact {
  display: grid;
  gap: var(--space-2);
}

.settings-copy-compact h1 {
  margin: 0;
  font-size: var(--text-3xl);
  letter-spacing: 0;
}

.settings-copy-compact .lede {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.settings-stack-plain {
  gap: var(--space-8);
}

.settings-section {
  display: grid;
  gap: var(--space-4);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: 0;
}

.settings-line-heading {
  gap: 2px;
}

.settings-line-heading h2 {
  font-size: var(--text-xl);
}

.settings-provider-list,
.settings-kv-list {
  display: grid;
  border-top: 1px solid var(--border);
}

.settings-provider-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(132px, auto) auto;
  gap: var(--space-5);
  align-items: center;
  min-height: 58px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.settings-provider-row-with-editor {
  align-items: start;
}

.settings-provider-editor {
  grid-column: 1 / -1;
  padding-top: var(--space-2);
}

.settings-provider-platform {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-provider-platform strong {
  color: var(--text);
}

.settings-provider-meta {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.settings-provider-meta a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(242, 143, 132, 0.45);
  text-underline-offset: 3px;
}

.settings-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: var(--text-ui);
  font-weight: 800;
  white-space: nowrap;
}

.settings-status::before {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--subtle);
  content: "";
}

.settings-status.connected {
  color: var(--green);
}

.settings-status.connected::before {
  background: var(--green);
}

.settings-status.warning {
  color: var(--amber);
}

.settings-status.warning::before {
  background: var(--amber);
}

.settings-status.missing {
  color: var(--muted);
}

.settings-provider-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
}

.settings-provider-actions form,
.settings-kv-row-action form {
  margin: 0;
}

.settings-row-button {
  min-height: 44px;
  min-width: 92px;
}

.settings-target-actions .button-primary,
.settings-target-actions .button-secondary {
  min-height: 44px;
}

.settings-text-action {
  color: var(--muted);
  font-size: var(--text-ui);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(160, 171, 164, 0.45);
  text-underline-offset: 3px;
}

.settings-text-action:hover {
  color: var(--text);
  text-decoration-color: rgba(242, 143, 132, 0.75);
}

.settings-target-form-compact {
  margin-top: 0;
}

.settings-target-form-compact .settings-target-input {
  grid-template-columns: 1fr;
  gap: 6px;
}

.settings-row-field {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 800;
}

.settings-row-field > span,
.settings-row-field legend {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 800;
  text-transform: uppercase;
}

.settings-row-field input,
.settings-row-field select,
.settings-row-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--text);
  background: #090b0a;
  border: 1px solid var(--border-strong);
  font: inherit;
  text-transform: none;
}

.settings-row-field textarea {
  resize: vertical;
  line-height: var(--line-body);
}

.settings-row-field input:focus,
.settings-row-field select:focus,
.settings-row-field textarea:focus {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
  border-color: var(--coral);
}

.settings-row-field input:disabled,
.settings-row-field select:disabled,
.settings-row-field textarea:disabled {
  color: var(--subtle);
  background: #0d0f0e;
  border-color: var(--border);
  cursor: not-allowed;
  opacity: 1;
}

.settings-defaults-compact {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
}

.settings-inline-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-check-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  align-items: stretch;
}

.settings-platform-control {
  display: grid;
  gap: 8px;
}

.settings-platform-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 9px 11px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
}

.settings-platform-option:hover:not(.is-disabled),
.settings-platform-option:has(input[type="checkbox"]:focus-visible) {
  border-color: rgba(242, 143, 132, 0.65);
}

.settings-platform-option.is-selected,
.settings-platform-option:has(input[type="checkbox"]:checked) {
  background: rgba(242, 143, 132, 0.12);
  border-color: rgba(242, 143, 132, 0.75);
}

.settings-platform-option input[type="checkbox"] {
  display: grid;
  width: 22px;
  height: 22px;
  place-content: center;
  appearance: none;
  margin: 0;
  background: #080a09;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.settings-platform-option input[type="checkbox"]::before {
  width: 9px;
  height: 5px;
  border-bottom: 2px solid #090b0a;
  border-left: 2px solid #090b0a;
  content: "";
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform 120ms ease;
}

.settings-platform-option input[type="checkbox"]:checked {
  background: var(--coral);
  border-color: var(--coral);
}

.settings-platform-option input[type="checkbox"]:checked::before {
  transform: rotate(-45deg) scale(1);
}

.settings-platform-option input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.settings-platform-option.is-disabled {
  color: var(--subtle);
  cursor: not-allowed;
}

.settings-platform-option input[type="checkbox"]:disabled {
  background: #0d0f0e;
  border-color: var(--border);
}

.settings-platform-option-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.settings-platform-option-name {
  overflow: hidden;
  color: inherit;
  font-size: var(--text-ui);
  font-weight: 900;
  line-height: var(--line-ui);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-platform-option-state {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: var(--line-ui);
  text-transform: none;
}

.settings-platform-option.is-disabled .settings-platform-option-state {
  color: var(--subtle);
}

.settings-field-hint {
  margin: 0;
  color: var(--subtle);
  font-size: var(--text-ui);
  font-weight: 600;
  text-transform: none;
}

.settings-row-field-wide {
  align-items: start;
}

.settings-form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-1);
}

.settings-form-footer .button-primary,
.settings-form-footer .button-secondary {
  min-height: 44px;
}

.settings-kv-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
  min-height: 46px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.settings-kv-row-action {
  grid-template-columns: 168px minmax(0, 1fr) auto;
}

.settings-kv-row > span {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 800;
  text-transform: uppercase;
}

.settings-kv-row code {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.settings-subsection-heading {
  padding-top: var(--space-3);
}

.settings-subsection-heading h3 {
  margin: 0;
  font-size: var(--text-lg);
}

.settings-session-list {
  margin-top: -2px;
}

.connect-page {
  display: grid;
  gap: var(--space-6);
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: clamp(28px, 5vh, 56px) 0 var(--space-8);
}

.connect-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 380px);
  gap: var(--space-5);
  align-items: end;
}

.connect-hero-copy {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  max-width: 820px;
}

.connect-hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(34px, 4.2vw, 56px);
}

.connect-hero .lede {
  max-width: 720px;
  margin: 0;
}

.connect-loop-line {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-md);
  line-height: var(--line-body);
}

.connect-action-panel {
  display: grid;
  padding: 0 var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.connect-start,
.connect-prompt-card,
.connect-prompt-context,
.connect-empty-action,
.connect-requests,
.connect-request-list,
.connect-setup-body,
.connect-client,
.connect-path-list,
.connect-path-item,
.connect-path-copy,
.connect-provider-grid,
.connect-provider-row,
.connect-provider-main,
.connect-provider-title,
.connect-provider-actions,
.connect-open-actions,
.connect-access-list div {
  display: grid;
  min-width: 0;
}

.connect-path-list {
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.connect-path-item {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-top: 1px solid rgba(229, 235, 231, 0.12);
}

.connect-path-item:first-child {
  border-top: 0;
}

.connect-path-marker {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  color: var(--green);
  background: rgba(126, 184, 148, 0.09);
  border: 1px solid rgba(126, 184, 148, 0.28);
  border-radius: 50%;
  font-size: var(--text-sm);
  font-weight: 900;
}

.connect-path-copy {
  gap: var(--space-3);
  align-content: start;
}

.connect-start {
  align-content: start;
  gap: var(--space-4);
}

.connect-start h2,
.connect-path-copy h2,
.connect-section-heading h2,
.connect-setup-disclosure strong {
  margin: 0;
}

.connect-start h2,
.connect-path-copy h2 {
  max-width: 760px;
  font-size: clamp(24px, 2.7vw, 34px);
  line-height: var(--line-tight);
}

.connect-start > p,
.connect-path-copy > p,
.connect-section-heading p:not(.eyebrow),
.connect-empty-action span {
  margin: 0;
  color: var(--muted);
  line-height: var(--line-body);
}

.connect-prompt-card {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  margin-top: var(--space-1);
  padding: var(--space-4);
  background: rgba(9, 10, 9, 0.78);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.connect-prompt-card p {
  grid-column: 1;
  margin: 0;
  color: var(--text);
  font-size: var(--text-md);
  line-height: var(--line-body);
}

.connect-prompt-card .button-primary,
.connect-prompt-card .button-secondary {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 42px;
  padding-inline: var(--space-4);
  white-space: nowrap;
}

.connect-prompt-context {
  gap: 2px;
}

.connect-prompt-context span {
  color: var(--subtle);
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connect-prompt-context strong {
  max-width: 100%;
  color: var(--text);
  font-size: var(--text-lg);
  line-height: var(--line-ui);
}

.connect-empty-action {
  gap: var(--space-2);
  justify-items: start;
}

.connect-provider-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.connect-provider-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  background: rgba(9, 10, 9, 0.36);
  border: 1px solid rgba(229, 235, 231, 0.1);
  border-radius: var(--radius-md);
}

.connect-provider-main {
  gap: 6px;
}

.connect-provider-title {
  grid-template-columns: minmax(0, auto) auto;
  gap: var(--space-2);
  align-items: center;
  justify-content: start;
}

.connect-provider-title h3 {
  margin: 0;
  font-size: var(--text-md);
}

.connect-provider-main p,
.connect-provider-meta,
.connect-footnote {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-ui);
  line-height: var(--line-body);
}

.connect-provider-actions {
  grid-auto-flow: column;
  gap: var(--space-2);
  justify-content: start;
}

.connect-open-actions {
  grid-auto-flow: column;
  justify-content: start;
  gap: var(--space-2);
}

.connect-requests {
  gap: var(--space-4);
  padding-top: var(--space-2);
}

.connect-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
  gap: var(--space-5);
  align-items: end;
}

.connect-request-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.connect-request {
  display: grid;
  grid-template-rows: auto auto;
  gap: var(--space-3);
  min-width: 0;
  min-height: 0;
  padding: var(--space-4);
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
}

.connect-request span {
  min-width: 0;
  font-size: var(--text-md);
  line-height: var(--line-body);
}

.connect-request strong {
  color: var(--green);
  font-size: var(--text-ui);
}

.connect-request:hover strong,
.connect-request:focus-visible strong {
  color: var(--coral);
}

.connect-request:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.connect-setup-disclosure {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.connect-setup-disclosure summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  min-height: 68px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.connect-setup-disclosure summary::-webkit-details-marker {
  display: none;
}

.connect-setup-disclosure summary::after {
  content: "+";
  color: var(--coral);
  font-size: var(--text-2xl);
  font-weight: 700;
}

.connect-setup-disclosure[open] summary::after {
  content: "-";
}

.connect-setup-disclosure summary span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.connect-setup-disclosure summary em {
  color: var(--muted);
  font-size: var(--text-ui);
  font-style: normal;
  line-height: var(--line-body);
}

.connect-setup-body {
  gap: var(--space-5);
  padding: 0 0 var(--space-5);
}

.connect-url-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: end;
}

.connect-url-box .settings-field code {
  display: flex;
  align-items: center;
  min-height: 46px;
  border-color: var(--border-strong);
}

.connect-copy-button {
  min-height: 46px;
  white-space: nowrap;
}

.connect-copy-button:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.connect-copy-status {
  min-height: 18px;
}

.connect-client-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.connect-client {
  gap: var(--space-2);
  min-width: 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.connect-client strong {
  color: var(--text);
  font-size: var(--text-md);
  line-height: var(--line-ui);
}

.connect-client span {
  color: var(--muted);
  line-height: var(--line-body);
}

.connect-access-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
}

.connect-access-list div {
  gap: var(--space-1);
  min-width: 0;
}

.connect-access-list dt {
  color: var(--text);
  font-weight: 800;
}

.connect-access-list dd {
  margin: 0;
  color: var(--muted);
  line-height: var(--line-body);
  overflow-wrap: anywhere;
}

.billing-page {
  display: grid;
  gap: var(--space-8);
  width: min(1240px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 0 0 var(--space-8);
}

.billing-hero h1,
.billing-history h2,
.billing-plan h2,
.billing-local-checkout h2 {
  margin: 0;
}

.billing-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.billing-summary div {
  display: grid;
  gap: var(--space-1);
  min-height: 72px;
  align-content: center;
  padding: var(--space-3) var(--space-4);
  border-right: 1px solid var(--border);
}

.billing-summary div:last-child {
  border-right: 0;
}

.billing-summary span,
.billing-table-head {
  color: var(--subtle);
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.billing-summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: var(--text-lg);
  line-height: var(--line-tight);
}

.billing-plans,
.billing-history,
.billing-local-checkout {
  display: grid;
  gap: var(--space-4);
}

.billing-plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: var(--space-7);
  align-items: center;
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border);
}

.billing-plan-main {
  display: grid;
  gap: var(--space-2);
}

.billing-plan-main p:not(.eyebrow) {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
}

.billing-plan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.billing-plan-meta span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 8px;
  color: var(--green);
  border: 1px solid rgba(126, 196, 154, 0.28);
  font-size: var(--text-sm);
  font-weight: 800;
}

.billing-plan-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
}

.billing-plan-form .button-primary {
  min-height: 44px;
}

.billing-plan-form input[type="text"] {
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  color: var(--text);
  background: #090b0a;
  border: 1px solid var(--border-strong);
  font: inherit;
}

.billing-table {
  display: grid;
  border-top: 1px solid var(--border);
}

.billing-table-head,
.billing-table-row {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1.1fr 1fr;
  gap: var(--space-3);
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--border);
}

.billing-table-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.billing-table-action a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.billing-table-action a:hover {
  text-decoration: underline;
}

.settings-panel {
  padding: 0 0 0 clamp(18px, 3vw, 32px);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border);
}

.auth-switch a {
  color: var(--coral);
}

.auth-switch {
  margin: 0;
  color: var(--text);
}

.wide-action {
  width: 100%;
}

.clip-row.active {
  border-color: var(--coral);
  box-shadow: inset 3px 0 0 var(--coral);
}

.preview-video.tall {
  min-height: 480px;
  aspect-ratio: 9 / 16;
}

.preview-video.has-media {
  display: block;
  min-height: auto;
  padding: 0;
  background: #050605;
}

.progress {
  height: 8px;
  background: #090b0a;
  border: 1px solid var(--border);
}

.progress span {
  display: block;
  height: 100%;
  background: var(--coral);
}

.speaker-memory-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: #0b0d0c;
  border: 1px solid var(--border);
}

.section-title.compact {
  margin-bottom: 10px;
}

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

.speaker-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  min-height: 116px;
  padding: 10px;
  background: #101310;
  border: 1px solid rgba(126, 196, 154, 0.26);
}

.speaker-card.needs-name {
  border-color: rgba(255, 154, 143, 0.65);
}

.speaker-avatar {
  display: grid;
  width: 88px;
  height: 96px;
  overflow: hidden;
  place-items: center;
  color: var(--muted);
  background:
    #070807;
  background-size: 18px 18px;
  border: 1px solid var(--border);
  font-size: 28px;
  font-weight: 900;
}

.speaker-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.speaker-card-body {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 8px;
}

.speaker-card-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.speaker-card-topline strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speaker-card-body small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.speaker-name-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.speaker-name-form input[type="text"] {
  min-width: 0;
  height: 36px;
  padding: 0 9px;
  color: var(--text);
  background: #090b0a;
  border: 1px solid var(--border);
  font: inherit;
}

.speaker-name-form input[type="submit"] {
  height: 36px;
  padding: 0 10px;
  color: #1c1110;
  background: var(--coral);
  border: 1px solid var(--coral);
  font: inherit;
  font-weight: 800;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  color: var(--green);
  background: rgba(126, 196, 154, 0.08);
  border: 1px solid rgba(126, 196, 154, 0.35);
  font-size: 12px;
  font-weight: 800;
}

.chip small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.chip-warning {
  color: var(--amber);
  background: rgba(212, 162, 85, 0.08);
  border-color: rgba(212, 162, 85, 0.42);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.pill-word_timed {
  color: var(--green);
  border-color: rgba(126, 196, 154, 0.4);
}

.pill-pending {
  color: var(--amber);
  border-color: rgba(212, 162, 85, 0.42);
}

.pill-error {
  color: var(--danger);
  border-color: rgba(215, 112, 85, 0.42);
}

.check-row {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.approval-page {
  padding: 28px;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.approval-actions button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
  background: #0d0f0e;
  border: 1px solid var(--border);
  font: inherit;
  font-weight: 700;
}

.approval-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.approval-blocker {
  display: grid;
  gap: 4px;
  max-width: 560px;
  margin-top: 12px;
  padding: 12px;
  color: var(--muted);
  background: rgba(212, 162, 85, 0.08);
  border: 1px solid rgba(212, 162, 85, 0.35);
}

.approval-blocker strong {
  color: var(--text);
}

.approval-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  margin-top: 16px;
}

.check-list {
  display: grid;
  gap: 4px;
}

.empty-stage {
  display: grid;
  min-height: 60vh;
  place-content: center;
  text-align: center;
}

@media (max-width: 980px) {
  .advanced-grid {
    grid-template-columns: 1fr;
  }

  .auth-page {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
  }

  .settings-page {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
  }

  .connect-hero,
  .connect-section-heading,
  .connect-provider-grid,
  .connect-client-grid,
  .connect-access-list {
    grid-template-columns: 1fr;
  }

  .connect-request-list {
    grid-template-columns: 1fr;
  }

  .connect-request {
    grid-template-rows: auto;
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .settings-page-compact {
    width: min(100%, calc(100vw - 28px));
  }

  .settings-copy-compact h1 {
    font-size: var(--text-2xl);
  }

  .settings-stack-plain {
    gap: var(--space-6);
  }

  .settings-provider-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    align-items: start;
    min-height: 0;
    padding: 12px 0;
  }

  .settings-provider-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .settings-row-button {
    min-width: 0;
    width: 100%;
  }

  .settings-provider-actions .button-primary,
  .settings-provider-actions .button-secondary,
  .settings-target-actions .button-primary,
  .settings-target-actions .button-secondary {
    flex: 1 1 0;
  }

  .settings-target-form-compact,
  .settings-row-field,
  .settings-check-row,
  .settings-kv-row,
  .settings-kv-row-action {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .settings-form-footer {
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .app-chrome {
    align-items: center;
    flex-direction: row;
    height: 40px;
    min-height: 40px;
    padding: 0 8px;
  }

  .approval-page {
    padding: 16px;
  }

  .flash-stack {
    top: auto;
    right: 16px;
    bottom: 16px;
    left: 16px;
    max-width: none;
  }

  h1 {
    font-size: 38px;
  }

  .top-nav {
    flex: 0 0 auto;
    width: auto;
    margin-left: auto;
    flex-wrap: nowrap;
    overflow: visible;
  }

  .identity-trigger {
    max-width: min(154px, 42vw);
  }

  .identity-menu {
    margin-left: 0;
  }

  .identity-popover {
    right: 0;
  }

  .auth-page {
    padding: var(--space-6) var(--space-4);
  }

  .auth-panel {
    padding: var(--space-5);
  }

  .settings-page {
    width: min(100%, calc(100vw - 28px));
    padding: 0 0 var(--space-7);
  }

  .connect-page {
    width: min(100%, calc(100vw - 28px));
    gap: var(--space-5);
    padding-top: var(--space-6);
  }

  .connect-hero h1 {
    font-size: 34px;
  }

  .connect-hero {
    gap: var(--space-4);
  }

  .connect-action-panel {
    padding: 0 var(--space-4);
    border-radius: var(--radius-md);
  }

  .connect-path-item {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: var(--space-3);
    padding: var(--space-4) 0;
  }

  .connect-path-marker {
    width: 24px;
    height: 24px;
    font-size: var(--text-xs);
  }

  .connect-path-copy h2 {
    font-size: var(--text-2xl);
  }

  .connect-prompt-card,
  .connect-provider-row {
    grid-template-columns: 1fr;
  }

  .connect-prompt-card .button-primary,
  .connect-prompt-card .button-secondary {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
  }

  .connect-prompt-context strong {
    white-space: normal;
  }

  .connect-provider-title {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .connect-provider-actions,
  .connect-open-actions {
    grid-auto-flow: row;
    justify-content: stretch;
  }

  .connect-url-box {
    grid-template-columns: 1fr;
  }

  .connect-provider-actions .button-secondary,
  .connect-provider-actions .button-primary,
  .connect-open-actions .button-secondary {
    width: 100%;
  }

  .connect-copy-button {
    width: 100%;
  }

  .settings-target-form,
  .settings-channel-row,
  .settings-checkbox-grid {
    grid-template-columns: 1fr;
  }

  .billing-summary,
  .billing-plan,
  .billing-table-head,
  .billing-table-row {
    grid-template-columns: 1fr;
  }

  .billing-summary div {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    min-height: 64px;
    padding: var(--space-3) 0;
  }

  .billing-summary div:last-child {
    border-bottom: 0;
  }

  .billing-plan-form {
    grid-template-columns: 1fr;
  }

  .billing-plan-form .button-primary {
    min-height: 52px;
    width: 100%;
  }
}

/* JUDGMENT: .bc-stage retired — replaced by .bc-pane-transcript (above) in
   the three-pane shell. Keeping the legacy ERB selectors intact, only the
   SPA workspace was reshaped. */

#selected-moment {
  scroll-margin-top: 118px;
}

@keyframes bc-indeterminate {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(260%);
  }
}

/*
 * Tablet / smaller-desktop fallback. Below ~1100px we can't hold four
 * columns at the design heuristic widths — collapse to a single column
 * stack. Mobile order per design-concept: media sticky-top → transcript →
 * moments drawer → library. Command box would land at bottom; that section
 * is being built by a separate sub-agent.
 */

@media (max-width: 640px) {

  

  

  

  #selected-moment {
    scroll-margin-top: 166px;
  }

  

  

  

  

  

  

  

}

/* Speaker profile memory. */
.speaker-profile-page {
  display: grid;
  gap: var(--space-5);
  width: min(1120px, calc(100vw - 28px));
  margin: 0 auto;
  padding: var(--space-5) 0 var(--space-7);
}

.speaker-profile-back a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 4px 8px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.speaker-profile-back a:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.speaker-profile-hero {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: center;
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.speaker-profile-avatar,
.gf-speaker-profile-avatar {
  display: grid;
  overflow: hidden;
  place-items: center;
  color: var(--text);
  background: rgba(190, 205, 216, 0.07);
  border: 1px solid rgba(190, 205, 216, 0.22);
  border-radius: 100%;
  font-weight: 800;
}

.speaker-profile-avatar {
  width: 112px;
  height: 112px;
  font-size: 34px;
}

.speaker-profile-avatar img,
.gf-speaker-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.speaker-profile-heading {
  min-width: 0;
}

.speaker-profile-heading h1 {
  margin: 2px 0 6px;
  font-size: var(--text-3xl);
  line-height: var(--line-tight);
}

.speaker-profile-heading p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-ui);
}

.speaker-profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.speaker-profile-badges span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  color: var(--muted);
  border: 1px solid rgba(190, 205, 216, 0.18);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
}

.speaker-profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.speaker-profile-stat {
  display: grid;
  gap: var(--space-1);
  min-height: 86px;
  align-content: center;
  padding: var(--space-3);
  background: rgba(190, 205, 216, 0.035);
  border: 1px solid rgba(190, 205, 216, 0.14);
  border-radius: var(--radius-sm);
}

.speaker-profile-stat span {
  color: var(--subtle);
  font-size: var(--text-xs);
  text-transform: uppercase;
}

.speaker-profile-stat strong {
  color: var(--text);
  font-size: var(--text-xl);
  line-height: var(--line-tight);
}

.speaker-profile-recordings {
  display: grid;
  gap: var(--space-3);
}

.speaker-profile-recordings > header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: end;
  justify-content: space-between;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.speaker-profile-recordings h2 {
  margin: 2px 0 0;
  font-size: var(--text-xl);
}

.speaker-profile-recordings > header > span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.speaker-profile-recording-list {
  display: grid;
  gap: var(--space-2);
}

.speaker-profile-recording {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.6fr);
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid rgba(190, 205, 216, 0.13);
  border-radius: var(--radius-sm);
}

.speaker-profile-recording > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.speaker-profile-recording a {
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.speaker-profile-recording a:hover {
  color: var(--coral);
}

.speaker-profile-recording span {
  overflow: hidden;
  color: var(--subtle);
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speaker-profile-recording dl {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0;
}

.speaker-profile-recording dl div {
  min-width: 0;
}

.speaker-profile-recording dt {
  color: var(--subtle);
  font-size: var(--text-xs);
}

.speaker-profile-recording dd {
  margin: 1px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speaker-profile-empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Greenfield transcript-first workspace. This intentionally avoids the current
   three-pane workspace classes so the reset can evolve independently. */
.gf-workspace {
  width: min(1440px, calc(100vw - 28px));
  margin: 0 auto;
  padding: var(--space-4) 0 var(--space-6);
}

.gf-recording-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.gf-recording-header h1 {
  margin: 2px 0 4px;
  font-size: 26px;
  line-height: var(--line-tight);
}

.gf-recording-header p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-ui);
}

.gf-source-switcher {
  display: grid;
  gap: var(--space-1);
  max-height: 110px;
  overflow: auto;
}

.gf-source-switcher a {
  display: block;
  padding: 6px 9px;
  color: var(--muted);
  border-left: 2px solid transparent;
  font-size: var(--text-ui);
  line-height: var(--line-ui);
}

.gf-source-switcher a:hover,
.gf-source-switcher a.is-active {
  color: var(--text);
  border-left-color: var(--coral);
  background: rgba(242, 143, 132, 0.06);
}

.gf-editor {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
  gap: var(--space-4);
  align-items: start;
}

.gf-media-column {
  position: sticky;
  top: calc(56px + var(--space-3));
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.gf-viewer {
  margin: 0;
  background: #050505;
  border: 1px solid var(--border);
}

.gf-viewer video,
.gf-viewer audio {
  display: block;
  width: 100%;
  max-height: 32vh;
  background: #050505;
}

.gf-viewer video {
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.gf-missing-media,
.gf-empty,
.gf-empty-transcript {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: var(--space-5);
  color: var(--muted);
  border: 1px solid var(--border);
}

.gf-processing-transcript {
  gap: var(--space-2);
  justify-items: center;
  text-align: center;
}

.gf-processing-transcript h2 {
  margin: 0;
  font-size: var(--text-xl);
  line-height: var(--line-tight);
}

.gf-processing-transcript p {
  max-width: 460px;
  margin: 0;
}

.gf-processing-transcript progress {
  width: min(360px, 100%);
  height: 8px;
  margin-top: var(--space-2);
  overflow: hidden;
  border: 0;
  border-radius: 999px;
}

.gf-processing-transcript progress::-webkit-progress-bar {
  background: #080a09;
}

.gf-processing-transcript progress::-webkit-progress-value {
  background: var(--coral);
}

.gf-processing-transcript progress::-moz-progress-bar {
  background: var(--coral);
}

.gf-indeterminate-bar {
  position: relative;
  width: min(360px, 100%);
  height: 8px;
  margin-top: var(--space-2);
  overflow: hidden;
  background: #080a09;
  border-radius: 999px;
}

.gf-indeterminate-bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42%;
  background: var(--coral);
  border-radius: 999px;
  animation: bc-indeterminate 1.15s ease-in-out infinite;
}

.gf-active-moment {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  align-items: start;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.gf-active-moment h2 {
  max-width: 100%;
  margin: 2px 0 5px;
  font-size: var(--text-xl);
  line-height: var(--line-tight);
}

.gf-active-moment p {
  max-width: 100%;
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: var(--text-ui);
  line-height: var(--line-ui);
}

.gf-active-moment small {
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.gf-active-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-start;
}

.gf-active-actions form {
  margin: 0;
}

.gf-active-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.gf-active-moment-hint {
  margin: 0;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--subtle);
  font-size: var(--text-sm);
}

.gf-substrate-preview {
  margin: 0 0 var(--space-3) 0;
}

.projects-page {
  width: min(1440px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 0 0 var(--space-8);
  overflow-x: clip;
}

/* The two index shelves: "Your projects" / "Shared with you" */
.projects-shelf-heading {
  margin: var(--space-6) 0 var(--space-2);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.projects-shared-shelf {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.project-tabs {
  position: sticky;
  top: 40px;
  z-index: 40;
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: var(--space-3);
  overflow-x: auto;
  background: rgba(9, 10, 9, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  scrollbar-width: none;
}

.project-tabs::-webkit-scrollbar {
  display: none;
}

.project-tab {
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-4);
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font: inherit;
  font-size: var(--text-base);
  line-height: 1;
  cursor: pointer;
}

.project-tab:hover {
  color: var(--text);
  background: rgba(190, 205, 216, 0.035);
}

.project-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--coral);
}

.project-tab:focus-visible {
  outline: 1px solid var(--coral);
  outline-offset: -4px;
}

.tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-tabs ~ [role="tabpanel"][data-view] {
  margin-top: var(--space-4);
}

@media (max-width: 560px) {
  .app-page-header {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
    padding: var(--space-4) 0 var(--space-3);
  }

  .app-chrome {
    grid-template-columns: minmax(0, calc(100vw - 14px));
  }

  .app-page-title h1 {
    font-size: var(--text-3xl);
  }

  .app-page-meta {
    font-size: var(--text-base);
  }

  .app-page-actions {
    justify-content: flex-start;
    gap: 7px;
  }

  .app-page-header .app-page-actions {
    padding-top: 0;
  }

  .project-page-header .app-page-title {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-page-actions bitterclip-upload-link-share {
    max-width: 100%;
  }

  .projects-page {
    box-sizing: border-box;
    width: min(100%, calc(100vw - 14px));
    margin: 0 auto;
    padding: 0 0 var(--space-7);
  }

  .project-assistant-nudge {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    align-items: start;
  }

  .upload-ai-strip,
  .settings-ai-guide {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    align-items: start;
  }

  .project-assistant-nudge .button-secondary {
    width: 100%;
  }

  .upload-ai-strip .button-secondary,
  .settings-ai-guide .button-secondary {
    width: 100%;
  }

  .project-tabs {
    top: 40px;
  }

  .project-tab {
    min-height: 42px;
    padding: 0 var(--space-3);
  }
}

/* Phase 4A wrappers around Lit components in greenfield workspace. The
   bulk of the old gf-* class rules are now dead code (component shadow DOM
   owns its own styling) — deferred to Phase 8 dead-class sweep. */
.gf-recording-header--lit {
  align-items: center;
}

.gf-selected-moment-shell {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.gf-selected-moment-shell .button_to {
  margin: 0;
}

.gf-speaker-profiles-shell {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.gf-speaker-profiles-shell .gf-speaker-profiles-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.gf-speaker-profiles-shell .gf-speaker-profiles-header .eyebrow {
  margin: 0;
}

.gf-speaker-profiles-shell .gf-speaker-profiles-header span {
  font-size: var(--text-sm);
  color: var(--subtle);
}

.gf-substrate-preview::before {
  content: "MCP Apps substrate preview";
  display: block;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: var(--space-1);
}

.gf-speaker-profile-panel {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.gf-speaker-profile-panel > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-2);
}

.gf-speaker-profile-panel > header .eyebrow {
  margin-bottom: 1px;
}

.gf-speaker-profile-panel > header span {
  color: var(--subtle);
  font-size: var(--text-xs);
}

.gf-speaker-profile-card-list {
  display: grid;
  gap: var(--space-2);
}

.gf-speaker-profile-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--space-2);
  align-items: center;
  min-height: 62px;
  padding: 8px;
  color: var(--muted);
  border: 1px solid rgba(190, 205, 216, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(190, 205, 216, 0.025);
}

.gf-speaker-profile-card.is-linked:hover {
  color: var(--text);
  border-color: rgba(190, 205, 216, 0.28);
  background: rgba(190, 205, 216, 0.055);
}

.gf-speaker-profile-avatar {
  width: 42px;
  height: 42px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.gf-speaker-profile-card-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.gf-speaker-profile-card-topline {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.gf-speaker-profile-card-topline strong {
  overflow: hidden;
  color: var(--text);
  font-size: var(--text-ui);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gf-speaker-profile-card-topline span {
  flex: 0 0 auto;
  color: var(--subtle);
  font-size: var(--text-xs);
}

.gf-speaker-profile-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
  margin: 0;
}

.gf-speaker-profile-card dl div {
  min-width: 0;
}

.gf-speaker-profile-card dt {
  color: var(--subtle);
  font-size: 10px;
  line-height: var(--line-tight);
  text-transform: uppercase;
}

.gf-speaker-profile-card dd {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gf-speaker-profile-panel.is-compact .gf-speaker-profile-card {
  min-height: 54px;
}

.gf-moment-strip {
  display: grid;
  gap: var(--space-2);
  max-height: 28vh;
  margin: 0;
  padding-right: 4px;
  overflow: auto;
}

.gf-moment-strip-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.gf-moment-strip-link {
  display: grid;
  gap: var(--space-1);
  padding: 8px 10px;
  color: var(--muted);
}

.gf-moment-strip-item:hover,
.gf-moment-strip-item.is-active {
  color: var(--text);
  border-color: var(--coral);
  background: rgba(242, 143, 132, 0.06);
}

.gf-moment-strip-item:hover .gf-moment-strip-link,
.gf-moment-strip-item.is-active .gf-moment-strip-link {
  color: var(--text);
}

.gf-moment-strip-item form {
  margin: 0;
  padding-right: 8px;
}

.gf-moment-discard {
  padding: 3px 6px;
  color: var(--subtle);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.gf-moment-discard:hover {
  color: var(--coral);
  border-color: var(--coral);
}

.gf-moment-strip strong {
  font-size: var(--text-ui);
  line-height: var(--line-tight);
}

.gf-moment-strip span {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--subtle);
}

.gf-transcript {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.gf-transcript > header {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.gf-transcript h2 {
  margin: 3px 0 0;
  font-size: var(--text-xl);
  line-height: var(--line-tight);
}

.gf-speaker-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.gf-speaker-legend span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  color: var(--speaker-color, var(--text));
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--speaker-color) 38%, var(--border));
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.gf-score {
  display: grid;
  gap: var(--space-3);
}

.gf-candidate-overlay {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-2) 0 0;
  border-top: 1px solid rgba(190, 205, 216, 0.18);
  color: var(--muted);
}

.gf-candidate-review-drawer {
  color: var(--muted);
}

.gf-candidate-review-drawer > summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 28px;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--text-sm);
}

.gf-candidate-review-drawer > summary strong {
  color: var(--text);
}

.gf-candidate-review-drawer > summary span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid rgba(190, 205, 216, 0.14);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--text-xs);
}

.gf-candidate-review-drawer-body {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.gf-candidate-overlay-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  font-size: var(--text-sm);
}

.gf-candidate-overlay-summary strong {
  color: var(--text);
}

.gf-candidate-overlay-summary span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid rgba(190, 205, 216, 0.2);
  border-radius: var(--radius-sm);
}

.gf-candidate-overlay-summary span.is-primary {
  border-color: rgba(242, 143, 132, 0.42);
  color: var(--text);
}

.gf-candidate-history {
  color: var(--muted);
  font-size: var(--text-xs);
}

.gf-candidate-history > summary {
  width: max-content;
  cursor: pointer;
  color: var(--muted);
}

.gf-candidate-versions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.gf-candidate-version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(190, 205, 216, 0.18);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--text-xs);
  text-decoration: none;
}

.gf-candidate-version strong {
  color: var(--text);
  font-weight: 700;
}

.gf-candidate-version span {
  font-family: var(--font-mono);
}

.gf-candidate-version.is-active {
  border-color: rgba(190, 205, 216, 0.42);
  background: rgba(190, 205, 216, 0.08);
  color: var(--text);
}

.gf-transcript-version-selector {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.gf-transcript-version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid rgba(190, 205, 216, 0.18);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--text-xs);
  text-decoration: none;
}

.gf-transcript-version strong {
  color: var(--text);
  font-weight: 700;
}

.gf-transcript-version span {
  font-family: var(--font-mono);
}

.gf-transcript-version.is-active {
  border-color: rgba(127, 184, 148, 0.48);
  background: rgba(127, 184, 148, 0.08);
  color: var(--text);
}

.gf-candidate-review-queue {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1px solid rgba(190, 205, 216, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(190, 205, 216, 0.035);
}

.gf-candidate-review-queue-header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: space-between;
}

.gf-candidate-review-title,
.gf-candidate-promotion-gate {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.gf-candidate-review-queue-header strong {
  color: var(--text);
}

.gf-candidate-review-queue-header span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid rgba(190, 205, 216, 0.16);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--text-xs);
}

.gf-candidate-promotion-gate {
  justify-content: flex-end;
}

.gf-candidate-promotion-gate form {
  margin: 0;
}

.gf-candidate-promotion-gate .button-secondary {
  min-height: 30px;
  padding: 4px 8px;
  font-size: var(--text-xs);
}

.gf-candidate-review-queue-list {
  display: grid;
  max-height: 250px;
  overflow: auto;
  border-top: 1px solid rgba(190, 205, 216, 0.12);
}

.gf-candidate-review-queue-labels {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 64px minmax(156px, 1.05fr) minmax(112px, 0.75fr) minmax(220px, 1.7fr) 88px;
  gap: var(--space-2);
  align-items: center;
  min-height: 30px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(190, 205, 216, 0.12);
  background: rgb(8, 10, 9);
  color: var(--subtle);
  font-size: var(--text-xs);
}

.gf-candidate-review-queue-item {
  display: grid;
  grid-template-columns: 64px minmax(156px, 1.05fr) minmax(112px, 0.75fr) minmax(220px, 1.7fr) 88px;
  gap: var(--space-2);
  align-items: center;
  min-width: 0;
  min-height: 46px;
  padding: 6px 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(190, 205, 216, 0.08);
  border-radius: 0;
  font: inherit;
  font-size: var(--text-xs);
  text-align: left;
}

.gf-candidate-review-queue-item:hover,
.gf-candidate-review-queue-item.is-active,
.gf-candidate-review-queue-item:focus-within,
.gf-candidate-review-queue-item:focus-visible {
  color: var(--text);
  background: rgba(190, 205, 216, 0.07);
  outline: none;
}

.gf-candidate-review-queue-item strong {
  color: var(--text);
  font-weight: 650;
}

.gf-candidate-review-queue-labels span,
.gf-queue-play,
.gf-queue-speaker-select,
.gf-queue-state,
.gf-queue-reason,
.gf-candidate-review-queue-item time {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gf-queue-play {
  display: grid;
  gap: 1px;
  width: 100%;
  padding: 4px 6px;
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(190, 205, 216, 0.16);
  border-radius: var(--radius-sm);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gf-queue-play:hover,
.gf-queue-play:focus-visible {
  border-color: rgba(242, 143, 132, 0.54);
  color: var(--text);
  outline: none;
}

.gf-queue-play strong {
  color: var(--text);
  font-size: var(--text-xs);
}

.gf-queue-play time {
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.gf-queue-speaker-select {
  display: grid;
  grid-template-columns: max-content minmax(92px, 1fr);
  gap: 7px;
  align-items: center;
}

.gf-queue-speaker-select > span {
  color: var(--subtle);
  font-size: var(--text-xs);
}

.gf-queue-speaker-select select {
  min-width: 0;
  width: 100%;
  min-height: 30px;
  padding: 3px 7px;
  color: var(--text);
  background: rgba(8, 10, 9, 0.96);
  border: 1px solid rgba(190, 205, 216, 0.22);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--text-xs);
}

.gf-queue-speaker-select select:focus-visible {
  border-color: rgba(242, 143, 132, 0.72);
  outline: none;
}

.gf-queue-state,
.gf-queue-reason {
  display: grid;
  gap: 1px;
}

.gf-queue-state span,
.gf-queue-reason span {
  min-width: 0;
  overflow: hidden;
  color: var(--subtle);
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gf-candidate-review-queue-item.is-confirmed .gf-queue-speaker-select select {
  border-color: rgba(127, 184, 148, 0.5);
  color: var(--green);
}

.gf-candidate-review-queue-item.is-unresolved .gf-queue-state strong,
.gf-candidate-review-queue-item.is-needs-followup .gf-queue-state strong {
  color: var(--amber);
}

.gf-queue-resolve {
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  font-size: var(--text-xs);
}

.gf-candidate-overlay-error {
  margin: var(--space-2) 0 0;
  color: var(--coral);
  font-size: var(--text-sm);
}

.gf-score-row {
  display: grid;
  gap: var(--space-1);
  scroll-margin-top: 92px;
}

.gf-score-ruler {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.gf-score-ruler span {
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.gf-score-lane {
  position: relative;
  min-height: calc(82px + var(--lane-extra, 0px));
  padding: 7px 0 25px;
  border-top: 1px solid rgba(70, 80, 73, 0.42);
  border-bottom: 1px solid rgba(70, 80, 73, 0.24);
  cursor: crosshair;
}

.gf-score-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
  border-left: 2px solid rgba(242, 143, 132, 0.72);
  border-right: 2px solid rgba(242, 143, 132, 0.72);
  background: rgba(242, 143, 132, 0.035);
  box-shadow: inset 0 1px 0 rgba(242, 143, 132, 0.14), inset 0 -1px 0 rgba(242, 143, 132, 0.14);
  pointer-events: none;
}

.gf-score-selection::before,
.gf-score-selection::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 1px;
  background: rgba(242, 143, 132, 0.86);
}

.gf-score-selection::before {
  top: 0;
  left: -2px;
}

.gf-score-selection::after {
  right: -2px;
  bottom: 0;
}

.gf-candidate-island {
  position: absolute;
  top: 0;
  z-index: 3;
  min-width: 8px;
  height: 10px;
  padding: 0;
  border: 1px solid rgba(242, 143, 132, 0.48);
  border-radius: 2px;
  background: rgba(242, 143, 132, 0.13);
  box-shadow: inset 0 0 0 1px rgba(8, 9, 8, 0.34);
  cursor: help;
}

.gf-candidate-island::before,
.gf-candidate-island::after {
  content: "";
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 1px;
  background: rgba(242, 143, 132, 0.78);
}

.gf-candidate-island::before {
  left: 0;
}

.gf-candidate-island::after {
  right: 0;
}

.gf-candidate-island.is-plausible {
  border-color: rgba(221, 181, 102, 0.5);
  background: rgba(221, 181, 102, 0.12);
}

.gf-candidate-island.is-active,
.gf-candidate-island:focus-visible {
  border-color: rgba(190, 205, 216, 0.88);
  background: rgba(190, 205, 216, 0.16);
  outline: 2px solid rgba(190, 205, 216, 0.34);
  outline-offset: 2px;
}

.gf-draft-selection {
  position: absolute;
  top: 3px;
  bottom: 3px;
  z-index: 1;
  border: 1px dashed rgba(190, 205, 216, 0.82);
  background: rgba(154, 174, 188, 0.11);
  box-shadow: inset 0 0 0 1px rgba(8, 9, 8, 0.38);
  pointer-events: none;
}

.gf-selection-handle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  z-index: 5;
  width: 28px;
  cursor: ew-resize;
  pointer-events: auto;
  touch-action: none;
  transform: translateX(-50%);
}

.gf-selection-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 13px;
  width: 2px;
  background: rgba(224, 232, 236, 0.88);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(8, 9, 8, 0.72), 0 0 12px rgba(242, 143, 132, 0.12);
}

.gf-selection-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 28px;
  background:
    linear-gradient(90deg, transparent 4px, rgba(224, 232, 236, 0.42) 4px 5px, transparent 5px 7px, rgba(224, 232, 236, 0.42) 7px 8px, transparent 8px),
    rgba(9, 11, 11, 0.72);
  border: 1px solid rgba(224, 232, 236, 0.5);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px rgba(8, 9, 8, 0.42);
  transform: translate(-50%, -50%);
}

.gf-selection-handle:hover::before,
body.is-score-trimming .gf-selection-handle::before {
  background: rgba(242, 143, 132, 0.96);
}

.gf-selection-handle:hover::after,
body.is-score-trimming .gf-selection-handle::after {
  border-color: rgba(242, 143, 132, 0.72);
}

.gf-score-text {
  position: relative;
  z-index: 2;
  min-height: calc(48px + var(--lane-extra, 0px));
}

.gf-score-block {
  position: absolute;
  box-sizing: border-box;
  top: var(--lane-top, 0);
  left: var(--block-center, var(--block-left, 0%));
  display: block;
  z-index: 2;
  width: max-content;
  max-width: min(220px, 42%);
  padding: 1px 2px 2px;
  color: var(--speaker-color, var(--text));
  background: transparent;
  border-radius: 3px;
  font-size: var(--text-base);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.82);
  transform: translateX(-50%);
}

.gf-score-block.is-near-start {
  left: var(--block-left, 0%);
  transform: none;
}

.gf-score-block.is-near-end {
  left: calc(var(--block-left, 0%) + var(--block-width, 0%));
  transform: translateX(-100%);
}

.gf-score-block.is-selected {
  background: rgba(242, 143, 132, 0.08);
  outline: 1px solid rgba(242, 143, 132, 0.42);
  outline-offset: 2px;
}

.gf-score-waveform {
  position: absolute;
  right: 0;
  bottom: 5px;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1px;
  height: 18px;
  opacity: 0.34;
  pointer-events: none;
}

.gf-score-waveform::before {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  top: 50%;
  height: 1px;
  background: color-mix(in srgb, var(--muted) 28%, transparent);
}

.gf-score-cursor {
  position: absolute;
  top: 3px;
  bottom: 3px;
  z-index: 4;
  width: 1px;
  background: var(--text);
  box-shadow: 0 0 0 1px rgba(5, 5, 5, 0.44), 0 0 16px rgba(255, 154, 143, 0.34);
  opacity: 0.92;
  pointer-events: none;
  transform: translateX(-1px);
}

.gf-score-row.is-playing .gf-score-ruler {
  color: var(--muted);
}

.gf-score-row.is-selected .gf-score-waveform {
  opacity: 0.48;
}

.gf-score-waveform span {
  position: relative;
  z-index: 1;
  flex: 1 1 2px;
  min-width: 1px;
  height: 1px;
  background: color-mix(in srgb, var(--muted) 72%, var(--green));
  border-radius: 999px;
}

.gf-score-row.is-selected .gf-score-waveform span {
  background: color-mix(in srgb, var(--muted) 58%, var(--coral));
}

.gf-selection-toolbar {
  position: fixed;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px;
  background: rgba(9, 11, 11, 0.96);
  border: 1px solid rgba(190, 205, 216, 0.42);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.42);
}

.gf-selection-toolbar[hidden] {
  display: none;
}

.gf-selection-toolbar output {
  min-width: 54px;
  color: rgb(216, 226, 232);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

body.is-score-selecting {
  user-select: none;
}

body.is-score-trimming {
  cursor: ew-resize;
  user-select: none;
}

.gf-speaker-1 { --speaker-color: rgb(255, 167, 158); }
.gf-speaker-2 { --speaker-color: rgb(145, 211, 171); }
.gf-speaker-3 { --speaker-color: rgb(226, 179, 103); }
.gf-speaker-4 { --speaker-color: rgb(154, 185, 255); }
.gf-speaker-5 { --speaker-color: rgb(226, 148, 230); }
.gf-speaker-6 { --speaker-color: rgb(126, 218, 226); }
.gf-speaker-7 { --speaker-color: rgb(217, 204, 142); }
.gf-speaker-8 { --speaker-color: rgb(198, 164, 130); }
.gf-speaker-unknown { --speaker-color: rgb(143, 151, 147); }

.gf-transcript-body {
  display: grid;
  gap: var(--space-2);
}

.gf-transcript-gap {
  display: grid;
  align-items: center;
  min-height: var(--gap-height);
  margin-left: calc(112px + var(--space-4));
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.gf-transcript-gap span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0.68;
}

.gf-transcript-gap span::before,
.gf-transcript-gap span::after {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  background: var(--border);
}

.gf-transcript-unit {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-2) var(--space-3);
  scroll-margin-top: 110px;
  border-left: 3px solid transparent;
}

.gf-transcript-unit.is-selected {
  border-left-color: var(--coral);
  background: rgba(255, 154, 143, 0.1);
}

.gf-transcript-unit aside {
  display: grid;
  align-content: start;
  gap: 4px;
  color: var(--subtle);
  font-size: var(--text-sm);
}

.gf-transcript-unit aside span {
  color: var(--muted);
  font-weight: 700;
}

.gf-transcript-unit time {
  font-family: var(--font-mono);
}

.gf-transcript-line {
  display: grid;
  gap: 8px;
}

.gf-transcript-unit p {
  margin: 0;
  color: var(--text);
  font-size: var(--text-lg);
  line-height: var(--line-body);
}

.gf-waveform {
  display: flex;
  align-items: center;
  gap: 1px;
  height: 14px;
  width: 100%;
  max-width: 720px;
  padding: 3px 0;
  opacity: 0.58;
}

.gf-transcript-unit.is-selected .gf-waveform {
  opacity: 0.9;
}

.gf-waveform span {
  flex: 1 1 4px;
  min-width: 2px;
  height: max(2px, calc(var(--bar-height) * 0.12px));
  background: color-mix(in srgb, var(--muted) 72%, transparent);
  border-radius: 999px;
}

.gf-transcript-unit.is-selected .gf-waveform span {
  background: color-mix(in srgb, var(--coral) 76%, var(--text));
}

.gf-transcript-markdown {
  color: var(--text);
  font-size: var(--text-md);
  line-height: var(--line-body);
}

@media (max-width: 860px) {
  .speaker-profile-page {
    width: min(100vw - 24px, 100%);
  }

  .speaker-profile-hero,
  .speaker-profile-recording {
    grid-template-columns: 1fr;
  }

  .speaker-profile-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .speaker-profile-recording dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gf-workspace {
    width: min(100vw - 24px, 100%);
    padding-top: var(--space-4);
  }

  .gf-recording-header,
  .gf-active-moment,
  .gf-transcript-unit {
    grid-template-columns: 1fr;
  }

  .gf-editor {
    grid-template-columns: 1fr;
  }

  .gf-media-column {
    position: static;
  }

  .gf-viewer video,
  .gf-viewer audio {
    max-height: 42vh;
  }

  .gf-source-switcher {
    display: flex;
    max-height: none;
    overflow-x: auto;
  }

  .gf-source-switcher a {
    flex: 0 0 auto;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }

  .gf-source-switcher a:hover,
  .gf-source-switcher a.is-active {
    border-left-color: transparent;
    border-bottom-color: var(--coral);
  }

  .gf-active-actions {
    justify-content: flex-start;
  }

  .gf-transcript-unit {
    gap: var(--space-2);
    padding-inline: var(--space-3);
  }

  .gf-transcript-gap {
    margin-left: var(--space-3);
  }

  .gf-transcript-unit p {
    font-size: var(--text-md);
  }

  .gf-score-block {
    font-size: var(--text-base);
  }

  .gf-score-lane {
    min-height: calc(86px + var(--lane-extra, 0px));
  }

  .gf-candidate-review-queue-labels,
  .gf-candidate-review-queue-item {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .gf-candidate-review-queue-labels span:nth-child(n + 3),
  .gf-queue-state,
  .gf-queue-reason,
  .gf-queue-resolve {
    grid-column: 2;
  }

  .gf-queue-speaker-select {
    grid-template-columns: 1fr;
  }

  .reference-docs {
    padding: var(--space-6) var(--space-4);
  }

  .reference-grid,
  .operation-columns {
    grid-template-columns: 1fr;
  }
}
