@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/web/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
}

@font-face {
  font-family: "Inter Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url("/web/fonts/inter-latin-wght-italic.woff2") format("woff2-variations");
}

@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("/web/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2-variations");
}

@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url("/web/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2-variations");
}

:root {
  color-scheme: light;
  --background: #f2f2f6;
  --surface: #ffffff;
  --surface-muted: #f7f7fa;
  --surface-raised: rgba(255, 255, 255, 0.92);
  --menu-surface: #ffffff;
  --menu-subtle-surface: #f3f3f5;
  --reader-notes-input-surface: #ffffff;
  --reader-notes-active-text: #00636d;
  --text-primary: #0d0d0f;
  --text-secondary: #8f8f96;
  --text-tertiary: #b7b7bf;
  --destructive: #ff3b30;
  --pro-active-background: #66d9f2;
  --border: rgba(20, 20, 24, 0.105);
  --toolbar-active: rgba(20, 20, 24, 0.08);
  --toolbar-active-text: #111111;
  --select-highlight: rgba(20, 20, 24, 0.08);
  --search-detail-background: color-mix(in srgb, #8fc7ff 16%, var(--background));
  --project-detail-background: color-mix(in srgb, #8fd8a8 16%, var(--background));
  --research-conversation-background: color-mix(in srgb, var(--ios-accent-administrative) 10%, var(--background));
  --recently-viewed-reader-background: color-mix(in srgb, #8fc7ff 12%, var(--background));
  --ios-accent-building: #c96410;
  --ios-accent-fuel-gas: #c62828;
  --ios-accent-administrative: #7c3aed;
  --ios-accent-mechanical: #2f8f4e;
  --ios-accent-plumbing: #0891b2;
  --ios-accent-energy: #a15c00;
  --ios-accent-electrical: #4338ca;
  --ios-accent-existing-building: #a33a7c;
  --ios-accent-fire: #be123c;
  --ios-accent-historical: #7a5a2e;
  --ios-accent-housing: #2563a6;
  --ios-accent-environmental: #087f5b;
  --ios-accent-land-use: #6d28d9;
  --ios-accent-housing-buildings: #475569;
  --ios-accent-current-consolidation: #1d4ed8;
  --ios-accent-local-law: #9a3412;
  --accent-building: var(--ios-accent-building);
  --accent-general: var(--ios-accent-administrative);
  --accent-soft: rgba(201, 100, 16, 0.105);
  --code-accent: var(--ios-accent-building);
  --code-accent-soft: rgba(201, 100, 16, 0.105);
  --shadow-panel: 0 20px 54px rgba(27, 29, 34, 0.08);
  --radius-panel: 28px;
  --radius-card: 14px;
  --radius-control: 12px;
  --radius-pill: 999px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
  --card-stack-gap: var(--space-4);
  --header-height: 55px;
  --divider-width: 1px;
  --ui-font-family: "Inter Variable", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --source-font-family: "Source Serif 4 Variable", "Source Serif 4", Iowan Old Style, Georgia, serif;
  --chrome-font-family: var(--ui-font-family);
  --reader-font-family: var(--source-font-family);
  --reader-font-size: 16.5px;
  --reader-line-height: 1.6;
  --chrome-font-size: 11pt;
  --code-title-scale: 1;
  --chapter-picker-scale: 0.8;
  --section-label-scale: 1;
  --subsection-title-scale: 1.05;
  --body-text-scale: 1;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #000000;
    --surface: #000000;
    --surface-muted: #000000;
    --surface-raised: #000000;
    --menu-surface: #121213;
    --menu-subtle-surface: #121213;
    --reader-notes-input-surface: #3c3e40;
    --reader-notes-active-text: #91e8ef;
    --text-primary: #f6f4f1;
    --text-secondary: #a09fa7;
    --text-tertiary: #6f6f78;
    --destructive: #ff453a;
    --pro-active-background: #00b9e8;
    --border: rgba(255, 255, 255, 0.12);
    --toolbar-active: rgba(255, 255, 255, 0.12);
    --toolbar-active-text: #ffffff;
    --select-highlight: rgba(255, 255, 255, 0.16);
    --search-detail-background: color-mix(in srgb, #67b7ff 18%, var(--background));
    --project-detail-background: color-mix(in srgb, #6edc8c 18%, var(--background));
    --recently-viewed-reader-background: color-mix(in srgb, #67b7ff 14%, var(--background));
    --ios-accent-building: #ffb067;
    --ios-accent-fuel-gas: #ff7b7b;
    --ios-accent-administrative: #c4a1ff;
    --ios-accent-mechanical: #6edc8c;
    --ios-accent-plumbing: #67e8f9;
    --ios-accent-energy: #ffc857;
    --ios-accent-electrical: #9ca8ff;
    --ios-accent-existing-building: #ff8dcf;
    --ios-accent-fire: #fb7185;
    --ios-accent-historical: #d6b27a;
    --ios-accent-housing: #7cb7ff;
    --ios-accent-environmental: #5ee0b0;
    --ios-accent-land-use: #bfa3ff;
    --ios-accent-housing-buildings: #a9b6c8;
    --ios-accent-current-consolidation: #7da6ff;
    --ios-accent-local-law: #fb9b72;
    --accent-building: var(--ios-accent-building);
    --accent-general: var(--ios-accent-administrative);
    --accent-soft: rgba(255, 176, 103, 0.13);
    --code-accent: var(--ios-accent-building);
    --code-accent-soft: rgba(255, 176, 103, 0.13);
    --shadow-panel: 0 22px 70px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--background);
  color: var(--text-primary);
  font-size: var(--chrome-font-size);
  font-family: var(--ui-font-family);
  font-weight: 400;
}

@media (prefers-color-scheme: dark) {
  body {
    background: var(--background);
  }
}

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

button {
  cursor: pointer;
}

.web-warning-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: 22px 12px;
  background: rgba(24, 24, 28, 0.2);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.web-warning-backdrop.is-column-scoped {
  position: fixed;
  z-index: 20;
  padding: var(--panel-padding);
}

.has-web-warning {
  position: relative;
}

.web-warning-backdrop.is-column-scoped .web-warning-dialog {
  width: 100%;
  padding: clamp(24px, 7cqw, 40px);
}

.web-warning-dialog {
  width: min(550px, 100%);
  padding: 40px 40px 40px;
  overflow: hidden;
  border: 1px solid rgba(20, 20, 24, 0.08);
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--text-primary);
  box-shadow: 0 18px 44px rgba(20, 20, 24, 0.22);
}

.web-warning-dialog:focus {
  outline: 0;
}

.web-warning-title {
  margin: 0;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.web-warning-message {
  margin: 22px 0 12px;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
}

.web-warning-field {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
  text-transform: none;
}

.web-warning-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
}

.web-warning-field input:focus-visible {
  border-color: color-mix(in srgb, var(--code-accent) 58%, var(--border));
  outline: 2px solid color-mix(in srgb, var(--code-accent) 28%, transparent);
  outline-offset: 1px;
}

.web-warning-form-error {
  margin: 8px 0 0;
  color: #b42318;
  font-size: 13px;
  line-height: 1.4;
}

.web-warning-form-error[hidden] {
  display: none;
}

.web-warning-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.web-warning-button {
  min-width: 98px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.web-warning-cancel {
  border: 1px solid rgba(92, 92, 150, 0.14);
  background: var(--surface);
  color: var(--text-primary);
}

.web-warning-confirm {
  border: 1px solid #df6464;
  background: #df6464;
  color: #ffffff;
}

.web-warning-cancel:hover,
.web-warning-cancel:focus-visible {
  background: var(--surface-muted);
}

.web-warning-confirm:hover,
.web-warning-confirm:focus-visible {
  border-color: #d75757;
  background: #d75757;
}

.web-warning-button:focus-visible {
  outline: 2px solid color-mix(in srgb, #df6464 60%, transparent);
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  .web-warning-backdrop {
    background: rgba(0, 0, 0, 0.58);
  }

  .web-warning-dialog {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.58);
  }

  .web-warning-cancel {
    border-color: rgba(255, 255, 255, 0.16);
  }
}

@media (max-width: 420px) {
  .web-warning-dialog {
    padding: 32px 24px;
  }

  .web-warning-button {
    min-width: 92px;
  }
}

@container (max-width: 340px) {
  .web-warning-backdrop.is-column-scoped .web-warning-dialog {
    padding: 24px 16px;
  }

  .web-warning-backdrop.is-column-scoped .web-warning-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .web-warning-backdrop.is-column-scoped .web-warning-button {
    width: 100%;
  }
}

.command-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: start center;
  padding: min(15vh, 120px) var(--space-4) var(--space-4);
  background: rgba(0, 0, 0, 0.34);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.command-palette {
  display: grid;
  width: min(580px, 100%);
  max-height: min(70vh, 620px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-card) + 4px);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.command-palette-input {
  width: 100%;
  min-height: 56px;
  padding: 0 var(--space-4);
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 1.08);
}

.command-palette-list {
  display: grid;
  gap: 2px;
  padding: var(--space-2);
  overflow-y: auto;
}

.command-palette-item {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.command-palette-item.is-selected,
.command-palette-item:hover {
  background: var(--toolbar-active);
}

.command-palette-item strong {
  font-size: var(--chrome-font-size);
}

.command-palette-item span {
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.82);
}

button:focus-visible,
select:focus-visible,
input[type="range"]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--text-secondary) 46%, transparent);
  outline-offset: 3px;
}

input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible {
  outline: 0;
  outline-offset: 0;
}

.workspace-shell {
  display: grid;
  grid-template-rows: var(--header-height) minmax(0, 1fr);
  height: 100dvh;
  padding: 0;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 clamp(22px, 3vw, 46px);
  border-bottom: 1px solid var(--border);
  text-transform: none;
}

.topbar button,
.topbar input,
.topbar .connection-status,
.topbar .topbar-brand-plan {
  text-transform: none;
}

.workspace-issue {
  position: fixed;
  top: calc(var(--header-height) + var(--space-3));
  right: var(--space-4);
  z-index: 1200;
  display: grid;
  width: min(420px, calc(100vw - (2 * var(--space-4))));
  gap: var(--space-3);
  padding: var(--space-4);
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  color: var(--text-primary);
  box-shadow: var(--shadow-panel);
}

.workspace-issue[hidden] {
  display: none;
}

.workspace-issue-copy {
  margin: 0;
  font-size: calc(var(--chrome-font-size) * 0.9);
  line-height: 1.4;
}

.workspace-issue-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.workspace-issue-actions button {
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-primary) 9%, transparent);
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.82);
  font-weight: 700;
}

.workspace-issue-actions button:hover,
.workspace-issue-actions button:focus-visible {
  background: color-mix(in srgb, var(--text-primary) 15%, transparent);
}

.workspace-issue-actions button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--code-accent) 52%, transparent);
  outline-offset: 2px;
}

.topbar-brand {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-self: auto;
  gap: var(--space-2);
  pointer-events: none;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.topbar-account-state {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-self: end;
  gap: var(--space-3);
}

.connection-status {
  display: inline-flex;
  align-items: center;
  height: 30px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-primary) 7%, transparent);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.connection-status.is-offline {
  background: color-mix(in srgb, #b54708 14%, var(--surface));
  color: #9a3c06;
}

.connection-status.has-pending:not(.is-offline) {
  background: color-mix(in srgb, var(--code-accent) 13%, var(--surface));
  color: var(--code-accent);
}

.connection-status.is-actionable {
  cursor: pointer;
}

.connection-status.is-actionable:hover,
.connection-status.is-actionable:focus-visible {
  background: color-mix(in srgb, var(--code-accent) 19%, var(--surface));
  color: var(--code-accent);
}

.connection-status.is-actionable:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--code-accent) 52%, transparent);
  outline-offset: 2px;
}

.topbar-brand-name {
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 1.08);
  font-weight: 300;
  letter-spacing: -0.03em;
  text-transform: none;
}

.topbar-brand-plan {
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.78);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.mobile-more-button {
  display: none;
}

.mobile-more-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  align-items: end;
  background: rgb(0 0 0 / 48%);
}

.mobile-more-sheet {
  display: grid;
  max-height: min(78dvh, 680px);
  gap: var(--space-4);
  padding: var(--space-4) var(--space-4) max(var(--space-4), env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: 24px 24px 0 0;
  background: var(--menu-surface);
  color: var(--text-primary);
}

.mobile-more-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-more-sheet header strong,
.mobile-more-section-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-more-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  color: var(--text-primary);
  font-size: 20px;
}

.mobile-more-section {
  display: grid;
  gap: var(--space-2);
}

.mobile-more-section-label {
  margin: 0;
  color: var(--text-secondary);
}

.mobile-more-workspaces,
.mobile-more-actions {
  display: grid;
  gap: 6px;
}

.mobile-more-sheet .mobile-more-action {
  min-height: 48px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  color: var(--text-primary);
  font-weight: 650;
  text-align: left;
}

.mobile-more-sheet .mobile-more-action[aria-current="true"] {
  background: color-mix(in srgb, var(--code-accent) 20%, var(--surface));
}

.mobile-more-sheet .mobile-more-action.is-danger {
  color: #ff6b64;
}

.mobile-more-sheet .mobile-more-action:focus-visible,
.mobile-more-close:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--code-accent) 58%, transparent);
  outline-offset: 2px;
}

.topbar-actions::-webkit-scrollbar,
.workspace-tabs::-webkit-scrollbar {
  display: none;
}

.topbar-workspaces {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  min-width: 0;
  max-width: min(220px, 24vw);
  margin-left: auto;
}

.topbar-workspaces[hidden] {
  display: none;
}

.topbar-layout-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-2);
}

.workspace-tabs {
  display: flex;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  justify-content: flex-end;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  white-space: nowrap;
}

.workspace-tab,
.workspace-add-button,
.workspace-actions-button,
.workspace-name-input {
  min-height: 30px;
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  color: var(--text-secondary);
  font: inherit;
  font-size: calc(var(--chrome-font-size) * 0.86);
}

.workspace-tab {
  display: inline-flex;
  flex: 0 0 auto;
  max-width: 150px;
  align-items: center;
  padding: 0 11px;
  cursor: pointer;
  font-size: 12px;
}

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

.workspace-tab[aria-selected="true"] {
  background: color-mix(in srgb, var(--code-accent) 22%, var(--surface-raised));
  color: var(--text-primary);
  font-weight: 700;
}

.workspace-tab:hover,
.workspace-add-button:hover,
.workspace-actions-button:hover {
  background: color-mix(in srgb, var(--text-primary) 15%, transparent);
  color: var(--text-primary);
}

.workspace-add-button:focus-visible,
.workspace-actions-button:focus-visible,
.workspace-name-input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--code-accent) 58%, transparent);
  outline-offset: 2px;
}

.workspace-tab:focus-visible {
  outline: 0;
  outline-offset: 0;
  background: color-mix(in srgb, var(--text-primary) 15%, transparent);
  box-shadow: none;
}

.workspace-tab[aria-selected="true"]:focus-visible {
  background: color-mix(in srgb, var(--code-accent) 22%, var(--surface-raised));
}

.workspace-tab.is-dragging {
  opacity: 0.48;
}

.workspace-add-button,
.workspace-actions-button {
  height: 30px;
  display: inline-flex;
  width: auto;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.workspace-actions-button {
  max-width: 220px;
  gap: 7px;
}

.workspace-actions-button .workspace-current-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-actions-button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  transition: transform 140ms ease;
}

.workspace-actions-button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.topbar-settings-button {
  display: inline-flex;
  width: auto;
  height: 30px;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
}

.topbar-layout-actions .toolbar-button {
  height: 30px;
  min-height: 30px;
}

.topbar-settings-button:hover,
.topbar-settings-button:focus-visible {
  outline: 0;
  background: color-mix(in srgb, var(--text-primary) 15%, transparent);
  color: var(--text-primary);
}

.topbar-settings-button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--code-accent) 20%, transparent);
  color: var(--toolbar-active-text);
}

.workspace-name-input {
  width: 132px;
  min-width: 0;
  padding: 0 11px;
  background: color-mix(in srgb, var(--code-accent) 18%, var(--surface-raised));
  color: var(--text-primary);
}

.workspace-context-menu {
  position: fixed;
  z-index: 1800;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(260px, calc(100vw - 16px));
  padding: 8px;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--menu-surface);
  box-shadow: var(--shadow-panel);
}

.workspace-context-heading {
  padding: 8px 10px 6px;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-context-divider {
  height: 1px;
  margin: 6px 8px;
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
}

.workspace-context-menu button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.workspace-context-menu .workspace-context-switch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  overflow: hidden;
}

.workspace-context-switch > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-context-current {
  flex: 0 0 auto;
  color: var(--code-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace-context-switch[aria-checked="true"] {
  background: color-mix(in srgb, var(--code-accent) 16%, transparent);
}

.workspace-context-menu button:hover,
.workspace-context-menu button:focus-visible {
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
}

.workspace-context-menu button.is-danger {
  color: #d94a4a;
}

.workspace-context-menu button:disabled {
  opacity: 0.35;
}

.topbar h1 {
  margin: 0;
  font-size: var(--chrome-font-size) !important;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 var(--space-1);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-kind {
  color: #000;
}

@media (prefers-color-scheme: dark) {
  .panel-kind {
    color: #fff;
  }
}

.reader-code-picker {
  position: relative;
  display: block;
  width: var(--code-select-width, max-content);
  min-width: min(100%, 420px);
  max-width: 100%;
  margin: 0;
  font-size: calc(var(--chrome-font-size) * var(--code-title-scale)) !important;
}

.reader-panel .reader-code-picker {
  width: 100%;
  min-width: 0;
}

.reader-code-picker::after {
  content: none;
}

.reader-code-picker select {
  width: var(--code-select-width, fit-content);
  min-width: min(100%, 420px);
  min-height: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  color: var(--code-accent);
  font-size: calc(var(--chrome-font-size) * var(--code-title-scale)) !important;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: none;
  cursor: pointer;
  field-sizing: content;
}

.reader-code-picker select:focus,
.reader-code-picker select:focus-visible,
.selector-stack select:focus,
.selector-stack select:focus-visible {
  outline: 0;
}

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

.panel-track {
  display: flex;
  min-height: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
}

.workspace-empty-state {
  display: grid;
  flex: 1 0 100%;
  min-width: 100%;
  height: 100%;
  padding: var(--space-5);
  place-items: center;
  color: var(--text-secondary);
  text-align: center;
}

.workspace-empty-state p {
  max-width: 34rem;
  margin: 0;
  font-size: calc(var(--chrome-font-size) * 0.94);
}

.workspace-switch-placeholder {
  align-content: start;
  color: var(--text-secondary);
}

.workspace-switch-placeholder-header {
  color: var(--text-primary);
  font-size: var(--chrome-font-size);
  font-weight: 700;
}

.workspace-switch-placeholder-status {
  align-self: center;
  justify-self: center;
  font-size: calc(var(--chrome-font-size) * 0.94);
}

.panel-track.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.panel-track.is-resizing .pane-divider {
  cursor: col-resize;
}

.panel-track.is-resizing .workspace-panel {
  pointer-events: none;
  transition: none;
}

.workspace-panel {
  --code-accent: #c96410;
  --code-accent-soft: rgba(201, 100, 16, 0.105);
  --pane-min-width: clamp(260px, 22vw, 420px);
  --pane-resized-min-width: var(--pane-min-width);
  --pane-default-min-width: 0px;
  --panel-padding: clamp(16px, 1.8vw, 24px);
  --panel-title-row-height: calc(var(--chrome-font-size) * var(--code-title-scale) * 1.2);
  --panel-title-control-size: var(--panel-title-row-height);
  --panel-title-icon-size: calc(var(--panel-title-row-height) - 2px);
  --panel-control-row-top: calc(var(--panel-padding) + var(--panel-title-row-height) + var(--space-2));
  container-type: inline-size;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1 1 0;
  min-width: max(var(--pane-default-min-width), min(var(--pane-min-width), var(--pane-resized-min-width)));
  min-height: 0;
  height: 100%;
  max-height: none;
  padding: var(--panel-padding);
  overflow: hidden;
  border: 1px solid var(--border);
  border-top: 0;
  border-bottom: 0;
  border-radius: 0;
  background: var(--surface-raised);
  box-shadow: none;
  transition: transform 260ms cubic-bezier(0.2, 0, 0, 1), opacity 180ms ease;
}

.workboard-panel {
  --pane-min-width: min(420px, 82vw);
  --project-pane-band-height: calc(var(--panel-padding) + var(--panel-title-row-height) + var(--space-3));
  --project-pane-band-background: color-mix(in srgb, var(--project-color) 42%, var(--surface));
  position: relative;
  grid-template-rows: minmax(0, 1fr);
  padding: 0;
  background: var(--surface-raised);
}

.workboard-panel > .project-tool-pane-drag-handle {
  position: absolute;
  z-index: 20;
  top: calc(var(--panel-padding) + 1px);
  right: calc(var(--panel-padding) + (var(--panel-title-control-size) * 2) + var(--space-2));
}

.workboard-root {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

body.is-detached-workboard-window .workspace-shell {
  grid-template-rows: minmax(0, 1fr);
}

body.is-detached-workboard-window .topbar {
  display: none;
}

body.is-detached-workboard-window .panel-track {
  width: 100%;
  overflow: hidden;
}

body.is-detached-workboard-window .workboard-panel {
  --pane-min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

body.is-detached-workboard-window .project-tool-pane-drag-handle {
  display: none;
}

body.is-detached-workboard-window .detached-workboard-error {
  display: grid;
  place-content: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 32px;
  text-align: center;
}

body.is-detached-workboard-window .detached-workboard-error h1,
body.is-detached-workboard-window .detached-workboard-error p {
  margin: 0;
}

.workspace-panel.is-dragging {
  opacity: 0.82;
}

.workspace-panel.is-drop-before,
.workspace-panel.is-drop-after {
  position: relative;
}

.workspace-panel.is-drop-before::before,
.workspace-panel.is-drop-after::after {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 5;
  width: 2px;
  content: "";
  background: var(--text-secondary);
}

.workspace-panel.is-drop-before::before {
  left: 0;
}

.workspace-panel.is-drop-after::after {
  right: 0;
}

.code-theme-building {
  --code-accent: var(--ios-accent-building);
  --code-accent-soft: rgba(201, 100, 16, 0.105);
}

.code-theme-administrative {
  --code-accent: var(--ios-accent-administrative);
  --code-accent-soft: rgba(124, 58, 237, 0.12);
}

.code-theme-plumbing {
  --code-accent: var(--ios-accent-plumbing);
  --code-accent-soft: rgba(8, 145, 178, 0.12);
}

.code-theme-mechanical {
  --code-accent: var(--ios-accent-mechanical);
  --code-accent-soft: rgba(47, 143, 78, 0.12);
}

.code-theme-fuel-gas {
  --code-accent: var(--ios-accent-fuel-gas);
  --code-accent-soft: rgba(198, 40, 40, 0.12);
}

.code-theme-zoning {
  --code-accent: #2f6f68;
  --code-accent-soft: rgba(47, 111, 104, 0.13);
}

.code-theme-energy {
  --code-accent: var(--ios-accent-energy);
  --code-accent-soft: rgba(161, 92, 0, 0.12);
}

.code-theme-electrical {
  --code-accent: var(--ios-accent-electrical);
  --code-accent-soft: rgba(67, 56, 202, 0.12);
}

.code-theme-existing-building {
  --code-accent: var(--ios-accent-existing-building);
  --code-accent-soft: rgba(163, 58, 124, 0.12);
}

.code-theme-fire {
  --code-accent: var(--ios-accent-fire);
  --code-accent-soft: rgba(190, 18, 60, 0.12);
}

.code-theme-historical {
  --code-accent: var(--ios-accent-historical);
  --code-accent-soft: rgba(122, 90, 46, 0.12);
}

.code-theme-housing {
  --code-accent: var(--ios-accent-housing);
  --code-accent-soft: rgba(37, 99, 166, 0.12);
}

.code-theme-environmental {
  --code-accent: var(--ios-accent-environmental);
  --code-accent-soft: rgba(8, 127, 91, 0.12);
}

.code-theme-land-use {
  --code-accent: var(--ios-accent-land-use);
  --code-accent-soft: rgba(109, 40, 217, 0.12);
}

.code-theme-housing-buildings {
  --code-accent: var(--ios-accent-housing-buildings);
  --code-accent-soft: rgba(71, 85, 105, 0.12);
}

.code-theme-current-consolidation {
  --code-accent: var(--ios-accent-current-consolidation);
  --code-accent-soft: rgba(29, 78, 216, 0.12);
}

.code-theme-local-law {
  --code-accent: var(--ios-accent-local-law);
  --code-accent-soft: rgba(154, 52, 18, 0.12);
}

@media (prefers-color-scheme: dark) {
  .workspace-panel,
  .code-theme-building {
    --code-accent: var(--ios-accent-building);
    --code-accent-soft: rgba(255, 176, 103, 0.13);
  }

  .code-theme-administrative {
    --code-accent: var(--ios-accent-administrative);
    --code-accent-soft: rgba(196, 161, 255, 0.15);
  }

  .code-theme-plumbing {
    --code-accent: var(--ios-accent-plumbing);
    --code-accent-soft: rgba(103, 232, 249, 0.15);
  }

  .code-theme-mechanical {
    --code-accent: var(--ios-accent-mechanical);
    --code-accent-soft: rgba(110, 220, 140, 0.15);
  }

  .code-theme-fuel-gas {
    --code-accent: var(--ios-accent-fuel-gas);
    --code-accent-soft: rgba(255, 123, 123, 0.15);
  }

  .code-theme-zoning {
    --code-accent: #70c9bd;
    --code-accent-soft: rgba(112, 201, 189, 0.16);
  }

  .code-theme-energy {
    --code-accent: var(--ios-accent-energy);
    --code-accent-soft: color-mix(in srgb, var(--code-accent) 16%, transparent);
  }

  .code-theme-electrical {
    --code-accent: var(--ios-accent-electrical);
    --code-accent-soft: color-mix(in srgb, var(--code-accent) 16%, transparent);
  }

  .code-theme-existing-building {
    --code-accent: var(--ios-accent-existing-building);
    --code-accent-soft: color-mix(in srgb, var(--code-accent) 16%, transparent);
  }

  .code-theme-fire {
    --code-accent: var(--ios-accent-fire);
    --code-accent-soft: color-mix(in srgb, var(--code-accent) 16%, transparent);
  }

  .code-theme-historical {
    --code-accent: var(--ios-accent-historical);
    --code-accent-soft: color-mix(in srgb, var(--code-accent) 16%, transparent);
  }

  .code-theme-housing {
    --code-accent: var(--ios-accent-housing);
    --code-accent-soft: color-mix(in srgb, var(--code-accent) 16%, transparent);
  }

  .code-theme-environmental {
    --code-accent: var(--ios-accent-environmental);
    --code-accent-soft: color-mix(in srgb, var(--code-accent) 16%, transparent);
  }

  .code-theme-land-use {
    --code-accent: var(--ios-accent-land-use);
    --code-accent-soft: color-mix(in srgb, var(--code-accent) 16%, transparent);
  }

  .code-theme-housing-buildings {
    --code-accent: var(--ios-accent-housing-buildings);
    --code-accent-soft: color-mix(in srgb, var(--code-accent) 16%, transparent);
  }

  .code-theme-current-consolidation {
    --code-accent: var(--ios-accent-current-consolidation);
    --code-accent-soft: color-mix(in srgb, var(--code-accent) 16%, transparent);
  }

  .code-theme-local-law {
    --code-accent: var(--ios-accent-local-law);
    --code-accent-soft: color-mix(in srgb, var(--code-accent) 16%, transparent);
  }
}

.reader-panel {
  --pane-min-width: clamp(380px, 30vw, 560px);
  --reader-header-overlay-height: calc(var(--panel-control-row-top) + 40px);
  --reader-scrollbar-rail-width: 0px;
  --reader-scrollbar-track-top: calc(var(--reader-header-overlay-height) + var(--panel-padding));
  --reader-internal-search-height: 42px;
  position: relative;
  grid-template-rows: minmax(0, 1fr);
}

.reader-panel::before {
  position: absolute;
  top: 0;
  right: calc(var(--panel-padding) + var(--reader-scrollbar-rail-width));
  left: 0;
  z-index: 6;
  height: calc(var(--reader-header-overlay-height) + var(--panel-padding));
  content: "";
  pointer-events: none;
  background: var(--surface);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.reader-panel.has-open-reader-menu::after {
  position: absolute;
  inset: 0;
  z-index: 20;
  content: "";
  pointer-events: none;
  background: rgb(0 0 0 / 16%);
}

.search-panel,
.utility-panel,
.settings-panel {
  --pane-min-width: clamp(280px, 22vw, 360px);
}

.settings-panel,
.analysis-panel {
  --pane-min-width: clamp(300px, 24vw, 380px);
}

.section-detail-panel,
.project-detail-panel {
  --pane-min-width: clamp(300px, 24vw, 380px);
}

.pane-divider {
  position: relative;
  flex: 0 0 var(--divider-width);
  margin: 0;
  min-height: 0;
  z-index: 12;
  cursor: col-resize;
  touch-action: none;
  background: var(--border);
}

.pane-divider::before {
  content: none;
}

.pane-divider::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 14px;
  content: "";
  transform: translateX(-50%);
  background: transparent;
  transition: opacity 140ms ease;
}

.pane-divider:focus-visible {
  outline: none;
}

.pane-divider:hover::after,
.pane-divider:focus-visible::after {
  background: transparent;
}

.pane-edge-resizer {
  z-index: 13;
}

.panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-4);
  min-width: 0;
  min-height: var(--panel-title-row-height);
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.reader-panel .panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-2);
  position: absolute;
  top: var(--panel-padding);
  right: var(--panel-padding);
  left: var(--panel-padding);
  z-index: 8;
  min-height: var(--panel-title-row-height);
  margin-bottom: 0;
  padding-bottom: 0;
  overflow: visible;
  background: transparent;
}

.reader-panel .panel-header:has(.reader-trust[open]) {
  z-index: 11;
}

.reader-to-top {
  position: absolute;
  right: var(--panel-padding);
  bottom: calc(var(--panel-padding) + var(--space-3));
  z-index: 9;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-raised) 86%, var(--code-accent) 14%);
  color: var(--code-accent);
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  pointer-events: none;
  transform: translateY(8px);
  box-shadow: 0 8px 24px color-mix(in srgb, #000 22%, transparent);
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 220ms;
}

.reader-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.reader-to-top svg {
  width: 20px;
  height: 20px;
}

.reader-to-top:hover {
  background: color-mix(in srgb, var(--surface-raised) 74%, var(--code-accent) 26%);
}

.reader-to-top:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--code-accent) 72%, transparent);
  outline-offset: 2px;
}

