:root {
  --paper: #f6f0e6;
  --paper-strong: #fffaf2;
  --ink: #16293a;
  --ink-soft: #4b5964;
  --vermilion: #c94a2f;
  --vermilion-dark: #9e3423;
  --sage: #637b64;
  --blue-pale: #dce7e9;
  --line: rgba(22, 41, 58, 0.16);
  --shadow: 0 18px 50px rgba(58, 42, 27, 0.1);
  --radius: 18px;
  color-scheme: light;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 0;
  margin: 0;
  background:
    radial-gradient(circle at 8% 4%, rgba(255, 255, 255, 0.95), transparent 27rem),
    linear-gradient(90deg, rgba(112, 82, 52, 0.028) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 26px 26px, auto;
  line-height: 1.7;
}

button, textarea { font: inherit; }
button { touch-action: manipulation; }
a { color: var(--vermilion-dark); text-underline-offset: 0.2em; }

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 48% 52%;
  background: var(--vermilion);
  color: white;
  font-size: 20px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}

.brand strong { display: block; letter-spacing: .08em; }
.brand small { display: block; color: var(--ink-soft); font-size: 10px; letter-spacing: .16em; }
.header-note { margin: 0; color: var(--ink-soft); font-size: 13px; letter-spacing: .08em; }

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 74px);
  min-height: 490px;
  padding: 56px 0 62px;
}

