:root {
  color-scheme: light;
  --sand-50: #fbf6ec;
  --sand-100: #f2e5cf;
  --sand-300: #c9aa7b;
  --ink: #15120f;
  --muted: #645b52;
  --red: #be2f28;
  --paper: #fffdf8;
  --line: rgba(21, 18, 15, 0.18);
  --shadow: 0 22px 60px rgba(47, 32, 18, 0.13);
  font-family: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  background: var(--sand-50);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--sand-50); }
a { color: inherit; text-underline-offset: 0.2em; }
button, input, select { font: inherit; }
button, select, input { min-height: 44px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.46; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 246, 236, 0.94);
}
.brand { font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-weight: 700; letter-spacing: 0.06em; }
.site-header nav { display: flex; gap: 20px; font-size: 0.88rem; }

.hero {
  min-height: 700px;
  padding: clamp(48px, 7vw, 100px) clamp(20px, 5vw, 72px);
  background-image: linear-gradient(90deg, rgba(251,246,236,0.98) 0%, rgba(251,246,236,0.93) 43%, rgba(251,246,236,0.1) 72%), url("./assets/shoe-last-measuring-paper.jpg");
  background-size: cover;
  background-position: center;
}
.hero__layout { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr); gap: clamp(32px, 6vw, 86px); align-items: start; }
.hero__copy { max-width: 580px; padding-top: 20px; }
.eyebrow { margin: 0 0 12px; color: var(--red); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.75rem; }
h1, h2, h3 { font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; line-height: 1.22; }
h1 { margin: 0; font-size: clamp(2.6rem, 6vw, 5.8rem); letter-spacing: -0.04em; }
.lead { max-width: 32em; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.16rem); line-height: 1.9; }
.hero__note { display: inline-block; margin-top: 16px; padding-left: 14px; border-left: 3px solid var(--red); font-size: 0.86rem; line-height: 1.7; }

.workbench { background: rgba(255,253,248,0.96); border: 1px solid rgba(21,18,15,0.22); box-shadow: var(--shadow); padding: clamp(22px, 4vw, 38px); position: relative; }
.workbench::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(190,47,40,0.15); pointer-events: none; }
.workbench h2 { margin: 0 0 6px; font-size: 1.55rem; }
.workbench > p { margin-top: 0; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; font-weight: 700; font-size: 0.88rem; }
.field input, .field select { width: 100%; border: 1px solid var(--line); border-radius: 0; background: #fff; padding: 10px 12px; font-size: 16px; }
.field--wide { grid-column: 1 / -1; }
.brand-scope { grid-column: 1 / -1; margin: -2px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }
.form-section { margin: 22px 0 12px; padding-top: 18px; border-top: 1px dashed var(--line); }
.form-section legend { padding: 0 8px 0 0; font-weight: 800; }
.form-section p { color: var(--muted); font-size: 0.82rem; line-height: 1.6; }
.manual-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.manual-grid label { font-size: 0.72rem; font-weight: 800; }
.manual-grid input { width: 100%; margin-top: 5px; padding: 8px; border: 1px solid var(--line); font-size: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.button { border: 1px solid var(--ink); background: var(--ink); color: white; padding: 11px 18px; font-weight: 800; }
.button--ghost { background: transparent; color: var(--ink); }
.form-status { min-height: 1.5em; margin: 14px 0 0; color: var(--red); font-weight: 800; font-size: 0.86rem; }

main > section:not(.hero) { max-width: 1160px; margin: 0 auto; padding: clamp(56px, 8vw, 104px) clamp(20px, 5vw, 48px); }
.result-panel:not([hidden]) { padding-bottom: 0; }
.result-tools { padding-top: 18px !important; padding-bottom: clamp(48px, 6vw, 72px) !important; }
.result-panel { outline: none; }
.result-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; border-bottom: 2px solid var(--ink); padding-bottom: 16px; }
.result-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.5rem); }
.result-tag { padding: 8px 12px; background: var(--red); color: white; font-weight: 800; }
.size-strip { display: grid; grid-template-columns: repeat(5, 1fr); margin: 28px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.size-strip span { padding: 20px 12px; border-right: 1px solid var(--line); }
.size-strip span:last-child { border-right: 0; }
.size-strip small { display: block; color: var(--muted); font-size: 0.72rem; }
.size-strip strong { display: block; margin-top: 8px; font-size: clamp(1.35rem, 3vw, 2.4rem); }
.size-strip--manual { grid-template-columns: repeat(4, 1fr); margin-top: 8px; background: var(--paper); }
.notice { padding: 14px 16px; border-left: 4px solid var(--red); background: var(--sand-100); line-height: 1.7; }
.notice--dark { background: var(--ink); color: white; }
.source-note { color: var(--muted); font-size: 0.82rem; line-height: 1.7; }
.conversion-note { margin-top: -16px; color: var(--muted); font-size: 0.8rem; line-height: 1.7; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.measure { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(30px, 7vw, 90px); }
.measure__steps { counter-reset: steps; display: grid; gap: 14px; }
.measure__steps article { counter-increment: steps; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.measure__steps article::before { content: counter(steps, decimal-leading-zero); color: var(--red); font: 800 1rem/44px ui-monospace, monospace; border: 1px solid var(--red); text-align: center; }
.measure__steps h3 { margin: 0 0 4px; }
.measure__steps p { margin: 0; color: var(--muted); line-height: 1.7; }
.saved { background: var(--sand-100); }
.saved-list { padding: 0; list-style: none; display: grid; gap: 8px; }
.saved-list li { background: var(--paper); padding: 14px 16px; display: flex; justify-content: space-between; gap: 12px; }
.sources li { margin-bottom: 12px; line-height: 1.8; }
.privacy { padding: 16px; border: 1px solid var(--line); }
footer { padding: 40px 20px; background: var(--ink); color: var(--sand-50); text-align: center; font-size: 0.82rem; }

@media (max-width: 860px) {
  .site-header nav { display: none; }
  .hero { min-height: 0; background-image: linear-gradient(180deg, rgba(251,246,236,0.96), rgba(251,246,236,0.8)), url("./assets/shoe-last-measuring-paper.jpg"); background-position: 64% center; }
  .hero__layout { grid-template-columns: 1fr; }
  .hero__copy { padding-top: 0; }
  .measure { grid-template-columns: 1fr; }
  .size-strip { grid-template-columns: repeat(2, 1fr); }
  .size-strip span { border-bottom: 1px solid var(--line); }
}

@media (max-width: 480px) {
  .hero { padding: 38px 16px 48px; }
  h1 { font-size: clamp(2.5rem, 16vw, 4rem); }
  .lead { line-height: 1.75; }
  .workbench { margin-inline: -2px; padding: 24px 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .manual-grid { grid-template-columns: repeat(2, 1fr); }
  .form-actions { flex-direction: column; }
  .form-actions .button { width: 100%; }
  .result-heading { align-items: start; flex-direction: column; }
  .size-strip, .size-strip--manual { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow-wrap: anywhere; }
  .result-actions .button { flex: 1 1 100%; }
  .saved-list li { flex-direction: column; }
}

@media print {
  .site-header, .hero, .measure, .saved, .sources, footer, .result-actions { display: none !important; }
  body { background: white; }
  main > section.result-panel { display: block !important; max-width: none; padding: 20mm; }
}