.reader-panel .panel-header > div:first-child {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.panel-header > div:first-child {
  min-width: 0;
}

.panel-title {
  display: none !important;
  max-width: 100%;
  margin: 0;
  font-size: clamp(1.65rem, 2.1vw, 2.35rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.reader-panel .panel-title {
  display: none !important;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.panel-actions {
  display: flex;
  align-items: start;
  flex: 0 0 auto;
  gap: var(--space-2);
  min-width: 0;
  transform: none;
}

.panel-actions .pane-drag-handle {
  order: 99;
}

.reader-panel .panel-actions {
  align-items: center;
  justify-content: end;
  gap: var(--space-2);
  min-width: 0;
  position: relative;
  z-index: 2;
}

.reader-panel.is-recently-viewed-linked-reader {
  background: var(--recently-viewed-reader-background);
}

.reader-panel.is-recently-viewed-linked-reader::before {
  right: 0;
  background: var(--recently-viewed-reader-background);
}

.reader-panel.is-recently-viewed-linked-reader .reader-typography-menu,
.reader-panel.is-recently-viewed-linked-reader .reader-internal-search-toggle,
.reader-panel.is-recently-viewed-linked-reader .pane-drag-handle {
  display: none;
}

.reader-typography-menu,
.reader-typography-tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.reader-typography-tools[hidden] {
  display: none;
}

.reader-typography-toggle {
  display: grid;
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  flex: 0 0 var(--panel-title-control-size);
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.reader-typography-toggle:hover,
.reader-typography-toggle:focus-visible {
  color: var(--text-primary);
}

.reader-typography-toggle svg {
  width: 16px;
  height: 16px;
}

.reader-typography-collapse-icon,
.reader-typography-toggle[aria-expanded="true"] .reader-typography-expand-icon {
  display: none;
}

.reader-typography-toggle[aria-expanded="true"] .reader-typography-collapse-icon {
  display: block;
}

.reader-text-size-controls,
.reader-spacing-controls {
  display: grid;
  grid-template-columns: repeat(2, var(--panel-title-control-size));
  align-items: center;
  gap: var(--space-2);
  height: var(--panel-title-control-size);
}

.reader-text-size-button,
.reader-spacing-button {
  display: grid;
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  place-items: center;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--ui-font-family);
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
  font-weight: 600;
  line-height: 1;
}

.reader-spacing-button svg {
  width: 14px;
  height: 14px;
}

.reader-text-size-button:hover,
.reader-text-size-button:focus-visible,
.reader-spacing-button:hover,
.reader-spacing-button:focus-visible {
  color: var(--text-primary);
}

.reader-text-size-button:disabled,
.reader-spacing-button:disabled {
  color: var(--text-tertiary);
  opacity: 0.42;
}

.icon-button,
.ghost-button,
.toolbar-button {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  font-size: 1.35rem;
  line-height: 1;
}

.topbar .icon-button {
  width: auto;
  height: auto;
  min-height: 0;
  border-color: transparent;
  background: transparent;
  color: var(--text-primary);
  box-shadow: none;
}

.toolbar-button {
  min-height: 42px;
  padding: 0 16px;
}

.topbar .toolbar-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
  color: var(--text-primary);
  font-size: 14px !important;
  font-weight: 400;
  box-shadow: none;
}

.topbar-actions > .toolbar-button {
  width: 88px;
  flex: 0 0 88px;
  justify-content: center;
}

.topbar .toolbar-button > svg,
.topbar .mobile-more-button > svg {
  display: none;
}

.topbar .toolbar-button:hover {
  background: color-mix(in srgb, var(--text-primary) 16%, transparent);
}

.topbar .toolbar-button:disabled,
.workspace-add-button:disabled,
.workspace-actions-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.topbar .toolbar-button:disabled:hover,
.workspace-add-button:disabled:hover,
.workspace-actions-button:disabled:hover {
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
}

.topbar .toolbar-button:focus-visible {
  outline: 0;
  outline-offset: 0;
  background: color-mix(in srgb, var(--text-primary) 16%, transparent);
  box-shadow: none;
  text-decoration: none;
}

.topbar .toolbar-button[aria-pressed="true"],
.topbar #add-reader.has-open-reader {
  background: color-mix(in srgb, var(--code-accent) 20%, transparent);
  color: var(--toolbar-active-text);
}

.topbar .icon-button[aria-pressed="true"] {
  border-color: transparent;
  background: transparent;
  color: var(--toolbar-active-text);
}

.ghost-button {
  min-height: 40px;
  padding: 0 15px;
  color: var(--text-primary);
}

.reader-close[hidden] {
  display: none;
}

.reader-close,
.reader-internal-search-toggle,
.utility-close,
.pane-drag-handle {
  display: grid;
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  place-items: center;
  padding: 0;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  line-height: 1;
}

.reader-close,
.pane-drag-handle,
.utility-close,
.reader-internal-search-toggle {
  color: var(--text-secondary);
}

.reader-close:hover,
.reader-close:focus-visible,
.utility-close:hover,
.utility-close:focus-visible,
.pane-drag-handle:hover,
.pane-drag-handle:focus-visible,
.reader-internal-search-toggle[aria-pressed="true"] {
  color: var(--text-primary);
}

.reader-internal-search-toggle svg {
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.reader-close svg,
.utility-close svg,
.pane-drag-handle svg {
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.projects-panel .projects-archive-button,
.projects-panel .projects-add-button,
.projects-panel .projects-select-button,
.archive-panel .projects-select-button,
.archive-panel .archive-close-button,
.saved-panel .saved-select-button {
  display: grid;
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  place-items: center;
  padding: 0;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

.projects-panel .projects-archive-button:hover,
.projects-panel .projects-archive-button:focus-visible,
.projects-panel .projects-archive-button[aria-pressed="true"],
.projects-panel .projects-add-button:hover,
.projects-panel .projects-add-button:focus-visible,
.projects-panel .projects-select-button:hover,
.projects-panel .projects-select-button:focus-visible,
.projects-panel .projects-select-button[aria-pressed="true"],
.archive-panel .projects-select-button:hover,
.archive-panel .projects-select-button:focus-visible,
.archive-panel .projects-select-button[aria-pressed="true"],
.archive-panel .archive-close-button:hover,
.archive-panel .archive-close-button:focus-visible,
.saved-panel .saved-select-button:hover,
.saved-panel .saved-select-button:focus-visible,
.saved-panel .saved-select-button[aria-pressed="true"] {
  border-color: transparent;
  background: transparent;
  color: var(--text-primary);
  box-shadow: none;
  outline: 0;
}

.projects-panel .projects-archive-button svg,
.projects-panel .projects-add-button svg,
.projects-panel .projects-select-button svg,
.archive-panel .projects-select-button svg,
.archive-panel .archive-close-button svg,
.saved-panel .saved-select-button svg {
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.projects-panel .projects-archive-button svg {
  transform: scale(0.88);
}

.projects-add-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.pane-drag-handle {
  display: grid;
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  place-items: center;
  padding: 0;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: grab;
  box-shadow: none;
}

.pane-drag-handle:active {
  cursor: grabbing;
}

.pane-drag-handle svg {
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.selector-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: 0 0 var(--space-2);
  border: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
}

.reader-panel .selector-stack {
  position: absolute;
  top: var(--panel-control-row-top);
  right: var(--panel-padding);
  left: var(--panel-padding);
  z-index: 8;
  margin-bottom: 0;
}

.reader-code-heading {
  position: relative;
  z-index: 30;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-2);
}

.reader-code-heading .reader-code-picker {
  flex: 0 1 auto;
  width: max-content;
  min-width: 0;
  max-width: calc(100% - var(--panel-title-control-size) - var(--space-2));
}

.reader-code-heading .reader-code-picker .custom-select,
.reader-code-heading .reader-code-picker .custom-select-trigger {
  width: max-content;
  max-width: 100%;
}

.reader-trust {
  position: static;
  flex: 0 0 var(--panel-title-control-size);
  color: var(--text-primary);
  font-family: var(--chrome-font-family);
}

.reader-trust[hidden] {
  display: none;
}

.reader-trust summary {
  position: relative;
  display: grid;
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
}

.reader-trust summary::-webkit-details-marker {
  display: none;
}

.reader-trust summary:hover,
.reader-trust summary:focus-visible,
.reader-trust[open] summary {
  color: var(--code-accent);
}

.reader-trust summary svg {
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.reader-trust-details {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: auto;
  left: 0;
  z-index: 31;
  width: min(360px, 100%);
  max-height: min(440px, calc(100vh - 96px));
  overflow: auto;
  padding: var(--space-4);
  border: 0;
  border-radius: var(--radius-tile);
  background: color-mix(in srgb, var(--surface-raised) 94%, var(--code-accent));
  box-shadow: none;
}

.reader-trust-state {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid color-mix(in srgb, var(--code-accent) 22%, transparent);
}

.reader-trust-status {
  font-size: calc(var(--chrome-font-size) * 0.78);
  font-weight: 680;
}

.reader-trust-currency {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.72);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-trust-details dl {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.reader-trust-details dl > div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: var(--space-2);
}

.reader-trust-details dl > div[hidden] {
  display: none;
}

.reader-trust-details dt {
  color: var(--text-tertiary);
  font-size: calc(var(--chrome-font-size) * 0.7);
  font-weight: 650;
  text-transform: uppercase;
}

.reader-trust-details dd,
.reader-trust-boundary {
  margin: 0;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.76);
  line-height: 1.38;
}

.reader-trust-boundary {
  margin-top: var(--space-3);
}

.reader-trust-source {
  display: inline-flex;
  margin-top: var(--space-2);
  color: var(--code-accent);
  font-size: calc(var(--chrome-font-size) * 0.76);
  font-weight: 650;
  text-decoration: none;
}

.reader-trust-source:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--code-accent) 66%, transparent);
  outline-offset: 3px;
}

.reader-internal-search.search-box {
  position: absolute;
  top: var(--reader-scrollbar-track-top);
  right: calc(var(--panel-padding) + var(--reader-scrollbar-rail-width));
  left: var(--panel-padding);
  z-index: 9;
  width: auto;
  max-width: none;
  margin: 0;
  border-radius: var(--radius-pill);
}

.reader-internal-search[hidden] {
  display: none;
}

.reader-internal-search-input:focus,
.reader-internal-search-input:focus-visible {
  outline: 0;
}

.selector-stack[hidden] {
  display: none;
}

.selector-stack label[hidden] {
  display: none;
}

label {
  display: grid;
  gap: 0;
  color: var(--text-secondary);
  font-size: 0;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.selector-stack label {
  font-size: 0 !important;
  line-height: 0;
}

.selector-stack select {
  min-height: auto;
  padding: 0;
  border-color: transparent;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  font-size: calc(var(--chrome-font-size) * var(--chapter-picker-scale)) !important;
  line-height: 1.1;
  box-shadow: none;
}

.native-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.custom-select {
  position: relative;
  min-width: 0;
  width: 100%;
  color: var(--text-primary);
  font-family: var(--ui-font-family);
  font-size: var(--chrome-font-size) !important;
  line-height: 1.1;
}

.selector-stack .custom-select {
  font-size: calc(var(--chrome-font-size) * var(--chapter-picker-scale)) !important;
}

.reader-code-picker .custom-select {
  width: var(--code-select-width, 420px);
  min-width: 0;
  max-width: 100%;
  font-size: calc(var(--chrome-font-size) * var(--code-title-scale)) !important;
}

.reader-panel .reader-code-picker .custom-select {
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  min-height: 1.2em;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--chrome-font-size) !important;
  font-weight: 400;
  line-height: inherit;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  box-shadow: none;
}

.custom-select-trigger:focus,
.custom-select-trigger:focus-visible {
  outline: 0;
}

.custom-select-trigger.is-static {
  cursor: default;
}

.reader-code-picker .custom-select-trigger {
  color: var(--code-accent);
  font-size: calc(var(--chrome-font-size) * var(--code-title-scale)) !important;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reader-panel .custom-select,
.reader-panel .custom-select-trigger {
  max-width: 100%;
}

.custom-select-menu {
  position: fixed;
  top: var(--select-menu-top, 0);
  left: var(--select-menu-left, 0);
  z-index: 1000;
  width: var(--select-menu-width, 100%);
  max-width: calc(100vw - 16px);
  max-height: var(--select-menu-max-height, calc(100vh - 16px));
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--menu-surface);
  color: var(--text-primary);
  box-shadow: none;
}

.custom-select-menu[hidden] {
  display: none;
}

.reader-code-select-menu,
.reader-chapter-select-menu,
.report-draft-select-menu,
.research-project-select-menu {
  box-sizing: border-box;
  padding: clamp(14px, 2vw, 20px);
  border-radius: clamp(22px, 4vw, 30px);
  background: var(--menu-surface);
  box-shadow: none;
}

.research-feedback-role-select-menu {
  box-sizing: border-box;
  padding: clamp(14px, 2vw, 20px);
  border-radius: clamp(22px, 4vw, 30px);
  background: var(--menu-surface);
  box-shadow: none;
}

.research-feedback-role-custom-select,
.research-feedback-role-custom-select .custom-select-trigger {
  width: 100%;
}

.research-feedback-role-custom-select .custom-select-trigger {
  justify-content: space-between;
  min-height: 38px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--text-primary) 7%, transparent);
  color: var(--text-primary);
  box-shadow: none;
  text-align: left;
}

.research-feedback-role-custom-select .custom-select-trigger::after {
  content: "⌄";
  color: var(--text-secondary);
  font-weight: 400;
}

.research-feedback-role-select-menu .custom-select-option {
  width: 100%;
  min-height: 34px;
  padding: 6px var(--space-2);
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
  text-align: left;
}

.research-feedback-role-select-menu .custom-select-option:hover,
.research-feedback-role-select-menu .custom-select-option:focus-visible,
.research-feedback-role-select-menu .custom-select-option[aria-selected="true"] {
  background: color-mix(in srgb, var(--code-accent) 12%, transparent);
  color: var(--text-primary);
}

.research-project-custom-select {
  flex: 0 1 auto;
  width: max-content;
  max-width: min(260px, 48vw);
}

.research-project-custom-select .custom-select-trigger {
  width: max-content;
  max-width: 100%;
  min-height: 28px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--project-color, var(--text-tertiary)) 42%, var(--surface));
  color: var(--text-primary);
  font-size: 10px !important;
  text-align: right;
}

.research-project-select-menu .custom-select-option {
  min-height: 30px;
  padding: 5px var(--space-2);
  border-radius: var(--radius-control);
  color: var(--text-secondary);
  line-height: 1.25;
}

.research-project-select-menu .custom-select-option[aria-selected="true"] {
  background: color-mix(in srgb, var(--project-color, var(--text-tertiary)) 14%, transparent);
  color: var(--text-primary);
  font-weight: 650;
}

.report-draft-picker .custom-select {
  flex: 0 0 auto;
  width: 24px;
  min-height: 28px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.report-draft-picker .custom-select-trigger {
  min-width: 24px;
  min-height: 28px;
  padding: 0;
  font-weight: 400;
}

.report-draft-picker .custom-select-trigger.is-icon-only {
  justify-content: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.report-title-control {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  padding: 5px 7px 5px 11px;
  border-radius: var(--radius-control);
  background: var(--surface-muted);
}

.report-title-text,
.report-title-editor {
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.report-title-text {
  overflow: hidden;
  padding: 4px 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-title-editor {
  min-height: 28px;
  padding: 3px 5px;
  border-radius: var(--radius-control);
}

.report-title-editor[hidden] {
  display: none;
}

.report-title-revision {
  flex: 0 0 auto;
  margin-left: var(--space-2);
  color: var(--text-secondary);
  font-size: 10px;
  white-space: nowrap;
}

.report-draft-select-menu .custom-select-option {
  min-height: 34px;
  padding: 7px var(--space-2);
  border-radius: var(--radius-control);
  color: var(--text-secondary);
  line-height: 1.25;
}

.report-draft-select-menu .custom-select-option[aria-selected="true"] {
  background: color-mix(in srgb, var(--project-color) 14%, transparent);
  color: var(--text-primary);
  font-weight: 650;
}

.reader-code-select-menu .custom-select-group-label {
  margin-top: var(--space-3);
  padding: 0 0 var(--space-1);
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 1.08) !important;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: none;
}

.reader-code-select-menu .custom-select-group-label:first-child {
  margin-top: 0;
}

.reader-code-select-menu .custom-select-option,
.reader-code-select-menu .custom-select-option.is-indented,
.reader-chapter-select-menu .custom-select-option {
  min-height: 26px;
  padding: 4px var(--space-2);
  border-radius: var(--radius-control);
  color: var(--text-secondary);
  line-height: 1.2;
}

.reader-code-select-menu .custom-select-option[aria-selected="true"],
.reader-chapter-select-menu .custom-select-option[aria-selected="true"] {
  background: color-mix(in srgb, var(--code-accent) 12%, transparent);
  color: var(--text-primary);
  font-weight: 650;
}

.reader-nav-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  outline: 0;
}

.reader-nav-chapter {
  min-width: 0;
}

.reader-nav-chapter-row,
.reader-nav-section {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 26px;
  padding: 4px var(--space-2);
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.reader-nav-chapter-row {
  background: transparent;
  color: var(--text-secondary);
  font-weight: 650;
}

.reader-nav-chapter-row:hover,
.reader-nav-section:hover {
  background: color-mix(in srgb, var(--code-accent) 8%, transparent);
  color: var(--text-primary);
}

.reader-nav-section[aria-selected="true"] {
  background: transparent;
  color: var(--text-primary);
  font-weight: 650;
}

.reader-nav-chapter:focus,
.reader-nav-chapter:focus-visible,
.reader-nav-section:focus,
.reader-nav-section:focus-visible,
.reader-nav-tree:focus-visible {
  outline: 0;
}

.reader-nav-chapter:focus-visible > .reader-nav-chapter-row,
.reader-nav-section:focus-visible {
  background: color-mix(in srgb, var(--code-accent) 18%, transparent);
  color: var(--text-primary);
}

.reader-nav-chevron {
  display: inline-flex;
  flex: 0 0 16px;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 1.25em;
  color: var(--text-tertiary);
}

.reader-nav-chevron svg {
  width: 12px;
  height: 12px;
  transition: transform 140ms ease;
}

.reader-nav-chapter[aria-expanded="true"] .reader-nav-chevron svg {
  transform: rotate(90deg);
}

.reader-nav-chapter-label {
  min-width: 0;
  flex: 1 1 auto;
}

.reader-nav-section-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 1px 0 6px;
}

.reader-nav-section {
  padding-left: calc(var(--space-2) + 24px);
}

.custom-select-option {
  display: block;
  width: 100%;
  padding: 0.1rem 0.25rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 400;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.custom-select-group-label {
  padding: 0.3rem 0.25rem 0.12rem;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.82em !important;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
}

.custom-select-option.is-indented {
  padding-left: 1.25rem;
}

.custom-select-option.is-group-action {
  padding-top: 0.3rem;
  font-weight: 700;
}

.custom-select-option[aria-selected="true"] {
  background: transparent;
  color: inherit;
}

.custom-select-option:hover,
.custom-select-option:focus,
.custom-select-option:focus-visible,
.custom-select-option[aria-selected="true"]:hover,
.custom-select-option[aria-selected="true"]:focus,
.custom-select-option[aria-selected="true"]:focus-visible {
  outline: 0;
  background: var(--select-highlight);
  color: inherit;
}

select,
input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface-muted);
  color: var(--text-primary);
}

textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface-muted);
  color: var(--text-primary);
  resize: none;
}

select {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.96rem;
  font-weight: 500;
}

select option {
  background: #ffffff;
  color: #111111;
}

select option:checked {
  background: #e9e9ec;
  color: #111111;
}

@media (prefers-color-scheme: dark) {
  select option {
    background: #1e1e20;
    color: #f6f4f1;
  }

  select option:checked {
    background: #1e1e20;
    color: #f6f4f1;
  }
}

.reader-body,
.search-results,
.saved-content,
.analysis-content {
  min-height: 0;
}

.reader-content,
.settings-scroll,
.saved-content,
.analysis-content,
.section-detail-content,
.project-detail-content,
.projects-content,
.project-create-sheet {
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.reader-content {
  padding-right: var(--space-4);
}

.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.settings-panel .panel-header {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.settings-scroll > .settings-list {
  margin-top: var(--space-3);
}

.settings-scroll > .settings-card {
  margin-top: var(--card-stack-gap);
}

.reader-content {
  padding-top: 0;
  font-size: var(--reader-font-size) !important;
}

.reader-content > * {
  width: 100%;
  max-width: 800px;
  margin-right: auto;
  margin-left: auto;
}

.reader-panel .reader-content {
  padding-top: var(--reader-header-overlay-height);
}

.reader-content.is-searching-reader {
  padding-top: calc(var(--reader-scrollbar-track-top) + var(--reader-internal-search-height) + var(--space-3));
}

.section-detail-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--search-detail-background);
}

.section-detail-panel.project-derived-panel {
  background: color-mix(in srgb, var(--project-color) 8%, var(--surface-raised));
}

.section-detail-chrome {
  display: grid;
  grid-template-columns: var(--panel-title-control-size) var(--panel-title-control-size);
  justify-content: space-between;
  gap: var(--space-3);
}

.section-detail-icon {
  display: grid;
  place-items: center;
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

.section-detail-icon svg {
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.section-detail-icon:hover,
.section-detail-icon:focus-visible {
  color: var(--text-primary);
}

.section-detail-save.is-saved {
  color: var(--code-accent);
}

.section-detail-save.has-error {
  color: #c62828;
}

.section-detail-content {
  min-width: 0;
  padding: var(--space-4) 0 108px;
  font-family: var(--ui-font-family);
  font-size: var(--reader-font-size) !important;
  line-height: var(--reader-line-height);
  overflow-wrap: anywhere;
}

.section-detail-code-label {
  min-width: 0;
  margin: 0 0 var(--space-4);
  color: var(--code-accent);
  font-family: var(--ui-font-family);
  font-size: calc(var(--reader-font-size) * var(--section-label-scale)) !important;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.section-detail-heading {
  position: relative;
  display: block;
  min-width: 0;
  width: 100%;
  margin: var(--space-6) 0 var(--space-3);
  padding: 0 34px 0 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  overflow-wrap: anywhere;
}

.section-detail-heading span {
  min-width: 0;
  font-family: var(--reader-font-family);
  font-size: calc(var(--reader-font-size) * var(--subsection-title-scale)) !important;
  font-weight: 400;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.section-detail-heading .section-detail-number {
  float: left;
  margin-right: 12px;
  color: var(--code-accent);
  font-weight: 700;
}

.section-detail-jump {
  position: absolute;
  top: 0.18em;
  right: 0;
  display: grid;
  place-items: center;
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
  color: var(--text-tertiary);
}

.section-detail-jump svg {
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.section-detail-chapter {
  min-width: 0;
  margin: 0 0 var(--space-5);
  color: var(--text-secondary);
  font-family: var(--reader-font-family);
  font-size: calc(var(--reader-font-size) * var(--body-text-scale)) !important;
  line-height: var(--reader-line-height);
}

.section-detail-body {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  margin: 0 0 var(--space-6);
  color: var(--text-primary);
  font-family: var(--reader-font-family);
  font-size: calc(var(--reader-font-size) * var(--body-text-scale)) !important;
  line-height: var(--reader-line-height);
}

.section-detail-body p,
.section-detail-body div,
.section-detail-body span,
.section-detail-body li,
.section-detail-body td,
.section-detail-body th {
  min-width: 0;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: var(--reader-line-height);
  overflow-wrap: anywhere;
}

.notebook-evidence-highlight {
  border-radius: 3px;
  background: color-mix(in srgb, var(--project-color, var(--accent)) 34%, transparent);
  color: inherit;
}

.section-detail-evidence-status {
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
}

.section-detail-notes {
  display: grid;
  gap: var(--space-3);
}

.section-detail-notes-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.section-detail-notes h3 {
  margin: 0;
  color: var(--text-secondary);
  font-family: var(--ui-font-family);
  font-size: calc(var(--reader-font-size) * var(--body-text-scale)) !important;
  font-weight: 600;
}

.section-detail-note-state {
  margin-left: auto;
  color: var(--text-secondary);
  font-family: var(--ui-font-family);
  font-size: var(--reader-font-size) !important;
  font-weight: 600;
}

.section-detail-note-box {
  display: grid;
}

.section-detail-note-box textarea {
  width: 100%;
  height: clamp(118px, 24vh, 210px);
  min-height: 118px;
  max-height: min(70vh, 760px);
  overflow-y: auto;
  resize: none;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--ui-font-family);
  font-size: calc(var(--reader-font-size) * var(--body-text-scale)) !important;
  line-height: var(--reader-line-height);
  outline: 0;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 4%, transparent);
}

.section-detail-note-box textarea::placeholder {
  color: var(--text-tertiary);
}

.section-detail-note-resize-handle {
  position: relative;
  z-index: 1;
  height: 14px;
  margin-top: -14px;
  cursor: row-resize;
  touch-action: none;
}

.section-detail-note-resize-handle::after {
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 36px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--text-secondary);
  content: "";
  opacity: 0.7;
  transform: translateX(-50%);
}

.section-detail-note-resize-handle:focus-visible {
  outline: 2px solid var(--code-accent, var(--text-primary));
  outline-offset: -2px;
}

.reader-internal-results {
  display: grid;
  gap: 0;
  padding-top: 0;
}

.reader-internal-result {
  display: block;
  width: 100%;
  padding: var(--space-3) 0;
  border: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.reader-internal-result:hover,
.reader-internal-result:focus-visible {
  background: var(--select-highlight);
  outline: 0;
}

.reader-internal-result strong {
  display: block;
  margin: 0 0 var(--space-1);
  font-family: var(--ui-font-family);
  font-size: var(--reader-font-size) !important;
  line-height: 1.25;
  font-weight: 600;
}

.reader-internal-result p {
  margin: 0;
  color: color-mix(in srgb, var(--text-primary) 82%, var(--text-secondary));
  font-family: var(--ui-font-family);
  font-size: var(--reader-font-size) !important;
  line-height: var(--reader-line-height);
}

.reader-internal-result mark {
  padding: 0 0.12em;
  border-radius: 0;
  background: color-mix(in srgb, var(--code-accent) 24%, transparent);
  color: inherit;
}

.annotated-code-block {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.annotated-code-block > :where(.section-block, .section-html, .code-table, .code-media) {
  grid-column: 1;
}

.annotated-code-block.is-source-target,
.chapter-section.is-source-target {
  background: transparent;
}

.annotated-code-block.is-source-target :where(
  .section-block,
  .section-html,
  .code-table,
  p,
  div,
  span,
  strong,
  em,
  b,
  i,
  li,
  td,
  th
),
.chapter-section.is-source-target :where(
  .section-block,
  .section-html,
  .code-table,
  p,
  div,
  span,
  strong,
  em,
  b,
  i,
  li,
  td,
  th
) {
  color: var(--reader-notes-active-text) !important;
  -webkit-text-fill-color: var(--reader-notes-active-text);
}

.inline-comment {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  justify-content: flex-end;
  gap: var(--space-1);
  min-width: 0;
  width: 60px;
  min-height: 30px;
  margin-bottom: var(--space-4);
  padding-left: var(--space-1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.reader-panel.code-theme-zoning .inline-comment {
  margin-bottom: var(--space-2);
}

.annotated-code-block:hover > .inline-comment,
.annotated-code-block:focus-within > .inline-comment {
  opacity: 1;
  pointer-events: auto;
}

.inline-bookmark-toggle,
.inline-research-toggle {
  display: inline-flex;
  min-width: 0;
  width: 28px;
  min-height: 28px;
  height: 28px;
  justify-content: center;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 1000px;
  background: color-mix(in srgb, var(--text-primary) 6%, transparent);
  color: var(--text-secondary);
  font-family: var(--chrome-font-family);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
}

.inline-research-toggle {
  flex: 0 0 28px;
}

.inline-research-toggle:disabled {
  opacity: 0.64;
}

.inline-bookmark-toggle svg,
.inline-research-toggle svg {
  width: 15px;
  height: 15px;
}

.inline-bookmark-toggle:hover,
.inline-bookmark-toggle:focus-visible,
.inline-bookmark-toggle.is-saved,
.inline-research-toggle:hover,
.inline-research-toggle:focus-visible {
  color: var(--text-primary);
  outline: 0;
}

.inline-bookmark-toggle.is-saved,
.inline-bookmark-toggle.has-error {
  color: var(--text-secondary);
}

.inline-bookmark-toggle.is-saved svg {
  fill: currentColor;
}

.inline-bookmark-toggle:disabled {
  opacity: 0.55;
  cursor: wait;
}

.reader-save-confirmation {
  position: absolute;
  right: calc(var(--panel-padding) + var(--reader-scrollbar-rail-width));
  bottom: calc(var(--panel-padding) + var(--space-3));
  z-index: 19;
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 10px 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--text-primary);
  color: var(--surface);
  font-family: var(--chrome-font-family);
  font-size: var(--chrome-font-size) !important;
  box-shadow: var(--shadow-panel);
}

.reader-save-confirmation button {
  min-height: 26px;
  padding: 3px 9px;
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface) 16%, transparent);
  color: inherit;
  font: inherit;
  font-weight: 650;
}

.reader-notes-project-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--space-2);
  min-width: 0;
  margin-top: calc(-1 * var(--space-2));
  padding-right: var(--space-1);
}

.reader-notes-project-options {
  display: grid;
  gap: var(--space-2);
  max-height: min(38vh, 280px);
  padding-right: var(--space-1);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}

.reader-notes-project-picker-header {
  display: flex;
  flex: 1 1 100%;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.reader-notes-project-picker-header > strong {
  font-size: calc(var(--reader-font-size) * 0.9) !important;
}

.reader-notes-project-picker button,
.reader-notes-project-picker p,
.reader-notes-project-picker input {
  min-height: 26px;
  margin: 0;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
  color: var(--text-primary);
  font-size: calc(var(--reader-font-size) * 0.9) !important;
  white-space: nowrap;
}

.reader-notes-project-picker .reader-notes-project-option {
  --project-color: var(--text-secondary);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-1);
  background: color-mix(in srgb, var(--project-color) 16%, transparent);
}

.reader-notes-project-option > span:first-child,
.reader-notes-project-option small {
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-notes-project-option small {
  color: var(--text-secondary);
  font-size: 0.72em !important;
}

.reader-notes-project-instruction,
.reader-notes-project-status {
  min-height: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  white-space: normal !important;
}

.reader-notes-new-folder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.reader-notes-project-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.reader-notes-project-picker .reader-notes-project-confirm {
  background: var(--text-primary);
  color: var(--surface);
  font-weight: 700;
}

.reader-notes-project-picker .reader-notes-project-confirm:disabled {
  cursor: default;
  opacity: 0.42;
}

.reader-notes-project-picker .reader-notes-project-option.is-selected {
  background: color-mix(in srgb, var(--project-color) 34%, transparent);
}

.reader-notes-project-check {
  display: inline-grid;
  width: 14px;
  height: 14px;
  place-items: center;
  font-size: 11px !important;
  font-weight: 700;
  line-height: 1;
}

.reader-notes-project-empty {
  color: var(--text-secondary) !important;
}

.reader-notes-project-picker .reader-notes-project-option:hover,
.reader-notes-project-picker .reader-notes-project-option:focus-visible {
  background: color-mix(in srgb, var(--project-color) 32%, transparent);
}

@media (prefers-color-scheme: dark) {
  .reader-notes-project-picker .reader-notes-project-option {
    background: color-mix(in srgb, var(--project-color) 24%, transparent);
  }

  .reader-notes-project-picker .reader-notes-project-option.is-selected {
    background: color-mix(in srgb, var(--project-color) 46%, transparent);
  }

  .reader-notes-project-picker .reader-notes-project-option:hover,
  .reader-notes-project-picker .reader-notes-project-option:focus-visible {
    background: color-mix(in srgb, var(--project-color) 42%, transparent);
  }
}

.reader-notes-new-project-form {
  display: flex;
  gap: var(--space-2);
  flex: 1 1 100%;
}

.reader-notes-new-project-form input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: var(--reader-notes-input-surface);
  box-shadow: none;
  appearance: none;
}

.reader-notes-new-project-form input:focus,
.reader-notes-new-project-form input:focus-visible {
  outline: 0;
  outline-offset: 0;
  background: color-mix(in srgb, var(--text-primary) 6%, var(--reader-notes-input-surface));
  box-shadow: none;
}

.reader-notes-new-project-form button {
  border: 0;
  outline: 0;
  box-shadow: none;
  appearance: none;
}

.reader-notes-new-project-form button:hover,
.reader-notes-new-project-form button:focus-visible {
  outline: 0;
  outline-offset: 0;
  background: color-mix(in srgb, var(--text-primary) 16%, transparent);
  box-shadow: none;
}

.section-detail-projects {
  display: grid;
  gap: var(--space-2);
}

.annotation-projects-header {
  display: flex;
  min-height: 24px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.annotation-project-add {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
}

.annotation-project-add:hover,
.annotation-project-add:focus-visible {
  background: color-mix(in srgb, var(--text-primary) 12%, transparent);
  color: var(--text-primary);
}

.annotation-project-add svg {
  width: 16px;
  height: 16px;
}

.annotation-project-list-toggle {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.annotation-project-list-toggle:hover {
  background: transparent;
  color: var(--text-primary);
}

.annotation-project-list-toggle::after {
  content: "›";
  display: inline-block;
  font-size: 0.95em;
  line-height: 1;
  transform-origin: center;
  transition: transform 260ms ease;
}

.annotation-project-list-toggle[aria-expanded="true"]::after {
  transform: rotate(90deg);
}

.annotation-project-list-toggle:focus-visible {
  outline: 2px solid var(--code-accent, var(--text-primary));
  outline-offset: 2px;
}

.annotation-project-list-motion {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 260ms ease;
}

.annotation-project-list-motion.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.annotation-project-chips {
  display: grid;
  min-height: 0;
  max-height: 240px;
  min-width: 0;
  overflow-y: auto;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--text-primary) 5%, transparent);
}

.annotation-project-chip,
.annotation-projects-empty {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: left;
}

.annotation-project-chip {
  cursor: pointer;
}

.annotation-project-chip + .annotation-project-chip {
  border-top: 1px solid color-mix(in srgb, var(--text-primary) 12%, transparent);
}

.annotation-project-chip:hover {
  color: var(--project-color, var(--text-primary));
}

.annotation-project-chip.is-selected {
  background: color-mix(in srgb, var(--project-color) 18%, transparent);
  color: var(--project-color, var(--text-primary));
}

.annotation-project-selected-mark {
  min-width: 1em;
  color: currentColor;
  text-align: right;
}

.annotation-project-chip:disabled {
  cursor: wait;
  opacity: 0.62;
}

.annotation-projects-empty {
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .annotation-project-list-motion,
  .annotation-project-list-toggle::after {
    transition: none;
  }
}

.annotation-editor-label {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reader-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  overflow-x: hidden;
}

.reader-panel .reader-body {
  grid-row: 1;
}

.reader-content {
  overflow-x: hidden;
}

.reader-empty {
  display: grid;
  align-content: center;
  min-height: 100%;
  padding: var(--space-6);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
}

.empty-panel {
  display: grid;
  align-content: center;
  min-height: 100%;
  padding: var(--space-6);
  border: 1px dashed color-mix(in srgb, var(--border) 78%, var(--text-secondary));
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text-secondary);
}

.reader-empty h3,
.empty-panel h3 {
  margin: 0 0 var(--space-2);
  color: var(--text-primary);
  font-size: clamp(1.25rem, 1.6vw, 1.55rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.reader-empty p,
.empty-panel p {
  max-width: 28rem;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.42;
}

.reader-progressive-status {
  margin: var(--space-4) 0;
  padding: var(--space-3);
  border: 0;
  border-radius: var(--radius-tile);
  background: color-mix(in srgb, var(--code-accent) 9%, var(--surface));
  color: var(--text-secondary);
  font-family: var(--chrome-font-family);
  font-size: calc(var(--chrome-font-size) * 0.82);
  line-height: 1.35;
  text-align: center;
}

.reader-progressive-status.is-error {
  background: color-mix(in srgb, #b54708 10%, var(--surface));
  color: #9a3c06;
}

.chapter-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  column-gap: var(--space-1);
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
  padding: 0 0 var(--space-3);
  border-bottom: 0;
  scroll-margin-top: var(--space-3);
}

.chapter-section:has(+ .chapter-section.starts-group) {
  border-bottom: 0;
}

.chapter-section h3 {
  grid-column: 1;
  min-width: 0;
  margin: 0 0 var(--space-2);
  color: var(--text-primary);
  font-family: var(--reader-font-family);
  font-size: calc(var(--reader-font-size) * var(--subsection-title-scale)) !important;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}

.reader-section-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  grid-column: 1 / -1;
  gap: var(--space-1);
  min-width: 0;
  margin-bottom: var(--space-2);
}

.reader-section-saved-marker {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--text-secondary);
}

