/* ================================================================
   Submittal Builder — Design System
   ================================================================ */

/* --- Palette --- */
:root {
  /* Core */
  --ink:        #111827;
  --ink-soft:   #374151;
  --muted:      #6b7280;
  --subtle:     #9ca3af;
  --line:       #e5e7eb;
  --line-light: #f3f4f6;
  --bg:         #f9fafb;
  --surface:    #ffffff;

  /* Accent — warm blue that reads as professional, not playful */
  --accent:     #2563eb;
  --accent-hover:#1d4ed8;
  --accent-bg:  #eff6ff;
  --accent-ring:#bfdbfe;

  /* Semantic */
  --success:    #059669;
  --success-bg: #ecfdf5;
  --warn:       #d97706;
  --warn-bg:    #fffbeb;
  --danger:     #dc2626;
  --danger-bg:  #fef2f2;

  /* Spacing rhythm */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.03);
  --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);

  /* Transition */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
code {
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 0.875em;
  background: var(--line-light);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ================================================================
   Top Bar
   ================================================================ */
.topbar {
  background: var(--ink);
  color: #fff;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.logo {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}
.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -1px;
}
.topnav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.topnav a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s var(--ease);
}
.topnav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
  text-decoration: none;
}
.topnav a.active {
  color: #fff;
  background: rgba(255,255,255,0.12);
}
.topnav a.topnav-cta {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.topnav a.topnav-cta:hover {
  background: var(--accent);
  color: #fff;
  filter: brightness(1.08);
}
.topnav a.topnav-gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  margin-left: 4px;
  border-radius: 50%;
  color: rgba(255,255,255,0.7);
}
.topnav a.topnav-gear:hover,
.topnav a.topnav-gear.active {
  color: #fff;
  background: rgba(255,255,255,0.12);
}
.topnav a.topnav-gear svg {
  display: block;
  transition: transform 0.4s var(--ease);
}
.topnav a.topnav-gear:hover svg {
  transform: rotate(60deg);
}

/* ================================================================
   Page Layout
   ================================================================ */
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) 80px;
}
.wrap.wrap-wide {
  max-width: min(1400px, 96vw);
}

/* ================================================================
   Step Indicator
   ================================================================ */
.steps {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-xl);
  gap: 0;
  counter-reset: step;
  position: relative;
}
.steps li {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--subtle);
  padding: var(--space-sm) var(--space-xs) 0;
  position: relative;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  font-size: 13px;
  color: var(--subtle);
  margin: 0 auto var(--space-xs);
  position: relative;
  z-index: 2;
  transition: all 0.2s var(--ease);
}
/* Connecting line between steps */
.steps li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: calc(var(--space-sm) + 16px);
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 2px;
  background: var(--line);
  z-index: 1;
}
.steps li.active::before {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px var(--accent-bg);
}
.steps li.active {
  color: var(--accent);
  font-weight: 600;
}
.steps li.done::before {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
  content: '\2713';
}
.steps li.done { color: var(--success); }
.steps li.done::after { background: var(--success); }

/* ================================================================
   Typography
   ================================================================ */
h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0 0 var(--space-sm);
  color: var(--ink);
  line-height: 1.3;
}
h2 {
  font-size: 18px;
  font-weight: 600;
  margin: var(--space-xl) 0 var(--space-sm);
}
.lead {
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 var(--space-lg);
  font-size: 15px;
}

/* ================================================================
   Cards & Surfaces
   ================================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

/* ================================================================
   Forms
   ================================================================ */
