:root {
  --bg: #f6f7f4;
  --ink: #17211d;
  --muted: #64706a;
  --line: #dce2dc;
  --panel: #ffffff;
  --accent: #0b6b57;
  --accent-2: #a83f39;
  --soft: #e8f2ed;
  --gold: #8a6516;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  background: #20352d;
  color: #ffffff;
}

.topbar h1,
.topbar p {
  margin: 0;
}

.product-heading {
  position: relative;
}

.back-to-lab {
  display: inline-block;
  margin-bottom: 5px;
  color: #9fd2be;
  font: 700 10px/1.2 ui-monospace, "SFMono-Regular", monospace;
  text-decoration: none;
}

.product-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}

.product-nav a {
  color: #dce9e2;
  font-size: 12px;
  text-decoration: none;
}

.product-nav a:hover,
.back-to-lab:hover {
  color: #ffffff;
}

.topbar h1 {
  font-size: 26px;
  font-weight: 760;
}

.topbar p {
  margin-top: 6px;
  color: #dce9e2;
}

.status {
  min-width: 140px;
  text-align: right;
  color: #dce9e2;
  font-size: 14px;
}

.topbar-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.auth-panel {
  width: min(560px, 52vw);
}

.auth-form,
.auth-user {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(110px, 0.7fr) auto auto;
  gap: 8px;
  align-items: center;
}

.auth-form input,
.auth-button {
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.3);
  border-radius: 6px;
}

.auth-form input {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.auth-form input::placeholder {
  color: #c8d8d0;
}

.auth-button {
  width: auto;
  padding: 0 12px;
  background: #ffffff;
  color: #20352d;
  border-color: #ffffff;
}

.auth-button.secondary {
  background: transparent;
  color: #ffffff;
}

.auth-message {
  grid-column: 1 / -1;
  color: #ffd9d6;
  font-size: 12px;
  text-align: right;
}

.auth-user {
  grid-template-columns: auto auto auto;
  justify-content: end;
  color: #ffffff;
  font-size: 13px;
}

.auth-user strong {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #dce9e2;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(420px, 1fr) minmax(340px, 0.72fr);
  min-height: calc(100vh - 140px);
}

.site-footer {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.site-footer a {
  color: #3f4944;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.filters,
.content,
.detail {
  border-right: 1px solid var(--line);
}

.filters {
  padding: 20px;
  background: #fbfcf9;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.subfilter {
  margin: -2px 0 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.subfilter legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.checkbox-grid input {
  width: 16px;
  min-height: 16px;
}

.checkline {
  display: flex;
  grid-template-columns: unset;
  align-items: center;
  gap: 9px;
  margin-top: -4px;
}

.checkline input {
  width: 17px;
  min-height: 17px;
}

input,
select,
button {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

input,
select {
  padding: 8px 10px;
}

button {
  cursor: pointer;
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 700;
}

button:hover {
  filter: brightness(0.96);
}

.summary {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.summary h2,
.content h2 {
  margin: 0 0 14px;
  font-size: 17px;
}

.statline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #edf0ed;
  color: var(--muted);
  font-size: 14px;
}

.statline strong {
  color: var(--ink);
}

.content {
  padding: 20px 0;
  overflow: auto;
}

.content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

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

.tab {
  width: auto;
  min-height: 34px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--muted);
  border-color: var(--line);
}

a.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-decoration: none;
}

a.tab:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.tab.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

#refresh {
  width: 38px;
  min-height: 34px;
  border-radius: 7px;
  font-size: 18px;
}

.results {
  display: grid;
}

.paper-row {
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.paper-row:hover,
.paper-row.active {
  background: #ffffff;
}

.paper-row.integrity-retracted {
  border-left: 4px solid #b42318;
}

.paper-row.integrity-expression_of_concern {
  border-left: 4px solid #b7791f;
}

.paper-title {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 760;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--soft);
  color: #255044;
  font-size: 12px;
  font-weight: 700;
}

.badge.preprint {
  background: #fff0df;
  color: var(--gold);
}

.badge.source {
  background: #eef0f5;
  color: #35415b;
}

.badge.score {
  background: #e9eff8;
  color: #2f4d7a;
}

.badge.core {
  background: #e9f5ef;
  color: #166044;
}

.badge.evidence {
  background: #fff4dc;
  color: #826019;
}

.badge.favorite {
  background: #f7e8e5;
  color: var(--accent-2);
}

.badge.retracted {
  background: #fee4e2;
  color: #9b1c1c;
}

.badge.concern {
  background: #fff3cd;
  color: #7a4d00;
}

.abstract-preview {
  margin: 10px 0 0;
  color: #3f4944;
  font-size: 14px;
  line-height: 1.5;
}

.detail {
  padding: 22px;
  overflow: auto;
  background: var(--panel);
}

.empty-detail {
  color: var(--muted);
}

.detail h2 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.28;
}

.original-title {
  margin: -4px 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.detail-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 14px;
}

.integrity-alert {
  margin: 0 0 20px;
  padding: 16px;
  border: 2px solid;
  border-radius: 7px;
}

.integrity-alert.retracted {
  border-color: #b42318;
  background: #fff1f0;
  color: #7a1510;
}

.integrity-alert.concern {
  border-color: #b7791f;
  background: #fff8e6;
  color: #6f4700;
}

.integrity-alert > strong {
  font-size: 18px;
}

.integrity-alert p {
  line-height: 1.55;
}

.integrity-alert a {
  color: inherit;
  font-weight: 750;
}

.integrity-meta {
  font-size: 13px;
}

.integrity-notice {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid currentColor;
}

.integrity-notice summary {
  cursor: pointer;
  font-weight: 750;
}

.integrity-evidence-note {
  margin: 0 0 10px;
  padding: 10px;
  border-left: 3px solid #b42318;
  background: #fff1f0;
  color: #7a1510;
  font-weight: 700;
}

.audit-time strong {
  max-width: 120px;
  overflow-wrap: anywhere;
  text-align: right;
}

.favorite-button {
  width: auto;
  min-width: 96px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--accent-2);
  border-color: #d9b5b0;
}

