/* First Aid Notebook Scaffold */
:root {
  --paper: #fbf6ec;
  --paper-2: #f3ecda;
  --ink: #2b2b2b;
  --muted: #6b655c;
  --line: #d9cdb6;
  --accent: #b83a3a;
  --accent-2: #8a2a2a;
  --safe: #2e7d5b;
  --warn: #c97a17;
  --shadow: 0 1px 2px rgba(0,0,0,0.06), 0 6px 18px rgba(0,0,0,0.06);
  --radius: 10px;
  --radius-sm: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #fff7e6 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #f6efe0 0%, transparent 60%),
    var(--paper);
  line-height: 1.55;
  font-size: 16px;
}

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 0 0 6px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

.site-header {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  background: #fffdf7;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.brand-title { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: 0.2px; }
.brand-sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.site-nav { display: flex; gap: 14px; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none; color: var(--ink); font-size: 14px; padding: 6px 10px; border-radius: 6px;
}
.site-nav a:hover { background: var(--paper-2); color: var(--accent-2); }

.notebook-shell { max-width: 1200px; margin: 0 auto; padding: 24px; }

.section-head { margin-bottom: 18px; }
.section-head h1, .section-head h2 { margin: 0 0 6px; line-height: 1.2; }
.section-lede { color: var(--muted); margin: 0; max-width: 720px; }

.section-workspace { margin-bottom: 36px; }
.workspace-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}

.situations {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  position: sticky; top: 92px;
  max-height: calc(100vh - 110px);
  overflow: auto;
}
.situations-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.situations-select {
  width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; font-size: 14px; margin-bottom: 10px;
}
.situation-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
.situation-chip {
  width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 14px;
}
.situation-chip:hover { border-color: var(--accent); }
.situation-chip.is-active { background: #fbeeee; border-color: var(--accent); color: var(--accent-2); font-weight: 600; }

.household-card {
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.household-card h2 { margin: 0 0 8px; font-size: 14px; }
.household-card label { display: block; font-size: 12px; color: var(--muted); margin: 6px 0 2px; }
.household-card input {
  width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); font-size: 14px;
}

.notebook {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.page { border-left: 3px solid var(--accent); padding-left: 16px; }
.page.is-hidden { display: none; }
.page-head h2 { margin: 0 0 4px; font-size: 22px; }
.page-kicker { color: var(--muted); margin: 0 0 14px; }

.page-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-size: 14px; font-family: inherit; line-height: 1.45;
}
.field textarea { resize: vertical; }
.callout-danger {
  background: #fbeeee; border: 1px solid #f1c0c0; border-radius: 8px; padding: 12px 14px;
}
.callout-danger h3 { margin: 0 0 6px; color: var(--accent-2); font-size: 14px; }
.callout-danger ul { margin: 0; padding-left: 18px; }
.callout-danger li { margin: 2px 0; }

.page-actions {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
}
.btn-primary, .btn-secondary, .btn-danger {
  padding: 9px 14px; border-radius: 8px; font-size: 14px; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-2); }
.btn-danger { background: #fff; color: var(--accent-2); border-color: #f1c0c0; }
.btn-danger:hover { background: #fbeeee; }
.save-status { color: var(--safe); font-size: 13px; margin: 0; min-height: 18px; }

.section-reference, .section-mistakes, .section-about { margin-bottom: 36px; }
.reference-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.reference-card {
  background: #fffdf7; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
}
.reference-card h3 { margin: 0 0 8px; font-size: 15px; }
.reference-card ul { margin: 0; padding-left: 18px; }
.reference-card li { margin: 3px 0; }
.reference-card ul.stack li { margin: 4px 0; }

.mistakes-table {
  width: 100%; border-collapse: collapse; background: #fffdf7; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.mistakes-table th, .mistakes-table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px;
}
.mistakes-table th { background: #f6efe0; font-weight: 600; }
.mistakes-table tr:last-child td { border-bottom: none; }

.about-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.about-card {
  background: #fffdf7; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.about-card h3 { margin: 0 0 6px; font-size: 16px; }
.about-card p { margin: 0; color: var(--ink); }
.about-foot { margin-top: 16px; }
.muted { color: var(--muted); font-size: 13px; }

.site-footer {
  border-top: 1px solid var(--line); background: #fffdf7; margin-top: 24px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 20px 24px; text-align: center; }
.footer-inner nav { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }

@media (max-width: 900px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .situations { position: static; max-height: none; }
  .situation-list { flex-direction: row; flex-wrap: wrap; }
  .situation-chip { width: auto; }
  .page-grid { grid-template-columns: 1fr; }
  .reference-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .site-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .reference-grid { grid-template-columns: 1fr; }
  .site-nav { gap: 8px; }
  .site-nav a { font-size: 13px; padding: 4px 8px; }
  .page-actions { gap: 8px; }
  .btn-primary, .btn-secondary, .btn-danger { padding: 8px 10px; font-size: 13px; }
}

@media print {
  body { background: #fff; }
  .site-header, .site-footer, .situations, .page-actions, .section-reference, .section-mistakes, .section-about, .skip-link { display: none; }
  .notebook-shell { padding: 0; }
  .notebook { border: none; box-shadow: none; padding: 0; }
  .page { border-left: none; padding-left: 0; }
  .page.is-hidden { display: block; }
  .page.is-hidden ~ .page.is-hidden { page-break-before: always; }
}



/* 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;
}
