:root {
  --brand: #0E7C86;
  --brand-ink: #0A5F67;
  --ink: #28324F;
  --muted: #5C667D;
  --line: #D5DAE3;
  --bg: #F3F5F8;
  --card: #FFFFFF;
  --red: #D6293E;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
/* display を指定したクラスより hidden 属性を優先する（候補リストが消えなくなるため） */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.hero { background: var(--brand); color: #fff; padding: 22px 0 20px; }
.hero h1 { margin: 0; font-size: 24px; letter-spacing: .02em; line-height: 1.35; }
.hero p { margin: 4px 0 0; font-size: 14px; opacity: .92; }
.tag {
  display: inline-block; margin-left: 8px; padding: 1px 10px; border-radius: 999px;
  background: #fff; color: var(--brand); font-size: 13px; vertical-align: 3px;
}

.layout { display: grid; gap: 16px; padding-top: 16px; padding-bottom: 8px; }
.col { display: grid; gap: 16px; align-content: start; min-width: 0; }
/* スマホは 検索・結果 → 地図 → 早見表 の順。PCは地図を右に置く */
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-rows: auto 1fr; align-items: start; }
  .col.side { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 16px; }
  .col.table-col { grid-column: 1; grid-row: 2; }
}

.card { background: var(--card); border-radius: var(--radius); padding: 18px 16px; box-shadow: 0 1px 2px rgba(31, 42, 90, .06), 0 4px 16px rgba(31, 42, 90, .05); }
.card h2 { margin: 0 0 10px; font-size: 17px; }

label { display: block; font-weight: 700; margin-bottom: 6px; }
.row { display: flex; gap: 8px; }
input[type="text"], input[type="search"] {
  flex: 1; min-width: 0; height: 48px; padding: 0 12px; font: inherit; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
}
input:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
button { font: inherit; cursor: pointer; }
.primary {
  height: 48px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--brand); color: #fff;
  font-weight: 700; white-space: nowrap;
}
.primary:disabled { opacity: .6; cursor: progress; }
.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.link {
  margin-top: 10px; padding: 6px 0; border: 0; background: none; color: var(--brand-ink);
  font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px;
}
.link:disabled { opacity: .5; }
.status { margin: 8px 0 0; font-size: 14px; min-height: 0; }
.status:empty { display: none; }
.status.error { color: var(--red); font-weight: 700; }

.choices { margin-top: 12px; display: grid; gap: 8px; }
.choices p { margin: 0; font-size: 14px; font-weight: 700; }
.choice {
  text-align: left; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.choice:hover { border-color: var(--brand); }

.result { border-top: 6px solid var(--brand); scroll-margin-top: 12px; }
.result .area { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.4; }
.result .from { margin: 2px 0 12px; font-size: 13px; color: var(--muted); word-break: break-all; }
.fee {
  --zone: #E8EAEE;
  display: grid; justify-items: center; gap: 2px; padding: 16px 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--zone) 32%, #fff); border: 2px solid var(--zone);
}
.fee .band { font-size: 14px; font-weight: 700; padding: 2px 12px; border-radius: 999px; background: var(--zone); }
.fee .band:empty { display: none; }
.fee strong { font-size: 40px; line-height: 1.25; letter-spacing: .01em; }
.fee .per { font-size: 13px; color: var(--muted); }
.cautions { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.cautions li { padding-left: 1.1em; text-indent: -1.1em; }
.cautions li::before { content: "＊"; }

table.fees { width: 100%; border-collapse: collapse; font-size: 15px; }
.fees th, .fees td { padding: 9px 4px; border-bottom: 1px solid var(--line); }
.fees tr:last-child th, .fees tr:last-child td { border-bottom: 0; }
.fees th { text-align: left; font-weight: 500; }
.fees td { text-align: right; font-weight: 800; white-space: nowrap; }
.sw { display: inline-block; width: 14px; height: 14px; margin-right: 8px; border-radius: 4px; vertical-align: -2px; border: 1px solid rgba(0, 0, 0, .08); }
.small { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

.map-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.map-head h2 { margin: 0; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: #fff; color: var(--ink); padding: 6px 12px; font-size: 13px; font-weight: 700; }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.map { aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: #EEF3F8; touch-action: manipulation; }
.map svg { display: block; width: 100%; height: 100%; }
.map .areas path { stroke: #fff; stroke-width: .8; vector-effect: non-scaling-stroke; cursor: pointer; }
.map .areas path:hover { filter: brightness(.95); }
.map .pref { fill: none; stroke: #7A849B; stroke-width: 1.4; vector-effect: non-scaling-stroke; pointer-events: none; }
.map .hl { fill: none; stroke: var(--ink); stroke-width: 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.map .lbl { pointer-events: none; text-anchor: middle; dominant-baseline: middle; paint-order: stroke; stroke: #fff; stroke-linejoin: round; fill: var(--ink); font-weight: 700; }
.map .lbl-pref { fill: #7A849B; font-weight: 800; }
.map .lbl-all { font-weight: 600; }
.map .base circle { fill: var(--red); stroke: #fff; stroke-width: 2.4; }
.map .base .dot { fill: #fff; stroke: none; }
.map .base text { font-size: 12px; font-weight: 800; fill: var(--red); paint-order: stroke; stroke: #fff; stroke-width: 3; dominant-baseline: middle; pointer-events: none; }
.map .pin path { fill: var(--brand); stroke: #fff; stroke-width: 2; }
.map .pin .dot { fill: #fff; }

.extra { margin-top: 14px; display: grid; gap: 10px; font-size: 14px; }
.extra:empty { display: none; }
.extra .line { margin: 0; }
.extra .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ghost {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1.5px solid var(--brand); border-radius: 10px;
  background: #fff; color: var(--brand-ink); font-weight: 700; font-size: 14px; text-decoration: none;
}
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 700; margin: 0; padding: 10px 12px; border-radius: 10px; background: #F3F5F8; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--brand); }
.waived { margin: 0; padding: 10px 12px; border-radius: 10px; border: 2px dashed var(--brand); }
.waived strong { font-size: 22px; }

.notes { padding-top: 8px; padding-bottom: 32px; font-size: 13.5px; }
.notes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.notes .credit { margin-top: 12px; font-size: 12px; color: var(--muted); }

/* 依頼金額の欄と、出張費 − サービス ＝ 合計 の内訳 */
input[type="search"]#q { width: 100%; }
label.mt { margin-top: 14px; }
.yen { flex: 1; min-width: 0; position: relative; display: flex; }
.yen input { padding-right: 36px !important; font-variant-numeric: tabular-nums; }
.yen span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
input[aria-invalid="true"] { border-color: var(--red); }
.calc { margin-top: 12px; }
.calc table { width: 100%; border-collapse: collapse; font-size: 15px; }
.calc th, .calc td { padding: 8px 2px; border-bottom: 1px solid var(--line); vertical-align: top; }
.calc th { text-align: left; font-weight: 700; }
.calc th small { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); line-height: 1.45; }
.calc td { text-align: right; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.calc tr.total th, .calc tr.total td { border-bottom: 0; border-top: 2px solid var(--ink); }
.calc tr.total td { font-size: 20px; }
.calc-hint { margin: 8px 0 0; font-size: 14px; }
.calc-hint:empty { display: none; }