.favorite-button.active {
  background: #f7e8e5;
  border-color: var(--accent-2);
}

.favorite-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.detail .source-link {
  display: inline-flex;
  margin: 16px 0;
  color: var(--accent);
  font-weight: 750;
  text-decoration: none;
}

.detail .source-link:hover {
  text-decoration: underline;
}

.detail-block {
  margin-top: 18px;
}

.detail-block h3 {
  margin: 0 0 7px;
  font-size: 14px;
  color: var(--muted);
}

.detail-block p {
  margin: 0;
  line-height: 1.58;
}

.detail-block.highlight {
  padding: 12px;
  border-left: 3px solid var(--accent);
  background: var(--soft);
}

.evidence-list {
  display: grid;
  gap: 10px;
}

.evidence-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.evidence-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.evidence-head strong {
  color: var(--ink);
}

.evidence-head span,
.score-grid {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 18px;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
}

.muted-note p {
  color: var(--muted);
  font-size: 13px;
}

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

.mini-paper {
  width: 100%;
  display: grid;
  gap: 4px;
  min-height: auto;
  padding: 10px;
  text-align: left;
  background: #f7faf7;
  color: var(--ink);
  border-color: var(--line);
  font-weight: 650;
}

.mini-paper small {
  color: var(--muted);
  font-weight: 500;
}

.mini-paper-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ingest,
.trends,
.system {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 20px 20px;
}

.ingest-panel,
.ingest-result,
.trend-panel,
.system-panel {
  background: #ffffff;
  border-top: 1px solid var(--line);
  padding: 16px;
}

.ingest-panel.wide,
.trend-panel.wide,
.system-panel.wide {
  grid-column: 1 / -1;
}

.ingest-panel h2,
.ingest-result h3,
.trend-panel h2,
.system-panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.custom-ingest-form {
  display: grid;
  gap: 2px;
}

textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.form-grid,
.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.button-row button:first-child {
  background: #ffffff;
  color: var(--accent);
}

.ingest-message {
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
}

.ingest-result {
  grid-column: 1 / -1;
}

.panel-head,
.run-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2 {
  margin-bottom: 0;
}

.panel-head button {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--accent);
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.history-actions select {
  width: auto;
  min-width: 96px;
  min-height: 32px;
  padding: 0 8px;
  font-size: 13px;
}

.history-actions button {
  flex: 0 0 auto;
}

.ingest-history {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  max-height: calc(100vh - 205px);
  overflow: auto;
}

.run-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcf9;
}

.run-card h3,
.run-card p {
  margin: 0;
}

.run-card h3 {
  font-size: 14px;
}

