/* ═══════════════════════════════════════════════════════════════════
   Community Foodshed Platform — Design System
   4-Layer Token-Based Architecture
   ═══════════════════════════════════════════════════════════════════ */

/* ── Layer 0: Design Tokens ── */
:root {
  /* Colors */
  --color-primary: #2D64B4;
  --color-primary-hover: #1e4d8c;
  --color-bg: #E8E4E0;
  --color-surface: #FFF;
  --color-surface-alt: #F7F5F2;
  --color-surface-hover: #F0ECE8;
  --color-surface-dim: #FAFAF8;
  --color-text: #2D2D2D;
  --color-text-muted: #888;
  --color-text-dim: #aaa;
  --color-text-secondary: #666;
  --color-border: #E0DCD8;
  --color-border-light: #F0ECE8;
  --color-success: #22c55e;
  --color-success-bg: #d1fae5;
  --color-success-text: #065f46;
  --color-warning-bg: #fef3c7;
  --color-warning-text: #92400e;
  --color-error-bg: #fee2e2;
  --color-error-text: #991b1b;
  --color-info-bg: #dbeafe;
  --color-info-text: #1e40af;
  --color-neutral-bg: #f3f4f6;
  --color-neutral-text: #6b7280;

  /* Spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Typography */
  --font-sans: 'SF Pro Text', -apple-system, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-lg: 15px;
  --text-xl: 22px;
  --text-2xl: 24px;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Radii */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 50%;

  /* Shadows */
  --shadow-xs: 0 1px 4px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-focus: 0 0 0 2px rgba(45,100,180,0.15);

  /* Transitions */
  --transition-fast: 0.15s;
  --transition-normal: 0.3s;
}

/* ── Layer 1: Reset + Base ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: var(--text-xl); font-weight: var(--weight-bold); margin-bottom: var(--space-1); }
h2 { font-size: 16px; font-weight: var(--weight-semibold); margin-bottom: var(--space-3); }
h3 { font-size: 14px; font-weight: var(--weight-semibold); margin-bottom: var(--space-2); }
p { font-size: var(--text-base); line-height: 1.6; margin-bottom: var(--space-2); }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Layer 2: Utility Classes ── */

/* Display */
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-inline-flex { display: inline-flex; }

/* Flex */
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.flex-shrink-0 { flex-shrink: 0; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-stretch { align-self: stretch; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-0 { gap: 0; }

/* Grid */
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Spacing */
.m-0 { margin: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mx-1 { margin-left: var(--space-1); margin-right: var(--space-1); }
.p-0 { padding: 0; }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }

/* Sizing */
.w-full { width: 100%; }
.max-w-400 { max-width: 400px; }
.min-h-touch { min-height: 44px; }

/* Typography utilities */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-dim { color: var(--color-text-dim); }
.text-accent { color: var(--color-primary); }
.text-secondary { color: var(--color-text-secondary); }
.font-mono { font-family: var(--font-mono); }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }
.leading-loose { line-height: 1.8; }
.leading-double { line-height: 2; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.5px; }
.tracking-wider { letter-spacing: 1px; }
.whitespace-nowrap { white-space: nowrap; }

/* Background */
.bg-alt { background: var(--color-surface-alt); }
.bg-surface { background: var(--color-surface); }

/* Border */
.border { border: 1px solid var(--color-border); }
.border-b-light { border-bottom: 1px solid var(--color-border-light); }
.border-l-success { border-left: 3px solid var(--color-success); }
.border-l-accent { border-left: 3px solid var(--color-primary); }
.border-accent { border: 2px solid var(--color-primary); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

/* Opacity */
.opacity-muted { opacity: 0.6; }
.opacity-80 { opacity: 0.8; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }

/* ── Layer 3: Components ── */

/* Subtitle */
.subtitle { font-size: var(--text-base); color: var(--color-text-muted); margin-bottom: var(--space-5); }

/* Section Title */
.section-title {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-bg);
  margin: var(--space-4) 0 var(--space-2);
}

/* Container */
.container { max-width: 640px; margin: 0 auto; padding: var(--space-6) var(--space-4); }
.container-wide { max-width: 800px; margin: 0 auto; padding: var(--space-6) var(--space-4); }

/* Nav / Breadcrumb */
.nav { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-4); }
.nav a { color: var(--color-primary); text-decoration: none; }
.nav a:hover { text-decoration: underline; }

