:root {
  color-scheme: light;
  --paper: #f5f1e8;
  --paper-deep: #ebe4d7;
  --ink: #17211d;
  --ink-soft: #53605a;
  --line: #d7d0c4;
  --white: #fffdf8;
  --blue: #155bd5;
  --blue-dark: #0e43a0;
  --green: #13765b;
  --green-pale: #dcefe8;
  --red: #b63b2d;
  --red-pale: #f8e0dc;
  --amber: #b26a00;
  --amber-pale: #f6ead1;
  --violet: #6550a4;
  --violet-pale: #ebe6f7;
  --shadow: 0 24px 70px rgb(42 45 40 / 10%);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 5%, rgb(255 255 255 / 78%) 0 9%, transparent 30%),
    var(--paper);
  color: var(--ink);
  line-height: 1.65;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  background: var(--ink);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
}

.skip-link:focus { transform: translateY(0); }
.shell { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }

.site-header {
  width: min(1240px, calc(100% - 40px));
  min-height: 76px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 760;
  letter-spacing: -.02em;
}

.brand small {
  display: block;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  font: 800 12px/1 ui-monospace, monospace;
}

.beta-badge, .local-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--ink-soft);
  background: rgb(255 253 248 / 55%);
  font-size: 12px;
  font-weight: 700;
}

.hero {
  display: grid;
  justify-items: center;
  padding: 84px 0 46px;
  text-align: center;
}

.eyebrow, .step-label, .section-kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 12px 0 22px;
  font-family: Georgia, "Noto Serif JP", serif;
  font-size: clamp(46px, 7vw, 82px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.055em;
}

.hero h1 em { color: var(--blue); font-style: normal; }
.hero-copy { max-width: 690px; margin: 0; color: var(--ink-soft); font-size: 17px; }

.trust-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
  margin: 26px 0 0;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
}

.trust-list span { color: var(--green); }