.reader-section-saved-marker[hidden] {
  display: none;
}

.reader-section-saved-marker svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.reader-section-heading-row .reader-section-title {
  margin-bottom: 0;
}

.reader-section-project-chip:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--code-accent) 62%, transparent);
  outline-offset: 2px;
}

.reader-section-project-context {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin: 0 0 var(--space-3);
  padding: 7px 9px;
  border: 0;
  border-radius: var(--radius-tile);
  background: color-mix(in srgb, var(--code-accent) 7%, transparent);
  font-family: var(--chrome-font-family);
}

.reader-section-project-context[hidden] {
  display: none;
}

.reader-section-project-context-label {
  color: var(--text-tertiary);
  font-size: calc(var(--chrome-font-size) * 0.62);
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.reader-section-project-chip {
  min-height: 24px;
  padding: 3px 8px;
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--project-color, var(--code-accent)) 16%, var(--surface-raised));
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.68);
  font-weight: 650;
}

.reader-section-project-context-status {
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.68);
}

.reader-section-title {
  border-radius: 0;
}

.reader-section-title:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--code-accent) 58%, transparent);
  outline-offset: 4px;
}

.section-block {
  grid-column: 1;
  margin: 0 0 var(--space-4);
  color: color-mix(in srgb, var(--text-primary) 88%, var(--text-secondary));
  font-family: var(--reader-font-family);
  font-size: calc(var(--reader-font-size) * var(--body-text-scale)) !important;
  line-height: var(--reader-line-height);
  white-space: pre-wrap;
}

.section-html {
  white-space: normal;
}

.reader-panel.code-theme-zoning .section-block {
  margin-bottom: var(--space-2);
}

.reader-panel.code-theme-zoning .section-html > p {
  margin: 0;
}

.section-html div,
.section-html span {
  color: inherit !important;
  -webkit-text-fill-color: currentColor;
  font-size: inherit !important;
  line-height: inherit;
}

.section-html :where(p, div, span, strong, em, b, i, li, td, th) {
  color: inherit !important;
  -webkit-text-fill-color: currentColor;
}

.section-html .specialty-provision {
  margin: 0;
}

.section-html .specialty-provision-heading {
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--reader-font-family);
  font-size: calc(var(--reader-font-size) * var(--subsection-title-scale)) !important;
  font-weight: 700;
  line-height: 1.25;
}

.authored-section-label {
  display: block;
  grid-column: 1 / -1;
  margin: var(--space-5) 0 var(--space-3);
  padding: 0;
  border-bottom: 0;
  color: var(--code-accent) !important;
  -webkit-text-fill-color: var(--code-accent);
  font-family: var(--reader-font-family);
  font-size: calc(var(--reader-font-size) * var(--section-label-scale)) !important;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-table {
  grid-column: 1;
  min-width: 0;
  max-width: 100%;
  margin: var(--space-3) 0 var(--space-5);
  font-family: var(--reader-font-family);
  font-size: calc(var(--reader-font-size) * var(--body-text-scale)) !important;
  line-height: var(--reader-line-height);
  overflow-x: auto;
}

.code-table table {
  width: max-content;
  max-width: none;
  border-collapse: collapse;
  border: 1px solid color-mix(in srgb, var(--text-primary) 34%, var(--border));
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
}

.code-table :where(table, thead, tbody, tfoot, tr, td, th, p, div, span, strong, em, b, i, li) {
  color: inherit !important;
  -webkit-text-fill-color: currentColor;
}

.section-html table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  border: 1px solid color-mix(in srgb, var(--text-primary) 34%, var(--border));
}

.code-table td,
.code-table th,
.section-html td,
.section-html th {
  min-width: 7rem;
  padding: var(--space-2);
  border: 1px solid color-mix(in srgb, var(--text-primary) 34%, var(--border));
  font-size: inherit !important;
  line-height: inherit;
  vertical-align: top;
}

@media (prefers-color-scheme: dark) {
  .code-table table,
  .section-html table,
  .code-table td,
  .code-table th,
  .section-html td,
  .section-html th {
    border: 1px solid rgba(255, 255, 255, 0.36) !important;
  }

  .code-table [style*="background-color:white" i],
  .code-table [style*="background-color: white" i],
  .code-table [style*="background:white" i],
  .code-table [style*="background: white" i],
  .section-html table [style*="background-color:white" i],
  .section-html table [style*="background-color: white" i],
  .section-html table [style*="background:white" i],
  .section-html table [style*="background: white" i] {
    background-color: var(--surface) !important;
  }

  .code-table [style*="background-color:#C0C0C0" i],
  .section-html table [style*="background-color:#C0C0C0" i] {
    background-color: rgba(255, 255, 255, 0.16) !important;
  }

  .code-table [style*="background-color:#808080" i],
  .section-html table [style*="background-color:#808080" i] {
    background-color: rgba(255, 255, 255, 0.08) !important;
  }

  .code-table [style*="background-color:#f8cbad" i],
  .code-table [style*="background-color:#f7caac" i],
  .code-table [style*="background-color:#fce4d6" i],
  .code-table [style*="background-color:#fbe4d5" i],
  .section-html table [style*="background-color:#f8cbad" i],
  .section-html table [style*="background-color:#f7caac" i],
  .section-html table [style*="background-color:#fce4d6" i],
  .section-html table [style*="background-color:#fbe4d5" i] {
    background-color: color-mix(in srgb, var(--ios-accent-building) 16%, var(--surface)) !important;
  }
}

.code-media {
  margin: var(--space-4) 0 var(--space-5);
}

.code-media img,
.section-html img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  background: var(--surface);
}

.search-panel {
  position: relative;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 600px;
  overflow: hidden;
}

.search-panel::before {
  content: none;
}

.search-panel .panel-header {
  position: relative;
  z-index: 2;
}

.search-box {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 22px;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  max-width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 var(--space-3);
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: var(--radius-card);
  background: var(--surface-muted);
}

.search-panel .search-box {
  border: 0;
  border-radius: var(--radius-pill);
}

.search-panel .search-box:has(.search-input:focus-visible) {
  outline: 2px solid color-mix(in srgb, var(--text-secondary) 46%, transparent);
  outline-offset: 2px;
}

.search-box span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.search-box > svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.search-input {
  width: 100%;
  height: 40px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 1.02);
  font-weight: 500;
  outline: 0;
  box-shadow: none;
}

.search-input::-webkit-search-cancel-button {
  display: none;
}

.search-clear-button {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
}

.search-clear-button svg {
  width: 18px;
  height: 18px;
}

@media (prefers-color-scheme: dark) {
  .search-box {
    background: rgb(246 244 241 / 10%);
  }
}

.search-code-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0;
  overflow: visible;
  padding: 0;
}

.code-filter-menu {
  display: grid;
  gap: 0;
  background: var(--menu-subtle-surface);
}

.code-filter-menu .search-code-filter,
.code-filter-menu .saved-code-filter,
.code-filter-menu .saved-project-list,
.code-filter-menu .notebook-card-list,
.code-filter-menu .notebook-reference-list,
.code-filter-menu .research-conversation-project-options {
  max-height: 0;
  min-height: 0;
  overflow: hidden;
  padding-top: 0;
  opacity: 0;
  pointer-events: none;
  transition:
    max-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 260ms ease,
    padding 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.code-filter-menu.is-open .search-code-filter,
.code-filter-menu.is-open .saved-code-filter,
.code-filter-menu.is-open .saved-project-list,
.code-filter-menu.is-open .notebook-card-list,
.code-filter-menu.is-open .notebook-reference-list,
.code-filter-menu.is-open .research-conversation-project-options {
  max-height: var(--code-filter-menu-height, 240px);
  padding-top: var(--space-2);
  opacity: 1;
  pointer-events: auto;
}

.code-filter-menu.is-restoring .search-code-filter,
.code-filter-menu.is-restoring .saved-code-filter,
.code-filter-menu.is-restoring .saved-project-list,
.code-filter-menu.is-restoring .notebook-card-list,
.code-filter-menu.is-restoring .notebook-reference-list,
.code-filter-menu.is-restoring .research-conversation-project-options {
  transition: none;
}

.code-filter-menu[hidden],
.code-filter-menu .search-code-filter[hidden],
.code-filter-menu .saved-code-filter[hidden],
.code-filter-menu .saved-project-list[hidden],
.code-filter-menu .notebook-card-list[hidden],
.code-filter-menu .notebook-reference-list[hidden],
.code-filter-menu .research-conversation-project-options[hidden] {
  display: none !important;
}

.code-filter-menu-toggle {
  display: flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-tertiary) 16%, transparent);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px !important;
  font-weight: 400;
  text-align: left;
}

.code-filter-menu-toggle:hover {
  background: color-mix(in srgb, var(--text-tertiary) 24%, transparent);
}

.search-code-filter-menu .code-filter-menu-toggle:focus-visible {
  outline: 0;
  outline-offset: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text-secondary) 46%, transparent);
}

.code-filter-menu-icon {
  display: grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
}

.code-filter-menu-icon svg {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
}

.code-filter-chevron-up,
.code-filter-menu-toggle[aria-expanded="true"] .code-filter-chevron-down {
  display: none;
}

.code-filter-menu-toggle[aria-expanded="true"] .code-filter-chevron-up {
  display: block;
}

.search-code-filter .search-filter-chip {
  width: 100%;
  min-height: 28px;
  justify-self: stretch;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  font-size: 12px !important;
  font-weight: 400;
  text-align: center;
  white-space: normal;
}

.search-filter-chip {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-tertiary) 16%, transparent);
  color: var(--text-secondary);
  font: inherit;
  font-weight: 650;
  white-space: nowrap;
}

.search-filter-chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--text-primary) 60%, transparent);
  color: var(--surface);
}

.search-filter-chip.code-theme-building[aria-pressed="true"],
.search-filter-chip.code-theme-administrative[aria-pressed="true"],
.search-filter-chip.code-theme-plumbing[aria-pressed="true"],
.search-filter-chip.code-theme-mechanical[aria-pressed="true"],
.search-filter-chip.code-theme-fuel-gas[aria-pressed="true"],
.search-filter-chip.code-theme-energy[aria-pressed="true"],
.search-filter-chip.code-theme-electrical[aria-pressed="true"],
.search-filter-chip.code-theme-existing-building[aria-pressed="true"],
.search-filter-chip.code-theme-fire[aria-pressed="true"],
.search-filter-chip.code-theme-historical[aria-pressed="true"],
.search-filter-chip.code-theme-housing[aria-pressed="true"],
.search-filter-chip.code-theme-environmental[aria-pressed="true"],
.search-filter-chip.code-theme-land-use[aria-pressed="true"],
.search-filter-chip.code-theme-housing-buildings[aria-pressed="true"],
.search-filter-chip.code-theme-current-consolidation[aria-pressed="true"],
.search-filter-chip.code-theme-local-law[aria-pressed="true"],
.search-filter-chip.code-theme-zoning[aria-pressed="true"] {
  background: color-mix(in srgb, var(--code-accent) 22%, transparent);
  color: var(--code-accent);
  -webkit-text-fill-color: var(--code-accent);
}

.search-filter-chip:hover {
  background: color-mix(in srgb, var(--text-tertiary) 24%, transparent);
}

.search-filter-chip[aria-pressed="true"]:hover {
  background: color-mix(in srgb, var(--text-primary) 66%, transparent);
}

.search-filter-chip.code-theme-building[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-administrative[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-plumbing[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-mechanical[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-fuel-gas[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-energy[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-electrical[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-existing-building[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-fire[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-historical[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-housing[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-environmental[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-land-use[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-housing-buildings[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-current-consolidation[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-local-law[aria-pressed="true"]:hover,
.search-filter-chip.code-theme-zoning[aria-pressed="true"]:hover {
  background: color-mix(in srgb, var(--code-accent) 28%, transparent);
}

.search-code-filter .search-filter-chip[aria-pressed="true"] {
  font-weight: 400;
}

.search-results {
  width: calc(100% + (2 * var(--panel-padding)));
  min-width: 0;
  margin-inline: calc(-1 * var(--panel-padding));
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-2) 0 var(--space-5);
  font-family: var(--ui-font-family);
  font-size: var(--chrome-font-size) !important;
  line-height: 1.45;
  scrollbar-gutter: stable;
  scrollbar-color: color-mix(in srgb, var(--text-tertiary) 58%, transparent) transparent;
  scrollbar-width: thin;
}

.search-dock {
  position: relative;
  z-index: 3;
  display: grid;
  gap: var(--space-2);
  margin: 0 calc(-1 * var(--panel-padding));
  padding: var(--space-2) var(--panel-padding) var(--space-3);
  background: color-mix(in srgb, var(--surface) 94%, var(--background));
}

.search-result-summary[hidden],
.search-clear-button[hidden],
.saved-inline-filters[hidden] {
  display: none !important;
}

.search-results::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-track {
  background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
  border-radius: 0;
  background: color-mix(in srgb, var(--text-tertiary) 44%, transparent);
}

.search-result-group,
.saved-code-group,
.projects-content {
  display: grid;
  align-content: start;
  gap: 0;
}

.workspace-column-intro {
  margin: 0 0 var(--space-3);
  padding: 0 0 var(--space-3);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.86);
  line-height: 1.4;
}

.section-label.search-group-label,
.section-label.saved-code-label {
  margin: var(--space-5) 0 var(--space-2);
  color: var(--code-accent) !important;
  -webkit-text-fill-color: var(--code-accent);
  font-family: var(--ui-font-family);
  font-size: calc(var(--chrome-font-size) * 0.82) !important;
  font-weight: 600;
  line-height: 1.2;
}

.search-panel .section-label.search-group-label,
.search-panel .search-history-label {
  padding-inline: var(--panel-padding);
}

.search-result-group mark,
.saved-code-group mark {
  background: color-mix(in srgb, var(--code-accent) 34%, transparent);
  color: inherit;
}

.result-row {
  display: grid;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-4) var(--panel-padding);
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
}

.result-row-main {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.result-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: var(--space-1);
  margin-bottom: var(--space-1);
  color: var(--text-primary);
  font-family: var(--ui-font-family);
  font-size: var(--chrome-font-size) !important;
  line-height: 1.4;
}

.result-number {
  color: var(--code-accent);
  font-size: inherit !important;
  font-weight: 700;
}

.result-chapter {
  display: block;
  margin: 0 0 var(--space-1);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.88) !important;
  font-weight: 500;
  line-height: 1.4;
}

.result-title {
  min-width: 0;
  margin: 0;
  color: var(--text-primary);
  font-size: inherit !important;
  font-weight: 700;
  line-height: inherit;
  overflow-wrap: anywhere;
}

.result-row-main p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-family: var(--ui-font-family);
  font-size: calc(var(--chrome-font-size) * 0.94) !important;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.search-result-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  padding: 0;
  background: transparent;
  color: #ffffff;
  font-size: calc(var(--chrome-font-size) * 0.86);
  font-weight: 600;
  text-align: center;
}

.search-load-more {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-5) 0 var(--space-3);
  color: var(--text-secondary);
  font-family: var(--chrome-font-family);
  font-size: calc(var(--chrome-font-size) * 0.82);
  text-align: center;
}

.search-load-more p {
  margin: 0;
}

.search-load-more-button {
  min-height: 34px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--code-accent) 14%, var(--surface));
  color: var(--code-accent);
  font: inherit;
  font-weight: 700;
}

.search-load-more-button:hover,
.search-load-more-button:focus-visible {
  background: color-mix(in srgb, var(--code-accent) 21%, var(--surface));
}

.search-load-more-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--code-accent) 52%, transparent);
  outline-offset: 2px;
}

.search-load-more-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.saved-load-more {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-4) 0 var(--space-2);
  color: var(--text-secondary);
  font-family: var(--chrome-font-family);
  font-size: calc(var(--chrome-font-size) * 0.82);
  text-align: center;
}

.saved-load-more p {
  margin: 0;
}

.saved-load-more-button {
  min-height: 34px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--code-accent) 14%, var(--surface));
  color: var(--code-accent);
  font: inherit;
  font-weight: 700;
}

.saved-load-more-button:hover,
.saved-load-more-button:focus-visible {
  background: color-mix(in srgb, var(--code-accent) 21%, var(--surface));
}

.saved-load-more-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--code-accent) 52%, transparent);
  outline-offset: 2px;
}

.search-history-section {
  display: grid;
  gap: 0;
  margin-bottom: var(--space-4);
}

.search-results.is-history:not(.is-split) {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.search-results.is-history:not(.is-split) .search-jump-section {
  min-height: 0;
  margin-bottom: 0;
}

.search-results.is-history:not(.is-split) .search-jump-list {
  max-height: none;
  min-height: 0;
  overflow-y: auto;
}

.search-recent-popover {
  position: absolute;
  z-index: 12;
  top: calc(var(--space-2) + 42px + var(--space-2));
  right: var(--panel-padding);
  left: var(--panel-padding);
  max-height: min(632px, calc(100vh - 180px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--surface) 96%, var(--background));
  box-shadow: 0 18px 44px color-mix(in srgb, #000000 34%, transparent);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.985);
  transform-origin: top center;
  transition: opacity 180ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.search-recent-popover.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.search-recent-popover[hidden] {
  display: none !important;
}

.search-recent-popover-heading {
  margin: 0;
  padding: var(--space-3) var(--space-3) var(--space-2);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-recent-popover-list {
  max-height: min(600px, calc(100vh - 220px));
  overflow-y: auto;
  padding: 0 var(--space-3) var(--space-2);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

@media (prefers-reduced-motion: reduce) {
  .search-recent-popover {
    transition: none;
  }
}

.search-results.is-history.is-split {
  display: grid;
  grid-template-rows:
    minmax(96px, var(--search-history-upper-size, 56%))
    11px
    minmax(96px, 1fr);
  overflow: hidden;
}

.search-history-pane {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.search-history-pane .search-history-section {
  min-height: 0;
  margin-bottom: 0;
}

.search-history-upper .search-jump-section,
.search-history-lower .search-history-section {
  flex: 1 1 auto;
}

.search-history-lower .search-history-section {
  grid-template-rows: auto minmax(0, 1fr);
}

.search-history-pane .search-history-scroll-list {
  max-height: none;
}

.search-history-upper .search-jump-list,
.search-history-lower .search-history-list {
  min-height: 0;
  overflow-y: auto;
}

.search-history-divider {
  position: relative;
  z-index: 1;
  min-height: 11px;
  cursor: row-resize;
  touch-action: none;
}

.search-history-divider::before {
  position: absolute;
  top: 5px;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--border);
  content: "";
  transition: background 160ms ease, height 160ms ease;
}

.search-history-divider:hover::before,
.search-history-divider:focus-visible::before,
.search-history-divider.is-dragging::before {
  height: 2px;
  background: var(--text-tertiary);
}

.search-history-divider:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

body.is-resizing-search-history,
body.is-resizing-search-history * {
  cursor: row-resize !important;
  user-select: none !important;
}

.search-history-label {
  margin: var(--space-3) 0 var(--space-2);
  color: var(--code-accent);
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-jump-section .search-history-label,
.search-history-section.is-recent .search-history-label {
  font-size: 13.3333px !important;
}

.search-jump-section {
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-2);
  padding-bottom: var(--space-2);
}

.search-history-list {
  display: grid;
  align-content: start;
  min-height: 0;
}

.search-history-section.is-pinned .search-history-list,
.search-history-section.is-recent .search-history-list {
  grid-auto-rows: 40px;
}

.search-history-scroll-list {
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior-x: auto;
  overscroll-behavior-y: contain;
  scrollbar-color: color-mix(in srgb, var(--text-tertiary) 58%, transparent) transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.search-history-scroll-list::-webkit-scrollbar {
  width: 6px;
}

.search-history-scroll-list::-webkit-scrollbar-track {
  background: transparent;
}

.search-history-scroll-list::-webkit-scrollbar-thumb {
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-tertiary) 44%, transparent);
}

.search-jump-list {
  display: grid;
  gap: 0;
  padding-right: 0;
}

.search-jump-tile {
  position: relative;
  height: 112px;
  min-width: 0;
  min-height: 112px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.search-jump-tile:last-child {
  border-bottom: 0;
}

.search-jump-open {
  display: grid;
  align-content: start;
  gap: 1px;
  width: 100%;
  height: 112px;
  min-height: 112px;
  padding: var(--space-1) var(--panel-padding);
  border: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.search-jump-code {
  color: var(--code-accent);
  font-size: calc(var(--chrome-font-size) * 0.72);
  font-weight: 700;
}

.search-jump-open strong {
  overflow: hidden;
  font-size: calc(var(--chrome-font-size) * 0.82);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-jump-preview {
  display: -webkit-box;
  max-height: 4.05em;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.7);
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.search-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  align-items: center;
  gap: var(--space-2);
  height: 40px;
  min-height: 40px;
  border-bottom: 1px solid var(--border);
}

.search-history-section.is-pinned .search-history-row {
  grid-template-columns: minmax(0, 1fr) 28px;
}

.search-history-apply {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  height: 40px;
  padding: var(--space-1) 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.search-history-apply svg,
.search-history-action svg {
  width: 16px;
  height: 16px;
}

.search-history-apply svg {
  color: var(--text-secondary);
}

.search-history-apply span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-history-action {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
}

.search-history-action.is-active {
  color: var(--code-accent);
}

.search-empty-action {
  margin-top: var(--space-3);
}

mark {
  padding: 0 3px;
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--text-primary);
}

.reader-search-match {
  border-radius: 0;
  background: var(--select-highlight);
}

.inline-code-reference {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--code-accent);
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.inline-code-reference:hover,
.inline-code-reference:focus-visible {
  background: var(--code-accent-soft);
}

.inline-code-reference[aria-busy="true"] {
  opacity: 0.62;
}

.reader-search-flash {
  --reader-search-flash-color: rgba(255, 221, 64, 0.88);
  padding: 0;
  margin: 0;
  background: var(--reader-search-flash-color);
  color: #0b0b0d;
  animation: reader-search-flash 2000ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes reader-search-flash {
  0% {
    background: rgba(255, 234, 118, 0.98);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--reader-search-flash-color) 76%, transparent);
  }

  45% {
    background: var(--reader-search-flash-color);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--reader-search-flash-color) 48%, transparent);
  }

  100% {
    background: rgba(255, 221, 64, 0.72);
    box-shadow: 0 0 0 0 transparent;
  }
}

.saved-content,
.projects-content {
  display: grid;
  align-content: start;
  gap: 0;
}

.projects-panel .panel-header {
  position: absolute;
  top: var(--panel-padding);
  right: var(--panel-padding);
  left: var(--panel-padding);
  z-index: 8;
  align-items: start;
  min-height: var(--panel-title-row-height);
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
  background: transparent;
}

.projects-panel .panel-actions {
  align-items: center;
}

.projects-panel {
  --reader-header-overlay-height: clamp(76px, 7vh, 96px);
  position: relative;
  overflow: hidden;
}

.projects-panel::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 6;
  height: calc(var(--reader-header-overlay-height) + var(--panel-padding));
  content: "";
  pointer-events: none;
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.archive-panel {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, #ff6b6b 10%, var(--surface-raised));
}

.projects-content {
  gap: var(--card-stack-gap);
  padding-top: var(--reader-header-overlay-height);
}

.projects-panel.is-project-selecting .projects-content,
.archive-panel.is-project-selecting .projects-content {
  padding-bottom: calc(var(--panel-padding) + 118px);
}

.project-bulk-bar {
  position: absolute;
  right: var(--panel-padding);
  bottom: var(--panel-padding);
  left: var(--panel-padding);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-3);
  border: 1px solid color-mix(in srgb, var(--text-primary) 18%, var(--border));
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--surface-raised) 92%, transparent);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.project-bulk-bar[hidden] {
  display: none;
}

.project-bulk-bar.is-archive {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: var(--space-2);
}

.project-bulk-bar.is-archive[hidden] {
  display: none;
}

.project-bulk-bar.is-archive .project-bulk-action,
.project-bulk-bar.is-archive .project-bulk-link {
  width: 100%;
  margin: 0;
  padding-right: var(--space-3);
  padding-left: var(--space-3);
}

.project-bulk-bar.is-archive .project-bulk-link {
  border-color: transparent;
  background: var(--surface-muted);
  color: var(--text-primary);
}

.project-bulk-count {
  flex: 1 1 100%;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
  font-weight: 650;
}

.project-bulk-link,
.project-bulk-action {
  min-height: 32px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  font-size: calc(var(--chrome-font-size) * 0.7) !important;
  font-weight: 650;
}

.project-bulk-link {
  padding-right: 0;
  padding-left: 0;
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
}

.project-bulk-link:hover,
.project-bulk-link:focus-visible {
  color: var(--text-primary);
}

.project-bulk-action {
  margin-left: auto;
  border: 1px solid var(--text-primary);
  background: var(--text-primary);
  color: var(--surface-raised);
}

.project-bulk-action.is-delete {
  border-color: #b42318;
  background: #b42318;
  color: #fff;
}

.project-bulk-action:disabled,
.project-bulk-link:disabled {
  cursor: default;
  opacity: 0.42;
}

.section-label {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--chrome-font-size) !important;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-card,
.saved-row,
.analysis-card,
.reader-preview-card,
.account-connector {
  min-width: 0;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  overflow-wrap: anywhere;
}

.project-card,
.analysis-card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
}

.project-card {
  position: relative;
}

.project-card-body {
  display: grid;
  gap: var(--space-1);
}

.project-card h3,
.analysis-card h3,
.saved-row strong {
  min-width: 0;
  margin: 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.project-card p,
.analysis-card p,
.saved-row span {
  min-width: 0;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

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

.projects-content .project-meta span {
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
  font-weight: 500;
}

.research-summary-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.research-interpreter {
  gap: var(--space-3);
}

.research-question-label {
  display: grid;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--chrome-font-size) !important;
}

.research-question-input {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-muted);
  color: var(--text-primary);
  line-height: 1.4;
}

.research-question-input::placeholder {
  color: var(--text-secondary);
}

.research-ask-button {
  justify-self: start;
}

.research-ask-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.research-interpreter-status:empty {
  display: none;
}

.research-interpretation-result:empty {
  display: none;
}

.research-result-card {
  gap: var(--space-3);
}

.research-result-subheading {
  margin-top: var(--space-1);
  color: var(--text-primary);
}

.research-answer-narrative {
  display: grid;
  gap: var(--space-3);
}

.research-answer-paragraph,
.research-answer-list {
  margin: 0;
  line-height: var(--reader-line-height);
}

.research-answer-paragraph {
  white-space: pre-line;
}

body .panel-track > article.workspace-panel:not(.reader-panel) .research-answer-paragraph,
body .panel-track > article.workspace-panel:not(.reader-panel) .research-answer-list {
  color: #ffffff !important;
}

body .panel-track > article.workspace-panel:not(.reader-panel) .research-answer-code-basis {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px !important;
  line-height: 1.35;
}

.research-answer-paragraph:first-child {
  font-size: 1.02rem;
  font-weight: 400;
}

.research-answer-paragraph,
.research-answer-list {
  font-weight: 400;
}

.research-answer-list {
  padding-left: 1.25rem;
}

.research-answer-citation-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.research-answer-citation-chips button {
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
  cursor: pointer;
}

.research-answer-citation-chips button:hover,
.research-answer-citation-chips button:focus-visible {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.research-answer-boundary {
  margin: 0;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.8) !important;
  line-height: 1.4;
}

.research-project-context-used {
  min-width: 0;
  color: var(--text-secondary);
}

.research-project-context-used > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  width: fit-content;
  padding: var(--space-1) 0;
  list-style: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.25;
}

.research-project-context-used > summary::-webkit-details-marker {
  display: none;
}

.research-project-context-used > summary::after {
  content: "›";
  display: inline-block;
  line-height: 1;
  transform-origin: center;
  transition: transform 260ms ease;
}

.research-project-context-used[open] > summary::after {
  transform: rotate(90deg);
}

.research-project-context-used > summary:focus-visible {
  outline: 2px solid var(--code-accent, var(--text-primary));
  outline-offset: 3px;
  border-radius: var(--radius-control);
}

.research-project-context-used-body {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-1);
  padding: var(--space-3);
  border: 0;
  border-radius: calc(var(--radius-card) + 2px);
  background: color-mix(in srgb, var(--text-primary) 5%, transparent);
  box-shadow: none;
}

.research-project-context-used-body p {
  margin: 0;
  color: var(--text-secondary);
  line-height: var(--reader-line-height);
}

.research-project-context-used-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.research-evidence-reviewed {
  min-width: 0;
  color: var(--text-secondary);
}

body .panel-track > article.workspace-panel:not(.reader-panel) .research-evidence-reviewed > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  width: fit-content;
  cursor: pointer;
  padding: var(--space-1) 0;
  list-style: none;
  color: var(--text-secondary);
  font-size: 14px !important;
  font-weight: 400;
  line-height: 1.25;
}

.research-evidence-reviewed > summary::-webkit-details-marker {
  display: none;
}

.research-evidence-reviewed > summary::after {
  content: "›";
  display: inline-block;
  line-height: 1;
  transform-origin: center;
  transition: transform 260ms ease;
}

.research-evidence-reviewed[open] > summary::after {
  transform: rotate(90deg);
}

.research-evidence-reviewed > summary:focus-visible {
  outline: 2px solid var(--code-accent, var(--text-primary));
  outline-offset: 3px;
  border-radius: var(--radius-control);
}

.research-evidence-reviewed-body {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-1);
  padding: var(--space-3);
  border: 0;
  border-radius: calc(var(--radius-card) + 2px);
  background: color-mix(in srgb, var(--text-primary) 5%, transparent);
  box-shadow: none;
}

.research-details-motion > .research-details-motion-body {
  overflow: hidden;
  transition:
    max-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 260ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .research-details-motion > .research-details-motion-body,
  .research-project-context-used > summary::after,
  .research-evidence-reviewed > summary::after {
    transition: none;
  }
}

.research-answer-details {
  color: var(--text-secondary);
}

.research-answer-details > summary {
  width: fit-content;
  cursor: pointer;
  padding: var(--space-1) 0;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
  font-weight: 400;
  line-height: 1.25;
}

.research-answer-details > summary:focus-visible {
  outline: 2px solid var(--code-accent, var(--text-primary));
  outline-offset: 3px;
  border-radius: var(--radius-control);
}

.research-answer-details-body {
  display: grid;
  gap: var(--space-3);
  padding: 0 0 var(--space-3);
}

.research-answer-details-body .research-result-subheading {
  margin: 0;
  font-size: calc(var(--chrome-font-size) * 0.9) !important;
}

.research-supported-points {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding-left: 1.4rem;
  color: var(--text-primary);
}

.research-supported-points li {
  padding-left: var(--space-1);
}

.research-supported-points li::marker {
  color: var(--code-accent, var(--text-primary));
  font-weight: 700;
}

.research-unresolved {
  display: grid;
  gap: var(--space-3);
}

.research-unresolved > div {
  display: grid;
  gap: var(--space-1);
}

.research-unresolved > div > strong {
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.88) !important;
}

.research-result-list {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.research-result-citation {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.research-result-citation > span {
  color: var(--text-primary);
  font-weight: 650;
}

.research-result-citation .ghost-button {
  justify-self: start;
}

.research-citation-passages summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.82) !important;
}

.research-citation-passages blockquote {
  max-height: 180px;
  margin: var(--space-2) 0 0;
  padding-left: var(--space-3);
  overflow: auto;
  border-left: 2px solid var(--code-accent, var(--text-primary));
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.8) !important;
  line-height: 1.45;
}

.research-feedback {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-1);
}

.research-answer-review-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.research-answer-review-row .research-evidence-reviewed {
  min-width: 0;
  flex: 1;
}

.research-answer-review-row:has(.research-evidence-reviewed[open]) {
  position: relative;
  display: block;
}

.research-answer-review-row:has(.research-evidence-reviewed[open]) .research-evidence-reviewed {
  width: 100%;
}

.research-answer-review-row:has(.research-evidence-reviewed[open]) .research-feedback-compact {
  position: absolute;
  top: 0;
  right: 0;
}

.research-feedback-compact {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.research-feedback-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-tertiary);
}

.research-feedback-icon svg {
  width: 14px;
  height: 14px;
}

.research-feedback-icon:hover,
.research-feedback-icon:focus-visible,
.research-feedback-icon[aria-pressed="true"] {
  color: var(--text-primary);
}

.research-feedback-details {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.research-feedback-details[hidden] {
  display: none;
}

.research-feedback-choices {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.research-feedback-choice {
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-primary) 9%, transparent);
  color: var(--text-primary);
  box-shadow: none;
  font-size: calc(var(--chrome-font-size) * 0.74) !important;
  font-weight: 600;
}

.research-feedback-choice:hover,
.research-feedback-choice:focus-visible {
  background: color-mix(in srgb, var(--text-primary) 15%, transparent);
  box-shadow: none;
}

.research-feedback-choice[aria-pressed="true"] {
  background: color-mix(in srgb, var(--code-accent) 22%, transparent);
  color: var(--text-primary);
}

.research-feedback-context {
  display: grid;
  gap: var(--space-2);
}

.research-feedback-context summary {
  width: fit-content;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
}

.research-feedback-context[open] summary {
  margin-bottom: var(--space-1);
}