/* Global Nav Bar */
.global-nav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 10px var(--space-4);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}
.global-nav a {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  padding: 6px 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
}
.global-nav a:hover { color: var(--color-text); border-color: var(--color-text-dim); background: var(--color-surface-alt); }
.global-nav a.active { background: var(--color-primary); color: var(--color-surface); border-color: var(--color-primary); }
.nav-separator {
  width: 1px;
  background: var(--color-border);
  margin: 0 6px;
  align-self: stretch;
}
.nav-group-label {
  font-size: 9px;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  align-self: center;
  margin-right: 2px;
}

/* Card */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
}
.card-compact { padding: var(--space-4); }
.card-clickable { cursor: pointer; transition: all var(--transition-fast); }
.card-clickable:hover { box-shadow: var(--shadow-md); border-color: #ccc; }

/* Card Header (absorbs common flex header pattern) */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header-info {
  text-align: right;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Info Box (common bg+radius+padding pattern) */
.info-box {
  background: var(--color-surface-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  font-size: var(--text-sm);
}

.info-box-lg {
  padding: 14px;
}

/* Stat Grid */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); margin-bottom: var(--space-5); }
.stat-grid-2 { grid-template-columns: repeat(2, 1fr); }
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-box { background: var(--color-surface-alt); border-radius: var(--radius-lg); padding: var(--space-4); text-align: center; }
.stat-number { font-size: var(--text-2xl); font-weight: var(--weight-bold); color: var(--color-primary); }
.stat-number-sm { font-size: 18px; }
.stat-number-md { font-size: 20px; }
.stat-label { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: var(--space-1); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  min-height: 44px;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
  text-decoration: none;
  text-align: center;
}
.btn-primary { background: var(--color-primary); color: var(--color-surface); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-secondary { background: var(--color-surface-alt); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: var(--color-surface-hover); }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: var(--text-sm); min-height: 44px; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-green { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-yellow { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-red { background: var(--color-error-bg); color: var(--color-error-text); }
.badge-gray { background: var(--color-neutral-bg); color: var(--color-neutral-text); }
.badge-blue { background: var(--color-info-bg); color: var(--color-info-text); }

/* Property Rows (key-value) */
.prop-group { margin-bottom: var(--space-4); }
.prop-group-title {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-2);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-bg);
}
.prop-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  min-height: 44px;
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--text-base);
}
.prop-key { color: var(--color-text-muted); }
.prop-value { color: var(--color-text); font-weight: var(--weight-medium); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); margin: var(--space-2) 0; }
.table th, .table td { padding: var(--space-2) 10px; text-align: left; border-bottom: 1px solid var(--color-border-light); }
.table th { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.5px; background: var(--color-surface-alt); }
.table tr:hover td { background: var(--color-surface-dim); }

/* Accordion */
.accordion { border: 1px solid var(--color-border); border-radius: var(--radius-lg); margin-bottom: var(--space-2); overflow: hidden; }
.accordion-header {
  background: var(--color-surface-alt);
  padding: var(--space-3) var(--space-4);
  min-height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  transition: background var(--transition-fast);
  border: none;
  width: 100%;
  font-family: inherit;
  color: inherit;
  text-align: left;
}
.accordion-header:hover { background: var(--color-surface-hover); }
.accordion-arrow { font-size: var(--text-sm); color: var(--color-text-muted); transition: transform 0.2s; }
.accordion.open .accordion-arrow { transform: rotate(90deg); }
.accordion-body {
  padding: 0 var(--space-4);
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal) ease-out;
}
.accordion.open .accordion-body { max-height: 5000px; padding: var(--space-4); }

/* Collapsible Sections — FIXED rounded bottom bug */
.section-header {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  min-height: 44px;
  cursor: pointer;
  margin-bottom: -1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: var(--weight-semibold);
  transition: all var(--transition-fast);
  /* button reset */
  font-family: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
}
.section-header:hover { background: var(--color-surface-alt); }

/* When open, flatten bottom corners so header connects flush with body */
.section-header[aria-expanded="true"] {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: none;
}

.section-body {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 0 18px;
  max-height: 0;
  overflow: hidden;
  margin-bottom: var(--space-3);
}
.section-body.open { max-height: none; padding: 18px; overflow: visible; }

/* Forms */
.input {
  font-family: inherit;
  font-size: var(--text-base);
  padding: var(--space-2) var(--space-3);
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  width: 100%;
  background: var(--color-surface);
  color: var(--color-text);
}
.input:focus { outline: none; border-color: var(--color-primary); box-shadow: var(--shadow-focus); }
.select {
  font-family: inherit;
  font-size: var(--text-base);
  padding: var(--space-2) var(--space-3);
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
}
.label { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: var(--space-1); }
textarea.input { resize: vertical; min-height: 60px; }
input[type="range"] { accent-color: var(--color-primary); }

