/* DEMO歯科クリニック（7R のホームページの見本）
   考え：歯科医院の「歯式（しかしき）」の十字を、最初の画面の骨組みにする。
   色：磁器の白・紺の文字・レモンの黄（予約のボタンと、歯式の今の1本だけ）。
   外への読み込みは無し。字体は端末の字体だけ。 */

:root {
  --porcelain: #F4F7F9;
  --white: #FFFFFF;
  --sky: #E3ECF4;
  --ink: #12284A;
  --ink-2: #475A73;
  --rule: #B9C7D6;
  --lemon: #F6C945;
  --lemon-soft: #FDF3CF;
  --line-green: #06C755;
  --foot-text: #E8EEF5;
  --foot-sub: #B8C6D6;

  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Yu Gothic", "YuGothic", "Meiryo", "Noto Sans JP", sans-serif;
  --wrap: 1120px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--porcelain);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.85;
  font-feature-settings: "palt" 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

h1, h2, h3 { margin: 0; line-height: 1.35; font-weight: 700; }
p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: var(--ink); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--white); padding: 10px 16px; border: 2px solid var(--ink); }
.skip:focus { top: 8px; }

.small { font-size: 13px; color: var(--ink-2); }
.nw { white-space: nowrap; }

/* 見本の帯 */
.demo-band {
  margin: 0;
  padding: 6px var(--gutter);
  background: var(--ink);
  color: var(--white);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}

/* 上の段 */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: var(--white);
  border-bottom: 1px solid var(--rule);
}
.site-head__inner {
  max-width: var(--wrap); margin: 0 auto;
  padding: 8px var(--gutter);
  display: flex; align-items: center; gap: 24px;
  min-height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: .02em; min-height: 44px; }
.brand__mark { width: 28px; height: 28px; color: var(--ink); }
.brand__dot { fill: var(--lemon); }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; font-size: 14.5px; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ボタン */
.btn {
  display: inline-flex; flex-direction: column; justify-content: center; align-items: flex-start;
  min-height: 52px; padding: 10px 20px;
  border: 2px solid var(--ink); border-radius: 6px;
  font-weight: 700; font-size: 16px; line-height: 1.4;
  text-decoration: none; cursor: pointer;
  font-family: inherit;
}
.btn__sub { font-weight: 400; font-size: 13.5px; letter-spacing: .04em; }
.btn--lemon { background: var(--lemon); color: var(--ink); }
.btn--lemon:hover { background: #F2BC1F; }
.btn--ink { background: var(--ink); color: var(--white); }
.btn--ink:hover { background: #0B1D38; }
.btn--ink:focus-visible { outline-color: var(--lemon); box-shadow: 0 0 0 6px var(--ink); }
.btn--line { background: var(--white); color: var(--ink); border-color: var(--ink); position: relative; padding-left: 40px; }
.btn--line::before { content: ""; position: absolute; left: 18px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--line-green); }
.btn--line:hover { background: var(--sky); }
.btn--head { min-height: 44px; padding: 6px 16px; font-size: 14.5px; flex-direction: row; align-items: center; }

.text-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; text-underline-offset: 5px; text-decoration-thickness: 1px; }

/* ===== 最初の画面：歯式の十字 ===== */
.hero {
  position: relative;
  max-width: var(--wrap); margin: 0 auto;
  padding: 40px var(--gutter) 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "tl tr"
    "chart chart"
    "bl br";
  column-gap: 72px;
}
/* 縦の線（歯式の正中） */
.hero::before {
  content: ""; position: absolute; top: 40px; bottom: 48px; left: 50%;
  width: 2px; margin-left: -1px; background: var(--ink);
}
.hero__q { position: relative; z-index: 1; }
.hero__q--tl { grid-area: tl; padding: 8px 0 40px; }
.hero__q--tr { grid-area: tr; padding: 8px 0 40px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; }
.hero__q--bl { grid-area: bl; padding: 40px 0 0; }
.hero__q--br { grid-area: br; padding: 40px 0 0; }

