/* レオタード採寸フォーム。ライトモード固定・外部CDNなし */
:root {
  --bg: #FFFFFF; --bg-ice: #F3FAFB; --ink: #2B3A55; --ink-soft: #6B7280;
  --gold: #C2A570; --gold-deep: #A8894F; --accent: #49B1C5; --accent-2: #7965BA;
  --line: #E3E8F1; --warn: #B98B2E; --warn-bg: #FBF5E6; --mark: #E0407A;
  --serif: "Shippori Mincho B1", "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", sans-serif;
  --kb: 0px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.75; letter-spacing: .02em;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2 { font-family: var(--serif); letter-spacing: .08em; font-weight: 700; margin: 0; }
p { margin: 0; }
.en { font-family: var(--sans); font-size: 11px; letter-spacing: .2em; color: var(--gold-deep); font-weight: 500; text-transform: uppercase; }

.screen { max-width: 480px; margin: 0 auto; padding: 20px 20px 40px; }
.screen.home, .screen.confirm { padding-bottom: 96px; }
.center { text-align: center; }

/* ブランド・見出し */
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-name { font-family: var(--serif); font-size: 18px; letter-spacing: .14em; font-weight: 700; }
.brand-sub { font-size: 10px; letter-spacing: .22em; color: var(--gold-deep); }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.title { font-size: 26px; line-height: 1.4; margin: 28px 0 14px; }
.title.small { font-size: 21px; margin: 24px 0 12px; }
.lead { color: var(--ink); }
.sec-title { font-size: 15px; margin: 28px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.preview-banner { background: var(--warn-bg); color: var(--warn); font-size: 12px; padding: 6px 10px; margin-bottom: 14px; border-radius: 8px; text-align: center; }

/* はじめに */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0 18px; background: var(--bg-ice); border-radius: 12px; }
.facts > div { padding: 12px 8px; text-align: center; }
.facts > div + div { border-left: 1px solid var(--line); }
.facts dt { margin-bottom: 2px; }
.facts dd { margin: 0; font-weight: 700; font-size: 14px; }
.guardian { font-size: 14px; padding: 12px 14px; border-left: 3px solid var(--gold); background: var(--bg-ice); }
.privacy { margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.privacy summary { cursor: pointer; padding: 6px 0; color: var(--ink); }
.privacy p { padding: 6px 0 2px; }
.draft-box { margin-top: 20px; padding: 14px; border: 1px solid var(--gold); border-radius: 12px; }
.draft-box p { margin-bottom: 10px; font-weight: 700; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; margin-bottom: 4px; }
.req, .opt { font-size: 10px; margin-left: 8px; padding: 1px 6px; border-radius: 4px; letter-spacing: .1em; }
.req { background: var(--ink); color: #fff; }
.opt { background: var(--line); color: var(--ink-soft); }
.text-input {
  width: 100%; height: 48px; padding: 0 12px; border: 1px solid #CBD3E1; border-radius: 8px; background: #fff; font-size: 16px;
}
.text-input:focus, .num-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-error { color: #B3261E; font-size: 13px; margin: 8px 0; }
.form-warn { color: var(--warn); background: var(--warn-bg); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 8px 0; }
.form-note { font-size: 13px; color: var(--ink-soft); }
.ok-note { color: var(--ink-soft); font-size: 13px; margin-bottom: 8px; }
.foot-note { margin-top: 14px; font-size: 12px; color: var(--ink-soft); text-align: center; }

/* ボタン */
.btn {
  height: 48px; padding: 0 20px; border-radius: 8px; border: 1px solid var(--ink); background: #fff; color: var(--ink);
  font-weight: 700; letter-spacing: .08em; white-space: nowrap;
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.ghost { border-color: #CBD3E1; }
.btn.block { display: block; width: 100%; margin-top: 20px; }
.btn.small { height: 38px; padding: 0 14px; font-size: 13px; }
.btn.submit { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; padding: 0 8px; }
.btn-col { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.btn-col .btn.block { margin-top: 12px; }
.link-btn { background: none; border: 0; padding: 10px 4px; min-height: 44px; color: var(--ink-soft); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn.center { display: block; margin: 8px auto 0; }

/* 進捗・切替 */
.progress { margin: 4px 0 14px; }
.progress-text { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--gold-deep); transition: width .25s; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.seg-btn { background: none; border: 0; height: 44px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.seg-btn.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }

/* 人体図 */
.home-fig { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.home-fig > .btn { align-self: flex-end; }
.fig-frame { background: var(--bg-ice); border-radius: 12px; overflow: hidden; }
.fig-viewport { position: relative; overflow: hidden; margin: 0 auto; background: var(--bg-ice); }
.fig-stage { position: absolute; left: 0; top: 0; aspect-ratio: 1 / 2; transform-origin: 0 0; }
.fig-stage img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.fig-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pin {
  position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; background: none; border: 0;
  display: flex; align-items: center; justify-content: center;
}
.pin-dot {
  width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 1.5px solid var(--gold-deep); color: var(--ink);
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.pin.is-done .pin-dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.pin-val { position: absolute; top: 38px; left: 50%; transform: translateX(-50%); font-size: 10px; line-height: 1; color: var(--ink); white-space: nowrap; font-weight: 700; background: rgba(255,255,255,.85); padding: 1px 3px; border-radius: 3px; }
.fig-note { font-size: 12px; color: var(--ink-soft); padding: 8px 4px; }
.chips { padding: 4px 0; }
.chips-title { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 8px; margin: 0 8px 8px 0; background: #fff; border: 1px solid var(--gold); border-radius: 22px; font-size: 13px; }
.chip-no { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--gold-deep); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.chip.is-done { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.is-done .chip-no { border-color: #fff; }
.chip-val { font-weight: 700; }

/* リスト・確認 */
.list-group { font-size: 13px; color: var(--gold-deep); letter-spacing: .2em; margin: 20px 0 6px; }
.list ul, .list-plain { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 4px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; }
.row-no { width: 28px; font-size: 12px; color: var(--gold-deep); font-weight: 700; flex: none; }
.row-name { flex: 1; min-width: 0; }
.row-val { color: var(--ink-soft); font-size: 13px; text-align: right; }
.row.is-done .row-val { color: var(--ink); font-weight: 700; }
.row.is-miss { background: #FFF6F6; }
.row.is-miss .row-val { color: #B3261E; font-weight: 700; }
.row.is-warn { background: var(--warn-bg); }
.row.is-warn .row-val { color: var(--warn); font-weight: 700; }
.cust { list-style: none; padding: 0; margin: 0; }
.cust li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cust .k { font-size: 12px; color: var(--ink-soft); }
.cust .v { word-break: break-all; }
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; gap: 10px; justify-content: center;
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
}
.bottom-bar .btn { flex: 1; max-width: 230px; padding: 0 8px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* 項目ビュー（全面） */
.screen.item {
  position: fixed; inset: 0; max-width: none; margin: 0; padding: 0; display: flex; flex-direction: column; background: var(--bg);
  --fig-vh: 34; --fig-vh-both: 24;
}
.kb-open .screen.item { --fig-vh: 16 !important; --fig-vh-both: 12 !important; }
.item-head { flex: none; display: flex; justify-content: space-between; align-items: center; padding: 6px 16px; border-bottom: 1px solid var(--line); max-width: 480px; width: 100%; margin: 0 auto; }
.step-of { color: var(--ink-soft); letter-spacing: .1em; }
.item-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; max-width: 480px; width: 100%; margin: 0 auto; }
.item-fig { background: var(--bg-ice); padding: 10px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fig-cell { position: relative; display: flex; justify-content: center; width: 100%; }
.fig-tag { position: absolute; top: 2px; left: 10px; z-index: 2; font-size: 10px; letter-spacing: .2em; color: var(--gold-deep); }
.item-fig .fig-note { padding: 0 16px; text-align: center; }
.item-info { padding: 16px 20px 24px; }
.group-tag { font-size: 11px; letter-spacing: .2em; color: var(--gold-deep); }
.item-title { font-size: 22px; margin: 2px 0 8px; display: flex; align-items: center; gap: 10px; }
.item-title .no { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; font-family: var(--sans); font-size: 13px; letter-spacing: 0; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.how { font-size: 14px; }
.tip { margin-top: 10px; padding: 10px 12px; background: var(--bg-ice); border-left: 3px solid var(--accent); font-size: 13px; }
.tip .en { display: block; color: var(--accent); }
.item-dock {
  flex: none; background: #fff; border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom) + var(--kb));
  max-width: 480px; width: 100%; margin: 0 auto;
}
.fields { display: flex; flex-direction: column; gap: 8px; }
.num-label { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 2px; }
.num-row { display: flex; gap: 8px; align-items: center; }
.num-box { flex: 1; position: relative; }
.num-input { width: 100%; height: 48px; border: 1px solid #CBD3E1; border-radius: 8px; padding: 0 44px 0 14px; font-size: 20px; font-weight: 700; text-align: center; background: #fff; }
.unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--ink-soft); pointer-events: none; }
.step-btn { width: 48px; height: 48px; flex: none; border-radius: 8px; border: 1px solid #CBD3E1; background: #fff; font-size: 22px; line-height: 1; touch-action: manipulation; user-select: none; }
.step-btn:disabled { opacity: .35; }
.warn { font-size: 12px; color: var(--warn); background: var(--warn-bg); border-radius: 6px; padding: 0; margin-top: 4px; }
.warn:not(:empty) { padding: 6px 10px; }
.nav-row { display: flex; gap: 10px; margin-top: 10px; }
.nav-row .btn { flex: 1; }

/* 送信中・完了 */
.screen.msg { text-align: left; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--line); border-top-color: var(--gold-deep); border-radius: 50%; margin: 40px auto 16px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.done-mark { margin-top: 36px; }
.ts-box { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; }

@media (min-width: 600px) { .screen { padding-top: 36px; } }
@media (prefers-reduced-motion: reduce) { .bar-fill, .spinner { transition: none; animation-duration: 3s; } }