/* Tabs */
.tab-bar { display: flex; border-bottom: 1px solid var(--color-border); margin-bottom: var(--space-4); }
.tab {
  padding: 10px var(--space-4);
  min-height: 44px;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.tab:hover { color: var(--color-text); }
.tab.active { color: var(--color-text); border-bottom-color: var(--color-primary); }

/* Progress Bar */
.progress-bar { background: var(--color-bg); border-radius: var(--radius-sm); height: 6px; width: 100%; overflow: hidden; }
.progress-bar-lg { height: 12px; }
.progress-fill { background: var(--color-primary); height: 100%; border-radius: var(--radius-sm); transition: width var(--transition-normal); }

/* Gap Bar (supply vs demand) */
.gap-bar { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0; }
.gap-bar-bg { background: var(--color-bg); border-radius: var(--radius-sm); height: 16px; flex: 1; overflow: hidden; }
.gap-bar-supply { height: 100%; border-radius: var(--radius-sm); background: var(--color-success); }
.gap-bar-label { font-size: var(--text-sm); width: 60px; text-align: right; font-weight: var(--weight-semibold); }

/* Score Circle */
.score-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  border: 3px solid var(--color-primary);
  font-size: 26px;
  font-weight: var(--weight-bold);
  color: var(--color-primary);
}
.score-circle-sm {
  width: 60px;
  height: 60px;
  font-size: var(--text-xl);
}

/* Checklist */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-2) 0;
  min-height: 44px;
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--text-base);
}
.checkbox {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: inline-block;
  cursor: pointer;
  flex-shrink: 0;
  background: var(--color-surface);
}
.checkbox.checked { background: var(--color-primary); border-color: var(--color-primary); }

/* Event Card */
.event-card { background: var(--color-surface-alt); border-radius: var(--radius-lg); padding: 14px; margin-bottom: var(--space-2); }
.event-date { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.event-title { font-size: 14px; font-weight: var(--weight-semibold); margin: var(--space-1) 0; }
.event-meta { font-size: var(--text-sm); color: var(--color-text-secondary); }

/* Event Card Header */
.event-card-header {
  display: flex;
  justify-content: space-between;
}

/* Crop Card */
.crop-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: var(--space-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.crop-card-name { font-weight: var(--weight-semibold); }
.crop-card-meta { font-size: var(--text-xs); color: var(--color-text-muted); }
.crop-card-companions { font-size: var(--text-xs); color: var(--color-text-dim); }

/* Livestock Card */
.livestock-card { border-left: 3px solid var(--color-success); }
.livestock-card--disabled { opacity: 0.6; }

/* Map Placeholder */
.map-placeholder {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-alt);
  margin-bottom: var(--space-3);
  color: var(--color-text-dim);
  font-size: var(--text-base);
}
.map-placeholder-tall { height: 300px; }

/* Photo Grid */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin: var(--space-2) 0; }
.photo-slot {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--color-text-dim);
  cursor: pointer;
  background: var(--color-surface-alt);
}
.photo-slot:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* Calendar Grid */
.calendar-row { display: flex; gap: 2px; margin-bottom: 2px; font-size: 10px; }
.calendar-cell { flex: 1; border: 1px solid var(--color-border-light); border-radius: var(--radius-sm); padding: 3px 4px; text-align: center; min-height: 22px; }
.calendar-cell.header { background: var(--color-surface-alt); font-weight: var(--weight-semibold); color: var(--color-text-muted); }
.calendar-cell.active { background: var(--color-primary); color: var(--color-surface); border-radius: var(--radius-sm); }
.calendar-cell--label { font-weight: var(--weight-semibold); }

/* Layout SVG */
.layout-svg { border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface-dim); margin: var(--space-2) 0; }

/* Split Layout (for workbench) */
.split { display: flex; gap: 0; }
.split-map { flex: 2; min-height: 500px; position: relative; }
.split-panel { flex: 1; max-width: 400px; overflow-y: auto; max-height: 600px; background: var(--color-surface); border-left: 1px solid var(--color-border); }

/* Contributor Row */
.contributor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--text-base);
}

/* Skill Checks */
.skill-checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-1); }
.skill-checks label {
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-1) 10px;
  cursor: pointer;
  background: var(--color-surface);
}
.skill-checks label:hover { background: var(--color-surface-alt); }
.skill-checks input { width: 14px; height: 14px; accent-color: var(--color-primary); }