form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}
.field {
  display: block;
  margin-bottom: var(--space-md);
}
.field > span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.field input[type=text],
.field input[type=date],
.field input[type=email],
.field input[type=number],
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  outline: none;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--subtle);
}
.field textarea {
  resize: vertical;
  min-height: 72px;
}
.field input[type=file] {
  font-size: 13px;
  color: var(--muted);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
@media (max-width: 540px) {
  .field-row { grid-template-columns: 1fr; }
}

/* ================================================================
   Buttons
   ================================================================ */
button, .btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s var(--ease);
  line-height: 1.4;
}
button, .btn-link.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
button:hover, .btn-link.primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
}
button:active, .btn-link.primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}
.btn-link.secondary {
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-link.secondary:hover {
  background: var(--line-light);
  border-color: #d1d5db;
  text-decoration: none;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* ================================================================
   File Upload Zone
   ================================================================ */
.filedrop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  margin-bottom: var(--space-md);
  background: var(--line-light);
}
.filedrop:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.filedrop input { display: block; margin: 0 auto; }
.filedrop span {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.filedrop-icon {
  font-size: 32px;
  line-height: 1;
  color: var(--subtle);
}

/* ================================================================
   Callout / Alert Banners
   ================================================================ */
.callout {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.55;
}
.banner {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin: var(--space-md) 0;
  font-size: 14px;
  line-height: 1.55;
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}
.banner.warn {
  background: var(--warn-bg);
  border-left: 3px solid var(--warn);
  color: var(--ink-soft);
}
.banner.warn a { color: var(--warn); font-weight: 600; }
.banner.info {
  background: var(--surface-2, var(--warn-bg));
  border-left: 3px solid var(--accent, var(--ink-soft));
  color: var(--ink-soft);
}
.banner.danger {
  background: var(--danger-bg);
  border-left: 3px solid var(--danger);
}

/* ================================================================
   Radio/Checkbox Choice Cards
   ================================================================ */
.choice {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
  cursor: pointer;
  line-height: 1.55;
  transition: all 0.15s var(--ease);
  background: var(--surface);
}
.choice:hover {
  border-color: var(--accent-ring);
  background: var(--accent-bg);
}
.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: 0 0 0 1px var(--accent);
}
.choice input { margin-top: 4px; accent-color: var(--accent); }

/* ================================================================
   Brand Grid (brands page)
   ================================================================ */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-sm);
}
.brand-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s var(--ease);
}
.brand-checkbox:hover {
  border-color: var(--accent-ring);
  background: var(--accent-bg);
}
.brand-checkbox:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.brand-checkbox input { margin: 0; accent-color: var(--accent); }

/* ================================================================
   Review Table
   ================================================================ */
