:root {
  --ink: #1c1915;
  --muted: #6f675c;
  --paper: #f6f1e8;
  --white: #fffdf9;
  --line: rgba(48, 36, 18, 0.12);
  --gold: #d4b483;
  --gold-deep: #a6854e;
  --night: #12110e;
  --night-text: #f6f1e8;
  --danger: #9f2d2d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --radius: 16px;
  --sans: "Outfit", "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--night);
}

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

body {
  overflow: hidden;
  color: var(--night-text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--gold);
  color: #111;
}

button, input, select { font: inherit; }

.shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(300px, 440px) 1fr;
}

.story {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: 28px 36px 24px;
  overflow: auto;
  background:
    radial-gradient(880px 420px at 0% 0%, rgba(212, 180, 131, 0.22), transparent 55%),
    var(--night);
  color: var(--night-text);
  color-scheme: dark;
}

.story-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  height: 54px;
  width: auto;
  max-width: 112px;
  object-fit: contain;
  display: block;
  flex: none;
}

.brand-name {
  display: block;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.brand-domain {
  display: block;
  margin-top: 1px;
  color: #a7a49c;
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #d9d6cf;
  font-size: 13px;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 180, 131, 0.18);
}

.story-mid { margin-top: clamp(36px, 8vh, 84px); }