.research-feedback textarea,
.research-feedback select,
.research-feedback input {
  width: 100%;
  resize: vertical;
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text-primary);
}

.research-feedback .ghost-button {
  justify-self: start;
}

.research-feedback-actions {
  display: flex;
  gap: var(--space-2);
}

.research-feedback-actions .ghost-button {
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 0;
  background: color-mix(in srgb, var(--text-primary) 9%, transparent);
  box-shadow: none;
}

.research-feedback-actions .research-feedback-cancel {
  background: color-mix(in srgb, var(--text-primary) 9%, transparent);
  color: var(--text-primary);
}

.research-feedback-actions .ghost-button:hover {
  background: color-mix(in srgb, var(--text-primary) 15%, transparent);
  box-shadow: none;
}

.research-feedback-actions .ghost-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--code-accent) 52%, transparent);
  outline-offset: 2px;
  box-shadow: none;
}

.research-feedback-status {
  min-height: 0;
  margin: 0 0 0 var(--space-1);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.74) !important;
}

.research-list-panel .analysis-content {
  display: flex;
  flex-direction: column;
}

.evidence-discovery {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.evidence-discovery-header {
  display: grid;
  gap: var(--space-1);
}

.evidence-discovery-header h3,
.evidence-discovery-header p {
  margin: 0;
}

.evidence-discovery-header h3 {
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 1.08) !important;
}

.evidence-discovery-header > p:last-child {
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.84) !important;
  line-height: 1.45;
}

.evidence-discovery-form,
.evidence-discovery-form label {
  display: grid;
  gap: var(--space-2);
}

.evidence-discovery-form label > span {
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
  font-weight: 650;
}

.evidence-discovery-form textarea,
.evidence-discovery-form select {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--text-primary) 9%, var(--surface));
  color: var(--text-primary);
  font: inherit;
}

.evidence-discovery-form textarea {
  min-height: 104px;
  padding: var(--space-3);
  resize: vertical;
  font-size: calc(var(--chrome-font-size) * 0.88) !important;
  line-height: 1.45;
}

.evidence-discovery-form select {
  min-height: 36px;
  padding: 0 var(--space-2);
  font-size: calc(var(--chrome-font-size) * 0.8) !important;
}

.evidence-discovery-form-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
}

.evidence-discovery-find,
.evidence-discovery-prepare-button,
.evidence-candidate-actions button {
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
  font-weight: 650;
  cursor: pointer;
}

.evidence-discovery-find,
.evidence-discovery-prepare-button {
  background: var(--text-primary);
  color: var(--surface);
}

.evidence-discovery-find:disabled,
.evidence-discovery-prepare-button:disabled,
.evidence-candidate-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

.evidence-discovery-form textarea:focus-visible,
.evidence-discovery-form select:focus-visible,
.evidence-discovery-find:focus-visible,
.evidence-discovery-prepare-button:focus-visible,
.evidence-candidate-actions button:focus-visible {
  outline: 2px solid var(--ios-accent-building);
  outline-offset: 2px;
}

.evidence-discovery-status {
  min-height: 1.2em;
  margin: 0;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.74) !important;
  line-height: 1.35;
}

.evidence-discovery-results {
  display: grid;
  gap: var(--space-3);
}

.evidence-discovery-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px;
  align-items: center;
  padding-top: var(--space-2);
}

.evidence-discovery-summary strong {
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.86) !important;
}

.evidence-discovery-summary span {
  grid-column: 1;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
}

.evidence-discovery-summary-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  gap: var(--space-2);
}

.evidence-candidate-view-all,
.evidence-candidate-find-more,
.evidence-candidate-review-rejected {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
}

.evidence-candidate-navigator {
  display: grid;
  border-top: 1px solid var(--border);
}

.evidence-candidate-navigator-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  min-height: 42px;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
}

.evidence-candidate-navigator-item strong {
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-candidate-navigator-item small {
  color: var(--text-secondary);
}

.evidence-candidate-navigator-item.is-active {
  color: var(--code-accent);
}

.evidence-candidate-navigator-item.is-selected small {
  color: #12b76a;
}

.evidence-candidate-navigator-item.is-rejected small {
  color: #d92d20;
}

.evidence-discovery-limitations,
.evidence-discovery-outside {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, #f79009 11%, var(--surface));
}

.evidence-discovery-limitations strong,
.evidence-discovery-outside strong {
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.8) !important;
}

.evidence-discovery-limitations ul {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding-left: 1rem;
}

.evidence-discovery-limitations li,
.evidence-discovery-outside li {
  margin: 0;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.74) !important;
  line-height: 1.4;
}

.evidence-discovery-outside ul,
.evidence-candidate-source-requirements ul,
.evidence-candidate-structured-sources ul,
.evidence-candidate-visual-sources ul {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding-left: 1rem;
}

.evidence-discovery-outside li {
  display: grid;
  gap: 3px;
}

.evidence-discovery-outside a {
  width: fit-content;
  color: var(--text-primary);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--text-primary) 45%, transparent);
  text-underline-offset: 2px;
}

.evidence-candidate-tray {
  display: grid;
  gap: 0;
}

.evidence-candidate-card {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.evidence-candidate-card.is-approved {
  background: transparent;
}

.evidence-candidate-card.is-rejected {
  background: transparent;
}

.evidence-candidate-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-1);
  align-items: baseline;
}

.evidence-candidate-heading > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.evidence-candidate-heading strong,
.evidence-candidate-heading p {
  margin: 0;
}

.evidence-candidate-heading strong {
  color: var(--code-accent);
  font-size: calc(var(--chrome-font-size) * 0.77) !important;
  font-weight: 650;
  line-height: 1.2;
}

.evidence-candidate-heading p {
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.946) !important;
  font-weight: 650;
  line-height: 1.25;
}

.evidence-candidate-rank {
  color: var(--code-accent);
  font-size: calc(var(--chrome-font-size) * 0.77) !important;
  font-weight: 650;
  line-height: 1.2;
}

.evidence-candidate-state {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--code-accent);
  font-size: calc(var(--chrome-font-size) * 0.68) !important;
  font-weight: 650;
}

.is-approved .evidence-candidate-state {
  background: transparent;
  color: #12b76a;
}

.is-rejected .evidence-candidate-state {
  background: transparent;
  color: #d92d20;
}

.evidence-candidate-why,
.evidence-candidate-signals {
  margin: 0;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.73) !important;
  line-height: 1.4;
}

.evidence-candidate-source-requirements {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, #f79009 16%, var(--surface));
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.73) !important;
  line-height: 1.4;
}

.evidence-candidate-structured-sources {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, #12b76a 13%, var(--surface));
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.73) !important;
  line-height: 1.4;
}

.evidence-candidate-visual-sources {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, #f79009 13%, var(--surface));
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.73) !important;
  line-height: 1.4;
}

.evidence-candidate-visual-sources p {
  margin: 0;
}

.evidence-candidate-visual-sources summary {
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 650;
}

.evidence-visual-source-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.evidence-visual-source-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2);
  align-items: start;
  padding: var(--space-2);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--text-primary) 7%, var(--surface));
  color: var(--text-secondary);
  cursor: pointer;
}

.evidence-visual-source-option.is-selected {
  background: color-mix(in srgb, #12b76a 22%, var(--surface));
  color: var(--text-primary);
}

.evidence-visual-source-option > input {
  margin-top: 3px;
}

.evidence-visual-source-option > img {
  grid-column: 1 / -1;
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  border-radius: calc(var(--radius-card) - 3px);
  background: color-mix(in srgb, var(--text-primary) 5%, var(--surface));
}

.evidence-visual-source-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.evidence-visual-source-copy span {
  overflow-wrap: anywhere;
  font-size: calc(var(--chrome-font-size) * 0.67) !important;
}

.evidence-visual-source-copy a {
  width: fit-content;
  color: var(--text-primary);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--text-primary) 45%, transparent);
  text-underline-offset: 2px;
}

.evidence-visual-review-confirmation {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  margin-top: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, #12b76a 14%, var(--surface));
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 650;
}

.evidence-visual-review-confirmation:has(input:disabled) {
  background: color-mix(in srgb, var(--text-primary) 6%, var(--surface));
  color: var(--text-secondary);
  cursor: not-allowed;
}

.evidence-candidate-source-requirements strong,
.evidence-candidate-structured-sources strong,
.evidence-candidate-visual-sources strong {
  color: var(--text-primary);
}

.evidence-candidate-source-requirements li,
.evidence-candidate-structured-sources li,
.evidence-candidate-visual-sources li {
  margin: 0;
}

.evidence-candidate-card blockquote {
  max-height: 180px;
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.8) !important;
  line-height: 1.5;
  white-space: pre-line;
}

.evidence-candidate-card blockquote .section-block {
  margin: 0;
  white-space: normal;
}

.evidence-candidate-card blockquote .section-html > :first-child {
  margin-top: 0;
}

.evidence-candidate-card blockquote .section-html > :last-child {
  margin-bottom: 0;
}

.evidence-candidate-card.is-active-review blockquote {
  max-height: none;
  overflow: visible;
}

.evidence-candidate-controls {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
  background: var(--research-conversation-background);
}

.evidence-candidate-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.evidence-candidate-actions button {
  min-width: 0;
  padding: 0 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
}

.evidence-candidate-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.evidence-candidate-navigation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-1) 0 0;
}

.evidence-candidate-navigation span {
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.68) !important;
  text-align: center;
}

.evidence-candidate-navigation button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
}

.evidence-candidate-navigation button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.evidence-candidate-approve[aria-pressed="true"] {
  background: #067647;
  color: #fff;
}

.evidence-candidate-reject[aria-pressed="true"] {
  background: #b42318;
  color: #fff;
}

.evidence-discovery-prepare {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-2);
}

.analysis-content .ghost-button {
  background: transparent;
  box-shadow: none;
}

.research-evidence-row {
  gap: var(--space-2);
}

.research-evidence-row > span {
  overflow-wrap: anywhere;
  font-size: 0.78rem;
}

.research-evidence-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.research-conversation-empty,
.research-list-status {
  color: var(--text-secondary);
  font-size: var(--chrome-font-size) !important;
  line-height: 1.45;
}

.research-usage {
  padding: var(--space-3) 0;
  border-block: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.82) !important;
}

.research-usage > strong {
  color: var(--text-primary);
}

.research-usage p {
  margin: var(--space-2) 0 0;
}

.research-conversation-list {
  display: grid;
}

.research-list-panel .research-conversation-list {
  width: 100%;
  min-width: 0;
  margin-inline: 0;
}

.research-history-group {
  display: grid;
}

.research-history-group-heading {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding-inline: var(--panel-padding);
}

.research-history-group-label {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 14px !important;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.research-history-group-label:hover,
.research-history-group-label:focus-visible,
.research-history-group-chevron:hover,
.research-history-group-chevron:focus-visible {
  color: var(--text-primary);
}

.research-history-group-chevron {
  margin-left: var(--space-2);
}

.research-history-group-body {
  display: grid;
}

.research-history-group.project-section-motion.is-open > .research-history-group-body {
  padding-top: 0;
}

.research-chat-start {
  display: grid;
  gap: var(--space-2);
  padding: clamp(var(--space-4), 5vh, var(--space-7)) 0 var(--space-3);
}

.research-chat-start > h3,
.research-chat-start > p {
  margin: 0;
}

.research-chat-start > h3 {
  font-size: 1.15rem;
}

.research-chat-start > p {
  max-width: 48ch;
  color: var(--text-secondary);
  line-height: 1.5;
}

.research-composer.research-start-composer {
  padding-bottom: var(--space-3);
  background: transparent;
}

.research-start-project {
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
}

.research-new-chat-button {
  min-height: 32px;
  padding-inline: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-primary);
  white-space: nowrap;
}

.research-history-selection-link {
  width: auto;
  height: var(--panel-title-control-size);
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}

.research-history-selection-link:hover,
.research-history-selection-link:focus-visible {
  color: var(--text-primary);
}

.research-history-select-button,
.research-history-delete-button {
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

.research-history-select-button svg,
.research-history-delete-button svg {
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.research-history-select-button[aria-pressed="true"] {
  color: var(--text-primary);
}

.research-history-select-button[hidden],
.research-history-delete-button[hidden] {
  display: none;
}

.research-history-delete-button:not(:disabled) {
  color: var(--text-primary);
}

.research-list-panel .panel-actions {
  align-items: center;
}

.research-list-panel.is-research-history-selecting .utility-close,
.research-list-panel.is-research-history-selecting .pane-drag-handle {
  display: none;
}

.research-conversation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  border-top: 1px solid var(--border);
}

.research-conversation-row.is-active {
  background: transparent;
  box-shadow: none;
}

.research-conversation-row.is-selected {
  background: color-mix(in srgb, var(--project-color, var(--accent-building)) 22%, transparent);
}

.research-conversation-row.is-selected .research-conversation-open {
  color: var(--text-primary);
}

.research-conversation-open,
.research-conversation-rename,
.research-conversation-delete {
  border: 0;
  background: transparent;
  color: var(--text-primary);
}

.research-conversation-open {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-4) var(--panel-padding);
  text-align: left;
}

.research-conversation-open strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.research-conversation-open strong {
  font-weight: 400;
  line-height: 1.35;
}

.research-conversation-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
}

.research-conversation-date {
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
  white-space: nowrap;
}

.research-conversation-project-pill {
  display: block;
  width: fit-content;
  max-width: min(70%, 260px);
  margin-left: auto;
  padding: 3px 9px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--project-color, var(--text-tertiary)) 32%, transparent);
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-conversation-row-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-right: var(--panel-padding);
}

.research-conversation-project-picker {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0 0 var(--space-3);
  overflow: hidden;
  border-radius: 22px;
  background: color-mix(in srgb, var(--text-tertiary) 16%, transparent);
}

.research-conversation-project-toggle {
  min-height: 30px;
  background: transparent;
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
}

.research-conversation-project-toggle:hover,
.research-conversation-project-toggle[aria-expanded="true"]:hover {
  background: transparent;
}

.research-conversation-project-options {
  display: block;
  margin: 0;
  padding: 0 var(--space-3);
  background-image: none;
}

.code-filter-menu.is-open .research-conversation-project-options {
  padding: var(--space-2) var(--space-3) var(--space-4);
}

.research-conversation-project-category {
  margin: var(--space-2) 0 2px;
  color: var(--text-tertiary);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.research-conversation-project-option {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--text-tertiary) 24%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
  font-weight: 400;
  text-align: left;
  white-space: normal;
}

.research-conversation-project-option:last-child {
  border-bottom: 0;
}

.research-conversation-project-option[aria-pressed="true"] {
  color: var(--text-primary);
  font-weight: 600;
}

.research-conversation-project-option:hover,
.research-conversation-project-option:focus-visible {
  color: var(--text-primary);
}

.research-conversation-rename {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 6px;
  place-items: center;
  color: var(--text-secondary);
}

.research-conversation-rename svg {
  width: 16px;
  height: 16px;
}

.research-conversation-rename:hover,
.research-conversation-rename:focus-visible {
  color: var(--text-primary);
}

.research-conversation-delete {
  padding: var(--space-2);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
}

.research-conversation-delete:hover,
.research-conversation-delete:focus-visible {
  color: #b42318;
}

.research-conversation-row.is-renaming {
  grid-template-columns: minmax(0, 1fr);
}

.research-conversation-rename-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2);
  align-items: center;
  min-height: 62px;
  padding: var(--space-2) 0;
}

.research-conversation-rename-input {
  min-width: 0;
  height: 34px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
  font: inherit;
}

.research-conversation-rename-form button {
  border: 0;
  background: transparent;
  color: var(--text-primary);
}

.research-conversation-rename-status {
  grid-column: 1 / -1;
  min-height: 1em;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
}

.research-conversation-panel {
  --pane-min-width: clamp(360px, 34vw, 560px);
  --research-conversation-background: #000000;
  background: var(--research-conversation-background);
}

.research-conversation-panel > .panel-header,
.research-conversation-panel > .panel-header .panel-actions,
.research-conversation-panel > .panel-header > div:first-child {
  align-items: center;
}

.research-conversation-panel > .panel-header > div:first-child {
  display: flex;
  min-height: 28px;
}

.research-conversation-panel > .panel-header .panel-kind {
  margin-bottom: 0;
  line-height: 1;
}

.analysis-panel.project-derived-panel,
.research-conversation-panel.project-derived-panel {
  --research-conversation-background: color-mix(in srgb, var(--project-color) 8%, var(--surface-raised));
  background: color-mix(in srgb, var(--project-color) 8%, var(--surface-raised));
}

.research-list-panel {
  position: relative;
  background: var(--background);
}

.research-conversation-content {
  display: grid;
  grid-template-rows:
    minmax(72px, var(--research-evidence-size, 36%))
    17px
    minmax(128px, 1fr);
  min-height: 0;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.research-conversation-content.is-evidence-pane-deferred {
  grid-template-rows: minmax(128px, 1fr);
}

.research-conversation-content.is-evidence-pane-deferred .research-dialogue-pane {
  grid-row: 1;
}

.research-conversation-embedded {
  min-height: 0;
}

.research-conversation-embedded .research-conversation-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-3);
  min-height: 0;
  padding-top: var(--space-3);
  overflow: visible;
}

.research-conversation-embedded .research-dialogue-pane {
  grid-row: 2;
  grid-template-rows: auto;
  overflow: visible;
}

.analysis-panel.has-research-composer {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.analysis-panel.has-research-composer > .analysis-content {
  width: calc(100% + (2 * var(--panel-padding)));
  min-width: 0;
  margin-inline: calc(-1 * var(--panel-padding));
  overflow-x: hidden;
  overflow-y: auto;
}

.analysis-panel.has-research-composer > .research-composer {
  padding: var(--space-3) 0 var(--panel-padding);
}

.research-selected-evidence-notices {
  display: grid;
  gap: var(--space-2);
}

.research-selected-evidence-drawer {
  border-block: 1px solid var(--border);
  padding: var(--space-2) 0;
}

.research-selected-evidence-drawer summary {
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 650;
}

.research-selected-evidence-list {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.research-selected-evidence-list li {
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.research-selected-evidence-open {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  width: 100%;
  gap: var(--space-2);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.research-selected-evidence-list span {
  color: var(--text-secondary);
}

.research-selected-evidence-passage {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-3);
  border-left: 2px solid var(--border-strong);
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.research-evidence-pane {
  grid-row: 1;
  min-height: 0;
  overflow: hidden;
}

.research-evidence-pane[hidden] {
  display: none;
}

.research-evidence-scroll {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.research-evidence-divider {
  grid-row: 2;
  position: relative;
  z-index: 6;
  min-height: 17px;
  cursor: row-resize;
  touch-action: none;
}

.research-evidence-divider::before {
  position: absolute;
  top: 8px;
  right: 0;
  left: 0;
  height: 1px;
  content: "";
  background: var(--border);
  transition: background 160ms ease, height 160ms ease;
}

.research-evidence-divider:hover::before,
.research-evidence-divider:focus-visible::before,
.research-evidence-divider.is-dragging::before {
  height: 2px;
  background: var(--text-tertiary);
}

.research-evidence-divider:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.research-evidence-divider[hidden] {
  display: none;
}

body.is-resizing-research-evidence,
body.is-resizing-research-evidence * {
  cursor: row-resize !important;
  user-select: none !important;
}

.research-dialogue-pane {
  grid-row: 3;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.research-reader-origin {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: 0;
  border: 0;
  background: transparent;
}

.research-reader-origin-list article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.research-reader-origin-list {
  display: grid;
  gap: var(--space-3);
}

.research-reader-origin-list article {
  padding: var(--space-3);
  border: 0;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--code-accent, var(--text-primary)) 13%, transparent);
}

.research-reader-origin-list blockquote {
  margin: var(--space-2) 0 0;
  padding: 0;
  border: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.research-reader-origin-open {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--code-accent, var(--text-primary));
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  text-underline-offset: 3px;
}

.research-reader-origin-open:hover {
  text-decoration: underline;
}

.research-reader-origin-open:focus-visible {
  outline: 2px solid var(--code-accent, var(--text-primary));
  outline-offset: 3px;
  border-radius: 3px;
}

.research-sources {
  padding: var(--space-2) 0 var(--space-4);
}

.research-sources-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  width: 100%;
  min-height: 1.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  font: inherit;
  text-align: left;
}

.research-source-list {
  display: grid;
  gap: 0;
  padding-top: var(--space-3);
}

.research-source-card {
  display: grid;
  gap: 0;
  padding: var(--space-3) 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  transition: row-gap 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.research-source-card.is-open {
  row-gap: var(--space-2);
}

.research-source-card + .research-source-card {
  border-top: 1px solid var(--border);
}

.research-source-toggle {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.research-source-disclosure {
  display: grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--text-secondary);
}

.research-source-disclosure svg {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
}

.research-chevron-up,
[aria-expanded="true"] > .research-source-disclosure .research-chevron-down {
  display: none;
}

[aria-expanded="true"] > .research-source-disclosure .research-chevron-up {
  display: block;
}

.research-source-body {
  display: grid;
  max-height: 0;
  min-height: 0;
  gap: var(--space-2);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    max-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 260ms ease;
}

.research-source-card.is-open > .research-source-body {
  max-height: var(--research-source-body-height, 1000px);
  opacity: 1;
  pointer-events: auto;
}

.research-source-card.is-restoring > .research-source-body {
  transition: none;
}

.research-source-card.is-restoring {
  transition: none;
}

.research-source-body[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .research-source-card,
  .research-source-body {
    transition: none;
  }
}

.research-source-toggle > strong,
.research-source-body > p,
.research-source-card blockquote {
  margin: 0;
}

.research-source-structured-tables {
  display: grid;
  min-width: 0;
  gap: var(--space-3);
}

.research-source-structured-table {
  margin: 0;
  font-family: var(--reader-font-family);
  font-size: 0.9rem !important;
}

.research-source-structured-table table {
  width: 100%;
  min-width: 32rem;
  table-layout: auto;
}

.research-source-structured-table caption {
  padding: 0 0 var(--space-2);
  color: var(--text-primary);
  font-weight: 700;
  text-align: left;
}

.research-source-structured-table :where(th, td) {
  min-width: 6rem;
  padding: var(--space-2);
  white-space: normal;
}

.research-source-toggle > strong {
  color: var(--code-accent);
}

.research-source-body > p:not(.section-label) {
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.84) !important;
}

.research-source-card blockquote {
  padding-left: var(--space-3);
  border-left: 2px solid var(--code-accent, var(--text-primary));
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-line;
}

.research-visual-evidence {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, #12b76a 12%, var(--surface));
}

.research-visual-evidence-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-2);
}

.research-visual-evidence-gallery article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: var(--space-2);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--text-primary) 7%, var(--surface));
}

.research-visual-evidence-gallery img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: calc(var(--radius-card) - 3px);
  background: var(--surface);
}

.research-visual-evidence-gallery strong,
.research-visual-evidence-gallery span {
  overflow-wrap: anywhere;
}

.research-visual-evidence-gallery span {
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.68) !important;
}

.research-visual-evidence-gallery a {
  width: fit-content;
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
  font-weight: 650;
}

.research-source-warning {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, #b54708 48%, var(--border));
  border-radius: var(--radius-card);
  background: color-mix(in srgb, #f79009 10%, var(--surface));
}

.research-source-warning p {
  margin: 0;
  line-height: 1.45;
}

.research-source-warning .ghost-button {
  justify-self: start;
}

.research-project-context {
  display: grid;
  gap: var(--space-3);
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.research-project-context-warning p {
  margin: 0;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.82) !important;
  line-height: 1.45;
}

.research-project-select {
  width: 100%;
}

.research-project-select {
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-tertiary) 16%, transparent);
  color: var(--text-primary);
  font: inherit;
  font-size: var(--chrome-font-size) !important;
  box-shadow: none;
}

.research-project-select:focus-visible,
.research-project-context textarea:focus-visible,
.project-research-context-editor textarea:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

.research-project-context-warning {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, #f79009 16%, var(--surface));
}

.research-project-context-warning[hidden] {
  display: none;
}

.research-project-context-form {
  display: grid;
  gap: var(--space-2);
}

.research-project-context-form label {
  display: grid;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
  font-weight: 650;
  text-transform: none;
}

.research-project-context-form textarea {
  width: 100%;
  resize: vertical;
  padding: var(--space-3);
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-weight: 400;
  line-height: 1.45;
}

.research-message-thread {
  display: grid;
  min-height: 0;
  gap: var(--space-2);
  align-content: start;
  padding-top: var(--space-3);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.research-message {
  min-width: 0;
}

.research-message.is-user {
  justify-self: end;
  max-width: 86%;
  padding: var(--space-3) var(--space-4);
  border-radius: 18px 18px 5px 18px;
  background: rgb(246 244 241 / 10%);
  color: #fff;
  opacity: 1;
  line-height: var(--reader-line-height);
}

.research-message.is-user > p {
  margin: 0;
}

.research-message-capture {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  font-size: calc(var(--chrome-font-size) * 0.8);
}

.research-message-capture > span {
  font-weight: 700;
}

.research-message-capture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.research-message-capture-actions button {
  min-height: 42px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text-primary);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.research-message-capture-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.research-message-capture-status {
  min-height: 1.2em;
  margin: 0;
  opacity: 0.78;
}

.research-message.is-assistant .research-result-card {
  padding: var(--space-4);
  border: 0;
  background: transparent;
}

.research-message.is-assistant {
  display: grid;
  gap: var(--space-3);
}

.research-message.is-assistant.is-pending {
  min-block-size: 0;
}

.research-progress-card {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
}

.research-progress-loading {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: end;
  gap: 2px var(--space-2);
  align-items: center;
  min-height: 0;
  text-align: right;
}

.research-progress-grid {
  display: grid;
  grid-template-columns: repeat(3, 2px);
  grid-auto-rows: 2px;
  gap: 1px;
  width: 8px;
  height: 8px;
}

.research-progress-grid > span {
  border-radius: 1px;
  background: currentColor;
  opacity: 0.24;
  animation: research-progress-pixel 1.35s ease-in-out infinite;
  animation-delay: calc(var(--research-progress-pixel) * 70ms);
}

[data-progress-state="completed"] .research-progress-grid > span,
[data-progress-state="failed"] .research-progress-grid > span,
[data-progress-state="cancelled"] .research-progress-grid > span {
  animation: none;
  opacity: 0.55;
}

body .panel-track > article.workspace-panel:not(.reader-panel) .research-progress-loading-label {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px !important;
  font-weight: 400;
  line-height: 1.35;
  color: var(--text-primary);
}

[data-progress-state="completed"] .research-progress-loading-label,
[data-progress-state="failed"] .research-progress-loading-label,
[data-progress-state="cancelled"] .research-progress-loading-label {
  animation: none;
  background: none;
  color: var(--text-primary);
}

body .panel-track > article.workspace-panel:not(.reader-panel) .research-progress-elapsed {
  grid-column: 1 / -1;
  justify-self: end;
  color: var(--text-secondary);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 14px !important;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.research-progress-error {
  margin: 0;
  color: var(--destructive);
  font-size: calc(var(--chrome-font-size) * 0.8) !important;
  line-height: 1.4;
}

.research-progress-actions {
  display: flex;
  justify-content: flex-end;
}

.research-progress-actions .ghost-button {
  min-height: 34px;
}

.research-progress-actions .research-progress-cancel,
.research-progress-actions .research-progress-retry {
  min-height: 42px;
  padding-inline: var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: rgb(246 244 241 / 10%);
  color: #fff;
  box-shadow: none;
}

@keyframes research-progress-pixel {
  0%, 100% { opacity: 0.2; transform: scale(0.82); }
  45% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .research-progress-grid > span {
    animation: none;
    transform: none;
  }

  .research-progress-grid > span {
    opacity: 0.58;
  }
}

.research-answer-source-text {
  margin: 0 var(--space-4);
  color: var(--text-secondary);
}

.research-evidence-reviewed-body > .research-answer-source-text {
  margin: 0;
}

.research-answer-source-text > summary {
  width: fit-content;
  cursor: pointer;
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
}

.research-answer-source-list {
  display: grid;
  gap: var(--space-4);
  padding-top: var(--space-2);
}

.research-answer-source-group {
  display: grid;
  gap: var(--space-2);
}

.research-answer-source-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
}

.research-answer-source-group-heading strong {
  font: inherit;
  font-weight: 700;
}

.research-answer-source-group.is-cited {
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--text-primary) 5%, transparent);
}

.research-answer-source-group-items {
  display: grid;
}

.research-answer-source-group-items .research-source-card {
  grid-template-columns: 1.5rem minmax(0, 1fr);
  align-items: start;
  padding-block: var(--space-2);
}

.research-answer-source-number {
  color: var(--text-tertiary);
  font-size: calc(var(--chrome-font-size) * 0.76) !important;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.research-answer-source-group-items .research-source-card + .research-source-card {
  border-top: 0;
}

.research-answer-source-list .research-source-toggle > strong {
  font-weight: 400;
}

.research-conversation-header-project {
  max-width: 180px;
  min-height: 28px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  appearance: none;
  -webkit-appearance: none;
  background: color-mix(in srgb, var(--project-color, var(--text-tertiary)) 42%, var(--surface));
  background-image: none;
  color: var(--text-primary);
  font-size: 10px !important;
  text-overflow: ellipsis;
}

.research-historical-details {
  margin-top: var(--space-2);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.research-historical-details > summary {
  cursor: pointer;
  padding: var(--space-3);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.82) !important;
  font-weight: 650;
}

.research-historical-body {
  padding: 0 var(--space-3) var(--space-3);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.82) !important;
}

.research-historical-record {
  display: grid;
  gap: var(--space-3);
}

.research-historical-heading {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: var(--text-primary);
  color: var(--surface);
}

.research-historical-heading span {
  color: color-mix(in srgb, var(--surface) 76%, transparent);
  font-size: calc(var(--chrome-font-size) * 0.76) !important;
}

.research-historical-question {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.research-historical-answer .research-result-card {
  padding: var(--space-3);
  border: 0;
  background: var(--surface-muted);
}

.research-historical-evidence {
  display: grid;
  gap: var(--space-2);
}

.research-historical-evidence article {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: var(--surface-muted);
}

.research-historical-evidence span,
.research-historical-evidence code {
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
}

.research-historical-evidence blockquote {
  margin: 0;
  padding-left: var(--space-3);
  border-left: 3px solid var(--text-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.research-historical-mapping {
  display: grid;
  gap: var(--space-2);
}

.research-historical-mapping ul {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.research-historical-reuse {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--ios-accent-building) 9%, var(--surface-muted));
}

.research-historical-reuse p,
.research-historical-status {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.research-historical-reuse-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
}

.research-historical-reuse .ghost-button {
  background: var(--text-primary);
  color: var(--surface);
}

.research-historical-status:empty {
  display: none;
}

.research-composer {
  position: relative;
  z-index: 5;
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-3) 0 var(--panel-padding);
  background: var(--research-conversation-background);
  isolation: isolate;
}

.research-composer-box {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface-muted);
}

.research-composer .research-question-input {
  display: block;
  min-height: 78px;
  resize: none;
  padding: var(--space-3) var(--space-3) calc(42px + var(--space-3));
  border: 0;
  border-radius: inherit;
  background: rgb(246 244 241 / 10%);
  color: #ffffff;
  overflow-y: hidden;
  outline: 0;
}

.research-send-button {
  position: absolute;
  right: var(--space-2);
  bottom: var(--space-2);
  min-height: 42px;
  border: 0;
  border-radius: var(--radius-pill);
  color: #ffffff;
  box-shadow: none;
}

.research-composer-status {
  min-height: 1.2em;
  margin: 0;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.82) !important;
}

.research-composer-status:empty {
  display: none;
}

@media (max-height: 560px) {
  .research-composer .research-question-input {
    min-height: 58px;
  }

  .research-composer {
    padding-top: var(--space-2);
  }
}

@media (max-width: 560px) {
  .research-historical-reuse-controls {
    grid-template-columns: 1fr;
  }
}

.saved-row {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
}