.run-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.stage-pill {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.run-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.run-details {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 6px 10px;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.run-details dt {
  color: var(--muted);
  font-weight: 800;
}

.run-details dd {
  margin: 0;
  color: #3f4944;
}

.continue-run {
  margin-top: 12px;
  min-height: 34px;
}

.compact-error {
  padding: 8px 0 0;
  font-size: 12px;
}

.collection-control .panel-head {
  align-items: center;
}

.collection-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin: 16px 0;
}

.collection-options .checkline {
  grid-column: 1 / -1;
  min-height: 42px;
  margin: 0;
}

.collection-jobs {
  display: grid;
  gap: 12px;
}

.collection-job {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcf9;
}

.collection-job h3,
.collection-job p {
  margin: 0;
}

.collection-job p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.collection-progress {
  height: 7px;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 4px;
  background: #e7ece8;
}

.collection-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

.collection-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.collection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.collection-actions button {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
}

.collection-cancel {
  background: #9c3d35;
}

.api-performance {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 2fr);
  gap: 4px 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.api-performance strong {
  color: var(--ink);
  font-weight: 650;
}

.collection-job-detail {
  margin-top: 16px;
}

.collection-job-detail h3 {
  margin: 0;
  font-size: 15px;
}

.source-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.collection-table-wrap {
  margin-top: 10px;
  overflow-x: auto;
}

.collection-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 12px;
}

.collection-table th,
.collection-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.collection-table th {
  color: var(--muted);
  font-weight: 800;
}

.system-panel h3 {
  margin: 0 0 7px;
  font-size: 14px;
  color: var(--muted);
}

.system-panel p {
  margin: 0;
  line-height: 1.55;
  color: #3f4944;
}

.architecture {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 8px;
  align-items: center;
}

.architecture.secondary {
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  margin-top: 10px;
}

.arch-node {
  min-height: 64px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7faf7;
  text-align: center;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.arch-arrow {
  display: none;
}

.system-list {
  margin: 0;
  display: grid;
  gap: 9px;
}

.system-list dt {
  color: var(--ink);
  font-weight: 800;
}

.system-list dd {
  margin: -5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.system-panel pre {
  margin: 0;
  overflow: auto;
  padding: 12px;
  border-radius: 7px;
  background: #17211d;
  color: #edf7f1;
  font-size: 12px;
  line-height: 1.5;
}

.metric-grid,
.perf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-grid div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcf9;
}

.metric-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-grid strong {
  font-size: 22px;
}

.perf-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcf9;
}

.bar {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
  color: var(--muted);
  font-size: 14px;
}

.bar strong {
  display: inline-flex;
  justify-content: flex-end;
  min-width: 28px;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--soft);
  color: var(--accent);
}

.trend-paper {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.trend-paper h3 {
  margin: 0 0 7px;
  font-size: 16px;
}

.trend-paper p {
  margin: 0 0 8px;
  color: #3f4944;
  line-height: 1.48;
}

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

.layout.tutorial-mode .filters,
.layout.tutorial-mode .detail {
  display: none;
}

.layout.tutorial-mode .content {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  border-right: 0;
}

.tutorials {
  padding-top: 14px;
}

.tutorial-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-rows: auto minmax(620px, calc(100vh - 220px));
  min-width: 0;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.tutorial-disclaimer {
  grid-column: 1 / -1;
  padding: 11px 20px;
  border-bottom: 1px solid #ead7b2;
  background: #fff8e9;
  color: #6d531c;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.tutorial-mobile-controls {
  display: none;
}

.tutorial-navigation {
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #f8faf8;
}

.tutorial-nav-section {
  padding: 18px 14px;
  border-bottom: 1px solid var(--line);
}

.tutorial-nav-section h2 {
  margin: 0 6px 12px;
  color: #3f4944;
  font-size: 13px;
  text-transform: uppercase;
}

.tutorial-course-button,
.tutorial-chapter-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin: 0 0 6px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.tutorial-course-button:hover,
.tutorial-chapter-button:hover {
  background: #ffffff;
  border-color: var(--line);
  filter: none;
}

.tutorial-course-button.active,
.tutorial-chapter-button.active {
  border-color: #a9c8ba;
  background: #e8f2ed;
  color: #084f41;
}

.tutorial-course-button span,
.tutorial-chapter-button span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.tutorial-course-button small,
.tutorial-chapter-button small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.tutorial-chapter-list {
  padding-top: 14px;
}

.tutorial-chapter-button {
  grid-template-columns: minmax(0, 1fr);
  min-height: 54px;
}

.tutorial-chapter-button small {
  margin-top: -4px;
}

.tutorial-reader {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  background: #ffffff;
}

.tutorial-reader-head {
  position: relative;
  min-height: 100px;
  padding: 18px 220px 16px 24px;
  border-bottom: 1px solid var(--line);
}

.tutorial-breadcrumb {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
}

.tutorial-reader-head h2 {
  margin: 0;
  max-width: 900px;
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.35;
}

.tutorial-mode-switch {
  position: absolute;
  top: 27px;
  right: 24px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  width: 180px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f2f5f2;
}

.tutorial-mode-switch button {
  min-height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.tutorial-mode-switch button.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(23, 33, 29, 0.12);
}

.tutorial-mode-switch button:disabled {
  cursor: not-allowed;
  color: #a7afa9;
}

.tutorial-frame-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #eef1ee;
}

