/* Joint noise decision aid styles */
:root {
  --bg: #f5f7f7;
  --surface: #ffffff;
  --ink: #172b30;
  --muted: #4a6368;
  --teal: #0f7680;
  --teal-dark: #0a5259;
  --soft-teal: #d9eef1;
  --warn: #a8471a;
  --warn-soft: #f4e1d6;
  --ok: #2f6b4f;
  --ok-soft: #d6e8de;
  --line: #d3dcdd;
  --shadow: 0 1px 3px rgba(23,43,48,0.08), 0 8px 24px rgba(23,43,48,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height:1.5; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position:sticky; top:0; z-index:10; }
.site-header .inner { display:flex; align-items:center; justify-content:space-between; padding:14px 0; }
.brand { display:flex; align-items:center; gap:10px; font-weight:700; color: var(--ink); }
.brand-mark { width:32px; height:32px; border-radius:50%; background: var(--teal); color:#fff; display:flex; align-items:center; justify-content:center; font-size:14px; }
.nav-links { display:flex; gap:16px; align-items:center; font-size:14px; }
.nav-links a { color: var(--muted); padding:6px 8px; border-radius:6px; }
.nav-links a:hover { background: var(--soft-teal); color: var(--teal-dark); text-decoration:none; }
.nav-toggle { display:none; background:none; border:1px solid var(--line); border-radius:6px; padding:6px 10px; cursor:pointer; color: var(--ink); }

/* Hero */
.hero { padding:56px 0 36px; background: linear-gradient(180deg, #ffffff 0%, #e9f3f4 100%); }
.hero h1 { font-size: clamp(28px, 4vw, 40px); line-height:1.15; margin:0 0 12px; max-width: 760px; }
.hero .lede { font-size:18px; color: var(--muted); max-width: 680px; margin-bottom:24px; }
.pill { display:inline-block; background: var(--soft-teal); color: var(--teal-dark); padding:4px 10px; border-radius:999px; font-size:12px; font-weight:600; margin-bottom:12px; }
.hero-actions { display:flex; gap:10px; flex-wrap:wrap; }
.btn { display:inline-flex; align-items:center; gap:6px; padding:10px 14px; border-radius:8px; font-weight:600; font-size:14px; cursor:pointer; border:1px solid transparent; background: var(--surface); color: var(--ink); transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: #f0f4f4; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color:#fff; border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }

/* Main layout */
.app-grid { display:grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap:28px; padding:32px 0 56px; align-items:start; }
@media (max-width: 900px) {
  .app-grid { grid-template-columns: 1fr; }
  .nav-links { display:none; }
  .nav-toggle { display:inline-flex; }
  .nav-links.open { display:flex; position:absolute; top:60px; right:20px; flex-direction:column; background: var(--surface); border:1px solid var(--line); border-radius:10px; padding:10px; box-shadow: var(--shadow); }
}

.panel { background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 20px; }
.panel h2 { margin:0 0 8px; font-size:18px; }
.panel .panel-sub { color: var(--muted); font-size:14px; margin-bottom:16px; }

.field { margin-bottom:14px; }
.field label { display:block; font-weight:600; font-size:14px; margin-bottom:6px; }
.field .hint { font-size:12px; color: var(--muted); margin-top:4px; }
select, input[type=text], input[type=number], textarea { width:100%; padding:9px 10px; border:1px solid var(--line); border-radius: var(--radius-sm); background: #fbfbfb; color: var(--ink); font-size:14px; font-family: inherit; }
textarea { min-height: 80px; resize: vertical; }
.chip-group { display:flex; flex-wrap:wrap; gap:8px; }
.chip { display-items:center; font-size:13px; padding:6px 10px; border:1px solid var(--line); border-radius:999px; cursor:pointer; user-select:none; background:#fff; color: var(--ink); }
.chip[aria-pressed="true"], .chip.active { background: var(--soft-teal); border-color: var(--teal); color: var(--teal-dark); font-weight:600; }
.row-2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width: 500px) { .row-2 { grid-template-columns:1fr; } }

.btn-row { display:flex; flex-wrap:wrap; gap:10px; margin-top:8px; }

/* Timeline */
.timeline { list-style:none; padding:0; margin:0; max-height: 440px; overflow-y:auto; }
.timeline li { padding:10px 0; border-bottom:1px dashed var(--line); }
.timeline li:last-child { border-bottom:none; }
.entry-head { display:flex; justify-content:space-between; gap:10px; font-size:14px; }
.entry-joint { font-weight:600; }
.entry-meta { color: var(--muted); font-size:12px; margin-top:4px; }
.entry-tags { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
.tag { font-size:11px; padding:2px 8px; border-radius:999px; background:#eef { background: var(--warn-soft);.tag.ok { background: var(--ok-soft); color: var(--ok); }
.empty { color: var(--muted); font-size:14px; padding:16px 4px; text-align:center; }
.delete-btn { background:none; border:none; color: var(--warn); cursor:pointer; font-size:12px; padding:0; }
.delete-btn:hover { text-decoration:underline; }

/* Summary */
.summary-card { border:1px solid var(--line); border-radius: var(--radius-sm); padding:14px; background:#fbfbfb; }
.summary-card h3 { margin:0 0 6px; font-size:14px; color: var(--muted); font-weight:600; text-transform:uppercase; letter-spacing: .03em; }
.summary-value { font-size:20px; font-weight:700; color: var(--ink); }
.next-steps { list-style:none; padding:0; margin:10px 0 0; }
.next-steps li { padding:6px 0 6px 22px; position:relative; font-size:14px; }
.next-steps li::before { content:""; position:absolute; left:4px; top:12px; width:8px; height:8px; border-radius:50%; background: var(--teal); }
.next-steps li.severe::before { background: var(--warn); }
.next-steps li.ok::before { background: var(--ok); }

/* Reference */
.ref-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:14px; }
.ref-card { border:1px solid var(--line); border-radius: var(--radius-sm); padding:12px; background:#fbfbfb; }
.ref-card h4 { margin:0 0 6px; font-size:14px; color: var(--teal-dark); }
.ref-card p { margin:0; font-size:13px; color: var(--muted); }

/* Content block */
.content-block { padding:56px 0; background: #ffffff; border-top:1px solid var(--line); }
.content-block h2 { font-size:24px; margin:0 0 14px; }
.content-block p { color: var(--muted); max-width: 780px; }
.content-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px,1fr)); gap:18px; margin-top:24px; }
.content-grid h3 { font-size:16px; margin:0 0 6px; color: var(--ink); }
.content-grid p { font-size:14px; color: var(--muted); margin:0; }

/* FAQ details */
details { border:1px solid var(--line); border-radius: var(--radius-sm); padding:10px 14px; background:#fbfbfb; margin-bottom:10px; }
details summary { cursor:pointer; font-weight:600; font-size:14px; color: var(--ink); }
details[open] summary { margin-bottom:6px; }
details p { margin:6px 0 0; font-size:14px; color: var(--muted); }

/* Footer */
.site-footer { border-top:1px solid var(--line); background:#ffffff; padding:28px 0; color: var(--muted); font-size:13px; }
.site-footer .inner { display:flex; flex-wrap:wrap; justify-content:space-between; gap:10px; }
.site-footer a { color: var(--teal-dark); }

/* Print */
@media print {
  .site-header, .site-footer, .nav-toggle, .btn, .panel .btn-row { display:none !important; }
  .panel { box-shadow:none; border:1px solid #ccc; break-inside:avoid; }
  body { background:#fff; }
}

/* Accessibility focus */
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius:4px; }
button.chip[aria-pressed]:focus-visible, .btn:focus-visible { outline-offset: 3px; }



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