

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

:root {
  /* ── Organic Tech Palette ── */
  --color-bg: #070a10;
  --color-surface: rgba(12, 16, 26, 0.82);
  --color-surface-elevated: rgba(18, 24, 38, 0.90);
  --color-border: rgba(0, 200, 165, 0.10);
  --color-border-hover: rgba(0, 200, 165, 0.22);

  /* Warm text hierarchy */
  --color-text-primary: #ede8df;
  --color-text-secondary: rgba(200, 194, 182, 0.82);
  --color-text-muted: rgba(140, 134, 124, 0.62);

  /* Bioluminescent accents */
  --color-accent: #00d4a4;
  --color-accent-glow: rgba(0, 212, 164, 0.12);
  --color-accent-2: #d4a03a;
  --color-accent-3: #c95e7e;

  /* Status */
  --color-success: #34d399;
  --color-success-bg: rgba(52, 211, 153, 0.08);
  --color-error: #f87171;
  --color-error-bg: rgba(248, 113, 113, 0.08);
  --color-warning: #fbbf24;

  /* Organic radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Fonts */
  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', Menlo, monospace;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans: var(--font-body);

  /* Shadows */
  --shadow-glow: 0 0 0 1px rgba(0, 212, 164, 0.06), 0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.02);

  /* Per-challenge theme (overridden via data-theme) */
  --theme-accent: var(--color-accent);
  --theme-glow: var(--color-accent-glow);
  --theme-surface: rgba(0, 212, 164, 0.03);
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-size: 14px;
}

/* ── Typography ── */

.text-xl {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.text-lg {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

.text-base {
  font-size: 14px;
  line-height: 1.6;
}

.text-sm {
  font-size: 13px;
  line-height: 1.5;
}

.text-xs {
  font-size: 12px;
  line-height: 1.4;
}

.font-mono {
  font-family: var(--font-mono);
}

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

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

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

/* ── Organic Background Layers ── */

.bg-organic {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(ellipse 900px 700px at 50% 60%, rgba(200, 94, 126, 0.025), transparent);
}

.bg-organic::before,
.bg-organic::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
}

.bg-organic::before {
  width: 70vmax;
  height: 60vmax;
  top: -25vmax;
  left: -15vmax;
  background: radial-gradient(circle, rgba(0, 212, 164, 0.055) 0%, transparent 65%);
  animation: drift 35s ease-in-out infinite;
}

.bg-organic::after {
  width: 55vmax;
  height: 55vmax;
  bottom: -15vmax;
  right: -10vmax;
  background: radial-gradient(circle, rgba(212, 160, 58, 0.04) 0%, transparent 65%);
  animation: drift 28s ease-in-out infinite reverse;
}

.bg-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: overlay;
}

/* Legacy class aliases */
.bg-grid { display: none; }
.bg-scanlines { display: none; }

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-4%, 3%) scale(1.02); }
  66% { transform: translate(3%, -2%) scale(0.98); }
}

/* ── Shell Layout ── */

.shell {
  min-height: 100%;
  padding: 20px;
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
}

/* ── Topbar ── */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(10, 14, 22, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-glow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 26px;
  height: 26px;
  color: var(--color-accent);
  filter: drop-shadow(0 0 10px rgba(0, 212, 164, 0.25));
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--color-text-primary);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── Chips ── */

.chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: rgba(10, 14, 22, 0.6);
  padding: 5px 12px;
}

.chip-accent {
  border-color: rgba(212, 160, 58, 0.18);
  color: var(--color-accent-2);
}

/* ── Grid Layout ── */

.grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

/* ── Panels ── */

.panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-glow);
  overflow: hidden;
  animation: breathe-border 8s ease-in-out infinite;
}

@keyframes breathe-border {
  0%, 100% { border-color: rgba(0, 200, 165, 0.08); }
  50% { border-color: rgba(0, 200, 165, 0.15); }
}

.panel-header {
  padding: 14px 18px;
  background: rgba(8, 12, 20, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-style: italic;
  letter-spacing: 0.03em;
  color: rgba(237, 232, 223, 0.88);
}

.panel-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

/* ── Sidebar ── */

.sidebar {
  padding-bottom: 14px;
}

.main {
  padding-bottom: 0;
}

.meta {
  padding: 14px 18px;
  display: grid;
  gap: 8px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(5, 8, 14, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

.meta-key {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.meta-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-secondary);
}

.panel-note {
  padding: 14px 18px;
}

.panel-note-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-style: italic;
  color: var(--color-accent-2);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.panel-note p {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ── Status Panel ── */

.status-panel {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: center;
  padding: 20px 18px;
  margin: 16px;
  border: 1px solid rgba(0, 200, 165, 0.08);
  border-radius: var(--radius-md);
  background: rgba(5, 8, 14, 0.5);
}

.status-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(0, 212, 164, 0.15);
  border-top-color: var(--color-accent);
  border-right-color: var(--color-accent-2);
  border-radius: 50%;
  animation: spin 1.2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(0, 212, 164, 0.08);
}

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

.status-text {
  font-size: 13px;
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.status-panel.success .status-icon {
  color: var(--color-success);
}

.status-panel.success .status-text {
  color: var(--color-success);
}

/* ── Runtime Info ── */

.runtime-info {
  padding: 16px;
}

.runtime-info.hidden {
  display: none;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 200, 165, 0.10), transparent);
  margin: 14px 18px;
}

/* ── Seed & Curl ── */

.meta-val-seed {
  font-size: 10px;
  word-break: break-all;
  max-width: 150px;
  text-align: right;
  cursor: pointer;
  color: var(--color-accent);
  transition: opacity 0.2s;
}

.meta-val-seed:hover {
  opacity: 0.7;
}

.curl-box {
  position: relative;
  background: rgba(5, 8, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  padding-right: 56px;
  overflow-x: auto;
}

.curl-box code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-primary);
  white-space: pre-wrap;
  word-break: break-all;
}

.curl-copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  background: rgba(0, 212, 164, 0.08);
  color: var(--color-accent);
  border: 1px solid rgba(0, 212, 164, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
  text-transform: uppercase;
}

.curl-copy-btn:hover {
  background: rgba(0, 212, 164, 0.18);
}

.curl-copy-btn.copied {
  color: var(--color-success);
  border-color: rgba(52, 211, 153, 0.3);
}

/* ── Challenge Surface ── */

