:root {
  color-scheme: light;
  --ink: #11231f;
  --muted: #5d6b67;
  --line: rgba(17, 35, 31, .10);
  --paper: #e9f3f0;
  --panel: rgba(255, 255, 255, .82);
  --canvas: #e9f3f0;
  --accent: #0e8d7c;
  --accent-dark: #0a6b60;
  --soft-accent: #e3f3ef;
  --glass-border: rgba(255, 255, 255, .78);
  --danger: #a13f34;
  --radius: 20px;
  --small-radius: 14px;
  --shadow: 0 16px 40px rgba(25, 45, 60, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--canvas); overscroll-behavior: none; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: transparent;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 8% 2%, rgba(255, 255, 255, .58), transparent 34rem),
    linear-gradient(165deg, #e9f3f0 0%, #e4ecfb 54%, #f1ecf9 100%);
}

button, input, textarea { font: inherit; }
button { color: inherit; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(14, 141, 124, .24);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.app-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(20px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--glass-border);
  background: rgba(233, 243, 240, .96);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: inline-flex; align-items: center; }
.brand img { display: block; height: 25px; width: auto; }
.header-label { color: var(--muted); font-size: 12px; letter-spacing: .12em; }

.progress {
  max-width: 580px;
  margin: 28px auto 0;
  padding: 0 24px;
}

.progress ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.progress ol::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 16.66%;
  right: 16.66%;
  height: 1px;
  background: var(--line);
}

.progress li {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  color: #999a96;
  font-size: 11px;
  letter-spacing: .08em;
}

.progress li span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--canvas);
  font-size: 11px;
  z-index: 1;
}

.progress li.is-current,
.progress li.is-done { color: var(--ink); }
.progress li.is-current span { color: #fff; border-color: var(--accent); background: var(--accent); }
.progress li.is-done span { border-color: var(--accent); background: var(--soft-accent); }

main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 52px 0 84px;
}

.step-panel { animation: panel-in .35s ease-out both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } }

.intro-copy { max-width: 680px; margin: 0 auto 34px; text-align: center; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .18em; }
h1 { margin: 0; font-family: inherit; font-weight: 760; letter-spacing: -.025em; }
.intro-copy h1 { font-size: clamp(34px, 7vw, 58px); line-height: 1.28; }
.lead { max-width: 560px; margin: 22px auto 0; color: var(--muted); font-size: 15px; line-height: 1.9; }

.input-card,
.editor-card,
.spec-card,
.share-card,
.print-note {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.input-card { max-width: 700px; margin: 0 auto; padding: clamp(22px, 4vw, 36px); }
.input-card > label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 700; }

textarea, input[type="text"], input[type="email"] {
  width: 100%;
  border: 1px solid rgba(17, 35, 31, .14);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  transition: border-color .18s, box-shadow .18s;
}

textarea { resize: vertical; }
.input-card textarea { min-height: 114px; padding: 14px 15px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.6; }
textarea:focus, input[type="text"]:focus, input[type="email"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,141,124,.12); outline: 0; }
.field-help { margin: 8px 0 0; color: var(--muted); font-size: 11px; }

.button-row { display: flex; gap: 10px; margin-top: 22px; }
.button {
  min-height: 46px;
  border-radius: var(--small-radius);
  border: 1px solid transparent;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, background .15s, border-color .15s;
}
.button:active { transform: translateY(1px); }
.button:disabled { cursor: wait; opacity: .68; transform: none; }
.button-primary { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 10px 22px rgba(14, 141, 124, .28); }
.button-primary:hover { filter: brightness(.94); }
.button-secondary { background: rgba(255,255,255,.9); border-color: rgba(17,35,31,.14); }
.button-secondary:hover { background: #fff; }
.button-wide { min-width: min(100%, 300px); }

.status { min-height: 20px; margin: 12px 0 0; color: var(--accent); font-size: 12px; line-height: 1.5; }
.status.is-error { color: var(--danger); }
.centered { text-align: center; }

.privacy-note {
  max-width: 700px;
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 20px;
  margin: 18px auto 0;
  padding: 18px 22px;
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--small-radius);
  background: rgba(255,255,255,.54);
  font-size: 12px;
}
.privacy-note p { margin: 0; color: var(--muted); line-height: 1.7; }