.projects-content .project-card,
.saved-code-group .saved-row {
  padding: var(--space-4) 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.projects-content .project-card {
  min-height: 84px;
  padding: var(--space-3) calc(var(--space-4) + (var(--panel-title-control-size) * 3) + (var(--space-2) * 3)) var(--space-3) var(--space-4);
  border: 0;
  border-radius: var(--radius-card);
  background: transparent;
}

.project-card-actions {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  gap: var(--space-1);
}

.project-selection-check {
  position: absolute;
  top: 50%;
  right: var(--space-3);
  display: none;
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  place-items: center;
  color: var(--text-secondary);
  transform: translateY(-50%);
}

.project-selection-check svg {
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.project-selection-checkmark {
  opacity: 0;
}

.is-project-selecting .project-selection-check {
  display: grid;
}

.is-project-selecting .projects-content .project-row {
  padding-right: calc(var(--space-4) + var(--panel-title-control-size) + var(--space-2));
  padding-left: var(--space-4);
}

.is-project-selecting .project-card-actions {
  display: none;
}

.is-project-selecting .project-row.is-selected {
  outline: 2px solid color-mix(in srgb, var(--project-color) 66%, var(--text-primary));
  outline-offset: -2px;
  background: color-mix(in srgb, var(--project-color) 42%, transparent);
}

.is-project-selecting .project-row.is-selected .project-selection-check {
  color: var(--text-primary);
}

.is-project-selecting .project-row.is-selected .project-selection-checkmark {
  opacity: 1;
}

.project-count-badge {
  display: grid;
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  place-items: center;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
  font-weight: 650;
  line-height: 1;
}

.project-card-action {
  display: grid;
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

.project-card-action:hover,
.project-card-action:focus-visible {
  color: var(--text-primary);
}

.project-card-action.is-delete:hover,
.project-card-action.is-delete:focus-visible {
  color: #c62828;
}

.project-card-action svg {
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.projects-content .project-row {
  background: color-mix(in srgb, var(--project-color) 16%, transparent);
}

.projects-content .project-row.is-open {
  background: color-mix(in srgb, var(--project-color) 32%, transparent);
}

.projects-content .project-row.is-detached {
  background: color-mix(in srgb, var(--project-color) 24%, transparent);
}

.project-detached-label {
  display: inline-flex;
  width: fit-content;
  margin-top: var(--space-1);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.66) !important;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (prefers-color-scheme: dark) {
  .projects-content .project-row {
    background: color-mix(in srgb, var(--project-color) 24%, transparent);
  }

  .projects-content .project-row.is-open {
    background: color-mix(in srgb, var(--project-color) 42%, transparent);
  }

  .projects-content .project-row.is-detached {
    background: color-mix(in srgb, var(--project-color) 34%, transparent);
  }
}

.projects-content .project-card h3 {
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
  font-weight: 650;
}

.projects-content .project-card p {
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
}

.projects-content .project-empty-card {
  justify-content: center;
}

.projects-content > .section-label,
.saved-content > .section-label {
  padding-top: var(--space-4);
  border-top: 0;
}

.projects-content > .section-label {
  padding-top: 0;
  border-top: 0;
}

.project-row h3 {
  color: var(--text-primary);
}

.project-row {
  cursor: pointer;
}

.project-row:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--project-color) 42%, transparent);
  outline-offset: 3px;
}

.project-detail-panel {
  --project-pane-band-height: calc(var(--panel-padding) + var(--panel-title-row-height) + var(--space-3));
  --project-pane-band-background: color-mix(in srgb, var(--project-color) 42%, var(--surface));
  display: grid;
  position: relative;
  grid-template-rows: auto minmax(0, 1fr);
  isolation: isolate;
  background: var(--surface-raised);
}

.project-detail-loading-status {
  margin: 0;
  padding: var(--space-5) 0;
  color: var(--text-secondary);
}

.saved-project-tile.is-opening {
  background: color-mix(in srgb, var(--project-color) 22%, var(--surface));
}

.project-detail-chrome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  padding-top: calc(var(--project-pane-band-height) - var(--panel-padding) + var(--space-3));
}

.project-detail-actions {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: start;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.project-detail-header-actions {
  position: absolute;
  top: 0;
  right: 0;
  align-items: start;
  justify-content: end;
}

.project-workboard-button,
.project-notebook-button,
.project-report-draft-button,
.project-coordination-button {
  min-height: var(--panel-title-control-size);
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--project-color) 14%, var(--surface));
  color: var(--text-primary);
  font-size: 11px !important;
  font-weight: 600;
}

.project-workboard-button:hover,
.project-workboard-button:focus-visible,
.project-workboard-button[aria-pressed="true"],
.project-notebook-button:hover,
.project-notebook-button:focus-visible,
.project-notebook-button[aria-pressed="true"],
.project-report-draft-button:hover,
.project-report-draft-button:focus-visible,
.project-report-draft-button[aria-pressed="true"],
.project-coordination-button:hover,
.project-coordination-button:focus-visible,
.project-coordination-button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--project-color) 28%, var(--surface));
}

.section-detail-chrome,
.project-detail-chrome {
  align-items: start;
  min-height: var(--panel-title-row-height);
  margin-bottom: var(--space-3);
  padding-right: 0;
  padding-bottom: 0;
  padding-left: 0;
}

.project-detail-back {
  display: grid;
  margin-left: auto;
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
  line-height: 1;
}

.project-detail-back:hover,
.project-detail-back:focus-visible {
  color: var(--text-primary);
}

.project-detail-back svg {
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.project-detail-heading {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.project-detail-heading h2 {
  min-width: 0;
  margin: 0;
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
  font-weight: 650;
  line-height: normal;
}

.project-detail-heading p {
  min-width: 0;
  margin: 0;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.project-detail-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: var(--space-4) 0 108px;
}

.project-detail-content > * {
  flex: 0 0 auto;
}

.project-context-notice {
  margin-top: auto;
  padding: var(--space-5) 0 0;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.72);
  line-height: 1.35;
}

.project-context-notice strong {
  display: block;
  color: inherit;
  font-size: inherit;
  font-weight: 650;
}

.project-context-notice p {
  margin: 2px 0 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.project-studio-overview,
.project-studio-section {
  display: grid;
  gap: var(--space-2);
}

.project-studio-overview {
  padding: 0 0 var(--space-5);
}

.project-studio-copy,
.project-studio-empty,
.project-studio-warning {
  margin: 0;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.76) !important;
  line-height: 1.45;
}

.project-studio-warning {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, #c78220 16%, var(--surface));
  color: var(--text-primary);
}

.project-sync-stale-warning {
  display: grid;
  gap: var(--space-1);
}

.workspace-panel.has-stale-project-sync:not(.workboard-panel) {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.workboard-panel.has-stale-project-sync {
  grid-template-rows: auto minmax(0, 1fr);
}

.project-sync-stale-warning p {
  margin: 0;
}

.project-research-context-editor {
  margin-top: 0;
  margin-bottom: var(--space-5);
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--project-color) 12%, var(--surface));
  box-shadow: none;
}

.project-research-context-conversation {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-research-context-editor .research-project-context-form textarea {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.project-studio-section {
  margin-top: var(--space-5);
}

.project-detail-content > .project-studio-section + .project-studio-section {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.project-detail-section.project-studio-section {
  gap: 0;
  margin-top: 0;
}

.project-detail-section.project-studio-section > .project-studio-section-heading {
  min-height: 26px;
}

.project-studio-section-heading {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.project-section-count {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--text-primary);
  font-size: 10px !important;
  font-weight: 700;
  line-height: 1;
}

.project-studio-section-heading > button {
  min-height: 32px;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--project-color) 18%, var(--surface));
  color: var(--text-primary);
  font-size: 10px !important;
  font-weight: 650;
}

.project-notes-heading {
  gap: var(--space-2);
}

.project-studio-section-heading > .project-notes-toggle-label {
  flex: 1 1 auto;
  justify-content: flex-start;
  min-height: 32px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
}

.project-notes-toggle-label:hover,
.project-notes-toggle-label:focus-visible {
  color: var(--text-primary);
}

.project-collapsible-heading {
  gap: var(--space-2);
}

.project-studio-section-heading > .project-section-toggle-label {
  flex: 1 1 auto;
  justify-content: flex-start;
  min-height: 32px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
}

.project-section-toggle-label:hover,
.project-section-toggle-label:focus-visible {
  color: var(--text-primary);
}

.project-section-heading-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-2);
}

.project-studio-section-heading > .project-section-heading-actions {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.project-section-toggle-chevron {
  display: grid;
  flex: 0 0 var(--panel-title-control-size);
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.project-section-toggle-chevron:hover,
.project-section-toggle-chevron:focus-visible {
  color: var(--text-primary);
}

.project-section-toggle-chevron svg {
  grid-area: 1 / 1;
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.project-section-toggle-chevron[aria-expanded="true"] .research-chevron-down,
.project-section-toggle-chevron[aria-expanded="false"] .research-chevron-up {
  display: none;
}

.project-studio-collapsible-body {
  display: grid;
  gap: var(--space-2);
}

.project-section-motion {
  gap: 0;
}

.project-section-motion > .project-section-motion-body {
  max-height: 0;
  min-height: 0;
  overflow: hidden;
  padding-top: 0;
  opacity: 0;
  pointer-events: none;
  transition:
    max-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 260ms ease,
    padding 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.project-section-motion.is-open > .project-section-motion-body {
  max-height: var(--project-section-body-height, 0px);
  padding-top: var(--space-2);
  opacity: 1;
  pointer-events: auto;
}

.project-section-motion.is-open.is-settled > .project-section-motion-body {
  max-height: none;
}

.project-section-motion.is-restoring > .project-section-motion-body {
  transition: none;
}

.project-studio-collapsible-body[hidden] {
  display: none;
}

.project-notes-heading-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-2);
}

.project-note-add {
  min-height: 32px;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--project-color) 18%, var(--surface));
  color: var(--text-primary);
  font-size: 10px !important;
  font-weight: 650;
}

.project-notes-toggle-chevron {
  display: grid;
  flex: 0 0 var(--panel-title-control-size);
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.project-notes-toggle-chevron:hover,
.project-notes-toggle-chevron:focus-visible {
  color: var(--text-primary);
}

.project-notes-toggle-chevron svg {
  grid-area: 1 / 1;
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.project-notes-toggle-chevron[aria-expanded="true"] .research-chevron-down,
.project-notes-toggle-chevron[aria-expanded="false"] .research-chevron-up {
  display: none;
}

.project-collaboration-notes-body {
  display: grid;
  gap: var(--space-2);
}

.project-note-block-editor {
  position: relative;
  height: 260px;
  min-width: 0;
  min-height: 220px;
  max-height: min(70vh, 760px);
  overflow: auto;
  resize: none;
  border-radius: var(--radius-card);
  background: transparent;
}

.project-note-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  height: 16px;
  cursor: row-resize;
  touch-action: none;
}

.project-note-editor-surface {
  height: 100%;
  min-height: 100%;
  max-height: none;
  overflow: auto;
}

.project-note-editor-surface .bn-container,
.project-note-editor-surface .bn-editor {
  min-height: 100%;
}

.project-collaboration-notes {
  margin-bottom: 0;
}

.project-collaboration-notes-body[hidden] {
  display: none;
}

.project-research-history-card {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: var(--space-2);
  gap: 4px;
  width: 100%;
  padding: var(--space-3) 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.project-research-history-card + .project-research-history-card {
  border-top: 1px solid var(--border);
}

.project-research-history-card:hover,
.project-research-history-card:focus-visible {
  background: transparent;
  color: var(--project-color);
}

.project-research-history-card:hover :is(strong, p, span),
.project-research-history-card:focus-visible :is(strong, p, span) {
  color: inherit;
}

.project-research-history-card strong {
  font-size: calc(var(--chrome-font-size) * 0.82) !important;
  font-weight: 400;
  line-height: 1.3;
}

.project-studio-section-heading > .saved-project-research-toggle {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
}

.project-studio-section-heading > .saved-project-research-toggle:hover,
.project-studio-section-heading > .saved-project-research-toggle:focus-visible {
  background: transparent;
  color: var(--text-primary);
}

.saved-project-research-body {
  display: grid;
  gap: 0;
}

.project-research-history-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.74) !important;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.project-research-history-card span {
  color: var(--text-secondary);
  font-size: 10px !important;
  font-weight: 650;
}

.project-research-history-index {
  align-self: start;
  text-align: left;
}

.project-studio-activity ol {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-studio-activity ol[hidden] {
  display: none;
}

.project-studio-activity-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
}

.project-studio-activity-toggle:hover,
.project-studio-activity-toggle:focus-visible {
  color: var(--text-primary);
}

.project-studio-activity-chevron,
.project-studio-activity-chevron svg {
  display: grid;
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
  place-items: center;
}

.project-activity-heading-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.project-studio-activity-toggle[aria-expanded="true"] .research-chevron-down,
.project-studio-activity-toggle[aria-expanded="false"] .research-chevron-up {
  display: none;
}

.project-studio-activity li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--project-color) 24%, transparent);
}

.project-studio-activity li:first-child {
  border-top: 1px solid color-mix(in srgb, var(--project-color) 24%, transparent);
}

.project-studio-activity li strong {
  min-width: 0;
  overflow: hidden;
  font-size: calc(var(--chrome-font-size) * 0.75) !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-studio-activity li span {
  color: var(--text-secondary);
  font-size: 10px !important;
  text-align: right;
  white-space: nowrap;
}

.project-review-scope {
  color: var(--text-secondary);
  font-size: 9px !important;
  font-weight: 650;
}

.project-evidence-reviews,
.project-report-exports,
.project-collaboration-notes,
.project-review-threads {
  display: grid;
  gap: var(--space-2);
}

.project-evidence-review,
.project-report-export,
.project-collaboration-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--project-color) 9%, var(--surface));
}

.project-evidence-review > div:first-child,
.project-report-export > div:first-child,
.project-collaboration-card > div:first-child,
.project-collaboration-card > div:first-child > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.project-evidence-review strong,
.project-report-export strong,
.project-collaboration-card strong {
  font-size: calc(var(--chrome-font-size) * 0.78) !important;
  line-height: 1.3;
}

.project-evidence-review span,
.project-report-export span,
.project-collaboration-card span {
  color: var(--text-secondary);
  font-size: 10px !important;
  font-weight: 650;
}

.project-evidence-review p,
.project-collaboration-card > p {
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.7) !important;
  line-height: 1.4;
}

.project-evidence-review-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-1);
}

.project-evidence-review-actions button,
.project-report-export > button,
.project-collaboration-card > div:first-child > button,
.project-review-request-actions button,
.project-collaboration-editor-actions button,
.project-review-comment-form button {
  min-height: 34px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--project-color) 28%, var(--surface));
  color: var(--text-primary);
  font: inherit;
  font-size: calc(var(--chrome-font-size) * 0.7) !important;
  font-weight: 700;
}

.project-evidence-review-actions button:hover,
.project-report-export > button:hover,
.project-collaboration-card > div:first-child > button:hover,
.project-review-request-actions button:hover,
.project-collaboration-editor-actions button:hover,
.project-review-comment-form button:hover {
  background: color-mix(in srgb, var(--project-color) 40%, var(--surface));
}

.project-evidence-review-actions button:focus-visible,
.project-report-export > button:focus-visible,
.project-collaboration-card > div:first-child > button:focus-visible,
.project-review-request-actions button:focus-visible,
.project-collaboration-editor-actions button:focus-visible,
.project-review-comment-form button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--project-color) 56%, transparent);
  outline-offset: 2px;
}

.project-evidence-review-actions button:disabled,
.project-report-export > button:disabled,
.project-collaboration-card > div:first-child > button:disabled,
.project-review-request-actions button:disabled,
.project-collaboration-editor-actions button:disabled,
.project-review-comment-form button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.project-collaboration-card {
  display: grid;
  align-items: stretch;
  justify-content: stretch;
}

.project-collaboration-card > div:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.project-review-thread.is-resolved,
.project-review-thread.is-dismissed {
  background: color-mix(in srgb, var(--project-color) 5%, var(--surface));
}

.project-collaboration-editor-slot:empty {
  display: none;
}

.project-collaboration-editor {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--project-color) 12%, var(--surface));
}

.project-collaboration-editor input,
.project-collaboration-editor textarea,
.project-collaboration-editor select,
.project-review-comment-form textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 0;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--project-color) 7%, var(--surface-raised));
  color: var(--text-primary);
  font: inherit;
  font-size: calc(var(--chrome-font-size) * 0.74) !important;
  line-height: 1.4;
  resize: vertical;
}

.project-collaboration-editor input:focus-visible,
.project-collaboration-editor textarea:focus-visible,
.project-collaboration-editor select:focus-visible,
.project-review-comment-form textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--project-color) 56%, transparent);
  outline-offset: 2px;
}

.project-collaboration-editor-actions,
.project-review-request-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-1);
}

.project-review-thread-heading {
  align-items: flex-start;
}

.project-review-comments {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-review-comments li {
  display: grid;
  gap: 3px;
  padding: var(--space-2);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--project-color) 7%, var(--surface));
}

.project-review-comments p {
  margin: 0;
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
  line-height: 1.4;
  white-space: pre-wrap;
}

.project-review-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--space-2);
}

.project-studio-metric:focus-visible,
.project-studio-section-heading > button:focus-visible,
.project-research-history-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--project-color) 56%, transparent);
  outline-offset: 2px;
}

.project-detail-section {
  display: grid;
  gap: 0;
  margin-top: var(--space-2);
}

.project-detail-saved-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: var(--space-1);
  width: 100%;
  padding: var(--space-1) 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.project-evidence-select-button svg {
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.project-evidence-bulk-bar {
  position: static;
  margin-bottom: var(--space-2);
  padding: var(--space-2);
  border: 0;
  background: var(--surface-muted);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.project-evidence-selection-check {
  position: absolute;
  top: 50%;
  right: 0;
  display: none;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--text-secondary);
  pointer-events: none;
  transform: translateY(-50%);
}

.project-evidence-selection-check svg {
  width: 20px;
  height: 20px;
}

.project-saved-evidence-body.is-selecting .project-detail-saved-row {
  padding-right: 32px;
  cursor: pointer;
}

.project-saved-evidence-body.is-selecting .project-evidence-selection-check {
  display: grid;
}

.project-saved-evidence-body.is-selecting .project-detail-saved-row.is-selected {
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--project-color) 16%, transparent);
}

.project-saved-evidence-body.is-selecting .project-detail-saved-row.is-selected .project-evidence-selection-check {
  color: var(--text-primary);
}

.project-detail-saved-row.is-read-only {
  grid-template-columns: minmax(0, 1fr);
}

.project-saved-code-group {
  display: grid;
  gap: 0;
}

.project-saved-code-group + .project-saved-code-group {
  margin-top: var(--space-2);
}

.project-detail-section .section-label.saved-code-label {
  margin: var(--space-2) 0 2px;
}

.project-detail-section-preview {
  display: -webkit-box;
  margin: 1px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.76) !important;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.saved-panel {
  --saved-font-size: var(--reader-font-size);
  position: relative;
  grid-template-rows: auto minmax(0, 1fr);
}

.saved-column-scroll {
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-color: color-mix(in srgb, var(--text-tertiary) 58%, transparent) transparent;
  scrollbar-width: thin;
}

.saved-column-scroll::-webkit-scrollbar {
  width: 6px;
}

.saved-column-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.saved-column-scroll::-webkit-scrollbar-thumb {
  border: 1px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-tertiary) 58%, transparent);
  background-clip: padding-box;
}

.saved-panel .saved-content {
  min-height: auto;
  overflow: visible;
  scrollbar-gutter: auto;
}

.saved-panel .saved-content[hidden] {
  display: none;
}

.saved-projects-section {
  --saved-projects-card-radius: 12px;
  display: grid;
  gap: 0;
  margin-top: var(--space-2);
  overflow: hidden;
  padding: 0;
  border-radius: var(--saved-projects-card-radius);
  background: var(--menu-subtle-surface);
}

.saved-projects-heading {
  position: relative;
  display: flex;
  min-height: var(--panel-title-control-size);
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.saved-projects-menu-toggle {
  flex: 1 1 auto;
  border-radius: var(--radius-control);
}

.saved-projects-menu-toggle[aria-expanded="true"],
.saved-projects-menu-toggle[aria-expanded="true"]:hover {
  background: transparent;
}

.saved-projects-actions {
  position: absolute;
  top: 50%;
  right: calc(var(--space-3) + 18px + var(--space-2));
  z-index: 1;
  display: none;
  align-items: center;
  gap: var(--space-2);
  transform: translateY(-50%);
}

.saved-projects-menu.is-open .saved-projects-actions {
  display: flex;
}

.saved-projects-actions button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.saved-projects-actions button:hover,
.saved-projects-actions button:focus-visible,
.saved-projects-selection-action:hover,
.saved-projects-selection-action:focus-visible {
  color: var(--text-primary);
}

.saved-projects-actions svg {
  width: 14px;
  height: 14px;
}

.saved-project-list,
.saved-collections-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  gap: var(--space-2);
  border-radius: var(--radius-control);
}

.saved-collections-section {
  display: grid;
  grid-column: 1 / -1;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.saved-collections-heading {
  margin: 0;
  color: var(--text-secondary);
  font-size: calc(var(--saved-font-size) * 0.78) !important;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

@container (min-width: 320px) {
  .saved-project-list,
  .saved-collections-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container (min-width: 580px) {
  .saved-project-list,
  .saved-collections-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@container (min-width: 820px) {
  .saved-project-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.saved-projects-menu.is-open .saved-project-list {
  padding: var(--space-2);
  max-height: min(var(--code-filter-menu-height, 240px), 52vh, 360px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}

.saved-projects-archive-button[aria-pressed="true"] {
  color: var(--text-primary);
}

.saved-projects-select-button[hidden] {
  display: none;
}

.saved-projects-add-button[hidden],
.saved-projects-archive-button[hidden] {
  display: grid;
  visibility: hidden;
  pointer-events: none;
}

.saved-projects-section.is-selecting .saved-projects-add-button,
.saved-projects-section.is-selecting .saved-projects-archive-button,
.saved-projects-section.is-selecting .saved-projects-select-button {
  display: none !important;
}

.saved-projects-section.is-selecting .saved-project-tile[data-bulk-selectable="true"] {
  grid-template-columns: minmax(0, 1fr) auto auto;
  cursor: pointer;
  opacity: 0.58;
}

.saved-projects-section.is-selecting .saved-project-tile[data-bulk-selectable="false"] {
  opacity: 0.48;
  cursor: not-allowed;
}

.saved-project-tile.is-bulk-selected {
  opacity: 1 !important;
  box-shadow: none;
}

.saved-projects-selection-action:disabled {
  opacity: 0.42;
}

.saved-projects-selection-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.saved-projects-selection-actions[hidden] {
  display: none;
}

.saved-projects-selection-action {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.saved-projects-selection-action svg {
  width: 13px;
  height: 13px;
}

.saved-projects-actions .saved-projects-selection-cancel {
  width: auto;
  padding-inline: var(--space-1);
  font-size: calc(var(--chrome-font-size) * 0.66);
  font-weight: 400;
}

.saved-projects-selection-delete:not(:disabled):hover,
.saved-projects-selection-delete:not(:disabled):focus-visible {
  color: #ef6b73;
}

.saved-project-tile {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto;
  min-width: 0;
  min-height: 42px;
  gap: 0 var(--space-1);
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--project-color) 42%, var(--surface));
  color: var(--text-primary);
  cursor: pointer;
  transition: opacity 160ms ease;
}

.saved-project-list:has(.saved-project-tile.is-selected) .saved-project-tile:not(.is-selected) {
  opacity: 0.58;
}

.saved-project-list:has(.saved-project-tile.is-selected) .saved-project-tile:not(.is-selected):hover,
.saved-project-list:has(.saved-project-tile.is-selected) .saved-project-tile:not(.is-selected):focus-visible {
  opacity: 0.78;
}

.saved-project-tile[data-draggable="true"] {
  cursor: grab;
}

.saved-project-tile.is-dragging {
  opacity: 0.82;
  cursor: grabbing;
}

.saved-project-tile.is-drop-before::before,
.saved-project-tile.is-drop-after::after {
  position: absolute;
  right: 0;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--project-color) 72%, var(--text-primary));
  content: "";
  pointer-events: none;
}

.saved-project-tile.is-drop-before::before {
  top: calc(var(--space-1) * -1);
}

.saved-project-tile.is-drop-after::after {
  bottom: calc(var(--space-1) * -1);
}

.saved-project-tile:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--project-color) 64%, var(--text-primary));
  outline-offset: -3px;
}

.saved-project-tile[data-pointer-focus="true"]:focus-visible {
  outline: 0;
}

.saved-project-tile.is-selected {
  background: color-mix(in srgb, var(--project-color) 70%, var(--surface));
  box-shadow: none;
}

.saved-project-tile strong,
.saved-project-tile > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-project-tile strong {
  align-self: start;
  font-size: calc(var(--chrome-font-size) * 0.76) !important;
}

.saved-project-tile-edit {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  align-self: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: currentColor;
  opacity: 0.72;
}

.saved-project-tile-edit[hidden] {
  display: none;
}

.saved-project-tile-edit:hover,
.saved-project-tile-edit:focus-visible {
  background: color-mix(in srgb, currentColor 14%, transparent);
  opacity: 1;
}

.saved-project-tile-edit svg {
  width: 13px;
  height: 13px;
}

.saved-project-tile.is-reference {
  --project-color: var(--text-secondary);
  background: var(--surface-muted);
}

.saved-project-tile.is-unassigned-saved {
  grid-column: 1 / -1;
}

.saved-folder-context {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: var(--surface-muted);
}

.saved-folder-context.is-project {
  --saved-project-row-gap: calc(var(--space-2) + var(--space-3));
  gap: var(--saved-project-row-gap);
  margin-top: var(--saved-project-row-gap);
  padding: 0 0 var(--space-4);
  border-radius: 0;
  background: transparent;
}

.saved-folder-context.is-project > .saved-project-summary {
  margin-top: 0;
}

.saved-folder-context.is-project .project-notebook-button,
.saved-folder-context.is-project .project-report-draft-button {
  height: 40px;
  min-height: 40px;
  border-radius: var(--radius-control);
}

.saved-project-summary {
  display: grid;
  gap: var(--saved-project-row-gap, var(--space-1));
}

.saved-folder-context.is-project .saved-project-facts-section,
.saved-folder-context.is-project .saved-project-structured-section,
.saved-folder-context.is-project .saved-project-evidence-section,
.saved-folder-context.is-project .saved-project-research-answers {
  overflow: hidden;
  padding: 0 var(--space-3);
  border-radius: var(--radius-control);
  background: var(--menu-subtle-surface);
}

.saved-folder-context.is-project .saved-project-facts-section.is-open > .project-section-motion-body,
.saved-folder-context.is-project .saved-project-structured-section.is-open > .project-section-motion-body,
.saved-folder-context.is-project .saved-project-evidence-section.is-open > .project-section-motion-body,
.saved-folder-context.is-project .saved-project-research-answers.is-open > .project-section-motion-body {
  padding-bottom: var(--space-3);
}

.saved-folder-context.is-project .saved-project-facts-section > .saved-project-facts-heading,
.saved-folder-context.is-project .saved-project-structured-section > .saved-project-facts-heading,
.saved-folder-context.is-project .saved-project-evidence-section > .saved-evidence-heading,
.saved-folder-context.is-project .saved-project-research-answers > .project-studio-section-heading {
  height: 40px;
  min-height: 40px;
}

.saved-folder-context.is-project .saved-project-facts-section > .saved-project-facts-heading > .saved-project-facts-toggle,
.saved-folder-context.is-project .saved-project-structured-section > .saved-project-facts-heading > .saved-project-facts-toggle,
.saved-folder-context.is-project .saved-project-research-answers > .project-studio-section-heading > .saved-project-research-toggle {
  height: 40px;
  min-height: 40px;
}

.saved-folder-context.is-project .project-section-motion > :is(.saved-project-facts-heading, .saved-evidence-heading, .project-studio-section-heading) .project-section-toggle-chevron {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
}

.saved-folder-context.is-project .saved-project-facts-section > .saved-project-facts-heading .project-section-toggle-chevron,
.saved-folder-context.is-project .saved-project-structured-section > .saved-project-facts-heading .project-section-toggle-chevron,
.saved-folder-context.is-project .saved-project-evidence-section > .saved-evidence-heading .project-section-toggle-chevron,
.saved-folder-context.is-project .saved-project-research-answers > .project-studio-section-heading .project-section-toggle-chevron {
  background: transparent;
}

.saved-project-facts-heading {
  display: flex;
  align-items: center;
  min-height: 30px;
}

.saved-project-facts-toggle {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
}

.saved-project-facts-toggle:hover,
.saved-project-facts-toggle:focus-visible {
  color: var(--text-primary);
}

.saved-project-facts-chevron {
  margin-left: var(--space-2);
}

.saved-project-facts-body {
  display: grid;
  gap: var(--space-1);
}

.saved-project-fact-input {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: var(--space-1) 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  line-height: 1.45;
}

.saved-project-fact-input::placeholder {
  color: var(--text-secondary);
}

.saved-project-fact-input:focus-visible {
  box-shadow: none;
}

.saved-project-fact-description {
  height: 112px;
  min-height: 72px;
  max-height: min(70vh, 760px);
  overflow-y: auto;
  resize: none;
}

.saved-project-fact-resize-handle {
  position: relative;
  height: 14px;
  margin-top: -14px;
  cursor: row-resize;
  touch-action: none;
}

.saved-project-fact-resize-handle::after {
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 36px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--text-secondary);
  content: "";
  opacity: 0.7;
  transform: translateX(-50%);
}

.saved-project-structured-facts {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-2) 0 var(--space-3);
}

.saved-project-structured-section.project-section-motion:not(.is-open) > .saved-project-structured-facts {
  padding-bottom: 0;
}

.saved-project-structured-groups,
.saved-project-structured-group-body {
  display: grid;
  gap: var(--space-2);
}

.saved-project-structured-group {
  display: grid;
  gap: 0;
}

.saved-project-structured-group.project-section-motion.is-open > .saved-project-structured-group-body {
  padding-top: 2px;
}

.saved-project-structured-group-heading {
  display: flex;
  align-items: center;
  min-height: 28px;
}

.saved-project-structured-group-toggle {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.9) !important;
  font-weight: 600;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
}

.saved-project-structured-group-toggle:hover,
.saved-project-structured-group-toggle:focus-visible {
  color: var(--text-primary);
}

.saved-project-structured-group-chevron {
  background: transparent;
  color: var(--text-tertiary);
}

.saved-project-structured-group-chevron:hover,
.saved-project-structured-group-chevron:focus-visible {
  color: var(--text-primary);
}

.saved-project-structured-custom-group {
  margin-top: var(--space-2);
}

.saved-project-structured-facts-help,
.saved-project-structured-facts-empty {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82em;
  line-height: 1.4;
}

.saved-project-structured-facts-list {
  display: grid;
  gap: 0;
  width: calc(100% + (2 * var(--space-3)));
  margin-inline: calc(-1 * var(--space-3));
}

.saved-project-structured-fact {
  position: relative;
  display: grid;
  grid-template-columns: minmax(92px, 0.85fr) minmax(100px, 1.15fr);
  gap: var(--space-2);
  align-items: center;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: 0;
  background: transparent;
}

.saved-project-structured-fact.is-custom {
  grid-template-columns: minmax(92px, 0.85fr) minmax(100px, 1.15fr) auto;
}

.saved-project-structured-fact + .saved-project-structured-fact::before,
.saved-folder-context.is-project .saved-project-evidence-body .saved-code-group .saved-row::after {
  position: absolute;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--border);
  content: "";
  pointer-events: none;
}

.saved-project-structured-fact + .saved-project-structured-fact::before {
  top: 0;
}

.saved-project-structured-fact-label {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.8em;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.saved-project-structured-fact-value,
.saved-project-structured-fact-label-input {
  min-width: 0;
  margin: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
}

.saved-project-structured-fact-value {
  width: auto;
  min-width: 144px;
  max-width: 100%;
  justify-self: end;
  padding-inline: 6px;
  field-sizing: content;
  text-align: right;
}

.saved-project-structured-fact-value:focus-visible,
.saved-project-structured-fact-label-input:focus-visible {
  box-shadow: none;
}

.saved-project-structured-fact-label-input {
  color: var(--text-secondary);
  font-size: 0.8em;
  letter-spacing: 0;
  text-transform: none;
}

.saved-project-structured-fact-add,
.saved-project-structured-fact-remove {
  border: 0;
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
}

.saved-project-structured-fact-add {
  justify-self: start;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--project-color, var(--accent)) 14%, var(--surface-muted));
  font-size: 0.82em;
}

.saved-project-structured-fact-remove {
  padding: 0 var(--space-1);
  background: transparent;
  font-size: 1.25em;
  line-height: 1;
}

.saved-project-structured-fact-add:hover,
.saved-project-structured-fact-remove:hover {
  color: var(--text-primary);
}

@media (max-width: 720px) {
  .saved-project-structured-fact {
    grid-template-columns: minmax(0, 1fr);
  }

  .saved-project-structured-fact-label {
    grid-column: auto;
  }

  .saved-project-structured-fact.is-custom {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .saved-project-structured-fact.is-custom .saved-project-structured-fact-label-input {
    grid-column: 1 / -1;
  }
}

.saved-folder-context.is-project .saved-project-tool-controls {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  width: 100%;
  padding-top: 0;
}

.saved-folder-context.is-project .saved-project-tool-controls button {
  width: 100%;
  min-width: 0;
  font-weight: 400;
}

.saved-folder-context.is-project > .project-studio-section {
  margin-top: 0;
  padding-top: 0;
}

.saved-folder-context.is-project > .project-studio-section > .project-studio-section-heading {
  min-height: 30px;
}

.saved-folder-context.is-project > .saved-project-overview-warning {
  margin-top: var(--space-2);
  padding-top: var(--space-4);
}

.saved-evidence-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.saved-evidence-heading > .section-label {
  flex: 1 1 auto;
  justify-content: flex-start;
  min-height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
}

.saved-evidence-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
}

.saved-evidence-heading-actions .saved-evidence-collapse-toggle {
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  flex-basis: var(--panel-title-control-size);
}

.saved-project-evidence-section.project-section-motion:not(.is-open) .saved-evidence-search-toggle,
.saved-project-evidence-section.project-section-motion:not(.is-open) .saved-evidence-select-toggle {
  display: none;
}

.saved-evidence-collapse-toggle[aria-expanded="true"] .research-chevron-up,
.saved-evidence-collapse-toggle[aria-expanded="false"] .research-chevron-down {
  display: block;
}

.saved-project-evidence-body {
  display: grid;
  gap: var(--space-2);
}

.saved-evidence-search-toggle,
.saved-evidence-select-toggle,
.saved-evidence-delete-selection {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
}

.saved-evidence-search-toggle:hover,
.saved-evidence-search-toggle:focus-visible,
.saved-evidence-search-toggle[aria-pressed="true"],
.saved-evidence-select-toggle:hover,
.saved-evidence-select-toggle:focus-visible,
.saved-evidence-select-toggle[aria-pressed="true"],
.saved-evidence-delete-selection:hover,
.saved-evidence-delete-selection:focus-visible {
  background: var(--toolbar-active);
  color: var(--text-primary);
}