.challenge-surface {
  margin: 16px;
  background: rgba(5, 8, 14, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.surface-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-style: italic;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.surface-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.surface-table th,
.surface-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.surface-table th {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 12px;
  background: rgba(8, 12, 20, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.surface-table td {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-secondary);
}

.surface-table tbody tr {
  transition: background 0.15s;
}

.surface-table tbody tr:hover {
  background: rgba(0, 212, 164, 0.03);
}

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

.code-block {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-secondary);
  background: rgba(5, 8, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
  line-height: 1.5;
}

.surface-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(0, 212, 164, 0.03);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-text-muted);
  border-left: 2px solid rgba(0, 212, 164, 0.4);
}

/* ── Challenge Sections ── */

.challenge-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.challenge-header {
  margin-bottom: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.challenge-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.challenge-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  font-weight: 400;
  color: var(--color-text-primary);
  letter-spacing: 0.01em;
}

.challenge-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
}

.pill {
  font-size: 10px;
  color: var(--color-text-muted);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 12, 20, 0.5);
  padding: 4px 10px;
  font-family: var(--font-mono);
  white-space: nowrap;
  border-radius: var(--radius-xl);
  letter-spacing: 0.03em;
}

.challenge-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.challenge-panel {
  background: rgba(12, 16, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color 0.2s;
}

.challenge-panel:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

/* ── System Bar (themed challenge headers) ── */

.system-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: rgba(6, 10, 18, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.system-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--theme-accent);
  box-shadow: 0 0 8px var(--theme-glow);
  flex-shrink: 0;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

.system-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--theme-accent);
}

