/* おうち鉄道 / Rail Room — 紹介サイト
   色はアプリの画面（クリーム色のトレイ・紺のボタン・オレンジの選択色）からとっている。 */

:root {
  --cream: #fff6e6;
  --cream-deep: #f7e9cf;
  --paper: #fffdf8;
  --ink: #2b3147;
  --ink-soft: #5a6078;
  --line: #e6d7b8;
  --orange: #f2953b;
  --orange-deep: #d9772a;
  --green: #2fae66;
  --blue: #3b82e6;
  --purple: #7b5bd6;
  --red: #c8442f;
  --rail: #8d7a66;
  --sleeper: #7a4f33;
  --radius: 22px;
  --shadow: 0 10px 0 rgba(43, 49, 71, 0.08), 0 24px 48px rgba(43, 49, 71, 0.12);
  --font-round: "Hiragino Maru Gothic ProN", "Zen Maru Gothic", "Arial Rounded MT Bold", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
  --font-body: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  overflow-x: hidden;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--orange-deep); }

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

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 10px;
}
.skip:focus { left: 8px; }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 40px); margin-inline: auto; }

h1, h2, h3 { font-family: var(--font-round); line-height: 1.3; margin: 0; font-weight: 700; word-break: auto-phrase; text-wrap: balance; line-break: strict; }
/* 文節の途中で折り返さないためのかたまり */
.nb { display: inline-block; }
h2 { font-size: clamp(1.7rem, 4.6vw, 2.6rem); letter-spacing: 0.02em; text-wrap: balance; }
h3 { font-size: 1.2rem; }
p { margin: 0; line-break: strict; }
summary { word-break: auto-phrase; line-break: strict; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-round); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.14em;
  color: var(--orange-deep);
  margin-bottom: 10px;
}

/* ---------- ヘッダー ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 246, 230, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 3px 0 rgba(43, 49, 71, 0.15); }
.brand b { font-family: var(--font-round); font-size: 1.15rem; letter-spacing: 0.04em; }
.brand small { display: block; font-size: 0.68rem; color: var(--ink-soft); letter-spacing: 0.12em; line-height: 1.1; }
.nav { display: flex; gap: 4px; }
.nav a {
  font-family: var(--font-round); font-weight: 700; font-size: 0.92rem;
  color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 12px;
}
.nav a:hover { background: var(--cream-deep); }
@media (max-width: 820px) { .nav { display: none; } }

/* ---------- ボタン ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-round); font-weight: 700; font-size: 1.02rem;
  padding: 14px 26px; border-radius: 18px; border: 0; cursor: pointer;
  text-decoration: none; color: #fff; background: var(--ink);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 7px 0 rgba(0, 0, 0, 0.22); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.22); }
.btn-go { background: var(--green); }
.btn-orange { background: var(--orange); }
.btn-ghost { background: var(--paper); color: var(--ink); box-shadow: 0 5px 0 var(--line); }
.btn-ghost:hover { color: var(--ink); box-shadow: 0 7px 0 var(--line); }
.btn-small { font-size: 0.9rem; padding: 9px 16px; border-radius: 14px; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22); }
.btn[aria-disabled="true"] { cursor: default; }
.btn .play { width: 0; height: 0; border-left: 14px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }

/* ---------- ヒーロー ---------- */

.hero { padding: 48px 0 0; position: relative; }
.hero-copy { text-align: center; }
.hero-logo { width: min(520px, 78%); margin: 0 auto -6px; filter: drop-shadow(0 10px 14px rgba(43, 49, 71, 0.25)); }
.hero h1 { font-size: clamp(2.6rem, 9vw, 5.2rem); letter-spacing: 0.06em; }
.hero h1 span { color: var(--orange-deep); }
.tagline {
  font-family: var(--font-round); font-weight: 700;
  font-size: clamp(1.05rem, 3vw, 1.5rem); letter-spacing: 0.12em; margin-top: 8px;
}
.tagline i { font-style: normal; display: inline-block; }
.tagline i:nth-child(1) { color: var(--orange-deep); }
.tagline i:nth-child(2) { color: var(--green); }
.tagline i:nth-child(3) { color: var(--blue); }
.tagline i:nth-child(4) { color: var(--purple); }
.hero-lead { max-width: 620px; margin: 18px auto 0; color: var(--ink-soft); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 26px; }
.hero-note { font-size: 0.82rem; color: var(--ink-soft); margin-top: 14px; }

