:root {
  --ink: #18202f;
  --muted: #697386;
  --line: #dfe5ee;
  --paper: #ffffff;
  --soft: #f7f8fb;
  --green: #12846f;
  --green-dark: #0a5d50;
  --amber: #d98a11;
  --red: #d64b55;
  --navy: #142237;
  --shadow: 0 26px 80px -52px rgba(20, 34, 55, .52);
  --shadow-soft: 0 16px 42px -34px rgba(20, 34, 55, .36);
  --maxw: 1180px;
  --font: "Inter", "Noto Sans JP", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
}
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.75;
  background:
    linear-gradient(180deg, #fffaf1 0, #fbfcff 480px, #fff 1000px),
    #fff;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
p, h1, h2, h3 { margin-top: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - var(--maxw)) / 2));
  border-bottom: 1px solid rgba(223, 229, 238, .84);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(16px);
}
.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: -.03em;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}
.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.94) 0 5px, transparent 5px 10px) 10px 12px / 18px 14px no-repeat,
    linear-gradient(135deg, var(--green), #56b48a);
  box-shadow: 0 16px 34px -24px var(--green);
}
.nav {
  display: flex;
  gap: 26px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}
.nav a:hover { color: var(--green); }

.hero {
  max-width: var(--maxw);
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding: 56px 24px 72px;
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(520px, 1.12fr);
  gap: 34px;
  align-items: center;
}
.eyebrow, .kicker {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
h1 {
  margin-bottom: 22px;
  font-size: clamp(42px, 5.1vw, 70px);
  line-height: 1.07;
  letter-spacing: -.07em;
}
h2 {
  margin-bottom: 14px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.16;
  letter-spacing: -.05em;
}
h3 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.38;
  letter-spacing: -.03em;
}
.lead {
  max-width: 570px;
  color: var(--muted);
  font-size: 17px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.button,
.panel-actions button,
.preview-panel button {
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}
.button.primary {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}
.button.ghost {
  background: rgba(255,255,255,.75);
}
.button.wide {
  width: 100%;
  margin-top: 2px;
}
.metrics {
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}
.metrics div {
  min-height: 88px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.84);
}
.metrics strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.04em;
}
.metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.hero-visual {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(223, 229, 238, .86);
  border-radius: 34px;
  background: #fff;
  box-shadow: var(--shadow);
}
.hero-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.section,
.tool-shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 84px 24px;
}
.section-head {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
}
.section-head.left {
  margin-left: 0;
  text-align: left;
}
.section-head p {
  color: var(--muted);
}
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(300px, .58fr);
  gap: 18px;
  align-items: stretch;
}
.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr);
  gap: 18px;
  margin-top: 18px;
}
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-soft);
}
.panel-head {
  min-height: 70px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.panel-head.simple {
  justify-content: flex-start;
}
.panel-head h3 {
  margin-bottom: 0;
}
.step {
  display: inline-flex;
  margin-bottom: 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.file-label {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--navy);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
#csvFile {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.panel-actions button,
.preview-panel button {
  min-height: 40px;
  padding: 0 14px;
  font-size: 13px;
  box-shadow: none;
}
textarea#csvInput {
  width: 100%;
  min-height: 360px;
  display: block;
  padding: 18px 20px;
  resize: vertical;
  border: 0;
  outline: 0;
  color: #dbe8f8;
  background: #111b2d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
}
.hint-row {
  min-height: 46px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.settings-panel {
  padding-bottom: 20px;
}
.settings-panel label {
  display: grid;
  gap: 7px;
  margin: 16px 20px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}
select {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}
.checkbox-line {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--muted) !important;
  font-weight: 800 !important;
}
.checkbox-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}
.settings-panel .button {
  margin: 18px 20px 0;
  width: calc(100% - 40px);
}
.insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .9fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.insight-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-soft);
}
.insight-card > span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.insight-card h3 {
  margin-top: 3px;
  margin-bottom: 14px;
  font-size: 18px;
}
.mapping-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.mapping-list div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}
.mapping-list div.missing {
  background: #fff9ed;
  border-color: rgba(217, 138, 17, .34);
}
.mapping-list span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}
.mapping-list strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mini-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}
.mini-list strong {
  color: var(--green);
  white-space: nowrap;
}
#workMemo {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.table-wrap {
  overflow: auto;
  max-height: 460px;
}
table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
}
td {
  color: #344054;
}
.issue-panel {
  padding-bottom: 20px;
}
.score-card {
  margin: 18px 20px;
  padding: 18px;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 12%, rgba(255,255,255,.18), transparent 28%),
    var(--green);
}
.score-card.warn {
  background: var(--amber);
}
.score-card.bad {
  background: var(--red);
}
.score-card strong {
  display: block;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -.05em;
}
.score-card span {
  font-size: 13px;
  font-weight: 900;
}
.issue-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 20px 18px;
}
.issue-summary div {
  min-width: 0;
  padding: 11px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.issue-summary strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}