.tutorial-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 0;
  background: #ffffff;
}

.tutorial-frame-state {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  color: var(--muted);
  background: #f7f9f7;
  font-size: 14px;
}

.tutorial-frame-error {
  gap: 12px;
  text-align: center;
}

.tutorial-frame-error p {
  margin: 0;
  color: var(--accent-2);
}

.tutorial-frame-error button {
  width: auto;
  min-width: 110px;
  padding: 0 14px;
}

.tutorial-page-nav {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 10px 24px;
  border-top: 1px solid var(--line);
}

.tutorial-page-nav > span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.tutorial-page-nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  max-width: 150px;
  padding: 0 14px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--accent);
}

.tutorial-page-nav button:last-child {
  justify-self: end;
}

.tutorial-page-nav button:disabled {
  cursor: default;
  color: #a7afa9;
  background: #f7f8f7;
}

.tutorial-coming-soon,
.tutorial-state {
  display: grid;
  place-content: center;
  min-height: 620px;
  padding: 40px;
  text-align: center;
  background: #ffffff;
}

.tutorial-coming-soon p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.tutorial-coming-soon h2 {
  margin: 0 0 18px;
  font-size: 28px;
}

.tutorial-coming-soon strong {
  color: var(--gold);
  font-size: 14px;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none;
}

.empty,
.error,
.locked {
  padding: 28px 20px;
  color: var(--muted);
}

.error {
  color: var(--accent-2);
}

.locked {
  background: #ffffff;
  border-top: 1px solid var(--line);
  color: #3f4944;
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 250px 1fr;
  }

  .detail {
    grid-column: 1 / -1;
    min-height: 360px;
    border-top: 1px solid var(--line);
  }

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

  .ingest,
  .trends,
  .system,
  .architecture,
  .architecture.secondary,
  .metric-grid,
  .perf-grid,
  .form-grid,
  .button-row,
  .collection-options,
  .collection-metrics,
  .api-performance {
    grid-template-columns: 1fr;
  }

  .tutorial-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .tutorial-reader-head {
    padding-right: 210px;
  }
}

@media (max-width: 760px) {
  .topbar {
    display: block;
    padding: 18px;
  }

  .topbar-actions,
  .status {
    margin-top: 12px;
    text-align: left;
    justify-items: stretch;
  }

  .auth-panel {
    width: 100%;
  }

  .auth-form,
  .auth-user {
    grid-template-columns: 1fr;
  }

  .layout {
    display: block;
    min-height: auto;
  }

  .filters,
  .content,
  .detail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content-head {
    align-items: flex-start;
    gap: 10px;
    padding: 0 14px;
  }

  .layout.tutorial-mode .content {
    border-bottom: 0;
  }

  .tutorials {
    padding-top: 12px;
  }

  .tutorial-shell {
    display: block;
    min-height: 0;
  }

  .tutorial-disclaimer {
    padding: 10px 14px;
    line-height: 1.45;
  }

  .tutorial-mobile-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
    background: #f8faf8;
  }

  .tutorial-mobile-controls label {
    margin: 0;
  }

  .tutorial-navigation {
    display: none;
  }

  .tutorial-reader-head {
    min-height: 0;
    padding: 16px 14px 14px;
  }

  .tutorial-reader-head h2 {
    font-size: 18px;
  }

  .tutorial-mode-switch {
    position: static;
    width: 100%;
    margin-top: 14px;
  }

  .tutorial-frame-wrap {
    min-height: 68vh;
  }

  .tutorial-frame {
    min-height: 68vh;
  }

  .tutorial-page-nav {
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
    padding: 10px;
  }

  .tutorial-page-nav button {
    min-width: 0;
    padding: 0 9px;
  }

  .tutorial-coming-soon,
  .tutorial-state {
    min-height: 60vh;
    padding: 28px 18px;
  }

  .panel-head {
    display: grid;
  }

  .history-actions {
    justify-content: flex-start;
  }
}
