:root {
  color-scheme: light;
  --ink: #503d42;
  --muted: #846f73;
  --line: #e8d7d0;
  --paper: #fffdf9;
  --cream: #fbf3e8;
  --peach: #f7d6c7;
  --peach-strong: #d78376;
  --rose: #bb6c70;
  --shadow: 0 18px 55px rgba(128, 84, 78, .12);
}

* { box-sizing: border-box; }
html { min-width: 0; background: var(--cream); }
body {
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 4%, rgba(247, 214, 199, .62), transparent 26rem),
    var(--cream);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  line-height: 1.65;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid rgba(187, 108, 112, .5);
  outline-offset: 3px;
}

.site-header, .page-shell, .site-footer { width: min(1240px, calc(100% - 40px)); margin-inline: auto; }
.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--ink); border-radius: 9px 3px 9px 3px;
  color: var(--peach-strong); font-size: 26px; line-height: 1;
  transform: rotate(-7deg);
}
.brand-name { display: block; font-family: Georgia, serif; font-size: 20px; font-weight: 700; letter-spacing: .05em; line-height: 1.1; }
.brand-sub { display: block; color: var(--muted); font-size: 10px; letter-spacing: .22em; line-height: 1.5; }
.header-note { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .08em; }

.intro-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .96fr); align-items: center; gap: clamp(28px, 6vw, 88px); padding: 46px 0 58px; }
.eyebrow, .section-kicker { margin: 0 0 9px; color: var(--rose); font-size: 11px; font-weight: 700; letter-spacing: .2em; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { max-width: 600px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 5.2vw, 70px); font-weight: 400; letter-spacing: -.045em; line-height: 1.09; }
h1 em { color: var(--peach-strong); font-style: normal; }
.lead { max-width: 520px; margin: 23px 0 18px; color: var(--muted); font-size: 16px; }
.intro-points { display: flex; flex-wrap: wrap; gap: 8px; }
.intro-points span, .unit-chip, .status-pill { border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 253, 249, .76); color: var(--muted); font-size: 12px; padding: 4px 11px; }
.hero-card { margin: 0; padding: 11px; border: 1px solid rgba(232, 215, 208, .9); border-radius: 18px 4px 18px 4px; background: var(--paper); box-shadow: var(--shadow); transform: rotate(1.2deg); }
.hero-card img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; border-radius: 11px 2px 11px 2px; object-fit: cover; }
.hero-card figcaption { padding: 9px 3px 0; color: var(--muted); font-size: 12px; }

