/* AllergenKit — design system (Common Measure micro-business template) */
:root {
  --ink: #1a2b28;
  --ink-soft: #4a5f5a;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --brand: #0e5e4a;
  --brand-dark: #0a4536;
  --brand-tint: #e7f2ee;
  --accent: #e8a13d;
  --accent-dark: #b97a1e;
  --danger: #b3402e;
  --line: #e3e0d8;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(26, 43, 40, 0.08), 0 4px 16px rgba(26, 43, 40, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.logo {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 1.15rem; color: var(--ink);
  text-decoration: none; letter-spacing: -0.01em;
}
.logo svg { display: block; }
.nav { display: flex; gap: 22px; align-items: center; }
.nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.nav a:hover { color: var(--brand); }

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 11px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary {
  background: var(--surface);
  color: var(--brand);
  border: 1.5px solid var(--brand);
}
.btn.secondary:hover { background: var(--brand-tint); }
.btn.small { padding: 7px 14px; font-size: 0.88rem; }

/* Hero */
.hero { padding: 72px 0 56px; text-align: center; }
.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 auto 18px;
  max-width: 760px;
}
.hero .sub {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 auto 30px;
}
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .note { margin-top: 14px; font-size: 0.88rem; color: var(--ink-soft); }

.badge {
  display: inline-block;
  background: var(--brand-tint);
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 100px;
  margin-bottom: 20px;
}

/* Sections */
section { padding: 56px 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.015em; margin: 0 0 12px; }
.section-intro { color: var(--ink-soft); max-width: 640px; margin-bottom: 36px; }

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
section.alt .card { box-shadow: none; }
.card h3 { margin: 0 0 8px; font-size: 1.08rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.card .icon { font-size: 1.5rem; margin-bottom: 12px; display: block; }

/* Pricing */
.price-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; max-width: 720px; margin: 0 auto; }
.price-card { text-align: left; position: relative; }
.price-card.featured { border-color: var(--brand); border-width: 2px; }
.price-card .plan-name { font-weight: 700; font-size: 1.05rem; }
.price-card .price { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 2px; }
.price-card .price span { font-size: 0.95rem; font-weight: 500; color: var(--ink-soft); }
.price-card ul { list-style: none; padding: 0; margin: 18px 0 22px; }
.price-card li { padding: 6px 0 6px 26px; position: relative; font-size: 0.94rem; color: var(--ink-soft); }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.pill {
  position: absolute; top: -12px; right: 18px;
  background: var(--accent); color: #fff;
  font-size: 0.75rem; font-weight: 700;
  padding: 3px 12px; border-radius: 100px;
}

/* FAQ */
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
}
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { color: var(--ink-soft); margin: 10px 0 0; font-size: 0.95rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); }

.disclaimer {
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: var(--brand-tint);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 18px;
}

/* ===================== Matrix tool ===================== */
.tool-head { padding: 34px 0 10px; }
.tool-head h1 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); letter-spacing: -0.02em; margin: 0 0 8px; }
.tool-head p { color: var(--ink-soft); max-width: 680px; margin: 0; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  margin: 22px 0 14px;
}
.toolbar .field { display: flex; flex-direction: column; gap: 4px; }
.toolbar label { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.toolbar input[type="text"] {
  font-family: var(--font); font-size: 0.95rem;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); min-width: 200px;
}
.toolbar input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.toolbar .spacer { flex: 1; }