.tool-shell {
  margin-bottom: 90px;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.tool-heading, .panel-head, .result-lead, .section-heading, .card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.step-label { margin: 0 0 4px; }
h2, h3, p { overflow-wrap: anywhere; }
.tool-heading h2, .panel-head h2, .section-heading h2, .result-lead h2 { margin: 0; line-height: 1.25; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px var(--green-pale); }

.drop-zone {
  margin-top: 26px;
  padding: 54px 24px 38px;
  border: 1.5px dashed #a9ada8;
  border-radius: var(--radius);
  text-align: center;
  background: #fbfaf6;
  transition: border-color .2s, background .2s, transform .2s;
}

.drop-zone.is-dragging { border-color: var(--blue); background: #f1f6ff; transform: scale(1.005); }
.file-icon { width: 56px; height: 66px; display: grid; place-items: center; margin: auto; border: 2px solid var(--ink); border-radius: 8px; font: 800 12px/1 ui-monospace, monospace; box-shadow: 6px 6px 0 var(--paper-deep); }
.drop-title { margin: 22px 0 0; font-size: 20px; font-weight: 800; }
.drop-subtitle { margin: 2px 0 14px; color: var(--ink-soft); font-size: 13px; }
.file-note { margin: 14px 0 4px; color: var(--ink-soft); font-size: 12px; }

.button {
  min-height: 48px;
  border: 0;
  border-radius: 11px;
  padding: 12px 20px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}

.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .62; transform: none; }
.button:focus-visible, .text-button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgb(21 91 213 / 28%); outline-offset: 3px; }
.button-primary { color: white; background: var(--blue); box-shadow: 0 8px 24px rgb(21 91 213 / 22%); }
.button-primary:hover { background: var(--blue-dark); }
.button-dark { color: white; background: var(--ink); white-space: nowrap; }
.button-wide { width: 100%; margin-top: 24px; }
.text-button { border: 0; padding: 8px 2px; color: var(--blue); background: transparent; font-weight: 750; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

.banner { margin-top: 18px; padding: 13px 16px; border-radius: 10px; font-size: 14px; }
.banner-error { border: 1px solid #ebaaa1; color: #7b241c; background: var(--red-pale); }
.banner-success { border: 1px solid #a4d0bf; color: #0b5a42; background: var(--green-pale); }
.banner-warning { border: 1px solid #dfbf7b; color: #744600; background: var(--amber-pale); }

.mapping-panel { margin-top: 32px; padding-top: 30px; border-top: 1px solid var(--line); }
.file-summary { margin: 18px 0; padding: 12px 15px; border-left: 3px solid var(--green); background: var(--green-pale); color: #185440; font-size: 14px; font-weight: 700; }
.mode-fieldset { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 22px 0; padding: 0; border: 0; }
.mode-fieldset legend { width: 100%; margin-bottom: 7px; font-weight: 800; }
.mode-fieldset label, .check-row { display: flex; gap: 9px; align-items: flex-start; }
.mode-fieldset input, .check-row input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--blue); }
.mapping-help { color: var(--ink-soft); font-size: 13px; }
.mapping-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; max-height: 470px; padding: 2px; overflow: auto; }
.mapping-row { display: grid; grid-template-columns: minmax(120px, 1fr) 20px minmax(150px, 1fr); align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fbfaf6; }
.mapping-target { font-size: 13px; font-weight: 750; }
.mapping-target small { color: var(--red); font-size: 10px; }
.mapping-arrow { color: var(--ink-soft); text-align: center; }
select { min-height: 38px; width: 100%; border: 1px solid #bcc2bd; border-radius: 7px; padding: 6px 30px 6px 9px; color: var(--ink); background: white; }

.results { padding-bottom: 96px; }
.result-lead h2 { font-family: Georgia, "Noto Serif JP", serif; font-size: clamp(28px, 5vw, 48px); font-weight: 500; letter-spacing: -.035em; }
.result-lead h2 strong { color: var(--blue); font-size: 1.3em; }
.readiness { border-radius: 999px; padding: 8px 13px; color: #7d2e25; background: var(--red-pale); font-size: 13px; font-weight: 800; }
.readiness-pass { color: #0c5a42; background: var(--green-pale); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 28px 0 12px; }
.metric { min-height: 118px; padding: 18px; border: 1px solid var(--line); border-top: 4px solid currentColor; border-radius: 13px; background: var(--white); }
.metric span { display: block; font-size: 11px; font-weight: 850; letter-spacing: .06em; }
.metric strong { display: block; margin-top: 9px; color: var(--ink); font-family: Georgia, serif; font-size: 38px; line-height: 1; }
.metric-error { color: var(--red); }.metric-warning { color: var(--amber); }.metric-manual { color: var(--violet); }.metric-muted { color: #79817d; }
.outcome-strip { display: flex; gap: 18px 32px; flex-wrap: wrap; margin-bottom: 20px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.outcome-strip p { margin: 0; }.dot { width: 8px; height: 8px; display: inline-block; margin-right: 8px; border-radius: 50%; }.dot-green { background: var(--green); }.dot-orange { background: var(--amber); }
.result-grid { display: grid; grid-template-columns: minmax(210px, .65fr) minmax(0, 2fr); gap: 16px; }
.card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.card h3 { margin: 0 0 16px; }.card-heading h3 { margin: 0; }.card-heading span { color: var(--ink-soft); font-size: 12px; }
.category-list { display: grid; gap: 2px; }.category-list div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }.category-list div:last-child { border: 0; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 10px; color: var(--ink-soft); background: #f1eee7; text-align: left; white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td strong { display: block; margin-bottom: 4px; } td code { display: inline-block; max-width: 330px; padding: 2px 5px; color: #6e2e27; background: #f7ebe8; white-space: normal; overflow-wrap: anywhere; }
.severity { display: inline-block; border-radius: 999px; padding: 3px 7px; font-size: 9px; font-weight: 900; letter-spacing: .03em; white-space: nowrap; }
.severity-confirmed-error { color: #81281e; background: var(--red-pale); }.severity-warning { color: #744600; background: var(--amber-pale); }.severity-manual-check { color: #4e3a85; background: var(--violet-pale); }.severity-not-evaluated { color: #4d5752; background: #e4e8e5; }
.empty-cell { color: var(--ink-soft); text-align: center; }

.commercial-panel { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 20px; padding: 28px; border-radius: var(--radius); color: white; background: var(--blue); box-shadow: 0 18px 45px rgb(21 91 213 / 22%); }
.commercial-panel .step-label { color: #cddfff; }.commercial-panel h3 { margin: 2px 0 4px; font-size: 23px; }.commercial-panel p { margin: 5px 0; color: #e8f0ff; }.commercial-panel .price-note { font-size: 12px; color: #cddfff; }
.full-results { margin-top: 24px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.filter-label { color: var(--ink-soft); font-size: 12px; }.filter-label select { display: block; margin-top: 4px; }
.full-table-wrap { max-height: 620px; margin-top: 20px; }.full-table-wrap th { position: sticky; z-index: 1; top: 0; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.pagination span { min-width: 170px; color: var(--ink-soft); font-size: 13px; text-align: center; }
.button-small { min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); background: var(--white); }
.download-panel { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 25px; padding: 24px; border-radius: 14px; background: var(--paper); }.download-panel h3 { margin: 0 0 10px; }.check-row { margin: 8px 0; font-size: 13px; }.check-warning { max-width: 720px; padding: 10px; border-radius: 8px; color: #744600; background: var(--amber-pale); }
.recheck-summary { margin: 13px 0; }.recheck-summary p { margin: 2px 0; font-size: 13px; }.recheck-summary p:first-child { font-weight: 800; }.recheck-pass { color: var(--green); }.recheck-attention { color: var(--red); }
.safe-fix-diff { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.safe-fix-diff summary { color: var(--blue); font-size: 13px; font-weight: 800; cursor: pointer; }
.safe-fix-table-wrap { max-height: 360px; margin-top: 12px; }
.safe-fix-table-wrap th { position: sticky; z-index: 1; top: 0; }
.safe-fix-table-wrap code { white-space: pre-wrap; }

.explain { padding: 80px 0; border-top: 1px solid var(--line); }
.section-kicker { margin-bottom: 25px; }.explain-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(40px, 8vw, 100px); }.explain h2 { margin: 0; font-family: Georgia, "Noto Serif JP", serif; font-size: clamp(31px, 4.5vw, 52px); font-weight: 500; line-height: 1.35; letter-spacing: -.04em; }
.principles { display: grid; }.principles article { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }.principles article > span { color: var(--blue); font: 800 12px/1.6 ui-monospace, monospace; }.principles h3, .principles p { margin: 0; }.principles p { color: var(--ink-soft); font-size: 14px; }
.rule-section, .next-actions { padding: 64px clamp(20px, 4vw, 46px); border: 1px solid var(--line); border-radius: 22px; background: var(--white); }.rule-section > p { max-width: 780px; color: var(--ink-soft); }.rules-table-wrap { max-height: 600px; margin-top: 22px; }.rules-table-wrap p { margin: 5px 0 0; color: var(--ink-soft); }.rules-table-wrap a { color: var(--blue); }
.next-actions { margin-top: 22px; margin-bottom: 70px; }.next-actions h2 { margin-top: 0; }.next-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }.next-links > * { min-height: 115px; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; background: #fbfaf6; }.next-links a:hover { border-color: var(--blue); }.next-links span { color: var(--ink-soft); font-size: 12px; }
.site-footer { display: grid; grid-template-columns: .7fr 1fr 1.4fr; gap: 30px; padding: 35px 0 55px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-soft); }.site-footer p { margin: 3px 0; }.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px; }.site-footer a:hover { color: var(--blue); }.footer-note { max-width: 480px; }
.legal { max-width: 800px; padding-top: 70px; padding-bottom: 100px; }.legal h1 { margin: 5px 0 4px; font-family: Georgia, "Noto Serif JP", serif; font-size: clamp(38px, 6vw, 62px); font-weight: 500; letter-spacing: -.04em; }.legal h2 { margin: 40px 0 8px; font-size: 20px; }.legal p { color: var(--ink-soft); }.legal-date { font-size: 13px; }.legal a { color: var(--blue); font-weight: 700; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 840px) {
  .mapping-grid, .metrics, .next-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-grid, .explain-grid { grid-template-columns: 1fr; }
  .commercial-panel, .download-panel { align-items: stretch; flex-direction: column; }
  .site-footer { grid-template-columns: 1fr 1fr; }.footer-note { grid-column: 1 / -1; }
}

@media (max-width: 580px) {
  .shell, .site-header { width: min(100% - 24px, 1160px); }
  .site-header { min-height: 64px; }.brand small { display: none; }.beta-badge { font-size: 10px; }
  .hero { padding-top: 58px; }.hero h1 { font-size: 44px; }.hero-copy { font-size: 15px; }
  .tool-shell { padding: 18px; border-radius: 18px; }.tool-heading, .panel-head, .result-lead, .section-heading { align-items: flex-start; flex-direction: column; }
  .local-status { align-self: flex-start; }.drop-zone { padding: 38px 14px 28px; }.file-note { padding-inline: 10px; }
  .mapping-grid, .metrics, .next-links { grid-template-columns: 1fr; }.mapping-row { grid-template-columns: 1fr 18px 1fr; }.mapping-target { font-size: 12px; }
  .metric { min-height: 94px; }.metric strong { font-size: 30px; }.result-lead { gap: 10px; }.readiness { align-self: flex-start; }
  .full-results { padding: 18px; }.commercial-panel { padding: 22px; }.button-dark { white-space: normal; }
  .explain { padding-block: 58px; }.rule-section, .next-actions { padding: 28px 18px; }
  .site-footer { grid-template-columns: 1fr; }.footer-note { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
