:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --primary: #1a5c4a;
  --primary-light: #2a7a64;
  --accent: #c9a96e;
  --text: #2c2c2c;
  --text-muted: #6b6b6b;
  --border: #e8e4dc;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
a { color: var(--primary); }

/* Header */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
  position: relative;
}
.site-header h1 { font-size: 1.8rem; letter-spacing: 0.5px; }
.site-header h1 a { color: #fff; text-decoration: none; }
.site-header h1 span { color: var(--accent); }
.site-header p {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  opacity: 0.9;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.back-link {
  position: absolute;
  left: 1.2rem;
  top: 1.2rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  opacity: 0.85;
}
.back-link:hover { opacity: 1; text-decoration: underline; }
@media (max-width: 600px) {
  .back-link { position: static; display: inline-block; margin-bottom: 0.8rem; }
}

/* Notice */
.notice {
  background: #fff8e7;
  border-left: 4px solid var(--accent);
  max-width: 820px;
  margin: 1.5rem auto;
  padding: 0.9rem 1.2rem;
  font-size: 0.88rem;
  border-radius: var(--radius);
  color: #5a4a20;
}
.notice strong { color: #3d3010; }

/* Layout */
.container { max-width: 820px; margin: 0 auto; padding: 0 1.2rem 3rem; }

/* Category */
.category { margin-top: 2.2rem; }
.category-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.4rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}
.category-head h2 { font-size: 1.25rem; color: var(--primary); }
.category-head .count {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: #f0ede6;
  padding: 0.1rem 0.6rem;
  border-radius: 20px;
}
.category-intro { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 1rem; }

/* FAQ accordion */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.7rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.faq-question {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 1rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: background 0.2s;
  font-family: inherit;
  line-height: 1.5;
}
.faq-question:hover { background: #f6f4ef; }
.faq-question .icon {
  flex-shrink: 0;
  font-size: 1.3rem;
  color: var(--primary-light);
  transition: transform 0.3s;
  font-weight: 400;
}
.faq-question[aria-expanded="true"] .icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.3s ease;
  padding: 0 1.2rem;
  background: #fdfcfa;
  border-top: 0 solid var(--border);
}
.faq-answer.open {
  max-height: 900px;
  padding: 1rem 1.2rem 1.2rem;
  border-top-width: 1px;
}
.faq-answer p { margin-bottom: 0.7rem; }
.faq-answer p:last-child { margin-bottom: 0; }

/* Source citation pill */
.ref {
  display: block;
  background: #eef6f2;
  color: var(--primary);
  font-size: 0.82rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  margin-top: 0.6rem;
  font-weight: 500;
  line-height: 1.5;
}
.ref::before { content: "📖 "; }
.ref a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 2px;
}
.ref a:hover { color: var(--primary-light); }

/* View all button */
.view-all-wrap { margin-top: 0.8rem; text-align: right; }
.view-all {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  border-radius: 24px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
}
.view-all:hover { background: var(--primary-light); transform: translateY(-1px); }

/* Methodology */
.methodology {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: #f0ede6;
  border-radius: var(--radius);
}
.methodology h2 { font-size: 1.1rem; color: var(--primary); margin-bottom: 0.6rem; }
.methodology p, .methodology li { font-size: 0.9rem; color: var(--text-muted); }
.methodology ul { padding-left: 1.2rem; margin-top: 0.4rem; }
.methodology a { color: var(--primary); }

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
footer a { color: var(--primary); }

@media (max-width: 480px) {
  .site-header h1 { font-size: 1.4rem; }
  .faq-question { font-size: 0.93rem; padding: 0.9rem 1rem; }
}
/* ===== Additions for the dynamic pages (the design above is unchanged) ===== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-muted); }
.small { font-size: 0.82rem; }
.header-links { margin-top: 0.9rem; display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.header-links a { color: #fff; text-decoration: none; font-size: 0.85rem; border: 1px solid rgba(255,255,255,0.45); border-radius: 20px; padding: 0.2rem 0.85rem; }
.header-links a:hover { background: rgba(255,255,255,0.14); }
.site-header h1 a:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.category-head h2 a { color: inherit; text-decoration: none; }
.category-head h2 a:hover { text-decoration: underline; }
.more-link { display: inline-block; margin-top: 0.7rem; font-weight: 600; font-size: 0.9rem; }
.methodology .after-list { margin-top: 0.6rem; }
.notice-inline { margin: 1.5rem 0; }
.container.narrow { max-width: 680px; }
.view-all-wrap.left { text-align: left; }
.btn-reset { border: none; cursor: pointer; font-family: inherit; }

/* Search */
.search-box { margin-top: 1.4rem; position: relative; }
.search-box input { width: 100%; padding: 0.8rem 1rem; font: inherit; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.search-results { list-style: none; margin-top: 0.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.search-results li { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.search-results li:last-child { border-bottom: none; }
.search-results .cat { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.search-results .none { color: var(--text-muted); }

/* Question page */
.q-title { font-size: 1.45rem; line-height: 1.4; color: var(--primary); margin: 2rem 0 1rem; }
.answer-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; }
.answer-card p { margin-bottom: 0.8rem; }
.answer-card p:last-child { margin-bottom: 0; }
.differs { margin-top: 1rem; background: #fff8e7; border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 0.9rem 1.2rem; font-size: 0.92rem; color: #5a4a20; }
.differs h3 { font-size: 0.95rem; margin-bottom: 0.4rem; color: #3d3010; }
.differs p { margin-bottom: 0.5rem; }
.differs p:last-child { margin-bottom: 0; }
.sources { margin-top: 1.4rem; background: #eef6f2; border-radius: var(--radius); padding: 1rem 1.2rem; }
.sources h3 { font-size: 1rem; color: var(--primary); margin-bottom: 0.3rem; }
.sources h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 0.7rem 0 0.2rem; }
.sources ul { padding-left: 1.2rem; }
.sources li { font-size: 0.9rem; margin: 0.25rem 0; }
.sources a { color: var(--primary); text-decoration-color: var(--accent); text-underline-offset: 2px; }
.tag { font-size: 0.7rem; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 0 0.4rem; color: var(--text-muted); }
.reviewed { margin-top: 1rem; font-size: 0.8rem; color: var(--text-muted); }
.followups, .more-qs { margin-top: 2.2rem; }
.followups h3, .more-qs h3 { font-size: 1.1rem; color: var(--primary); border-bottom: 2px solid var(--accent); padding-bottom: 0.3rem; margin-bottom: 0.8rem; }
.more-qs ul { padding-left: 1.2rem; }
.more-qs li { margin: 0.35rem 0; }
.prose h2 { font-size: 1.15rem; color: var(--primary); margin: 1.6rem 0 0.4rem; }
.prose p { margin-bottom: 0.7rem; }

/* Forms */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem; margin-top: 1.3rem; }
.form-card h2 { font-size: 1.1rem; color: var(--primary); margin-bottom: 0.6rem; }
.field { margin-bottom: 1rem; }
.field label, .admin-card label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }
.form-card input, .form-card select, .form-card textarea, .admin-card input, .admin-card select, .admin-card textarea { width: 100%; padding: 0.7rem 0.85rem; font: inherit; color: var(--text); background: #fff; border: 1px solid #cfc9bc; border-radius: 8px; }
textarea { resize: vertical; line-height: 1.5; }
[aria-invalid="true"] { border-color: #b3261e !important; background: #fdecea !important; }
.hint { font-size: 0.78rem; color: var(--text-muted); text-align: right; margin-top: 0.2rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn-primary, .btn-secondary, .btn-danger { font: inherit; font-weight: 600; border-radius: 24px; padding: 0.6rem 1.3rem; cursor: pointer; border: 1px solid var(--primary); transition: background 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-secondary { background: #fff; color: var(--primary); }
.btn-secondary:hover { background: #eef6f2; }
.btn-danger { background: #fff; color: #b3261e; border-color: #b3261e; }
.btn-secondary.small { padding: 0.3rem 0.8rem; font-size: 0.8rem; }
.msg { margin: 0.6rem 0; padding: 0.6rem 0.9rem; border-radius: 8px; background: #fdecea; color: #7a1c15; font-size: 0.9rem; }
.msg.good { background: #e6f4ec; color: #14532d; }
.msg a { color: inherit; font-weight: 600; }
.success .code { font-size: 2rem; font-weight: 700; letter-spacing: 0.15em; color: var(--primary); margin: 0.3rem 0 0.8rem; font-family: ui-monospace, Consolas, monospace; }
.inline-form { display: flex; gap: 0.6rem; }
.inline-form input { flex: 1; }
.community-list .faq-item { margin-bottom: 0.7rem; }

/* Admin */
.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.5rem; }
.tab { font: inherit; background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 0.35rem 1rem; cursor: pointer; }
.tab.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab.right { margin-left: auto; }
.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; margin-top: 1.1rem; }
.admin-card > * + * { margin-top: 0.5rem; }
.admin-card .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.src-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 0.5rem; margin-bottom: 0.4rem; }
.admin-card .bar { display: flex; gap: 0.6rem; flex-wrap: wrap; }
@media (max-width: 600px) { .admin-card .two, .src-row { grid-template-columns: 1fr; } .inline-form { flex-direction: column; } .q-title { font-size: 1.25rem; } }
.community-list .faq-answer.open { max-height: 4000px; }

.opinions{margin:1.5rem 0}
.opinion{border:1px solid var(--border,#e6e0d4);border-radius:12px;padding:1rem 1.1rem;margin:.8rem 0;background:var(--card,#fff)}
.opinion h4{margin:0 0 .4rem;font-size:1rem}
.opinion p{margin:.3rem 0}
.opinion-sources{margin:.5rem 0 0;padding-left:1.2rem;font-size:.9rem}
.opinion-note{font-size:.9rem}