.saved-evidence-search-toggle,
.saved-evidence-search-toggle:hover,
.saved-evidence-search-toggle:focus-visible,
.saved-evidence-search-toggle[aria-pressed="true"] {
  border-radius: 0;
  background: transparent;
}

.saved-evidence-search-toggle:focus-visible {
  box-shadow: inset 0 -1px 0 var(--project-color, var(--accent));
}

.saved-evidence-search-toggle svg,
.saved-evidence-select-toggle svg,
.saved-evidence-delete-selection svg,
.saved-evidence-search-close svg {
  width: 14px;
  height: 14px;
}

.saved-evidence-delete-selection {
  color: var(--destructive, #ff6767);
}

.saved-evidence-select-toggle[hidden],
.saved-evidence-delete-selection[hidden],
.saved-evidence-cancel-selection[hidden] {
  display: none;
}

.saved-evidence-cancel-selection {
  min-height: 28px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font-size: calc(var(--saved-font-size) * 0.8) !important;
}

.saved-evidence-cancel-selection:hover,
.saved-evidence-cancel-selection:focus-visible {
  background: var(--toolbar-active);
  color: var(--text-primary);
}

.saved-evidence-heading-actions button,
.saved-evidence-heading-actions button:hover,
.saved-evidence-heading-actions button:focus-visible,
.saved-evidence-heading-actions button[aria-pressed="true"] {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.saved-evidence-heading-actions button:focus-visible {
  outline: 0;
  box-shadow: inset 0 -1px 0 var(--project-color, var(--accent));
}

.saved-evidence-search {
  position: relative;
  display: flex;
  width: 100%;
  height: 42px;
  min-height: 42px;
  align-items: center;
}

.saved-evidence-search[hidden] {
  display: none;
}

.saved-evidence-search-input {
  width: 100%;
  min-width: 0;
  height: 42px;
  min-height: 42px;
  padding: 0 calc(var(--space-4) + 18px) 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  outline: 0;
  background: var(--menu-subtle-surface);
  color: var(--text-primary);
  font: inherit;
}

.saved-evidence-search-input:focus-visible {
  background: color-mix(in srgb, var(--text-primary) 10%, var(--menu-subtle-surface));
  box-shadow: none;
}

@media (prefers-color-scheme: dark) {
  .saved-evidence-search-input {
    background: #080808;
  }
}

.saved-evidence-search-close {
  position: absolute;
  right: var(--space-2);
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
}

.saved-evidence-search-close:hover,
.saved-evidence-search-close:focus-visible {
  color: var(--text-primary);
}

.saved-folder-context > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
}

.saved-folder-context > header > div {
  display: grid;
  min-width: 0;
}

.saved-folder-context > header span {
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.68) !important;
}

.saved-folder-context > header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-folder-back,
.saved-folder-controls button {
  min-height: 30px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
  color: var(--text-primary);
}

.saved-folder-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.saved-folder-context.is-project .saved-folder-controls button:hover,
.saved-folder-context.is-project .saved-folder-controls button:focus-visible {
  background: color-mix(in srgb, var(--project-color) 34%, transparent);
}

.saved-folder-back:focus-visible,
.saved-folder-controls button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--project-color, var(--text-primary)) 62%, transparent);
  outline-offset: 2px;
}

.saved-reference-capabilities {
  align-self: center;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
}

.saved-folder-search {
  width: 100%;
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-primary);
}

.saved-project-count {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.66) !important;
}

.saved-project-tile.is-selected .saved-project-count {
  color: #ffffff;
}

.saved-projects-empty {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.76) !important;
}

.saved-panel .panel-actions {
  position: relative;
}

.saved-sort-button svg,
.saved-export-button svg {
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.saved-sort-button,
.saved-export-button {
  display: grid;
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

.saved-sort-button:hover,
.saved-sort-button:focus-visible,
.saved-export-button:hover,
.saved-export-button:focus-visible {
  color: var(--text-primary);
}

.saved-action-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: 20;
  display: grid;
  width: max-content;
  min-width: 170px;
  overflow: hidden;
  padding: var(--space-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--menu-surface);
  box-shadow: var(--shadow-panel);
}

.saved-action-menu button {
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.saved-action-menu button:hover,
.saved-action-menu button:focus-visible,
.saved-action-menu button.is-selected {
  background: var(--toolbar-active);
}

.saved-action-menu button.is-selected::before {
  margin-right: var(--space-2);
  content: "✓";
  color: var(--code-accent);
}

.saved-inline-filters {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-2) 0 var(--space-3);
}

.saved-project-evidence-body > .saved-inline-filters:not(:has(> :not([hidden]))) {
  display: none;
}

.saved-plan-usage {
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-tile);
  background: color-mix(in srgb, var(--text-primary) 7%, transparent);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.78);
  line-height: 1.35;
  text-align: center;
}

.saved-plan-usage[hidden] {
  display: none;
}

.saved-inline-filters > .code-filter-menu {
  --saved-filter-card-radius: 22px;
  overflow: hidden;
  border-radius: var(--saved-filter-card-radius);
  background: var(--menu-subtle-surface);
}

.saved-inline-filters > .code-filter-menu > .code-filter-menu-toggle,
.saved-code-filter-heading > .code-filter-menu-toggle {
  background: transparent;
}

.saved-inline-filters > .code-filter-menu > .code-filter-menu-toggle:hover,
.saved-code-filter-heading > .code-filter-menu-toggle:hover {
  background: color-mix(in srgb, var(--text-tertiary) 10%, transparent);
}

.saved-code-filter-menu-toggle[aria-expanded="true"]:hover {
  background: transparent;
}

.saved-code-filter-heading {
  position: relative;
  display: flex;
  min-height: var(--panel-title-control-size);
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.saved-code-filter-menu-toggle {
  flex: 1 1 auto;
}

.saved-code-filter-actions {
  position: absolute;
  top: 50%;
  right: calc(var(--space-3) + 18px + var(--space-2));
  z-index: 1;
  display: none;
  align-items: center;
  transform: translateY(-50%);
}

.saved-code-filter-menu.is-open .saved-code-filter-actions {
  display: flex;
}

.saved-code-filter-actions button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.saved-code-filter-actions button:hover,
.saved-code-filter-actions button:focus-visible {
  color: var(--text-primary);
}

.saved-code-filter-actions button:disabled {
  opacity: 0.32;
  cursor: default;
}

.saved-code-filter-actions svg {
  width: 14px;
  height: 14px;
}

.saved-code-filter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  grid-auto-flow: row;
  column-gap: calc(var(--space-3) * 2);
  gap: var(--space-2);
  margin: 0;
  overflow: visible;
  padding: 0 var(--space-3);
  background-image: none;
}

.code-filter-menu.is-open .saved-code-filter {
  padding: var(--space-2) var(--space-3) var(--space-4);
}

.saved-code-filter .saved-filter-chip {
  width: 100%;
  min-height: 0;
  justify-self: stretch;
  padding: var(--space-1) 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: var(--text-secondary);
  font-size: 12px !important;
  font-weight: 400;
  text-align: left;
  white-space: normal;
  -webkit-text-fill-color: currentColor;
}

.saved-code-filter .saved-filter-chip[aria-pressed="true"] {
  color: var(--text-primary);
  font-weight: 600;
}

.saved-code-filter .saved-filter-chip.code-theme-building[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-administrative[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-plumbing[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-mechanical[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-fuel-gas[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-energy[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-electrical[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-existing-building[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-fire[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-historical[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-housing[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-environmental[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-land-use[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-housing-buildings[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-current-consolidation[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-local-law[aria-pressed="true"],
.saved-code-filter .saved-filter-chip.code-theme-zoning[aria-pressed="true"] {
  color: var(--code-accent);
  -webkit-text-fill-color: var(--code-accent);
}

.saved-code-filter .saved-filter-chip:hover {
  background: transparent !important;
  color: var(--text-primary);
}

.saved-print-frame {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.saved-panel.is-saved-selecting .saved-content {
  padding-bottom: calc(var(--panel-padding) + 118px);
}

.project-detail-section-open,
.project-detail-section-remove {
  border: 0;
  background: transparent;
  color: inherit;
}

.project-detail-section-open {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.project-detail-section-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: var(--space-1);
}

.project-detail-section-number {
  flex: 0 0 auto;
  color: var(--project-color);
  font-size: calc(var(--chrome-font-size) * 0.76) !important;
  font-weight: 700;
  line-height: 1.2;
}

.project-detail-section-title {
  min-width: 0;
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.82) !important;
  font-weight: 650;
  line-height: 1.25;
}

.project-detail-section-remove {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  color: var(--text-secondary);
}

.project-detail-section-remove svg {
  width: 15px;
  height: 15px;
}

.project-section-reader {
  display: grid;
  gap: calc(var(--space-3) / 2);
  padding: 0 var(--space-4) var(--space-6);
}

.project-section-reader > .section-label {
  color: var(--code-accent);
  font-size: 10.56px !important;
  font-weight: 700;
}

.project-section-reader h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 10.56px !important;
  font-weight: 650;
}

.project-section-chapter {
  margin: 0;
  color: var(--text-secondary);
  font-size: 10.56px !important;
}

.project-section-body {
  color: var(--text-primary);
  font-size: 10.56px !important;
}

.project-section-body > :first-child {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font-size: 10.56px !important;
  overflow: hidden;
}

.project-sheet-overlay {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: var(--space-3);
  background: rgba(0, 0, 0, 0.54);
}

.project-create-sheet {
  display: grid;
  gap: var(--space-3);
  width: 100%;
  max-width: 28rem;
  max-height: calc(100dvh - var(--header-height) - (var(--space-3) * 2));
  overflow-y: auto;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--surface) 92%, var(--text-primary) 8%);
  box-shadow: var(--shadow-panel);
  overscroll-behavior: contain;
}

.sheet-grabber {
  width: 48px;
  height: 5px;
  margin: var(--space-2) auto 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-secondary) 70%, transparent);
}

.project-sheet-header {
  position: sticky;
  top: calc(-1 * var(--space-3));
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) 0;
  background: color-mix(in srgb, var(--surface) 92%, var(--text-primary) 8%);
}

.project-sheet-header-compact {
  grid-template-columns: 1fr 1fr;
}

.project-sheet-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 1.08) !important;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.project-sheet-header button {
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: calc(var(--chrome-font-size) * 0.92) !important;
  font-weight: 500;
}

.project-sheet-header button:first-child {
  justify-self: start;
}

.project-sheet-header button:last-child {
  justify-self: end;
  font-weight: 650;
}

.project-sheet-header button:disabled {
  color: var(--text-tertiary);
  cursor: not-allowed;
}

.project-sheet-field {
  display: grid;
  gap: 0;
}

.project-sheet-field[hidden] {
  display: none;
}

.project-folder-type {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  border: 0;
}

.project-folder-type > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.project-folder-type button {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
  padding: var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  background: var(--menu-subtle-surface);
  color: var(--text-primary);
  box-shadow: none;
  text-align: left;
}

.project-folder-type button[aria-pressed="true"] {
  background: var(--surface-raised);
  color: var(--text-primary);
  box-shadow: var(--shadow-panel);
}

.project-folder-type button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.project-folder-type button span {
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.68) !important;
}

.project-folder-type button[aria-pressed="true"] span {
  color: var(--text-secondary);
}

.project-sheet-field span,
.project-sheet-colors legend {
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.84) !important;
  font-weight: 650;
}

.project-sheet-field input,
.project-sheet-field textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-panel);
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
  color: var(--text-primary);
  font-family: inherit;
  font-size: calc(var(--chrome-font-size) * 0.92) !important;
  line-height: 1.25;
  outline: 0;
}

.project-sheet-field textarea {
  min-height: 86px;
  max-height: 180px;
  padding-right: var(--space-4);
  padding-left: var(--space-4);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  resize: vertical;
  overflow-wrap: anywhere;
}

.project-create-sheet.is-reference-folder .project-description-input {
  min-height: calc(126px + var(--space-3));
  max-height: 230px;
}

.project-sheet-field .project-description-input {
  text-align: left;
}

.project-sheet-field input::placeholder,
.project-sheet-field textarea::placeholder {
  color: var(--text-tertiary);
}

.project-sheet-field .project-name-input,
.project-sheet-field .project-address-input {
  text-align: center;
}

.project-sheet-colors {
  display: grid;
  gap: 0;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.project-color-rail {
  --project-swatch-size: clamp(22px, 6.6vw, 28px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--project-swatch-size), 1fr));
  justify-items: center;
  align-items: center;
  gap: clamp(6px, 1.6vw, var(--space-2));
  overflow: visible;
  padding: clamp(8px, 2vw, var(--space-2));
  border-radius: var(--radius-panel);
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
}

.project-color-swatch {
  width: var(--project-swatch-size);
  height: var(--project-swatch-size);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--project-swatch);
}

.project-color-swatch[aria-pressed="true"] {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
}

.saved-section-row {
  position: relative;
  color: var(--text-primary);
}

.saved-panel .saved-content > .section-label {
  padding-top: var(--space-2);
}

.saved-panel .section-label.saved-code-label {
  margin: var(--space-3) 0 var(--space-1);
  font-size: var(--saved-font-size) !important;
}

.saved-panel .saved-code-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-1) 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.saved-code-toggle-chevron {
  display: inline-grid;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  place-items: center;
  transform: rotate(90deg);
  transition: transform 160ms ease;
}

.saved-code-toggle-chevron svg {
  width: 100%;
  height: 100%;
}

.saved-code-group.is-collapsed .saved-code-toggle-chevron {
  transform: rotate(0deg);
}

.saved-code-group.project-section-motion.is-open > .saved-code-group-body {
  padding-top: 0;
}

.saved-code-group-body[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .project-section-motion > .project-section-motion-body,
  .saved-code-toggle-chevron {
    transition: none;
  }
}

.saved-panel .saved-code-group + .saved-code-group {
  margin-top: var(--space-2);
}

.saved-panel .saved-code-group .saved-row {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.saved-folder-context.is-project .saved-project-evidence-body .saved-code-group .saved-row {
  width: calc(100% + (2 * var(--space-3)));
  margin-inline: calc(-1 * var(--space-3));
  padding-inline: var(--space-3);
  border-bottom: 0;
}

.saved-folder-context.is-project .saved-project-evidence-body .saved-code-group .saved-row::after {
  bottom: 0;
}

.saved-panel .saved-content > .saved-code-group:last-child .saved-row:last-child {
  border-bottom: 0;
}

.saved-chapter-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-3) 0 var(--space-1);
  color: var(--text-secondary);
}

.saved-chapter-header strong,
.saved-chapter-header span {
  color: var(--code-accent);
  font-size: calc(var(--saved-font-size) * 0.82) !important;
  line-height: 1.25;
}

.saved-chapter-header strong {
  flex: 0 0 auto;
  text-transform: uppercase;
}

.saved-chapter-header span {
  min-width: 0;
  font-weight: 600;
}

.saved-selection-check {
  display: none;
  position: absolute;
  top: 50%;
  right: var(--space-2);
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--text-secondary);
  transform: translateY(-50%);
}

.saved-selection-check svg {
  width: 20px;
  height: 20px;
}

.is-saved-selecting .saved-section-row {
  cursor: pointer;
}

.is-saved-selecting .saved-section-row .saved-row-button {
  padding-right: 40px;
}

.is-saved-selecting .saved-section-row .saved-selection-check {
  display: grid;
}

.is-saved-selecting .saved-section-row.is-selected .project-selection-checkmark {
  opacity: 1;
}

.is-saved-selecting .saved-row-remove {
  display: none;
}

.saved-section-row.has-remove-action {
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  column-gap: var(--space-2);
}

.saved-section-row.is-removing {
  opacity: 0.58;
}

.saved-section-heading {
  display: grid;
  gap: 2px;
}

.saved-section-meta {
  color: var(--code-accent);
  font-size: calc(var(--saved-font-size) * 0.77) !important;
  font-weight: 650;
  line-height: 1.2;
}

.saved-section-meta-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.saved-section-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--code-accent);
}

.saved-section-status > span {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
}

.saved-section-status svg {
  width: 13px;
  height: 13px;
}

.saved-section-title {
  color: var(--text-primary);
  font-size: calc(var(--saved-font-size) * 0.946) !important;
  font-weight: 650;
  line-height: 1.25;
}

.saved-section-row.is-list-paragraph .saved-section-title {
  color: var(--text-secondary);
  font-weight: 450;
}

.saved-row-button {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.saved-row-button:hover {
  color: var(--code-accent);
}

.saved-row-button:hover .saved-section-title {
  color: var(--code-accent);
}

.saved-paragraph-preview {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: calc(var(--saved-font-size) * 0.836) !important;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.saved-note-preview {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: var(--code-accent);
  font-size: calc(var(--saved-font-size) * 0.814) !important;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.saved-row-projects {
  display: block;
  margin-top: 5px;
  color: var(--code-accent);
  font-size: calc(var(--saved-font-size) * 0.72) !important;
  font-weight: 600;
}

.saved-row-projects.is-unassigned {
  color: var(--text-tertiary);
}

.saved-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-1);
  min-height: 26px;
  margin-top: var(--space-2);
}

.saved-row-actions button {
  min-height: 26px;
  padding: 3px 7px;
  border: 0;
  border-radius: 1000px;
  background: transparent;
  color: #404040;
  font-family: var(--chrome-font-family);
  font-size: calc(var(--saved-font-size) * 0.72) !important;
  font-weight: 400;
  opacity: 0;
  transition: opacity 140ms ease, background-color 140ms ease, color 140ms ease;
}

.saved-section-row:hover .saved-row-actions button,
.saved-section-row:focus-within .saved-row-actions button {
  opacity: 1;
}

.saved-row-actions button:hover,
.saved-row-actions button:focus-visible {
  background: color-mix(in srgb, var(--code-accent) 12%, transparent);
  color: var(--code-accent);
}

.saved-row-remove {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.saved-row-remove:hover,
.saved-row-remove:focus-visible {
  color: var(--code-accent);
  background: color-mix(in srgb, var(--code-accent) 10%, transparent);
}

.saved-row-remove.has-error {
  color: var(--code-accent);
}

.saved-row-remove:disabled {
  cursor: wait;
  opacity: 0.55;
}

.saved-row-remove svg {
  width: 16px;
  height: 16px;
}

.analysis-content {
  display: grid;
  align-content: start;
  gap: 0;
}

.analysis-content .analysis-card,
.analysis-content .saved-row {
  padding: var(--space-4) 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.settings-list {
  display: grid;
  align-content: start;
  gap: 0;
  overflow: visible;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface-muted);
}

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

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

.settings-list span {
  min-width: 0;
  color: var(--text-primary);
  font-weight: 500;
}

.settings-list strong {
  min-width: 0;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  overflow-wrap: break-word;
}

.settings-row select {
  min-width: 0;
  max-width: 100%;
  min-height: 34px;
  padding: 0 24px 0 0;
  border: 0;
  background-color: transparent;
  color: var(--text-primary);
  font-weight: 400;
  text-align: right;
  text-overflow: ellipsis;
}

.settings-card {
  display: grid;
  min-width: 0;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface-muted);
}

.settings-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.settings-firm-role,
.project-shared-role {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--code-accent) 16%, var(--surface));
  color: var(--code-accent);
  font-size: 8.5pt !important;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}

.settings-firm-content,
.settings-firm-create,
.settings-firm-workspace,
.settings-firm-owner-tools,
.settings-firm-invite,
.settings-firm-members > div {
  display: grid;
  gap: var(--space-2);
}

.settings-firm-muted,
.settings-firm-status {
  margin: 0;
  color: var(--text-secondary);
  font-size: 9pt !important;
  line-height: 1.4;
}

.settings-firm-muted.has-error,
.settings-firm-status.has-error {
  color: #b54708;
}

.settings-firm-create input,
.settings-firm-field input,
.settings-firm-field select,
.settings-firm-field textarea,
.settings-firm-invite-result input,
.settings-firm-member select,
.settings-firm-standard-row input,
.settings-firm-standard-row select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text-primary) 7%, transparent);
  color: var(--text-primary);
  font-size: 9pt !important;
  line-height: 1.35;
}

.settings-firm-create input:focus-visible,
.settings-firm-field input:focus-visible,
.settings-firm-field select:focus-visible,
.settings-firm-field textarea:focus-visible,
.settings-firm-invite-result input:focus-visible,
.settings-firm-member select:focus-visible,
.settings-firm-standard-row input:focus-visible,
.settings-firm-standard-row select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--code-accent) 48%, transparent);
  outline-offset: 1px;
}

.settings-firm-invitation,
.settings-firm-workspace {
  padding: var(--space-3);
  border: 0;
  border-radius: 9px;
  background: var(--settings-inset-surface, color-mix(in srgb, var(--text-primary) 4%, transparent));
}

.settings-firm-invitation {
  display: grid;
  gap: var(--space-2);
}

.settings-firm-invitation > div,
.settings-firm-workspace-heading > div,
.settings-firm-member > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.settings-firm-invitation span,
.settings-firm-workspace-heading span:not(.settings-firm-role),
.settings-firm-member span {
  color: var(--text-secondary);
  font-size: 8.75pt !important;
  line-height: 1.3;
}

.settings-firm-workspace-heading,
.settings-firm-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.settings-firm-projects {
  display: grid;
  gap: var(--space-1);
}

.settings-firm-project {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 48px;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--code-accent) 10%, var(--surface));
  color: var(--text-primary);
  text-align: left;
}

.settings-firm-project:hover,
.settings-firm-project:focus-visible {
  background: color-mix(in srgb, var(--code-accent) 20%, var(--surface));
}

.settings-firm-project:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--code-accent) 48%, transparent);
  outline-offset: 1px;
}

.settings-firm-project span {
  color: var(--text-secondary);
  font-size: 8.5pt !important;
}

.settings-firm-owner-tools {
  padding-top: var(--space-2);
}

.settings-firm-standards {
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--code-accent) 9%, var(--surface));
}

.settings-firm-standards summary {
  min-height: 34px;
  color: var(--text-primary);
  font-size: 9pt !important;
  font-weight: 700;
  cursor: pointer;
}

.settings-firm-standards > div,
.settings-firm-standard-section {
  display: grid;
  gap: var(--space-2);
}

.settings-firm-standards > div {
  padding-top: var(--space-2);
}

.settings-firm-standard-section {
  padding: var(--space-3);
  border-radius: 8px;
  background: color-mix(in srgb, var(--text-primary) 5%, transparent);
}

.settings-firm-standard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.settings-firm-standard-heading button {
  width: auto;
}

.settings-firm-field textarea {
  min-height: 72px;
  padding-block: var(--space-2);
  resize: vertical;
}

.settings-firm-field input[type="color"],
.settings-firm-standard-row input[type="color"] {
  padding: 5px;
}

.settings-firm-standard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px minmax(92px, 0.5fr);
  gap: var(--space-1);
}

.settings-firm-subheading {
  color: var(--text-secondary);
  font-size: 8.5pt !important;
  font-weight: 700;
}

.settings-firm-default-template {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 8.5pt !important;
}

.settings-firm-template {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: 8px;
  background: color-mix(in srgb, var(--code-accent) 7%, var(--surface));
}

.settings-firm-field {
  display: grid;
  gap: 4px;
}

.settings-firm-field > span {
  color: var(--text-secondary);
  font-size: 8.5pt !important;
  font-weight: 650;
}

.settings-firm-invite {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.settings-firm-invite-result {
  display: grid;
  gap: var(--space-1);
}

.settings-firm-members {
  margin-top: var(--space-1);
}

.settings-firm-members summary {
  min-height: 34px;
  color: var(--text-primary);
  font-size: 9pt !important;
  font-weight: 650;
  cursor: pointer;
}

.settings-firm-member {
  min-height: 48px;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

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

.settings-firm-member-actions {
  display: grid !important;
  grid-template-columns: minmax(88px, 1fr) auto;
  align-items: center;
  gap: var(--space-1) !important;
}

.settings-firm-member .settings-mini-button {
  width: auto !important;
  min-height: 34px !important;
}

.notebook-access-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--project-color) 12%, var(--surface));
  color: var(--text-secondary);
  font-size: 9pt !important;
}

.project-detail-heading .project-shared-role {
  margin-top: 2px;
  background: color-mix(in srgb, var(--project-color) 16%, var(--surface));
  color: var(--text-primary);
}

.saved-project-tile.is-shared {
  background: color-mix(in srgb, var(--project-color) 32%, var(--surface));
}

@media (max-width: 760px) {
  .project-evidence-review,
  .project-report-export {
    align-items: stretch;
    flex-direction: column;
  }

  .project-evidence-review-actions {
    justify-content: flex-start;
  }
}

.settings-offline-status {
  min-height: 20px;
  color: var(--text-primary);
  font-size: 9.5pt !important;
  line-height: 1.35;
}

.settings-offline-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
}

.settings-offline-progress::-webkit-progress-bar {
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
}

.settings-offline-progress::-webkit-progress-value {
  border-radius: var(--radius-pill);
  background: var(--text-primary);
}

.settings-offline-progress::-moz-progress-bar {
  border-radius: var(--radius-pill);
  background: var(--text-primary);
}

.settings-offline-actions {
  align-items: center;
}

.settings-card-copy,
.settings-disclaimer,
.settings-status-message,
.account-profile-helper {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.4;
}

.settings-plan-features {
  display: grid;
  gap: var(--space-2);
}

.settings-plan-usage {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-tile);
  background: transparent;
}

.settings-plan-usage[hidden] {
  display: none;
}

.settings-plan-usage p {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0;
  padding: 0 var(--space-3);
  color: var(--text-secondary);
  font-size: 9pt !important;
}

.settings-plan-usage p + p {
  border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}

.settings-plan-usage strong {
  color: var(--text-primary);
  font-size: inherit !important;
  text-align: right;
}

.settings-feature-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-2);
}

.settings-feature-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--text-tertiary);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 9pt !important;
  font-weight: 700;
}

.settings-feature-icon.is-pro {
  border-color: var(--text-primary);
  background: var(--text-primary);
  color: var(--surface-raised);
}

.settings-feature-row p {
  display: grid;
  gap: 2px;
  margin: 0;
}

.settings-feature-row strong {
  font-weight: 600;
}

.settings-feature-row span:not(.settings-feature-icon) {
  color: var(--text-secondary);
  font-size: 10pt !important;
  line-height: 1.35;
}

.settings-primary-button,
.settings-secondary-button,
.settings-link-button,
.settings-mini-button {
  min-height: 42px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.settings-primary-button {
  background: var(--text-primary);
  color: var(--surface-raised);
}

.settings-secondary-button,
.settings-mini-button {
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  color: var(--text-primary);
}

.settings-link-button {
  min-height: 28px;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
}

.settings-primary-button:disabled,
.settings-secondary-button:disabled,
.settings-link-button:disabled,
.settings-mini-button:disabled {
  cursor: default;
  opacity: 0.48;
}

.account-profile-editor {
  display: grid;
  gap: var(--space-2);
}

.account-profile-editor[hidden] {
  display: none;
}

.account-profile-editor label {
  color: var(--text-primary);
  font-size: 10pt !important;
  font-weight: 600;
}

.account-profile-editor input {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--text-primary) 6%, transparent);
  color: var(--text-primary);
}

.account-profile-helper {
  font-size: 9.5pt !important;
}

.account-profile-helper.has-error,
.settings-status-message.has-error {
  color: #b54708;
}

.settings-projects-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.settings-projects-heading .settings-link-button {
  min-height: 24px;
  font-size: 9.5pt !important;
}

.settings-project-list {
  display: grid;
}

.settings-project-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.settings-project-archive-label {
  justify-self: end;
  color: var(--text-secondary);
  font-size: 8.75pt !important;
  text-transform: none;
  white-space: nowrap;
}

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

.settings-project-row input {
  display: grid;
  width: 18px;
  height: 18px;
  margin: 0;
  appearance: none;
  place-items: center;
  border: 1px solid var(--text-tertiary);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.settings-project-row input::after {
  color: var(--surface);
  content: "✓";
  font-size: 8pt;
  font-weight: 700;
  opacity: 0;
}

.settings-project-row input:checked {
  border-color: var(--text-primary);
  background: var(--text-primary);
}

.settings-project-row input:checked::after {
  opacity: 1;
}

.settings-project-row input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

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

.settings-project-copy strong,
.settings-project-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-project-copy strong {
  font-size: 10.5pt !important;
  color: var(--project-color);
  font-weight: 400;
  text-transform: none;
}

.settings-project-copy span,
.settings-projects-empty {
  color: var(--text-secondary);
  font-size: 9.5pt !important;
}

.settings-projects-empty {
  margin: 0;
}

.settings-project-delete:not(:disabled) {
  color: #d92d20;
}

.settings-mini-button {
  min-height: 32px;
  font-size: 10pt !important;
}

.settings-danger-list {
  display: grid;
}

.settings-danger-button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  min-height: 46px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  font-weight: 600;
}

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

.settings-danger-button > span {
  color: #d92d20;
  font-weight: 700;
  text-align: center;
}

.settings-disclaimer,
.settings-status-message {
  padding: 0 var(--space-1);
  font-size: 9.5pt !important;
}

.settings-status-message:empty {
  display: none;
}

.reader-preview-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
}

.settings-panel .reader-preview-card,
.settings-panel .account-connector {
  padding: var(--space-4);
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface-muted);
}

.preview-code-title {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--reader-font-family);
  font-size: calc(var(--reader-font-size) * var(--section-label-scale)) !important;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-preview-card h3 {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--reader-font-family);
  font-size: calc(var(--reader-font-size) * var(--subsection-title-scale)) !important;
  line-height: 1.25;
  font-weight: 600;
}

.preview-copy {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--reader-font-family);
  font-size: var(--reader-font-size) !important;
  line-height: var(--reader-line-height);
}

.preview-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-2);
  border-top: 0;
  text-transform: none;
}

.preview-setting-row span {
  color: var(--text-primary);
  font-weight: 500;
}

.preview-setting-row select {
  min-height: auto;
  width: auto;
  padding: 0 20px 0 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: right;
}

.account-connector {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
}

.account-connector > p:not(.section-label),
.connector-status {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12pt !important;
  line-height: 1.36;
}

.account-connector label,
.account-connector button {
  font-size: 12pt !important;
}

.account-connector label {
  text-transform: none;
}

.account-connector input {
  min-height: 42px;
  padding: 0 12px;
  font-size: 12pt !important;
  font-weight: 400;
  letter-spacing: 0;
}

.account-plan-summary {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.account-plan-summary[hidden] {
  display: none;
}

.account-plan-summary span {
  color: var(--text-secondary);
  font-size: 10pt !important;
  font-weight: 500;
  text-transform: uppercase;
}

.account-plan-summary strong {
  min-width: 0;
  color: var(--text-primary);
  font-size: 12pt !important;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.connector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.account-connector .connector-actions .ghost-button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid color-mix(in srgb, var(--text-secondary) 42%, transparent);
  background: transparent;
  box-shadow: none;
  color: var(--text-primary);
}

.account-connector .connector-actions .ghost-button:disabled {
  color: var(--text-secondary);
  opacity: 1;
}

/* Settings column hierarchy refinement. */
.settings-panel {
  --settings-card-surface: color-mix(in srgb, var(--text-primary) 4.5%, var(--surface));
  --settings-inset-surface: color-mix(in srgb, var(--text-primary) 3%, var(--surface));
  --settings-danger: #e2574c;
  gap: 0;
  overflow-x: hidden;
}

.settings-panel .panel-header {
  margin-bottom: var(--space-3);
}

.settings-scroll {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: calc(var(--space-2) + var(--space-3));
  min-height: 0;
  padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
}

.settings-scroll > .settings-list,
.settings-scroll > .settings-card {
  margin-top: 0;
}

.settings-panel .settings-card[hidden] {
  display: none;
}

.settings-panel .settings-card,
.settings-panel .settings-list,
.settings-panel .reader-preview-card,
.settings-panel .account-connector {
  min-width: 0;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 0;
  border-radius: 12px;
  background: var(--settings-card-surface);
  box-shadow: none;
}

.settings-panel .settings-section-title {
  justify-self: center;
  width: 100%;
  margin: 0;
  color: var(--text-secondary);
  font-family: var(--ui-font-family);
  font-size: 9pt !important;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0.085em;
  text-align: center;
  text-transform: uppercase;
}

.settings-panel .settings-card-toggle {
  display: block;
  width: 100%;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary) !important;
  font-family: var(--ui-font-family);
  font-size: 9pt !important;
  font-weight: 650 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.085em !important;
  text-transform: uppercase !important;
  text-align: center;
  cursor: pointer;
}

.settings-panel .settings-card-content {
  display: grid;
  max-height: var(--settings-card-content-height, 1200px);
  min-height: 0;
  gap: var(--space-2);
  overflow: hidden;
  opacity: 1;
  transition:
    max-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 260ms ease;
}

.settings-panel .settings-card.is-collapsed {
  min-height: 56px;
  padding: var(--space-3);
}

.settings-panel .settings-card.is-collapsed > .settings-card-content {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.settings-panel .settings-card.is-collapsed > .settings-section-title,
.settings-panel .settings-card.is-collapsed > .settings-card-heading {
  width: 100%;
  margin: 0;
}

.settings-panel .settings-card.is-collapsed .settings-section-title {
  margin: 0;
}

.settings-panel .settings-card-toggle > span {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .settings-panel .settings-card-content {
    transition: none;
  }
}

.settings-panel .settings-card-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  width: 100%;
}

.settings-panel .settings-card-heading .settings-section-title {
  grid-column: 1 / -1;
  width: 100%;
}