.hero__dept { font-size: 14px; color: var(--ink-2); letter-spacing: .06em; margin-bottom: 14px; }
.hero__title {
  font-size: clamp(40px, 6.4vw, 76px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.01em;
  margin-bottom: 24px;
}
.hero__lead { max-width: 30em; font-size: 16.5px; }

.today { background: var(--white); border: 1px solid var(--rule); border-radius: 6px; padding: 18px 22px; width: 100%; max-width: 420px; }
.today__label { font-size: 13px; color: var(--ink-2); }
.today__value { font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; line-height: 1.4; margin: 4px 0 6px; }
.today__note { font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.hero__q--tr .text-link { margin-top: 8px; }

.hero__ask { font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.cta-set { display: grid; gap: 10px; max-width: 420px; }
.cta-set .btn { width: 100%; }

.mini { display: grid; gap: 10px; }
.mini > div { display: grid; grid-template-columns: 5em 1fr; gap: 12px; border-bottom: 1px solid var(--rule); padding-bottom: 10px; }
.mini dt { font-size: 13.5px; color: var(--ink-2); padding-top: 2px; }
.mini dd { font-weight: 700; }
.hero__q--br .text-link { margin-top: 6px; }

/* 歯式 */
.chart { grid-area: chart; position: relative; z-index: 1; padding: 0; }
.chart__grid { position: relative; padding: 26px 0 0; }
.chart__row {
  display: grid;
  grid-template-columns: repeat(8, 1fr) 28px repeat(8, 1fr);
  align-items: center;
}
.chart__row span {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1;
  font-size: clamp(14px, 2.7vw, 34px);
  font-weight: 300;
  line-height: 1;
  border-radius: 4px;
  transition: background-color 900ms ease, color 900ms ease, font-weight 900ms ease;
}
/* 正中のすき間（9番目の列） */
.chart__row span:nth-child(8) { grid-column: 8; }
.chart__row span:nth-child(9) { grid-column: 10; }
.chart__row--upper { border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.chart__row--lower { padding-top: 6px; }
.chart__row span.is-on { background: var(--lemon); font-weight: 700; }
.chart__side { position: absolute; top: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.chart__side--r { left: 0; }
.chart__side--l { right: 0; }
.chart__cap {
  margin-top: 16px; font-size: 14px; color: var(--ink-2);
  max-width: calc(50% - 36px);
}

/* ===== 各段 ===== */
.sec {
  max-width: var(--wrap); margin: 0 auto;
  padding: 72px var(--gutter);
  border-top: 1px solid var(--rule);
}
.sec__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; align-items: baseline; margin-bottom: 36px; }
.sec__head h2 { font-size: clamp(26px, 3vw, 34px); letter-spacing: .02em; }
.sec__head p { color: var(--ink-2); max-width: 40em; }

/* 診療時間 */
.table-wrap { background: var(--white); border: 1px solid var(--rule); border-radius: 6px; }
.hours { width: 100%; border-collapse: collapse; text-align: center; table-layout: fixed; }
.hours th, .hours td { padding: 16px 4px; border-bottom: 1px solid var(--rule); }
.hours thead th { background: var(--sky); font-size: 15px; font-weight: 700; }
.hours thead th:first-child { width: 30%; }
.hours tbody tr:last-child th, .hours tbody tr:last-child td { border-bottom: 0; }
.hours tbody th { text-align: left; padding-left: 20px; font-weight: 700; font-size: 17px; white-space: nowrap; }
.hours td { font-size: 20px; }
.hours td.off { color: var(--ink-2); }
.hours td.sat { background: var(--lemon-soft); }
.hours__dash { padding: 0 2px; }
.notes { margin-top: 18px; display: grid; gap: 6px; font-size: 15px; }
.notes li { padding-left: 1.2em; text-indent: -1.2em; }
.notes li::before { content: "・"; }

/* 診療の内容：十字で4つに分ける */
.quad { position: relative; display: grid; grid-template-columns: 1fr 1fr; }
.quad::before, .quad::after { content: ""; position: absolute; background: var(--ink); }
.quad::before { top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; }
.quad::after { left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; }
.quad__item { padding: 28px 40px 32px 0; }
.quad__item:nth-child(even) { padding: 28px 0 32px 40px; }
.quad__item h3 { font-size: 20px; margin-bottom: 10px; }
.quad__item p { color: var(--ink); max-width: 30em; }

/* 自由診療の説明の1枚 */
.sec--sheet .sec__head h2 { max-width: 12em; }
.sheet { background: var(--white); border: 2px solid var(--ink); border-radius: 6px; }
.sheet__row { display: grid; grid-template-columns: 12em 1fr; border-bottom: 1px solid var(--rule); }
.sheet__row:last-child { border-bottom: 0; }
.sheet dt { padding: 18px 20px; background: var(--sky); font-weight: 700; font-size: 15px; }
.sheet dd { padding: 18px 24px; }
.sheet .price { display: block; font-weight: 700; font-size: 20px; margin-bottom: 4px; }
.sheet .small { display: block; margin-top: 4px; }
.dash { display: grid; gap: 4px; }
.dash li { padding-left: 1.2em; text-indent: -1.2em; }
.dash li::before { content: "・"; }

/* はじめての方へ */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; counter-reset: step; border-top: 2px solid var(--ink); }
.steps li { counter-increment: step; padding: 20px 20px 4px 0; position: relative; }
.steps li + li { padding-left: 20px; border-left: 1px solid var(--rule); }
.steps li::before { content: counter(step); display: block; font-size: 40px; font-weight: 200; line-height: 1; margin-bottom: 12px; }
.steps h3 { font-size: 18px; margin-bottom: 6px; }
.steps p { font-size: 15px; color: var(--ink-2); }

.faq { margin-top: 56px; }
.faq__title { font-size: 20px; margin-bottom: 14px; }
.faq dl { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.faq dl > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.faq dt { font-weight: 700; }

/* 院長 */
.incho { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; }
.incho__text { grid-column: 2; font-size: 19px; line-height: 2; max-width: 30em; }
.incho__name { grid-column: 2; font-weight: 700; margin-top: 20px; }
.incho__name span { margin-left: 12px; font-weight: 400; font-size: 14px; color: var(--ink-2); }

/* 場所 */
.place { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; margin-bottom: 14px; }
.place__map { width: 100%; height: auto; display: block; border: 1px solid var(--rule); border-radius: 6px; background: var(--white); }
.m-bg { fill: var(--white); }
.m-road { stroke: var(--sky); stroke-width: 26; fill: none; }
.m-road--thin { stroke-width: 14; }
.m-station { fill: var(--ink); }
.m-clinic { fill: var(--lemon); stroke: var(--ink); stroke-width: 2; }
.m-route { fill: none; stroke: var(--ink); stroke-width: 3; stroke-dasharray: 2 8; stroke-linecap: round; }
.m-label { font: 700 19px var(--sans); fill: var(--ink); }
.m-label--light { fill: var(--white); }
.m-small { font: 400 16px var(--sans); fill: var(--ink); }
.place__info { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.place__info > div { display: grid; grid-template-columns: 4em 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.place__info dt { color: var(--ink-2); font-size: 14px; padding-top: 2px; }

/* フォーム */
.form { background: var(--white); border: 1px solid var(--rule); border-radius: 6px; padding: 32px; display: grid; gap: 26px; max-width: 760px; }
.field { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.field > label, .field > legend { font-weight: 700; font-size: 15.5px; padding: 0; margin-bottom: 8px; }
.field input[type="text"] {
  width: 100%; min-height: 52px; padding: 10px 14px;
  font: inherit; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--ink-2); border-radius: 6px;
}
.field input[type="text"]:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-color: var(--ink); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choices--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--rule); border-radius: 6px; cursor: pointer; line-height: 1.45; }
.choice input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--ink); }
.choice:has(input:checked) { border-color: var(--ink); background: var(--lemon-soft); }
.choice:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.choice input:focus-visible { outline: none; }
.btn--submit { justify-self: start; min-width: 220px; align-items: center; }
.form__result { font-weight: 700; }
.form__result:not(:empty) { background: var(--lemon-soft); border-left: 4px solid var(--ink); padding: 12px 16px; }

/* 下の段 */
.site-foot { background: var(--ink); color: var(--foot-text); margin-top: 40px; }
.site-foot__inner { max-width: var(--wrap); margin: 0 auto; padding: 56px var(--gutter) 64px; }
.site-foot__name { font-weight: 700; font-size: 20px; margin-bottom: 20px; color: var(--white); }
.site-foot__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.site-foot__list > div { display: grid; grid-template-columns: 8em 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid #2E4468; font-size: 14.5px; }
.site-foot__list dt { color: var(--foot-sub); }
.site-foot__demo { margin-top: 28px; font-size: 13px; color: var(--foot-sub); }

/* スマホの下の固定ボタン */
.dock { display: none; }

/* 知らせ */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40;
  transform: translateX(-50%);
  width: min(92vw, 460px);
  background: var(--ink); color: var(--white);
  padding: 14px 18px; border-radius: 6px;
  border-left: 6px solid var(--lemon);
  font-size: 15px; line-height: 1.6;
}

/* ===== 幅の狭い画面 ===== */
@media (max-width: 960px) {
  .site-nav { display: none; }
  .btn--head { margin-left: auto; }
  .hero { column-gap: 40px; }
}

@media (max-width: 720px) {
  body { padding-bottom: 76px; }
  .site-head__inner { min-height: 56px; gap: 12px; }
  .brand { font-size: 15.5px; }
  .btn--head { display: none; }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas: "tl" "tr" "chart" "bl" "br";
    padding-top: 28px; padding-bottom: 36px;
  }
  .hero::before { display: none; }
  .hero__q--tl { padding: 0 0 20px; }
  .hero__q--tr { padding: 0 0 28px; }
  .hero__q--bl { padding: 28px 0 0; }
  .hero__q--br { padding: 28px 0 0; }
  .hero__lead { font-size: 16px; }
  .today { max-width: none; }
  .cta-set { max-width: none; }

  .chart__row { grid-template-columns: repeat(8, 1fr) 12px repeat(8, 1fr); }
  .chart__grid::after { content: ""; position: absolute; left: 50%; top: 22px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); }
  .chart__row span { font-size: 16px; border-radius: 3px; }
  .chart__cap { font-size: 13.5px; max-width: none; }

  .sec { padding: 52px var(--gutter); }
  .sec__head { grid-template-columns: 1fr; gap: 10px; margin-bottom: 26px; }

  .hours th, .hours td { padding: 12px 0; }
  .hours thead th { font-size: 13.5px; }
  .hours thead th:first-child { width: 31%; }
  .hours tbody th { padding-left: 8px; font-size: 13px; }
  .hours td { font-size: 16px; }

  .quad { grid-template-columns: 1fr; }
  .quad::before, .quad::after { display: none; }
  .quad__item, .quad__item:nth-child(even) { padding: 20px 0 22px; border-top: 2px solid var(--ink); }

  .sheet__row { grid-template-columns: 1fr; }
  .sheet dt { padding: 12px 16px; }
  .sheet dd { padding: 14px 16px 18px; }

  .steps { grid-template-columns: 1fr; border-top: 0; border-left: 2px solid var(--ink); }
  .steps li, .steps li + li { padding: 4px 0 22px 20px; border-left: 0; display: grid; grid-template-columns: 40px 1fr; column-gap: 8px; }
  .steps li::before { grid-row: span 2; font-size: 30px; margin: 0; }
  .faq dl > div { grid-template-columns: 1fr; gap: 4px; }

  .incho { grid-template-columns: 1fr; }
  .incho__text, .incho__name { grid-column: 1; font-size: 17px; }
  .incho__name { font-size: 16px; }

  .place { grid-template-columns: 1fr; gap: 24px; }

  .form { padding: 20px 16px; }
  .choices, .choices--3 { grid-template-columns: 1fr; }
  .btn--submit { width: 100%; }

  .site-foot__list { grid-template-columns: 1fr; }
  .site-foot__list > div { grid-template-columns: 7em 1fr; }

  .dock {
    display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 6px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: var(--white); border-top: 1px solid var(--rule);
  }
  .dock__btn {
    display: flex; align-items: center; justify-content: center;
    min-height: 52px; border-radius: 6px;
    background: var(--ink); color: var(--white);
    font-weight: 700; text-decoration: none; font-size: 15px;
  }
  .dock__btn--lemon { background: var(--lemon); color: var(--ink); }
  .dock__btn--line { background: var(--white); color: var(--ink); border: 2px solid var(--ink); }
  .dock__btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
  .dock__btn:not(.dock__btn--lemon):not(.dock__btn--line):focus-visible { outline-color: var(--lemon); box-shadow: 0 0 0 5px var(--ink); }
  .toast { bottom: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  .chart__row span { transition: none; }
}
