/* =============================================================
   Backlink Hospital — internal app
   Clinical chart aesthetic, matched to marketing brand system
   ============================================================= */

:root {
  color-scheme: light;

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'SFMono-Regular', Menlo, Consolas, monospace;

  /* Surface palette — warm off-white from marketing */
  --bg: #F8F7F4;
  --bg-alt: #F0EFEB;
  --bg-card: #FFFFFF;
  --bg-soft: #FBFAF7;
  --text: #1C1917;
  --text-muted: #78716C;
  --text-light: #A8A29E;
  --border: #E7E5E0;
  --border-strong: #D6D3CD;

  /* Brand accent — teal */
  --accent: #0F766E;
  --accent-hover: #14B8A6;
  --accent-bg: #F0FDFA;
  --accent-soft: #CCFBF1;

  /* Vital-sign status palette */
  --alive: #16A34A;
  --alive-bg: #F0FDF4;
  --alive-border: #BBF7D0;
  --dead: #DC2626;
  --dead-bg: #FEF2F2;
  --dead-border: #FECACA;
  --changed: #CA8A04;
  --changed-bg: #FEFCE8;
  --changed-border: #FDE68A;
  --triage: #7C3AED;
  --triage-bg: #F5F3FF;
  --triage-border: #DDD6FE;
  --missing: #475569;
  --missing-bg: #F1F5F9;
  --missing-border: #CBD5E1;

  /* Layout */
  --content-max: 1180px;
  --content-narrow: 560px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-md: 0 1px 3px rgba(28, 25, 23, 0.05), 0 8px 24px rgba(28, 25, 23, 0.06);
  --shadow-lg: 0 1px 3px rgba(28, 25, 23, 0.05), 0 16px 48px rgba(28, 25, 23, 0.08);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --grid-color: rgba(15, 118, 110, 0.04);
  --grid-size: 24px;
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* ============================================
   LAYOUT — shell / containers
   ============================================ */
.shell {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.shell--narrow {
  max-width: var(--content-narrow);
}

main.shell {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

/* ============================================
   TOP NAV
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 247, 244, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 64px;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  max-width: var(--content-max);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.brand::before {
  content: '+';
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand:hover { color: var(--text); }

.brand-copy { display: none; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s ease;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.nav-link.is-active {
  color: var(--text);
  background: var(--bg-alt);
}

.nav-link.muted {
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: default;
}

.nav-link.muted:hover { background: transparent; color: var(--text-light); }

/* ============================================
   HERO — page header strip
   ============================================ */
.hero {
  position: relative;
  margin: 0 0 2rem;
  padding: 2.5rem 2rem;
  background:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px),
    var(--bg-soft);
  background-size: var(--grid-size) var(--grid-size);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.hero h1,
.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 3.5vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0.4rem 0 0.6rem;
}

.hero h1 em,
.page-title em {
  color: var(--dead);
  font-style: italic;
}

.hero p,
.lede {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 56ch;
  line-height: 1.65;
}

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

/* Hero compact variant for empty/login pages */
.hero--centered {
  text-align: center;
  padding: 3rem 2rem;
}
.hero--centered .lede,
.hero--centered p { margin-left: auto; margin-right: auto; }

/* ============================================
   SECTION LABELS — mono caps
   ============================================ */
.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-label::before {
  content: '▓ ';
  letter-spacing: 0;
}

/* ============================================
   PANELS / CARDS
   ============================================ */
.panel,
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.panel--flush {
  padding: 0;
  overflow: hidden;
}

.panel h2 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 0 0 1rem;
}

.panel h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin: 1.25rem 0 0.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.section-header h2 { margin: 0; }

/* ============================================
   STAT GRID — vital sign cards
   ============================================ */
.grid {
  display: grid;
  gap: 0.875rem;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.metric {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.15s ease;
}

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

.metric-value {
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.01em;
}

.metric > div:not(.metric-value) {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Vital-sign metric variants — colored backgrounds */
.metric--alive   { background: var(--alive-bg);   border-color: var(--alive-border); }
.metric--alive   .metric-value { color: var(--alive); }
.metric--changed { background: var(--changed-bg); border-color: var(--changed-border); }
.metric--changed .metric-value { color: var(--changed); }
.metric--missing { background: var(--missing-bg); border-color: var(--missing-border); }
.metric--missing .metric-value { color: var(--missing); }
.metric--dead    { background: var(--dead-bg);    border-color: var(--dead-border); }
.metric--dead    .metric-value { color: var(--dead); }
.metric--triage  { background: var(--triage-bg);  border-color: var(--triage-border); }
.metric--triage  .metric-value { color: var(--triage); }
.metric--atrisk  { background: var(--changed-bg); border-color: var(--changed-border); }
.metric--atrisk  .metric-value { color: var(--changed); }

/* ============================================
   FORMS
   ============================================ */
form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

label small {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="file"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="file"] {
  padding: 0.65rem 0.7rem;
  cursor: pointer;
}

textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.55;
}

/* ============================================
   BUTTONS
   ============================================ */
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  color: white;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

button:hover,
.button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.2);
}

