:root{
  /* SimpleFast ブランド(紙 paper #f4f1ea × 黒 ink #111 × 黄 yellow #ffe000)
     機能アクセント=黒インク / 主要CTA・見出しバー=黄。地図の配色・選択色は機能色として維持。 */
  --brand:#111111; --brand-d:#111111; --accent:#ffe000; --ink:#111111; --muted:#555555;
  --line:#d9d5c8; --bg:#f4f1ea; --panel:#ffffff; --sel:#d64545;
  --shadow:0 2px 10px rgba(17,17,17,.12);
}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{
  font-family:"Segoe UI","Hiragino Kaku Gothic ProN","Meiryo",system-ui,sans-serif;
  color:var(--ink); background:var(--bg); display:flex; flex-direction:column;
}
header.app-head{
  display:flex; align-items:center; gap:12px; padding:10px 16px;
  background:var(--panel); border-bottom:1px solid var(--line);
}
header.app-head h1{font-size:16px; margin:0; font-weight:800;}
header.app-head .sub{font-size:12px; color:var(--muted);}
header.app-head .spacer{flex:1}
/* スマホ向けPC推奨バナー（既定は非表示・中身DOMは残す＝SEO安全。狭幅で表示） */
.mobile-notice{display:none; padding:9px 14px; background:#fdf7cf; border-bottom:1px solid #e6c200; color:var(--ink); font-size:12.5px; line-height:1.5; text-align:center}
.mobile-notice strong{font-weight:800}
/* ヘッダーのヘルプ（解説トグル＋Q&Aパネル） */
.help-toggle{display:inline-flex; align-items:center; gap:8px; font-size:12.5px; font-weight:700; color:var(--ink); cursor:pointer; user-select:none; white-space:nowrap; border:1px solid var(--line); border-radius:8px; padding:5px 11px; background:#fff}
.help-toggle:hover{background:var(--bg)}
.help-toggle input{position:absolute; opacity:0; width:0; height:0; margin:0}
.ht-switch{position:relative; width:32px; height:18px; border-radius:18px; background:#c4ccd4; transition:background .15s; flex:none}
.ht-knob{position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.3); transition:left .15s}
body.help-on .ht-switch{background:var(--brand)}
body.help-on .ht-knob{left:16px}
.help-wrap{position:relative}
.help-btn{border:1px solid var(--line); background:#fff; color:var(--brand-d); border-radius:8px; padding:6px 11px; font-size:12.5px; font-weight:700; cursor:pointer; white-space:nowrap}
.help-btn:hover{background:var(--bg)}
.help-wrap.open .help-btn{background:var(--brand); border-color:var(--brand); color:#fff}
.help-panel{position:absolute; top:100%; right:0; margin-top:4px; width:400px; max-width:88vw; max-height:78vh; overflow-y:auto; background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:0 14px 40px rgba(15,30,50,.22); padding:16px 40px 18px 18px; z-index:4000; display:none; text-align:left}
.help-wrap.open .help-panel{display:block}
.help-close{position:absolute; top:10px; right:12px; width:26px; height:26px; border:none; background:var(--bg); color:var(--muted); border-radius:6px; font-size:17px; line-height:1; cursor:pointer}
.help-close:hover{background:#e6e0d4; color:var(--ink)}
.help-panel h3{margin:0 0 10px; font-size:14px; color:var(--brand-d)}
.help-panel dt{font-weight:800; font-size:12.5px; color:var(--ink); margin-top:12px}
.help-panel dt:first-of-type{margin-top:0}
.help-panel dd{margin:4px 0 0; font-size:12px; color:var(--muted); line-height:1.65}
/* 各項目の ? バッジ（body.help-on の時だけ表示）＋ JSツールチップ */
.info{display:none; align-items:center; justify-content:center; width:15px; height:15px; border-radius:50%; background:var(--brand); color:#fff; font-size:10px; font-weight:700; line-height:1; cursor:help; flex:none; vertical-align:middle; margin-left:5px}
body.help-on .info{display:inline-flex}
.sec-h .info{margin-left:auto}
.info-tip{position:fixed; z-index:5000; max-width:280px; background:#111111; color:#fff; font-size:12px; line-height:1.6; padding:9px 11px; border-radius:8px; box-shadow:0 8px 24px rgba(0,0,0,.28); pointer-events:none; white-space:pre-line; opacity:0; transition:opacity .1s}
.info-tip.show{opacity:1}
/* ヘッダーの「自社の配布実数を登録」ボタン */
.hdr-btn{border:1px solid var(--line); background:#fff; color:var(--ink); border-radius:8px; padding:6px 11px; font-size:12.5px; font-weight:700; cursor:pointer; white-space:nowrap}
.hdr-btn:hover{background:var(--bg)}
/* 自社実数の登録モーダル */
.ov-modal{position:fixed; inset:0; background:rgba(15,30,50,.55); z-index:3500; display:none; align-items:center; justify-content:center; padding:20px}
.ov-modal.open{display:flex}
.ov-box{background:#fff; border-radius:12px; width:520px; max-width:100%; max-height:90vh; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 12px 40px rgba(0,0,0,.3)}
.ov-head{display:flex; align-items:center; justify-content:space-between; padding:14px 18px; border-bottom:1px solid var(--line); font-size:15px; font-weight:800; color:var(--brand-d)}
.ov-close{width:28px; height:28px; border:none; background:var(--bg); color:var(--muted); border-radius:6px; font-size:18px; line-height:1; cursor:pointer}
.ov-close:hover{background:#e6e0d4; color:var(--ink)}
.ov-body{padding:16px 18px; overflow-y:auto}
.ov-lead{font-size:13px; color:var(--ink); line-height:1.7; margin:0 0 14px}
.ov-note{font-size:12px; color:var(--muted); line-height:1.7; margin:14px 0 0}
.ov-actions{display:flex; flex-direction:column; gap:11px}
.ov-row{display:flex; align-items:flex-start; gap:12px}
.ov-row .btn{flex:none; width:118px; padding:9px 8px; font-size:13px}
.ov-desc{font-size:12px; color:var(--muted); line-height:1.6; padding-top:2px}
.ov-desc b{color:var(--ink)}

.app{display:flex; flex:1; min-height:0;}
aside.side{
  width:314px; flex:none; background:var(--panel); border-right:1px solid var(--line);
  padding:0; overflow-y:auto;
}
.sec{padding:18px 14px; border-top:1px solid var(--line);}
.sec:first-child{border-top:none; padding-top:14px;}
.sec-h{display:flex; align-items:center; gap:8px; color:var(--brand-d); font-size:12.5px; font-weight:800; letter-spacing:.02em; margin-bottom:13px; padding-bottom:7px; border-bottom:2px solid var(--line);}
.sec-h::before{content:""; width:5px; height:15px; background:var(--accent); border-radius:2px; flex:none;}
details.tpl{margin-bottom:12px; border:1px solid var(--line); border-radius:8px; padding:2px 10px;}
details.tpl summary{cursor:pointer; font-size:12px; font-weight:700; color:var(--muted); padding:6px 0;}
details.tpl textarea{width:100%; margin:4px 0 8px; padding:7px 9px; border:1px solid var(--line); border-radius:6px; font-size:12.5px; font-family:inherit; resize:none; overflow:hidden; min-height:38px; line-height:1.5; box-sizing:border-box;}
.toast{position:fixed; left:50%; bottom:26px; transform:translateX(-50%); background:#1f2a37; color:#fff; padding:10px 18px; border-radius:8px; font-size:13px; font-weight:600; box-shadow:var(--shadow); z-index:2000; opacity:0; transition:opacity .2s; pointer-events:none;}
.toast.show{opacity:1;}

/* PDFプレビュー */
.pdf-preview{position:fixed; inset:0; background:rgba(15,30,50,.55); z-index:3000; display:none; align-items:center; justify-content:center; padding:20px;}
.pdf-preview .pv-box{background:#fff; border-radius:12px; max-width:940px; width:100%; max-height:94vh; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 12px 40px rgba(0,0,0,.3);}
.pv-head{display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid var(--line); font-size:14px; font-weight:700;}
.pv-body{overflow-y:auto; overflow-x:hidden; padding:14px; background:#eef2f6;}
.pv-body canvas,.pv-body img{width:100%; max-width:100%; height:auto; display:block; box-shadow:0 2px 10px rgba(0,0,0,.15); background:#fff;}
.pv-foot{display:flex; gap:8px; justify-content:flex-end; padding:12px 16px; border-top:1px solid var(--line);}
.field{margin-bottom:12px;}
.field:last-child{margin-bottom:0;}
.field label{display:block; font-size:12px; font-weight:700; color:var(--muted); margin-bottom:5px;}
select,input[type=text]{
  width:100%; padding:8px 10px; border:1px solid var(--line); border-radius:8px;
  font-size:14px; color:var(--ink); background:#fff;
}
.seg{display:flex; gap:6px}
.seg button{flex:1}
button.btn{
  border:1px solid var(--line); background:#fff; color:var(--ink);
  padding:8px 10px; border-radius:8px; font-size:13px; cursor:pointer; font-weight:600;
}
button.btn:hover{background:#efeae0}
button.btn.primary{background:var(--accent); border-color:var(--ink); color:var(--ink); font-weight:800}
button.btn.primary:hover{background:#ffe94d}
button.btn.active{background:var(--brand); border-color:var(--brand); color:#fff}
button.btn.ghost{background:#fff}

.radius-row{display:flex; align-items:center; gap:10px}
.radius-row input[type=range]{flex:1; accent-color:var(--ink)}
.radius-val{font-weight:700; color:var(--brand-d); font-variant-numeric:tabular-nums; min-width:46px; text-align:right}

.summary{background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:12px}
.summary .big{font-size:26px; font-weight:800; color:var(--brand-d); line-height:1.1; font-variant-numeric:tabular-nums}
.summary .big small{font-size:13px; color:var(--muted); font-weight:600}
.summary .row{display:flex; justify-content:space-between; font-size:13px; margin-top:6px; color:var(--ink)}
.summary .note{font-size:11px; color:var(--muted); margin-top:8px; line-height:1.4}
/* 手持ち枚数との差（あと何枚オーバー／余裕） */
.summary .budget{margin:8px 0; padding:8px 10px; border-radius:8px; font-size:12.5px; line-height:1.55}
.summary .budget b{font-weight:800}
.summary .budget.over{background:#fdecec; border:1px solid #f0b4b4; color:#a12a2a}
.summary .budget.ok{background:#eafaf0; border:1px solid #bce8cd; color:#1c7d46}

.pdfopt{margin-top:12px; padding:10px 12px; background:var(--bg); border:1px solid var(--line); border-radius:10px}
.pdfopt-t{font-size:11.5px; font-weight:700; color:var(--muted); margin-bottom:6px}
.pdfopt-row{display:flex; flex-wrap:nowrap; gap:7px}
.pdfopt .chk{display:inline-flex; align-items:center; gap:4px; font-size:13px; color:var(--ink); cursor:pointer; user-select:none; white-space:nowrap}
.pdfopt .chk input{width:14px; height:14px; accent-color:var(--brand); cursor:pointer; flex:none; margin:0}
.pdfopt .chk-sep{border-left:1px solid var(--line); padding-left:7px}
.pdfopt .chk-block{display:flex; width:100%; margin-top:9px; padding-top:9px; border-top:1px solid var(--line); white-space:normal}
.mapfit{margin-top:12px}

.hint{font-size:11.5px; color:var(--muted); line-height:1.5}
.hint b{color:var(--ink)}
/* ②エリアの選び方：2モードの排他トグル。activeを黒地＋黄ラジオドットで一目瞭然にする */
.mode-toggle{display:flex; flex-direction:column; gap:7px; margin-bottom:10px}
.mode-btn{position:relative; width:100%; text-align:left; padding:10px 12px 10px 34px; border:1px solid var(--line); background:#fff; color:var(--ink); border-radius:8px; font-size:12.5px; font-weight:700; cursor:pointer; line-height:1.3}
.mode-btn::before{content:""; position:absolute; left:12px; top:50%; transform:translateY(-50%); width:13px; height:13px; border-radius:50%; border:2px solid #b9b3a4; background:#fff; box-sizing:border-box}
.mode-btn:hover{background:#efeae0}
.mode-btn.active{background:var(--ink); color:#fff; border-color:var(--ink)}
.mode-btn.active:hover{background:#000}
.mode-btn.active::before{border-color:var(--accent); background:var(--accent); box-shadow:inset 0 0 0 2.5px var(--ink)}
.radius-label{font-size:12px; font-weight:700; color:var(--muted); flex:none}

.map-col{display:flex; flex-direction:column; flex:1; min-width:0}
.map-wrap{position:relative; flex:1; min-height:0}
#map{position:absolute; inset:0}

/* 町丁別一覧（地図の下） */
.tract-list{height:190px; overflow:auto; background:#fff; border-top:1px solid var(--line)}
.tract-empty{padding:16px; font-size:12px; color:var(--muted)}
.tract-tbl{width:100%; border-collapse:collapse; font-size:12.5px}
.tract-tbl th,.tract-tbl td{padding:5px 10px; border-bottom:1px solid #eef2f6; text-align:left; white-space:nowrap}
.tract-tbl thead th{position:sticky; top:0; background:#efeae0; color:var(--brand-d); z-index:1}
.tract-tbl .num{text-align:right; font-variant-numeric:tabular-nums}
.tract-tbl tfoot td{position:sticky; bottom:0; background:var(--bg); font-weight:700; border-top:1px solid var(--line)}
.tract-tbl input.ov{width:74px; padding:3px 6px; border:1px solid var(--line); border-radius:6px; font-size:12.5px; text-align:right; font-variant-numeric:tabular-nums; background:#fff}
.tract-tbl input.ov.is-est{color:#98a5b2}
.tract-tbl input.ov.is-act{color:var(--ink); font-weight:700; border-color:#e6c200; background:#fdf7cf}
.tract-tbl input.ov:focus{outline:2px solid var(--brand); outline-offset:-1px}
.tract-tbl .reset{border:none; background:transparent; cursor:pointer; color:#98a5b2; font-size:15px; padding:2px 6px; line-height:1}
.tract-tbl .reset:hover{color:var(--sel)}
.tract-tbl td.rowact{white-space:nowrap; text-align:right}
.tract-tbl .rm{border:none; background:transparent; cursor:pointer; color:#c46; font-size:17px; font-weight:700; padding:2px 6px; line-height:1}
.tract-tbl .rm:hover{color:#fff; background:var(--sel); border-radius:5px}
.dot{display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; vertical-align:middle}
.dot.act{background:#1c8a4e}
.dot.est{background:#c4ccd4}
.citytag{display:inline-block; font-size:10px; color:#5c6b79; background:#eef2f6; border-radius:4px; padding:1px 5px; margin-right:5px}

/* 実数上書きボタン */
.ovbtns{display:flex; flex-wrap:wrap; gap:6px}
.ovbtns .btn{flex:1 1 46%; padding:7px 6px; font-size:12px}

/* サマリーの配布内訳・凡例注記 */
.brk{display:flex; flex-direction:column; gap:3px; margin:8px 0; padding:8px 0; border-top:1px dashed var(--line); border-bottom:1px dashed var(--line)}
.brk>div{display:flex; justify-content:space-between; font-size:13px}
.brk>div b{color:var(--brand-d); font-variant-numeric:tabular-nums}
.lg-note{margin-top:6px; font-size:10.5px; color:var(--muted); max-width:200px; line-height:1.45}

.legend{
  position:absolute; right:12px; bottom:22px; z-index:500; background:rgba(255,255,255,.95);
  border:1px solid var(--line); border-radius:10px; padding:10px 12px; box-shadow:var(--shadow);
  font-size:12px; min-width:150px;
}
.legend .ttl{font-weight:700; margin-bottom:6px; font-size:12px}
.legend .row{display:flex; align-items:center; gap:8px; margin:2px 0}
.legend .sw{width:16px; height:12px; border-radius:2px; border:1px solid rgba(0,0,0,.15)}

.selbar{
  position:absolute; left:50%; transform:translateX(-50%); top:12px; z-index:500; background:rgba(255,255,255,.95);
  border:1px solid var(--line); border-radius:10px; padding:8px 12px; box-shadow:var(--shadow);
  font-size:13px; font-weight:600;
}
.selbar b{color:var(--brand-d)}

footer.app-foot{
  display:flex; align-items:center; gap:8px 16px; flex-wrap:wrap;
  padding:6px 16px; font-size:11px; color:var(--muted); background:var(--panel);
  border-top:1px solid var(--line);
}
footer.app-foot a{color:var(--muted)}
.foot-nav{display:flex; gap:14px; flex:none}
.foot-nav a{color:var(--ink); font-weight:700; text-decoration:none}
.foot-nav a:hover{text-decoration:underline}
.foot-src{color:var(--muted)}

/* leaflet tooltip */
.tw-tip{font-size:12px}
.tw-tip b{color:var(--brand-d)}

@media (max-width:720px){
  .mobile-notice{display:block}
  .app{flex-direction:column}
  aside.side{width:auto; max-height:44vh; border-right:none; border-bottom:1px solid var(--line)}
}

/* ===== PDF提案書（A4・150dpi=1240px幅を想定） ===== */
.pdf-a4{
  width:1240px; min-height:1754px; background:#fff; padding:56px 64px; box-sizing:border-box;
  font-family:"Segoe UI","Hiragino Kaku Gothic ProN","Meiryo",system-ui,sans-serif; color:#1f2a37;
}
.pdf-head{display:flex; justify-content:space-between; align-items:flex-start; border-bottom:3px solid #111111; padding-bottom:14px}
.pdf-title{font-size:40px; font-weight:800; color:#111111}
.pdf-sub{font-size:20px; color:#5c6b79; margin-top:8px}
.pdf-map{width:100%; height:auto; border:1px solid #dbe3ec; border-radius:8px; margin:22px 0; display:block}
.pdf-kpi{display:flex; align-items:center; gap:24px; margin-bottom:18px}
.pdf-kpi .kbig{font-size:54px; font-weight:800; color:#111111; line-height:1; font-variant-numeric:tabular-nums}
.pdf-kpi .kbig span{font-size:22px; margin-left:6px; color:#5c6b79; font-weight:700}
.pdf-kpi .kmeta{font-size:20px; color:#1f2a37; line-height:1.5}
.pdf-tbl{width:100%; border-collapse:collapse; font-size:20px}
.pdf-tbl th,.pdf-tbl td{border-bottom:1px solid #e3e9f0; padding:8px 12px; text-align:left}
.pdf-tbl th{background:#f4f1ea; color:#111111; font-weight:700}
.pdf-tbl .num{text-align:right; font-variant-numeric:tabular-nums}
.pdf-tbl th.feat,.pdf-tbl td.feat{text-align:left}
.pdf-tbl .tag{display:inline-block; background:#f4f1ea; color:#111111; border:1px solid #d9d5c8; border-radius:5px; padding:2px 9px; font-size:15px; line-height:1.3; margin:1px 5px 1px 0; white-space:nowrap}
.pdf-tbl tfoot td{font-weight:700; background:#f4f1ea; border-top:2px solid #111111}
.pdf-foot{margin-top:22px; font-size:14px; color:#5c6b79; line-height:1.6}
.pdf-intro{font-size:19px; color:#1f2a37; line-height:1.6; margin:4px 0 14px}
.pdf-seg{font-size:19px; color:#111111; background:#fdf7cf; border-left:4px solid var(--accent); border-radius:8px; padding:12px 16px; margin:16px 0}
.pdf-outro{font-size:18px; color:#1f2a37; line-height:1.6; margin:18px 0 4px}
