:root {
  color-scheme: light;
  --bg: oklch(0.972 0.006 250);
  --surface: oklch(0.997 0.002 250);
  --surface-low: oklch(0.948 0.008 250);
  --surface-mid: oklch(0.908 0.01 250);
  --surface-high: oklch(0.988 0.004 250);
  --text: oklch(0.18 0.02 255);
  --muted: oklch(0.38 0.02 255);
  --faint: oklch(0.54 0.018 255);
  --line: oklch(0.84 0.014 250);
  --line-strong: oklch(0.64 0.02 250);
  --navy: oklch(0.19 0.055 258);
  --green: oklch(0.64 0.17 158);
  --green-dark: oklch(0.39 0.13 158);
  --green-soft: oklch(0.9 0.1 158);
  --blue-soft: oklch(0.925 0.034 258);
  --danger: oklch(0.56 0.14 28);
  --radius-sm: 4px;
  --radius: 8px;
  --suite-bar-h: 42px;
  --product-masthead-h: 62px;
  --sticky-content-top: 134px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button,
.open-original {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: oklch(0.985 0.004 250);
  color: var(--text);
  padding: 0 13px;
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

button:hover,
.open-original:hover {
  border-color: var(--line-strong);
  background: var(--surface-low);
}

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

.primary-button {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: oklch(0.985 0.006 158);
  font-weight: 700;
}

.primary-button:hover {
  background: oklch(0.38 0.13 158);
  border-color: oklch(0.38 0.13 158);
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 9px 11px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green-dark);
  box-shadow: 0 0 0 2px oklch(0.75 0.14 158 / 0.2);
}

textarea {
  resize: vertical;
}

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

h1,
h2,
.stat strong,
.post-byline strong {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.suite-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  height: var(--suite-bar-h);
  min-height: var(--suite-bar-h);
  padding: 0 32px;
  border-bottom: 1px solid oklch(0.3 0.025 255);
  background: var(--navy);
  color: oklch(0.96 0.008 250);
}

.suite-brand {
  color: var(--green-soft);
  font: 800 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.suite-nav {
  display: flex;
  align-items: stretch;
  min-width: 0;
  height: var(--suite-bar-h);
  margin-left: 28px;
  overflow: visible;
  scrollbar-width: thin;
}

.suite-nav a {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 13px;
  border-bottom: 2px solid transparent;
  color: oklch(0.78 0.015 250);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.suite-nav a:hover {
  color: white;
}

.suite-nav a[aria-current="page"] {
  border-bottom-color: var(--green);
  color: white;
}
.suite-menu { position: relative; display: flex; flex: 0 0 auto; }
.suite-menu > button {
  display: flex; align-items: center; height: var(--suite-bar-h); min-height: 0;
  padding: 0 13px; border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; background: transparent; color: oklch(0.78 0.015 250);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.suite-menu > button::after { content: "▾"; margin-left: 6px; color: oklch(0.64 0.02 250); font-size: 9px; }
.suite-menu:hover > button, .suite-menu:focus-within > button { color: white; }
.suite-submenu {
  position: absolute; top: 100%; left: 0; z-index: 60; display: none;
  min-width: 190px; padding: 6px 0; border: 1px solid oklch(0.32 0.025 255);
  background: var(--navy); box-shadow: 0 12px 30px rgb(0 0 0 / .35);
}
.suite-menu.is-open .suite-submenu { display: block; }
.suite-submenu a, .suite-submenu [aria-disabled="true"] {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 34px; height: auto; padding: 8px 13px; border-bottom: 0;
}
.suite-submenu [aria-disabled="true"] { color: oklch(0.58 0.015 250); }
.suite-submenu small { font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .05em; text-transform: uppercase; }

.suite-account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-left: 16px;
  color: oklch(0.8 0.012 250);
  font-size: 11px;
}

#suite-user {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#suite-sign-out {
  min-height: 27px;
  padding: 0 9px;
  border-color: oklch(0.52 0.02 255);
  background: transparent;
  color: oklch(0.88 0.01 250);
  font-size: 11px;
}

#suite-sign-out:hover {
  border-color: oklch(0.72 0.02 255);
  background: oklch(0.25 0.045 258);
}

.suite-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: oklch(0.12 0.025 255 / 0.72);
  backdrop-filter: blur(8px);
}

.suite-auth-overlay[hidden],
.suite-auth-form[hidden],
#suite-sign-out[hidden] {
  display: none;
}

.suite-auth-panel {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 80px oklch(0.08 0.025 255 / 0.32);
}