button:disabled,
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.button-secondary,
.button.button-secondary,
button.button-neutral,
.button.button-neutral {
  background: var(--bg-card);
  color: var(--text-muted);
  border-color: var(--border-strong);
}

button.button-secondary:hover,
.button.button-secondary:hover,
button.button-neutral:hover,
.button.button-neutral:hover {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}

button.button-small,
.button.button-small {
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ============================================
   STATUS BADGES — pill-shaped vital signs
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.4;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.badge-neutral {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--text-muted);
}

.badge-active {
  background: var(--alive-bg);
  border-color: var(--alive-border);
  color: var(--alive);
}

.badge-pending,
.badge-changed {
  background: var(--changed-bg);
  border-color: var(--changed-border);
  color: var(--changed);
}

.badge-missing {
  background: var(--missing-bg);
  border-color: var(--missing-border);
  color: var(--missing);
}

.badge-broken {
  background: var(--dead-bg);
  border-color: var(--dead-border);
  color: var(--dead);
}

.badge-review {
  background: var(--triage-bg);
  border-color: var(--triage-border);
  color: var(--triage);
}

.badge-draft {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--text-light);
}

/* Collapsed 3-state badges */
.badge-alive {
  background: var(--alive-bg);
  border-color: var(--alive-border);
  color: var(--alive);
}

.badge-atrisk {
  background: var(--changed-bg);
  border-color: var(--changed-border);
  color: var(--changed);
}

.badge-dead {
  background: var(--dead-bg);
  border-color: var(--dead-border);
  color: var(--dead);
}

/* ============================================
   FLASH MESSAGES
   ============================================ */
.flash {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.flash::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.flash-success {
  background: var(--alive-bg);
  border-color: var(--alive-border);
  color: #14532D;
}

.flash-error {
  background: var(--dead-bg);
  border-color: var(--dead-border);
  color: #7F1D1D;
}

/* Row run-state: queued / running replaces the status badge during a re-check */
.run-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.4;
}

.run-pill--queued {
  background: var(--bg-alt);
  border-color: var(--border-strong);
  color: var(--text-muted);
}

.run-pill--queued::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-light);
  display: inline-block;
}

.run-pill--running {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.run-spinner {
  width: 10px;
  height: 10px;
  border: 2px solid rgba(15, 118, 110, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: run-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes run-spin {
  to { transform: rotate(360deg); }
}

tr.row-running { background: var(--accent-bg); }
tr.row-queued td { color: var(--text-muted); }

/* Live progress banner */
.live-progress {
  margin: 0 0 1.5rem;
  padding: 1.1rem 1.3rem;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.08), 0 8px 24px rgba(15, 118, 110, 0.06);
  position: relative;
  overflow: hidden;
}

.live-progress::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.5;
  pointer-events: none;
}

.live-progress > * { position: relative; z-index: 1; }

.live-progress__top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.live-progress__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.18);
  animation: lp-pulse 1.2s ease-in-out infinite;
}

@keyframes lp-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.18); opacity: 1; }
  50% { box-shadow: 0 0 0 8px rgba(15, 118, 110, 0.06); opacity: 0.7; }
}

.live-progress__label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: -0.005em;
}

.live-progress__count {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text);
  margin-left: auto;
}

.live-progress__pct {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 3rem;
  text-align: right;
}

.live-progress__bar {
  height: 6px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
}

.live-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
  position: relative;
  overflow: hidden;
}

.live-progress__fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.35) 50%,
    transparent 100%);
  animation: lp-shimmer 1.6s linear infinite;
}

