:root {
  --ink: #12262a;
  --ink-soft: #516265;
  --forest: #103337;
  --forest-2: #17484a;
  --sage: #dce8df;
  --sage-soft: #f2f6f2;
  --line: #d8e0da;
  --paper: #fffdfa;
  --accent: #d67a42;
  --accent-soft: #f8e8dc;
  --good: #197253;
  --warn: #b26631;
  --risk: #a54733;
  --shadow: 0 16px 46px rgba(18, 38, 42, 0.07);
  --radius: 20px;
  --font: var(--world-font-sans);
  --font-paper: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--world-page-background, #f4f3ee);
  font-family: var(--font);
  line-height: 1.65;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  padding: 0 clamp(20px, 5vw, 64px);
  display: flex;
  align-items: center;
  gap: 38px;
  background: rgba(250, 251, 248, 0.92);
  border-bottom: 1px solid rgba(216, 224, 218, 0.7);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.brand-parent { font-size: 12px; font-weight: 800; letter-spacing: 0.22em; color: var(--forest); }
.brand-product { font-family: var(--world-font-sans); font-size: 26px; letter-spacing: -0.03em; color: var(--forest); }
.header-nav { display: flex; gap: 28px; margin-left: auto; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.header-nav a:hover { color: var(--forest); }
.header-cta {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 20px;
  color: #fff;
  background: var(--forest);
  border-radius: 24px;
  font-size: 14px;
  font-weight: 700;
}

main { padding: 0 clamp(20px, 5vw, 64px); }
.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(54px, 8vw, 90px) 0 clamp(44px, 6vw, 64px);
}
.eyebrow {
  margin-bottom: 16px;
  color: var(--good);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .22em;
}
.hero h1 {
  color: var(--forest);
  font-family: var(--world-font-sans);
  font-size: clamp(52px, 5.4vw, 72px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.055em;
}
.hero-paper-line {
  display: inline-block;
  font-family: var(--font-paper);
  font-weight: 600;
  letter-spacing: -.035em;
}
.hero-lead {
  max-width: 530px;
  margin-top: 25px;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 2;
}
.hero-points { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.hero-points span {
  padding: 8px 14px;
  color: var(--forest-2);
  background: var(--sage-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.upload-card {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.drop-zone {
  min-height: 350px;
  padding: 46px 34px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  text-align: center;
  color: var(--ink-soft);
  background: var(--sage-soft);
  border: 1.5px dashed #aec4b4;
  border-radius: 17px;
  outline: none;
  transition: border-color .18s, background .18s, transform .18s;
}
.drop-zone.dragging, .drop-zone:focus-visible {
  border-color: var(--good);
  background: #ebf4ed;
}
.drop-zone.dragging { transform: scale(1.006); }
.drop-icon {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  color: var(--forest);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 3px 16px rgba(18,38,42,.08);
}
.drop-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone strong { margin-top: 5px; color: var(--ink); font-size: 18px; }
.drop-zone span { max-width: 300px; font-size: 13px; }
.file-select {
  margin-top: 12px;
  padding: 11px 30px;
  color: #fff;
  background: var(--forest);
  border-radius: 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.upload-actions { min-height: 58px; padding: 13px 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.upload-actions p { color: #849294; font-size: 12px; }
.subtle-button {
  color: var(--forest); background: transparent; border: 0; font-size: 13px; font-weight: 700; padding: 8px 10px;
}
.subtle-button:hover { text-decoration: underline; }

.capabilities {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.capabilities article { min-height: 150px; padding: 34px clamp(20px, 3vw, 38px); }
.capabilities article + article { border-left: 1px solid var(--line); }
.capability-index { color: var(--good); font-size: 12px; font-weight: 800; letter-spacing: .18em; }
.capabilities h2 { margin: 9px 0 7px; font-size: 21px; line-height: 1.35; }
.capabilities p { color: var(--ink-soft); font-size: 14px; }

.workspace {
  max-width: 1460px;
  margin: 0 auto;
  padding: 76px 0 48px;
}
.section-heading { margin-bottom: 30px; display: flex; justify-content: space-between; align-items: end; gap: 36px; }
.section-heading h2 { color: var(--forest); font-size: clamp(29px, 3vw, 39px); font-family: var(--world-font-sans); font-weight: 500; letter-spacing: -.04em; }
.section-description { max-width: 420px; color: var(--ink-soft); font-size: 14px; }
.empty-workspace {
  min-height: 248px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 22px;
  color: var(--ink-soft); background: #fff; border: 1px dashed #cbd5cf; border-radius: var(--radius);
}
.empty-workspace strong { color: var(--ink); font-size: 17px; font-weight: 600; }
.primary-button, .secondary-button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  transition: background .15s, border-color .15s, color .15s;
}
.primary-button { color: #fff; background: var(--forest); border: 1px solid var(--forest); }
.primary-button:hover { background: var(--forest-2); }
.secondary-button { color: var(--forest); background: #fff; border: 1px solid var(--line); }
.secondary-button:hover { border-color: #9cb6a5; background: var(--sage-soft); }
.analysis-panel section, .comparison-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
}
.asset-card, .score-card, .metric-card, .issues-card { padding: 19px 18px; }
.card-label { margin-bottom: 10px; color: #7e8d8d; font-size: 11px; letter-spacing: .18em; font-weight: 800; }
.asset-card h3 { margin-bottom: 14px; font-size: 15px; word-break: break-all; }
.sheet-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.sheet-tab {
  max-width: 100%; padding: 5px 9px; color: var(--ink-soft); background: var(--sage-soft); border: 1px solid transparent;
  border-radius: 6px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sheet-tab.active { color: var(--forest); background: #e4eee5; border-color: #bdd1c2; font-weight: 700; }
.score-header { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.badge { padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; background: var(--sage); color: var(--good); }
.badge.warn { color: var(--warn); background: #fcf1e8; }
.badge.risk { color: var(--risk); background: #f7e8e4; }
.score-display { display: flex; gap: 4px; align-items: baseline; color: var(--forest); }
.score-display strong { font-size: 54px; font-weight: 600; line-height: 1.05; letter-spacing: -.06em; }
.score-display span { color: var(--ink-soft); font-size: 16px; }
.score-track { height: 7px; margin: 13px 0 14px; background: #eef2ee; border-radius: 5px; overflow: hidden; }
.score-track div { width: 0; height: 100%; border-radius: inherit; background: var(--good); transition: width .35s; }
.score-track div.warn { background: var(--warn); }
.score-track div.risk { background: var(--risk); }
.score-message { color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.metrics { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 8px; }
.metrics div { display: flex; flex-direction: column; gap: 2px; }
.metrics dt { color: #768588; font-size: 11px; }
.metrics dd { margin: 0; color: var(--ink); font-size: 17px; font-weight: 700; }
.issue-list { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; list-style: none; }
.issue-list li { display: flex; gap: 8px; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.issue-list li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: var(--accent); }

.comparison-panel { overflow: hidden; }
.comparison-header {
  min-height: 67px; padding: 12px 16px; display: flex; justify-content: flex-start; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--line);
}
.mode-tabs { display: flex; align-items: center; gap: 5px; padding: 4px; background: var(--sage-soft); border-radius: 10px; }
.mode-tab { min-height: 38px; padding: 0 15px; color: var(--ink-soft); background: transparent; border: 0; border-radius: 7px; font-size: 13px; font-weight: 700; }
.mode-tab.active { color: var(--forest); background: #fff; box-shadow: 0 1px 3px rgba(16,51,55,.12); }
.export-actions { display: flex; gap: 8px; }
.settings-bar {
  padding: 13px 17px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  color: var(--ink-soft); background: #fcfcfa; border-bottom: 1px solid var(--line); font-size: 12px;
}
.settings-bar label { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.settings-bar select {
  min-height: 34px; padding: 0 26px 0 10px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 7px;
}
.comparison-grid { min-height: 676px; display: grid; grid-template-columns: 0.9fr 1.1fr; }
.preview-pane { padding: 17px; min-width: 0; }
.source-pane { border-right: 1px solid var(--line); background: #fafbf8; }
.pane-heading { min-height: 40px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pane-heading h3 { font-size: 15px; }
.pane-heading span { color: #7a8989; font-size: 11px; }
.sheet-preview {
  overflow: auto; max-height: 590px; min-height: 590px; padding: 14px;
  background: #f5f7f4; border: 1px solid var(--line); border-radius: 10px;
}
.grid-canvas { display: grid; min-width: max-content; border-left: 1px solid #d3dcd5; border-top: 1px solid #d3dcd5; background: #fff; }
.grid-cell {
  min-height: 30px; padding: 4px 6px; overflow: hidden;
  color: #36484a; background: #fff; border-right: 1px solid #d3dcd5; border-bottom: 1px solid #d3dcd5;
  font-size: 11px; white-space: nowrap; text-overflow: ellipsis;
}
.grid-cell.filled { background: #fff; }
.grid-cell.label { font-weight: 700; background: #eef4ef; }
.grid-cell.heading { color: var(--forest); font-size: 13px; font-weight: 700; background: #deebe2; }
.grid-cell.checkbox { background: #fff8f2; }
.grid-cell.merge { border-color: #aebfb3; }
.result-preview {
  min-height: 590px; overflow: auto; display: flex; justify-content: center; align-items: start;
  padding: 14px; background: #f4f5f2; border: 1px solid var(--line); border-radius: 10px;
}
.form-paper {
  --paper-width: 474px;
  width: var(--paper-width); min-height: 650px; padding: 31px 32px 28px;
  color: #16282a; background: var(--paper); border: 1px solid #e2e1da; box-shadow: 0 9px 23px rgba(26,33,30,.09);
}
.form-paper.landscape { --paper-width: 585px; min-height: 432px; }
.form-paper.a3 { --paper-width: 555px; min-height: 750px; }
.form-paper.a3.landscape { --paper-width: 675px; min-height: 485px; }
.paper-brand { color: #475c59; font-size: 9px; font-weight: 800; letter-spacing: .24em; }
.paper-header { padding-bottom: 18px; margin-bottom: 18px; display: flex; justify-content: space-between; gap: 18px; border-bottom: 2px solid var(--forest); }
.paper-title { margin-top: 6px; font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.paper-meta { color: #627170; font-size: 9px; text-align: right; white-space: nowrap; }
.form-section-title { margin: 18px 0 10px; color: var(--forest); font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.form-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px 12px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.wide { grid-column: 1 / -1; }
.form-field span { color: #435553; font-size: 10px; font-weight: 700; }
.form-field .line { min-height: 29px; background: #fff; border: 1px solid #abb9b1; border-radius: 2px; }
.form-field.textarea .line { min-height: 54px; }
.option-row { display: flex; gap: 14px; align-items: center; min-height: 29px; padding: 0 7px; border: 1px solid #abb9b1; font-size: 10px; }
.option-row i { display: inline-block; width: 9px; height: 9px; margin-right: 4px; border: 1px solid #7e8b86; vertical-align: middle; }
.paper-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 10px; }
.paper-table th, .paper-table td { height: 25px; padding: 4px 6px; border: 1px solid #aeb9b1; }
.paper-table th { color: #344743; background: #eaf0eb; font-weight: 700; text-align: left; }
.paper-note { min-height: 47px; margin-top: 17px; padding: 8px 9px; border: 1px solid #abb9b1; color: #53635f; font-size: 9.5px; }
.paper-footer { display: flex; justify-content: space-between; margin-top: 22px; padding-top: 10px; border-top: 1px solid #cbd4ce; color: #6a7975; font-size: 9px; }
.preset-compact .form-fields { gap: 8px; }
.preset-compact .form-field .line { min-height: 24px; }
.preset-field .form-field .line { min-height: 38px; }
.preset-field .form-field span { font-size: 11px; }
.svg-preview { width: 100%; display: flex; justify-content: center; }
.svg-preview svg { max-width: 100%; height: auto; box-shadow: 0 9px 23px rgba(26,33,30,.09); }
.web-form-preview { width: min(100%, 560px); padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.web-form-preview h4 { margin: 0 0 4px; font-size: 20px; }
.web-form-preview .web-note { margin-bottom: 18px; color: var(--ink-soft); font-size: 12px; }
.web-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.web-field { display: flex; flex-direction: column; gap: 5px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.web-field.wide { grid-column: 1 / -1; }
.web-field input, .web-field textarea, .web-field select {
  min-height: 40px; padding: 8px 10px; border: 1px solid #c8d4cd; border-radius: 7px; background: #fff; color: var(--ink);
}
.web-field textarea { min-height: 70px; resize: none; }
.web-form-actions { margin-top: 21px; display: flex; justify-content: end; gap: 8px; }
.schema-preview { width: 100%; max-width: 610px; margin: 0; padding: 21px; overflow: auto; color: #e9f1ec; background: #172a2c; border-radius: 10px; font: 12px/1.7 "SFMono-Regular", Consolas, monospace; }

.workflow { max-width: 1360px; margin: 0 auto; padding: 62px 0 90px; }
.section-heading.compact { margin-bottom: 33px; }
.workflow ol {
  margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.workflow li { min-height: 125px; padding: 26px 25px; display: flex; flex-direction: column; gap: 9px; position: relative; }
.workflow li + li { border-left: 1px solid var(--line); }
.workflow li::before { content: counter(list-item, decimal-leading-zero); color: var(--good); font-size: 11px; font-weight: 800; letter-spacing: .2em; }
.workflow strong { font-size: 18px; }
.workflow span { color: var(--ink-soft); font-size: 13px; }
.site-footer {
  min-height: 170px; padding: 42px clamp(20px, 5vw, 64px); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px;
  color: #d1ddda; background: var(--forest);
}
.footer-brand .brand-parent, .footer-brand .brand-product { color: #fff; }
.site-footer p { grid-column: 1; color: #c3d3cf; font-size: 13px; }
.site-footer small { grid-column: 2; grid-row: 1 / 3; align-self: end; color: #c3d3cf; }
.toast {
  position: fixed; right: 26px; bottom: 24px; z-index: 40; transform: translateY(18px); opacity: 0; pointer-events: none;
  padding: 12px 17px; color: #fff; background: var(--forest); border-radius: 10px; box-shadow: var(--shadow); font-size: 13px;
  transition: opacity .2s, transform .2s;
}
.toast.visible { transform: translateY(0); opacity: 1; }

@media (max-width: 1180px) {
  .comparison-grid { min-height: auto; }
}
@media (max-width: 980px) {
  .site-header { gap: 18px; }
  .header-nav { display: none; }
  .header-cta { margin-left: auto; }
  .upload-card { max-width: 580px; width: 100%; }
  .capabilities, .workflow ol { grid-template-columns: 1fr; }
  .capabilities article + article, .workflow li + li { border-left: 0; border-top: 1px solid var(--line); }
  .comparison-header { flex-direction: column; align-items: stretch; }
  .comparison-grid { grid-template-columns: 1fr; }
  .source-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .sheet-preview { min-height: 390px; max-height: 390px; }
}
@media (max-width: 600px) {
  .brand-product { font-size: 22px; }
  .header-cta { display: none; }
  main { padding: 0 14px; }
  .hero h1 { font-size: 42px; }
  .drop-zone { min-height: 310px; padding: 35px 18px; }
  .mode-tabs { overflow-x: auto; }
  .mode-tab { white-space: nowrap; }
  .export-actions { flex-wrap: wrap; }
  .form-paper { padding: 25px 20px; }
  .web-form-grid { grid-template-columns: 1fr; }
  .site-footer { display: block; }
  .site-footer p { margin: 10px 0 20px; }
}


/* WORLD flow layout: hero -> import -> analysis -> comparison */
.hero-intro .hero-copy { max-width: 710px; }
.intake-section {
  max-width: 1360px;
  margin: 0 auto;
  padding: 54px 0 72px;
  border-top: 1px solid var(--line);
}
.intake-heading { max-width: 1180px; }
.intake-grid {
  display: grid;
  grid-template-columns: minmax(290px, .82fr) minmax(380px, 540px);
  gap: clamp(28px, 6vw, 74px);
  align-items: center;
}
.intake-copy h3 {
  max-width: 420px;
  color: var(--forest);
  font-size: clamp(22px, 2.4vw, 29px);
  line-height: 1.55;
  letter-spacing: -.035em;
}
.intake-copy > p { max-width: 470px; margin-top: 18px; color: var(--ink-soft); font-size: 14px; }
.intake-facts { display: grid; gap: 0; margin: 34px 0 0; max-width: 480px; border-top: 1px solid var(--line); }
.intake-facts div { display: grid; grid-template-columns: 110px 1fr; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.intake-facts dt { color: #7e8d8d; font-weight: 700; }
.intake-facts dd { margin: 0; color: var(--ink); font-weight: 600; }
.intake-section .upload-card { width: 100%; }
.intake-section .drop-zone { min-height: 318px; }
.workspace { padding-top: 76px; border-top: 1px solid var(--line); }
.workspace-content { display: flex; flex-direction: column; gap: 32px; }
.analysis-results {
  padding: clamp(18px, 2vw, 26px);
  background: rgba(255,255,255,.65);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.analysis-results-header {
  display: flex; justify-content: space-between; align-items: end; gap: 28px;
  margin-bottom: 20px;
}
.analysis-results-header h3 { color: var(--forest); font-size: 21px; letter-spacing: -.03em; }
.analysis-results-header p { max-width: 560px; color: var(--ink-soft); font-size: 13px; }
.analysis-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.analysis-panel section { min-width: 0; height: 100%; }
.transform-section { display: flex; flex-direction: column; gap: 17px; }
.transform-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; }
.transform-heading h3 { color: var(--forest); font-size: clamp(23px, 2vw, 28px); letter-spacing: -.04em; }
.transform-heading p { max-width: 430px; color: var(--ink-soft); font-size: 13px; }
.comparison-panel { background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.comparison-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  padding: 17px 20px; border-top: 1px solid var(--line); background: #fbfcfa;
}
.comparison-footer p { color: var(--ink-soft); font-size: 12px; }
.supporting-capabilities { margin-top: 38px; }
@media (max-width: 1120px) {
  .intake-grid { grid-template-columns: 1fr; }
  .intake-copy { max-width: 640px; }
  .intake-section .upload-card { max-width: 650px; }
  .analysis-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .analysis-results-header, .transform-heading, .comparison-footer { flex-direction: column; align-items: stretch; }
  .intake-facts div { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 600px) {
  .analysis-panel { display: flex; flex-direction: column; }
  .intake-section { padding: 40px 0 50px; }
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  body { background: #fff; }
  body * { visibility: hidden !important; }
  #resultPreview, #resultPreview * { visibility: visible !important; }
  #resultPreview {
    position: absolute; left: 0; top: 0; width: 100%; min-height: auto; padding: 0; overflow: visible; border: 0; background: #fff;
  }
  .form-paper {
    width: 210mm !important; min-height: 297mm !important; padding: 14mm 15mm !important; margin: 0 !important;
    border: 0 !important; box-shadow: none !important;
  }
  .form-paper.landscape { width: 297mm !important; min-height: 210mm !important; }
  .form-paper.a3 { width: 297mm !important; min-height: 420mm !important; }
  .form-paper.a3.landscape { width: 420mm !important; min-height: 297mm !important; }
}