.workspace-grid { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 20px 5px 20px 5px; background: rgba(255, 253, 249, .92); box-shadow: 0 10px 34px rgba(128, 84, 78, .06); }
.form-panel { padding: clamp(20px, 3vw, 34px); }
.preview-panel { padding: clamp(20px, 3vw, 30px); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 25px; }
.panel-heading h2, .info-card h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(23px, 3vw, 31px); font-weight: 400; letter-spacing: -.025em; line-height: 1.2; }
.unit-chip { white-space: nowrap; }
.status-pill { color: var(--peach-strong); white-space: nowrap; }
.status-pill.is-error { border-color: #d99b9c; background: #fff2f0; color: #a9454b; }
.status-pill.is-ready { background: #f7eee2; }

fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
.type-switch legend, .field-group h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; }
.switch-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 24px; }
.switch-option { position: relative; display: block; }
.switch-option input { position: absolute; opacity: 0; pointer-events: none; }
.switch-option span { display: block; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--cream); color: var(--muted); text-align: center; font-size: 14px; }
.switch-option input:checked + span { border-color: var(--peach-strong); background: #fff0e7; color: var(--ink); box-shadow: inset 0 0 0 1px var(--peach-strong); }
.field-group { margin-bottom: 19px; }
.field-grid { display: grid; gap: 12px; }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact-fields { margin-top: 2px; }
.field { min-width: 0; display: block; }
.field > span:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; margin-bottom: 5px; font-size: 13px; font-weight: 700; }
.field small { color: var(--muted); font-family: Georgia, serif; font-size: 12px; font-style: italic; }
.input-with-unit { position: relative; }
.input-with-unit input { width: 100%; min-width: 0; min-height: 46px; padding: 9px 36px 9px 11px; border: 1px solid #ddc8c0; border-radius: 8px; background: #fff; color: var(--ink); font-size: 16px; }
.input-with-unit b { position: absolute; top: 50%; right: 11px; color: var(--muted); font-size: 12px; font-weight: 400; transform: translateY(-50%); }
.field-error { display: block; min-height: 20px; margin-top: 3px; color: #a9454b; font-size: 11px; line-height: 1.35; }
.field input[aria-invalid="true"] { border-color: #c65d64; background: #fff6f4; }
.form-actions, .output-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.form-actions { margin-top: 5px; }
.button { min-height: 46px; border: 1px solid transparent; border-radius: 8px; padding: 10px 17px; font-size: 14px; font-weight: 700; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 15px rgba(128, 84, 78, .12); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-primary { background: var(--peach-strong); color: #fff; }
.button-secondary { border-color: var(--rose); background: #fff8f2; color: var(--rose); }
.button-quiet { border-color: var(--line); background: transparent; color: var(--muted); }
.form-hint, .print-note, .print-preview-heading p { margin: 11px 0 0; color: var(--muted); font-size: 11px; }
.summary-card { margin-top: 25px; padding: 15px; border-radius: 10px; background: var(--cream); }
.summary-empty { color: var(--muted); font-size: 12px; }
.summary-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.summary-title small { color: var(--muted); font-size: 11px; font-weight: 400; }
.summary-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; margin: 0; font-size: 12px; }
.summary-list div { display: flex; justify-content: space-between; gap: 7px; border-bottom: 1px dashed #e5d4ca; }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; font-variant-numeric: tabular-nums; }
.summary-warn { margin: 9px 0 0; color: #a9454b; font-size: 11px; }

.preview-art { display: grid; place-items: center; min-height: 240px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #f5ede3; }
.preview-art svg { display: block; width: 100%; height: auto; max-height: 530px; }
.preview-placeholder { max-width: 280px; color: var(--muted); font-size: 13px; text-align: center; }
.preview-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 11px 0 25px; color: var(--muted); font-size: 11px; }
.preview-meta p { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.legend-swatch { display: inline-block; width: 23px; border-top: 2px solid var(--ink); }
.fold-swatch { border-top-style: dashed; border-color: var(--rose); }
.glue-swatch { width: 16px; height: 10px; border: 0; background: var(--peach); }
.summary-errors { margin: -4px 0 15px; padding: 10px 12px; border: 1px solid #e3b3ad; border-radius: 8px; background: #fff3f0; color: #a9454b; font-size: 12px; }
.summary-errors ul { margin: 0; padding-left: 18px; }
.print-preview-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.print-preview-heading h3 { margin: 0; font-size: 14px; }
.print-preview-heading p { margin-top: 1px; }
.print-preview-heading strong { color: var(--rose); font-family: Georgia, serif; font-size: 20px; font-weight: 400; white-space: nowrap; }
.tile-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; min-height: 46px; }
.tile { min-width: 0; padding: 5px; border: 1px solid var(--line); border-radius: 6px; background: #f5ede3; }
.tile svg { display: block; width: 100%; height: auto; }
.output-actions { margin-top: 18px; }
.print-note strong { color: var(--ink); }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 22px 0; }
.info-card { padding: 27px 30px; border: 1px solid var(--line); border-radius: 14px 4px 14px 4px; background: rgba(255, 253, 249, .72); }
.info-card ol { margin: 17px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; }
.info-card li + li { margin-top: 7px; }
.info-card p:last-child { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.legal-details { margin: 14px 0 36px; border-top: 1px solid var(--line); color: var(--muted); }
.legal-details summary { padding: 16px 0; cursor: pointer; font-size: 13px; }
.legal-copy { max-width: 820px; padding-bottom: 6px; font-size: 12px; }
.legal-copy p { margin: 0 0 10px; }
.site-footer { display: flex; justify-content: space-between; gap: 10px; padding: 20px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; letter-spacing: .08em; }

#print-pages { display: none; }

@media (max-width: 960px) {
  .intro-grid { grid-template-columns: 1fr; gap: 28px; padding-top: 28px; }
  .hero-card { max-width: 620px; }
  .workspace-grid { grid-template-columns: 1fr; }
  .preview-art svg { max-height: none; }
}

@media (max-width: 560px) {
  .site-header, .page-shell, .site-footer { width: min(100% - 24px, 1240px); }
  .site-header { min-height: 68px; }
  .header-note { display: none; }
  .intro-grid { padding: 25px 0 30px; }
  h1 { font-size: clamp(36px, 13vw, 54px); }
  .lead { font-size: 14px; }
  .three-columns { grid-template-columns: 1fr 1fr; }
  .three-columns .field:first-child { grid-column: span 2; }
  .form-actions .button, .output-actions .button { flex: 1 1 150px; }
  .info-grid { grid-template-columns: 1fr; }
  .info-card { padding: 22px; }
}

@media (max-width: 340px) {
  .site-header, .page-shell, .site-footer { width: calc(100% - 18px); }
  .form-panel, .preview-panel { padding: 15px 12px; }
  .three-columns { grid-template-columns: 1fr; }
  .three-columns .field:first-child { grid-column: auto; }
  .summary-list { grid-template-columns: 1fr; }
  .panel-heading { gap: 8px; }
  .panel-heading h2 { font-size: 23px; }
  .unit-chip, .status-pill { padding-inline: 8px; font-size: 10px; }
}

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

@media print {
  @page { size: A4; margin: 0; }
  body.is-printing > *:not(#print-pages) { display: none !important; }
  body.is-printing #print-pages { display: block !important; }
  body.is-printing #print-pages .print-sheet { width: 210mm; height: 297mm; break-after: page; page-break-after: always; }
  body.is-printing #print-pages .print-sheet:last-child { break-after: auto; page-break-after: auto; }
  body.is-printing #print-pages svg { display: block; width: 210mm; height: 297mm; }
}

/* SOU100 Stage A: first-view */
.intro-grid { padding: 24px 0 30px; gap: clamp(18px, 4vw, 50px); }
.intro-grid h1 { font-size: clamp(1.9rem, 3.5vw, 3.15rem); line-height: 1.12; letter-spacing: -.035em; word-break: auto-phrase; }
.lead { margin: 12px 0; line-height: 1.5; }
.hero-card { max-width: 420px; align-self: center; }
.hero-card img { max-height: 230px; object-fit: cover; }
.hero-steps { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; counter-reset: stage; padding: 0; margin: 12px 0 0; }
.hero-steps li { counter-increment: stage; position: relative; padding-left: 1.35rem; font-size: .86rem; line-height: 1.4; }
.hero-steps li::before { content: counter(stage); position: absolute; left: 0; top: .08em; font-weight: 800; }
.hero-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 12px; padding: 9px 17px; border: 2px solid #203c34; border-radius: 999px; background: #203c34; color: #fff; font-weight: 750; line-height: 1.25; text-decoration: none; }
.hero-cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px #203c34; }
.hero-privacy { margin: 8px 0 0; font-size: .78rem; line-height: 1.45; }
@media (max-width: 640px) {
  .intro-grid { padding: 15px 0 12px; gap: 8px; }
  .hero-card { display: none; }
  .intro-grid h1 { font-size: clamp(1.75rem, 8vw, 2.05rem); line-height: 1.14; }
  .lead { margin: 7px 0; font-size: .94rem; line-height: 1.42; }
  .hero-steps { flex-direction: column; gap: 4px; margin-top: 7px; }
  .hero-steps li { font-size: .83rem; }
  .hero-cta { margin-top: 8px; }
  .form-panel .panel-heading .section-kicker { display: none; }
  .form-panel .panel-heading h2 { font-size: 1.15rem; }
  .form-panel .panel-heading { margin-bottom: .7rem; }
}
