:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #647087;
  --line: #d8dee8;
  --surface: #ffffff;
  --surface-soft: #f5f7fa;
  --brand: #1f4f91;
  --brand-dark: #153a6d;
  --brand-soft: #edf4ff;
  --success: #176b43;
  --success-soft: #eaf8f0;
  --warning: #8a5a00;
  --warning-soft: #fff6dc;
  --danger: #a32d2d;
  --danger-soft: #fff0f0;
  font-family: "Yu Gothic UI", "Meiryo", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: #eef2f7; color: var(--ink); min-width: 320px; }
.shell { width: min(1080px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 54px; }
.hero { display: flex; justify-content: space-between; gap: 28px; align-items: flex-start; margin-bottom: 30px; }
.eyebrow, .section-kicker { margin: 0 0 7px; color: var(--brand); font-weight: 800; letter-spacing: .12em; font-size: 12px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 11px; font-size: clamp(29px, 4vw, 42px); letter-spacing: .02em; }
h2 { margin-bottom: 0; font-size: 21px; }
.lead { color: var(--muted); font-size: 16px; line-height: 1.7; margin-bottom: 0; }
.hero-badge { border: 1px solid #bdd0eb; color: var(--brand); background: var(--brand-soft); border-radius: 12px; padding: 13px 16px; text-align: center; font-size: 13px; font-weight: 700; line-height: 1.6; white-space: nowrap; }
.hero-badge span { font-size: 16px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; list-style: none; padding: 0; margin: 0 0 22px; }
.step { display: flex; gap: 12px; align-items: center; min-height: 68px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafc; color: #7a8494; }
.step > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: #dfe5ed; font-weight: 800; }
.step strong, .step small { display: block; }
.step strong { font-size: 14px; }
.step small { margin-top: 3px; font-size: 12px; }
.step.active { background: var(--brand-soft); border-color: #9fb9df; color: var(--brand-dark); }
.step.active > span { background: var(--brand); color: #fff; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(38, 53, 79, .06); padding: 27px; margin-bottom: 18px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 21px; }
.status-chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 11px; background: #eef1f5; color: #667186; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-chip.ready { color: var(--success); background: var(--success-soft); }
.dropzone { min-height: 218px; border: 2px dashed #aebcd0; border-radius: 13px; background: #fbfcfe; display: grid; place-items: center; align-content: center; text-align: center; padding: 24px; transition: border-color .15s, background .15s; }
.dropzone:focus, .dropzone.dragover { outline: 3px solid rgba(31, 79, 145, .14); border-color: var(--brand); background: #f2f7ff; }
.drop-icon { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 9px; border-radius: 10px; color: var(--brand); background: #e4efff; font-weight: 900; font-size: 23px; }
.drop-title { margin-bottom: 4px; font-size: 17px; font-weight: 800; }
.drop-subtitle { margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.file-help { margin: 15px 0 0; color: var(--muted); font-size: 12px; }
.button { border: 0; border-radius: 9px; min-height: 46px; padding: 0 19px; font: inherit; font-weight: 800; cursor: pointer; transition: background .15s, transform .05s, opacity .15s; }
.button:active { transform: translateY(1px); }
.button:focus-visible, .text-button:focus-visible { outline: 3px solid rgba(31, 79, 145, .28); outline-offset: 2px; }
.button.primary { background: var(--brand); color: #fff; min-width: 240px; }
.button.primary:hover { background: var(--brand-dark); }
.button.primary:disabled { cursor: not-allowed; opacity: .45; }
.button.secondary { display: inline-flex; align-items: center; justify-content: center; background: #e6edf8; color: var(--brand-dark); }
.button.secondary:hover { background: #d8e5f8; }
.selected-file { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid #bfd0e5; border-radius: 10px; background: var(--brand-soft); }
.file-icon { display: grid; place-items: center; width: 42px; height: 38px; border-radius: 7px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 900; }
.selected-file strong, .selected-file span { display: block; }
.selected-file strong { overflow-wrap: anywhere; }
.selected-file span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.text-button { margin-left: auto; border: 0; background: transparent; color: var(--brand); cursor: pointer; font: inherit; font-size: 13px; font-weight: 800; }
.inline-note, .calculation-note { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 16px 0 0; }
.inline-note span { color: var(--brand); margin-right: 5px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 21px; }
.summary-card { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.summary-card small, .summary-card strong { display: block; }
.summary-card small { color: var(--muted); font-size: 12px; }
.summary-card strong { margin-top: 7px; font-size: 20px; letter-spacing: .02em; }
.summary-card.total { border-color: #9fb9df; background: var(--brand-soft); }
.summary-card.total strong { color: var(--brand-dark); }
.review-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
caption { padding: 12px 14px; text-align: left; font-weight: 800; background: #f3f5f8; }
th, td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 12px; font-weight: 800; }
td:not(:first-child), th:not(:first-child) { text-align: right; }
.action-panel { display: flex; justify-content: space-between; gap: 20px; align-items: center; background: #f8fbff; border-color: #bcd0e8; }
.action-copy p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.result, .error-box { border-radius: 13px; padding: 21px 24px; margin-bottom: 18px; }
.result { border: 1px solid #a5d2b9; background: var(--success-soft); }
.result h2 { color: var(--success); margin-bottom: 10px; }
.result p { margin: 5px 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.result-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.result-actions .button { min-height: 40px; }
.error-box { border: 1px solid #e1aaaa; background: var(--danger-soft); color: var(--danger); font-weight: 700; line-height: 1.6; }
footer { display: flex; justify-content: space-between; gap: 15px; color: #7a8494; font-size: 12px; padding: 8px 3px; }
@media (max-width: 720px) {
  .shell { width: min(100% - 24px, 620px); padding-top: 26px; }
  .hero, .action-panel { display: block; }
  .hero-badge { display: inline-block; margin-top: 17px; text-align: left; }
  .steps { grid-template-columns: 1fr; gap: 8px; }
  .step { min-height: 54px; }
  .panel { padding: 19px 16px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .action-panel .button { width: 100%; margin-top: 18px; }
  footer { display: block; line-height: 1.8; }
  footer span { display: block; }
}
