:root {
  color-scheme: light;
  --ink: #172c35;
  --muted: #60747a;
  --line: #dce5e5;
  --paper: #fff;
  --canvas: #f4f8f7;
  --teal: #147b78;
  --teal-dark: #0d5f5d;
  --soft-teal: #e4f4f1;
  --amber: #8e5810;
  --soft-amber: #fff4de;
  font-family: system-ui, -apple-system, "Yu Gothic UI", "Meiryo", sans-serif;
  background: var(--canvas);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
a { color: var(--teal-dark); text-underline-offset: .2em; }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { width: min(100% - 32px, 960px); min-height: 58px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { color: var(--ink); font-weight: 750; letter-spacing: .01em; text-decoration: none; }
.guide-link { font-size: .92rem; }
.page-shell { width: min(100% - 32px, 850px); margin: 0 auto; padding: 36px 0 52px; }
.intro { margin: 0 0 22px; }
.eyebrow { margin: 0 0 8px; color: var(--teal-dark); font-size: .82rem; font-weight: 750; letter-spacing: .08em; }
h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.45rem); line-height: 1.25; letter-spacing: -.035em; }
.intro-copy { max-width: 700px; margin: 14px 0 0; color: var(--muted); line-height: 1.75; }
.privacy-note { display: inline-flex; align-items: center; gap: 8px; margin: 16px 0 0; padding: 9px 13px; border: 1px solid #b9dfd7; border-radius: 999px; background: var(--soft-teal); color: #145d56; font-size: .91rem; font-weight: 720; }
.panel { margin: 16px 0; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 5px 18px rgb(23 44 53 / 3%); }
.section-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.step-number { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 10px; background: var(--soft-teal); color: var(--teal-dark); font-weight: 800; }
h2 { margin: 1px 0 4px; font-size: 1.2rem; line-height: 1.4; }
.section-heading p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.drop-zone { min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 2px dashed #a9c9c5; border-radius: 13px; background: #f8fcfb; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--teal); background: #eef9f6; }
.upload-icon { display: grid; width: 35px; height: 35px; margin-bottom: 3px; place-items: center; border-radius: 50%; background: var(--soft-teal); color: var(--teal-dark); font-size: 1.35rem; font-weight: 700; }
.drop-title { font-weight: 750; }
.drop-help, .small-note, .field small { color: var(--muted); font-size: .84rem; }
.drop-zone input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.drop-zone:focus-within { outline: 3px solid #92ceca; outline-offset: 3px; }
.file-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 11px 1px 0; font-size: .88rem; }
.file-line span { overflow-wrap: anywhere; }
.text-button { padding: 5px 0; border: 0; background: transparent; color: var(--teal-dark); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.small-note { margin: 11px 0 0; line-height: 1.65; }
.message { margin: 13px 0 0; padding: 11px 13px; border-radius: 9px; background: #f1f5f5; color: #405a61; font-size: .9rem; line-height: 1.55; }
.message.error { background: #fff0ec; color: #9e3528; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 6px; color: #29434b; font-size: .88rem; font-weight: 700; }
.field input, .field select { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid #cbd8d9; border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: .95rem; font-weight: 450; }
.field input:focus, .field select:focus, button:focus-visible, a:focus-visible { outline: 3px solid #92ceca; outline-offset: 2px; }
.field small { font-weight: 400; line-height: 1.45; }
.caution-note { margin: 17px 0 0; padding: 11px 13px; border-left: 3px solid #e2b14e; border-radius: 4px 9px 9px 4px; background: var(--soft-amber); color: #704b1c; font-size: .87rem; line-height: 1.65; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.summary-card { min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfdfd; }
.summary-card span { display: block; color: var(--muted); font-size: .78rem; }
.summary-card strong { display: block; margin-top: 6px; overflow-wrap: anywhere; font-size: clamp(.98rem, 2vw, 1.25rem); font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 11px 12px; border-bottom: 1px solid #e9eeee; text-align: left; white-space: nowrap; }
th { background: #f3f8f7; color: #466067; font-size: .78rem; font-weight: 750; }
tbody tr:last-child td { border-bottom: 0; }
td.numeric, th.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.empty-row { height: 62px; color: var(--muted); text-align: center; }
.diagnostics { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfd; color: #405a61; font-size: .87rem; line-height: 1.6; }
.diagnostics h3 { margin: 0 0 7px; color: var(--ink); font-size: .97rem; }
.diagnostics p { margin: 5px 0; overflow-wrap: anywhere; }
.diagnostics ul { margin: 8px 0 0; padding-left: 20px; }
.diagnostics li + li { margin-top: 4px; }
.download-row { display: flex; align-items: flex-end; gap: 12px; }
.output-select { flex: 1; }
.primary-button { min-height: 44px; padding: 10px 18px; border: 0; border-radius: 9px; background: var(--teal); color: white; font: inherit; font-weight: 750; cursor: pointer; }
.primary-button:hover:not(:disabled) { background: var(--teal-dark); }
.primary-button:disabled { background: #aebcbe; cursor: not-allowed; }
.import-note { margin: 15px 0 0; color: #405a61; font-size: .91rem; line-height: 1.65; }
.page-footer { display: flex; justify-content: space-between; gap: 16px; padding: 15px 3px 0; color: var(--muted); font-size: .84rem; }

@media (max-width: 620px) {
  .header-inner, .page-shell { width: min(100% - 24px, 850px); }
  .page-shell { padding: 25px 0 35px; }
  .panel { padding: 18px 15px; border-radius: 13px; }
  .settings-grid { grid-template-columns: 1fr; gap: 13px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .download-row { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .page-footer { flex-direction: column; gap: 7px; }
  .file-line { align-items: flex-start; flex-direction: column; }
}
