/* deadline-radar — craft-calc「B-Light」流用：白地の作業台＋グリッド。数字は等幅。 */
:root {
  --bg: #f6f6f3; --grid: #e9ebee; --surface: #fff; --panel: #fbfbfa;
  --text: #1b1f24; --muted: #5b6670; --faint: #8b94a0; --line: #e1e4e8; --line-strong: #c3c9d0;
  --brand: #3f5ae0; --brand-ink: #fff; --brand-soft: #e9edfd; --brand-line: #b9c4f5;
  --urgent: #d9480f; --urgent-soft: #fff0e6; --urgent-line: #f3c7ad;
  --ok: #2f7d4a; --ok-soft: #e6f4ea; --warn-bg: #fff6d9; --warn-line: #ecd58a; --footer: #1b1f24; --footer-text: #b9c0c8;
  --font: "IBM Plex Sans JP", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 6px; --r-lg: 10px;
  --shadow: 0 1px 2px rgba(27,31,36,.05), 0 6px 20px rgba(27,31,36,.05);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; background-position: -1px -1px; }
a { color: var(--text); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
h1, h2, h3 { line-height: 1.3; margin: 0; }
p { margin: 0 0 .8em; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.note { color: var(--muted); font-size: .82rem; line-height: 1.6; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header / footer */
.site-header { background: rgba(255,255,255,.92); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 54px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); font-weight: 700; white-space: nowrap; }
.logo svg { display: block; }
.logo small { font-weight: 500; color: var(--muted); font-size: .78rem; margin-left: 2px; }
.nav { display: flex; gap: 4px; }
.nav a { font-size: .85rem; font-weight: 500; text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--bg); }
@media (max-width: 640px) { .logo small { display: none; } .nav a { padding: 6px 7px; font-size: .8rem; } .nav a.sec { display: none; } }
.site-footer { background: var(--footer); color: var(--footer-text); margin-top: 56px; padding: 26px 0 30px; font-size: .82rem; }
.site-footer a { color: #fff; margin-right: 14px; text-decoration: none; }
.site-footer nav { margin: 6px 0; }

/* hero */
.hero { padding: 28px 0 8px; }
.hero .eyebrow { font-size: .8rem; color: var(--muted); font-weight: 500; }
.hero .lead { font-size: clamp(1.3rem, 1rem + 1.5vw, 1.8rem); font-weight: 700; margin: 4px 0 0; line-height: 1.35; }
.hero .lead em { font-style: normal; background: linear-gradient(transparent 62%, var(--brand-soft) 62%); padding: 0 .1em; }
.hero p { color: var(--muted); font-size: .92rem; max-width: 760px; margin-top: 8px; }
.hero .stats { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .82rem; color: var(--muted); margin-top: 6px; }
.hero .stats b { font-family: var(--mono); color: var(--text); }

/* layout */
.grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 16px; }
.grid > * { min-width: 0; }
@media (min-width: 960px) { .grid { grid-template-columns: 340px 1fr; align-items: start; } .side { position: sticky; top: 66px; max-height: calc(100vh - 80px); overflow: auto; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.grp { padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.grp:first-child { border-top: 0; }
.grp-t { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .9rem; font-weight: 700; }
.grp-t .note { font-weight: 400; }

.side-sum { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.side-sum::-webkit-details-marker { display: none; }
.side-sum .grp-t::before { content: "▸ "; color: var(--muted); }
.side-d[open] > .side-sum .grp-t::before { content: "▾ "; }
@media (min-width: 960px) { .side-sum { display: none; } }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font: inherit; font-size: .8rem; font-weight: 500; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--muted); cursor: pointer; line-height: 1.4; }
.chip:hover { border-color: var(--text); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: #fff; border-color: var(--text); }
.chip .cnt { font-family: var(--mono); font-size: .72rem; opacity: .75; margin-left: 4px; }
.seg { display: inline-flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.seg label { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); cursor: pointer; background: #fff; }
.seg label:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); }
.seg input { accent-color: var(--brand); margin: 0; }
textarea { width: 100%; min-height: 120px; font: inherit; font-family: var(--mono); font-size: .8rem; line-height: 1.5; border: 1px solid var(--line-strong); border-radius: var(--r); padding: 8px 10px; margin-top: 8px; resize: vertical; background: #fff; color: var(--text); }
textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgba(27,31,36,.08); }
.match-sum { margin-top: 8px; font-size: .85rem; }
.match-sum b { font-family: var(--mono); }
.match-sum .hit { color: var(--ok); font-weight: 700; }

/* buttons */
button, .btn { font: inherit; font-size: .88rem; font-weight: 600; padding: 8px 14px; border-radius: var(--r); border: 1px solid var(--line-strong); background: #fff; color: var(--text); cursor: pointer; line-height: 1.3; min-height: 36px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, border-color .15s; }
button:hover, .btn:hover { border-color: var(--text); background: var(--panel); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
.btn-primary:hover { background: #3049c9; border-color: #3049c9; }
.btn-sm { padding: 4px 9px; font-size: .8rem; min-height: 28px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg); border-color: transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.msg { font-size: .82rem; color: var(--ok); min-height: 1.3em; margin-top: 6px; }
.subs a.btn { font-family: var(--mono); font-size: .8rem; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: .85rem; margin-top: 10px; cursor: pointer; }
.toggle input { accent-color: var(--brand); }

/* timeline */
.tl-sec { margin-top: 8px; }
.tl-h { display: flex; align-items: baseline; gap: 10px; padding: 8px 2px 6px; font-size: .95rem; font-weight: 700; }
.tl-h .cnt { font-family: var(--mono); font-weight: 500; color: var(--muted); font-size: .8rem; }
.tl-h.soon { color: var(--urgent); }
details.tl-past > summary { cursor: pointer; list-style: none; }
details.tl-past > summary::-webkit-details-marker { display: none; }
details.tl-past > summary .tl-h::before { content: "▸ "; color: var(--muted); }
details.tl-past[open] > summary .tl-h::before { content: "▾ "; }
.dl { display: grid; grid-template-columns: 92px 1fr; gap: 0 14px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.dl:first-of-type { border-top: 0; }
.dl.hit { background: var(--ok-soft); box-shadow: inset 3px 0 0 var(--ok); }
.dl.dim { opacity: .45; }
.dl .when { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dl .when .d { font-weight: 700; font-size: 1.02rem; line-height: 1.2; }
.dl .when .left { display: inline-block; margin-top: 4px; font-size: .72rem; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.dl .when .left.soon { background: var(--urgent-soft); border-color: var(--urgent-line); color: var(--urgent); font-weight: 700; }
.dl .when .left.past { background: var(--bg); }
.dl h3 { font-size: .98rem; font-weight: 700; line-height: 1.4; }
.dl h3 a { text-decoration: none; }
.dl h3 a:hover { text-decoration: underline; }
.dl .meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: .72rem; margin-top: 4px; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-family: var(--mono); line-height: 1.5; }
.badge.k-hard { border-color: var(--urgent-line); color: var(--urgent); background: var(--urgent-soft); }
.badge.k-phased { border-color: var(--warn-line); background: var(--warn-bg); color: #7a5a00; }
.badge.plat { background: var(--text); color: #fff; border-color: var(--text); font-family: var(--font); font-weight: 600; }
.badge.why { background: var(--ok); color: #fff; border-color: var(--ok); font-weight: 600; }
.badge.st { font-family: var(--font); }
.dl .req { margin: 6px 0 0; font-size: .88rem; }
.dl .aff { margin: 4px 0 0; font-size: .84rem; color: var(--muted); }
.dl .aff b { color: var(--text); font-weight: 600; }
.dl .dn { margin: 4px 0 0; font-size: .8rem; color: var(--muted); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--r); padding: 4px 8px; display: inline-block; }
.dl .src { margin: 8px 0 0; font-size: .78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.dl .src a { color: var(--text); }
.dl .src .off { font-weight: 700; }
.dl .src .off::before { content: "公式 "; color: var(--ok); font-size: .72rem; }
.dl details.hist { margin-top: 4px; font-size: .78rem; color: var(--muted); }
.dl details.hist summary { cursor: pointer; }
.dl details.hist li { margin: 2px 0; }
.dl details.hist ul { margin: 4px 0 0; padding-left: 1.2em; }
@media (max-width: 520px) { .dl { grid-template-columns: 1fr; gap: 4px; } .dl .when { display: flex; align-items: center; gap: 8px; } .dl .when .left { margin-top: 0; } }
.empty { padding: 24px 14px; color: var(--muted); text-align: center; font-size: .9rem; }
:target { scroll-margin-top: 70px; }
.dl:target { box-shadow: inset 3px 0 0 var(--brand); background: var(--brand-soft); }

/* how / faq */
.how { margin-top: 32px; }
.how h2 { font-size: 1rem; margin-bottom: 8px; }
.how ul { padding-left: 1.2em; margin: 0; }
.how li { margin: 4px 0; }

/* legal pages */
.page { padding: 28px 0; }
.page h1 { font-size: 1.5rem; margin-bottom: 4px; }
.page .meta { color: var(--muted); font-size: .85rem; margin-bottom: 20px; }
.legal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 24px 22px; box-shadow: var(--shadow); }
.legal h2 { font-size: 1.02rem; margin-top: 1.6em; padding-left: 10px; border-left: 3px solid var(--brand); }
.legal ul { padding-left: 1.3em; }
