:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #5d6475;
  --line: #e4ded4;
  --accent: #3a5ba0;
  --accent-soft: #e8eefb;
  --red: #b42318;
  --red-soft: #fdecea;
  --orange: #b54708;
  --orange-soft: #fff4e5;
  --green: #1d7a4a;
  --green-soft: #e7f6ee;
  --gray-soft: #f1efea;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(31, 36, 48, .06), 0 4px 16px rgba(31, 36, 48, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
header.top {
  position: sticky; top: 0; z-index: 10; background: rgba(246, 243, 238, .92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
header.top .in { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 16px; }
header.top .logo { font-weight: 700; text-decoration: none; color: var(--ink); margin-right: auto; }
header.top nav a { text-decoration: none; color: var(--muted); font-size: 14px; padding: 6px 8px; border-radius: 8px; }
header.top nav a.on { color: var(--ink); background: var(--gray-soft); }
main { max-width: 720px; margin: 0 auto; padding: 16px 16px 80px; }
h1 { font-size: 28px; line-height: 1.2; margin: 12px 0 8px; }
h2 { font-size: 21px; line-height: 1.25; margin: 24px 0 8px; }
h3 { font-size: 17px; margin: 16px 0 6px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 12px 0; }
.btn {
  display: inline-block; border: 0; border-radius: 12px; padding: 12px 18px; font: inherit; font-weight: 600;
  background: var(--accent); color: #fff; text-decoration: none; cursor: pointer;
}
.btn.ghost { background: var(--accent-soft); color: var(--accent); }
.btn.plain { background: transparent; color: var(--muted); padding: 10px 8px; font-weight: 500; }
.btn.block { display: block; width: 100%; text-align: center; }
.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.hero { padding: 8px 0 4px; }
.hero .lead { font-size: 18px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 16px 0; }
@media (min-width: 560px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile { display: block; text-decoration: none; color: var(--ink); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.tile b { display: block; }
.tile span { color: var(--muted); font-size: 14px; }

.notice { border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 15px; }
.notice.red { background: var(--red-soft); color: #7a1610; border: 1px solid #f5c2bd; }
.notice.orange { background: var(--orange-soft); color: #7a3104; border: 1px solid #f7d4a6; }
.notice.green { background: var(--green-soft); color: #11512f; border: 1px solid #b9e3cb; }
.notice.gray { background: var(--gray-soft); color: var(--muted); }

.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 8px 0 16px; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.qhead { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.q { font-size: 22px; line-height: 1.25; font-weight: 700; margin: 6px 0 4px; }
.hint { color: var(--muted); font-size: 15px; }
.opts { display: grid; gap: 8px; margin: 16px 0; }
.opt {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%;
  background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px;
  font: inherit; color: var(--ink); cursor: pointer;
}
.opt .box { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid #b9b2a6; margin-top: 1px; display: grid; place-items: center; font-size: 14px; color: #fff; }
.opt.radio .box { border-radius: 50%; }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt.sel .box { background: var(--accent); border-color: var(--accent); }
.opt .t b { display: block; font-weight: 600; }
.opt .t span { display: block; color: var(--muted); font-size: 14px; }
.opt.none { border-style: dashed; }
.navrow { display: flex; gap: 8px; align-items: center; margin-top: 8px; }

details.why { margin: 10px 0; background: var(--gray-soft); border-radius: 12px; padding: 0 12px; }
details.why > summary { cursor: pointer; padding: 10px 0; color: var(--muted); font-size: 14px; list-style: none; }
details.why > summary::before { content: "＋ "; }
details.why[open] > summary::before { content: "－ "; }
details.why > div { padding-bottom: 10px; font-size: 15px; }

.src {
  display: inline-block; font-size: 12px; line-height: 1.2; padding: 3px 8px; border-radius: 999px; margin: 2px 4px 2px 0;
  background: var(--accent-soft); color: var(--accent); text-decoration: none; white-space: nowrap; border: 0; cursor: pointer; font-family: inherit;
}
.srcs { margin-top: 6px; }

.verdict { border-radius: var(--radius); padding: 18px; margin: 12px 0; }
.verdict.red { background: var(--red); color: #fff; }
.verdict.orange { background: var(--orange); color: #fff; }
.verdict.blue { background: var(--accent); color: #fff; }
.verdict.green { background: var(--green); color: #fff; }
.verdict h1 { margin: 4px 0 6px; font-size: 26px; }
.verdict .kicker { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; opacity: .85; }
.verdict p { margin: 6px 0; }
.verdict a.call { display: inline-block; margin-top: 8px; background: #fff; color: var(--red); font-weight: 800; font-size: 20px; padding: 10px 18px; border-radius: 12px; text-decoration: none; }

.crit { list-style: none; padding: 0; margin: 8px 0; }
.crit li { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; }
.crit li:first-child { border-top: 0; }
.crit .m { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.m.yes { background: var(--green-soft); color: var(--green); }
.m.no { background: var(--red-soft); color: var(--red); }
.m.unk { background: var(--gray-soft); color: var(--muted); }

.tx { border-top: 1px solid var(--line); padding: 12px 0; }
.tx:first-child { border-top: 0; padding-top: 0; }
.tx .name { font-weight: 700; }
.tx .dose { margin: 2px 0; }
.ev { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; margin-left: 4px; vertical-align: 1px; }
.ev.high { background: var(--green-soft); color: var(--green); }
.ev.mod { background: var(--accent-soft); color: var(--accent); }
.ev.low { background: var(--orange-soft); color: var(--orange); }
.ev.none { background: var(--red-soft); color: var(--red); }
.warn { color: var(--red); font-size: 14px; margin: 4px 0; }
.warn::before { content: "⚠ "; }

.alt { border-top: 1px solid var(--line); padding: 10px 0; }
.alt:first-child { border-top: 0; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--gray-soft); color: var(--muted); margin-left: 6px; }

/* flowchart */
.flow { position: relative; }
.fnode { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; margin: 0 auto; position: relative; }
.fnode.fq { border-left: 5px solid var(--accent); }
.fnode.red { border-left: 5px solid var(--red); }
.fnode.orange { border-left: 5px solid var(--orange); }
.fnode.green { border-left: 5px solid var(--green); }
.fnode .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fnode b { display: block; }
.farrow { text-align: center; color: var(--muted); font-size: 13px; padding: 4px 0; }
.farrow::before { content: "↓"; display: block; font-size: 20px; line-height: 1; color: #b9b2a6; }
.fbranch { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 8px 0; }
@media (min-width: 560px) { .fbranch.two { grid-template-columns: 1fr 1fr; } .fbranch.three { grid-template-columns: 1fr 1fr 1fr; } }
.fbranch .fnode { margin: 0; height: 100%; }
.fbranch .tag { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.fnode ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.fnode a { font-size: 14px; }

.srclist li { margin: 10px 0; }
.srclist .id { font-weight: 600; }
.foot { margin-top: 32px; font-size: 13px; color: var(--muted); }
table.mini { border-collapse: collapse; width: 100%; font-size: 14px; }
table.mini td, table.mini th { border-top: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: top; }

#srcpop { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--card); box-shadow: 0 -8px 30px rgba(0,0,0,.15); border-radius: 18px 18px 0 0; padding: 16px 16px 24px; max-height: 70vh; overflow: auto; }
#srcpop .in { max-width: 720px; margin: 0 auto; }
#srcpop[hidden] { display: none; }