.settings-panel .settings-card-copy,
.settings-panel .account-profile-helper,
.settings-panel .connector-status {
  font-size: 9.5pt !important;
  line-height: 1.35;
}

.settings-sync-conflicts-list {
  display: grid;
  gap: var(--space-2);
}

.settings-sync-conflicts-card[hidden] {
  display: none;
}

.settings-conflict-row {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, #f79009 9%, transparent);
}

.settings-conflict-row > span {
  color: var(--text-secondary);
  font-size: 9.5pt !important;
  line-height: 1.35;
}

.settings-conflict-row > .settings-conflict-kind {
  color: var(--text-primary);
  font-size: 8.5pt !important;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-conflict-row > .settings-conflict-guidance {
  color: var(--text-tertiary);
  font-size: 8.75pt !important;
}

.settings-panel .settings-conflict-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: var(--space-1);
}

.settings-panel .settings-conflict-actions .settings-mini-button {
  width: 100%;
  min-width: 0;
}

.settings-panel .settings-plan-features {
  gap: var(--space-1);
}

.settings-panel .settings-feature-row {
  grid-template-columns: 18px minmax(0, 1fr);
  gap: var(--space-2);
  padding: 8px;
  border: 0;
  border-radius: 8px;
}

.settings-panel .settings-feature-row.is-active {
  border-color: transparent;
  background: transparent;
}

.settings-panel .settings-feature-icon {
  width: 18px;
  height: 18px;
  border-color: var(--text-tertiary);
  background: transparent;
  color: transparent;
  font-size: 8pt !important;
}

.settings-panel .settings-feature-row.is-active .settings-feature-icon {
  border-color: var(--text-primary);
  background: var(--text-primary);
  color: var(--surface);
}

.settings-panel .settings-feature-row p {
  gap: 1px;
}

.settings-panel .settings-feature-row strong {
  font-size: 9.75pt !important;
}

.settings-panel .settings-feature-row span:not(.settings-feature-icon) {
  font-size: 9pt !important;
  line-height: 1.3;
}

.settings-panel .settings-plan-upgrade-note {
  display: inline-flex;
  margin-left: 4px;
  color: var(--code-accent) !important;
  font-size: 8pt !important;
  font-weight: 600;
}

.settings-panel .settings-feature-row.is-active .settings-plan-upgrade-note {
  display: none;
}

.settings-panel .settings-primary-button,
.settings-panel .settings-secondary-button,
.settings-panel .settings-mini-button {
  justify-self: center;
  width: 60%;
  min-height: 40px;
  margin-inline: auto;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  font-size: 9.75pt !important;
}

.settings-panel .settings-primary-button {
  border: 0;
}

.settings-panel .account-checkout.is-pro-active,
.settings-panel .account-checkout.is-pro-active:disabled {
  background: var(--pro-active-background);
  color: #001014;
  opacity: 1;
}

.settings-panel .settings-secondary-button,
.settings-panel .settings-mini-button {
  border: 0;
  background: var(--settings-inset-surface);
}

.settings-panel .settings-link-button {
  justify-self: start;
  width: fit-content;
  min-height: 30px;
  border-radius: 6px;
  font-size: 9pt !important;
  font-weight: 550;
}

.settings-panel .account-plan-secondary {
  justify-self: center;
}

.settings-panel .settings-primary-button:disabled,
.settings-panel .settings-secondary-button:disabled,
.settings-panel .settings-link-button:disabled,
.settings-panel .settings-mini-button:disabled {
  opacity: 0.38;
}

.settings-panel .account-profile-editor {
  gap: var(--space-1);
}

.settings-panel .account-profile-editor label {
  font-size: 9.5pt !important;
}

.settings-panel .account-profile-editor input {
  min-height: 40px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: 8px;
  background: var(--settings-inset-surface);
  font-size: 9.75pt !important;
}

.settings-panel .account-profile-editor input:focus-visible {
  border-color: color-mix(in srgb, var(--text-primary) 45%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-primary) 10%, transparent);
}

.settings-panel .account-profile-save {
  margin-top: 2px;
}

.settings-panel .settings-destructive-secondary {
  border: 0;
  background: var(--text-primary);
  color: var(--surface);
}

.settings-panel .settings-destructive-secondary {
  margin-top: 2px;
}

.settings-panel .settings-destructive-secondary.account-delete,
.settings-panel .settings-destructive-secondary.settings-firm-delete {
  background: color-mix(in srgb, var(--destructive) 10%, transparent);
  color: var(--destructive);
}

.settings-panel .settings-firm-delete {
  margin-top: var(--space-2);
}

.settings-panel .reader-preview-card {
  gap: var(--space-2);
}

.settings-panel .reader-preview-sample {
  display: grid;
  gap: var(--space-1);
  max-height: 126px;
  padding: var(--space-2);
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: var(--settings-inset-surface);
}

.settings-panel .preview-code-title {
  font-size: 8pt !important;
}

.settings-panel .reader-preview-sample h3 {
  font-size: calc(var(--reader-font-size) * 0.96) !important;
}

.settings-panel .preview-copy {
  display: -webkit-box;
  overflow: hidden;
  font-size: calc(var(--reader-font-size) * 0.92) !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.settings-panel .preview-setting-row {
  min-height: 34px;
  padding-top: 0;
  font-size: 9.5pt !important;
}

.settings-panel .settings-data-card {
  gap: var(--space-3);
}

.settings-panel .settings-data-subsection,
.settings-panel .settings-danger-zone {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.settings-panel .settings-projects-heading h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: 9.75pt !important;
  font-weight: 650;
}

.settings-panel .settings-projects-heading .settings-link-button {
  justify-self: auto;
  min-height: 28px;
}

.settings-panel .settings-project-row {
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--border);
}

.settings-panel .settings-project-row:last-child {
  border-bottom: 0;
}

.settings-panel .settings-project-copy strong {
  font-size: 9.75pt !important;
}

.settings-panel .settings-project-copy span,
.settings-panel .settings-projects-empty {
  font-size: 8.75pt !important;
}

.settings-panel .settings-danger-zone {
  padding-top: var(--space-3);
}

.settings-panel .settings-project-delete {
  border: 0;
  background: transparent;
  color: var(--settings-danger);
}

.settings-panel .settings-project-delete:disabled {
  color: var(--text-secondary);
}

.settings-panel .settings-danger-list {
  border-top: 1px solid var(--border);
}

.settings-panel .settings-danger-button {
  grid-template-columns: 20px minmax(0, 1fr);
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--settings-danger);
  font-size: 9.25pt !important;
  font-weight: 550;
}

.settings-panel .settings-danger-button:last-child {
  border-bottom: 0;
}

.settings-panel .settings-danger-button:disabled {
  color: var(--text-secondary);
  cursor: default;
  opacity: 0.58;
}

.settings-panel .settings-danger-button > span {
  color: inherit;
  font-size: 10pt !important;
}

.settings-panel .settings-disclaimer,
.settings-panel .settings-status-message {
  align-self: stretch;
  margin: 0;
  padding: 2px var(--space-1);
  font-size: 8.75pt !important;
  line-height: 1.35;
}

.settings-panel .settings-footer-links {
  text-align: center;
}

@container (max-width: 340px) {
  .settings-panel .settings-card,
  .settings-panel .settings-list,
  .settings-panel .reader-preview-card,
  .settings-panel .account-connector {
    padding: var(--space-2);
  }

  .settings-panel .settings-primary-button,
  .settings-panel .settings-secondary-button,
  .settings-panel .settings-danger-button {
    min-height: 44px;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 58px;
    --divider-width: 0px;
  }

  .workspace-shell {
    grid-template-rows: minmax(0, 1fr) var(--header-height);
  }

  .topbar {
    grid-row: -2 / -1;
    display: block;
    padding: 0 max(10px, env(safe-area-inset-right)) max(0px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    overflow: hidden;
    border-top: 1px solid var(--border);
    border-bottom: 0;
    background: var(--surface-raised);
  }

  .topbar-brand {
    display: none;
  }

  .topbar-account-state {
    display: contents;
  }

  .connection-status {
    position: fixed;
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(var(--header-height) + max(8px, env(safe-area-inset-bottom)));
    z-index: 900;
    min-height: 30px;
    box-shadow: 0 4px 16px color-mix(in srgb, #000000 16%, transparent);
  }

  .connection-status:not([data-state="offline"]):not([data-state="pending"]):not([data-state="conflict"]) {
    display: none;
  }

  .topbar-actions {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 4px 0;
    overflow: visible;
  }

  .topbar-actions::-webkit-scrollbar {
    display: none;
  }

  .topbar .toolbar-button,
  .topbar .mobile-more-button {
    display: grid;
    width: 100%;
    min-width: 0;
    min-height: 50px;
    grid-template-rows: 24px auto;
    place-items: center;
    gap: 1px;
    padding: 3px 2px 2px;
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 650;
    text-transform: none;
  }

  .topbar .toolbar-button > svg,
  .topbar .mobile-more-button > svg {
    display: block;
    width: 21px;
    height: 21px;
  }

  .topbar #toggle-saved { order: 1; }
  .topbar #add-reader { order: 2; }
  .topbar #toggle-search { order: 3; }
  .topbar #toggle-analysis { order: 4; }
  .topbar #mobile-more { order: 5; }

  .topbar #fit-columns,
  .topbar #collapse-readers,
  .topbar #toggle-workboard {
    display: none !important;
  }

  .topbar .toolbar-button[aria-pressed="true"],
  .topbar #add-reader.has-open-reader,
  .topbar .mobile-more-button[aria-expanded="true"] {
    background: color-mix(in srgb, var(--code-accent) 18%, transparent);
    color: var(--text-primary);
  }

  .topbar-workspaces {
    display: none;
  }

  .topbar-layout-actions {
    display: none;
  }

  .workspace-tab,
  .workspace-add-button,
  .workspace-actions-button,
  .workspace-name-input {
    min-height: 42px;
  }

  .workspace-add-button,
  .workspace-actions-button,
  .topbar-settings-button {
    width: 38px;
    height: 42px;
    flex-basis: 38px;
  }

  .topbar-settings-button {
    display: none;
  }

  .panel-track {
    grid-row: 1;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
  }

  .panel-track::-webkit-scrollbar {
    display: none;
  }

  .workspace-panel {
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    height: 100%;
    padding: var(--space-4);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .pane-divider {
    display: none;
  }

  .pane-drag-handle {
    display: none;
  }

  .settings-row {
    grid-template-columns: 1fr;
    gap: var(--space-1);
    padding-block: var(--space-3);
  }

  .settings-list strong {
    text-align: left;
  }
}

@container (max-width: 360px) {
  .settings-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: var(--space-1);
    padding-block: var(--space-3);
  }

  .settings-list strong {
    text-align: left;
    overflow-wrap: anywhere;
  }
}

@container (max-width: 320px) {
  .project-card,
  .saved-row,
  .analysis-card,
  .reader-preview-card,
  .account-connector {
    padding: var(--space-3);
  }

  .projects-content .project-card {
    min-height: auto;
    padding: var(--space-3);
  }

  .project-meta {
    display: grid;
    gap: var(--space-1);
  }

  .projects-content .project-meta span {
    width: fit-content;
    max-width: 100%;
  }

  .preview-setting-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
    align-items: start;
  }

  .preview-setting-row select {
    width: 100%;
    text-align: left;
  }

  .connector-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}

.notebook-panel {
  --project-pane-band-height: calc(var(--panel-padding) + var(--panel-title-row-height) + var(--space-3));
  --project-pane-band-background: color-mix(in srgb, var(--project-color) 42%, var(--surface));
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  isolation: isolate;
  background: var(--surface-raised);
}

.project-detail-panel::before,
.notebook-panel::before,
.report-draft-panel::before {
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  height: var(--project-pane-band-height);
  content: "";
  pointer-events: none;
  background: var(--project-pane-band-background);
}

.coordination-panel::before,
.coordination-thread-panel::before {
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  height: var(--project-pane-band-height);
  content: "";
  pointer-events: none;
  background: var(--project-pane-band-background);
}

.project-detail-panel > *,
.notebook-panel > *,
.report-draft-panel > * {
  position: relative;
  z-index: 1;
}

.coordination-panel > *,
.coordination-thread-panel > * {
  position: relative;
  z-index: 1;
}

.notebook-header {
  display: flex;
  min-height: var(--panel-title-row-height);
  align-items: flex-start;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.notebook-header,
.report-draft-header-actions {
  align-items: center;
}

.notebook-heading {
  display: grid;
  min-width: 0;
  margin-right: auto;
}

.notebook-heading strong {
  color: var(--text-primary);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notebook-card-rail h3,
.notebook-welcome h3 {
  margin: 0;
}

.notebook-toolbar button,
.notebook-primary-action,
.notebook-secondary-action,
.notebook-danger-action {
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--toolbar-active);
  color: var(--text-primary);
  font-weight: 650;
}

.notebook-toolbar button:hover,
.notebook-secondary-action:hover {
  background: color-mix(in srgb, var(--project-color) 18%, var(--surface));
}

.notebook-add-to-report.is-in-report {
  background: color-mix(in srgb, var(--project-color) 28%, var(--surface));
}

.notebook-primary-action {
  background: color-mix(in srgb, var(--project-color) 68%, var(--surface));
  color: color-mix(in srgb, var(--text-primary) 94%, #000);
}

.notebook-danger-action {
  background: color-mix(in srgb, #d43b32 16%, var(--surface));
  color: color-mix(in srgb, #d43b32 78%, var(--text-primary));
}

.notebook-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: calc(100% + (2 * var(--panel-padding)));
  min-height: 0;
  margin-inline: calc(-1 * var(--panel-padding));
  overflow: hidden;
  border-radius: 0;
  background: var(--surface-raised);
}

.notebook-status {
  grid-column: 1 / -1;
  margin: 0;
  padding: var(--space-5);
  color: var(--text-secondary);
}

.notebook-card-rail {
  display: grid;
  gap: 0;
  min-width: 0;
  margin: var(--space-3) var(--panel-padding) var(--space-3);
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--menu-subtle-surface);
  transition: padding-bottom 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.notebook-card-rail.is-open {
  padding-bottom: 0;
}

.notebook-card-rail-header {
  position: relative;
  display: flex;
  align-items: center;
}

.notebook-card-rail-header[hidden] {
  display: none;
}

.notebook-card-menu-toggle {
  width: 100%;
  min-height: 40px;
  background: var(--menu-surface);
}

.notebook-card-menu-toggle:hover,
.notebook-card-menu-toggle:focus-visible {
  background: var(--menu-surface);
}

.notebook-card-rail-actions {
  position: absolute;
  top: 50%;
  right: calc(var(--space-3) + 18px + var(--space-2));
  z-index: 1;
  display: none;
  align-items: center;
  gap: var(--space-2);
  transform: translateY(-50%);
}

.notebook-card-menu.is-open .notebook-card-rail-actions {
  display: flex;
}

.notebook-card-add-action,
.notebook-card-archive-action,
.notebook-card-select-action,
.notebook-card-selection-action {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

.notebook-card-add-action {
  display: inline-flex;
  width: auto;
  gap: 4px;
  padding-inline: 4px;
  font-size: 11px;
  white-space: nowrap;
}

.notebook-card-selection-cancel {
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 400;
  box-shadow: none;
}

.notebook-card-add-action:hover,
.notebook-card-add-action:focus-visible,
.notebook-card-archive-action:hover,
.notebook-card-archive-action:focus-visible,
.notebook-card-select-action:hover,
.notebook-card-select-action:focus-visible,
.notebook-card-selection-action:hover,
.notebook-card-selection-action:focus-visible,
.notebook-card-selection-cancel:hover,
.notebook-card-selection-cancel:focus-visible {
  color: var(--text-primary);
}

.notebook-card-rail-actions svg {
  width: 14px;
  height: 14px;
}

.notebook-card-rail-actions button:disabled {
  opacity: 0.34;
}

.notebook-card-rail-actions button[hidden] {
  display: none;
}

.notebook-card-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-flow: row;
  align-content: start;
  width: 100%;
  gap: var(--space-1);
  min-height: 0;
  overflow-y: auto;
  padding-inline: var(--space-3);
  border-radius: var(--radius-control);
  background-color: var(--menu-surface);
  background-image: none;
}

.code-filter-menu.notebook-card-menu .notebook-card-list {
  height: 0;
  transition:
    height 420ms cubic-bezier(0.22, 1, 0.36, 1),
    max-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 260ms ease,
    padding 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.notebook-card-menu.is-open .notebook-card-list {
  height: min(var(--notebook-card-list-height, 156px), 70vh);
  max-height: min(var(--notebook-card-list-height, 156px), 70vh);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}

.notebook-card-list-resize-handle {
  position: relative;
  display: block;
  height: 0;
  overflow: hidden;
  cursor: row-resize;
  opacity: 0;
  pointer-events: none;
  touch-action: none;
  transition:
    height 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease;
}

.notebook-card-menu.is-open .notebook-card-list-resize-handle {
  height: 5px;
  opacity: 1;
  pointer-events: auto;
}

.code-filter-menu.notebook-card-menu.is-restoring .notebook-card-list,
.notebook-card-menu.is-restoring .notebook-card-list-resize-handle {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .code-filter-menu.notebook-card-menu .notebook-card-list,
  .notebook-card-list-resize-handle {
    transition: none;
  }
}

.notebook-card-list-resize-handle::after {
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 36px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--text-secondary);
  content: "";
  opacity: 0.7;
  transform: translateX(-50%);
}

.notebook-card-list-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: var(--space-3);
  color: var(--text-secondary);
  line-height: 1.45;
}

.notebook-card-row {
  position: relative;
  min-width: 0;
}

.notebook-card-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: var(--space-3);
  row-gap: 2px;
  width: 100%;
  padding: var(--space-1) 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.notebook-card-tile:hover,
.notebook-card-tile[aria-pressed="true"] {
  background: transparent;
  color: var(--text-primary);
}

.notebook-card-tile:hover strong,
.notebook-card-tile[aria-pressed="true"] strong,
.notebook-card-row.is-selected .notebook-card-tile strong {
  color: var(--project-color);
}

.notebook-card-tile small {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 650;
}

.notebook-card-tile strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notebook-card-tile small {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  white-space: nowrap;
}

.notebook-card-row.is-selected {
  background: transparent;
}

.notebook-focus {
  display: grid;
  grid-template-rows: auto auto minmax(220px, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: var(--space-4);
  background: var(--surface-raised);
}

.notebook-welcome {
  align-self: center;
  justify-self: center;
  max-width: 460px;
  padding: var(--space-5);
  text-align: center;
}

.notebook-welcome p {
  color: var(--text-secondary);
  line-height: 1.5;
}

.notebook-card-fields {
  margin-bottom: var(--space-2);
}

.notebook-card-title {
  height: 40px;
  min-height: 40px;
  min-width: 0;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  color: var(--text-primary);
}

.notebook-card-title {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: 16px;
  font-weight: 700;
  line-height: 40px;
}

.notebook-toolbar {
  display: block;
  margin-bottom: var(--space-2);
}

.notebook-reference-menu {
  display: grid;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border-radius: var(--radius-card);
  background: var(--menu-subtle-surface);
  transition: padding-bottom 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.notebook-reference-menu.is-open {
  padding-bottom: var(--space-3);
}

.notebook-toolbar .notebook-reference-menu-toggle {
  min-height: 40px;
  border-radius: var(--radius-pill);
  background: var(--menu-surface);
  font-size: 12px !important;
  font-weight: 400;
}

.notebook-toolbar .notebook-reference-menu-toggle:hover,
.notebook-toolbar .notebook-reference-menu-toggle:focus-visible {
  background: var(--menu-surface);
}

.notebook-reference-list {
  display: block;
  min-height: 0;
  padding-inline: var(--space-3);
  padding-bottom: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  background-image: none;
}

.code-filter-menu.is-open .notebook-reference-list {
  padding-bottom: var(--space-3);
}

.notebook-reference-group-title {
  display: block;
  margin: var(--space-2) 0 0;
  padding: 0;
  color: var(--code-accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.notebook-reference-code-group,
.notebook-reference-chapter-group {
  display: block;
}

.notebook-reference-code-group > summary,
.notebook-reference-chapter-group > summary {
  cursor: pointer;
  list-style: none;
}

.notebook-reference-code-group > summary::-webkit-details-marker,
.notebook-reference-chapter-group > summary::-webkit-details-marker {
  display: none;
}

.notebook-reference-code-group > .notebook-reference-group-title,
.notebook-reference-chapter-title {
  position: relative;
  padding-right: 18px;
}

.notebook-reference-code-group > .notebook-reference-group-title::after,
.notebook-reference-chapter-title::after {
  position: absolute;
  top: 50%;
  right: 2px;
  color: var(--text-tertiary);
  content: "›";
  transform: translateY(-50%);
  transition: transform 160ms ease;
}

.notebook-reference-code-group[open] > .notebook-reference-group-title::after,
.notebook-reference-chapter-group[open] > .notebook-reference-chapter-title::after {
  transform: translateY(-50%) rotate(90deg);
}

.notebook-reference-chapter-title {
  margin: var(--space-1) 0 0;
  padding-block: 5px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}

.notebook-reference-chapter-body {
  padding-left: var(--space-2);
}

.notebook-reference-group-title:first-child {
  margin-top: 0;
}

.notebook-toolbar .notebook-reference-option {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  box-sizing: border-box;
  padding: 6px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--text-tertiary) 24%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: left;
  white-space: normal;
}

.notebook-reference-option strong,
.notebook-reference-option small {
  display: block;
  min-width: 0;
}

.notebook-reference-option strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-primary);
  font: inherit;
  font-weight: 600;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notebook-reference-option small {
  margin-top: 2px;
  color: var(--text-tertiary);
  font-size: 10px;
  line-height: 1.25;
}

.notebook-reference-option:last-child {
  border-bottom: 0;
}

.notebook-toolbar .notebook-reference-option:hover,
.notebook-toolbar .notebook-reference-option:focus-visible {
  background: transparent;
  color: var(--text-primary);
}

.notebook-reference-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: var(--space-2) 0;
  color: var(--text-secondary);
  font-size: 12px;
}

/* Keep references as a readable dropdown list. The shared menu animation
 * measures the full content height, so this later, more-specific rule caps
 * the open rail and restores scrolling inside it. */
.notebook-reference-menu .notebook-reference-list {
  background-image: none;
}

.notebook-reference-menu.is-open .notebook-reference-list {
  max-height: min(var(--code-filter-menu-height, 240px), 52vh, 360px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}

.notebook-editor-surface {
  min-height: 0;
  overflow-y: auto;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--menu-surface);
  box-shadow: none;
}

.notebook-editor-surface:focus-within {
  box-shadow: none;
}

.notebook-editor-surface .bn-container {
  min-height: 100%;
  border-radius: inherit;
  background: var(--menu-surface);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.55;
}

.notebook-editor-surface .bn-editor {
  min-height: 100%;
  padding: var(--space-4);
  border-radius: inherit;
  background: var(--menu-surface);
  color: var(--text-primary);
  font-family: inherit;
}

/* Reserve a gutter for BlockNote's add and drag controls. BlockNote positions
 * its side menu just to the left of the active block, so the normal editor
 * padding lets those controls escape a narrow Notebook column. */
.notebook-editor-surface:not(.project-note-editor-surface) .bn-editor {
  padding-inline-start: calc(var(--space-4) + 32px);
}

.notebook-editor-surface .bn-block-content,
.notebook-editor-surface .bn-inline-content {
  font-family: inherit;
}

.notebook-editor-surface .bn-block-content::after,
.notebook-editor-surface .bn-side-menu svg {
  color: var(--text-tertiary) !important;
}

.notebook-editor-surface .bn-side-menu,
.notebook-editor-surface .bn-formatting-toolbar,
.notebook-editor-surface .bn-suggestion-menu,
.notebook-editor-surface .mantine-Menu-dropdown,
.notebook-editor-surface .mantine-Popover-dropdown {
  background: var(--menu-surface) !important;
  color: var(--text-primary);
}

/* Slash menus are portaled to the document so Floating UI can flip and size
 * them against the viewport instead of clipping them to an editor column. */
.bn-suggestion-menu {
  background: var(--menu-surface) !important;
  color: var(--text-primary);
}

.notebook-editor-surface [data-color-scheme="dark"] {
  --mantine-color-body: var(--surface);
  --mantine-color-text: var(--text-primary);
}

.notebook-editor-surface img {
  max-width: 100%;
  border-radius: var(--radius-control);
}

.notebook-editor-surface table :is(th, td) {
  border-color: #000 !important;
  color: var(--text-primary) !important;
}

@media (prefers-color-scheme: dark) {
  .notebook-editor-surface,
  .notebook-editor-surface .bn-container,
  .notebook-editor-surface .bn-editor {
    background: var(--menu-surface);
    color: var(--text-primary);
  }

  .notebook-editor-surface .bn-block-content,
  .notebook-editor-surface .bn-inline-content,
  .notebook-editor-surface table :is(th, td),
  .notebook-editor-surface table :is(th, td) * {
    color: var(--text-primary) !important;
  }

  .notebook-editor-surface table :is(th, td) {
    border-color: #fff !important;
  }
}

.notebook-reference-chip {
  display: inline-grid;
  gap: 1px;
  max-width: 100%;
  padding: 3px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  box-shadow: none;
  cursor: pointer;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: baseline;
}

.notebook-reference-chip:hover {
  background: transparent;
}

.notebook-reference-meta {
  color: var(--text-tertiary);
  font-size: 0.78em;
  font-weight: 650;
  line-height: 1.2;
}

.notebook-reference-title {
  color: var(--text-primary);
  font-size: 0.9em;
  font-weight: 700;
  line-height: 1.25;
}

.notebook-reference-preview {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.84em;
  font-weight: 400;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notebook-reference-chip:hover .notebook-reference-title,
.notebook-reference-chip:focus-visible .notebook-reference-title {
  color: var(--project-color, var(--text-primary));
}

.notebook-reference-chip:focus-visible,
.notebook-card-tile:focus-visible,
.notebook-card-delete:focus-visible,
.notebook-toolbar button:focus-visible,
.notebook-primary-action:focus-visible,
.notebook-secondary-action:focus-visible,
.notebook-danger-action:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--project-color) 56%, transparent);
  outline-offset: 2px;
}

.notebook-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-3);
}

.notebook-card-footer > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-1);
}

.notebook-report-status {
  margin-right: auto;
  color: var(--text-secondary);
  font-size: 11px;
}

.notebook-research-draft {
  background: color-mix(in srgb, var(--accent-building) 12%, var(--surface));
}

.notebook-research-draft p {
  margin: var(--space-2) 0;
  color: var(--text-primary);
  line-height: 1.45;
}

.notebook-research-draft small {
  color: var(--text-secondary);
  line-height: 1.4;
}

@container (max-width: 620px) {
  .notebook-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(360px, 1fr);
    overflow-y: auto;
  }

  .notebook-card-rail {
    min-height: 0;
  }

  .notebook-focus {
    min-height: 440px;
  }
}

@container (max-width: 400px) {
  .notebook-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .notebook-card-footer > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}

.report-draft-panel {
  --pane-min-width: 600px;
  --project-pane-band-height: calc(var(--panel-padding) + var(--panel-title-row-height) + var(--space-3));
  --project-pane-band-background: color-mix(in srgb, var(--project-color) 42%, var(--surface));
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  isolation: isolate;
  background: var(--surface-raised);
}

.coordination-panel,
.coordination-thread-panel {
  --project-pane-band-height: calc(var(--panel-padding) + var(--panel-title-row-height) + var(--space-3));
  --project-pane-band-background: color-mix(in srgb, var(--project-color) 42%, var(--surface));
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  isolation: isolate;
  background: color-mix(in srgb, var(--project-color) 7%, var(--surface-raised));
}

.coordination-header,
.coordination-thread-header {
  display: flex;
  min-height: var(--panel-title-row-height);
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding-top: calc(var(--project-pane-band-height) - var(--panel-padding) + var(--space-3));
}

.coordination-header > div:first-child,
.coordination-thread-header > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.coordination-header h2,
.coordination-thread-header h2 {
  margin: 0;
  overflow: hidden;
  font-size: calc(var(--chrome-font-size) * 1.08) !important;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.coordination-header > div:first-child > span,
.coordination-thread-header > div:first-child > span {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 10px !important;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coordination-close {
  display: grid;
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.coordination-close:hover,
.coordination-close:focus-visible {
  color: var(--text-primary);
}

.coordination-close svg {
  width: var(--panel-title-icon-size);
  height: var(--panel-title-icon-size);
}

.coordination-content,
.coordination-thread-content {
  min-height: 0;
  overflow: auto;
  padding-bottom: var(--space-5);
}

.coordination-content {
  display: grid;
  align-content: start;
  gap: var(--space-3);
}

.coordination-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
  padding: 3px;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--project-color) 9%, var(--surface));
}

.coordination-filters button {
  min-width: 0;
  min-height: 34px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: calc(var(--radius-control) - 2px);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 10px !important;
  font-weight: 700;
  white-space: nowrap;
}

.coordination-filters button[aria-selected="true"] {
  background: color-mix(in srgb, var(--project-color) 25%, var(--surface-raised));
  color: var(--text-primary);
}

.coordination-filters button:focus-visible,
.coordination-list-item:focus-visible,
.coordination-create-actions button:focus-visible,
.coordination-thread-controls button:focus-visible,
.coordination-thread-controls select:focus-visible,
.coordination-linked-card:focus-visible,
.coordination-response-form textarea:focus-visible,
.coordination-response-form button:focus-visible,
.coordination-resolution-form textarea:focus-visible,
.coordination-resolution-form button:focus-visible,
.project-coordination-summary button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--project-color) 56%, transparent);
  outline-offset: 2px;
}

.coordination-create-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.coordination-create-actions button,
.coordination-thread-controls button,
.coordination-response-form button,
.coordination-resolution-form button,
.project-coordination-summary button,
.coordination-composer-heading button {
  min-height: 34px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--project-color) 24%, var(--surface));
  color: var(--text-primary);
  font: inherit;
  font-size: 10px !important;
  font-weight: 700;
}

.coordination-create-actions button:hover,
.coordination-thread-controls button:hover,
.coordination-response-form button:hover,
.coordination-resolution-form button:hover,
.project-coordination-summary button:hover {
  background: color-mix(in srgb, var(--project-color) 38%, var(--surface));
}

.coordination-composer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.coordination-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.coordination-list-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: var(--space-3);
  border: 0;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--project-color) 9%, var(--surface));
  color: var(--text-primary);
  text-align: left;
}

.coordination-list-item:hover,
.coordination-list-item[aria-current="true"] {
  background: color-mix(in srgb, var(--project-color) 22%, var(--surface));
}

.coordination-list-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.coordination-list-item > strong {
  font-size: calc(var(--chrome-font-size) * 0.82) !important;
  line-height: 1.35;
}

.coordination-type,
.coordination-status {
  color: var(--text-secondary);
  font-size: 9px !important;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.coordination-status {
  padding: 4px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--project-color) 16%, var(--surface-raised));
}

.coordination-status.is-waiting {
  background: color-mix(in srgb, #c78220 18%, var(--surface-raised));
}

.coordination-status.is-resolved {
  opacity: 0.72;
}

.coordination-linked-item,
.coordination-list-meta {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 10px !important;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coordination-linked-item {
  color: color-mix(in srgb, var(--project-color) 72%, var(--text-primary));
  font-weight: 650;
}

.coordination-empty {
  padding: var(--space-5) var(--space-3);
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.76) !important;
  text-align: center;
}

.project-coordination-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--project-color) 11%, var(--surface));
}

.project-coordination-summary > div {
  display: grid;
  gap: 4px;
}

.project-coordination-summary strong {
  font-size: calc(var(--chrome-font-size) * 0.8) !important;
}

.coordination-thread-content {
  display: grid;
  align-content: start;
  gap: var(--space-4);
}

.coordination-thread-metadata {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
  gap: 5px var(--space-3);
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--project-color) 8%, var(--surface));
}

.coordination-thread-metadata dt,
.coordination-thread-metadata dd {
  margin: 0;
  font-size: 10px !important;
  line-height: 1.35;
}

.coordination-thread-metadata dt {
  color: var(--text-secondary);
  font-weight: 650;
}

.coordination-thread-metadata dd {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coordination-linked-card {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: var(--space-3);
  border: 0;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--project-color) 15%, var(--surface));
  color: var(--text-primary);
  text-align: left;
}

.coordination-linked-card:hover {
  background: color-mix(in srgb, var(--project-color) 26%, var(--surface));
}

.coordination-linked-card span,
.coordination-request > span {
  color: var(--text-secondary);
  font-size: 9px !important;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.coordination-linked-card strong {
  font-size: calc(var(--chrome-font-size) * 0.8) !important;
}

.coordination-thread-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.coordination-thread-controls select {
  min-width: 150px;
  min-height: 34px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--project-color) 12%, var(--surface));
  color: var(--text-primary);
  font: inherit;
  font-size: 10px !important;
  font-weight: 650;
}

.coordination-request,
.coordination-discussion article,
.coordination-resolution {
  display: grid;
  gap: 5px;
  padding: var(--space-3);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--project-color) 8%, var(--surface));
}

.coordination-request p,
.coordination-discussion p,
.coordination-resolution p {
  margin: 0;
  color: var(--text-primary);
  font-size: calc(var(--chrome-font-size) * 0.76) !important;
  line-height: 1.5;
  white-space: pre-wrap;
}

.coordination-request small,
.coordination-discussion small,
.coordination-resolution small,
.coordination-thread-activity small {
  color: var(--text-secondary);
  font-size: 10px !important;
}

.coordination-discussion,
.coordination-thread-activity {
  display: grid;
  gap: var(--space-2);
}

