/* 結婚新生活の補助の早見：生成りの紙に金色の差し色（招待状のような見た目）。base.css の上に重ねる */
:root {
  --bg: #f7f1e3; --fg: #3b2f22; --muted: #7a6a55; --line: #e3d6b8; --card: #fffaf0;
  --accent: #9a7425; --gold: #b8913a; --gold-soft: #efe1bd;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #221c14; --fg: #f1e7d2; --muted: #c2b293; --line: #4a3e2c; --card: #2c241a; --accent: #d9b45a; --gold: #d9b45a; --gold-soft: #4a3c22; }
}
body { font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; }
input, select, button, .hint, .source, table, .legend, .dist { font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; }
.site-header { border-bottom: 1px solid var(--gold); box-shadow: 0 3px 0 -1px var(--bg), 0 4px 0 -1px var(--gold); text-align: center; }
.site-name { letter-spacing: 0.08em; }
h1 { text-align: center; font-size: 1.45rem; letter-spacing: 0.04em; margin-top: 16px; }
h1 .sub { display: block; font-size: 0.95rem; font-weight: 600; color: var(--muted); margin-top: 6px; letter-spacing: 0; }
h1::after { content: "❦"; display: block; color: var(--gold); font-size: 1rem; margin-top: 6px; }
h2 { border-left: 0; padding-left: 0; text-align: center; letter-spacing: 0.05em; }
h2::before, h2::after { content: "—"; color: var(--gold); margin: 0 0.5em; }
.lead { font-size: 1rem; }
.caution { border: 1px solid var(--gold); background: var(--gold-soft); border-radius: 4px; padding: 10px 14px; margin: 16px 0; font-family: system-ui, -apple-system, "Hiragino Sans", sans-serif; font-size: 0.92rem; }
.caution p { margin: 0; }
.card { background: var(--card); border: 1px solid var(--gold); border-radius: 4px; outline: 1px solid var(--gold); outline-offset: -6px; padding: 20px 18px; }
.hayami h2 { margin-top: 0; }
.hayami .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.err { color: #b42318; font-size: 0.8rem; min-height: 1.1em; margin: 2px 0 0; font-family: system-ui, sans-serif; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: #b42318; }
.unit-wrap { position: relative; }
.unit-wrap input { padding-right: 52px; }
.unit-wrap .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 0.9rem; pointer-events: none; }
.actions { display: flex; gap: 8px; margin-top: 14px; }
button { background: var(--accent); border-color: var(--accent); }
button.secondary { background: transparent; color: var(--accent); }
.result { margin-top: 16px; border-top: 1px dashed var(--gold); padding-top: 12px; }
.result .verdict { font-size: 1.3rem; font-weight: 700; margin: 0; }
.result[data-verdict="対象"] .verdict { color: var(--accent); }
.result[data-verdict="対象外"] .verdict, .result[data-open="0"] .verdict { color: var(--muted); }
.result .capline { font-size: 1.9rem; font-weight: 700; color: var(--accent); margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.result .capline:empty { display: none; }
.result ul { padding-left: 1.2em; font-size: 0.92rem; margin: 6px 0; font-family: system-ui, sans-serif; }
.source { font-size: 0.8rem; color: var(--muted); margin: 6px 0 0; overflow-wrap: anywhere; }
.summary { background: var(--card); border-left: 3px solid var(--gold); padding: 8px 12px; }
.updated { text-align: center; font-size: 0.85rem; color: var(--muted); margin-top: 32px; }

/* 日本地図（都道府県のマス） */
.jmap { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); grid-template-rows: repeat(12, auto); gap: 2px; max-width: 560px; margin: 12px auto 4px; }
.tile { aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 3px; text-decoration: none; color: var(--fg); font-family: system-ui, sans-serif; font-size: 0.6rem; line-height: 1.1; border: 1px solid var(--line); min-width: 0; overflow: hidden; letter-spacing: -0.05em; }
.tile span { white-space: nowrap; }
.tile b { font-size: 0.72rem; letter-spacing: 0; }
.b80 { background: #8a6418; color: #fff; border-color: #8a6418; }
.b60 { background: #c79a3e; color: #2a1e08; border-color: #c79a3e; }
.b30 { background: #ead29a; color: #3b2f22; border-color: #d8bc77; }
.b15 { background: #f6ead0; color: #3b2f22; }
.b0 { background: transparent; color: var(--muted); border-style: dashed; }
.legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; font-size: 0.78rem; margin: 6px 0; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; border: 1px solid var(--line); vertical-align: -1px; margin-right: 4px; }
.legend .sw.b0 { border-style: dashed; }
@media (min-width: 560px) { .tile { font-size: 0.68rem; } .tile b { font-size: 0.85rem; } }

/* ランキング */
#rank-table td:first-child { white-space: nowrap; }
/* base.css は表の 2 列目から折り返さない。市と年齢の区分の列は折り返して、スマホ幅で横に動かさずに読めるようにする */
#rank-table td:nth-child(2), #rank-table td:nth-child(4) { white-space: normal; }
#rank-table td:nth-child(4) { font-size: 0.82rem; }
#rank-table th, #rank-table td { padding: 6px 6px; }
#rank-table .num { white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
#rank-table small { color: var(--muted); }
#rank-table tbody tr:nth-child(-n+3) td:first-child { color: var(--accent); font-weight: 700; }

/* 条件の分布 */
.dists { display: grid; gap: 12px; }
@media (min-width: 640px) { .dists { grid-template-columns: 1fr 1fr; } }
.dist { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; }
.dist figcaption { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.dist ul { list-style: none; padding: 0; margin: 0; }
.dist li { display: grid; grid-template-columns: 9.5em 1fr 3em; align-items: center; gap: 6px; font-size: 0.82rem; margin: 3px 0; }
.dist .bar { height: 10px; background: linear-gradient(90deg, var(--gold) var(--w), transparent var(--w)); border-radius: 2px; }
.dist .dn { text-align: right; font-variant-numeric: tabular-nums; }
.dist .dsum { font-size: 0.72rem; color: var(--muted); margin: 4px 0 0; text-align: right; }

/* 市ごとの札 */
.region h3 { text-align: center; color: var(--accent); }
.fudas { display: grid; gap: 10px; }
@media (min-width: 640px) { .fudas { grid-template-columns: 1fr 1fr; } }
.fuda { position: relative; background: var(--card); border: 1px solid var(--gold); border-radius: 4px; padding: 12px 14px; scroll-margin-top: 12px; }
.fuda.off { border-color: var(--line); border-style: dashed; background: transparent; }
.fuda h4 { margin: 0 0 2px; font-size: 1.1rem; }
.fuda h4 small { font-size: 0.75rem; color: var(--muted); margin-left: 6px; font-weight: 400; }
.fuda .cap { margin: 0 0 6px; font-size: 0.95rem; }
.fuda .cap strong { font-size: 1.5rem; color: var(--accent); }
.fuda dl { margin: 0; font-family: system-ui, sans-serif; font-size: 0.85rem; display: grid; grid-template-columns: 6.5em 1fr; gap: 2px 8px; }
.fuda dt { color: var(--muted); }
.fuda dd { margin: 0; overflow-wrap: anywhere; }
.fuda p { font-size: 0.88rem; }
.fuda:target { box-shadow: 0 0 0 3px var(--gold-soft); }
.st { position: absolute; top: 10px; right: 12px; font-family: system-ui, sans-serif; font-size: 0.72rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.st-0 { border-color: var(--gold); color: var(--accent); background: var(--gold-soft); }