@keyframes lp-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.live-progress__foot {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* ============================================
   DATA TABLE
   ============================================ */
.data-table,
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.data-table thead th,
.table thead th {
  background: var(--bg-alt);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.data-table thead th:first-child,
.table thead th:first-child { border-top-left-radius: var(--radius); }
.data-table thead th:last-child,
.table thead th:last-child  { border-top-right-radius: var(--radius); }

.data-table tbody td,
.table tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.data-table tbody tr:hover,
.table tbody tr:hover {
  background: var(--bg-soft);
}

.data-table tbody tr:last-child td,
.table tbody tr:last-child td {
  border-bottom: none;
}

/* Keep every row single-line; long cells truncate with ellipsis */
.data-table tbody td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.data-table tbody td.truncate-cell {
  max-width: 140px;
  color: var(--text);
}

.data-table tbody td.anchor-cell {
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  max-width: 240px;
}

.data-table tbody td.nowrap {
  white-space: nowrap;
}

/* URL cell with favicon */
.data-table tbody td a.url-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
}

.data-table tbody td a.url-cell:hover .url-cell__path,
.data-table tbody td a.url-cell:hover .url-cell__text {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.url-cell__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-cell.url-cell--path {
  align-items: flex-start;
  overflow: visible;
}

.url-cell__path {
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.url-cell__path--empty {
  color: var(--text-muted);
  font-style: italic;
}

.favicon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 3px;
  background: var(--bg-alt);
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
}

.favicon--empty {
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ============================================
   PREVIEW TABLE (mapping page)
   ============================================ */
.preview-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.preview-table thead th {
  background: var(--bg-alt);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
}

.preview-table tbody td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.preview-table tbody tr:last-child td { border-bottom: none; }

.preview-table .col-role {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.7rem;
}

.preview-table th.col-source,
.preview-table td.col-source {
  background: var(--accent-bg);
  border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}
.preview-table th.col-source { color: var(--accent); border-top: 2px solid var(--accent); }
.preview-table tbody tr:last-child td.col-source { border-bottom: 2px solid var(--accent); }

.preview-table th.col-target,
.preview-table td.col-target {
  background: var(--alive-bg);
  border-left: 2px solid var(--alive);
  border-right: 2px solid var(--alive);
}
.preview-table th.col-target { color: var(--alive); border-top: 2px solid var(--alive); }
.preview-table tbody tr:last-child td.col-target { border-bottom: 2px solid var(--alive); }

.preview-table th.col-anchor,
.preview-table td.col-anchor {
  background: var(--changed-bg);
  border-left: 2px solid var(--changed);
  border-right: 2px solid var(--changed);
}
.preview-table th.col-anchor { color: var(--changed); border-top: 2px solid var(--changed); }
.preview-table tbody tr:last-child td.col-anchor { border-bottom: 2px solid var(--changed); }

/* ============================================
   MISC
   ============================================ */
.inline-code,
pre {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

pre {
  padding: 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
}

.note {
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.empty {
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  color: var(--text-muted);
  text-align: center;
  font-size: 0.9rem;
}

.stats-list,
.list {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
}

.stats-list li {
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
  color: var(--text);
}

.stats-list li:last-child { border-bottom: none; }

.stats-list strong {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-block;
  min-width: 9rem;
}

.list-item {
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.4rem 0;
}

details summary:hover { color: var(--accent); }

.checkboxes {
  display: grid;
  gap: 0.5rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.checkbox input { width: auto; }

.meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.compact-card { margin-bottom: 0; }
.panel-subsection { margin-top: 1.25rem; }
.action-column { align-items: flex-start; }

/* Auth single-column layout */
.auth-shell {
  max-width: 440px;
  margin: 4rem auto;
}

.auth-shell .hero { margin-bottom: 1.25rem; }
.auth-shell .panel { margin-bottom: 0; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 860px) {
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5,
  .grid-6 {
    grid-template-columns: 1fr;
  }

  .header-inner {
    height: auto;
    padding: 0.85rem clamp(1rem, 4vw, 1.5rem);
  }

  .hero {
    padding: 2rem 1.5rem;
  }

  .panel,
  .card {
    padding: 1.4rem;
  }

  .stats-list strong { display: block; min-width: 0; margin-bottom: 0.15rem; }
}

@media (max-width: 540px) {
  .nav-link.muted { display: none; }
  main.shell { padding-top: 1.25rem; }
}