.suite-auth-heading {
  display: grid;
  gap: 7px;
  margin-bottom: 22px;
}

.suite-auth-kicker {
  color: var(--green-dark);
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.suite-auth-heading h2 {
  font-size: 24px;
  line-height: 1.2;
}

.suite-auth-heading p,
.suite-auth-form p {
  color: var(--muted);
}

.suite-auth-form {
  display: grid;
  gap: 15px;
}

.suite-auth-form label {
  display: grid;
  gap: 7px;
}

.suite-auth-form label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.suite-auth-form .primary-button {
  min-height: 42px;
  margin-top: 4px;
}

.suite-auth-error {
  min-height: 20px;
  margin-top: 12px;
  color: var(--danger);
  font-size: 12px;
}

body.auth-required {
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: var(--suite-bar-h);
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(170px, 205px) minmax(230px, 1fr) minmax(180px, 250px) auto;
  gap: 18px;
  align-items: center;
  width: 100%;
  height: var(--product-masthead-h);
  min-height: var(--product-masthead-h);
  padding: 10px 32px;
  background: oklch(0.993 0.003 250 / 0.98);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-block > div,
.top-nav,
.archive-switcher,
.top-actions {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--navy);
  color: var(--green-soft);
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

h1 {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.05;
}

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

.topbar p {
  overflow: hidden;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.top-nav a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.top-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom: 2px solid var(--text);
  padding-bottom: 7px;
}

.archive-switcher,
.pdf-option,
.pdf-limit {
  display: grid;
  gap: 3px;
}

.archive-switcher span,
.pdf-option span,
.pdf-limit span,
.field span {
  color: var(--faint);
  font: 700 10px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.archive-switcher select {
  min-width: 0;
  border-color: transparent;
  background: var(--surface-low);
}

.archive-switcher > span {
  display: none;
}

.top-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: end;
}

#export-jsonl,
#refresh {
  display: none;
}

.top-actions .pdf-option span,
.top-actions .pdf-limit span {
  display: none;
}

.pdf-option {
  width: 152px;
}

.pdf-limit {
  width: 78px;
}

.action-status {
  flex: 0 1 180px;
  min-width: 0;
  max-width: 180px;
  min-height: 16px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-status:empty {
  display: none;
}

.layout {
  display: grid;
  grid-template-columns: 224px minmax(640px, 1fr) 280px;
  gap: 28px;
  max-width: 1520px;
  margin: 0 auto;
  padding: 28px 32px 56px;
}

.query-bar {
  position: sticky;
  top: var(--sticky-content-top);
  align-self: start;
  min-height: calc(100vh - 112px);
  padding: 0;
}

.archive-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.research-rail {
  position: sticky;
  top: var(--sticky-content-top);
  align-self: start;
  display: grid;
  gap: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.panel-head h2,
.results-head h2 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}

.query-bar .panel-head {
  display: block;
}

.filters {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.search-field {
  grid-column: auto;
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.advanced-filters {
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 12px;
}

.advanced-filters summary {
  min-height: 30px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.advanced-filter-grid {
  display: grid;
  gap: 10px;
  padding-top: 8px;
}

.toggle-group {
  display: grid;
  gap: 7px;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 26px;
  color: var(--muted);
  font-size: 12px;
}

.check input {
  width: auto;
  accent-color: var(--green-dark);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.filter-chip {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-low);
  color: var(--muted);
  padding: 4px 10px;
  font-size: 12px;
}

.filter-chip span {
  color: var(--text);
  padding-left: 4px;
}

.ask-workbench {
  margin-bottom: 24px;
}

.ask-main {
  display: grid;
  gap: 14px;
  position: relative;
  padding: 4px 0 0;
}

.ask-intro {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}

.ask-intro h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ask-intro p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  max-width: 62ch;
}

#rag-status {
  color: var(--text);
  font: 600 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  align-self: center;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface-low);
}

.ai-status {
  display: none;
}

.ask-field span {
  display: none;
}

.ask-field {
  position: relative;
}

.ask-field textarea {
  height: 62px;
  min-height: 62px;
  border-color: var(--line-strong);
  background: var(--surface);
  padding: 18px 18px 13px;
  font-size: 16px;
  box-shadow: 0 2px 0 oklch(0.2 0.01 250 / 0.035);
}

.ask-actions {
  display: flex;
  gap: 8px;
}

.ask-actions button {
  min-height: 38px;
}

#rebuild-rag {
  display: none;
}

.question-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.question-suggestions button {
  min-height: 30px;
  border-radius: 999px;
  border-color: var(--line);
  background: oklch(0.958 0.008 250);
  color: var(--muted);
  padding: 0 11px;
  font-size: 12px;
}

.overview {
  order: 4;
  margin-bottom: 20px;
}

.stats-grid {
  display: flex;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat {
  flex: 0 0 142px;
  min-height: 66px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: 0;
}

.stat span {
  display: block;
  margin-bottom: 4px;
  color: var(--faint);
  font: 600 10px/1.25 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: break-word;
}

.results-head {
  order: 2;
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.content-grid {
  order: 3;
  min-width: 0;
}

.ask-workbench {
  order: 1;
}

.posts {
  display: grid;
  gap: 12px;
}

.post {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.post:hover {
  border-color: var(--line-strong);
}

.post-meta {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 18px 18px 10px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: oklch(0.91 0.018 250);
  color: var(--muted);
  font-weight: 700;
}

.post-byline {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.post-byline strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
}

.post-byline span {
  color: var(--muted);
  font: 600 12px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.reviewed-badge {
  border: 1px solid oklch(0.75 0.04 258);
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  color: var(--navy);
  padding: 3px 8px;
  font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.post-text {
  max-width: 76ch;
  padding: 8px 18px 16px 70px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.post-text a,
.reference-text a,
.source-actions a,
.post-meta a {
  color: var(--green-dark);
}

.reference {
  display: grid;
  grid-template-columns: 2px minmax(0, 1fr);
  gap: 14px;
  margin: 0 18px 16px 70px;
}

.reference-rule {
  width: 2px;
  min-height: 100%;
  background: var(--line);
}

.reference-card {
  padding: 12px 14px;
  background: oklch(0.96 0.006 250);
}

.reference-label {
  margin-bottom: 6px;
  color: var(--muted);
  font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.reference-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 9px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.reference-meta strong {
  color: var(--text);
}

.reference-meta a {
  color: var(--green-dark);
  text-decoration: none;
}

.reference-text {
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  padding: 0 16px 16px 68px;
}

.media-item {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-low);
}

.media-item img,
.media-item video {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: oklch(0.18 0.012 240);
}

.media-caption {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.media-caption small {
  color: var(--faint);
  font-size: 11px;
}

.post-footer {
  display: grid;
  gap: 10px;
  margin: 0 18px 0 70px;
  padding: 13px 0 16px;
  border-top: 1px solid var(--line);
}

.metrics-block {
  display: grid;
  gap: 6px;
}

.metrics-caption {
  color: var(--faint);
  font: 600 10px/1.25 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--muted);
  font-size: 12px;
}

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

.post-actions button,
.post-actions .open-original,
.small-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.post-actions .open-original {
  display: inline-flex;
  align-items: center;
  color: var(--green-dark);
  font-weight: 700;
}

.provenance {
  border-top: 1px solid var(--line);
  margin: 0 16px 0 68px;
  padding: 0 0 12px;
  color: var(--muted);
}

.provenance summary {
  cursor: pointer;
  padding: 10px 0;
  font-size: 12px;
}

.provenance h3 {
  margin: 10px 0 5px;
  color: var(--faint);
  font: 700 10px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.provenance ul {
  margin: 0;
  padding-left: 18px;
}

.provenance li {
  margin: 4px 0;
  overflow-wrap: anywhere;
}

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

.provenance-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-low);
  padding: 7px;
}

.provenance-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--faint);
  font: 700 9px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

code {
  font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.answer,
.saved-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

.answer {
  min-height: 128px;
}

.empty-answer,
.answer-loading {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.empty-answer strong,
.answer-loading strong,
.answer-header strong,
.source-topline strong {
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.answer-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.answer-header span,
.source-topline span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 12px;
}

.answer-text {
  color: var(--text);
  line-height: 1.58;
}

.answer-text p,
.answer-text ul {
  margin: 0 0 10px;
}

.answer-text ul {
  padding-left: 20px;
}

.source-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.source-item {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-low);
  font-size: 12px;
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.saved-panel .panel-head {
  margin-bottom: 12px;
}

.small-head {
  align-items: center;
}

.saved-list {
  display: grid;
  gap: 8px;
}

.saved-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-low);
  color: var(--muted);
  font-size: 12px;
}

.saved-item div,
.saved-note {
  grid-column: 1 / -1;
}

.saved-note {
  display: grid;
  gap: 5px;
}

.saved-note span {
  color: var(--faint);
  font: 700 9px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.saved-note textarea {
  min-height: 58px;
  font-size: 12px;
}

.empty-state {
  padding: 16px;
  color: var(--muted);
}

.load-more {
  width: 100%;
  margin: 16px 0 0;
  font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 1260px) {
  .topbar {
    grid-template-columns: minmax(170px, 205px) minmax(180px, 1fr) auto;
    gap: 14px;
  }

  .top-nav,
  .pdf-limit,
  .action-status {
    display: none;
  }

  .layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .research-rail {
    grid-column: 2;
    position: static;
  }
}

@media (max-width: 920px) {
  .suite-bar {
    padding: 0 16px;
  }

  .suite-nav {
    margin-left: 16px;
  }

  .suite-nav a,
  .suite-menu > button {
    padding: 0 10px;
  }

  .suite-nav .suite-menu .suite-submenu {
    position: fixed;
    top: 41px;
    right: 10px;
    left: auto;
  }

  #suite-user {
    display: none;
  }

  .suite-account {
    margin-left: 8px;
  }

  .topbar {
    grid-template-columns: minmax(145px, 190px) minmax(0, 1fr) auto;
    gap: 12px;
    padding: 10px 16px;
  }

  .pdf-option {
    display: none;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .query-bar,
  .research-rail {
    position: static;
  }

  .query-bar {
    min-height: 0;
    border-right: 0;
    padding: 0;
  }

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

  .search-field,
  .advanced-filters,
  .filter-actions {
    grid-column: 1 / -1;
  }

  .stats-grid {
    display: flex;
    overflow-x: auto;
  }

  .stat {
    flex: 0 0 150px;
  }

  .post-text,
  .media-grid,
  .reference,
  .post-footer,
  .provenance {
    margin-left: 16px;
    padding-left: 0;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .brand-mark,
  .top-nav,
  #health,
  #export-jsonl,
  #refresh {
    display: none;
  }

  .suite-bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0 10px;
  }

  .suite-brand {
    font-size: 10px;
  }

  .suite-nav {
    margin-left: 8px;
  }

  .suite-nav a,
  .suite-menu > button {
    padding: 0 9px;
    font-size: 11px;
  }

  .suite-account {
    margin-left: 4px;
  }

  #suite-sign-out {
    padding: 0 7px;
  }

  .suite-auth-panel {
    padding: 24px 20px;
  }

  h1 {
    font-size: 18px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
  }

  .archive-switcher {
    overflow: hidden;
  }

  #print-packet {
    min-height: 36px;
    padding: 0 9px;
    font-size: 12px;
  }

  .layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px 12px 32px;
  }

  .overview {
    order: 1;
    display: none;
  }

  .query-bar {
    order: 2;
  }

  .archive-main {
    display: contents;
  }

  .ask-workbench {
    order: 4;
  }

  .results-head,
  .content-grid {
    order: 3;
  }

  .research-rail {
    order: 5;
  }

  .ask-intro {
    display: block;
  }

  .ask-intro h2 {
    font-size: 20px;
  }

  .ask-field textarea {
    height: 70px;
    min-height: 70px;
    padding: 12px;
  }

  .ask-actions {
    position: static;
    margin-top: 8px;
  }

  .post-meta {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .reviewed-badge {
    grid-column: 2;
    justify-self: start;
  }

  .avatar {
    width: 36px;
    height: 36px;
  }

  .post-text,
  .media-grid,
  .reference,
  .post-footer,
  .provenance {
    margin-left: 12px;
    margin-right: 12px;
  }

  .post-text {
    padding-right: 12px;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }

  .provenance-grid {
    grid-template-columns: 1fr;
  }
}

/* CD OPS Lobbying menu contract v2 */
.suite-menu > button {
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.suite-menu > button.active { border-bottom-color: #72d9a5; color: #f7fafc; }
.suite-menu .suite-submenu {
  top: calc(100% - 1px);
  z-index: 80;
  width: 220px;
  min-width: 220px;
  padding: 6px;
  border-color: #344154;
  background: #111827;
}
.suite-menu.is-open .suite-submenu { display: block; }
.suite-menu .suite-submenu a,
.suite-menu .suite-submenu [aria-disabled="true"] {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  color: #dce3ea;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
}
.suite-menu .suite-submenu a:hover,
.suite-menu .suite-submenu a:focus-visible { color: #86efb6; background: #1c2737; outline: none; }
.suite-menu .suite-submenu a[aria-current="page"] { box-shadow: inset 2px 0 0 #72d9a5; color: #f7fafc; }
.suite-menu .suite-submenu [aria-disabled="true"] { color: #8c98a8; cursor: default; }
.suite-menu .suite-submenu small {
  color: inherit;
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
}