.eyebrow, .section-kicker {
  margin: 0 0 10px;
  color: var(--vermilion-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.eyebrow span { font-size: 8px; margin-right: 7px; }

h1, h2, p { overflow-wrap: anywhere; }
h1 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(42px, 6.1vw, 78px);
  line-height: 1.14;
  letter-spacing: -.045em;
  font-weight: 600;
}
h1 em { color: var(--vermilion); font-style: normal; }
.intro-lede { max-width: 33rem; margin: 24px 0 0; color: var(--ink-soft); font-size: 16px; }

.trust-line { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 26px; color: var(--ink); font-size: 12px; font-weight: 700; }
.trust-line span { display: inline-flex; align-items: center; gap: 7px; }
.trust-line b { color: var(--vermilion); }

.workdesk-visual { position: relative; margin: 0; }
.workdesk-visual::before {
  content: "";
  position: absolute;
  inset: 14px -12px -12px 16px;
  border: 1px solid rgba(22,41,58,.22);
  border-radius: 47% 53% 46% 54% / 5% 6% 5% 7%;
  transform: rotate(1.2deg);
}
.workdesk-visual img {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 51% 49% 48% 52% / 6% 7% 5% 8%;
  box-shadow: var(--shadow);
}
.workdesk-visual figcaption { position: relative; margin-top: 15px; text-align: right; color: var(--ink-soft); font-size: 11px; letter-spacing: .1em; }

.workspace, .results-section { padding: 54px 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading h2, .detail-card h2 { margin: 0; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(26px, 3vw, 38px); line-height: 1.3; }
.limit-note { color: var(--ink-soft); font-size: 12px; }

.envelope-card {
  position: relative;
  padding: clamp(22px, 4vw, 44px);
  overflow: hidden;
  border: 1px solid rgba(22,41,58,.2);
  border-radius: var(--radius);
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}
.envelope-card::after {
  content: "";
  position: absolute;
  inset: auto -9% -58% 35%;
  height: 78%;
  border: 1px solid rgba(201,74,47,.12);
  background: rgba(201,74,47,.035);
  transform: rotate(-12deg);
  pointer-events: none;
}
.envelope-card > * { position: relative; z-index: 1; }
.envelope-label { display: flex; align-items: center; gap: 13px; margin-bottom: 13px; font-weight: 700; }
.stamp { width: 36px; height: 36px; display: grid; place-items: center; border: 2px dotted var(--vermilion); color: var(--vermilion); }

textarea {
  display: block;
  width: 100%;
  min-height: 190px;
  resize: vertical;
  border: 1px solid rgba(22,41,58,.28);
  border-radius: 10px;
  padding: 18px;
  background: rgba(255,255,255,.8);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  box-shadow: inset 0 1px 4px rgba(22,41,58,.06);
}
textarea::placeholder { color: #879096; }
textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid rgba(201,74,47,.42); outline-offset: 3px; }

.input-foot { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 12px; }
.input-foot p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.primary-actions, .result-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .02em;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-primary { min-width: 180px; display: inline-flex; justify-content: space-between; align-items: center; gap: 22px; background: var(--vermilion); color: #fff; box-shadow: 0 8px 22px rgba(201,74,47,.24); }
.button-primary:hover:not(:disabled) { background: var(--vermilion-dark); }
.button-arrow { font-size: 20px; }
.button-quiet { border-color: var(--line); background: transparent; color: var(--ink); }
.button-cancel { border-color: var(--vermilion); background: #fff; color: var(--vermilion-dark); }
.button-secondary { border-color: var(--ink); background: var(--ink); color: #fff; }

.progress-wrap { display: flex; align-items: center; gap: 12px; min-height: 30px; margin-top: 16px; color: var(--ink-soft); font-size: 12px; }
progress { width: min(340px, 62vw); height: 8px; accent-color: var(--sage); }
.feedback { margin-top: 12px; border-radius: 9px; padding: 11px 13px; background: var(--blue-pale); font-size: 13px; }
.feedback-error { background: #f7ddd7; color: #7a251b; }
.feedback-warning { background: #f4e5bf; color: #60470e; }
.feedback-success { background: #dfe9df; color: #294b2c; }
.retry-link { min-height: 44px; margin-top: 8px; border: 0; background: none; color: var(--vermilion-dark); text-decoration: underline; cursor: pointer; }

.results-heading { align-items: center; }
.result-summary { max-width: 34rem; margin: 0; color: var(--ink-soft); font-size: 13px; text-align: right; }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.result-card { min-width: 0; border: 1px solid var(--line); border-top: 5px solid var(--ink); border-radius: 8px 8px 15px 15px; padding: 20px; background: rgba(255,250,242,.88); box-shadow: 0 8px 24px rgba(42,39,35,.07); }
.result-card.is-matched { border-top-color: var(--sage); }
.result-card.is-candidates { border-top-color: #c88426; }
.result-card.is-not-found, .result-card.is-invalid { border-top-color: var(--vermilion); }
.result-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.result-index { color: rgba(22,41,58,.35); font-family: ui-monospace, monospace; font-size: 12px; }
.status-tag { border-radius: 999px; padding: 3px 9px; background: rgba(99,123,100,.13); font-size: 11px; font-weight: 700; }
.result-input { display: grid; gap: 3px; margin: 16px 0; padding-bottom: 13px; border-bottom: 1px dashed var(--line); }
.result-input span { color: var(--ink-soft); font-size: 10px; letter-spacing: .12em; }
.result-input strong { font-size: 15px; }
.result-input strong,
.candidate-address span,
.candidate-reading,
.notice span,
.candidate-overflow,
.empty-result {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.candidate-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.candidate-item { border-radius: 9px; padding: 13px; background: rgba(220,231,233,.48); }
.candidate-heading { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-soft); font-size: 10px; letter-spacing: .08em; }
.candidate-address { display: grid; gap: 3px; margin-top: 7px; }
.candidate-address strong { color: var(--vermilion-dark); font-family: ui-monospace, monospace; letter-spacing: .08em; }
.candidate-reading { margin-top: 5px; color: var(--ink-soft); font-size: 11px; }
.notice { display: flex; gap: 8px; margin-top: 10px; color: #714912; font-size: 11px; }
.notice > span:first-child { flex: 0 0 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #e4b965; color: #fff; font-weight: 800; }
.result-message, .empty-result, .candidate-overflow { color: var(--ink-soft); font-size: 12px; }

.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 54px 0; border-top: 1px solid var(--line); }
.detail-card { min-width: 0; padding: clamp(22px, 3vw, 34px); border-radius: var(--radius); background: rgba(255,250,242,.72); border: 1px solid var(--line); }
.data-list { margin: 24px 0 0; }
.data-list div { display: grid; grid-template-columns: minmax(8rem,.5fr) 1fr; gap: 12px; padding: 9px 0; border-top: 1px dashed var(--line); }
.data-list dt { color: var(--ink-soft); font-size: 12px; }
.data-list dd { margin: 0; text-align: right; font-size: 13px; font-weight: 700; }
.guide-card ol { display: grid; gap: 15px; margin: 24px 0 0; padding: 0; list-style: none; }
.guide-card li { display: flex; align-items: center; gap: 13px; }
.guide-card li span { flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--vermilion); color: white; font-size: 12px; font-weight: 700; }

.privacy-note { display: flex; align-items: center; gap: 18px; margin-bottom: 54px; padding: 24px; border: 1px solid rgba(99,123,100,.28); border-radius: var(--radius); background: rgba(223,233,223,.7); }
.privacy-icon { flex: 0 0 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--sage); color: #fff; font-size: 24px; }
.privacy-note p { margin: 3px 0 0; color: var(--ink-soft); font-size: 12px; }
.site-footer { display: flex; justify-content: space-between; gap: 30px; padding: 26px 0 40px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 10px; letter-spacing: .05em; }
.no-script { padding: 1rem; background: #7a251b; color: #fff; text-align: center; }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 28px, 640px); }
  .site-header { min-height: 72px; }
  .header-note { display: none; }
  .intro-grid { grid-template-columns: 1fr; min-height: 0; gap: 32px; padding: 42px 0 46px; }
  h1 { font-size: clamp(39px, 12.5vw, 57px); }
  .intro-lede { margin-top: 18px; }
  .workdesk-visual { width: 100%; }
  .workdesk-visual::before { inset: 10px 0 -8px 10px; transform: none; }
  .workdesk-visual img { aspect-ratio: 16 / 10; object-position: 67% 50%; }
  .workspace, .results-section { padding: 42px 0; }
  .section-heading, .results-heading { align-items: start; flex-direction: column; gap: 8px; }
  .result-summary { text-align: left; }
  .input-foot { align-items: start; flex-direction: column; }
  .primary-actions .button { flex: 1 1 calc(50% - 6px); }
  .primary-actions .button-primary { flex-basis: 100%; }
  .results-grid, .details-grid { grid-template-columns: 1fr; }
  .details-grid { padding: 42px 0; }
  .result-actions .button { flex: 1 1 100%; }
  .site-footer { flex-direction: column; gap: 8px; }
}

@media (max-width: 360px) {
  .page-shell { width: calc(100% - 20px); }
  .brand-mark { width: 38px; height: 38px; }
  h1 { font-size: 38px; }
  .envelope-card { padding: 18px 14px; }
  .primary-actions .button { flex-basis: 100%; }
  .data-list div { grid-template-columns: 1fr; gap: 2px; }
  .data-list dd { text-align: left; }
  .privacy-note { align-items: flex-start; padding: 18px; }
}

@media print {
  :root { background: #fff; }
  body { background: #fff; }
  .site-header, .intro-grid, .workspace, .result-actions, .details-grid, .privacy-note, .site-footer { display: none !important; }
  .page-shell { width: 100%; }
  .results-section { padding: 0; border: 0; }
  .results-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .result-card { break-inside: avoid; box-shadow: none; }
}

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

/* Stage A: first-view compression and tool entry */
.intro-grid { min-height: 0; padding: 24px 0 28px; gap: clamp(20px, 4vw, 48px); }
.intro-copy h1 { max-width: 19ch; font-size: clamp(32px, 3.4vw, 46px); line-height: 1.14; word-break: auto-phrase; }
.intro-lede { margin-top: 12px; font-size: 15px; }
.workdesk-visual img { max-height: 285px; }
.trust-line { gap: 7px 14px; margin-top: 12px; font-size: 11px; }
.firstview-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 13px 0 9px; padding: 0; list-style-position: inside; color: var(--ink); font-size: 12px; font-weight: 700; }
.firstview-steps li { min-width: 0; padding: 5px 3px; border-top: 1px solid var(--line); }
.firstview-cta { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; margin-top: 3px; padding: 9px 16px; border-radius: 8px; color: #fff; background: var(--vermilion-dark); font-size: 14px; font-weight: 800; text-decoration: none; }
.firstview-cta:hover { background: #812a1d; }
.firstview-cta:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.workspace { padding-top: 32px; }
@media (max-width: 640px) {
  .intro-grid { grid-template-columns: 1fr; min-height: 0; gap: 12px; padding: 20px 0 22px; }
  .intro-copy h1 { max-width: none; font-size: clamp(28px, 8vw, 34px); }
  .intro-lede { margin-top: 8px; font-size: 14px; line-height: 1.55; }
  .workdesk-visual { display: none; }
  .firstview-steps { gap: 3px; margin: 10px 0 7px; font-size: 11px; line-height: 1.4; }
  .firstview-steps li { padding: 4px 2px; }
  .trust-line { margin-top: 9px; }
  .workspace { padding: 24px 0; }
  .workspace > .section-heading { gap: 5px; margin-bottom: 12px; }
  .workspace > .section-heading .section-kicker { display: none; }
  .workspace > .section-heading h2 { font-size: 22px; }
}
@media (max-width: 380px) {
  .firstview-steps { grid-template-columns: 1fr; gap: 2px; }
  .firstview-steps li { padding: 2px 0; }
}

