:root {
  --paper:    #faf8f4;
  --paper-2:  #f3efe7;
  --card:     #ffffff;
  --ink:      #23211e;
  --ink-2:    #6d6760;
  --ink-3:    #9a9389;
  --line:     #ded7c9;
  --line-2:   #eae4d8;
  --accent:   #2e4756;
  --accent-2: #4c6b7c;
  --accent-pale: #eef2f4;
  --gold:     #b99a52;
  --gold-pale:#faf3e5;
  --ok:       #4a7a58;
  --ok-pale:  #f0f6f1;
  --ng:       #a8503c;
  --ng-pale:  #fbf1ee;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", "Yu Gothic", "Noto Sans JP", sans-serif;
  line-height: 2;
  font-size: 15.5px;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 680px; margin: 0 auto; padding: 0 22px; }

/* ---------- type ---------- */
.label { display: block; font-size: 11.5px; letter-spacing: .22em; color: var(--ink-3); margin-bottom: 14px; }
h1 { font-size: clamp(22px, 5.6vw, 29px); line-height: 1.85; margin: 0 0 20px; font-weight: 600; letter-spacing: .04em; text-wrap: balance; }
h1 .u { background-image: linear-gradient(transparent 70%, #e8dcc0 70%); }
h2 { font-size: 19px; margin: 0 0 12px; font-weight: 600; line-height: 1.9; letter-spacing: .04em; text-wrap: balance; }
.sub { color: var(--ink-2); font-size: 14px; margin: 0 0 30px; }
.rule { display: block; width: 62px; height: 8px; margin: 0 0 26px; color: var(--line); }

/* ---------- hero ---------- */
.hero { padding: 44px 0 50px; text-align: center; }
.hero-lead { margin: 0 auto 22px; color: var(--ink-2); font-size: 14.5px; max-width: 26em; }
.assure { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding: 0; }
.assure li { border: 1px solid var(--line); background: #fff; padding: 5px 14px; font-size: 12.5px; color: var(--ink-2); letter-spacing: .06em; }
.scene { display: block; width: 100%; max-width: 360px; margin: 38px auto 0; color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: block; width: 100%; max-width: 330px; margin: 0 auto; min-height: 62px;
  background: var(--accent); color: #fff; border: none; border-radius: 2px;
  padding: 19px 26px; font-size: 16px; font-weight: 600; letter-spacing: .1em;
  cursor: pointer; text-decoration: none; text-align: center; font-family: inherit;
  transition: background .2s;
}
.btn:hover { background: #253a47; }
.btn:disabled { background: #b4aea6; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn-inline { max-width: none; }
.btn-note { display: block; margin-top: 14px; font-size: 12px; color: var(--ink-3); letter-spacing: .06em; text-align: center; line-height: 1.8; }

.btn-sub {
  display: block; width: 100%; background: transparent; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 2px; padding: 15px 22px; min-height: 52px;
  font-size: 14.5px; font-weight: 600; letter-spacing: .06em; cursor: pointer;
  font-family: inherit; text-align: center; transition: background .2s;
}
.btn-sub:hover { background: var(--accent-pale); }
.btn-sub:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.link-btn {
  background: none; border: none; padding: 0; font-family: inherit; font-size: 13px;
  color: var(--accent); text-decoration: underline; cursor: pointer; letter-spacing: .04em;
}

/* ---------- sections ---------- */
section { padding: 56px 0; }
.band { background: var(--paper-2); }
.band-w { background: var(--card); }

/* ---------- saved wish ---------- */
.saved-box { border: 1px solid var(--accent-2); background: var(--accent-pale); padding: 20px 20px 18px; }
.saved-t { margin: 0 0 12px; font-size: 12px; letter-spacing: .18em; color: var(--accent); }
dl.mini { margin: 0 0 14px; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 14px; }
dl.mini dt { color: var(--ink-3); font-size: 13px; }
dl.mini dd { margin: 0; }

/* ---------- forms ---------- */
.form-card { background: var(--card); border: 1px solid var(--line); padding: 26px 20px; }
.band-w .form-card { background: var(--paper); }
fieldset { border: none; margin: 0 0 30px; padding: 0; }
legend { font-size: 12px; font-weight: 600; letter-spacing: .18em; color: var(--accent); padding: 0; }
.legend-note { font-size: 12.5px; color: var(--ink-2); margin: 6px 0 18px; line-height: 1.9; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

label { font-size: 14px; font-weight: 600; letter-spacing: .04em; }
.hint { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; line-height: 1.8; margin-top: 3px; letter-spacing: 0; }
input, select, textarea {
  font-family: inherit; font-size: 16px; padding: 13px 14px;
  border: 1px solid #cfc8ba; border-radius: 2px; background: #fff; color: var(--ink);
  width: 100%; min-height: 52px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-pale);
}
.field.missing label { color: #8a6a1e; }
.field.missing input, .field.missing select { border-color: var(--gold); background: var(--gold-pale); }

.promise {
  border: 1px solid var(--line); border-left: 2px solid var(--accent-2); background: var(--card);
  padding: 17px 19px; font-size: 13.5px; line-height: 1.95; color: var(--ink-2); margin-bottom: 22px;
}
.promise strong { color: var(--ink); font-weight: 600; }

/* ---------- howto ---------- */
.howto { border: 1px solid var(--line); background: var(--card); margin-bottom: 22px; }
.howto summary {
  padding: 15px 18px; font-size: 14px; font-weight: 600; cursor: pointer; letter-spacing: .04em;
}
.howto summary:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.howto-list { margin: 0; padding: 0 20px 4px 38px; font-size: 13.5px; line-height: 2; color: var(--ink-2); }
.howto-list li { margin-bottom: 6px; }
.howto-note { margin: 0; padding: 6px 20px 18px; font-size: 12.5px; color: var(--ink-3); line-height: 1.9; }

/* ---------- upload ---------- */
.upload { background: var(--card); border: 1px solid var(--line); padding: 24px 20px; margin-bottom: 24px; }
.upload.dragover { border-color: var(--accent); background: var(--accent-pale); }
.upload-head { font-size: 16px; font-weight: 600; margin: 0 0 6px; letter-spacing: .04em; }
.upload-desc { margin: 0 0 18px; font-size: 13.5px; color: var(--ink-2); line-height: 1.95; }
.upload-desc b { color: var(--ink); font-weight: 600; }
.shot-sample { border: 1px solid var(--line-2); margin-bottom: 18px; font-size: 12.5px; }
.shot-sample-h {
  background: var(--paper-2); padding: 8px 13px; font-weight: 600; font-size: 11.5px;
  color: var(--ink-2); letter-spacing: .12em; border-bottom: 1px solid var(--line-2);
}
.shot-sample dl { margin: 0; padding: 6px 0; }
.shot-sample dt, .shot-sample dd { display: inline-block; margin: 0; padding: 5px 13px; vertical-align: top; line-height: 1.8; }
.shot-sample dt { width: 44%; color: var(--ink-3); }
.shot-sample dd { width: 54%; font-variant-numeric: tabular-nums; }
label.btn-sub { display: block; }

.upload-status { font-size: 13.5px; margin-top: 16px; line-height: 1.9; }
.upload-status.ok { color: var(--ok); }
.upload-status.ng { color: var(--ng); }
.upload-status.busy { color: var(--ink-2); }

.extract-report { margin-top: 14px; }
.extract-report:empty { display: none; }
.er-block { padding: 15px 17px; font-size: 13.5px; line-height: 1.95; margin-bottom: 11px; border: 1px solid; }
.er-block:last-child { margin-bottom: 0; }
.er-ok { background: var(--ok-pale); border-color: #c2d8c8; color: var(--ok); }
.er-miss { background: var(--gold-pale); border-color: #e4d3ac; color: #7d6224; }
.er-block b { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 600; }
.er-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.er-tag { background: #fff; border: 1px solid currentColor; padding: 3px 11px; font-size: 12.5px; }
.er-hint { margin-top: 11px; font-size: 12.5px; line-height: 1.95; }

/* ---------- errors ---------- */
.err {
  background: var(--ng-pale); border: 1px solid #e0bbb0; color: #8f4433;
  padding: 17px 18px; font-size: 14px; display: none; line-height: 1.95; margin-top: 20px;
}
.err.shown { display: block; }
.err b { font-weight: 600; }

/* ---------- result ---------- */
#result { display: none; padding: 56px 0; }
#result.shown { display: block; }

.verdict { border: 2px solid var(--line); padding: 26px 22px; margin-bottom: 20px; }
.verdict.ok   { border-color: var(--ok);   background: var(--ok-pale); }
.verdict.warn { border-color: var(--gold); background: var(--gold-pale); }
.verdict.ng   { border-color: var(--ng);   background: var(--ng-pale); }
.v-head { margin: 0 0 16px; font-size: 18px; font-weight: 600; line-height: 1.8; text-wrap: balance; }
.blockers { list-style: none; margin: 0 0 20px; padding: 0; }
.blockers li {
  background: #fff; border: 1px solid currentColor; padding: 11px 14px; margin-bottom: 8px;
  font-size: 14.5px; line-height: 1.85;
}
.blockers li b { display: block; font-size: 12.5px; letter-spacing: .1em; color: var(--ink-3); font-weight: 600; }
.v-score { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.v-grade { font-size: 32px; font-weight: 600; line-height: 1; width: 34px; text-align: center; }
.v-bar { flex: 1; height: 6px; background: rgba(0,0,0,.08); position: relative; }
.v-bar span { position: absolute; inset: 0 auto 0 0; background: currentColor; }
.v-num { font-size: 13px; white-space: nowrap; color: var(--ink-2); }
.v-num b { font-variant-numeric: tabular-nums; color: var(--ink); }
.v-next { margin: 0; font-size: 13.5px; line-height: 1.95; color: var(--ink-2); }

.rcard { background: var(--card); border: 1px solid var(--line); padding: 26px 22px; margin-bottom: 16px; }
.rcard h3 { font-size: 15.5px; margin: 0 0 6px; font-weight: 600; letter-spacing: .06em; display: flex; align-items: center; gap: 11px; }
.rcard h3 .ic { width: 19px; height: 19px; color: var(--accent-2); flex-shrink: 0; }
.rcard ul { margin: 0; padding: 0; list-style: none; }
.rcard li { margin-bottom: 15px; font-size: 14.5px; line-height: 2; padding-left: 17px; position: relative; }
.rcard li::before { content: ""; position: absolute; left: 0; top: 13px; width: 6px; height: 1px; background: var(--ink-3); }
.rcard li:last-child { margin-bottom: 0; }

/* ---------- comparison tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.cmp { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.cmp th, table.cmp td {
  border-bottom: 1px solid var(--line-2); padding: 12px 10px; text-align: left;
  vertical-align: top; line-height: 1.8;
}
table.cmp thead th {
  font-size: 11.5px; letter-spacing: .12em; color: var(--ink-3); font-weight: 600;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.cmp tbody th { font-weight: 600; white-space: nowrap; }
table.cmp .c { text-align: center; }
table.cmp .mark { font-size: 17px; font-weight: 600; }
.cell-note { display: block; font-size: 12px; color: var(--ink-3); line-height: 1.7; }
tr.s-ok   .mark { color: var(--ok); }
tr.s-warn .mark { color: var(--gold); }
tr.s-ng   .mark { color: var(--ng); }
tr.s-ng th, tr.s-ng td { background: var(--ng-pale); }
td.s-ok   { color: var(--ok); }
td.s-warn { color: var(--gold); }
td.s-ng   { color: var(--ng); background: var(--ng-pale); }
table.compare th, table.compare td { min-width: 108px; }
table.compare tbody th { min-width: 96px; background: var(--paper-2); }
tr.row-strong td { font-size: 15px; }
tr.row-strong .g { font-size: 12px; color: var(--ink-3); }

/* ---------- budget ---------- */
.budget { margin-top: 24px; border-top: 1px solid var(--line-2); padding-top: 22px; }
.budget-t { margin: 0 0 14px; font-size: 12px; letter-spacing: .16em; color: var(--ink-3); }
.budget dl { margin: 0 0 16px; display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14px; }
.budget dt { color: var(--ink-2); white-space: nowrap; }
.budget dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.budget dt.tot, .budget dd.tot { border-top: 1px solid var(--line); padding-top: 10px; font-weight: 600; }
.sub-note { display: block; font-size: 11.5px; color: var(--ink-3); text-align: right; line-height: 1.7; }
.budget-diff { margin: 0; font-size: 14px; padding: 12px 14px; line-height: 1.8; }
.budget-diff.over  { background: var(--ng-pale); color: var(--ng); }
.budget-diff.under { background: var(--ok-pale); color: var(--ok); }

/* ---------- site plan ---------- */
.siteplan { display: block; width: 100%; max-width: 360px; margin: 0 auto; color: var(--accent-2); }
.plan-note { margin: 18px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.95; }
.plan-note strong { color: var(--ink-2); }

/* ---------- loading ---------- */
.loading { display: none; }
.loading.shown { display: block; }
.load-card { background: var(--card); border: 1px solid var(--line); padding: 32px 22px; text-align: center; margin-bottom: 16px; }
.load-house { width: 96px; height: 78px; margin: 0 auto 20px; display: block; color: var(--accent); }
.load-house .draw { stroke-dasharray: 240; stroke-dashoffset: 240; animation: draw 3.4s ease-in-out infinite; }
@keyframes draw {
  0% { stroke-dashoffset: 240; } 55% { stroke-dashoffset: 0; }
  88% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: .15; }
}
.load-title { font-size: 15px; font-weight: 600; margin: 0 0 22px; letter-spacing: .12em; color: var(--ink-2); }
.bar { height: 1px; background: var(--line); margin-bottom: 26px; position: relative; }
.bar span { position: absolute; inset: 0 auto 0 0; height: 1px; width: 4%; background: var(--accent); transition: width .6s ease; }
.load-steps { list-style: none; margin: 0; padding: 0; text-align: left; display: grid; gap: 13px; }
.load-steps li { display: flex; gap: 13px; align-items: flex-start; font-size: 13.5px; color: #bdb6ab; transition: color .4s; line-height: 1.8; }
.load-steps li .ic { flex-shrink: 0; width: 15px; height: 15px; margin-top: 5px; }
.load-steps li.on { color: var(--ink); }
.load-steps li.done { color: var(--accent-2); }
.load-foot { margin: 26px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.95; }
@media (prefers-reduced-motion: reduce) {
  .load-house .draw { animation: none; stroke-dashoffset: 0; }
  .bar span, .v-bar span { transition: none; }
}

/* ---------- disclaimer / actions ---------- */
.disclaimer {
  border: 1px solid var(--line); background: var(--paper-2);
  padding: 20px; font-size: 12.5px; color: var(--ink-2); line-height: 2.05;
}
.disclaimer strong { color: var(--ink); font-weight: 600; }
.actions { display: grid; gap: 11px; margin-top: 26px; }

/* ---------- footer ---------- */
footer { background: var(--ink); color: #b6b0a6; padding: 44px 0 46px; font-size: 12.5px; margin-top: 60px; line-height: 2; }
.foot-mark { display: block; width: 40px; height: 8px; color: #4d483f; margin-bottom: 22px; }
.foot-nav { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 24px; }
footer a { color: #ded8cd; text-decoration: none; }
footer a:hover, footer a:focus-visible { text-decoration: underline; }
.foot-ad { margin: 0 0 22px; padding: 13px 15px; background: rgba(255,255,255,.05); border-left: 1px solid var(--gold); font-size: 12px; line-height: 1.95; }
.foot-info { margin: 0 0 18px; font-size: 12.5px; }
.foot-info b { color: #fff; font-weight: 600; letter-spacing: .1em; }
.foot-name { margin: 0; font-size: 11.5px; color: #85807a; line-height: 1.95; }

@media print {
  .hero, footer, .form-card, .upload, .howto, .promise, .actions, .no-print,
  .loading, #step1, #step2, .assure { display: none !important; }
  section { padding: 10px 0; }
  body { background: #fff; font-size: 11pt; }
  .rcard, .verdict { break-inside: avoid; }
}