.system-version {
  font-size: 11px;
  color: var(--color-text-muted);
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.system-body {
  padding: 16px;
}

/* ── Challenge Themes — SDG 1 ── */

[data-theme="aid"] { --theme-accent: #d4a03a; --theme-glow: rgba(212, 160, 58, 0.15); --theme-surface: rgba(212, 160, 58, 0.04); }
[data-theme="poverty-data"] { --theme-accent: #6b8aed; --theme-glow: rgba(107, 138, 237, 0.15); --theme-surface: rgba(107, 138, 237, 0.04); }
[data-theme="microfinance"] { --theme-accent: #2dd89a; --theme-glow: rgba(45, 216, 154, 0.15); --theme-surface: rgba(45, 216, 154, 0.04); }
[data-theme="welfare"] { --theme-accent: #e87da0; --theme-glow: rgba(232, 125, 160, 0.15); --theme-surface: rgba(232, 125, 160, 0.04); }
[data-theme="housing"] { --theme-accent: #22c5a5; --theme-glow: rgba(34, 197, 165, 0.15); --theme-surface: rgba(34, 197, 165, 0.04); }
[data-theme="food-bank"] { --theme-accent: #e89040; --theme-glow: rgba(232, 144, 64, 0.15); --theme-surface: rgba(232, 144, 64, 0.04); }
[data-theme="benefits"] { --theme-accent: #818cf8; --theme-glow: rgba(129, 140, 248, 0.15); --theme-surface: rgba(129, 140, 248, 0.04); }
[data-theme="survey"] { --theme-accent: #b07ce8; --theme-glow: rgba(176, 124, 232, 0.15); --theme-surface: rgba(176, 124, 232, 0.04); }
[data-theme="grant"] { --theme-accent: #e85555; --theme-glow: rgba(232, 85, 85, 0.15); --theme-surface: rgba(232, 85, 85, 0.04); }
[data-theme="xor"] { --theme-accent: #38b5f0; --theme-glow: rgba(56, 181, 240, 0.15); --theme-surface: rgba(56, 181, 240, 0.04); }

/* ── Stat Cards (for dashboard challenges) ── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.stat-card {
  background: rgba(5, 8, 14, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 12px;
  transition: border-color 0.2s;
}

.stat-card:hover {
  border-color: var(--theme-glow);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--theme-accent);
}

.stat-unit {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-left: 2px;
  font-weight: 400;
}

/* ── Chat Area (for chatbot challenges) ── */

.chat-area {
  height: 300px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(5, 8, 14, 0.5);
  border-radius: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.chat-area::-webkit-scrollbar {
  width: 4px;
}

.chat-area::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(8, 12, 20, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
  border-radius: var(--radius-lg);
  animation: fadeIn 0.2s ease;
}

.chat-bubble-user {
  align-self: flex-end;
  background: rgba(var(--theme-accent-rgb, 0, 212, 164), 0.1);
  color: var(--color-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom-right-radius: 4px;
}

.chat-bubble-ai {
  align-self: flex-start;
  background: rgba(18, 24, 38, 0.8);
  color: var(--color-text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom-left-radius: 4px;
}

/* ── Hex Display (for crypto challenges) ── */

.hex-display {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 12px;
  background: rgba(5, 8, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  color: var(--theme-accent);
  word-break: break-all;
  line-height: 1.6;
  letter-spacing: 0.05em;
}

.hex-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

/* ── Fields & Inputs ── */

.field {
  margin-bottom: 12px;
}

.label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.input {
  width: 100%;
  background: rgba(5, 8, 14, 0.5);
  color: var(--color-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
  border-color: rgba(0, 212, 164, 0.4);
  box-shadow: 0 0 0 3px rgba(0, 212, 164, 0.08), 0 0 16px rgba(0, 212, 164, 0.04);
}

.input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(140,134,124,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.help {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.help code {
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
  background: rgba(255,255,255,0.04);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}

/* ── Buttons ── */

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

.button {
  border: 1px solid rgba(0, 212, 164, 0.2);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(0, 212, 164, 0.12), rgba(212, 160, 58, 0.06));
  color: var(--color-text-primary);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s;
}

.button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 212, 164, 0.08), rgba(212, 160, 58, 0.04));
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: inherit;
}

.button:hover {
  border-color: rgba(0, 212, 164, 0.35);
  box-shadow: 0 0 20px rgba(0, 212, 164, 0.08);
  transform: translateY(-1px);
}

.button:hover::before {
  opacity: 1;
}

.button:active {
  transform: translateY(0);
}

.button.secondary {
  background: rgba(12, 16, 26, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

.button.secondary:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.03);
}

.button.secondary::before {
  background: rgba(255, 255, 255, 0.02);
}

/* Themed buttons */
.button.themed {
  border-color: rgba(var(--theme-accent-rgb, 0, 212, 164), 0.2);
  background: linear-gradient(135deg, var(--theme-surface), transparent);
}

.button.themed:hover {
  border-color: rgba(var(--theme-accent-rgb, 0, 212, 164), 0.35);
  box-shadow: 0 0 20px var(--theme-glow);
}

/* ── Output & Flag ── */

.output {
  background: rgba(5, 8, 14, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  min-height: 44px;
  display: flex;
  align-items: center;
  white-space: pre-wrap;
  transition: border-color 0.2s, background 0.2s;
}

.output.ok {
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--color-success);
  background: var(--color-success-bg);
}

.output.bad {
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--color-error);
  background: var(--color-error-bg);
}

.flag {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(212, 160, 58, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(212, 160, 58, 0.04);
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  word-break: break-word;
  user-select: all;
  box-shadow: 0 0 20px rgba(212, 160, 58, 0.06);
}

/* ── Hints ── */

.hints-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(5, 8, 14, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 16px;
}

.hint-header {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hint-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hint-item {
  position: relative;
  background: rgba(5, 8, 14, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 12px;
  transition: all 0.3s ease;
}

.hint-item.locked {
  opacity: 0.5;
  pointer-events: none;
}

.hint-item.visible {
  border-color: rgba(0, 212, 164, 0.12);
  background: rgba(0, 212, 164, 0.03);
}

.hint-content {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.hint-blur {
  filter: blur(5px);
  user-select: none;
  opacity: 0.4;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.hint-reveal-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 20, 0.5);
  cursor: pointer;
  border: none;
  border-radius: inherit;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  z-index: 2;
  transition: background 0.2s;
}

.hint-reveal-btn:hover {
  background: rgba(8, 12, 20, 0.3);
  color: var(--color-text-primary);
}

/* ── SDG Poster ── */

.sdg-tag {
  display: inline-block;
  margin-bottom: 10px;
}

.sdg-poster {
  background: rgba(5, 8, 14, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 16px;
}

.sdg-poster-row {
  display: block;
}

.sdg-poster-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
}

.sdg-poster-title {
  margin: 0 0 6px 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  font-weight: 400;
  color: var(--color-text-primary);
}

.sdg-poster-text {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.sdg-poster-divider {
  margin: 14px 0;
}

.sdg-poster-note {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ── Error Panel ── */

.error-panel {
  padding: 24px 18px;
  margin: 16px;
  background: rgba(5, 8, 14, 0.5);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-md);
  text-align: center;
}

.error-panel.hidden {
  display: none;
}

.error-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--color-error);
}

.error-icon svg {
  width: 100%;
  height: 100%;
}

.error-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
  color: var(--color-error);
  margin-bottom: 8px;
}

.error-message {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  padding: 12px;
  background: var(--color-error-bg);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.error-hint {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ── Footer ── */

.runtime-footer {
  padding: 12px 18px;
  margin: 16px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  background: rgba(5, 8, 14, 0.3);
}

.runtime-footer p {
  font-size: 11px;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  text-align: center;
}

/* ── Region Cards (Aid Distribution) ── */

.region-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(5, 8, 14, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

.region-card:hover {
  border-color: var(--theme-glow);
}

.region-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.region-dot.active {
  background: var(--color-success);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
}

.region-dot.suspended {
  background: var(--color-warning);
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.3);
}

.region-info {
  flex: 1;
  min-width: 0;
}

.region-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.region-detail {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ── Dataset Cards (Poverty Data Portal) ── */

.dataset-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dataset-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(5, 8, 14, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

.dataset-card:hover {
  border-color: rgba(107, 138, 237, 0.15);
}

.dataset-name {
  font-size: 13px;
  color: var(--color-text-primary);
  font-weight: 500;
}

.dataset-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-xl);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge.active {
  color: var(--color-success);
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.status-badge.archived {
  color: var(--color-warning);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.15);
}

.status-badge.system {
  color: var(--color-accent-3);
  background: rgba(200, 94, 126, 0.08);
  border: 1px solid rgba(200, 94, 126, 0.15);
}

.status-badge.suspended {
  color: var(--color-error);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.15);
}

/* ── Calc Display (Microfinance) ── */

.calc-display {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--theme-accent);
  text-align: center;
  padding: 20px;
  background: rgba(5, 8, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  letter-spacing: 0.02em;
  text-shadow: 0 0 20px var(--theme-glow);
}

.calc-display.overflow {
  color: var(--color-error);
  text-shadow: 0 0 20px rgba(248, 113, 113, 0.3);
  animation: flash 0.5s ease;
}

@keyframes flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Beneficiary Cards (Benefits Portal) ── */

.beneficiary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.beneficiary-card {
  padding: 12px;
  background: rgba(5, 8, 14, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
  cursor: default;
}

.beneficiary-card:hover {
  border-color: rgba(129, 140, 248, 0.15);
}

.beneficiary-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.beneficiary-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
}

.beneficiary-program {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 6px;
}

/* ── Proxy Log (Grant Gateway) ── */

.proxy-log {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 8px 12px;
  background: rgba(5, 8, 14, 0.5);
  border-left: 2px solid var(--theme-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.arch-node {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-secondary);
  background: rgba(5, 8, 14, 0.4);
}

.arch-node.internal {
  border-color: rgba(232, 85, 85, 0.15);
  color: var(--color-error);
}

.arch-node.public {
  border-color: rgba(0, 212, 164, 0.15);
  color: var(--color-accent);
}

/* ── Utility ── */

.hidden {
  display: none !important;
}

.hidden-proof {
  display: none;
  visibility: hidden;
  opacity: 0;
  font-size: 0;
  color: transparent;
}

.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.font-bold { font-weight: 600; }
.gap-sm { gap: 8px; }

/* ── Responsive ── */

@media (max-width: 768px) {
  .shell {
    padding: 12px;
  }

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

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .topbar-right {
    width: 100%;
    justify-content: flex-start;
  }

  .challenge-title {
    font-size: 18px;
  }

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

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

  .calc-display {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Reduced Motion ── */

@media (prefers-reduced-motion: reduce) {
  .bg-organic::before,
  .bg-organic::after {
    animation: none;
  }

  .panel {
    animation: none;
  }

  .spinner {
    animation: none;
  }

  .system-dot {
    animation: none;
    opacity: 1;
  }

  .button,
  .button::before {
    transition: none;
  }

  .challenge-section {
    animation: none;
  }

  .chat-bubble {
    animation: none;
  }

  .calc-display.overflow {
    animation: none;
  }
}

/* ==========================================================================
   2026 FIELD CONSOLE REDESIGN
   A purpose-built, tactile interface for investigation work. This layer
   deliberately replaces glass cards, glow effects, pill-heavy styling and
   decorative gradient blobs with matte materials and field-note structure.
   ========================================================================== */

:root {
  --color-bg: #101611;
  --color-surface: #182019;
  --color-surface-elevated: #202a21;
  --color-border: #435044;
  --color-border-hover: #71806f;
  --color-text-primary: #f1eddd;
  --color-text-secondary: #c7c9ba;
  --color-text-muted: #899486;
  --color-accent: #d8e66a;
  --color-accent-glow: rgba(216, 230, 106, 0.12);
  --color-accent-2: #f07a3f;
  --color-accent-3: #d98691;
  --color-success: #bddc75;
  --color-success-bg: #25351e;
  --color-error: #ff8d78;
  --color-error-bg: #3a211e;
  --color-warning: #efbc56;
  --radius-sm: 1px;
  --radius-md: 2px;
  --radius-lg: 2px;
  --radius-xl: 2px;
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Atkinson Hyperlegible', Verdana, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --font-sans: var(--font-body);
  --shadow-glow: 5px 5px 0 #080b08;
  --shadow-elevated: 7px 7px 0 #080b08;
  --theme-accent: var(--color-accent);
  --theme-glow: rgba(216, 230, 106, 0.12);
  --theme-surface: #20291e;
}

html {
  background: var(--color-bg);
  scrollbar-color: #6f7d6e #111712;
  scrollbar-width: thin;
}

body {
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.52;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  border: 6px solid #0a0d0a;
}

::selection {
  color: #101610;
  background: var(--color-accent);
}

button,
input,
select {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.bg-organic {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  opacity: 0.62;
  background-color: #101611;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='260' viewBox='0 0 360 260'%3E%3Cg fill='none' stroke='%23374436' stroke-width='1' opacity='.55'%3E%3Cpath d='M-30 61C31 18 86 25 115 61s76 41 117 7 89-33 158 10'/%3E%3Cpath d='M-42 83c65-51 132-47 164-6s77 46 118 9 91-38 157 6'/%3E%3Cpath d='M-27 108c51-46 123-48 160-7s80 47 120 13 84-43 141-17'/%3E%3Cpath d='M-38 184c51-35 94-28 126 4s82 38 137 3 106-34 166 3'/%3E%3Cpath d='M-25 209c51-36 101-34 135 0s81 38 132 3 100-36 153-3'/%3E%3C/g%3E%3Cg stroke='%23d8e66a' opacity='.13'%3E%3Cpath d='M22 18h11M27.5 12.5v11M315 226h15M322.5 218.5v15'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 360px 260px;
}

.bg-organic::before {
  width: 8px;
  height: 132px;
  top: 88px;
  left: 0;
  border-radius: 0;
  filter: none;
  background: var(--color-accent-2);
  animation: none;
}

.bg-organic::after {
  width: 72px;
  height: 72px;
  right: 28px;
  bottom: 22px;
  border: 1px solid #536053;
  border-radius: 50%;
  filter: none;
  background: transparent;
  animation: none;
  box-shadow: inset 0 0 0 8px #101611, inset 0 0 0 9px #536053;
}

.bg-grain,
.bg-grid,
.bg-scanlines {
  display: none;
}

.shell {
  width: min(1500px, calc(100% - 56px));
  max-width: none;
  min-height: 100%;
  margin: 0 auto;
  padding: 34px 0 42px;
}

.topbar {
  min-height: 82px;
  padding: 14px 18px 14px 16px;
  border: 2px solid #111711;
  border-bottom-color: #303a30;
  border-radius: 0;
  background: #e9e4d2;
  color: #152016;
  box-shadow: 6px 6px 0 #080b08;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: relative;
}

.topbar::after {
  content: 'FIELD UNIT  /  26.09';
  position: absolute;
  left: 76px;
  bottom: -9px;
  padding: 1px 7px 2px;
  background: var(--color-accent-2);
  color: #131812;
  font: 600 9px/1.3 var(--font-mono);
  letter-spacing: .08em;
}

.brand {
  gap: 14px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  padding: 5px;
  color: #182219;
  filter: none;
  border: 1px solid #182219;
  transform: rotate(-1.5deg);
}

.brand-title {
  color: #152016;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.3vw, 34px);
  font-style: normal;
  font-weight: 700;
  line-height: .92;
  letter-spacing: .015em;
  text-transform: uppercase;
}

.brand-sub {
  margin-top: 7px;
  color: #4d584d;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .085em;
}

.topbar-right {
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #344034;
  border-radius: 0;
  background: transparent;
  color: #344034;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
}

.chip-index {
  color: #70796e;
}

.chip-accent {
  border-color: #1c271d;
  background: #1c271d;
  color: #f1eddd;
}

.status-light {
  width: 7px;
  height: 7px;
  background: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(216, 230, 106, .18);
}

.grid {
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 20px;
  margin-top: 22px;
}

.panel {
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-surface);
  box-shadow: var(--shadow-glow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
  animation: none;
}

.sidebar {
  position: sticky;
  top: 20px;
  padding-bottom: 8px;
}

.panel-header {
  min-height: 48px;
  padding: 11px 14px;
  background: #263127;
  border-bottom: 1px solid #515e51;
  align-items: center;
  position: relative;
}

.panel-header::after {
  content: '';
  position: absolute;
  right: 12px;
  bottom: -4px;
  width: 22px;
  height: 7px;
  background: var(--color-accent-2);
}

.panel-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  color: var(--color-text-primary);
  font-family: var(--font-display);
  font-size: 18px;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.panel-title span {
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 9px;
}

.panel-kicker {
  color: #8d998c;
  font-size: 9px;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.meta {
  padding: 16px 14px 8px;
}

.meta-row {
  display: block;
  padding: 11px 10px;
  border: 0;
  border-left: 3px solid var(--color-accent);
  border-radius: 0;
  background: #111712;
}

.meta-key {
  margin-bottom: 7px;
  color: var(--color-accent);
  font-size: 9px;
}

.meta-val,
.meta-val-seed {
  display: block;
  max-width: none;
  text-align: left;
  color: var(--color-text-secondary);
  font-size: 10px;
}

.divider {
  height: 0;
  margin: 12px 14px;
  border-top: 1px dashed #4c584c;
  background: none;
}

.panel-note {
  padding: 10px 14px 14px;
}

.panel-note-title {
  margin-bottom: 8px;
  color: var(--color-accent-2);
  font-family: var(--font-display);
  font-size: 16px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.panel-note p {
  color: #a9b0a3;
  font-size: 12px;
  line-height: 1.55;
}

.curl-box {
  padding: 11px 58px 11px 10px;
  border: 1px solid #455145;
  border-radius: 0;
  background: #0e130f;
}

.curl-box code {
  color: #d6d9ca;
  font-size: 10px;
}

.curl-copy-btn {
  top: 7px;
  right: 7px;
  padding: 4px 7px;
  border: 1px solid #6b786a;
  border-radius: 0;
  background: transparent;
  color: var(--color-accent);
}

.curl-copy-btn:hover,
.curl-copy-btn.copied {
  background: var(--color-accent);
  color: #131813;
}

.status-panel {
  grid-template-columns: 64px 1fr;
  gap: 16px;
  min-height: 118px;
  margin: 20px;
  padding: 22px;
  border: 1px solid #536053;
  border-left: 5px solid var(--color-accent);
  border-radius: 0;
  background: #121813;
}

.status-icon {
  width: 52px;
  height: 52px;
  border: 1px solid #596559;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 2px solid #4a554a;
  border-top-color: var(--color-accent);
  border-right-color: var(--color-accent);
  border-radius: 50%;
  box-shadow: none;
  animation: spin .8s steps(8) infinite;
}

.status-text {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.status-sub {
  color: var(--color-text-muted);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.runtime-info {
  padding: 0;
}

.challenge-surface {
  margin: 0;
  padding: clamp(18px, 3vw, 36px);
  border: 0;
  border-radius: 0;
  background: transparent;
  gap: 24px;
}

.challenge-section {
  gap: 18px;
  animation: field-entry .36s cubic-bezier(.2,.75,.2,1) both;
}

@keyframes field-entry {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.challenge-header {
  margin: 0 0 5px;
  padding: 2px 0 20px;
  border-bottom: 1px solid #566256;
  position: relative;
}

.challenge-header::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 88px;
  height: 3px;
  background: var(--theme-accent);
}

.challenge-title-row {
  align-items: flex-end;
  margin-bottom: 8px;
}

.challenge-title {
  max-width: 760px;
  color: #f2efdf;
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 58px);
  font-style: normal;
  font-weight: 700;
  line-height: .92;
  letter-spacing: -.015em;
  text-transform: uppercase;
}

.challenge-subtitle {
  color: #aeb6a9;
  font-size: 14px;
}

.pill {
  padding: 5px 7px;
  border: 1px solid #657165;
  border-radius: 0;
  background: transparent;
  color: #b5beaf;
  font-size: 9px;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.challenge-grid {
  gap: 14px;
}

.challenge-panel,
.hints-section,
.sdg-poster,
.stat-card,
.region-card,
.dataset-card,
.beneficiary-card {
  border: 1px solid #455245;
  border-radius: 0;
  background: #1c251d;
  box-shadow: none;
}

.challenge-panel {
  padding: 18px;
  transition: border-color .12s ease, transform .12s ease;
}

.challenge-panel:hover {
  border-color: #697668;
}

.challenge-panel:nth-of-type(even) {
  background: #1a221b;
}

.text-xl,
.text-lg,
.sdg-poster-title,
.error-title {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 600;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.text-lg {
  color: #ebeadc;
  font-size: 18px;
}

.text-base {
  font-size: 14px;
}

.system-bar {
  padding: 10px 14px;
  border-bottom: 1px solid #526052;
  border-radius: 0;
  background: #121813;
}

.system-dot {
  width: 8px;
  height: 8px;
  border-radius: 0;
  box-shadow: none;
  animation: none;
  transform: rotate(45deg);
}

.system-name {
  font-size: 11px;
  letter-spacing: .1em;
}

.system-body {
  padding: 18px;
}

.surface-table {
  border: 1px solid #465246;
  border-radius: 0;
}

.surface-table th,
.surface-table td {
  padding: 9px 11px;
  border-right: 1px solid #354035;
  border-bottom: 1px solid #354035;
}

.surface-table th:last-child,
.surface-table td:last-child {
  border-right: 0;
}

.surface-table th {
  background: #111712;
  color: #aab3a7;
  font: 600 10px/1.4 var(--font-mono);
  letter-spacing: .08em;
}

.surface-table td {
  color: #d1d3c5;
  font-size: 12px;
}

.surface-table tbody tr:hover {
  background: #242e23;
}

.code-block,
.hex-display,
.output,
.chat-area,
.calc-display {
  border: 1px solid #455145;
  border-radius: 0;
  background: #0f1410;
  box-shadow: inset 4px 0 0 #283329;
}

.code-block {
  color: #cdd1c5;
  padding: 14px;
}

.surface-note {
  margin-top: 12px;
  padding: 10px 12px;
  border: 0;
  border-left: 3px solid var(--theme-accent);
  border-radius: 0;
  background: #151c16;
  color: #9ca698;
}

.stat-grid {
  gap: 8px;
}

.stat-card {
  border-top: 3px solid var(--theme-accent);
  padding: 12px;
}

.stat-value {
  font-size: 21px;
}

.field {
  margin-bottom: 14px;
}

.label {
  margin-bottom: 6px;
  color: #aab3a7;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.input {
  min-height: 43px;
  padding: 10px 11px;
  border: 1px solid #596659;
  border-radius: 0;
  background-color: #101510;
  color: #f0edde;
}

.input:hover {
  border-color: #7e8b7c;
}

.input:focus {
  border-color: var(--color-accent);
  box-shadow: inset 4px 0 0 var(--color-accent);
}

.input::placeholder {
  color: #738071;
  opacity: 1;
}

.help code {
  border-radius: 0;
  background: #101510;
}

.actions {
  gap: 8px;
}

.button {
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid #f28a52;
  border-radius: 0;
  background: var(--color-accent-2);
  color: #141913;
  box-shadow: 3px 3px 0 #090c09;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .055em;
  text-transform: uppercase;
  transition: transform .1s ease, box-shadow .1s ease, background .1s ease;
}

.button::before {
  display: none;
}

.button:hover,
.button.themed:hover {
  border-color: #f4a077;
  background: #f38b56;
  box-shadow: 1px 1px 0 #090c09;
  transform: translate(2px, 2px);
}

.button:active {
  box-shadow: none;
  transform: translate(3px, 3px);
}

.button.secondary {
  border-color: #687568;
  background: transparent;
  color: #d7d8cb;
}

.button.secondary:hover {
  border-color: var(--color-accent);
  background: #273127;
  box-shadow: 1px 1px 0 #090c09;
}

.button.themed {
  border-color: #d4e265;
  background: var(--theme-accent);
  color: #111611;
}

.output {
  min-height: 48px;
  color: #8e9a8c;
}

.output.ok {
  border-color: var(--color-success);
  background: var(--color-success-bg);
  box-shadow: inset 4px 0 0 var(--color-success);
}

.output.bad {
  border-color: var(--color-error);
  background: var(--color-error-bg);
  box-shadow: inset 4px 0 0 var(--color-error);
}

.flag {
  border: 1px solid var(--color-warning);
  border-radius: 0;
  background: #312a18;
  box-shadow: 4px 4px 0 #080b08;
}

.hints-section {
  gap: 8px;
  padding: 0;
  overflow: hidden;
}

.hint-header {
  padding: 11px 14px;
  border-bottom: 1px solid #4a574a;
  background: #111712;
  color: var(--color-accent);
  font-size: 10px;
}

.hint-list {
  gap: 0;
  padding: 0 14px 14px;
}

.hint-item {
  min-height: 48px;
  padding: 13px 12px;
  border: 0;
  border-bottom: 1px dashed #4c594c;
  border-radius: 0;
  background: transparent;
}

.hint-item.visible {
  border-color: #667365;
  background: #232c22;
}

.hint-reveal-btn {
  justify-content: flex-start;
  padding-left: 13px;
  border-radius: 0;
  background: #1c241c;
  color: var(--color-accent);
  text-align: left;
}

.hint-reveal-btn:hover {
  background: #283127;
}

.hint-blur {
  filter: blur(4px);
}

.chat-area {
  padding: 14px;
}

.chat-input-row {
  border-radius: 0;
  background: #151c16;
}

.chat-bubble {
  border-radius: 0;
  animation: none;
}

.chat-bubble-user {
  border-left: 3px solid var(--theme-accent);
  background: #253024;
}

.chat-bubble-ai {
  border-left: 3px solid #6f7c6e;
  background: #151c16;
}

.sdg-poster {
  border-left: 4px solid var(--theme-accent);
}

.sdg-poster-title {
  font-size: 26px;
}

.region-card,
.dataset-card,
.beneficiary-card {
  transition: border-color .12s ease, transform .12s ease;
}

.region-card:hover,
.dataset-card:hover,
.beneficiary-card:hover {
  border-color: #768375;
  transform: translateX(2px);
}

.region-dot {
  border-radius: 0;
  transform: rotate(45deg);
  box-shadow: none !important;
}

.status-badge,
.arch-node {
  border-radius: 0;
}

.calc-display {
  text-shadow: none;
}

.calc-display.overflow {
  text-shadow: none;
}

.proxy-log {
  border-radius: 0;
  background: #111712;
}

.error-panel {
  margin: 20px;
  padding: 34px 24px;
  border: 1px solid var(--color-error);
  border-left: 5px solid var(--color-error);
  border-radius: 0;
  background: #1d1715;
  text-align: left;
}

.error-icon {
  width: 34px;
  height: 34px;
  margin: 0 0 16px;
}

.error-title {
  font-size: 28px;
}

.error-message {
  border-radius: 0;
  background: #2c1b19;
}

.runtime-footer {
  margin: 8px 20px 20px;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid #435043;
  border-radius: 0;
  background: transparent;
}

.runtime-footer p {
  color: #768274;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .07em;
  text-align: left;
  text-transform: uppercase;
}

.runtime-footer p span {
  color: var(--color-accent-2);
}

/* Bring the many challenge-specific inline mastheads into the same material. */
.challenge-panel > div[style*="background:#1a2332"] {
  background: #111712 !important;
  border-bottom-color: #4b574b !important;
}

.challenge-panel [style*="color:#607080"] {
  color: #879285 !important;
}

@media (min-width: 980px) {
  .challenge-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  }
}

@media (max-width: 900px) {
  .shell {
    width: min(100% - 28px, 760px);
    padding-top: 20px;
  }

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

  .panel,
  .sidebar,
  .main {
    min-width: 0;
  }

  .sidebar {
    position: static;
  }

  .topbar {
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  body::after {
    border-width: 3px;
  }

  .shell {
    width: calc(100% - 20px);
    padding: 12px 0 24px;
  }

  .topbar {
    padding: 14px;
  }

  .brand-title {
    font-size: 25px;
  }

  .brand-sub {
    max-width: 220px;
  }

  .topbar-right {
    margin-top: 8px;
  }

  .chip {
    flex: 1;
    justify-content: center;
  }

  .panel-header {
    align-items: flex-start;
  }

  .panel-kicker {
    max-width: 128px;
    text-align: right;
  }

  .challenge-surface {
    padding: 22px 15px;
  }

  .challenge-title-row {
    align-items: flex-start;
    flex-direction: column-reverse;
  }

  .challenge-title {
    font-size: 38px;
  }

  .pill {
    white-space: normal;
  }

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

  .surface-table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 380px) {
  .brand-icon {
    display: none;
  }

  .brand-title {
    font-size: 23px;
  }

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

@media (prefers-reduced-motion: reduce) {
  .challenge-section,
  .button,
  .region-card,
  .dataset-card,
  .beneficiary-card {
    animation: none;
    transition: none;
  }
}

/* ==========================================================================
   OPERATOR TERMINAL THEME
   The runtime is a working console, not a marketing dashboard. SDG colours
   appear as track signals while the primary visual language stays technical.
   ========================================================================== */

:root {
  --color-bg: #020705;
  --color-surface: #07110c;
  --color-surface-elevated: #0a1710;
  --color-border: #1b4a32;
  --color-border-hover: #42a66c;
  --color-text-primary: #c8f7d6;
  --color-text-secondary: #96c9a6;
  --color-text-muted: #598269;
  --color-accent: #72f59e;
  --color-accent-glow: rgba(114, 245, 158, .12);
  --color-accent-2: #53d6ed;
  --color-accent-3: #e86a8a;
  --color-success: #72f59e;
  --color-success-bg: #092014;
  --color-error: #ff6b76;
  --color-error-bg: #26090d;
  --color-warning: #ffca58;
  --font-display: 'IBM Plex Mono', 'Courier New', monospace;
  --font-body: 'IBM Plex Mono', 'Courier New', monospace;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --shadow-glow: none;
  --shadow-elevated: none;
  --theme-accent: var(--color-accent);
  --theme-glow: rgba(114, 245, 158, .12);
  --theme-surface: #0b1a11;
}

html,
body {
  background: var(--color-bg);
}

body {
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  text-shadow: 0 0 12px rgba(114, 245, 158, .045);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: .055;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, #9dfeb9 4px);
}

body::after {
  border: 1px solid #17402b;
}

.bg-organic {
  opacity: 1;
  background-color: #020705;
  background-image:
    linear-gradient(rgba(52, 143, 91, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 143, 91, .07) 1px, transparent 1px);
  background-size: 32px 32px;
}

.bg-organic::before {
  width: 1px;
  height: 100%;
  top: 0;
  left: 23px;
  background: rgba(83, 214, 237, .28);
}

.bg-organic::after {
  width: 280px;
  height: 280px;
  right: -90px;
  bottom: -90px;
  border: 1px solid rgba(114, 245, 158, .12);
  box-shadow:
    inset 0 0 0 24px #020705,
    inset 0 0 0 25px rgba(83, 214, 237, .11),
    inset 0 0 0 64px #020705,
    inset 0 0 0 65px rgba(114, 245, 158, .1);
}

::selection {
  color: #020705;
  background: var(--color-accent);
  text-shadow: none;
}

.shell {
  width: min(1560px, calc(100% - 44px));
  padding: 22px 0 34px;
}

.topbar {
  min-height: 72px;
  padding: 13px 16px;
  border: 1px solid #287247;
  border-radius: 0;
  background: #06100b;
  color: var(--color-text-primary);
  box-shadow: inset 0 1px 0 rgba(114, 245, 158, .08);
}

.topbar::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--color-accent);
}

.topbar::after {
  content: 'TTY0  //  SECURE SESSION  //  UTF-8';
  left: auto;
  right: 14px;
  bottom: -9px;
  padding: 1px 7px;
  border: 1px solid #225f3d;
  background: #020705;
  color: #65aa7d;
  font: 500 8px/1.5 var(--font-mono);
  letter-spacing: .1em;
}

.brand-icon {
  width: 40px;
  height: 40px;
  padding: 3px;
  border: 1px solid #2d7a4b;
  color: var(--color-accent);
  transform: none;
}

.brand-title {
  color: #8fffb3;
  font: 500 clamp(14px, 1.7vw, 20px)/1.2 var(--font-mono);
  letter-spacing: -.025em;
  text-transform: none;
}

.brand-title span {
  color: var(--color-accent-2);
}

.brand-title strong {
  color: #effff3;
  font-weight: 600;
}

.brand-sub {
  margin-top: 4px;
  color: #56896a;
  font-size: 9px;
  letter-spacing: .12em;
}

.topbar-right {
  gap: 7px;
}

.sdg-signals {
  display: flex;
  align-items: stretch;
  height: 28px;
  padding: 4px;
  border: 1px solid #1c5034;
  gap: 3px;
}

.sdg-signals i {
  display: block;
  width: 5px;
}

.sdg-signals .sdg-1 { background: #e5243b; }
.sdg-signals .sdg-3 { background: #4c9f38; }
.sdg-signals .sdg-7 { background: #fcc30b; }
.sdg-signals .sdg-16 { background: #00689d; }

.chip {
  min-height: 28px;
  padding: 5px 8px;
  border-color: #225e3d;
  background: #040b07;
  color: #76aa87;
  font-size: 9px;
  text-transform: lowercase;
}

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

.chip-accent {
  border-color: #2f7d4e;
  background: #07150d;
  color: var(--color-accent);
}

.status-light {
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  box-shadow: 0 0 8px rgba(114, 245, 158, .7);
  animation: terminal-blink 1.3s steps(1) infinite;
}

@keyframes terminal-blink {
  50% { opacity: .25; }
}

.grid {
  grid-template-columns: 318px minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.panel {
  border-color: #1b4a32;
  background: rgba(4, 12, 8, .96);
  box-shadow: none;
  overflow: hidden;
}

.sidebar {
  top: 12px;
}

.panel-header {
  min-height: 39px;
  padding: 8px 11px;
  border-bottom-color: #1c5035;
  background: #0a1b11;
}

.panel-header::before {
  content: '[';
  margin-right: -4px;
  color: #477f59;
}

.panel-header::after {
  content: ']';
  position: static;
  width: auto;
  height: auto;
  margin-left: -4px;
  background: transparent;
  color: #477f59;
  font-size: 12px;
}

.panel-title {
  gap: 7px;
  color: #b5f5c7;
  font: 500 12px/1 var(--font-mono);
  letter-spacing: .035em;
  text-transform: lowercase;
}

.panel-title span {
  color: var(--color-accent-2);
  font-size: 9px;
}

.panel-kicker {
  margin-left: auto;
  color: #467259;
  font-size: 8px;
}

.meta {
  padding: 12px 11px 5px;
}

.meta-row {
  padding: 10px;
  border-left: 1px solid var(--color-accent-2);
  background: #020805;
}

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

.meta-key::before {
  content: 'export ';
  color: #416c51;
}

.meta-val,
.meta-val-seed {
  color: #92caa2;
}

.divider {
  margin: 10px 11px;
  border-top: 1px dashed #1e5136;
}

.panel-note {
  padding: 9px 11px 13px;
}

.panel-note-title {
  color: var(--color-accent-2);
  font: 500 11px/1.3 var(--font-mono);
  letter-spacing: .04em;
  text-transform: none;
}

.panel-note-title::before {
  content: '$ cat ';
  color: #4e7d5f;
}

.panel-note p {
  color: #6f9b7d;
  font-size: 10px;
  line-height: 1.75;
}

.panel-note code {
  color: var(--color-warning);
}

.curl-box {
  padding: 10px 58px 10px 10px;
  border-color: #21603d;
  background: #010503;
}

.curl-box::before {
  content: '$ ';
  color: var(--color-accent);
}

.curl-box code {
  color: #a7dcb6;
  font-size: 9px;
}

.curl-copy-btn {
  border-color: #2d7a4a;
  color: #78cf94;
  background: #06100a;
}

.curl-copy-btn:hover,
.curl-copy-btn.copied {
  background: var(--color-accent);
  color: #020705;
}

.status-panel {
  margin: 16px;
  border-color: #215f3d;
  border-left: 2px solid var(--color-accent-2);
  background: #020805;
}

.status-icon {
  border-color: #2b7448;
}

.spinner {
  border-color: #143a25;
  border-top-color: var(--color-accent);
  border-right-color: var(--color-accent-2);
}

.status-text {
  color: #b9f7cb;
  font: 500 14px/1.3 var(--font-mono);
  letter-spacing: .02em;
  text-transform: lowercase;
}

.status-text::before {
  content: '> ';
  color: var(--color-accent);
}

.status-sub {
  color: #4e805f;
}

.challenge-surface {
  padding: clamp(14px, 2.4vw, 28px);
}

.terminal-command-line {
  margin: -2px 0 16px;
  padding: 8px 10px;
  border: 1px solid #173e2b;
  background: #020704;
  color: #6ea582;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.terminal-command-line span {
  color: var(--color-accent-2);
}

.terminal-command-line b {
  color: #89be99;
  font-weight: 400;
}

.terminal-command-line i {
  color: var(--color-accent);
  font-style: normal;
  animation: terminal-blink 1.1s steps(1) infinite;
}

.challenge-header {
  padding: 12px 0 18px 16px;
  border-bottom-color: #20543a;
  border-left: 1px solid var(--theme-accent);
}

.challenge-header::before {
  content: 'TARGET_DESCRIPTOR';
  display: block;
  margin-bottom: 9px;
  color: #426e53;
  font-size: 8px;
  letter-spacing: .14em;
}

.challenge-header::after {
  width: 96px;
  height: 1px;
  background: var(--theme-accent);
}

.challenge-title {
  color: #d6ffe1;
  font: 600 clamp(22px, 3.3vw, 38px)/1.05 var(--font-mono);
  letter-spacing: -.04em;
  text-transform: none;
}

.challenge-title::before {
  content: './';
  color: var(--theme-accent);
}

.challenge-subtitle {
  color: #66a77c;
  font-size: 10px;
  letter-spacing: .035em;
}

.pill {
  border-color: #276442;
  color: #649b75;
  font-size: 8px;
  text-transform: lowercase;
}

.pill::before {
  content: '[';
}

.pill::after {
  content: ']';
}

.challenge-panel,
.hints-section,
.sdg-poster,
.stat-card,
.region-card,
.dataset-card,
.beneficiary-card {
  border-color: #1b4a32;
  background: #06100a;
}

.challenge-panel,
.challenge-panel:nth-of-type(even) {
  background: #06100a;
}

.challenge-panel {
  padding: 15px;
}

.challenge-panel:hover {
  border-color: #2a6d47;
}

.text-xl,
.text-lg,
.sdg-poster-title,
.error-title {
  color: #b8efc8;
  font-family: var(--font-mono);
  letter-spacing: .025em;
  text-transform: none;
}

.text-lg {
  font-size: 12px;
}

.text-lg::before {
  content: '## ';
  color: var(--theme-accent);
}

.text-base,
.text-secondary {
  color: #81aa8d;
}

.system-bar,
.challenge-panel > div[style*="background:#1a2332"] {
  border-bottom-color: #1f5739 !important;
  background: #030906 !important;
}

.system-dot {
  box-shadow: 0 0 7px var(--theme-accent);
}

.surface-table {
  border-color: #1d5235;
}

.surface-table th,
.surface-table td {
  border-color: #123a25;
}

.surface-table th {
  background: #020704;
  color: #5f9771;
}

.surface-table td {
  color: #96c9a5;
}

.surface-table tbody tr:hover {
  background: #0a1a10;
}

.code-block,
.hex-display,
.output,
.chat-area,
.calc-display {
  border-color: #1d5436;
  background: #010503;
  box-shadow: inset 2px 0 0 #174e31;
  color: #89c29a;
}

.code-block::selection,
.hex-display::selection {
  color: #020705;
  background: var(--color-accent-2);
}

.surface-note {
  border-left-color: var(--theme-accent);
  background: #07140c;
  color: #649174;
}

.surface-note::before {
  content: '// ';
  color: var(--theme-accent);
}

.label {
  color: #5f9770;
}

.label::before {
  content: '> ';
  color: var(--theme-accent);
}

.input {
  border-color: #225d3c;
  background-color: #010503;
  color: #c8f7d6;
  caret-color: var(--color-accent);
}

.input:hover {
  border-color: #368559;
}

.input:focus {
  border-color: var(--color-accent);
  box-shadow: inset 2px 0 0 var(--color-accent);
}

.input::placeholder {
  color: #39634a;
}

.proof-manual-note {
  margin-top: 7px;
  color: #557c63;
  font-size: 9px;
  line-height: 1.55;
}

.proof-manual-note span {
  margin-right: 5px;
  color: var(--color-warning);
}

.proof-manual-note span::before {
  content: '[';
}

.proof-manual-note span::after {
  content: ']';
}

.button,
.button.themed,
.button.secondary {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #2a7549;
  background: #06140c;
  color: #83d99f;
  box-shadow: none;
  font-size: 9px;
  letter-spacing: .045em;
  text-transform: lowercase;
}

.button::before,
.button.themed::before,
.button.secondary::before {
  content: '$ ';
  display: inline;
  position: static;
  background: transparent;
  color: var(--color-accent);
  opacity: 1;
}

.button:hover,
.button.themed:hover,
.button.secondary:hover {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #020705;
  box-shadow: 0 0 16px rgba(114, 245, 158, .12);
  transform: none;
}

.button:hover::before,
.button.themed:hover::before,
.button.secondary:hover::before {
  color: #020705;
}

.button:active {
  transform: translateY(1px);
}

.output {
  min-height: 44px;
  color: #5f8f6f;
}

.output::before {
  content: 'stdout: ';
  color: #3f7352;
}

.output.ok {
  border-color: #2d8150;
  background: #06170d;
  box-shadow: inset 2px 0 0 var(--color-success);
}

.output.bad {
  border-color: #83303a;
  background: #190609;
  box-shadow: inset 2px 0 0 var(--color-error);
}

.output.inspect {
  border-color: #8a6a24;
  background: #181205;
  color: #e3b957;
  box-shadow: inset 2px 0 0 var(--color-warning);
}

.output.inspect::before {
  content: 'stderr[inspect]: ';
  color: var(--color-warning);
}

.flag {
  border-color: var(--color-accent);
  background: #07170d;
  color: #c5ffd5;
  box-shadow: 0 0 18px rgba(114, 245, 158, .08);
}

.flag::before {
  content: 'FLAG => ';
  color: var(--color-accent);
}

.hints-section {
  background: #040c07;
}

.hint-header {
  padding: 10px 12px;
  border-bottom-color: #20573a;
  background: #020704;
  color: var(--color-warning);
  text-transform: lowercase;
}

.hint-policy {
  margin: 0;
  padding: 10px 12px 0;
  color: #53755e;
  font-size: 9px;
}

.hint-policy::before {
  content: '# policy: ';
  color: #6e9d7d;
}

.hint-list {
  padding-top: 8px;
}

.hint-item {
  min-height: 72px;
  border-bottom-color: #1b4b32;
  background: transparent;
}

.hint-item.locked {
  opacity: .35;
}

.hint-item.visible {
  background: #07160d;
}

.hint-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #436c50;
  font-size: 8px;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.hint-meta span:first-child {
  color: #8dad71;
}

.hint-content {
  color: #8dbc99;
  font-size: 11px;
}

.hint-blur {
  position: relative;
  filter: none;
  visibility: hidden;
}

.hint-blur::before {
  content: '[ encrypted hint payload ]';
  visibility: visible;
  color: #2f5940;
}

.hint-reveal-btn {
  top: 27px;
  right: 12px;
  bottom: auto;
  left: auto;
  width: auto;
  height: 30px;
  padding: 5px 9px;
  border: 1px solid #6d632e;
  background: #151204;
  color: var(--color-warning);
  font-size: 8px;
  text-transform: lowercase;
}

.hint-reveal-btn::before {
  content: '$ hintctl --';
  color: #968140;
}

.hint-reveal-btn:hover {
  border-color: var(--color-warning);
  background: var(--color-warning);
  color: #090702;
}

.hint-reveal-btn:hover::before {
  color: #090702;
}

.chat-input-row,
.chat-bubble-ai,
.chat-bubble-user {
  border-color: #1d5035;
  background: #041008;
}

.chat-bubble-user {
  border-left-color: var(--theme-accent);
}

.chat-bubble-ai {
  border-left-color: var(--color-accent-2);
}

.error-panel {
  border-color: #7b2933;
  border-left-width: 2px;
  background: #100407;
}

.error-title {
  color: var(--color-error);
}

.error-title::before {
  content: 'fatal: ';
}

.error-message {
  background: #1b070b;
}

.runtime-footer {
  border-top-color: #17442d;
}

.runtime-footer p {
  color: #335840;
  text-transform: lowercase;
}

.runtime-footer p span {
  color: var(--color-accent-2);
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .shell {
    width: calc(100% - 16px);
    padding-top: 8px;
  }

  .topbar-right {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
  }

  .sdg-signals {
    height: 30px;
  }

  .challenge-title {
    font-size: 22px;
  }

  .challenge-title-row {
    flex-direction: column-reverse;
  }

  .hint-reveal-btn {
    position: static;
    margin: 7px 0 4px;
  }

  .hint-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-light,
  .terminal-command-line i {
    animation: none;
  }
}
