:root {
  --navy: #0B1F4B;
  --yellow: #FFD400;
  --green: #1E9E50;
  --band-yellow: #F2C200;
  --orange: #F07F00;
  --red: #D93025;
  --ink: #1b2233;
  --muted: #5d6679;
  --line: #dde2ec;
  --bg: #f4f6fb;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); line-height: 1.7;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans CJK JP", sans-serif;
  font-size: 16px;
}
.hidden { display: none !important; }
header.site { background: var(--navy); color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
header.site .logo { font-weight: 800; font-size: 20px; letter-spacing: .02em; }
header.site .logo b { color: var(--yellow); }
header.site .sub { font-size: 12px; opacity: .8; }
.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1000px; }
.hero { background: var(--navy); color: #fff; padding: 28px 16px 36px; text-align: center; }
.hero h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.35; }
.hero h1 em { color: var(--yellow); font-style: normal; }
.hero p { margin: 0; font-size: 18px; font-weight: 700; color: var(--yellow); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; margin: 14px 0; box-shadow: 0 1px 3px rgba(11,31,75,.06); }
.card h2 { margin: 0 0 10px; font-size: 18px; color: var(--navy); }
.step { display: inline-block; background: var(--navy); color: var(--yellow); border-radius: 999px; font-size: 12px; font-weight: 800; padding: 1px 10px; margin-right: 6px; vertical-align: 2px; }
label { display: block; font-size: 14px; font-weight: 700; margin: 12px 0 4px; }
label .opt { font-weight: 400; color: var(--muted); font-size: 12px; }
input[type=text], input[type=tel], input[type=email], input[type=password], textarea, select {
  width: 100%; font-size: 16px; padding: 12px; border: 1px solid #b9c1d3; border-radius: 10px; background: #fff; color: var(--ink); font-family: inherit;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(255,212,0,.7); border-color: var(--navy); }
button, .btn {
  display: inline-block; font-family: inherit; font-size: 17px; font-weight: 800; border: 0; border-radius: 12px; padding: 14px 18px;
  background: var(--yellow); color: var(--navy); cursor: pointer; text-align: center; text-decoration: none; min-height: 48px;
}
button.block, .btn.block { display: block; width: 100%; margin-top: 14px; }
button.sub, .btn.sub { background: #fff; color: var(--navy); border: 2px solid var(--navy); }
button.small { font-size: 14px; padding: 8px 12px; min-height: 36px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 8px; align-items: stretch; }
.row input { flex: 1; }
.row button { white-space: nowrap; }
.cands { margin-top: 12px; display: grid; gap: 8px; }
.cand { text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 12px; font-weight: 400; color: var(--ink); width: 100%; }
.cand:hover, .cand.on { border-color: var(--navy); background: #fffbe0; }
.cand b { display: block; color: var(--navy); font-size: 16px; }
.cand span { font-size: 13px; color: var(--muted); }
.msg { margin: 10px 0 0; font-size: 14px; }
.msg.err { color: var(--red); font-weight: 700; }
.note { font-size: 12px; color: var(--muted); }
.chosen { background: #fffbe0; border: 1px solid var(--yellow); border-radius: 10px; padding: 10px 12px; }
.chosen b { color: var(--navy); }
.loading { text-align: center; padding: 24px 8px; font-weight: 700; color: var(--navy); }
.spinner { width: 36px; height: 36px; border: 4px solid var(--line); border-top-color: var(--navy); border-radius: 50%; margin: 0 auto 10px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.bigrank { text-align: center; margin: 4px 0 8px; }
.bigrank .lead { font-size: 15px; color: var(--muted); font-weight: 700; }
.bigrank .num { font-size: 56px; font-weight: 900; color: var(--navy); line-height: 1.2; }
.bigrank .num small { font-size: 24px; }
.bigrank .num.green { color: var(--green); }
.bigrank .num.orange { color: var(--orange); }
.bigrank .num.red { color: var(--red); }
.sumline { text-align: center; font-weight: 700; margin: 0 0 12px; }
.sumline b { color: var(--navy); font-size: 20px; }

.grid { display: grid; gap: 4px; margin: 10px auto; max-width: 420px; }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.grid.g5 { grid-template-columns: repeat(5, 1fr); max-width: 520px; }
.grid.g7 { grid-template-columns: repeat(7, 1fr); max-width: 620px; }
.cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: #fff; font-weight: 800; font-size: 22px; position: relative; }
.g5 .cell { font-size: 17px; }
.g7 .cell { font-size: 14px; border-radius: 6px; }
.cell.green { background: var(--green); }
.cell.yellow { background: var(--band-yellow); color: #3a2f00; }
.cell.orange { background: var(--orange); }
.cell.red { background: var(--red); font-size: .72em; }
.cell.center { outline: 3px solid var(--navy); outline-offset: 1px; z-index: 1; }
.cell.center::after { content: "店"; position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 700; opacity: .9; }
.cell .blur { filter: blur(6px); user-select: none; }
.compass { text-align: center; font-size: 12px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; font-size: 12px; color: var(--muted); margin: 6px 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.i-green { background: var(--green); } .i-yellow { background: var(--band-yellow); } .i-orange { background: var(--orange); } .i-red { background: var(--red); }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 8px 0; }
.tile { background: var(--bg); border-radius: 10px; padding: 10px; text-align: center; }
.tile .v { font-size: 24px; font-weight: 900; color: var(--navy); }
.tile .k { font-size: 12px; color: var(--muted); }
table.cmp { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
table.cmp th, table.cmp td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; }
table.cmp th { background: var(--bg); font-size: 12px; color: var(--muted); }
table.cmp td.n { text-align: right; white-space: nowrap; }
table.cmp tr.me td { background: #fffbe0; font-weight: 700; }
.advice { list-style: none; padding: 0; margin: 8px 0; counter-reset: a; }
.advice li { counter-increment: a; background: var(--bg); border-radius: 10px; padding: 10px 12px 10px 44px; margin: 8px 0; position: relative; }
.advice li::before { content: counter(a); position: absolute; left: 12px; top: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: var(--yellow); font-weight: 800; text-align: center; line-height: 24px; font-size: 14px; }
.advice b { display: block; color: var(--navy); }
.cta { background: var(--navy); color: #fff; border-radius: 14px; padding: 18px 16px; text-align: center; margin: 14px 0; }
.cta p { margin: 0 0 8px; }
.cta .tel { display: block; font-size: 26px; font-weight: 900; color: var(--yellow); text-decoration: none; margin: 6px 0; }
.cta .btn { background: var(--yellow); }
footer.site { text-align: center; font-size: 12px; color: var(--muted); padding: 18px 16px 32px; }
footer.site p { margin: 4px 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }

/* 営業版・管理画面 */
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.cols { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .cols.two { grid-template-columns: 1fr 1fr; } }
.kwblock { border-top: 3px solid var(--navy); margin-top: 18px; padding-top: 10px; }
.kwblock h3 { margin: 0; color: var(--navy); font-size: 20px; }
.tiles.four { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .tiles.four { grid-template-columns: repeat(4, 1fr); } }
.shareurl { display: flex; gap: 8px; }
.shareurl input { flex: 1; font-size: 14px; }
.tablewrap { overflow-x: auto; }
table.leads { border-collapse: collapse; font-size: 13px; min-width: 900px; width: 100%; background: #fff; }
table.leads th, table.leads td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; white-space: nowrap; }
table.leads th { background: var(--navy); color: #fff; }
.meter { height: 12px; background: var(--line); border-radius: 6px; overflow: hidden; margin: 4px 0; }
.meter > span { display: block; height: 100%; background: var(--green); }
.meter > span.warn { background: var(--orange); }
.meter > span.full { background: var(--red); }
.printonly { display: none; }

@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body { background: #fff; font-size: 12px; }
  header.site, .no-print, button, .shareurl, footer.site .nonprint { display: none !important; }
  .printonly { display: block; }
  .wrap, .wrap.wide { max-width: none; padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; margin: 0 0 8px; }
  .cell, .tile, .cta, table.cmp th, table.cmp tr.me td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .kwblock { break-inside: avoid; page-break-inside: avoid; }
  .grid { max-width: 120mm; }
  .grid.g7 { max-width: 130mm; }
  footer.site { padding: 6px 0 0; font-size: 9px; }
  .printhead { border-bottom: 3px solid var(--navy); margin-bottom: 8px; padding-bottom: 4px; }
  .printhead h1 { margin: 0; font-size: 18px; color: var(--navy); }
}
table.cmp td:first-child { white-space: nowrap; }
.card > .row:last-of-type { margin-top: 14px; }
