: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-outputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 29px;
}
.hero-outputs div {
  min-height: 62px;
  padding: 10px 10px 9px;
  background: var(--sage-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.hero-outputs strong {
  display: block;
  margin-bottom: 3px;
  color: var(--forest);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  white-space: nowrap;
}
.hero-outputs span {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.4;
}
.hero-flow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 21px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}
.hero-flow span { display: inline-flex; align-items: baseline; gap: 5px; }
.hero-flow b {
  color: var(--good);
  font-size: 10px;
  letter-spacing: .12em;
}
.hero-flow i { color: #a9b8b1; font-style: normal; }
.hero-copy > .button { margin-top: 25px; font-size: 14px; }
.hero-split {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(390px, 492px);
  align-items: center;
  gap: clamp(34px, 6vw, 76px);
}
.hero-copy { min-width: 0; }
.redesign-preview {
  margin: 0;
  padding: 23px 23px 19px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.redesign-preview figcaption { display: flex; flex-direction: column; gap: 6px; }
.preview-kicker { color: var(--good); font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.redesign-preview figcaption strong { color: var(--forest); font-size: 17px; font-weight: 700; }
.redesign-visual { display: block; width: 100%; height: auto; margin: 20px 0 12px; }
.concept-sheet { fill: #faf7f0; stroke: #d6ddd6; stroke-width: 1.5; }
.concept-label { fill: #647775; font: 700 9px var(--font); letter-spacing: 1.2px; }
.concept-grid { fill: none; stroke: #d7ded7; stroke-width: 1.2; }
.concept-merge { fill: #eee4d7; stroke: #dfc6b0; stroke-width: 1; }
.concept-node { fill: var(--forest); }
.node-mark { fill: #fff; font: 700 12px var(--font); text-anchor: middle; letter-spacing: .08em; }
.concept-arrow, .concept-branch { fill: none; stroke: #75a08d; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.output-card { fill: #edf4ed; stroke: #c7d7ca; stroke-width: 1.25; }
.output-name { fill: var(--forest); font: 800 11px var(--font); letter-spacing: 1.7px; }
.output-line { stroke: #9db9a7; stroke-width: 1.4; }
.output-name-small { font-size: 9px; letter-spacing: 1px; }
.output-meta { fill: #71867c; font: 700 8px var(--font); letter-spacing: 1.25px; }
.preview-footnote { color: var(--ink-soft); font-size: 12px; line-height: 1.75; }

.source-upload-surface {
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.source-upload-surface.awaiting-upload {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f5f8f4;
  border: 1.5px dashed #aec4b4;
  cursor: pointer;
}
.source-upload-surface.dragging {
  border-color: var(--good);
  background: #ebf4ed;
  box-shadow: inset 0 0 0 1px rgba(25,114,83,.08);
}
.source-upload-surface.awaiting-upload:focus-visible {
  outline: 3px solid rgba(25,114,83,.18);
  outline-offset: 2px;
}
.source-empty-state {
  width: min(100%, 340px);
  padding: 42px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  text-align: center;
}
.source-document-icon {
  width: 60px; height: 60px;
  display: grid; place-items: center;
  color: var(--forest);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 3px 16px rgba(18,38,42,.08);
}
.source-document-icon svg { width: 31px; height: 31px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.source-empty-state strong { margin-top: 6px; color: var(--ink); font-size: 18px; }
.source-empty-state p { color: var(--ink-soft); font-size: 13px; line-height: 1.8; }
.file-picker { margin-top: 9px; padding-inline: 30px; font-size: 14px; }
.subtle-button {
  color: var(--forest); background: transparent; border: 0; font-size: 13px; font-weight: 700; padding: 8px 10px;
}
.subtle-button:hover { text-decoration: underline; }
.pane-heading > .button { flex: none; }
.result-empty-state {
  min-height: 540px;
  max-width: 300px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px;
  color: var(--ink-soft);
  text-align: center;
}
.result-empty-state strong { color: var(--forest); font-size: 18px; line-height: 1.65; }
.result-empty-state p { font-size: 13px; line-height: 1.8; }
.result-arrow {
  width: 45px; height: 45px;
  display: grid; place-items: center;
  color: var(--good);
  background: #e7f1e8;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 700;
}
button:disabled, select:disabled { cursor: not-allowed; opacity: .42; }


.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; }
.export-actions { display: flex; gap: 9px; align-items: center; }
.comparison-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
}
.source-asset-bar {
  padding: 9px 12px 10px;
  margin-bottom: 10px;
  background: #f5f7f4;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.source-asset-bar strong {
  display: block;
  margin-bottom: 7px;
  color: var(--forest);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.sheet-tab {
  max-width: 100%; padding: 5px 9px; color: var(--ink-soft); background: #fff; border: 1px solid transparent;
  border-radius: 999px; 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; }
.compact-insights {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-top: 10px;
  padding: 12px 13px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.compact-score p,
.compact-points > p {
  margin: 0 0 7px;
  color: #7e8d8d;
  font-size: 10px;
  letter-spacing: .14em;
  font-weight: 800;
}
.badge {
  display: inline-flex;
  min-width: 34px;
  justify-content: center;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  background: var(--sage);
  color: var(--good);
}
.badge.warn { color: var(--warn); background: #fcf1e8; }
.badge.risk { color: var(--risk); background: #f7e8e4; }
.issue-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  list-style: none;
}
.issue-list li {
  display: flex;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}
.issue-list li::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--good);
}
.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: 999px; }
.mode-tab { min-height: 38px; padding: 0 15px; color: var(--ink-soft); background: transparent; border: 0; border-radius: 999px; 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; }
.form-platform-preview {
  width: min(100%, 650px); padding: 25px; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 13px;
}
.form-preview-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 13px; }
.platform-kicker { margin: 0 0 5px; color: #168348; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.platform-kicker.microsoft { color: #1669ad; }
.form-preview-head h4 { margin: 0; color: var(--forest); font-size: 21px; line-height: 1.4; }
.integration-badge { flex: none; padding: 5px 10px; border-radius: 16px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.integration-badge.planned { color: #13704c; background: #e6f3e8; }
.integration-badge.researching { color: #365e7f; background: #ebf2f8; }
.platform-lead { margin: 0 0 21px; color: var(--ink-soft); font-size: 13px; line-height: 1.8; }
.form-plan-section { padding: 15px 0; border-top: 1px solid var(--line); }
.form-section-index { margin: 0 0 4px; color: #6b8379; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.form-plan-section h5 { margin: 0 0 11px; color: var(--forest); font-size: 15px; }
.form-question-list { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; list-style: none; }
.form-question { display: flex; justify-content: space-between; align-items: start; gap: 15px; padding: 9px 11px; background: #f7f9f6; border-radius: 7px; font-size: 12px; }
.question-name { color: var(--ink); font-weight: 700; line-height: 1.55; }
.question-name small { display: block; color: var(--ink-soft); font-size: 10px; font-weight: 500; }
.question-type { flex: none; color: var(--good); font-size: 11px; font-weight: 700; text-align: right; }
.integration-callout { margin-top: 20px; padding: 15px; background: #edf6ee; border: 1px solid #c6dccb; border-radius: 9px; }
.integration-callout.muted { background: #f3f6f8; border-color: #d6e0e9; }
.integration-callout strong { display: block; margin-bottom: 6px; color: var(--forest); font-size: 14px; }
.integration-callout p { margin: 0 0 13px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }


/* Direct transformation canvas editor */
.inline-editor-toolbar {
  padding: 13px 0 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.inline-editor-toolbar p { color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.inline-editor-toolbar strong { color: var(--forest); }
.drag-guide {
  display: inline-grid; place-items: center; width: 22px; height: 22px;
  color: var(--forest); background: #e7f1e8; border-radius: 999px; font-weight: 800;
}
.editor-history-actions { display: flex; gap: 7px; flex: none; }
.editor-history-actions .button { min-height: 34px; }
.design-canvas {
  width: min(100%, 620px); min-height: 550px; margin: 0 auto; padding: 22px 20px 30px;
  color: #223738; background: var(--paper); border: 1px solid #ded8ce;
  box-shadow: 0 8px 25px rgba(26,33,30,.06);
}
.design-document-header {
  display: flex; justify-content: space-between; align-items: start; gap: 16px;
  margin-bottom: 18px; padding-bottom: 14px; border-bottom: 2px solid var(--forest);
}
.design-brand { color: #6f817a; font-size: 9px; font-weight: 800; letter-spacing: .24em; }
.design-title-input {
  display: block; width: min(100%, 360px); margin-top: 6px; padding: 3px 1px;
  color: var(--ink); background: transparent; border: 1px solid transparent;
  border-radius: 4px; font-size: 22px; font-weight: 700; letter-spacing: -.04em;
}
.design-title-input:hover, .design-title-input:focus { background: #fff; border-color: #b6cbbd; outline: none; }
.design-meta { color: #74847e; font-size: 10px; text-align: right; }
.section-drop-slot { height: 11px; margin: 1px 0; border-radius: 6px; transition: background .12s, height .12s; }
.section-drop-slot.drop-active { height: 27px; background: #dceee0; border: 1px dashed #6c9c82; }
.design-section {
  position: relative; margin-bottom: 12px; padding: 10px 10px 12px;
  border: 1px solid transparent; border-radius: 9px; transition: border-color .15s, background .15s;
}
.design-section:hover, .design-section.is-selected { border-color: #d0ded3; background: #fcfefb; }
.design-section.is-dragging, .design-item.is-dragging { opacity: .44; }
.design-section-head {
  display: flex; align-items: center; gap: 5px; margin-bottom: 7px;
}
.drag-handle {
  width: 25px; height: 25px; display: inline-grid; place-items: center; flex: none;
  color: #7a9287; background: transparent; border: 1px solid transparent; border-radius: 999px;
  font-size: 15px; font-weight: 700; cursor: grab;
}
.drag-handle:hover { color: var(--forest); border-color: #c6d7cb; background: #eff5ef; }
.drag-handle:active { cursor: grabbing; }
.section-title-input {
  flex: 1; min-width: 0; padding: 3px 5px; color: var(--forest); background: transparent;
  border: 1px solid transparent; border-radius: 5px; font-size: 12px; font-weight: 800;
  letter-spacing: .12em;
}
.section-title-input:hover, .section-title-input:focus { border-color: #bdd1c2; background: #fff; outline: none; }
.section-mini-control, .item-mini-control {
  width: 26px; height: 26px; display: inline-grid; place-items: center;
  color: #6c847a; background: transparent; border: 1px solid transparent; border-radius: 999px;
  font-size: 13px; font-weight: 700;
}
.section-mini-control:hover, .item-mini-control:hover { color: var(--forest); background: #edf5ee; border-color: #c4d7c9; }
.section-mini-control.danger:hover, .item-mini-control.danger:hover { color: var(--risk); background: #faeeee; border-color: #e7c6c0; }
.section-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 9px; }
.item-drop-slot { grid-column: 1 / -1; height: 6px; border-radius: 6px; transition: height .12s, background .12s; }
.item-drop-slot.drop-active { height: 22px; background: #dceee0; border: 1px dashed #6c9c82; }
.design-item { position: relative; margin-bottom: 8px; }
.design-field {
  min-width: 0; padding: 5px 6px 7px; border: 1px solid transparent; border-radius: 7px;
  background: transparent;
}
.design-field.full, .design-table { grid-column: 1 / -1; }
.design-field:hover, .design-field.is-selected, .design-table:hover, .design-table.is-selected {
  border-color: #99b9a6; background: #f6faf6;
}
.design-item-head { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.field-label-input, .table-title-input {
  flex: 1; min-width: 0; padding: 3px 4px; color: #435553; background: transparent;
  border: 1px solid transparent; border-radius: 4px; font-size: 10px; font-weight: 700;
}
.table-title-input { color: var(--forest); font-size: 12px; letter-spacing: .08em; }
.field-label-input:hover, .field-label-input:focus, .table-title-input:hover, .table-title-input:focus {
  border-color: #bcd1c2; background: #fff; outline: none;
}
.required-mark { color: var(--risk); font-size: 11px; font-weight: 700; }
.field-visual { min-height: 30px; background: #fff; border: 1px solid #abb9b1; border-radius: 3px; }
.design-field.textarea .field-visual { min-height: 55px; }
.design-field.choice .field-visual { display: flex; gap: 14px; align-items: center; padding: 0 8px; font-size: 10px; }
.design-field.choice .field-visual span::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 4px; border: 1px solid #7e8b86; vertical-align: -1px; }
.field-inspector {
  grid-column: 1 / -1; margin: 3px 0 10px; padding: 10px;
  display: flex; flex-wrap: wrap; align-items: end; gap: 8px;
  background: #edf5ee; border: 1px solid #c6d8cb; border-radius: 8px;
}
.field-inspector label { display: flex; flex-direction: column; gap: 3px; color: #647873; font-size: 10px; font-weight: 700; }
.field-inspector select {
  min-height: 30px; padding: 0 8px; border: 1px solid #c6d6cc; border-radius: 5px; background: #fff; color: var(--ink); font-size: 11px;
}
.field-inspector .check-inline { flex-direction: row; align-items: center; min-height: 30px; gap: 6px; }
.field-inspector .button { min-height: 30px; padding-inline: 10px; font-size: 10px; }
.design-table { padding: 6px; border: 1px solid transparent; border-radius: 7px; }
.table-frame { overflow-x: auto; }
.design-table table { width: 100%; border-collapse: collapse; font-size: 10px; }
.design-table th, .design-table td { height: 28px; padding: 3px; border: 1px solid #aeb9b1; }
.design-table th { position: relative; min-width: 62px; background: #eaf0eb; }
.column-label-input {
  width: calc(100% - 70px); min-width: 45px; padding: 2px 3px; color: #344743; background: transparent; border: 1px solid transparent; border-radius: 3px; font-size: 10px; font-weight: 700;
}
.column-label-input:hover, .column-label-input:focus { background: #fff; border-color: #b6cbbb; outline: none; }
.column-controls {
  position: absolute; top: 3px; right: 3px; display: inline-flex; gap: 1px; opacity: 0; transition: opacity .12s;
}
.design-table th:hover .column-controls, .design-table.is-selected .column-controls { opacity: 1; }
.column-controls button {
  width: 18px; height: 18px; color: #74857c; background: #fff; border: 0; border-radius: 999px; font-size: 10px; font-weight: 700;
}
.column-controls button:hover:not(:disabled) { color: var(--forest); background: #dae9de; }
.column-controls button.danger:hover:not(:disabled) { color: var(--risk); background: #faeceb; }
.column-controls button:disabled { opacity: .25; }
.row-action { width: 30px; text-align: center; border-color: transparent !important; background: transparent; }
.row-remove { width: 20px; height: 20px; color: #7b8d85; background: #fff; border: 1px solid #d5dfd7; border-radius: 999px; font-size: 11px; }
.row-remove:hover { color: var(--risk); border-color: #e5c4bd; background: #faeceb; }
.table-inline-actions, .item-inline-actions, .canvas-inline-actions {
  display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 8px;
}
.inline-plus {
  min-height: 27px; padding: 0 10px; color: var(--good); background: #fff;
  border: 1px dashed #9dbea9; border-radius: 999px; font-size: 10px; font-weight: 700;
}
.inline-plus:hover { background: #edf6ef; border-style: solid; }
.inline-plus.section-add { margin: 8px auto 0; min-height: 34px; padding: 0 17px; font-size: 12px; }
.design-footer { display: flex; justify-content: space-between; margin-top: 22px; padding-top: 10px; border-top: 1px solid #cbd4ce; color: #6a7975; font-size: 9px; }
.drop-note { margin: 10px 0 0; color: #73857d; font-size: 10px; text-align: center; }
@media (max-width: 760px) {
  .inline-editor-toolbar { flex-direction: column; align-items: stretch; }
  .section-items { grid-template-columns: 1fr; }
  .design-canvas { padding: 16px 12px 22px; }
  .field-inspector { align-items: stretch; flex-direction: column; }
}

.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; }
  .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; }
  .mode-tabs { overflow-x: auto; }
  .mode-tab { white-space: nowrap; }
  .export-actions { flex-wrap: wrap; }
  .form-paper { padding: 25px 20px; }
  .form-preview-head, .form-question { flex-direction: column; }
  .question-type { text-align: left; }
  .site-footer { display: block; }
  .site-footer p { margin: 10px 0 20px; }
}


/* WORLD flow layout: hero -> transform studio -> output */
.transform-studio {
  max-width: 1460px;
  margin: 0 auto;
  padding: 56px 0 56px;
  border-top: 1px solid var(--line);
}
.studio-heading { margin-bottom: 28px; }
.studio-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; }

@media (max-width: 1120px) {
  .hero-split { grid-template-columns: 1fr; }
  .redesign-preview { max-width: 650px; }
}
@media (max-width: 760px) {
  .hero-outputs { grid-template-columns: 1fr; }
  .hero-flow { flex-wrap: wrap; }
  .comparison-footer { flex-direction: column; align-items: stretch; }
  .compact-insights { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .transform-studio { padding: 40px 0; }
  .source-empty-state { padding: 30px 12px; }
  .redesign-preview { padding: 18px 16px 14px; }
}

@media print {
  @page { size: A4 portrait; margin: 0; }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    background: #fff !important;
  }

  /* Print only the generated paper preview. Hidden site sections must not
     retain layout height, otherwise browsers produce trailing blank pages. */
  body.formrecast-print-ready .world-shell-header,
  body.formrecast-print-ready .world-shell-footer,
  body.formrecast-print-ready .site-header,
  body.formrecast-print-ready .site-footer,
  body.formrecast-print-ready #toast,
  body.formrecast-print-ready main > :not(#studio) {
    display: none !important;
  }

  body.formrecast-print-ready main,
  body.formrecast-print-ready #studio {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  body.formrecast-print-ready #studio > :not(.studio-panel),
  body.formrecast-print-ready .studio-panel > :not(.comparison-grid),
  body.formrecast-print-ready .comparison-grid > :not(.result-pane),
  body.formrecast-print-ready .result-pane > :not(#resultPreview) {
    display: none !important;
  }

  body.formrecast-print-ready .studio-panel,
  body.formrecast-print-ready .comparison-grid,
  body.formrecast-print-ready .result-pane,
  body.formrecast-print-ready #resultPreview {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body.formrecast-print-ready #resultPreview {
    position: static !important;
  }

  body.formrecast-print-ready .paper-page-stack {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  body.formrecast-print-ready .form-paper {
    display: block !important;
    box-sizing: border-box !important;
    width: 210mm !important;
    min-height: 297mm !important;
    padding: 14mm 15mm !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  body.formrecast-print-ready .form-paper.landscape {
    width: 297mm !important;
    min-height: 210mm !important;
  }

  body.formrecast-print-ready .form-paper.a3 {
    width: 297mm !important;
    min-height: 420mm !important;
  }

  body.formrecast-print-ready .form-paper.a3.landscape {
    width: 420mm !important;
    min-height: 297mm !important;
  }

  body.formrecast-print-ready .form-paper:not(:last-child) {
    break-after: page;
    page-break-after: always;
  }

  body.formrecast-print-ready .form-paper:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}


/* Sample selection and multi-page document support */
.sample-options {
  width: 100%; margin-top: 10px; padding-top: 13px; display: grid; gap: 7px;
  border-top: 1px solid #dae5dc;
}
.sample-options p { margin: 0 0 2px; color: #788a83; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.sample-option {
  width: 100%; padding: 9px 11px; display: flex; flex-direction: column; align-items: start; gap: 2px;
  color: var(--forest); background: #fff; border: 1px solid #d6e1d9; border-radius: 18px; text-align: left;
}
.sample-option:hover { border-color: #95b49d; background: #edf5ee; }
.sample-option.featured { border-color: #a5c5ad; background: #f2f8f3; }
.sample-option strong { font-size: 12px; }
.sample-option span { color: var(--ink-soft); font-size: 10px; }
.page-count-note {
  margin-left: auto; padding: 5px 11px; color: var(--forest); background: #e7f1e8;
  border: 1px solid #c5d9c9; border-radius: 18px; font-size: 11px; font-weight: 700;
}
.paper-page-stack {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.form-paper { flex: none; }
.paper-page-badge {
  margin-bottom: 12px; display: inline-flex; padding: 4px 9px; color: var(--forest);
  background: #edf4ed; border-radius: 15px; font-size: 9px; font-weight: 800; letter-spacing: .14em;
}
.design-canvas { width: min(100%, 700px); }
.design-page {
  margin: 0 0 18px; padding: 13px 12px 17px; border: 1px solid #dfddd5; border-radius: 8px;
  background: #fffefa;
}
.design-page + .design-page { margin-top: 22px; }
.design-page-header {
  margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center;
  color: #63756f; font-size: 9px; font-weight: 800; letter-spacing: .16em;
}
.design-page-tag { padding: 3px 8px; color: var(--forest); background: #eef4ef; border-radius: 13px; }
.page-break-control {
  min-height: 25px; padding: 0 8px; margin-left: 4px; color: #647a70; background: #fff;
  border: 1px solid #d5ded7; border-radius: 999px; font-size: 9px; font-weight: 700;
}
.page-break-control.active { color: var(--good); border-color: #a5c6ad; background: #eaf4ec; }
.page-break-rule {
  margin: 15px 0 13px; display: flex; align-items: center; gap: 10px;
  color: #6f8479; font-size: 9px; font-weight: 800; letter-spacing: .16em;
}
.page-break-rule::before, .page-break-rule::after { content: ""; flex: 1; border-top: 1px dashed #bfd0c2; }

@media (max-width: 760px) {
  .page-count-note { margin-left: 0; }
  .design-page { padding: 10px 8px 12px; }
}



/* FormRecast mapping view: source cells to redesigned elements */
.comparison-grid { position: relative; }
.preview-pane { position: relative; z-index: 1; }
.mapping-guide {
  flex: 1 1 100%;
  margin: 0;
  padding: 8px 11px;
  border: 1px solid #d2e3d9;
  border-radius: 8px;
  color: var(--forest);
  background: #edf6ef;
  font-size: 11px;
  line-height: 1.6;
}
.mapping-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.mapping-overlay path {
  fill: var(--good);
  stroke: none;
}
.mapping-path {
  fill: none !important;
  stroke: #197253 !important;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-dasharray: 5 4;
  marker-end: url(#mappingArrow);
  filter: drop-shadow(0 2px 3px rgba(25,114,83,.15));
}
.grid-cell.mapped-source {
  position: relative;
  cursor: pointer;
  transition: background-color .14s, box-shadow .14s, color .14s;
}
.grid-cell.mapped-source::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--good);
  opacity: .54;
}
.grid-cell.mapped-source:hover,
.grid-cell.mapped-source:focus-visible,
.grid-cell.map-active {
  color: var(--forest);
  background: #def0e5;
  box-shadow: inset 0 0 0 2px #197253;
  outline: none;
}
.design-item.map-target-active {
  position: relative;
  z-index: 6;
  border-color: #197253;
  background: #f0f8f3;
  box-shadow: 0 0 0 2px rgba(25,114,83,.18), 0 9px 20px rgba(25,114,83,.08);
}
.design-item.map-target-active::before {
  content: "移行先";
  position: absolute;
  top: -18px;
  left: 8px;
  padding: 2px 7px;
  border-radius: 9px;
  color: #fff;
  background: var(--good);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
}
@media (max-width: 980px) {
  .mapping-overlay { display: none !important; }
  .mapping-guide { order: 9; }
}
@media print {
  .mapping-overlay,
  .mapping-guide { display: none !important; }
}


/* FormRecast v24: WORLD rounded control language */
button { border-radius: var(--world-button-radius, 999px); }
.mode-tab,
.sheet-tab,
.page-break-control,
.inline-plus { border-radius: var(--world-button-radius, 999px); }
.sample-option { border-radius: 18px; }
.section-mini-control,
.item-mini-control,
.column-controls button,
.row-remove,
.drag-handle { border-radius: 50%; }
.world-shell-action { border-radius: var(--world-button-radius, 999px); }


/* FormRecast v011: online form outputs */
.integration-badge.ready { color: #13704c; background: #e6f3e8; }
.integration-badge.import-ready { color: #1669ad; background: #ebf2f8; }
.platform-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.platform-result { margin-top: 16px; padding: 15px; border: 1px solid #b9d6c1; border-radius: 12px; background: #eef7f0; }
.platform-result.warning { border-color: #e4c27a; background: #fff7e6; }
.platform-result strong { display: block; margin-bottom: 6px; color: var(--forest); font-size: 14px; }
.platform-result p, .platform-config-note { margin: 0 0 12px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.field-inspector { flex-wrap: wrap; }
.field-description-editor, .field-option-editor { flex: 1 1 100%; }
.field-description-editor input, .field-option-editor textarea { display: block; width: 100%; margin-top: 4px; padding: 7px 9px; color: var(--ink); background: #fff; border: 1px solid #c8d8ce; border-radius: 8px; font: inherit; }
.field-option-editor textarea { min-height: 56px; resize: vertical; }
.design-field.choice .field-visual { flex-wrap: wrap; }
.ms-import-document { width: min(100%, 700px); padding: 28px 31px; color: #17282b; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.ms-import-document header { padding-bottom: 18px; margin-bottom: 22px; border-bottom: 2px solid var(--forest); }
.ms-import-document header p { margin: 0 0 8px; color: #607b72; font-size: 9px; font-weight: 800; letter-spacing: .2em; }
.ms-import-document header h4 { margin: 0 0 6px; color: var(--forest); font-size: 22px; }
.ms-import-document header span { color: var(--ink-soft); font-size: 12px; }
.ms-import-section { margin: 24px 0; }
.ms-import-section h5 { margin: 0 0 13px; padding-bottom: 7px; color: var(--forest); border-bottom: 1px solid #cfe0d6; font-size: 14px; }
.ms-import-question { margin: 0 0 17px; break-inside: avoid; }
.ms-import-question h6 { margin: 0 0 6px; color: #182b2e; font-size: 13px; }
.ms-import-help { margin: 0 0 7px; color: #63756f; font-size: 11px; }
.ms-import-answer { min-height: 31px; margin: 0; padding: 8px 10px; border: 1px solid #c9d6ce; color: #75827d; font-size: 11px; }
.ms-import-answer.multi { min-height: 70px; }
.ms-import-options { margin: 0; padding: 0; display: grid; gap: 5px; list-style: none; color: #263b3b; font-size: 12px; }
.ms-import-document footer { margin-top: 27px; padding-top: 11px; border-top: 1px solid #d8e1da; color: #71837d; font-size: 10px; }
@media print {
  body.formrecast-ms-import-ready .world-shell-header,
  body.formrecast-ms-import-ready .world-shell-footer,
  body.formrecast-ms-import-ready .site-header,
  body.formrecast-ms-import-ready .site-footer,
  body.formrecast-ms-import-ready #toast,
  body.formrecast-ms-import-ready main > :not(#studio) { display: none !important; }
  body.formrecast-ms-import-ready main, body.formrecast-ms-import-ready #studio { max-width: none !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; }
  body.formrecast-ms-import-ready #studio > :not(.studio-panel),
  body.formrecast-ms-import-ready .studio-panel > :not(.comparison-grid),
  body.formrecast-ms-import-ready .comparison-grid > :not(.result-pane),
  body.formrecast-ms-import-ready .result-pane > :not(#resultPreview) { display: none !important; }
  body.formrecast-ms-import-ready .studio-panel, body.formrecast-ms-import-ready .comparison-grid, body.formrecast-ms-import-ready .result-pane, body.formrecast-ms-import-ready #resultPreview { display: block !important; width: auto !important; max-width: none !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; border: 0 !important; background: #fff !important; box-shadow: none !important; }
  body.formrecast-ms-import-ready .ms-import-document { width: auto !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; }
}