.pro-notice {
  max-width: 700px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 auto 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: var(--small-radius);
  background: rgba(227, 243, 239, .82);
  box-shadow: 0 8px 22px rgba(25,45,60,.06);
}
.pro-notice.compact { max-width: none; margin: 0 0 22px; }
.pro-notice .pro-chip { flex: 0 0 auto; margin: 1px 0 0; }
.pro-notice strong { display: block; font-size: 12px; }
.pro-notice p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; }

.step-back {
  margin: 0 0 22px;
  padding: 5px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}
.step-back:hover { color: var(--ink); }
.section-heading { margin-bottom: 26px; }
.section-heading h1 { font-size: clamp(30px, 4vw, 44px); }
.section-heading > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

.side-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: var(--small-radius);
  background: rgba(255,255,255,.46);
}
.side-switch > button {
  min-width: 126px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.side-switch > button[aria-selected="true"] { color: #fff; background: var(--accent); box-shadow: 0 8px 18px rgba(14,141,124,.22); }
.pro-chip {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 20px;
  color: #fff;
  background: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .03em;
  vertical-align: middle;
}

.designer-layout { display: grid; min-width: 0; grid-template-columns: minmax(0, 1.04fr) minmax(340px, .96fr); gap: clamp(24px, 4vw, 52px); align-items: start; }
.designer-layout > * { min-width: 0; }
.preview-column { position: sticky; top: 92px; }
.preview-label { margin: 0 0 10px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.card-stage {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 390px;
  overflow: hidden;
  padding: clamp(26px, 5vw, 56px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.38);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 12px 34px rgba(25,45,60,.08);
}

.business-card {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 91 / 55;
  overflow: hidden;
  color: #20211f;
  background: #fffefa;
  box-shadow: var(--shadow);
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
}

.lab-card-preview {
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow);
}
.lab-card-preview.is-tate { width: 64%; max-width: 290px; }
.lab-card-preview svg { display: block; width: 100%; height: auto; }
.lab-card-preview [data-text-key] { cursor: pointer; touch-action: manipulation; }
.lab-card-preview text.is-text-selected {
  paint-order: stroke fill;
  stroke: rgba(14,141,124,.34);
  stroke-width: 1.25px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.front-copy { position: absolute; inset: 14% 30% 12% 8%; z-index: 1; }
.front-copy p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-company { min-height: 1.1em; font-size: clamp(7px, 1.7vw, 11px); letter-spacing: .08em; }
.preview-reading { margin-top: 10% !important; color: #747570; font-size: clamp(6px, 1.35vw, 9px); letter-spacing: .18em; text-transform: uppercase; }
.preview-name { margin-top: 2% !important; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: clamp(20px, 5.2vw, 34px); line-height: 1.2; }
.preview-role { margin-top: 5% !important; font-size: clamp(7px, 1.55vw, 10px); }
.preview-email { position: absolute; bottom: 0; left: 0; right: 0; color: #5f605d; font-size: clamp(6px, 1.4vw, 9px); }
.preview-qr-wrap { position: absolute; right: 7%; bottom: 13%; width: 19%; text-align: center; z-index: 2; }
.preview-qr-wrap canvas { display: block; width: 100%; height: auto; background: #fff; image-rendering: pixelated; }
.preview-qr-wrap span { display: block; margin-top: 5px; font-size: clamp(5px, 1.1vw, 7px); letter-spacing: .16em; }
.front-accent { position: absolute; background: var(--card-accent, var(--accent)); }

.front-card.layout-minimal .front-accent { top: 0; bottom: 0; left: 0; width: 1.5%; }
.front-card.layout-band .front-accent { top: 0; left: 0; right: 0; height: 12%; }
.front-card.layout-band .front-copy { top: 19%; }
.front-card.layout-solid { color: #fff; background: var(--card-accent, var(--accent)); }
.front-card.layout-solid .front-accent { display: none; }
.front-card.layout-solid .preview-reading,
.front-card.layout-solid .preview-email { color: rgba(255,255,255,.74); }
.front-card.layout-solid .preview-qr-wrap { padding: 3.3%; width: 24%; border-radius: 3px; color: #222; background: #fff; }

.back-card { padding: 7% 7.5%; }
.back-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 1.5%; background: var(--card-accent, var(--accent)); }
.back-heading > span { display: block; color: var(--card-accent, var(--accent)); font-size: clamp(6px, 1.3vw, 8px); font-weight: 800; letter-spacing: .18em; }
.back-heading > strong { display: block; margin-top: 2%; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: clamp(12px, 3vw, 19px); font-weight: 500; line-height: 1.35; }
.back-sections { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4%; margin-top: 5%; padding-top: 4%; border-top: 1px solid #d5d4cf; }
.back-sections section { min-width: 0; }
.back-sections b { color: var(--card-accent, var(--accent)); font-size: clamp(6px, 1.15vw, 8px); letter-spacing: .08em; }
.back-sections p { margin: 4% 0 0; font-size: clamp(6px, 1.25vw, 8px); line-height: 1.55; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.back-services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8%; margin: 6% 0 0; padding: 5% 0 0; border-top: 1px solid #d5d4cf; list-style: none; }
.back-services li { position: relative; padding-left: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(7px, 1.5vw, 10px); }
.back-services li::before { content: ""; position: absolute; top: .55em; left: 0; width: 5px; height: 1px; background: var(--card-accent, var(--accent)); }
.back-card.layout-services .back-sections { display: none; }
.back-card.layout-services .back-heading > strong { font-size: clamp(15px, 3.8vw, 24px); }
.back-card.layout-split .back-sections { grid-template-columns: 1fr; width: 48%; gap: 5px; }
.back-card.layout-split .back-sections section { display: grid; grid-template-columns: 54px 1fr; gap: 4px; }
.back-card.layout-split .back-sections p { margin: 0; -webkit-line-clamp: 2; }
.back-card.layout-split .back-services { position: absolute; top: 29%; right: 7%; bottom: 8%; width: 38%; display: block; margin: 0; padding: 3% 0 0 5%; border-top: 0; border-left: 1px solid #d5d4cf; }
.back-card.layout-split .back-services li { margin-bottom: 7%; }

.preview-caption { margin: 10px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.qr-check-card { margin-top: 14px; padding: 16px 17px; border: 1px solid var(--glass-border); border-radius: 16px; background: rgba(255,255,255,.62); box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.qr-check-card > strong { display: inline; margin-left: 7px; font-size: 12px; }
.required-chip { display: inline-flex; padding: 3px 7px; border-radius: 999px; color: #fff; background: var(--danger); font-size: 8px; font-weight: 800; letter-spacing: .05em; }
.qr-check-card ol { margin: 10px 0 12px; padding-left: 20px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.qr-phone-guide, .qr-open-link { display: none; }
.qr-open-link { align-items: center; justify-content: center; min-height: 42px; margin: 10px 0 8px; padding: 9px 12px; border: 1px solid var(--accent); border-radius: 12px; color: #fff; background: var(--accent); font-size: 11px; font-weight: 700; text-decoration: none; }
.qr-check-action { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 11px; border: 1px solid rgba(17,35,31,.14); border-radius: 12px; background: #fff; font-size: 11px; font-weight: 700; cursor: pointer; }
.qr-check-action input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.qr-check-action:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--soft-accent); }
.qr-check-action:has(input:disabled) { opacity: .48; cursor: not-allowed; }

.editor-card { min-width: 0; padding: clamp(20px, 3.5vw, 30px); }
.control-section + .control-section { margin-top: 26px; }
.control-title { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 12px; font-weight: 700; }
.control-hint { margin: -3px 0 10px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.segmented-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.segmented-controls.three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segmented-controls > button {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(17,35,31,.14);
  border-radius: 12px;
  background: rgba(255,255,255,.86);
  font-size: 11px;
  cursor: pointer;
}
.segmented-controls > button.is-selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--soft-accent); font-weight: 700; }

.template-scroll {
  display: flex;
  gap: 10px;
  margin: 0 -3px;
  padding: 3px 3px 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.template-option {
  flex: 0 0 118px;
  padding: 7px;
  border: 1px solid rgba(17,35,31,.14);
  border-radius: 12px;
  background: rgba(255,255,255,.86);
  cursor: pointer;
  scroll-snap-align: start;
}
.template-option.is-tate { flex-basis: 82px; }
.template-option.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--soft-accent); }
.template-thumb { display: grid; place-items: center; min-height: 64px; overflow: hidden; border: 1px solid #e0dfda; border-radius: 5px; background: #e9e8e3; }
.template-option.is-tate .template-thumb { min-height: 102px; }
.template-thumb svg { display: block; width: 100%; height: auto; }
.template-option.is-tate .template-thumb svg { width: 72%; }
.template-name { display: flex; align-items: center; justify-content: center; gap: 3px; min-height: 21px; margin-top: 6px; font-size: 9.5px; }
.mini-pro { color: var(--accent); font-size: 7px; font-weight: 800; letter-spacing: .04em; }

.palette-block + .palette-block { margin-top: 11px; }
.palette-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; }
.lab-color-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.lab-color {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px #bbb;
  cursor: pointer;
}
.lab-color.is-card { width: 46px; border-radius: 5px; background: var(--swatch-card); }
.lab-color.is-selected { box-shadow: 0 0 0 2px var(--ink); }
.asset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.asset-note { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.photo-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.photo-tools output { min-width: 42px; color: var(--muted); font-size: 11px; text-align: center; }
.small-control {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid rgba(17,35,31,.14);
  border-radius: 999px;
  background: #fff;
  font-size: 10px;
  cursor: pointer;
}
.small-control.is-selected { color: #fff; border-color: var(--accent); background: var(--accent); }
.details-editor { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.details-editor summary { margin-bottom: 18px; font-size: 12px; font-weight: 700; cursor: pointer; }
.control-group { padding: 0; margin: 0 0 28px; border: 0; }
.control-group legend { margin-bottom: 11px; font-size: 12px; font-weight: 700; }
.back-type-controls { padding-top: 20px; border-top: 1px solid var(--line); }
.divider-controls { padding: 18px; border: 1px solid var(--glass-border); border-radius: 16px; background: rgba(255,255,255,.4); }
.divider-controls .fine-controls { margin-top: 14px; }
.text-targets { display: flex; gap: 7px; margin: 0 -2px 12px; padding: 2px 2px 5px; overflow-x: auto; scrollbar-width: thin; }
.text-targets > button { flex: 0 0 auto; min-height: 40px; padding: 8px 13px; border: 1px solid rgba(17,35,31,.14); border-radius: 999px; background: #fff; font-size: 10px; font-weight: 700; white-space: nowrap; cursor: pointer; touch-action: manipulation; }
.text-targets > button.is-selected { color: #fff; border-color: var(--accent); background: var(--accent); box-shadow: 0 6px 15px rgba(14,141,124,.18); }
.selected-text-label { margin: 0 0 15px; padding: 9px 11px; border-radius: 10px; color: var(--muted); background: var(--soft-accent); font-size: 10px; }
.selected-text-label strong { color: var(--ink); }
.fine-controls { margin-top: 18px; padding: 14px; border: 1px solid rgba(17,35,31,.1); border-radius: 14px; background: rgba(255,255,255,.58); }
.fine-controls > p { margin: 0 0 12px; font-size: 10px; font-weight: 800; }
.fine-control { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 44px; }
.fine-control + .fine-control { margin-top: 6px; }
.fine-control > span { display: flex; flex-direction: column; color: var(--muted); font-size: 10px; font-weight: 700; }
.fine-control output { margin-top: 2px; color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.fine-control input[type="range"] { width: 100%; height: 32px; margin: 0; padding: 0; accent-color: var(--accent); touch-action: pan-x; }
.back-type-row + .back-type-row { margin-top: 16px; }
.back-type-row > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice {
  min-height: 84px;
  padding: 10px 8px;
  border: 1px solid rgba(17,35,31,.14);
  border-radius: 12px;
  background: rgba(255,255,255,.86);
  font-size: 11px;
  cursor: pointer;
}
.choice.is-selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--soft-accent); }
.layout-icon { display: block; width: 40px; height: 25px; margin: 0 auto 7px; border: 1px solid #999; background: #fff; position: relative; }
.icon-minimal::before { content:""; position:absolute; inset:0 auto 0 0; width:3px; background:var(--accent); }
.icon-band::before { content:""; position:absolute; inset:0 0 auto 0; height:5px; background:var(--accent); }
.icon-solid { background:var(--accent); }
.icon-values::before { content:""; position:absolute; left:5px; right:5px; top:7px; height:1px; box-shadow:0 5px #aaa, 0 10px #aaa; background:#777; }
.icon-services::before { content:""; position:absolute; left:6px; right:6px; top:6px; height:2px; box-shadow:0 6px #888, 0 12px #888; background:#888; }
.icon-split::before { content:""; position:absolute; left:50%; top:4px; bottom:4px; width:1px; background:#888; }

.color-grid { display: flex; gap: 10px; }
.color-choice { width: 36px; height: 36px; padding: 0; border: 3px solid #fff; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px #bbb; cursor: pointer; }
.color-choice.is-selected { box-shadow: 0 0 0 2px var(--ink); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 14px; }
.form-grid label { display: block; min-width: 0; color: #4c4d4a; font-size: 11px; font-weight: 700; }
.form-grid label > span { margin-left: 5px; color: var(--danger); font-size: 9px; }
.form-grid input, .form-grid textarea { margin-top: 7px; padding: 11px 12px; font-size: 13px; font-weight: 400; }
.span-2 { grid-column: 1 / -1; }

.pro-toggle { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; margin-bottom: 28px; cursor: pointer; }
.pro-toggle > input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { width: 46px; height: 26px; padding: 3px; border-radius: 30px; background: #b9b9b4; transition: background .2s; }
.toggle-track i { display: block; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.2); transition: transform .2s; }
.pro-toggle input:checked + .toggle-track { background: var(--accent); }
.pro-toggle input:checked + .toggle-track i { transform: translateX(20px); }
.pro-toggle input:focus-visible + .toggle-track { outline: 3px solid rgba(36,77,66,.25); outline-offset: 3px; }
.pro-toggle strong { display: block; font-size: 13px; }
.pro-toggle small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.5; }
#back-controls { transition: opacity .2s; }
#back-controls.is-disabled { opacity: .35; pointer-events: none; user-select: none; }

.bottom-actions { margin-top: 28px; text-align: right; }
.bottom-actions .status { text-align: right; }

.spec-card { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 18px 8px; margin-bottom: 28px; }
.spec-card div { padding: 5px 18px; border-right: 1px solid var(--line); }
.spec-card div:last-child { border-right: 0; }
.spec-card span, .spec-card strong { display: block; }
.spec-card span { color: var(--muted); font-size: 10px; }
.spec-card strong { margin-top: 5px; font-size: 13px; }

.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.result-grid:has(.result-card[hidden]) { grid-template-columns: minmax(0, 580px); justify-content: center; }
.result-card { margin: 0; }
.result-card > p { margin: 0 0 9px; color: var(--muted); font-size: 11px; }
.result-card img { display: block; width: 100%; aspect-ratio: 97 / 61; object-fit: contain; border: 1px solid var(--line); background: #ddd; box-shadow: 0 12px 38px rgba(35,32,24,.09); }
.result-card img.is-tate { aspect-ratio: 61 / 97; max-height: 680px; }
.result-card .button { width: 100%; margin-top: 10px; }
.result-card img.is-a4 { aspect-ratio: 210 / 297; max-height: 620px; }

.output-choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.output-choice {
  min-height: 82px;
  padding: 13px 14px;
  border: 1px solid rgba(17,35,31,.14);
  border-radius: var(--small-radius);
  background: rgba(255,255,255,.82);
  text-align: left;
  cursor: pointer;
}
.output-choice strong, .output-choice span { display: block; }
.output-choice strong { font-size: 12px; }
.output-choice span { margin-top: 5px; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.output-choice.is-selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--soft-accent); }
.generate-row { margin: 0 0 28px; text-align: center; }

.share-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 720px; margin: 34px auto 0; padding: 20px 22px; }
.share-card strong { font-size: 14px; }
.share-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.print-note { max-width: 720px; margin: 18px auto 0; padding: 18px 22px; font-size: 12px; }
.print-note p { margin: 5px 0 0; color: var(--muted); line-height: 1.7; }
.install-button { display: block; margin: 18px auto 0; }

footer { display: flex; justify-content: space-between; max-width: 1120px; margin: 0 auto; padding: 22px max(20px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--glass-border); color: var(--muted); font-size: 9px; letter-spacing: .12em; }

@media (max-width: 820px) {
  main { width: min(100% - 28px, 680px); padding-top: 40px; }
  .designer-layout { grid-template-columns: 1fr; gap: 20px; }
  .preview-column { position: static; }
  .card-stage { min-height: 0; }
  .spec-card { grid-template-columns: repeat(2, 1fr); }
  .spec-card div:nth-child(2) { border-right: 0; }
  .spec-card div:nth-child(-n+2) { padding-bottom: 14px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
  .output-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .app-header { height: 56px; }
  .brand img { height: 22px; }
  .progress { margin-top: 20px; }
  main { width: calc(100% - 24px); padding: 26px 0 60px; }
  .intro-copy { text-align: left; }
  .intro-copy h1 { font-size: 34px; }
  .lead { font-size: 14px; }
  .input-card, .editor-card { padding: 20px; }
  .button-row { flex-direction: column-reverse; }
  .button { width: 100%; }
  .privacy-note { grid-template-columns: 1fr; gap: 6px; }
  .pro-notice { align-items: flex-start; }
  .section-heading { margin-bottom: 18px; }
  .section-heading h1 { font-size: 28px; }
  .section-heading > p:last-child { font-size: 12.5px; line-height: 1.65; }
  .side-switch { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-bottom: 12px; }
  .side-switch > button { min-width: 0; }
  .designer-layout { gap: 14px; }
  .preview-column {
    position: sticky;
    top: 56px;
    z-index: 12;
    margin: 0 -12px;
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(233,243,240,.96);
    box-shadow: 0 12px 26px rgba(25,45,60,.08);
  }
  .preview-label { display: none; }
  .preview-caption { margin-top: 7px; font-size: 9.5px; }
  .qr-check-card { margin-top: 10px; padding: 12px; }
  .qr-desktop-guide { display: none; }
  .qr-phone-guide { display: block; margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
  .qr-open-link { display: flex; }
  .card-stage { padding: 14px 12px; border-radius: var(--small-radius); }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .choice { min-height: 76px; }
  .text-targets { margin-right: -20px; padding-right: 20px; }
  .text-targets > button { min-height: 44px; font-size: 11px; }
  .segmented-controls > button { min-height: 46px; }
  .fine-controls { margin-left: -4px; margin-right: -4px; padding: 14px 12px; }
  .fine-control { grid-template-columns: 64px minmax(0, 1fr); min-height: 50px; }
  .fine-control input[type="range"] { height: 40px; }
  .bottom-actions .status { text-align: left; }
  .result-grid { grid-template-columns: 1fr; }
  .lab-card-preview.is-tate { width: 70%; max-width: 260px; }
  .template-option { flex-basis: 106px; }
  .template-option.is-tate { flex-basis: 76px; }
  .share-card { align-items: stretch; flex-direction: column; }
  .spec-card { padding: 12px 6px; }
  .spec-card div { padding-left: 12px; padding-right: 12px; }
  footer { margin: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .app-header, .progress, footer, .button, .text-button { display: none !important; }
  body, main { background: #fff; }
}

.input-card.profile-faq { margin-top: 24px; scroll-margin-top: 80px; }
.profile-faq h2 { margin: 0 0 14px; font-size: 20px; }
.profile-faq details { border-top: 1px solid var(--line); }
.profile-faq summary { min-height: 44px; padding: 16px 0; font-size: 16px; font-weight: 600; cursor: pointer; }
.profile-faq p { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