.step-head {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.step-no {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 92px;
  line-height: 0.78;
  letter-spacing: -0.04em;
  color: var(--gold);
}

.step-kicker {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ddd9d0;
}

.story h1 {
  margin: 18px 0 14px;
  max-width: 9em;
  font-size: clamp(36px, 3vw, 48px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.lead {
  margin: 0;
  max-width: 18em;
  font-family: var(--serif);
  font-style: italic;
  font-size: 23px;
  line-height: 1.3;
  color: #ddd9d0;
}

.path {
  margin: 28px 0 0;
  display: grid;
  gap: 14px;
}

.path p {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  margin: 0;
}

.path p > span:first-child {
  color: var(--gold);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.path strong {
  display: block;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.path em {
  display: block;
  margin-top: 2px;
  color: #b7b1a6;
  font-style: normal;
  font-size: 14px;
  line-height: 1.35;
}

.roles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
}

.roles span {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 180, 131, 0.35);
  color: var(--night-text);
  font-size: 13px;
  line-height: 1.2;
}

.story-bottom { margin-top: auto; padding-top: 28px; }

.rail {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border: 0;
  background: transparent;
  color: #8f8c86;
  text-align: left;
  cursor: pointer;
}

.rail button:hover { color: var(--night-text); }

.rail button[aria-current="step"] { color: var(--night-text); }

.rail .n {
  width: 1.8em;
  color: var(--gold);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.rail button:disabled { cursor: default; }

.quiet {
  color: var(--gold);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.quiet:hover { text-decoration: underline; text-underline-offset: 3px; }

.copyline {
  margin: 14px 0 0;
  color: #7d7a74;
  font-size: 13px;
}

.workspace {
  margin: 12px 12px 12px 0;
  border-radius: 28px;
  overflow: auto;
  min-height: calc(100vh - 24px);
  min-height: calc(100dvh - 24px);
  color: var(--ink);
  color-scheme: light;
  background:
    radial-gradient(640px 260px at 100% 0%, rgba(212, 180, 131, 0.28), transparent 48%),
    var(--paper);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 24px 70px rgba(0, 0, 0, 0.35);
  scrollbar-color: #d0cdc6 transparent;
}

.sheet {
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 52px 48px 64px;
}

.sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.kicker, .count {
  margin: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.count { font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }

.progress {
  height: 2px;
  margin: 22px 0 32px;
  border-radius: 99px;
  background: rgba(28, 28, 30, 0.08);
}

.progress span {
  display: block;
  height: 100%;
  width: 33%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  transition: width 0.35s ease;
}

.block-title {
  margin: 28px 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.block-title:first-of-type { margin-top: 8px; }

.hint {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.mobile-afis {
  display: none;
  margin: 0 0 8px;
}

.mobile-afis img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.code-input {
  letter-spacing: 0.28em;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

#codeStep .actions {
  flex-wrap: wrap;
}

#codeStep .actions .btn {
  flex: 1 1 140px;
}

.optional {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.media-box { margin-bottom: 4px; }

.notes {
  display: grid;
  gap: 10px;
  margin: 6px 0 18px;
}

.note {
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}

.note h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.note ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.note li + li { margin-top: 4px; }

.note p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.note.accent {
  border-color: transparent;
  background: #14120f;
  color: var(--night-text);
}

.note.accent h3 { color: var(--gold); }

.note.accent p {
  color: #ddd9d0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
}

.guide { margin-top: 28px; }
.guide > p {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
.faq { display: grid; gap: 8px; }
.faq details {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  padding: 12px 14px;
}
.faq summary {
  cursor: pointer;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.faq summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.faq details p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gallery:empty { display: none; }

.shot {
  position: relative;
  width: 92px;
  margin: 0;
}

.shot img {
  width: 92px;
  height: 122px;
  object-fit: cover;
  border-radius: 16px;
  background: #e7e1d6;
  display: block;
}

.shot button,
.video-chip button {
  border: 0;
  border-radius: 999px;
  background: #111;
  color: #fff;
  cursor: pointer;
}

.shot button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  padding: 0;
}

.shot.edit { width: 148px; }
.shot.edit img { width: 148px; height: 196px; }
.shot.edit button { position: static; width: auto; height: 32px; padding: 0 10px; font-size: 12px; }

.shot-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.shot-tools .add-file {
  height: 32px;
  margin-top: 0;
  padding: 0 10px;
  font-size: 12px;
}

.owner-video {
  width: 100%;
  max-height: 320px;
  margin-top: 8px;
  border-radius: 16px;
  background: #14120f;
}

.saved {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--gold-deep);
  font-size: 14px;
  font-weight: 500;
}

.ref-no {
  margin: 4px 0 0;
  font-size: clamp(26px, 7vw, 34px);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.actions.span .btn.solid {
  width: 100%;
  margin-left: 0;
}

.add-file {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 44px;
  margin-top: 12px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-weight: 500;
  cursor: pointer;
}

.add-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.video-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}

.video-chip p { margin: 0; min-width: 0; }
.video-chip strong { display: block; font-weight: 500; overflow-wrap: anywhere; }
.video-chip span { color: var(--muted); font-size: 13px; }
.video-chip button { height: 36px; padding: 0 12px; flex: none; }

.media-box.over { box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08); border-radius: 18px; }

.step { animation: rise 0.45s ease; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.row > *,
.date-row > * { min-width: 0; }

.field { margin-bottom: 18px; }

.legend {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 500;
}

label, .legend { color: #2c2c2e; }

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field select {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field select {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23111' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.field select.is-empty,
.field select:disabled { color: #8d8a84; }

.field input::placeholder { color: #9a968e; }

.field input:focus,
.field select:focus {
  border-color: #111;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

.field.invalid input,
.field.invalid select,
.field.invalid .segment,
.field.invalid .chips,
.field.invalid .drop,
.field.invalid .check {
  border-color: var(--danger);
}

.field.invalid input,
.field.invalid select {
  box-shadow: 0 0 0 4px rgba(159, 45, 45, 0.1);
}

.err {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.err:empty { display: none; }

.date-row {
  display: grid;
  grid-template-columns: 0.8fr 1.25fr 1fr;
  gap: 8px;
}

.segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: rgba(28, 28, 30, 0.05);
}

.segment-item { position: relative; }

.segment-item input,
.chip input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segment-item span {
  display: grid;
  place-items: center;
  height: 46px;
  border-radius: 12px;
  font-weight: 500;
}

.segment-item input:checked + span {
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 18px rgba(0, 0, 0, 0.05);
}

.segment-item input:focus-visible + span,
.chip input:focus-visible + span {
  outline: 2px solid #111;
  outline-offset: 3px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 16px;
}

.chip { position: relative; }

.chip span {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
}

.chip input:checked + span {
  background: #111;
  border-color: #111;
  color: #fff;
}

.summary {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  font-size: 14px;
}

.uploader { margin-bottom: 18px; }

.drop {
  position: relative;
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.drop.over { box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08); }

.frame {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, #f7f6f3, #e6e2d8);
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.frame-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  text-align: center;
}

.initials {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #111;
  color: var(--gold);
  font-weight: 600;
  font-size: 14px;
}

.frame-empty span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.drop-copy {
  display: block;
  min-width: 0;
}

.drop-copy strong {
  display: block;
  font-weight: 500;
  letter-spacing: -0.02em;
}

#photoHint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.filename {
  margin-top: 8px;
  color: var(--ink);
  font-size: 13px;
  word-break: break-word;
}

.filename:empty { display: none; }

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}

.check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #111;
  flex: none;
}

.textlink {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: #111;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.btn.solid {
  margin-left: auto;
  min-width: 148px;
  background: #111;
  color: #fff;
}

.btn.solid:hover { background: #000; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: rgba(0, 0, 0, 0.05); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }

.btn.tiny {
  height: 36px;
  padding: 0 14px;
  background: #111;
  color: #fff;
  font-size: 13px;
}

.fine {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.fine a {
  color: inherit;
  font-weight: 500;
}

.done h2 {
  margin: 8px 0 12px;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 500;
  letter-spacing: -0.048em;
  line-height: 1.02;
}

.lead-dark {
  margin: 0;
  max-width: 18em;
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  line-height: 1.3;
  color: #3f3d39;
}

.ref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 8px;
  padding: 16px 16px 16px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}

.ref-label {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ref span {
  font-size: clamp(26px, 7vw, 34px);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

dialog {
  width: min(440px, calc(100% - 32px));
  padding: 28px;
  border: 0;
  border-radius: 22px;
  background: #f7f6f3;
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

dialog::backdrop { background: rgba(12, 12, 14, 0.62); }

dialog h2 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

dialog p { margin: 0 0 12px; color: #3f3d39; font-size: 15px; }
dialog .btn { margin-top: 8px; }

.noscript {
  margin: 0 0 16px;
  color: var(--danger);
}

.story :focus-visible,
dialog :focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 1100px) and (min-width: 901px) {
  .story { padding: 24px 28px 20px; }
  .step-no { font-size: 76px; }
  .sheet { padding: 40px 32px 48px; }
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .shell {
    display: block;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .story {
    height: auto;
    padding:
      0
      max(16px, env(safe-area-inset-right))
      4px
      max(16px, env(safe-area-inset-left));
    overflow: visible;
  }

  .story-top {
    position: sticky;
    top: 0;
    z-index: 4;
    margin-right: calc(-1 * max(16px, env(safe-area-inset-right)));
    margin-left: calc(-1 * max(16px, env(safe-area-inset-left)));
    padding:
      calc(12px + env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      12px
      max(16px, env(safe-area-inset-left));
    background: rgba(18, 17, 14, 0.9);
    backdrop-filter: saturate(140%) blur(18px);
  }

  .brand-mark { height: 44px; }
  .brand-name { font-size: 15px; }
  .brand-domain { font-size: 12px; }

  .mobile-afis {
    display: block;
    margin: -22px -18px 16px;
  }

  .mobile-afis img { border-radius: 28px 28px 0 0; }

  .story-mid { margin-top: 18px; }
  .step-no { font-size: 58px; }
  .step-kicker { margin-bottom: 8px; }
  .story h1 {
    max-width: none;
    margin: 10px 0 8px;
    font-size: clamp(30px, 8vw, 40px);
  }
  .lead { font-size: 18px; }

  .story-bottom { display: none; }

  .rail {
    display: flex;
    gap: 8px;
  }

  .rail li { flex: 1; min-width: 0; }

  .rail button {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    padding: 8px 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    gap: 6px;
  }

  .rail button[aria-current="step"] {
    background: rgba(212, 180, 131, 0.16);
    border-color: rgba(212, 180, 131, 0.5);
    color: var(--night-text);
  }

  .copyline { margin-top: 12px; }

  .workspace {
    margin:
      18px
      max(16px, env(safe-area-inset-right))
      calc(20px + env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
    min-height: 0;
    overflow: hidden;
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  }

  .sheet { padding: 22px 18px 28px; }

  .chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .chip span {
    width: 100%;
    justify-content: center;
  }

  .chips .chip:last-child:nth-child(odd) { grid-column: 1 / -1; }

  .add-file {
    display: flex;
    width: 100%;
    justify-content: center;
  }

  .date-row select {
    padding-left: 12px;
    padding-right: 30px;
    background-position: right 8px center;
  }

  .field input[type="text"],
  .field input[type="tel"],
  .field input[type="email"],
  .field select {
    height: 52px;
    font-size: 16px;
  }

  .actions { margin-top: 8px; }
  .btn { min-height: 52px; }
  .btn.solid { flex: 1; margin-left: 0; }
  .btn.ghost { min-width: 76px; padding: 0 8px; }

  .fine { margin-top: 8px; }

  dialog {
    max-height: calc(100dvh - 32px);
    overflow: auto;
    margin: auto;
  }
}

@media (max-width: 640px) {
  .row { grid-template-columns: 1fr; }
  .row.pair { grid-template-columns: 1fr 1fr; gap: 10px; }
  .drop {
    grid-template-columns: 112px 1fr;
    gap: 14px;
    align-items: center;
  }
  .frame { width: 100%; }
  .ref { align-items: flex-start; flex-direction: column; }
  .ref span { font-size: 26px; }
  .done h2 { font-size: 34px; }
  .lead-dark { font-size: 20px; }
}

@media (max-width: 390px) {
  .status { font-size: 12px; }
  .step-no { font-size: 48px; }
  .story h1 { font-size: 28px; }
  .rail .n { width: auto; }
  .drop { grid-template-columns: 1fr; }
  .frame { width: min(168px, 46vw); }
  .date-row { gap: 8px; }
  .note { padding: 14px 14px 12px; }
  .ref { padding: 14px; }
}

@media (max-height: 480px) and (orientation: landscape) {
  .story-mid { margin-top: 8px; }
  .lead, .copyline, .path em { display: none; }
  .step-no { font-size: 40px; }
  .story h1 { font-size: 24px; margin: 4px 0; }
  .story-bottom { padding-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