/* Group/Neighbor Cards */
.group-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-surface);
}
.group-card .name { font-weight: var(--weight-semibold); font-size: var(--text-base); }
.group-card .detail { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

/* Next-Step Cards */
.next-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-2);
  cursor: pointer;
  background: var(--color-surface);
  transition: all var(--transition-fast);
}
.next-card:hover { background: var(--color-surface-alt); border-color: var(--color-primary); }
.next-card h4 { font-size: 14px; margin: 0 0 var(--space-1); }
.next-card p { font-size: var(--text-sm); color: var(--color-text-secondary); margin: 0; }

/* Impact Compare */
.impact-compare { display: flex; gap: var(--space-3); margin-bottom: var(--space-4); }
.impact-box { flex: 1; text-align: center; padding: var(--space-3); border-radius: var(--radius-lg); }
.impact-box.before { background: var(--color-surface-alt); border: 1px solid var(--color-border); }
.impact-box.after { background: var(--color-surface); border: 2px solid var(--color-primary); }
.impact-box .impact-label { font-size: 10px; color: var(--color-text-muted); text-transform: uppercase; margin-bottom: 6px; }

/* Highlight Box */
.highlight-box {
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
  margin: var(--space-4) 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
}

/* Hub Card (home page) */
.hub-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: block;
  color: var(--color-text);
}
.hub-card:hover { box-shadow: var(--shadow-md); border-color: #ccc; transform: translateY(-1px); }
.hub-card h3 { font-size: var(--text-lg); font-weight: var(--weight-semibold); margin-bottom: 10px; color: var(--color-primary); }
.hub-detail { font-size: var(--text-sm); color: var(--color-text-secondary); margin: 3px 0; line-height: 1.5; }
.hub-detail strong, .hub-detail b { color: var(--color-text); }
.hub-actions { margin-top: var(--space-3); display: flex; gap: var(--space-2); }

/* Coefficient Bar */
.coef-bar-bg { background: var(--color-bg); border-radius: var(--radius-sm); height: 6px; width: 80px; }
.coef-bar-fill { background: var(--color-primary); border-radius: var(--radius-sm); height: 6px; }

/* Derivation Chain */
.derivation-chain { display: flex; gap: 0; align-items: center; overflow-x: auto; padding: var(--space-3) 0; }
.derivation-step {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) 14px;
  text-align: center;
  min-width: 100px;
  flex-shrink: 0;
  background: var(--color-surface);
}
.derivation-step .step-title { font-size: 10px; font-weight: var(--weight-semibold); text-transform: uppercase; color: var(--color-text-muted); }
.derivation-step .step-value { font-size: var(--text-base); margin-top: var(--space-1); font-weight: var(--weight-medium); }
.derivation-arrow { font-size: 16px; padding: 0 6px; color: var(--color-text-dim); flex-shrink: 0; }

/* Step Dots (land.html wizard) */
.step-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  display: inline-block;
}
.step-dot--active {
  background: var(--color-primary);
}
.step-dot-separator {
  width: 1px;
  height: 14px;
  background: var(--color-border);
  margin: 0 var(--space-1);
}

/* Step List (numbered instructions) */
.step-list {
  font-size: var(--text-base);
  line-height: 2;
}

/* Knowledge Base List */
.kb-list {
  font-size: var(--text-base);
}
.kb-list-item {
  border-bottom: 1px solid var(--color-border-light);
  padding: 6px 0;
}
.kb-list-item:last-child {
  border-bottom: none;
}

/* Survey Question */
.survey-question {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-light);
}
.survey-question:last-child {
  border-bottom: none;
}
.survey-question-label {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

/* Audit Log Entry */
.audit-entry {
  border-bottom: 1px solid var(--color-border-light);
  padding: 10px 0;
}
.audit-entry:last-child {
  border-bottom: none;
}
.audit-timestamp {
  color: var(--color-text-dim);
  font-size: var(--text-xs);
}
.audit-detail {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
  padding-left: var(--space-4);
}

/* Concentric Circles (community.html) */
.circles-viz {
  display: flex;
  justify-content: center;
  margin: var(--space-5) 0 var(--space-6);
}
.circle-ring {
  border-radius: var(--radius-full);
  border: 2px dashed var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.circle-ring--l2 { width: 320px; height: 320px; background: rgba(45,100,180,0.03); }
.circle-ring--l1 { width: 230px; height: 230px; background: rgba(45,100,180,0.05); }
.circle-ring--l0 { width: 140px; height: 140px; background: rgba(45,100,180,0.08); }
.circle-ring--home {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(45,100,180,0.15);
}
.circle-label {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.circle-sublabel {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--color-text-dim);
  white-space: nowrap;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .split { flex-direction: column; }
  .split-map { min-height: 250px; }
  .split-panel { max-width: none; max-height: none; border-left: none; border-top: 1px solid var(--color-border); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .impact-compare { flex-direction: column; }
}
