:root {
  --bg: #f5f7f9;
  --surface: #ffffff;
  --ink: #17212b;
  --muted: #66717d;
  --line: #dbe1e7;
  --accent: #176b55;
  --accent-dark: #0f5441;
  --accent-soft: #eaf5f1;
  --warning: #8a5a12;
  --warning-bg: #fff8e9;
  --danger: #a13b3b;
  --danger-soft: #fbebeb;
  --shadow: 0 12px 32px rgba(30, 50, 65, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Yu Gothic", sans-serif;
  line-height: 1.65;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

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

.site-header {
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: .02em; }
.free-badge, .done-badge {
  display: inline-flex; align-items: center; min-height: 28px; padding: 2px 10px;
  border-radius: 999px; color: var(--accent-dark); background: var(--accent-soft);
  font-size: 13px; font-weight: 700;
}

.hero { padding: 68px 0 34px; text-align: center; }
.eyebrow, .step-label { margin: 0 0 7px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
h1 { margin: 0; font-size: clamp(34px, 6vw, 54px); line-height: 1.2; letter-spacing: -.035em; }
.lead { margin: 14px auto 26px; color: #495663; font-size: clamp(16px, 2.4vw, 21px); }
.privacy-notice {
  display: inline-flex; align-items: center; gap: 12px; padding: 13px 18px;
  background: var(--accent-soft); border: 1px solid #cfe7df; border-radius: 12px;
  color: var(--accent-dark); text-align: left;
}
.privacy-notice strong, .privacy-notice span { display: block; }
.privacy-notice span { font-size: 13px; }
.privacy-icon {
  display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 50%; background: var(--accent); color: white; font-weight: 800;
}

.warning-notice {
  display: block; margin: 16px auto 0; padding: 13px 18px; max-width: 720px;
  background: var(--warning-bg); border: 1px solid #ecd7ab; border-radius: 12px;
  color: var(--warning); text-align: left; font-size: 13px;
}
.warning-notice strong { display: block; margin-bottom: 4px; }

.tool { padding-bottom: 38px; }
.stepper {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 20px; padding: 0; list-style: none;
  color: var(--muted); font-size: 13px; font-weight: 700;
}
.stepper li { display: flex; align-items: center; justify-content: center; gap: 8px; position: relative; }
.stepper li:not(:last-child)::after { content: ""; position: absolute; left: 65%; right: -35%; height: 1px; background: var(--line); }
.stepper span { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); background: white; border-radius: 50%; }
.stepper .active { color: var(--accent); }
.stepper .active span { color: white; border-color: var(--accent); background: var(--accent); }

.panel {
  margin-bottom: 20px; padding: 28px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow);
}
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel h2, .cta h2, .seo-copy h2 { margin: 0; font-size: 22px; line-height: 1.4; }
.supported, .count-label { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

.dual-upload { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.upload-block { min-width: 0; }
.upload-title { margin: 0 0 10px; font-size: 15px; font-weight: 800; }

.drop-zone {
  min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; border: 2px dashed #aebbc4; border-radius: 14px; background: #fbfcfd;
  text-align: center; outline: none; transition: .15s ease;
}
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.file-mark { display: grid; place-items: center; width: 48px; height: 56px; margin-bottom: 10px; border: 2px solid var(--accent); border-radius: 7px; color: var(--accent); font-weight: 800; }
.drop-main { margin: 0; font-size: 16px; font-weight: 800; }
.drop-sub { margin: 5px 0 12px; color: var(--muted); font-size: 13px; }
.file-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 20px;
  border: 1px solid transparent; border-radius: 9px; text-decoration: none; font-weight: 800; cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .text-button:focus-visible { outline: 3px solid rgba(23,107,85,.25); outline-offset: 2px; }
.button-primary { color: white; background: var(--accent); }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { color: var(--accent-dark); background: white; border-color: #9fcbbd; }
.button-secondary:hover { background: var(--accent-soft); }
.button-wide { width: 100%; margin-top: 24px; }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.file-status, .sheet-row, .limit-notice {
  margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd;
}
.file-status, .sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.file-status strong, .file-status span { display: block; }
.file-status span { color: var(--muted); font-size: 13px; }
.text-button { border: 0; background: transparent; color: var(--accent); font-weight: 800; cursor: pointer; }
.sheet-row label { font-weight: 800; font-size: 13px; }
.sheet-row select { min-width: 160px; padding: 8px 30px 8px 10px; border: 1px solid #b9c3cb; border-radius: 8px; background: white; }
.limit-notice { color: var(--warning); background: var(--warning-bg); border-color: #ecd7ab; }
.limit-notice strong, .limit-notice span { display: block; }
.limit-notice span { font-size: 13px; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.option-group { min-width: 0; margin: 0 0 20px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.option-group.columns-full { grid-column: 1 / -1; }
.option-group legend { padding: 0 6px; font-weight: 800; }
.hint { margin: 0 0 10px; color: var(--muted); font-size: 13px; }

.map-label { display: block; margin: 12px 0 5px; font-weight: 700; font-size: 13px; }
.map-label:first-of-type { margin-top: 0; }
.map-select {
  width: 100%; padding: 9px 30px 9px 11px; border: 1px solid #b9c3cb; border-radius: 8px; background: white;
}

.tolerance-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tolerance-row select, .tolerance-row input {
  padding: 9px 12px; border: 1px solid #b9c3cb; border-radius: 8px; background: white;
}
.tolerance-row select { min-width: 140px; }
.tolerance-row input { width: 120px; }

.summary-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: stretch; }
.summary-card { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfd; }
.summary-card span, .summary-card strong { display: block; }
.summary-card span { color: var(--muted); font-size: 12px; }
.summary-card strong { margin-top: 3px; font-size: 20px; }
.summary-card.primary { background: var(--accent-soft); border-color: #cfe7df; }
.download-actions { display: flex; gap: 10px; margin-top: 22px; }
.download-note, .preview-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 14px; }
.filter-tab {
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: white;
  color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer;
}
.filter-tab.is-active { color: white; background: var(--accent); border-color: var(--accent); }

.table-wrap { overflow: auto; max-height: 560px; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
th, td { max-width: 320px; padding: 10px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid #edf0f2; overflow: hidden; text-overflow: ellipsis; text-align: left; }
th { position: sticky; top: 0; z-index: 1; background: #eef2f4; font-weight: 800; }
tr:last-child td { border-bottom: 0; }
td.status-match { color: var(--accent-dark); font-weight: 800; }
td.status-review { color: var(--warning); font-weight: 800; }
td.status-multiple { color: #8a5a12; font-weight: 800; }
td.status-none { color: var(--danger); font-weight: 800; }

.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 26px;
  margin-top: 10px; margin-bottom: 30px; padding: 28px; border: 1px solid #cfd7dd; border-radius: 16px; background: white;
}
.cta p { margin: 8px 0 0; color: var(--muted); }
.cta .button { flex: 0 0 auto; }
.seo-copy { padding: 28px 0 64px; }
.seo-copy h2 { margin-bottom: 12px; }
.seo-copy p { max-width: 880px; color: #52606c; }
footer { border-top: 1px solid var(--line); background: white; color: var(--muted); font-size: 12px; }
footer .shell { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

[hidden] { display: none !important; }

@media (max-width: 850px) {
  .dual-upload { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .cta { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 600px) {
  .shell { width: min(100% - 24px, 1120px); }
  .hero { padding-top: 46px; }
  .privacy-notice, .warning-notice { width: 100%; }
  .stepper li { flex-direction: column; gap: 4px; text-align: center; font-size: 11px; }
  .stepper li:not(:last-child)::after { top: 14px; }
  .panel { padding: 20px; border-radius: 13px; }
  .panel-heading, .file-status, .sheet-row { align-items: flex-start; flex-direction: column; }
  .sheet-row select { width: 100%; min-width: 0; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .download-actions { flex-direction: column; }
  .tolerance-row { flex-direction: column; align-items: stretch; }
  footer .shell { align-items: flex-start; justify-content: center; flex-direction: column; gap: 2px; }
}
