:root {
  --fs: 20px;
  --bg: #f4f7fb;
  --ink: #14233a;
  --sub: #4a5a72;
  --main: #0b5cad;
  --main-d: #084a8c;
  --accent: #e8590c;
  --ok: #1b7f3b;
  --line: #cfd9e6;
  --card: #fff;
  --warn: #fff4e0;
  --staff: #eef7ee;
  --r: 16px;
}
* { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  line-height: 1.7; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
body.fs-1 { --fs: 24px; }
body.fs-2 { --fs: 29px; }
body:not(.furigana) rt, body:not(.furigana) rp { display: none; }
ruby { ruby-position: over; }
rt { font-size: .5em; font-weight: 400; letter-spacing: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--main); }

/* ヘッダー */
.top {
  position: sticky; top: 0; z-index: 20; background: var(--main); color: #fff;
  padding: .5rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.top .brand { font-weight: 700; font-size: 1.15rem; margin-right: auto; display: flex; align-items: center; gap: .5rem; }
.top .brand button { all: unset; cursor: pointer; }
.tool { display: flex; gap: .35rem; align-items: center; }
.tbtn {
  min-height: 52px; min-width: 52px; padding: 0 .9rem; border-radius: 12px; border: 2px solid rgba(255,255,255,.6);
  background: transparent; color: #fff; font-weight: 700; font-size: .85rem;
}
.tbtn[aria-pressed="true"], .tbtn.on { background: #fff; color: var(--main); border-color: #fff; }
.tbtn.home { background: #fff; color: var(--main); }

.banner-staff { background: var(--ok); color: #fff; padding: .45rem 1rem; display: flex; gap: 1rem; align-items: center; font-weight: 700; }
.banner-staff button { margin-left: auto; min-height: 44px; border-radius: 10px; border: 2px solid #fff; background: transparent; color: #fff; padding: 0 1rem; font-weight: 700; }
.notice { background: var(--warn); border: 2px solid #f0b04a; border-radius: var(--r); padding: .8rem 1rem; margin-bottom: 1rem; font-weight: 700; }

main { max-width: 1100px; margin: 0 auto; padding: 1rem 1rem 6rem; }
h1 { font-size: 1.5rem; margin: .2rem 0; line-height: 1.4; }
h2 { font-size: 1.2rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .3rem; color: var(--ok); }
.crumb { display: flex; gap: .6rem; align-items: center; margin: .3rem 0 1rem; flex-wrap: wrap; }
.back { min-height: 56px; padding: 0 1.2rem; border-radius: 14px; border: 2px solid var(--main); background: #fff; color: var(--main); font-weight: 700; }

/* ホーム */
.hero { text-align: center; margin: .6rem 0 1.2rem; }
.hero h1 { font-size: 1.7rem; }
.hero p { color: var(--sub); margin: .2rem 0 0; }
.searchbox { display: flex; gap: .5rem; margin: 1rem 0 1.4rem; }
.searchbox input {
  flex: 1; min-width: 0; min-height: 64px; font-size: 1.1rem; padding: 0 1rem; border-radius: 14px; border: 3px solid var(--main); background: #fff;
}
.searchbox button { min-width: 120px; min-height: 64px; border-radius: 14px; border: 0; background: var(--main); color: #fff; font-weight: 700; font-size: 1.05rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; }
.tile {
  display: flex; align-items: center; gap: .8rem; min-height: 96px; padding: .8rem 1rem; text-align: left;
  background: #fff; border: 3px solid var(--line); border-radius: var(--r); font-weight: 700; font-size: 1.1rem; box-shadow: 0 2px 0 var(--line);
}
.tile:active { background: #e8f1fb; border-color: var(--main); }
.tile .ic { font-size: 2.2rem; line-height: 1; }
.tile small { display: block; font-weight: 400; color: var(--sub); font-size: .75rem; }
.sec-title { font-size: 1.1rem; margin: 1.6rem 0 .6rem; color: var(--sub); }

/* 一覧 */
.list { display: grid; gap: .7rem; }
.item {
  display: block; width: 100%; text-align: left; background: #fff; border: 3px solid var(--line); border-radius: var(--r);
  padding: .8rem 1rem; min-height: 80px;
}
.item:active { border-color: var(--main); background: #e8f1fb; }
.item .t { font-weight: 700; font-size: 1.1rem; }
.item .k { color: var(--sub); font-size: .75rem; }
.item .d { color: var(--sub); font-size: .85rem; margin-top: .15rem; }
.tag { display: inline-block; font-size: .7rem; padding: 0 .55rem; border-radius: 99px; background: #e5efff; color: var(--main-d); font-weight: 700; margin-right: .3rem; }
.tag.online { background: #fff0e5; color: #b24400; }
.tag.staffonly { background: #e1f3e1; color: var(--ok); }
.empty { text-align: center; color: var(--sub); padding: 2rem 0; }

/* 手続詳細 */
.p-head { margin-bottom: .6rem; }
.kana { color: var(--sub); font-size: .8rem; }
.lead { font-size: 1.1rem; background: #fff; border-left: 8px solid var(--main); padding: .8rem 1rem; border-radius: 8px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .6rem; margin: .8rem 0; }
.card .facts { margin: 0; }
.fact { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: .5rem .8rem; }
.card .fact { background: #f7fafd; }
.fact dt { font-size: .75rem; color: var(--sub); font-weight: 700; }
.fact dd { margin: 0; font-weight: 700; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; margin: 1rem 0; }
.card.note { background: var(--warn); border-color: #f0b04a; }
.card.staff { background: var(--staff); border: 3px solid var(--ok); }
.hint { color: var(--sub); font-size: .8rem; margin: 0 0 .6rem; }
.badge-staff { background: var(--ok); color: #fff; font-weight: 700; padding: .2rem .8rem; border-radius: 8px; display: inline-block; margin-bottom: .5rem; font-size: .8rem; }
.btn-online {
  display: block; margin: 1rem 0; padding: 1rem 1.2rem; border-radius: var(--r); background: var(--accent); color: #fff; text-decoration: none;
  font-size: 1.25rem; font-weight: 700; text-align: center; box-shadow: 0 4px 0 #b8440a;
}
.btn-online small { display: block; font-weight: 400; font-size: .75rem; opacity: .95; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.chk { display: flex; gap: .8rem; align-items: flex-start; padding: .7rem .8rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; min-height: 64px; cursor: pointer; }
.chk input { position: absolute; opacity: 0; pointer-events: none; }
.chk .box { flex: none; width: 2rem; height: 2rem; border: 3px solid var(--main); border-radius: 8px; background: #fff; position: relative; margin-top: .1rem; }
.chk input:checked + .box { background: var(--ok); border-color: var(--ok); }
.chk input:checked + .box::after { content: "✓"; color: #fff; position: absolute; inset: 0; text-align: center; line-height: 1.7rem; font-weight: 700; font-size: 1.3rem; }
.chk input:checked ~ .txt { color: var(--sub); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.chk .txt small, .chk .txt em { display: block; font-size: .8rem; color: var(--sub); font-style: normal; }
.chk .txt em.cond { color: #a23a00; font-weight: 700; }

.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: .8rem; }
.steps li { counter-increment: s; position: relative; padding: .2rem 0 .2rem 3.4rem; min-height: 3rem; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--main); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 1.2rem;
}
.s-title { font-weight: 700; font-size: 1.05rem; }
.s-body { color: #223; margin-top: .1rem; }

.related { display: flex; flex-wrap: wrap; gap: .5rem; }
.related button { min-height: 52px; padding: 0 1rem; border-radius: 12px; border: 2px solid var(--main); background: #fff; color: var(--main); font-weight: 700; }

footer.foot { margin-top: 2rem; color: var(--sub); font-size: .8rem; text-align: center; }
footer.foot .staffbtn { margin-top: 1rem; min-height: 48px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--sub); padding: 0 1rem; }

/* 暗証番号ダイアログ */
.modal { position: fixed; inset: 0; background: rgba(10,20,40,.6); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.dlg { background: #fff; border-radius: 20px; padding: 1.2rem; width: min(380px, 100%); text-align: center; }
.dlg h2 { margin-bottom: .2rem; }
.dots { font-size: 2rem; letter-spacing: .4rem; min-height: 3rem; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.pad button { min-height: 68px; border-radius: 14px; border: 2px solid var(--line); background: #f4f7fb; font-size: 1.5rem; font-weight: 700; }
.pad button.ok { background: var(--main); color: #fff; border-color: var(--main); font-size: 1.1rem; }
.err { color: #c0392b; font-weight: 700; min-height: 1.6rem; }
.dlg .cancel { margin-top: .6rem; min-height: 52px; width: 100%; border-radius: 12px; border: 2px solid var(--line); background: #fff; }

@media (max-width: 700px) { .tbtn { min-width: 46px; padding: 0 .6rem; } .top .brand { width: 100%; } }
@media print { .top, .banner-staff, footer.foot, .back, .btn-online { display: none !important; } }