.issue-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}
.issue-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0 20px;
  list-style: none;
}
.issue-list li {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.issue-list li strong {
  display: block;
  color: var(--ink);
}
.issue-list li.error {
  border-color: rgba(214, 75, 85, .35);
  background: #fff7f7;
}
.issue-list li.warn {
  border-color: rgba(217, 138, 17, .38);
  background: #fff9ed;
}
.issue-list li.ok {
  border-color: rgba(18, 132, 111, .26);
  background: #f2fbf8;
}

.rule-grid,
.deliverable-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.rule-grid article,
.deliverable-grid article {
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.rule-grid span {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  margin-bottom: 44px;
  border-radius: 12px;
  color: #fff;
  background: var(--green);
  font-size: 13px;
  font-weight: 900;
}
.rule-grid p,
.deliverable-grid p,
.case-copy p {
  color: var(--muted);
  font-size: 14px;
}
.case-section {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
  gap: 26px;
  align-items: center;
}
.flow-list {
  display: grid;
  gap: 12px;
}
.flow-list div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.flow-list span {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.flow-list strong {
  display: block;
  margin-top: 5px;
  line-height: 1.55;
}
.deliverable-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.deliverable-grid article {
  min-height: 176px;
}
.footer {
  padding: 34px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  background: #fff;
}
.footer p {
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .hero,
  .tool-grid,
  .result-grid,
  .case-section,
  .insight-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    min-height: auto;
    padding-top: 44px;
  }
  .rule-grid,
  .deliverable-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-visual {
    border-radius: 28px;
  }
}

@media (max-width: 640px) {
  .topbar {
    height: auto;
    min-height: 72px;
    padding: 14px 20px;
  }
  .brand {
    font-size: 15px;
  }
  .nav {
    display: none;
  }
  .hero,
  .section,
  .tool-shell {
    padding-left: 20px;
    padding-right: 20px;
  }
  .hero {
    padding-top: 34px;
    gap: 28px;
  }
  h1 {
    font-size: 38px;
    letter-spacing: -.06em;
  }
  h2 {
    font-size: 31px;
  }
  .lead {
    font-size: 16px;
  }
  .hero-actions {
    align-items: stretch;
  }
  .hero-actions .button {
    flex: 1 1 150px;
    justify-content: center;
    text-align: center;
  }
  .metrics {
    gap: 8px;
  }
  .metrics div {
    min-height: 82px;
    padding: 11px 8px;
  }
  .metrics strong {
    font-size: 24px;
  }
  .metrics span {
    font-size: 11px;
  }
  .hero-visual {
    border-radius: 22px;
  }
  .hero-visual img {
    min-height: 238px;
  }
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .panel-actions {
    justify-content: flex-start;
  }
  textarea#csvInput {
    min-height: 330px;
    font-size: 12px;
  }
  .hint-row {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .mapping-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rule-grid,
  .deliverable-grid {
    grid-template-columns: 1fr;
  }
  .rule-grid article,
  .deliverable-grid article {
    min-height: auto;
  }
  .rule-grid span {
    margin-bottom: 24px;
  }
}