.review-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}
.review-actions .action-hint {
  color: var(--subtle);
  font-size: 12px;
  margin-left: auto;
}
.review-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.review-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.review-table thead th {
  background: var(--line-light);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.review-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-light);
  vertical-align: top;
}
.review-table tbody tr:last-child td { border-bottom: none; }
.review-table tr.row-resolved   { background: var(--surface); }
.review-table tr.row-unresolved { background: transparent; }
.review-table tr.row-skipped    { background: var(--line-light); color: var(--muted); }
.review-table tr:hover td       { background: var(--accent-bg); }
.review-table .col-check  { width: 56px;  text-align: center; }
.review-table .col-mfr    { width: 140px; font-weight: 600; }
.review-table .col-model  { width: 150px; }
.review-table .col-desc   { width: auto; }
.review-table .col-qty    { width: 54px; text-align: right; font-variant-numeric: tabular-nums; }
.review-table .col-status { width: 140px; }
.review-table .col-action { width: 130px; }
.review-table input[type="checkbox"] {
  width: 18px; height: 18px; cursor: pointer;
  accent-color: var(--accent);
}
.review-table input[type="checkbox"]:disabled {
  cursor: not-allowed; opacity: 0.35;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status-ok   { background: var(--success-bg); color: var(--success); }
.status-bad  { background: var(--danger-bg);  color: var(--danger); }
.status-skip { background: var(--line-light);  color: var(--muted); }
/* Unresolved is a normal "to do" state, not a failure: calm, neutral. */
.status-pending { background: var(--surface-2, var(--line-light)); color: var(--ink-soft); }

/* Inline upload in review rows */
.row-upload summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.row-upload summary::-webkit-details-marker { display: none; }
.row-upload[open] summary { margin-bottom: 6px; }
.row-upload .upload-row { display: flex; gap: 6px; align-items: center; }
.row-upload input[type="file"] { font-size: 11px; max-width: 130px; }
.row-upload button { padding: 5px 10px; font-size: 11px; margin: 0; }

/* ================================================================
   Brand Summary (collapsible)
   ================================================================ */
.brand-summary-collapse {
  margin-top: var(--space-xl);
  border-top: 1px solid var(--line);
  padding-top: var(--space-md);
}
.brand-summary-collapse > summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: var(--space-md);
}
.brand-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-md) 0;
}
.brand-card.brand-complete { border-left: 3px solid var(--success); }
.brand-card.brand-partial  { border-left: 3px solid var(--warn); }
.brand-card.brand-empty    { border-left: 3px solid var(--muted); }
.brand-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-md);
}
.brand-name { font-weight: 600; font-size: 15px; }
.brand-stats { color: var(--muted); font-size: 13px; }
.brand-flag {
  font-size: 12px;
  color: var(--danger);
  background: var(--danger-bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

/* ================================================================
   Unresolved / Item List
   ================================================================ */
.section { margin-top: var(--space-xl); font-size: 16px; font-weight: 600; }
.items { list-style: none; padding: 0; margin: 0; }
.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: start;
  padding: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  font-size: 13px;
  transition: border-color 0.15s var(--ease);
}
.item:hover { border-color: var(--accent-ring); }
.item.missing { border-left: 3px solid var(--danger); }
.item .mfr { font-weight: 600; }
.item .model { background: var(--line-light); padding: 2px 8px; border-radius: 4px; margin-left: 6px; }
.item .desc { color: var(--muted); margin-left: 6px; }
.item .reason { display: block; color: var(--danger); font-size: 12px; margin-top: 4px; }
.item .source { color: var(--muted); font-size: 12px; }
.resolved-item { border-left: 3px solid var(--success); }
.skipped-item  { border-left: 3px solid var(--subtle); opacity: 0.8; }

.upload-row { background: none; border: 0; padding: 0; margin: 0; display: flex; gap: 6px; box-shadow: none; }
.upload-row input[type=file] { font-size: 12px; }
.upload-row button { margin: 0; padding: 6px 10px; font-size: 12px; }
.inline-build { background: none; border: 0; padding: 0; margin-bottom: var(--space-md); box-shadow: none; }

/* ================================================================
   Result Page
   ================================================================ */
.result-actions {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.result-actions .btn-link {
  padding: 12px 24px;
  font-size: 15px;
}
.annotation-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-card .stat-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.stat-card.stat-good { border-color: #a7f3d0; background: var(--success-bg); }
.stat-card.stat-good .stat-value { color: var(--success); }
.stat-card.stat-warn { border-color: #fde68a; background: var(--warn-bg); }
.stat-card.stat-warn .stat-value { color: var(--warn); }
.stat-card.stat-bad  { border-color: #fecaca; background: var(--danger-bg); }
.stat-card.stat-bad  .stat-value { color: var(--danger); }

.stats {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  font-size: 13px;
}
.stats dt { color: var(--muted); font-weight: 500; }
.stats dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ================================================================
   Loading Overlay
   ================================================================ */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
#loading-overlay[hidden] { display: none; }
.loading-content {
  background: var(--surface);
  padding: var(--space-xl) var(--space-2xl);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  box-shadow: var(--shadow-xl);
  min-width: 280px;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ssb-spin 0.75s linear infinite;
}
@keyframes ssb-spin { to { transform: rotate(360deg); } }
.loading-text {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}
.loading-sub {
  color: var(--muted);
  font-size: 13px;
}

/* ================================================================
   Reference Page
   ================================================================ */
.ref-head { margin-bottom: 6px; }
.ref-sub  { color: var(--muted); max-width: 64ch; margin-top: 0; line-height: 1.6; }
.ref-stats {
  display: flex;
  gap: var(--space-md);
  margin: var(--space-md) 0 var(--space-lg);
  flex-wrap: wrap;
}
.ref-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.ref-stat b { font-size: 22px; display: block; font-weight: 800; color: var(--ink); }
.ref-search {
  width: 100%;
  max-width: 420px;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.ref-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.legend {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 var(--space-lg);
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}
.legend span.k {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  vertical-align: -1px;
  margin-right: 5px;
}
.k.multi { background: #ede9fe; border: 1px solid #c4b5fd; }
.k.spec  { background: var(--line-light); border: 1px solid var(--line); }

.ref-div > h2 { margin: var(--space-lg) 0 var(--space-sm); font-size: 17px; }
.ref-div > h2 .code  { color: var(--subtle); font-weight: 700; margin-right: var(--space-sm); }
.ref-div > h2 .cov   { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: var(--space-sm); }

details.ref-sys {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin: var(--space-sm) 0;
  background: var(--surface);
  transition: border-color 0.15s var(--ease);
}
details.ref-sys:hover { border-color: var(--accent-ring); }
details.ref-sys.spec-only { background: var(--line-light); border-style: dashed; }
details.ref-sys.spec-only:hover { border-color: var(--subtle); }
details.ref-sys > summary {
  cursor: pointer;
  padding: 12px var(--space-md);
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
details.ref-sys > summary::-webkit-details-marker { display: none; }
.sys-code { color: var(--subtle); font-weight: 700; font-size: 13px; }
.sys-meta { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: auto; }
.pill {
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 10px;
  margin-left: auto;
}
.pill.spec { background: var(--line-light); color: var(--muted); border: 1px solid var(--line); }

.brand-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md) var(--space-md);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--line-light);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  transition: all 0.15s var(--ease);
}
.chip:hover { border-color: var(--accent-ring); background: var(--accent-bg); }
.chip.multi { border-color: #c4b5fd; background: #ede9fe; }
.chip.multi:hover { border-color: #a78bfa; }
.spec-note {
  padding: 2px var(--space-md) var(--space-md);
  color: var(--subtle);
  font-size: 13px;
  font-style: italic;
}
.no-match { color: var(--subtle); padding: var(--space-sm) var(--space-md); font-style: italic; }

/* ================================================================
   Dashboard (Projects page)
   ================================================================ */

/* Header with title + CTA */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.dash-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
}
.dash-subtitle {
  color: var(--muted);
  font-size: 15px;
  margin: 4px 0 0;
  line-height: 1.5;
}

/* Stat cards row */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.dash-stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.dash-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.dash-stat-value {
  display: block;
  font-size: 36px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dash-stat-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.dash-stat-accent {
  border-color: var(--accent-ring);
  background: var(--accent-bg);
}
.dash-stat-accent .dash-stat-value {
  color: var(--accent);
}

/* Search + sort controls */
.dash-controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.dash-search-form {
  flex: 1;
  min-width: 280px;
}
.dash-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.dash-search-icon {
  position: absolute;
  left: 14px;
  color: var(--subtle);
  pointer-events: none;
  flex-shrink: 0;
}
.dash-search {
  width: 100%;
  padding: 12px 40px 12px 42px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  box-shadow: var(--shadow-sm);
}
.dash-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg), var(--shadow-sm);
}
.dash-search::placeholder {
  color: var(--subtle);
}
.dash-search-clear {
  position: absolute;
  right: 12px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--line-light);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  transition: all 0.15s var(--ease);
}
.dash-search-clear:hover {
  background: var(--line);
  color: var(--ink);
  text-decoration: none;
}

/* Sort pills */
.dash-sort {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.dash-sort-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.dash-sort-opt {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
}
.dash-sort-opt:hover {
  background: var(--line-light);
  color: var(--ink-soft);
  text-decoration: none;
}
.dash-sort-opt.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}

/* Search result label */
.dash-search-result-label {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: var(--space-md);
}
.dash-clear-link {
  margin-left: var(--space-sm);
  font-size: 13px;
}

/* Project cards list */
.dash-project-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.dash-project-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s var(--ease);
}
.dash-project-card:hover {
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}
.dash-project-main {
  flex: 1;
  min-width: 0;
}
.dash-project-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--success-bg);
}
.dash-project-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-project-number {
  font-size: 13px;
  font-weight: 500;
  color: var(--subtle);
  flex-shrink: 0;
}
.dash-project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  margin-top: 6px;
}
.dash-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}
.dash-meta-item svg {
  color: var(--subtle);
  flex-shrink: 0;
}
.dash-project-stats {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-shrink: 0;
}
.dash-project-stat {
  text-align: center;
  min-width: 64px;
}
.dash-project-stat-val {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dash-project-stat-lbl {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 500;
}
.dash-project-date {
  font-size: 13px;
  color: var(--subtle);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 80px;
  text-align: right;
}

/* Empty state */
.dash-empty {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  margin-top: var(--space-lg);
}
.dash-empty-icon {
  color: var(--subtle);
  margin-bottom: var(--space-md);
}
.dash-empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: var(--space-xs);
}
.dash-empty-hint {
  font-size: 14px;
  color: var(--muted);
}

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 640px) {
  .topbar { padding: 0 var(--space-md); }
  .wrap { padding: var(--space-lg) var(--space-md) 60px; }
  .steps li { font-size: 10px; }
  .steps li::before { width: 28px; height: 28px; font-size: 12px; }
  h1 { font-size: 20px; }
  .annotation-summary { grid-template-columns: repeat(2, 1fr); }
  .review-table { font-size: 12px; }
  .review-table thead th, .review-table tbody td { padding: 8px; }

  /* Dashboard responsive */
  .dash-header { flex-direction: column; gap: var(--space-sm); }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-stat-value { font-size: 28px; }
  .dash-controls { flex-direction: column; align-items: stretch; }
  .dash-sort { justify-content: flex-start; flex-wrap: wrap; }
  .dash-project-card { flex-direction: column; align-items: stretch; gap: var(--space-md); }
  .dash-project-stats { justify-content: flex-start; gap: var(--space-md); }
  .dash-project-date { text-align: left; }
}

/* Site-wide disclaimer footer (positioning + AI notice) */
.site-footer {
  max-width: var(--wrap, 980px);
  margin: var(--space-xl) auto 0;
  padding: var(--space-lg) var(--space-md) var(--space-xl);
  border-top: 1px solid var(--line-light, #e3e8ee);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted, #8a97a8);
}
.site-footer p { margin: 0 0 8px; }
.site-footer p:last-child { margin-bottom: 0; }
.site-footer strong { color: var(--ink-soft, #5a6675); }