/* 横向きの iPhone の枠。動画とスクリーンショットをこの中に入れる */
.device {
  background: #1b2030; border-radius: clamp(18px, 3.4vw, 40px);
  padding: clamp(6px, 1.1vw, 13px);
  box-shadow: var(--shadow);
  position: relative;
}
.device > img, .device > video {
  width: 100%; height: auto; border-radius: clamp(12px, 2.4vw, 28px); background: #10131c;
}
.hero-screen { width: min(980px, 100% - 32px); margin: 40px auto 0; }
.video-wrap { position: relative; }
.video-toggle {
  position: absolute; right: 14px; bottom: 14px;
  font-family: var(--font-round); font-weight: 700; font-size: 0.8rem;
  background: rgba(27, 32, 48, 0.78); color: #fff; border: 0; border-radius: 12px; padding: 7px 12px; cursor: pointer;
}
.caption { text-align: center; font-size: 0.82rem; color: var(--ink-soft); margin-top: 14px; }

/* ---------- 線路の仕切り（小さな電車が走る） ---------- */

.track { position: relative; height: 54px; margin-top: 34px; overflow: hidden; }
.track::before {
  /* まくらぎ */
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 16px;
  background: repeating-linear-gradient(90deg, var(--sleeper) 0 8px, transparent 8px 26px);
  opacity: 0.85;
}
.track::after {
  /* レール 2 本 */
  content: ""; position: absolute; left: 0; right: 0; bottom: 9px; height: 10px;
  border-top: 3px solid var(--rail); border-bottom: 3px solid var(--rail);
}
.toy-train {
  position: absolute; bottom: 19px; left: 0; display: flex; gap: 3px; z-index: 1;
  animation: run 22s linear infinite;
}
.toy-train b {
  display: block; width: 58px; height: 24px; border-radius: 6px 6px 3px 3px;
  background:
    linear-gradient(var(--band, #f4ecd6), var(--band, #f4ecd6)) 0 14px / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, var(--glass, #1b2030) 0 9px, transparent 9px 14px) 6px 5px / 46px 7px no-repeat,
    var(--c, var(--green));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}
.toy-train b:last-child { border-radius: 6px 12px 3px 3px; }

/* 気動車：オレンジとクリームの 2 両 */
.t-diesel b { --c: #e8742a; --band: #f6e7c4; width: 62px; }
/* 高速列車：白い車体に青い帯、長い鼻。速い */
.t-bullet { animation-duration: 9s; }
.t-bullet b { --c: #f4f6f8; --band: #2b6fd6; width: 66px; height: 21px; box-shadow: inset 0 -3px 0 rgba(43, 111, 214, 0.35); }
.t-bullet b:last-child { border-radius: 6px 46px 4px 3px; width: 78px; }
.t-bullet b:first-child { border-radius: 46px 6px 3px 4px; width: 78px; }
/* 貨物列車：青い機関車とコンテナ */
.t-freight { animation-duration: 30s; }
.t-freight b { background: var(--c); width: 50px; height: 20px; border-radius: 3px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25), inset 16px 0 0 -14px rgba(0, 0, 0, 0.2); }
.t-freight b:nth-child(1) { --c: #c8442f; }
.t-freight b:nth-child(2) { --c: #2e7d4f; }
.t-freight b:nth-child(3) { --c: #d98a1f; }
.t-freight b:nth-child(4) { --c: #5a6078; }
.t-freight b:last-child {
  width: 60px; height: 26px; border-radius: 5px 10px 3px 3px;
  background:
    linear-gradient(#f4ecd6, #f4ecd6) 0 16px / 100% 2px no-repeat,
    linear-gradient(#1b2030, #1b2030) 38px 5px / 14px 8px no-repeat,
    #2458b8;
}
/* 蒸気機関車：黒い機関車とえんじ色の客車。煙がのぼる */
.t-steam { animation-duration: 26s; }
.t-steam b { --c: #8e2430; --band: #e6b84a; --glass: #f6e7c4; }
.t-steam b:last-child {
  position: relative; width: 64px; height: 20px; align-self: flex-end; border-radius: 4px 12px 3px 3px;
  background:
    linear-gradient(#1e1f22, #1e1f22) 0 -8px / 22px 100% no-repeat,
    radial-gradient(circle at 50% 50%, #c8442f 0 3px, transparent 4px) 26px 12px / 12px 12px repeat-x,
    #1e1f22;
  box-shadow: none; overflow: visible;
}
.t-steam b:last-child::before {
  /* 運転室と煙突 */
  content: ""; position: absolute; left: 0; bottom: 100%; width: 22px; height: 9px; background: #1e1f22; border-radius: 4px 4px 0 0;
  box-shadow: 34px 3px 0 -1px #1e1f22, 46px 5px 0 -2px #e6b84a;
}
.t-steam b:last-child::after {
  /* 煙 */
  content: ""; position: absolute; left: 30px; bottom: 30px; width: 12px; height: 12px; border-radius: 50%;
  background: rgba(120, 124, 140, 0.55);
  box-shadow: -14px -8px 0 3px rgba(120, 124, 140, 0.38), -34px -14px 0 6px rgba(120, 124, 140, 0.22);
  animation: puff 1.6s ease-in-out infinite;
}
@keyframes puff { 50% { transform: translate(-4px, -4px) scale(1.15); opacity: 0.7; } }

/* 右から左へ走る */
.toy-train.rev { animation-name: run-rev; flex-direction: row-reverse; }
.toy-train.rev b:last-child { border-radius: 12px 6px 3px 3px; }
.t-bullet.rev b:last-child { border-radius: 46px 6px 3px 4px; }
.t-bullet.rev b:first-child { border-radius: 6px 46px 4px 3px; }
@keyframes run-rev { from { transform: translateX(100vw); } to { transform: translateX(-340px); } }
.track.tall { height: 84px; }
.track.in-band { margin-top: 56px; margin-bottom: -84px; }
@keyframes run { from { transform: translateX(-340px); } to { transform: translateX(100vw); } }

/* ---------- セクション ---------- */

section { padding: 84px 0; }
section[id], h2[id] { scroll-margin-top: 66px; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head p { color: var(--ink-soft); max-width: 640px; margin: 14px auto 0; }
.band { background: var(--paper); border-block: 2px solid var(--line); }
.band-ink { background: var(--ink); color: #fff; }
.band-ink .eyebrow { color: #ffc27d; }
.band-ink .section-head p { color: #c6cbe0; }

/* 4 つの遊び */
.play-row { display: grid; gap: 28px; align-items: center; margin-bottom: 72px; }
.play-row:last-child { margin-bottom: 0; }
@media (min-width: 860px) {
  .play-row { grid-template-columns: 5fr 7fr; gap: 56px; }
  .play-row.flip .play-text { order: 2; }
}
.play-num {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-round); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.1em;
  color: #fff; padding: 6px 16px 6px 8px; border-radius: 999px; margin-bottom: 14px;
}
.play-num em {
  font-style: normal; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; font-size: 1rem;
}
.c-orange { background: var(--orange); } .c-orange em { color: var(--orange-deep); }
.c-green { background: var(--green); } .c-green em { color: var(--green); }
.c-blue { background: var(--blue); } .c-blue em { color: var(--blue); }
.c-purple { background: var(--purple); } .c-purple em { color: var(--purple); }
.play-text h3 { font-size: clamp(1.5rem, 3.6vw, 2rem); margin-bottom: 12px; }
.play-text p { color: var(--ink-soft); }
.play-text ul { margin: 16px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.play-text li {
  font-family: var(--font-round); font-weight: 700; font-size: 0.85rem;
  background: var(--cream-deep); border-radius: 999px; padding: 4px 14px;
}

/* 動画の帯 */
.movie { width: min(900px, 100%); margin-inline: auto; }
.view-pills { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.view-pill {
  font-family: var(--font-round); font-weight: 700; font-size: 1rem; cursor: pointer;
  padding: 11px 24px; border-radius: 16px; border: 0; color: #fff; background: var(--blue);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3); transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.view-pill:hover { transform: translateY(-2px); box-shadow: 0 7px 0 rgba(0, 0, 0, 0.3); }
.view-pill:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }
.view-pill[aria-pressed="true"] { background: var(--orange); }
.caption.on-dark { color: #c6cbe0; }

/* 画像の見出しつきの枠・縦にならべる */
figure { margin: 0; }
figure.device figcaption {
  position: absolute; left: clamp(14px, 2.2vw, 26px); bottom: clamp(14px, 2.2vw, 26px);
  font-family: var(--font-round); font-weight: 700; font-size: 0.8rem; color: #fff;
  background: rgba(27, 32, 48, 0.78); border-radius: 999px; padding: 4px 14px;
}
.stack { display: grid; gap: 22px; }
.shot-note { text-align: center; font-size: 0.85rem; color: var(--ink-soft); margin-top: 8px; }
.bg-gallery { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-bottom: 22px; }
.bg-gallery .device { margin: 0; box-shadow: none; }
.bg-gallery .device:first-child { grid-column: 1 / -1; }

/* 部屋と AR */
.duo { display: grid; gap: 24px; }
@media (min-width: 860px) { .duo { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 28px;
  box-shadow: 0 6px 0 var(--line);
}
.card h3 { margin-bottom: 10px; font-size: 1.35rem; }
.card p { color: var(--ink-soft); }
.card .device { margin-bottom: 22px; box-shadow: none; }
/* 車両の一覧（横に流す） */
.train-strip {
  display: flex; gap: 18px; overflow-x: auto; padding: 8px 20px 28px;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
  scroll-padding-inline: 20px;
}
.train-card {
  flex: 0 0 min(340px, 80vw); scroll-snap-align: start; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 6px 0 var(--line); position: relative;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.train-card:hover { transform: translateY(-3px); box-shadow: 0 9px 0 var(--line); }
.train-card img { width: 100%; aspect-ratio: 900 / 506; object-fit: cover; background: #fffde9; }
.train-card .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 14px; }
.train-card b { font-family: var(--font-round); font-size: 1rem; line-height: 1.4; }
.train-card .spin {
  position: absolute; top: 10px; right: 10px; font-family: var(--font-round); font-weight: 700; font-size: 0.74rem;
  background: rgba(43, 49, 71, 0.82); color: #fff; border-radius: 999px; padding: 3px 11px;
}
.tag {
  flex: none; font-family: var(--font-round); font-weight: 700; font-size: 0.78rem;
  border-radius: 999px; padding: 3px 12px; background: var(--cream-deep); color: var(--ink);
}
.tag-free { background: var(--green); color: #fff; }
.strip-hint { text-align: center; font-size: 0.82rem; color: var(--ink-soft); }

/* 料金 */
.free-box {
  background: var(--green); color: #fff; border-radius: var(--radius); padding: 32px;
  box-shadow: 0 8px 0 #238a50; margin-bottom: 36px;
}
.free-box h3 { font-size: 1.6rem; margin-bottom: 8px; }
.free-box ul { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 8px 24px; }
@media (min-width: 700px) { .free-box ul { grid-template-columns: 1fr 1fr; } }
.free-box li { padding-left: 30px; position: relative; font-weight: 600; }
.free-box li::before {
  content: ""; position: absolute; left: 4px; top: 0.55em; width: 14px; height: 8px;
  border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(-45deg);
}
.price-grid { display: grid; gap: 18px; }
@media (min-width: 700px) { .price-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .price-grid { grid-template-columns: 1fr 1fr 1fr; } }
.price-card {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 8px;
}
.price-card .kind { font-family: var(--font-round); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.1em; color: var(--orange-deep); }
.price-card h3 { font-size: 1.12rem; }
.price-card p { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.7; flex: 1; }
.price-card .yen { font-family: var(--font-round); font-weight: 700; font-size: 1.5rem; }
.price-card .yen small { font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; margin-right: 6px; }
.price-card.wide { grid-column: 1 / -1; background: var(--ink); color: #fff; border-color: var(--ink); }
.price-card.wide .kind { color: #ffc27d; }
.price-card.wide p { color: #c6cbe0; }
.price-card.wide .yen small { color: #c6cbe0; }
.price-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 22px; }
.price-note li { margin-bottom: 4px; }

/* 安心 */
.safe-grid { display: grid; gap: 18px; }
@media (min-width: 700px) { .safe-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .safe-grid { grid-template-columns: repeat(3, 1fr); } }
.safe {
  background: rgba(255, 255, 255, 0.07); border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius); padding: 24px;
}
.safe h3 { color: #ffc27d; margin-bottom: 8px; }
.safe p { color: #dfe3f2; font-size: 0.95rem; }

/* よくある質問 */
.faq details {
  background: var(--paper); border: 2px solid var(--line); border-radius: 18px; margin-bottom: 12px;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 54px 18px 22px; position: relative;
  font-family: var(--font-round); font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; translate: 0 -50%;
  font-size: 1.5rem; color: var(--orange-deep); line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 22px 20px; color: var(--ink-soft); }

/* 最後のよびかけ */
.final { text-align: center; }
.final img { width: 120px; height: 120px; border-radius: 28px; margin: 0 auto 22px; box-shadow: var(--shadow); }
.final p { color: var(--ink-soft); margin: 12px auto 26px; max-width: 520px; }

/* ---------- フッター ---------- */

.site-footer { background: var(--ink); color: #c6cbe0; padding: 52px 0 36px; font-size: 0.9rem; }
.site-footer a { color: #fff; }
.foot-grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h4 { font-family: var(--font-round); color: #ffc27d; font-size: 0.85rem; letter-spacing: 0.12em; margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot-brand b { font-family: var(--font-round); color: #fff; font-size: 1.2rem; }
.fine { border-top: 1px solid rgba(255, 255, 255, 0.16); margin-top: 32px; padding-top: 20px; font-size: 0.78rem; line-height: 1.8; }

/* ---------- 文書のページ（プライバシー・特商法・規約・サポート） ---------- */

.doc { padding: 56px 0 84px; }
.doc h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); margin-bottom: 8px; }
.doc .lead { color: var(--ink-soft); margin-bottom: 36px; }
.doc h2 {
  font-size: 1.3rem; margin: 44px 0 12px; padding-left: 14px; border-left: 6px solid var(--orange);
}
.doc h3 { font-size: 1.05rem; margin: 24px 0 8px; }
.doc p, .doc ul, .doc ol { margin: 0 0 14px; }
.doc li { margin-bottom: 6px; }
.doc .updated { color: var(--ink-soft); font-size: 0.9rem; margin-top: 48px; }
.sheet { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 5vw, 44px); }

.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: 14px 12px; border-bottom: 2px solid var(--line); }
.table th { width: 30%; font-family: var(--font-round); white-space: nowrap; }
.table td.num { text-align: right; white-space: nowrap; font-family: var(--font-round); font-weight: 700; }
@media (max-width: 600px) {
  .table.stack th, .table.stack td { display: block; width: 100%; }
  .table.stack th { border-bottom: 0; padding-bottom: 0; color: var(--orange-deep); }
}

/* 問い合わせフォーム */
.form { display: grid; gap: 18px; margin-top: 20px; }
.form label { font-family: var(--font-round); font-weight: 700; display: block; }
/* 欄の説明（クラスのない span） */
.form label:not(.topic):not(.agree) > span:not([class]) { display: block; font-weight: 400; font-size: 0.82rem; color: var(--ink-soft); font-family: var(--font-body); }
.form label > input, .form label > select, .form label > textarea { margin-top: 6px; display: block; }
.form label .err, .form label .count { display: block; }
.form input, .form select, .form textarea {
  font: inherit; font-family: var(--font-body); font-weight: 400; color: var(--ink);
  padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; width: 100%;
}
.form textarea { min-height: 170px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--blue); outline: none; }
.form .hp { position: absolute; left: -9999px; }
.form .agree { display: flex; gap: 10px; align-items: flex-start; font-family: var(--font-body); font-weight: 400; }
.form > .err { color: var(--red); font-weight: 700; font-size: 0.82rem; margin-top: -12px; }
.form .agree input { width: 20px; height: 20px; margin-top: 5px; flex: none; }
.form-status { font-family: var(--font-round); font-weight: 700; min-height: 1.6em; }
.form-status.ok { color: var(--green); }
.form-status.ng { color: var(--red); }
.mail-box {
  background: var(--cream-deep); border-radius: 16px; padding: 16px 20px; margin-top: 18px;
  font-family: var(--font-round); font-weight: 700; word-break: break-all;
}

/* 404 */
.lost { text-align: center; padding: 96px 0; }
.lost h1 { font-size: clamp(3rem, 14vw, 6rem); color: var(--orange-deep); }

/* ---------- 車両の 360 度ビュー ---------- */

.viewer {
  border: 0; padding: 0; border-radius: 26px; background: var(--paper); color: var(--ink);
  width: min(880px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.viewer::backdrop { background: rgba(27, 32, 48, 0.72); }
.viewer-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px 22px; }
.viewer-head h3 { font-size: 1.3rem; margin-right: auto; }
.viewer-close {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: var(--ink); color: #fff; font-size: 1.4rem; line-height: 1; font-family: var(--font-round);
}
.viewer-stage {
  aspect-ratio: 16 / 9; background-color: #fffde9; background-repeat: no-repeat; background-size: 600% 600%;
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; position: relative;
}
.viewer-stage.dragging { cursor: grabbing; }
.viewer-stage.loading::after {
  content: "よみこみ中…"; position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-round); font-weight: 700; color: var(--ink-soft); background: rgba(255, 253, 233, 0.7);
}
.viewer-foot { padding: 14px 22px 20px; display: grid; gap: 10px; }
.viewer-foot input[type="range"] { width: 100%; accent-color: var(--orange); height: 28px; }
.viewer-ctrl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.viewer-ctrl p { font-size: 0.85rem; color: var(--ink-soft); margin-right: auto; }

/* ---------- AR のイメージ ---------- */

.ar-scene { position: relative; margin-bottom: 22px; border-radius: 18px; overflow: hidden; aspect-ratio: 3 / 2; background: #cfc2ae; }
.ar-scene > img { width: 100%; height: 100%; object-fit: cover; }
.ar-note { position: absolute; left: 10px; bottom: 8px; font-size: 0.7rem; color: #fff; background: rgba(27, 32, 48, 0.6); padding: 2px 9px; border-radius: 999px; }

/* ---------- ホームへもどる丸いボタン（文書のページ） ---------- */

.home-fab {
  position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 60;
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: var(--orange); color: #fff; text-decoration: none;
  box-shadow: 0 5px 0 var(--orange-deep), 0 12px 24px rgba(43, 49, 71, 0.28);
  transition: transform 0.12s ease;
}
.home-fab:hover { transform: translateY(-2px); color: #fff; }
.home-fab svg { width: 30px; height: 30px; }
.home-fab span { position: absolute; left: -9999px; }

/* ---------- お問い合わせフォーム（拡充） ---------- */

.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 22px; font-family: var(--font-round); font-weight: 700; font-size: 0.85rem; }
.steps li { flex: 1; text-align: center; padding: 8px 4px; border-radius: 12px; background: var(--cream-deep); color: var(--ink-soft); margin: 0; }
.steps li[aria-current="step"] { background: var(--orange); color: #fff; }
.topic-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 0; padding: 0; margin: 0; }
.topic-grid legend { font-family: var(--font-round); font-weight: 700; padding: 0; margin-bottom: 8px; }
.topic { position: relative; }
.topic input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.topic span {
  display: block; padding: 14px 12px; border-radius: 16px; border: 2px solid var(--line); background: #fff;
  font-family: var(--font-round); font-weight: 700; text-align: center; line-height: 1.4;
}
.topic small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.74rem; color: var(--ink-soft); }
.topic input:checked + span { border-color: var(--orange); background: #fff3e2; box-shadow: 0 4px 0 var(--orange); }
.topic input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.hint-box { background: #eef5ff; border: 2px solid #cfe0fb; border-radius: 16px; padding: 14px 18px; font-size: 0.92rem; }
.hint-box p { margin: 0; }
.field-row { display: grid; gap: 18px; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
.req { font-family: var(--font-round); font-size: 0.7rem; color: #fff; background: var(--red); border-radius: 6px; padding: 1px 7px; margin-left: 8px; font-weight: 700; }
.opt { font-family: var(--font-round); font-size: 0.7rem; color: var(--ink-soft); background: var(--cream-deep); border-radius: 6px; padding: 1px 7px; margin-left: 8px; font-weight: 700; }
.form label .err { color: var(--red); font-weight: 700; font-size: 0.82rem; min-height: 0; }
.form [aria-invalid="true"] { border-color: var(--red); }
.count { text-align: right; font-size: 0.8rem; color: var(--ink-soft); font-family: var(--font-body); font-weight: 400; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.confirm dl { display: grid; gap: 4px 16px; margin: 0 0 20px; }
@media (min-width: 640px) { .confirm dl { grid-template-columns: 11em 1fr; } }
.confirm dt { font-family: var(--font-round); font-weight: 700; color: var(--orange-deep); }
.confirm dd { margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.done-box { text-align: center; padding: 20px 0; }
.done-box h3 { font-size: 1.5rem; color: var(--green); margin-bottom: 10px; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toy-train { animation: none; left: 12%; }
  .toy-train.rev { left: auto; right: 12%; }
  .t-steam b:last-child::after { animation: none; }
  .btn { transition: none; }
}