.coordination-discussion h3,
.coordination-thread-activity h3 {
  margin: 0;
  color: var(--text-secondary);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.coordination-response-form,
.coordination-resolution-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--space-2);
}

.coordination-response-form textarea,
.coordination-resolution-form textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 0;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--project-color) 7%, var(--surface-raised));
  color: var(--text-primary);
  font: inherit;
  font-size: calc(var(--chrome-font-size) * 0.74) !important;
  line-height: 1.4;
  resize: vertical;
}

.coordination-resolution {
  background: color-mix(in srgb, var(--project-color) 17%, var(--surface));
}

.coordination-thread-activity ol {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.coordination-thread-activity li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--project-color) 20%, transparent);
  font-size: calc(var(--chrome-font-size) * 0.72) !important;
}

.coordination-thread-activity li > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.coordination-thread-activity li p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 10px !important;
  line-height: 1.4;
  white-space: pre-wrap;
}

.project-research-history-card.is-coordination-target,
.project-evidence-review.is-coordination-target {
  background: color-mix(in srgb, var(--project-color) 30%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--project-color) 44%, transparent);
}

@container (max-width: 400px) {
  .coordination-response-form,
  .coordination-resolution-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .coordination-thread-controls select,
  .coordination-thread-controls button,
  .coordination-response-form button,
  .coordination-resolution-form button {
    width: 100%;
  }

  .project-coordination-summary {
    align-items: stretch;
    flex-direction: column;
  }
}

.report-draft-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.report-heading {
  display: grid;
  min-width: 0;
  margin-right: auto;
}

.report-heading strong {
  color: var(--text-primary);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.report-draft-header h2 {
  margin: 0;
}

.report-draft-eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
}

.report-draft-add-controls button,
.report-draft-block-actions button,
.report-source-card button,
.report-draft-primary-actions button,
.report-history-card,
.report-history-files button {
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--toolbar-active);
  color: var(--text-primary);
  font-weight: 650;
}

.report-draft-add-controls button:hover,
.report-draft-block-actions button:hover,
.report-source-card button:hover,
.report-history-card:hover,
.report-history-files button:hover {
  background: color-mix(in srgb, var(--project-color) 22%, var(--surface));
}

.report-draft-shell {
  --report-content-edge: var(--space-3);
  display: grid;
  align-content: start;
  gap: var(--space-3);
  min-height: 0;
  overflow-y: auto;
  padding: var(--report-content-edge);
  border-radius: calc(var(--radius-card) + 4px);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.report-draft-status,
.report-draft-empty {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.report-draft-picker select,
.report-draft-metadata input,
.report-draft-metadata textarea,
.report-draft-block input,
.report-draft-block textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  color: var(--text-primary);
}

.report-draft-picker select,
.report-draft-metadata input:first-child {
  font-weight: 700;
}

.report-draft-metadata {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
}

.report-draft-metadata textarea {
  grid-column: 1 / -1;
  min-height: 82px;
  resize: vertical;
}

.report-introduction-section {
  display: grid;
  gap: var(--space-2);
}

.report-introduction-section textarea {
  background: var(--menu-surface);
  resize: none;
}

.report-introduction-resize-handle {
  position: relative;
  z-index: 1;
  height: 14px;
  margin-top: -14px;
  cursor: row-resize;
  touch-action: none;
}

.report-introduction-resize-handle::after {
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 36px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--text-secondary);
  content: "";
  opacity: 0.7;
  transform: translateX(-50%);
}

.report-introduction-resize-handle:focus-visible,
.notebook-card-list-resize-handle:focus-visible {
  outline: 2px solid var(--project-color, var(--text-primary));
  outline-offset: -2px;
}

.report-introduction-label {
  margin: 0;
}

.report-introduction-label {
  width: fit-content;
}

.report-introduction-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.report-header-info {
  position: relative;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: help;
}

.report-header-info:hover,
.report-header-info:focus-visible {
  background: transparent;
  color: var(--text-primary);
}

.report-header-info svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-draft-panel [data-report-help] {
  position: relative;
}

.report-draft-panel [data-report-help]::after {
  position: absolute;
  z-index: 20;
  top: calc(100% + var(--space-2));
  right: 0;
  width: min(280px, calc(100vw - 40px));
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  content: attr(data-report-help);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.report-draft-panel [data-report-help]:hover::after,
.report-draft-panel [data-report-help]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .report-draft-panel [data-report-help]::after {
    transition: none;
  }
}

.report-draft-add-controls,
.report-draft-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.report-draft-blocks,
.report-source-palette,
.report-history {
  display: grid;
  gap: var(--space-2);
}

.report-draft-blocks-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.report-draft-blocks-heading,
.report-source-group-heading,
.report-output-heading,
.report-introduction-heading,
.report-draft-add-controls,
.report-draft-blocks-body,
.report-source-group-body,
.report-output-body {
  width: 100%;
  min-width: 0;
}

.report-draft-blocks-toggle {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.report-draft-blocks-chevron {
  flex: 0 0 auto;
  margin-left: auto;
}

.report-draft-blocks-body {
  display: grid;
  gap: var(--space-2);
}

.report-source-group {
  display: grid;
}

.report-source-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.report-source-group:first-child .report-source-group-heading {
  margin-top: 0;
}

.report-source-group-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
}

.report-source-group-toggle {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.report-source-group-chevron {
  flex: 0 0 auto;
  margin-left: auto;
}

.report-source-group-body {
  display: grid;
  gap: var(--space-2);
}

.report-evidence-code-group {
  display: grid;
  gap: var(--space-2);
}

.report-evidence-code-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-top: var(--space-2);
}

.report-evidence-code-group:first-of-type .report-evidence-code-heading {
  padding-top: 0;
}

.report-evidence-code-toggle {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--code-accent);
  text-align: left;
}

.report-evidence-code-chevron {
  flex: 0 0 auto;
  margin-left: auto;
}

.report-evidence-code-body {
  display: grid;
  gap: var(--space-2);
}

.report-output-section {
  display: grid;
}

.report-output-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.report-output-toggle {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.report-output-chevron {
  flex: 0 0 auto;
  margin-left: auto;
}

.report-output-body {
  display: grid;
}

.report-draft-block {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--surface-muted) 78%, var(--project-color));
}

.report-draft-block-evidence {
  background: color-mix(in srgb, #b56a20 12%, var(--surface));
}

.report-draft-block-researchAnswer {
  background: color-mix(in srgb, #5d6fb4 16%, var(--surface));
}

.report-draft-block-notebookCard {
  background: color-mix(in srgb, #785da8 14%, var(--surface));
}

.report-draft-block-projectFacts {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-2);
  padding-block: var(--space-2);
  background: transparent;
}

.report-draft-block-projectFacts .report-draft-block-top {
  grid-column: 2;
  grid-row: 1;
}

.report-draft-block-projectFacts .report-draft-classification {
  display: none;
}

.report-draft-block-projectFacts > strong {
  grid-column: 1;
  grid-row: 1;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.report-draft-block-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.report-draft-classification {
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.report-draft-block-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.report-draft-block-actions button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 10px !important;
}

.report-draft-block-actions .report-draft-block-remove {
  display: inline-grid;
  width: 30px;
  min-width: 30px;
  padding: 6px;
  place-items: center;
}

.report-draft-block-actions .report-draft-block-drag-handle {
  display: inline-grid;
  width: 30px;
  min-width: 30px;
  padding: 6px;
  place-items: center;
  cursor: grab;
}

.report-draft-block-drag-handle:active {
  cursor: grabbing;
}

.report-draft-block-remove svg,
.report-draft-block-drag-handle svg {
  width: 14px;
  height: 14px;
}

.report-draft-block.is-dragging {
  opacity: 0.45;
}

.report-draft-block.is-drop-before {
  box-shadow: inset 0 2px 0 var(--project-color);
}

.report-draft-block.is-drop-after {
  box-shadow: inset 0 -2px 0 var(--project-color);
}

.report-draft-block textarea {
  min-height: 90px;
  resize: vertical;
}

.report-note-provenance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}

.report-note-provenance > p {
  flex: 1 0 100%;
  -webkit-line-clamp: unset;
}

.report-note-evidence {
  min-height: 28px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, currentColor 14%, transparent);
  color: var(--code-accent, var(--text-secondary));
  font-size: 10px !important;
  font-weight: 550;
}

.report-draft-block strong,
.report-source-card strong {
  font-size: 13px;
  line-height: 1.35;
}

.report-draft-block p,
.report-source-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.report-source-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--project-color) 9%, var(--surface-muted));
  font-size: 12px;
}

.report-source-card.report-evidence-source-card {
  background: color-mix(in srgb, var(--code-accent) 13%, var(--surface-muted));
}

.report-source-card.report-evidence-source-card strong {
  color: color-mix(in srgb, var(--code-accent) 72%, var(--text-primary));
  font-weight: 400;
}

.report-source-card > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.report-source-card button:disabled {
  opacity: 0.48;
}

.report-source-included-label {
  color: var(--text-secondary);
  font-size: 10px;
}

.report-draft-primary-actions {
  position: sticky;
  z-index: 2;
  bottom: 0;
  padding: var(--space-2);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
}

.report-draft-primary-actions button:last-child {
  background: color-mix(in srgb, var(--project-color) 68%, var(--surface));
}

.report-draft-preview {
  padding: var(--space-5);
  border-radius: var(--radius-card);
  background: #f8f6f2;
  color: #191919;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.12);
}

.report-draft-preview h3,
.report-draft-preview h4 {
  margin: 0 0 var(--space-2);
}

.report-draft-preview p {
  margin: 0 0 var(--space-2);
  color: #444;
  font-size: 12px;
  line-height: 1.5;
}

.report-draft-preview .section-label {
  color: #8a4a10;
}

.report-preview-evidence,
.report-preview-researchAnswer,
.report-preview-notebookCard,
.report-preview-workboardPreview,
.report-preview-attachment {
  padding: var(--space-2);
  border-radius: var(--radius-control);
  background: rgb(0 0 0 / 0.05);
  font-weight: 650;
}

.report-history-card {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
}

.report-history-entry {
  display: grid;
  gap: 6px;
  margin: 0;
}

.report-history-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-history-files button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 10px;
}

.report-history-card span {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.35;
}

.report-draft-close:focus-visible,
.report-title-text:focus-visible,
.report-title-editor:focus-visible,
.report-draft-picker select:focus-visible,
.report-draft-metadata input:focus-visible,
.report-draft-metadata textarea:focus-visible,
.report-draft-block input:focus-visible,
.report-draft-block textarea:focus-visible,
.report-draft-add-controls button:focus-visible,
.report-draft-block-actions button:focus-visible,
.report-source-card button:focus-visible,
.report-draft-primary-actions button:focus-visible,
.report-history-card:focus-visible,
.report-history-files button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--project-color) 56%, transparent);
  outline-offset: 2px;
}

@container (max-width: 520px) {
  .report-draft-metadata {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-draft-metadata textarea {
    grid-column: auto;
  }

  .report-source-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-source-card button,
  .report-draft-primary-actions button {
    width: 100%;
  }
}

body .panel-track > article.workspace-panel:not(.reader-panel),
body .panel-track > article.workspace-panel:not(.reader-panel) * {
  font-size: 14px !important;
}

.code-question-panel {
  min-width: 288px;
}

.code-question-panel[data-cq-role="question-index"] {
  min-width: 300px;
}

.code-question-panel[data-cq-role="question-index"] .code-question-panel-body {
  overflow: hidden;
}

.code-question-panel-body {
  min-height: 0;
  padding: 12px 16px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.code-question-index-toolbar {
  display: block;
  margin-top: 10px;
}

.code-question-index {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
}

.code-question-index-search {
  display: block;
  width: 100%;
  min-height: 78px;
  resize: none;
  padding: var(--space-3) var(--space-3) calc(42px + var(--space-3));
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  line-height: 1.4;
  overflow-y: hidden;
  outline: 0;
}

.code-question-index-search::placeholder {
  color: var(--text-secondary);
}

.code-question-entry-box:has(.code-question-index-search:focus-visible) {
  outline: 2px solid var(--text-secondary);
  outline-offset: -2px;
}

.code-question-start-button {
  min-height: 42px;
}

.code-question-create-button {
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  background: color-mix(in srgb, var(--project-color, #6678d4) 85%, #000);
  color: #fff;
  cursor: pointer;
  font: inherit;
}

.code-question-index-meta {
  margin: 0 0 12px;
  color: var(--muted, #555);
}

.code-question-index-list {
  min-height: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.code-question-index-item {
  position: relative;
  display: block;
  border: 0;
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.1));
  border-radius: 0;
  padding: 2px 0;
}

.code-question-index-item.is-active {
  background: color-mix(in srgb, var(--project-color, #6678d4) 10%, transparent);
}

.code-question-index-open {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "id title";
  gap: 1px 8px;
  width: 100%;
  min-height: 44px;
  padding: 5px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.code-question-index-id {
  grid-area: id;
  font-weight: 400;
  align-self: start;
}

.code-question-index-title {
  grid-area: title;
  font-weight: 400;
}

.code-question-index-actions button {
  min-height: 32px;
  min-width: 32px;
  padding: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.code-question-index-actions {
  position: absolute;
  top: 6px;
  right: 0;
}

.code-question-index-list.is-managing .code-question-index-open {
  padding-right: 40px;
}

.code-question-index-archive svg,
.code-question-index-select svg {
  width: 14px;
  height: 14px;
}

.code-question-panel .code-question-index-select {
  width: var(--panel-title-control-size);
  height: var(--panel-title-control-size);
  padding: 0;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

.code-question-panel .code-question-index-select:hover,
.code-question-panel .code-question-index-select:focus-visible,
.code-question-panel .code-question-index-select[aria-pressed="true"] {
  border-color: transparent;
  background: transparent;
  color: var(--text-primary);
  box-shadow: none;
}

.code-question-index-empty,
.code-question-pane-placeholder,
.code-question-legacy-path {
  color: var(--muted, #444);
  line-height: 1.45;
}

.code-question-legacy-path {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.code-question-legacy-path h3 {
  margin: 0 0 6px;
  font-size: 1em;
}

.code-question-pane-status {
  font-weight: 600;
  color: inherit;
}

.code-decision-research,
.code-decision-record {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.code-decision-research-intro,
.code-decision-research-boundary {
  margin: 0;
  color: var(--muted, #555);
  line-height: 1.45;
}

.code-decision-research-intro p {
  margin: 0 0 6px;
}

.code-decision-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.code-decision-message {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 12px;
  line-height: 1.45;
}

.code-decision-message p {
  margin: 0 0 6px;
}

.code-decision-message p:last-child {
  margin-bottom: 0;
}

.code-decision-message.is-user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--project-color, #6678d4) 18%, var(--surface, #fff));
}

.code-decision-message.is-assistant {
  align-self: flex-start;
  background: color-mix(in srgb, var(--surface, #fff) 88%, var(--text-primary, #111));
}

.code-decision-message-role {
  font-weight: 700;
}

.code-decision-research-actions,
.code-decision-record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.code-decision-research-actions button,
.code-decision-record-actions button {
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--project-color, #6678d4) 12%, var(--surface, #fff));
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.code-decision-record-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.code-decision-record-header p,
.code-decision-record-header h3 {
  margin: 0;
}

.code-decision-state {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--project-color, #6678d4) 16%, transparent);
}

.code-decision-state.is-changed,
.code-decision-state.is-missing-information,
.code-decision-state.is-needs-review,
.code-decision-changed-warning {
  color: #6b4300;
  background: color-mix(in srgb, #d89a20 20%, transparent);
}

.code-decision-record-section {
  padding-top: 12px;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.09));
}

.code-decision-record-section h4,
.code-decision-record-section p,
.code-decision-record-section ul {
  margin-top: 0;
}

.code-decision-record-section ul {
  padding-left: 1.2rem;
}

.code-decision-record-section.is-professional {
  padding: 12px;
  border: 0;
  background: color-mix(in srgb, var(--project-color, #6678d4) 8%, transparent);
}

.code-decision-changed-warning {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
}

.code-decision-record-actions .code-decision-create-memo {
  background: color-mix(in srgb, var(--project-color, #6678d4) 85%, #000);
  color: #fff;
}

.code-decision-record-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Phase 3 — Define column */
.code-question-define {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.code-question-define-readonly-banner {
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: color-mix(in srgb, #c9a227 18%, transparent);
  font-weight: 600;
}

.code-question-define-readiness {
  padding: 10px 12px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
  border-radius: 8px;
  background: color-mix(in srgb, var(--project-color, #6678d4) 6%, transparent);
}

.code-question-define-readiness-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.code-question-define-revision,
.code-question-define-muted,
.code-question-define-input-meta,
.code-question-fact-request-meta {
  color: var(--muted, #555);
  font-size: 0.92em;
}

.code-question-define-blockers,
.code-question-define-notes,
.code-question-define-input-list,
.code-question-define-fact-request-list {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.code-question-define-blockers li {
  color: #8b1e1e;
  font-weight: 600;
}

.code-question-define-stale {
  margin: 8px 0 0;
  font-weight: 600;
  color: #7a4b00;
}

.code-question-define-form {
  display: grid;
  gap: 12px;
}

.code-question-define-field {
  display: grid;
  gap: 4px;
}

.code-question-define-field label {
  font-weight: 600;
}

.code-question-define-field input,
.code-question-define-field textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  border-radius: 6px;
  font: inherit;
  resize: vertical;
}

.code-question-define-field input:disabled,
.code-question-define-field textarea:disabled {
  opacity: 0.75;
  background: color-mix(in srgb, var(--surface, #fff) 80%, #ddd);
}

.code-question-define-inputs {
  border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
  border-radius: 8px;
  padding: 10px 12px;
}

.code-question-define-inputs h3,
.code-question-define-fact-requests h3,
.code-question-define-offline h3 {
  margin: 0 0 8px;
  font-size: 1em;
}

.code-question-define-inputs.is-confirmed-fact {
  border-left: 4px solid #1f6b3a;
}

.code-question-define-inputs.is-assumption {
  border-left: 4px solid #8a6d1d;
}

.code-question-define-inputs.is-unknown {
  border-left: 4px solid #8b3a1e;
}

.code-question-define-input-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.code-question-define-input {
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  border-radius: 8px;
  padding: 8px 10px;
}

.code-question-define-input.has-change {
  box-shadow: inset 3px 0 0 #2f6fed;
}

.code-question-define-input-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin-bottom: 4px;
}

.code-question-define-kind-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.85em;
  font-weight: 700;
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.code-question-define-input.is-confirmed-fact .code-question-define-kind-badge {
  color: #1f6b3a;
}

.code-question-define-input.is-assumption .code-question-define-kind-badge {
  color: #8a6d1d;
}

.code-question-define-input.is-unknown .code-question-define-kind-badge {
  color: #8b3a1e;
}

.code-question-define-change {
  font-size: 0.85em;
  font-weight: 700;
  color: #2f6fed;
}

.code-question-define-statement {
  margin: 0 0 4px;
  font-weight: 600;
}

.code-question-define-input-actions,
.code-question-define-offline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.code-question-define-add-input,
.code-question-define-secondary,
.code-question-define-input-actions button,
.code-question-fact-request button {
  min-height: 36px;
  min-width: 44px;
  padding: 6px 12px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  border-radius: 6px;
  background: var(--surface, #fff);
  cursor: pointer;
  font: inherit;
}

.code-question-define-history {
  margin-top: 6px;
  font-size: 0.92em;
}

.code-question-define-empty-item {
  color: var(--muted, #555);
}

.code-question-fact-request {
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  list-style: none;
}

.code-question-define-fact-request-list {
  list-style: none;
  padding: 0;
}

/* Phase 4 — Evidence */
.code-question-evidence-banner {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 6px;
  background: color-mix(in srgb, #2f6fed 12%, transparent);
}

.code-question-evidence-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.code-question-candidate-list,
.code-question-evidence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.code-question-candidate-item,
.code-question-evidence-item {
  border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
  border-radius: 8px;
  padding: 4px;
}

.code-question-candidate-item.is-selected,
.code-question-evidence-item.is-approved {
  border-color: color-mix(in srgb, var(--project-color, #6678d4) 50%, transparent);
  background: color-mix(in srgb, var(--project-color, #6678d4) 8%, transparent);
}

.code-question-candidate-open {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.code-question-candidate-label {
  font-weight: 600;
}

.code-question-candidate-meta,
.code-question-candidate-badge {
  font-size: 0.9em;
  color: var(--muted, #555);
}

.code-question-candidate-badge {
  display: inline-block;
  font-weight: 700;
  color: #2f6fed;
}

.code-question-evidence-provenance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 12px;
  margin: 8px 0;
}

.code-question-evidence-provenance-grid dt {
  font-weight: 600;
  font-size: 0.85em;
  color: var(--muted, #555);
}

.code-question-evidence-provenance-grid dd {
  margin: 0;
}

.code-question-evidence-quote {
  margin: 8px 0;
  padding: 10px 12px;
  border-left: 4px solid var(--project-color, #6678d4);
  background: color-mix(in srgb, var(--project-color, #6678d4) 6%, transparent);
}

.code-question-evidence-context,
.code-question-evidence-structured {
  white-space: pre-wrap;
  font-size: 0.92em;
}

.code-question-evidence-actions,
.code-question-evidence-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.code-question-evidence-item-actions button,
.code-question-evidence-item > button {
  min-height: 36px;
  min-width: 44px;
  padding: 6px 12px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  border-radius: 6px;
  background: var(--surface, #fff);
  cursor: pointer;
  font: inherit;
}

.code-question-evidence-warnings {
  margin: 6px 0 0;
  padding-left: 1.1rem;
  color: #7a4b00;
  font-weight: 600;
}

.code-question-evidence-item.is-proposed {
  border-left: 4px solid #8a6d1d;
}

.code-question-evidence-item.is-verification-blocked {
  border-left: 4px solid #8b1e1e;
}

.code-question-evidence-item.is-unassigned {
  border-left: 4px solid #666;
  opacity: 0.95;
}

.code-question-evidence-tray-head,
.code-question-evidence-proposals,
.code-question-evidence-approved,
.code-question-evidence-unassigned,
.code-question-evidence-summary {
  margin-bottom: 14px;
}

.code-question-evidence-tray-head h3,
.code-question-evidence-proposals h4,
.code-question-evidence-approved h4,
.code-question-evidence-unassigned h4,
.code-question-evidence-summary h4,
.code-question-evidence-passage h3,
.code-question-evidence-provenance h3 {
  margin: 0 0 6px;
  font-size: 1em;
}

/* Phase 5 — bounded analysis and separately authored conclusion */
.code-question-analysis-approved,
.code-question-bounded-analysis,
.code-question-professional-conclusion {
  display: grid;
  gap: 16px;
  padding: 14px;
}

.code-question-analysis-binding,
.code-question-analysis-intro,
.code-question-analysis-result,
.code-question-conclusion-boundary,
.code-question-conclusion-history {
  padding: 14px;
  background: color-mix(in srgb, var(--project-color, #6678d4) 6%, var(--surface, #fff));
}

.code-question-analysis-result.is-stale {
  box-shadow: inset 4px 0 0 #9a5b00;
  background: color-mix(in srgb, #d98b16 8%, var(--surface, #fff));
}

.code-question-analysis-hashes {
  display: grid;
  gap: 8px;
  overflow-wrap: anywhere;
}

.code-question-analysis-hashes div {
  display: grid;
  grid-template-columns: minmax(80px, 0.35fr) 1fr;
  gap: 10px;
}

.code-question-analysis-hashes dt {
  font-weight: 700;
}

.code-question-analysis-hashes dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
}

.code-question-analysis-evidence-list,
.code-question-analysis-result ul,
.code-question-analysis-result ol,
.code-question-conclusion-history ol {
  margin: 8px 0 0;
  padding-left: 1.3rem;
}

.code-question-analysis-evidence-list > li,
.code-question-conclusion-history li {
  margin-bottom: 12px;
}

.code-question-analysis-run,
.code-question-analysis-actions button,
.code-question-conclusion-publish {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--project-color, #5268c8);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.code-question-analysis-run:disabled,
.code-question-analysis-actions button:disabled,
.code-question-conclusion-publish:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.code-question-analysis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.code-question-analysis-structured,
.code-question-analysis-citations {
  margin-top: 14px;
}

.code-question-analysis-structured h4,
.code-question-analysis-citations h4,
.code-question-analysis-result h3,
.code-question-analysis-result h4,
.code-question-conclusion-history h3 {
  margin: 0 0 6px;
}

.code-question-conclusion-form {
  display: grid;
  gap: 8px;
}

.code-question-conclusion-form > label,
.code-question-conclusion-form legend {
  font-weight: 700;
}

.code-question-conclusion-form textarea {
  width: 100%;
  resize: vertical;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-raised, #f4f5f7);
  color: inherit;
  font: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 16%, transparent);
}

.code-question-conclusion-form fieldset {
  display: grid;
  gap: 8px;
  margin: 6px 0;
  padding: 12px;
  border: 0;
  background: color-mix(in srgb, var(--project-color, #6678d4) 5%, transparent);
}

.code-question-conclusion-citation-choice {
  min-height: 32px;
}

/* Phase 6 — auditable Review Requests and passive History. */
.code-question-review-workspace,
.code-question-review-history { display: grid; gap: 1rem; }
.code-question-review-boundary,
.code-question-review-history-boundary,
.code-question-review-approval,
.code-question-review-composer,
.code-question-review-request,
.code-question-review-server-links {
  padding: 1rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--project-color, #315c52) 8%, var(--surface-raised));
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--project-color, #315c52) 72%, transparent);
}
.code-question-review-approval,
.code-question-review-composer,
.code-question-review-request-actions,
.code-question-review-comment-form,
.code-question-review-resolution,
.code-question-review-server-links { display: grid; gap: 0.7rem; }
.code-question-review-approval textarea,
.code-question-review-composer input,
.code-question-review-composer textarea,
.code-question-review-composer select,
.code-question-review-comment-form input,
.code-question-review-resolution input { width: 100%; box-sizing: border-box; }
.code-question-review-blocking-choice { display: flex; align-items: center; gap: 0.45rem; font-weight: 650; }
.code-question-review-filters,
.code-question-review-request-head,
.code-question-review-request-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; }
.code-question-review-filters button[aria-pressed="true"] { background: var(--project-color, #315c52); color: white; }
.code-question-review-list,
.code-question-review-comments,
.code-question-review-history-list { display: grid; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.code-question-review-request-head { justify-content: space-between; }
.code-question-review-request.is-waiting { background: color-mix(in srgb, #b97a19 10%, var(--surface-raised)); }
.code-question-review-request.is-resolved,
.code-question-review-request.is-dismissed {
  opacity: 0.82;
  box-shadow: inset 4px 0 0 color-mix(in srgb, #64748b 65%, transparent);
}
.code-question-review-resolution,
.code-question-review-comment-form { grid-template-columns: minmax(12rem, 1fr) auto; flex: 1 1 100%; }
.code-question-review-comments li,
.code-question-review-history-list li {
  padding: 0.75rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--project-color, #315c52));
}
.code-question-review-history-list li p { margin: 0.3rem 0 0; color: var(--text-muted); }

/* Code Question Phase 7 — constrained Code Memo and immutable issued versions. */
.code-memo-workspace,
.code-memo-readiness,
.code-memo-versions { display: grid; gap: 1rem; align-content: start; }
.code-memo-boundary,
.code-memo-preview,
.code-memo-recovery {
  padding: 0.9rem 1rem;
  background: color-mix(in srgb, var(--project-color, #315c52) 7%, var(--surface-raised));
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--project-color, #315c52) 74%, transparent);
}
.code-memo-boundary p,
.code-memo-preview p,
.code-memo-recovery p { margin: 0.35rem 0 0; }
.code-memo-prepare-form,
.code-memo-approval-form { display: grid; gap: 0.7rem; }
.code-memo-prepare-form input,
.code-memo-prepare-form textarea,
.code-memo-approval-form textarea { width: 100%; box-sizing: border-box; }
.code-memo-analysis-choice { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.9rem; }
.code-memo-analysis-choice input { width: auto; margin-top: 0.2rem; }
.code-memo-preview { background: var(--surface-raised); }
.code-memo-preview header,
.code-memo-preview section { padding: 0.65rem 0; }
.code-memo-preview section + section { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 10%, transparent); }
.code-memo-preview h3,
.code-memo-preview h4 { margin: 0; }
.code-memo-readiness-list,
.code-memo-version-list { display: grid; gap: 0.7rem; margin: 0; padding: 0; list-style: none; }
.code-memo-readiness-list li,
.code-memo-version-list li {
  padding: 0.8rem 0.9rem;
  background: var(--surface-raised);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--text) 24%, transparent);
}
.code-memo-readiness-list li.is-ready { box-shadow: inset 3px 0 0 color-mix(in srgb, #2d7d46 72%, transparent); }
.code-memo-readiness-list li.is-blocked { box-shadow: inset 3px 0 0 color-mix(in srgb, #b24c38 76%, transparent); }
.code-memo-readiness-list p,
.code-memo-version-list p { margin: 0.3rem 0 0; color: var(--text-muted); }
.code-memo-recovery {
  background: color-mix(in srgb, #b24c38 8%, var(--surface-raised));
  box-shadow: inset 4px 0 0 color-mix(in srgb, #b24c38 76%, transparent);
}
.code-memo-version-list li.is-superseded { opacity: 0.82; box-shadow: inset 3px 0 0 color-mix(in srgb, var(--text) 38%, transparent); }
.code-memo-downloads { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }

/* Code Question Phase 8 — explicit legacy promotion and supporting links. */
.code-question-legacy {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.code-question-legacy-boundary,
.code-question-legacy-migration {
  padding: 0.95rem 1rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--project-color, #315c52) 7%, var(--surface-raised));
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--project-color, #315c52) 72%, transparent);
}

.code-question-legacy-boundary p,
.code-question-legacy-migration p { margin: 0.35rem 0 0; }

.code-question-legacy-counts,
.code-question-legacy-actions,
.code-question-legacy-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.code-question-legacy-count,
.code-question-legacy-actions button,
.code-question-legacy-path button {
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  border: 0;
  border-radius: 9px;
  background: color-mix(in srgb, var(--project-color, #315c52) 12%, var(--surface-raised));
  color: inherit;
  font: inherit;
  font-weight: 680;
  cursor: pointer;
}

.code-question-legacy-count.is-active,
.code-question-legacy-actions button:first-child:not(:disabled) {
  background: var(--project-color, #315c52);
  color: #fff;
}

.code-question-legacy-count:disabled,
.code-question-legacy-actions button:disabled { opacity: 0.55; cursor: not-allowed; }

.code-question-legacy-filters input,
.code-question-legacy-filters select {
  min-height: 44px;
  box-sizing: border-box;
  border: 0;
  border-radius: 9px;
  padding: 0.6rem 0.75rem;
  background: var(--surface-raised);
  color: inherit;
  font: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 16%, transparent);
}

.code-question-legacy-filters input { flex: 1 1 13rem; min-width: 0; }
.code-question-legacy-filters select { flex: 0 1 13rem; }

.code-question-legacy-list { display: grid; gap: 0.8rem; }

.code-question-legacy-item {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: var(--surface-raised);
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--text) 24%, transparent);
}

.code-question-legacy-item.is-linked {
  box-shadow: inset 4px 0 0 color-mix(in srgb, #2d7d46 74%, transparent);
}

.code-question-legacy-item.is-recovery {
  background: color-mix(in srgb, #b97a19 7%, var(--surface-raised));
  box-shadow: inset 4px 0 0 color-mix(in srgb, #b97a19 78%, transparent);
}

.code-question-legacy-item-heading {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.65rem;
  align-items: center;
}

.code-question-legacy-kind,
.code-question-legacy-state {
  width: fit-content;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--project-color, #315c52) 11%, transparent);
  font-size: 0.76rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.code-question-legacy-state { justify-self: end; }
.code-question-legacy-item h3,
.code-question-legacy-item p,
.code-question-legacy-item small { grid-column: 1 / -1; margin: 0; }
.code-question-legacy-item small,
.code-question-legacy-guidance { color: var(--text-muted); }
.code-question-legacy-guidance { font-size: 0.88rem; }
.code-question-legacy-error { color: #8f341f; font-weight: 680; }
.code-question-legacy-empty { padding: 1rem; color: var(--text-muted); }

.code-question-legacy-migration dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.code-question-legacy-migration dl div {
  padding: 0.6rem;
  border-radius: 8px;
  background: var(--surface-raised);
}

.code-question-legacy-migration dt { font-size: 0.78rem; color: var(--text-muted); }
.code-question-legacy-migration dd { margin: 0.15rem 0 0; font-weight: 760; }

@media (max-width: 767px) {
  .code-question-legacy-counts,
  .code-question-legacy-actions,
  .code-question-legacy-filters { align-items: stretch; }
  .code-question-legacy-count,
  .code-question-legacy-actions button,
  .code-question-legacy-filters input,
  .code-question-legacy-filters select { flex: 1 1 100%; }
  .code-question-legacy-migration dl { grid-template-columns: 1fr; }
}
.mobile-web-message {
  display: none;
}

@media (max-width: 767px) and (pointer: coarse) {
  body > .workspace-shell,
  body > .web-warning-backdrop,
  body > .web-prompt-backdrop {
    display: none !important;
  }

  .mobile-web-message {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 32px;
    background: #000;
    color: #f5f5f7;
    text-align: center;
  }

  .mobile-web-message > div {
    width: min(100%, 28rem);
  }

  .mobile-web-message h1 {
    margin: 22px 0 10px;
    font: 650 1.65rem/1.18 Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  }

  .mobile-web-message p {
    margin: 0;
    color: #a8a8af;
    font: 450 1rem/1.5 Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  }
}