.matrix-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.matrix { border-collapse: collapse; width: 100%; min-width: 980px; }
table.matrix th, table.matrix td { border: 1px solid var(--line); }
table.matrix thead th {
  background: var(--brand); color: #fff;
  font-size: 0.72rem; font-weight: 600;
  padding: 8px 4px;
  text-align: center;
  vertical-align: bottom;
  line-height: 1.25;
}
table.matrix thead th.item-col { text-align: left; padding: 8px 12px; font-size: 0.85rem; min-width: 200px; }
table.matrix thead th .al-icon { display: block; font-size: 1.05rem; margin-bottom: 3px; }
table.matrix td.item-cell { padding: 0; min-width: 200px; }
table.matrix td.item-cell input {
  width: 100%; border: none; background: transparent;
  font-family: var(--font); font-size: 0.93rem; color: var(--ink);
  padding: 9px 12px;
}
table.matrix td.item-cell input:focus { outline: 2px solid var(--brand); outline-offset: -2px; }
table.matrix td.al-cell { padding: 0; text-align: center; width: 52px; }
table.matrix td.al-cell button {
  width: 100%; height: 40px;
  border: none; background: transparent; cursor: pointer;
  font-size: 0.95rem; font-weight: 700; font-family: var(--font);
  color: transparent;
}
table.matrix td.al-cell button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
table.matrix td.al-cell.state-yes { background: #f6d7d1; }
table.matrix td.al-cell.state-yes button { color: var(--danger); }
table.matrix td.al-cell.state-may { background: #fdeed3; }
table.matrix td.al-cell.state-may button { color: var(--accent-dark); }
table.matrix td.del-cell { width: 40px; text-align: center; }
table.matrix td.del-cell button {
  border: none; background: transparent; cursor: pointer;
  color: var(--ink-soft); font-size: 1rem; padding: 6px;
}
table.matrix td.del-cell button:hover { color: var(--danger); }

.matrix-actions { display: flex; gap: 10px; margin: 14px 0 6px; flex-wrap: wrap; }

.legend { display: flex; gap: 20px; flex-wrap: wrap; margin: 12px 0; font-size: 0.88rem; color: var(--ink-soft); }
.legend .key { display: inline-flex; align-items: center; gap: 7px; }
.legend .swatch { width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; }
.legend .swatch.yes { background: #f6d7d1; color: var(--danger); }
.legend .swatch.may { background: #fdeed3; color: var(--accent-dark); }

.autosave-note { font-size: 0.82rem; color: var(--ink-soft); }

/* Print header block — hidden on screen */
.print-meta { display: none; }

/* SEO content under tool */
.tool-content { max-width: 760px; }
.tool-content h2 { font-size: 1.35rem; margin-top: 36px; }
.tool-content p, .tool-content li { color: var(--ink-soft); font-size: 0.97rem; }

@media (max-width: 700px) {
  .nav a.hide-mobile { display: none; }
  .hero { padding: 48px 0 40px; }
}

/* ===================== Print (the PDF output) ===================== */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; }
  .site-header, .toolbar, .matrix-actions, .tool-head p, .tool-content,
  .site-footer, .autosave-note, .no-print { display: none !important; }
  .tool-head { padding: 0; }
  .print-meta {
    display: flex; justify-content: space-between; align-items: baseline;
    margin: 0 0 8px; font-size: 10pt;
  }
  .print-meta .pm-name { font-size: 14pt; font-weight: 700; }
  .matrix-scroll { overflow: visible; border: none; box-shadow: none; border-radius: 0; }
  table.matrix { min-width: 0; width: 100%; }
  table.matrix th, table.matrix td { border: 1px solid #888; }
  table.matrix thead th { background: #0e5e4a !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 6.5pt; padding: 4px 2px; }
  table.matrix thead th.item-col { font-size: 8pt; }
  table.matrix td.al-cell.state-yes { background: #f6d7d1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.matrix td.al-cell.state-may { background: #fdeed3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.matrix td.al-cell button { height: 24px; font-size: 9pt; }
  table.matrix td.item-cell input { padding: 4px 8px; font-size: 9pt; }
  table.matrix td.del-cell { display: none; }
  th.del-col { display: none; }
  .legend { margin: 6px 0 0; font-size: 8pt; }
  .legend .swatch { width: 12px; height: 12px; font-size: 7pt; }
  .print-disclaimer { display: block !important; font-size: 7pt; color: #555; margin-top: 6px; }
}
.print-disclaimer { display: none; }
