:root {
  --ink: #12211c;
  --forest-950: #07130f;
  --forest-900: #0b1d17;
  --forest-800: #123229;
  --forest-700: #1c493c;
  --paper: #f5f6f2;
  --white: #ffffff;
  --muted: #93a69e;
  --line: rgba(210, 229, 220, .17);
  --teal: #43dfb8;
  --teal-soft: #b9f6e6;
  --gold: #d7b974;
  --coral: #ef7f73;
  --warning: #f2cb73;
  --success: #66d5a8;
  --shadow: 0 20px 54px rgba(0,0,0,.24);
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--forest-950); }
body { margin: 0; min-width: 320px; min-height: 100vh; font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif; color: var(--white); background: var(--forest-950); letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.content { width: min(100% - 32px, 1120px); margin: 0 auto; }
.content-narrow { width: min(100% - 32px, 680px); margin: 0 auto; }
.icon { width: 19px; height: 19px; stroke-width: 1.8; }
.icon-button { width: 42px; height: 42px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--forest-800); color: var(--white); }
.primary-button, .secondary-button, .danger-button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 18px; border-radius: 6px; font-weight: 650; }
.primary-button { color: #06241b; background: var(--teal); border: 1px solid var(--teal); }
.secondary-button { color: var(--white); background: transparent; border: 1px solid var(--line); }
.danger-button { color: #ffd9d4; background: rgba(239,127,115,.08); border: 1px solid rgba(239,127,115,.42); }
.wide-button { width: 100%; }
.primary-button, .secondary-button, .danger-button { text-decoration: none; }
.compact-button { min-height: 38px; padding: 0 12px; font-size: 12px; }
.light-button { color: var(--ink); border-color: #ccd5d0; }
.danger-text { color: var(--coral); }
.eyebrow { color: var(--gold); font-size: 12px; text-transform: uppercase; }
.preview-ribbon { position: fixed; z-index: 1000; right: 12px; top: 12px; padding: 6px 9px; border-radius: 4px; background: var(--warning); color: #352a10; font-size: 11px; font-weight: 750; box-shadow: var(--shadow); }
.topbar { height: 70px; display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 12px; padding: 0 max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: rgba(7,19,15,.97); position: sticky; top: 0; z-index: 40; }
.topbar-title { min-width: 0; text-align: center; }
.topbar-title strong, .topbar-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-title strong { font-size: 17px; }
.topbar-title span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.bottom-action { position: relative; z-index: 30; left: 0; right: 0; bottom: 0; padding: 12px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)); background: rgba(7,19,15,.97); border-top: 1px solid var(--line); }
.bottom-action > * { max-width: 680px; margin: 0 auto; }

.home-hero { min-height: min(720px, 82vh); position: relative; isolation: isolate; overflow: hidden; background: #14211d; }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .55s ease; }
.hero-media img.active { opacity: 1; }
.home-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(4,12,9,.62); }
.hero-inner { position: relative; z-index: 2; min-height: inherit; padding: 24px 0 34px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; }
.brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: auto; }
.brand-row img { width: 58px; height: 58px; object-fit: cover; border-radius: 7px; border: 1px solid rgba(255,255,255,.34); }
.brand-row span { display: block; margin-top: 3px; color: var(--teal-soft); font-size: 12px; }
.dealer-entry { margin-bottom: 20px; display: inline-flex; gap: 8px; align-items: center; padding: 9px 12px; border-left: 3px solid var(--gold); background: rgba(7,19,15,.82); font-size: 13px; }
.hero-copy { width: min(100%, 620px); }
.hero-copy h1 { margin: 8px 0 12px; font-size: 44px; line-height: 1.16; }
.hero-copy p { margin: 0 0 22px; max-width: 560px; color: #dce9e3; line-height: 1.7; }
.hero-actions { display: flex; gap: 10px; width: min(100%, 520px); }
.hero-actions .primary-button { flex: 1; }
.benefit-band { padding: 18px 0; background: var(--paper); color: var(--ink); }
.benefit-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 0; border-top: 1px solid #d7ddd8; border-bottom: 1px solid #d7ddd8; }
.benefit { padding: 18px; border-right: 1px solid #d7ddd8; }
.benefit:last-child { border-right: 0; }
.benefit span { color: #8c7137; font-size: 11px; }
.benefit strong { display: block; margin-top: 8px; font-size: 14px; }
.benefit p { margin: 7px 0 0; color: #5e6a65; font-size: 12px; line-height: 1.55; }

.form-page { min-height: 100vh; background: var(--forest-950); }
.form-section { padding: 30px 0 38px; }
.section-heading { margin: 0 0 8px; font-size: 25px; }
.section-copy { margin: 0 0 26px; color: var(--muted); line-height: 1.65; }
.field { display: grid; gap: 7px; margin-bottom: 19px; }
.field label, .field-label { color: #dce7e2; font-size: 13px; }
.text-input, .select-input, .textarea-input { width: 100%; border-radius: 6px; border: 1px solid var(--line); color: var(--white); background: var(--forest-800); outline: none; }
.text-input, .select-input { height: 50px; padding: 0 13px; }
.textarea-input { min-height: 96px; resize: vertical; padding: 12px 13px; }
.text-input:focus, .select-input:focus, .textarea-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(67,223,184,.1); }
.input-unit { position: relative; }
.input-unit span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; }
.input-unit input { padding-right: 45px; }
.requirements { margin: 20px 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.requirements li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); line-height: 1.6; }
.requirements b { color: var(--gold); }
.requirements li > span { min-width: 0; overflow-wrap: anywhere; }
.check-line { min-height: 48px; display: flex; align-items: center; gap: 10px; color: #dce7e2; }
.check-line input { width: 20px; height: 20px; accent-color: var(--teal); }
.choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.choice { min-height: 46px; display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--forest-900); }
.choice input { width: 18px; height: 18px; accent-color: var(--teal); }
.form-band { padding: 24px 0; border-top: 1px solid var(--line); }
.form-band h2 { margin: 0 0 18px; font-size: 18px; }
.spaced-field { margin-top: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 14px; }
.readonly-value { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 13px; border: 1px solid rgba(67,223,184,.26); border-radius: 5px; background: rgba(67,223,184,.06); }
.readonly-value strong { color: var(--teal-soft); }
.visual-choice-grid { display: grid; gap: 10px; }
.posture-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.sleep-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.visual-choice { overflow: hidden; color: var(--ink); background: #eef1ed; border: 1px solid #cfd7d2; border-radius: 6px; cursor: pointer; }
.visual-choice img { width: 100%; aspect-ratio: 16/9; object-fit: contain; background: #eef1ed; }
.visual-choice span { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid #cfd7d2; font-size: 12px; font-weight: 650; }
.visual-choice input { width: 18px; height: 18px; accent-color: var(--teal); }

.guide-intro { padding: 24px 0 8px; }
.guide-switch { display: grid; grid-template-columns: repeat(2,1fr); border: 1px solid var(--line); }
.guide-card { position: relative; min-height: 400px; overflow: hidden; background: #e8ebe6; color: var(--ink); border-right: 1px solid #cfd7d2; }
.guide-card:last-child { border-right: 0; }
.guide-card img { width: 100%; height: 310px; object-fit: contain; object-position: center top; }
.guide-card-body { padding: 14px 15px 17px; border-top: 1px solid #cfd7d2; }
.guide-card h2 { margin: 0 0 6px; font-size: 17px; }
.guide-card p { margin: 0; color: #52615b; font-size: 12px; line-height: 1.55; }
.guide-composite { overflow: hidden; border: 1px solid var(--line); background: #e8ebe6; color: var(--ink); }
.guide-composite > img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #f5f5f2; }
.guide-caption-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-top: 1px solid #cfd7d2; }
.guide-caption { min-width: 0; padding: 12px 14px 14px; }
.guide-caption + .guide-caption { border-left: 1px solid #cfd7d2; }
.guide-caption h2 { margin: 0 0 5px; font-size: 15px; }
.guide-caption p { margin: 0; color: #52615b; font-size: 11px; line-height: 1.5; }
.guide-page .guide-intro { padding: 12px 0 8px; }
.guide-page .guide-composite { width: min(100%,620px); margin: 0 auto; }
.guide-page .requirements { margin: 10px 0; }
.guide-page .requirements li { padding: 7px 0; font-size: 12px; line-height: 1.4; }
.guide-page .field { gap: 6px; margin-bottom: 8px; }
.guide-page .choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.guide-page .choice { min-height: 42px; padding: 7px 8px; font-size: 12px; }
.guide-page .bottom-action { padding-top: 8px; padding-bottom: max(8px,env(safe-area-inset-bottom)); }
.asset-placeholder { position: absolute; top: 10px; left: 10px; padding: 5px 7px; background: var(--coral); color: #fff; font-size: 10px; border-radius: 3px; }
.marker-swatch { position: absolute; z-index: 2; left: 50%; top: 48%; transform: translate(-50%,-50%); background: rgba(255,255,255,.94); border: 2px solid #51685f; box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.marker-swatch.a4 { width: 82px; aspect-ratio: 210 / 297; }
.marker-swatch.card { width: 82px; aspect-ratio: 85.6 / 53.98; border-radius: 7px; }

.camera-page { min-height: 100vh; background: #020604; }
.camera-stage { height: calc(100vh - 70px - 118px); min-height: 440px; position: relative; overflow: hidden; background: #050a08; }
.camera-video, .camera-photo { width: 100%; height: 100%; object-fit: cover; }
.camera-overlay { position: absolute; inset: 0; pointer-events: none; }
.camera-guide { position: absolute; left: 50%; top: 4%; height: 94%; width: auto; max-width: 96%; transform: translateX(-50%); object-fit: contain; opacity: .8; filter: drop-shadow(0 0 12px rgba(67,223,184,.32)); }
.camera-tip-bottom { top: auto !important; bottom: 12px; }
.camera-tip { position: absolute; left: 12px; right: 12px; top: 12px; padding: 11px 12px; text-align: center; line-height: 1.55; font-size: 13px; background: rgba(7,19,15,.9); border: 1px solid rgba(255,255,255,.2); }
.camera-bounds { position: absolute; left: 10%; right: 10%; top: 12%; bottom: 7%; border: 1px dashed rgba(67,223,184,.45); }
.camera-controls { height: 118px; display: grid; grid-template-columns: 56px 1fr 56px; gap: 20px; align-items: center; padding: 12px 20px max(12px,env(safe-area-inset-bottom)); background: var(--forest-950); }
.camera-action { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: var(--white); background: var(--forest-800); }
.shutter { justify-self: center; width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; background: var(--teal); box-shadow: inset 0 0 0 5px var(--forest-950); }
.review-actions { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; gap: 9px; }
.review-actions button { flex: 1; }
.dual-photo-review { height: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; padding: 64px 0 116px; background: #111915; }
.dual-photo-review figure { min-width: 0; height: 100%; margin: 0; position: relative; overflow: hidden; background: #020604; }
.dual-photo-review img { width: 100%; height: 100%; display: block; object-fit: contain; }
.dual-photo-review figcaption { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 7px; text-align: center; color: #fff; background: rgba(7,19,15,.88); font-size: 12px; }
.dual-review-actions { position: absolute; left: 12px; right: 12px; bottom: 12px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.dual-review-actions #measure { grid-column: 1 / -1; }

.scan-page { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; background: var(--forest-950); }
.scan-panel { width: min(100%,620px); text-align: center; }
.scan-panel h1 { margin: 8px 0; font-size: 26px; }
.scanner { width: min(80vw,370px); aspect-ratio: 4/5; margin: 24px auto; position: relative; overflow: hidden; border: 1px solid rgba(67,223,184,.38); background: var(--forest-900); }
.scanner img { width: 100%; height: 100%; object-fit: contain; opacity: .68; }
.scan-line { position: absolute; left: 0; right: 0; top: 16%; height: 2px; background: var(--teal); box-shadow: 0 0 15px rgba(67,223,184,.85); animation: scan 1.9s ease-in-out infinite alternate; }
.scan-status { color: var(--muted); }
@keyframes scan { to { top: 82%; } }

.result-page { min-height: 100vh; background: var(--forest-950); }
.result-summary { padding: 14px 0 16px; border-bottom: 1px solid var(--line); }
.result-heading { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.result-heading h1 { margin: 6px 0 5px; font-size: 27px; }
.marker-chip { padding: 7px 9px; border: 1px solid rgba(215,185,116,.4); color: var(--gold); background: rgba(215,185,116,.06); font-size: 12px; }
.measurement-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.measurement-item { min-height: 112px; padding: 15px; background: var(--forest-900); }
.measurement-item span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.measurement-item strong { display: block; margin-top: 11px; color: var(--teal-soft); font-size: 24px; }
.quality-note { margin: 18px 0 0; padding: 13px 0; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; line-height: 1.65; }
.result-actions { padding: 22px 0 34px; display: flex; gap: 10px; }
.result-actions button { flex: 1; }
.result-data-title { margin: 26px 0 -8px; font-size: 18px; }
.measurement-visual { margin: 12px 0 0; display: grid; grid-template-columns: minmax(360px,.9fr) minmax(300px,1fr); min-height: 460px; border: 1px solid var(--line); background: var(--forest-900); overflow: hidden; }
.body-map-column { padding: 8px; border-right: 1px solid var(--line); background: #050c09; }
.body-map { position: relative; min-height: 388px; overflow: hidden; background: #050c09; }
.body-map > img { position: absolute; left: 50%; top: 2%; height: 96%; width: auto; max-width: 82%; transform: translateX(-50%); object-fit: contain; opacity: .46; }
.body-measure-line { position: absolute; z-index: 1; height: 0; border-top: 2px solid var(--teal-soft); filter: drop-shadow(0 0 5px rgba(106,232,210,.45)); }
.body-measure-line::before, .body-measure-line::after { content: ""; position: absolute; top: -5px; width: 7px; height: 7px; border: 1px solid var(--gold); border-radius: 50%; background: #07130f; }
.body-measure-line::before { left: -4px; }
.body-measure-line::after { right: -4px; }
.line-shoulder { left: 27%; right: 27%; top: 43%; border-top-color: var(--gold); }
.line-left-shoulder { left: 27%; width: 23%; top: 48%; border-top-color: var(--gold); }
.line-right-shoulder { right: 27%; width: 23%; top: 48%; border-top-color: var(--gold); }
.line-neck { left: 50%; top: 25%; width: 0; height: 12%; border-top: 0; border-left: 2px solid var(--teal-soft); }
.line-neck::before { left: -5px; top: -4px; }
.line-neck::after { left: -5px; right: auto; top: auto; bottom: -4px; }
.line-upper-arm { left: 15%; right: 15%; top: 58%; border-top-width: 3px; }
.measure-callout { position: absolute; z-index: 2; min-width: 112px; max-width: 230px; padding: 6px 8px; border: 1px solid rgba(215,185,116,.48); background: rgba(7,19,15,.94); box-shadow: 0 7px 18px rgba(0,0,0,.2); }
.measure-callout::after { content: ""; position: absolute; top: 50%; width: 32px; border-top: 1px solid var(--gold); }
.measure-callout span { display: block; color: var(--gold); font-size: 10px; line-height: 1.35; }
.measure-callout strong { display: block; margin-top: 3px; color: var(--teal-soft); font-size: 13px; }
.callout-left-shoulder { left: 8px; top: 47%; }
.callout-left-shoulder::after { left: 100%; }
.callout-right-shoulder { right: 8px; top: 47%; text-align: right; }
.callout-right-shoulder::after { right: 100%; }
.callout-shoulder { left: 50%; top: 30%; transform: translateX(-50%); text-align: center; }
.callout-neck { left: 50%; top: 10%; transform: translateX(-50%); text-align: center; }
.callout-upper-arm { left: 50%; top: 65%; width: min(230px,68%); transform: translateX(-50%); text-align: center; }
.callout-shoulder::after, .callout-neck::after, .callout-upper-arm::after { left: 50%; top: auto; width: 1px; border-top: 0; border-left: 1px solid var(--gold); }
.callout-shoulder::after { top: 100%; height: 32px; }
.callout-neck::after { top: 100%; height: 28px; }
.callout-upper-arm::after { bottom: 100%; height: 30px; }
.diagram-profile-button { min-height: 44px; margin-top: 8px; }
.visual-key { align-self: center; padding: 18px; }
.visual-key h2 { margin: 0 0 8px; font-size: 20px; }
.visual-key > p { margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.visual-key-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.visual-key-grid .detail-value { min-height: 62px; }
.compact-result-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compact-result-footer .quality-note { flex: 1; margin-top: 10px; padding: 10px 0 0; }
.compact-result-footer button { flex: 0 0 auto; }
.confirm-backdrop { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 18px; background: rgba(0,0,0,.78); }
.confirm-dialog { width: min(100%,430px); padding: 24px; border: 1px solid var(--line); border-radius: 7px; background: #101a17; box-shadow: var(--shadow); }
.confirm-dialog h2 { margin: 15px 0 8px; }
.confirm-dialog > p { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.confirm-icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--forest-950); background: var(--warning); border-radius: 50%; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.danger-confirm-icon { color: #2b0d09; background: var(--coral); }
.entry-unavailable { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; background: var(--forest-950); }
.entry-unavailable section { width: min(100%,460px); }
.entry-unavailable h1 { margin: 0 0 10px; font-size: 26px; }
.entry-unavailable p { margin: 0; color: var(--muted); line-height: 1.65; }
.complete-band { padding: 52px 0; text-align: center; }
.complete-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; color: var(--forest-950); background: var(--success); }

.admin-page { min-height: 100vh; background: #0c1311; }
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-panel { width: min(100%,410px); padding: 26px; border: 1px solid var(--line); border-radius: 7px; background: var(--forest-900); box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-brand img { width: 52px; height: 52px; border-radius: 6px; }
.login-brand span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.login-error { min-height: 22px; color: var(--coral); font-size: 12px; }
.admin-shell { width: min(100% - 28px,1280px); margin: 0 auto; padding: 22px 0 50px; }
.admin-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.admin-header h1 { margin: 0 0 5px; font-size: 24px; }
.admin-header p { margin: 0; color: var(--muted); font-size: 12px; }
.admin-actions { display: flex; gap: 8px; }
.admin-tabs { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.admin-tab { min-height: 44px; padding: 0 16px; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; }
.admin-tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; margin-bottom: 18px; border: 1px solid var(--line); background: var(--line); }
.stat { min-height: 78px; padding: 14px; background: var(--forest-900); }
.stat span { color: var(--muted); font-size: 11px; }
.stat strong { display: block; margin-top: 8px; font-size: 24px; }
.admin-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.admin-toolbar .text-input { width: min(100%,310px); }
.admin-toolbar .select-input { width: 210px; }
.pagination-bar { justify-content: flex-end; margin-top: 14px; }
.pagination-bar .muted { margin-right: auto; font-size: 12px; }
.selection-bar { min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin-bottom: 10px; border-left: 3px solid var(--teal); background: rgba(67,223,184,.06); }
.records { overflow-x: auto; border-top: 1px solid var(--line); }
.record-row { min-width: 980px; display: grid; grid-template-columns: 34px 150px 130px 135px 100px repeat(3,100px) 42px; gap: 10px; align-items: center; min-height: 62px; padding: 8px; border-bottom: 1px solid var(--line); }
.record-row.header { min-height: 42px; color: var(--muted); font-size: 11px; }
.record-row:not(.header):hover { background: rgba(67,223,184,.035); }
.record-row input { width: 18px; height: 18px; accent-color: var(--teal); }
.record-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-cell { color: var(--muted); font-size: 12px; }
.status { width: max-content; padding: 5px 7px; border: 1px solid var(--line); font-size: 11px; }
.status-completed { color: var(--success); }
.status-pending { color: var(--warning); }
.empty-state { padding: 52px 16px; text-align: center; color: var(--muted); border-bottom: 1px solid var(--line); }
.dealer-layout { display: grid; grid-template-columns: 360px 1fr; gap: 24px; }
.dealer-form { align-self: start; padding: 20px; border: 1px solid var(--line); background: var(--forest-900); }
.dealer-form h2 { margin: 0 0 18px; font-size: 18px; }
.dealer-list { border-top: 1px solid var(--line); }
.dealer-row { display: grid; grid-template-columns: minmax(160px,1fr) 130px 80px 280px; gap: 10px; align-items: center; min-height: 62px; padding: 8px; border-bottom: 1px solid var(--line); }
.dealer-row .record-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dealer-row-actions { display: flex; justify-content: flex-end; gap: 7px; }
.dealer-edit-dialog { max-height: min(720px,92vh); overflow: auto; }
.readonly-token { color: var(--muted); background: rgba(255,255,255,.025); cursor: not-allowed; }
.danger-icon { color: #ffb4aa; border-color: rgba(239,127,115,.42); background: rgba(239,127,115,.08); }
.date-field { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.date-field .text-input { width: 160px; height: 38px; }
.hero-admin { border-top: 1px solid var(--line); }
.hero-admin > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 0; }
.hero-admin h2 { margin: 0 0 6px; font-size: 19px; }
.hero-admin header p { margin: 0; color: var(--muted); font-size: 12px; }
.hero-admin-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.hero-admin-item { overflow: hidden; border: 1px solid var(--line); background: var(--forest-900); }
.hero-admin-item > img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.hero-admin-item > div { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; }
.site-settings { display: grid; gap: 28px; }
.site-content-form { padding: 20px; border: 1px solid var(--line); background: var(--forest-900); }
.site-content-form > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.site-content-form h2 { margin: 0 0 6px; font-size: 19px; }
.site-content-form header p { margin: 0; color: var(--muted); font-size: 12px; }
.site-content-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.site-content-grid .site-wide { grid-column: 1 / -1; }
.site-content-grid .textarea-input { min-height: 88px; }
.detail-actions { display: grid; grid-template-columns: 1fr 180px; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.qr-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 18px; background: rgba(0,0,0,.76); }
.qr-dialog { width: min(100%,430px); padding: 22px; color: var(--ink); background: var(--paper); border-radius: 7px; }
.qr-dialog header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.qr-dialog h2 { margin: 0; font-size: 20px; }
.qr-dialog p { color: #53625c; font-size: 12px; line-height: 1.6; word-break: break-all; }
.qr-canvas { width: 260px; min-height: 260px; margin: 18px auto; display: grid; place-items: center; background: #fff; }
.qr-dialog .icon-button { color: var(--ink); background: transparent; border-color: #ccd5d0; }
.detail-backdrop { position: fixed; inset: 0; z-index: 70; display: flex; justify-content: flex-end; background: rgba(0,0,0,.74); }
.detail-panel { width: min(100%,740px); height: 100%; overflow: auto; padding: 22px; background: #101a17; border-left: 1px solid var(--line); }
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.detail-header h2 { margin: 0 0 5px; }
.detail-values { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin: 18px 0; border: 1px solid var(--line); background: var(--line); }
.detail-value { padding: 13px; background: var(--forest-900); }
.detail-value span { color: var(--muted); font-size: 11px; }
.detail-value strong { display: block; margin-top: 7px; color: var(--teal-soft); }
.detail-section { padding: 16px 0; border-top: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 11px; font-size: 15px; }
.detail-list { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px 16px; }
.detail-list div { color: var(--muted); font-size: 12px; line-height: 1.5; }
.detail-list b { color: #dfe9e4; font-weight: 550; }
.toast { position: fixed; z-index: 1100; left: 50%; bottom: max(22px,env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 28px),430px); padding: 12px 14px; text-align: center; border: 1px solid var(--line); background: #20342d; box-shadow: var(--shadow); }

@media (max-width: 820px) {
  .hero-copy h1 { font-size: 34px; }
  .guide-composite > img { aspect-ratio: 16 / 9; }
  .guide-page .guide-composite { width: 100%; max-width: 100%; }
  .measurement-grid { grid-template-columns: repeat(2,1fr); }
  .dealer-layout { grid-template-columns: 1fr; }
  .dealer-row { grid-template-columns: minmax(160px,1fr) auto; }
  .dealer-row-actions { grid-column: 1 / -1; }
  .dealer-row .dealer-user { display: none; }
  .detail-values { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 520px) {
  .preview-ribbon { position: relative; inset: auto; width: 100%; border-radius: 0; box-shadow: none; text-align: center; }
  .content, .content-narrow { width: min(100% - 24px,1120px); }
  .home-hero { min-height: 72vh; }
  .hero-inner { padding-top: 16px; padding-bottom: 24px; }
  .brand-row img { width: 50px; height: 50px; }
  .hero-copy h1 { font-size: 29px; }
  .hero-copy p { font-size: 13px; }
  .hero-actions { flex-direction: column; }
  .benefit { padding: 13px 8px; }
  .benefit strong { font-size: 11px; line-height: 1.4; }
  .field-grid, .choice-grid { grid-template-columns: 1fr; }
  .posture-grid, .sleep-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .measurement-visual { grid-template-columns: 1fr; }
  .body-map-column { border-right: 0; border-bottom: 1px solid var(--line); }
  .body-map { min-height: 390px; }
  .visual-key { padding: 14px; }
  .measure-callout { min-width: 92px; padding: 5px 6px; }
  .measure-callout strong { font-size: 11px; }
  .hero-admin > header { flex-direction: column; }
  .hero-admin-grid { grid-template-columns: 1fr; }
  .site-content-form > header { flex-direction: column; }
  .site-content-grid { grid-template-columns: 1fr; }
  .site-content-grid .site-wide { grid-column: auto; }
  .date-field, .date-field .text-input { width: 100%; }
  .detail-actions { grid-template-columns: 1fr; }
  .admin-tabs { overflow-x: auto; }
  .admin-tab { white-space: nowrap; }
  .measurement-grid { grid-template-columns: repeat(2,1fr); }
  .measurement-item { min-height: 100px; padding: 12px; }
  .measurement-item strong { font-size: 21px; }
  .result-actions { flex-direction: column; }
  .result-actions button { width: 100%; }
  .result-heading { align-items: center; }
  .result-heading h1 { font-size: 23px; }
  .marker-chip { flex: 0 0 auto; }
  .compact-result-footer { align-items: stretch; flex-direction: column; }
  .compact-result-footer button { width: 100%; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .admin-shell { width: calc(100% - 18px); }
  .admin-header { flex-direction: column; }
  .admin-toolbar .text-input, .admin-toolbar .select-input { width: 100%; }
  .selection-bar { flex-wrap: wrap; }
  .detail-panel { padding: 15px; }
  .detail-list, .detail-values { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
