:root {
  --bg: #0f1117;
  --bg-elev: #1a1d27;
  --bg-panel: #202433;
  --border: #2e3348;
  --text: #e8eaf0;
  --text-muted: #9aa3b8;
  --accent: #e85d75;
  --accent-soft: rgba(232, 93, 117, 0.15);
  --accent-hover: #f07088;
  --success: #4ecb8d;
  --warning: #f5b74d;
  --info: #5aa3ff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
}
.brand-mark { display: flex; }
.site-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--accent); }

/* Hero */
.hero {
  padding: 48px 0 24px;
}
.hero h1 {
  font-size: 2.2rem;
  margin: 0 0 10px;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--accent), #f5b74d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lede {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0;
}

/* Panels */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.panel h2 {
  margin: 0 0 18px;
  font-size: 1.2rem;
}

/* Triage grid */
.triage { padding: 24px 0 48px; }
.triage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 860px) {
  .triage-grid { grid-template-columns: 1fr; }
}

/* Form */
fieldset { border: none; padding: 0; margin: 0 0 18px; }
legend {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.95rem;
}
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.chip:hover { border-color: var(--accent); }
.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field-label {
  font-size: 0.88rem;
  font-weight: 600;
}
select {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font);
}
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.presets-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.preset-btn {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}
.preset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

/* Result panel */
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.result-header h2 { margin: 0; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.plan-output { min-height: 200px; }
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state p { margin: 6px 0; }

/* Plan card */
.plan-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}
.plan-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 6px;
}
.plan-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 14px;
n  font-size: 0.82rem;
  font-weight: 600;
}
.meta-badge.difficulty-easy { background: rgba(78, 203, 141, 0.15); color: var(--success); }
.meta-badge.difficulty-moderate { background: rgba(245, 183, 77, 0.15); color: var(--warning); }
.meta-badge.difficulty-hard { background: rgba(232, 93, 117, 0.15); color: var(--accent); }
.meta-badge.time { background: rgba(90, 163, 255, 0.15); color: var(--info); }

.plan-section { margin-top: 16px; }
.plan-section h4 {
  font-size: 0.92rem;
  margin: 0 0 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.plan-section ul {
  margin: 0;
  padding-left: 20px;
}
.plan-section li {
  margin-bottom: 6px;
  font-size: 0.92rem;
}
.plan-section li::marker { color: var(--accent); }

/* Reference */
.reference { padding: 48px 0; }
.reference h2 {
  font-size: 1.6rem;
  margin: 0 0 24px;
}
.ref-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}
.ref-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--accent);
}
.ref-card p { margin: 6px 0; font-size: 0.93rem; }

.tips-block {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 20px;
}
.tips-block h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}
.tips-block ul {
  margin: 0;
  padding-left: 20px;
}
.tips-block li {
  margin-bottom: 6px;
  font-size: 0.92rem;
}

/* History */
.history { padding: 24px 0 48px; }
.history h2 { font-size: 1.4rem; margin: 0 0 16px; }
.history-list {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.history-item {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.history-item-info { flex: 1; min-width: 200px; }
.history-item-title { font-weight: 600; font-size: 0.95rem; }
.history-item-meta { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.history-item-actions { display: flex; gap: 8px; }

/* About block */
.about-block {
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
}
.about-block h2 { font-size: 1.4rem; margin: 0 0 14px; }
.about-block p { max-width: 720px; font-size: 0.95rem; }

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

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* Print */
@media print {
  .site-header, .site-footer, .triage-form, .result-actions, .history, .about-block, .site-nav { display: none !important; }
  .triage-result { box-shadow: none; border: none; padding: 0; }
  body { background: #fff; color: #000; }
  .plan-card { border: 1px solid #ccc; background: #fff; }
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
