:root {
  color-scheme: light;
  --ink: #08254a;
  --ink-2: #17385e;
  --muted: #63758a;
  --line: #d7e0e9;
  --line-strong: #becbd8;
  --paper: #fff;
  --wash: #f5f8fb;
  --accent: #c93425;
  --accent-soft: #fff4f1;
  --sage: #3d7f4a;
  --sage-soft: #eef7ef;
  --shadow: 0 8px 28px rgb(10 37 72 / 6%);
  --radius: 12px;
  --ui-font: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", sans-serif;
  --editorial-font: "Yu Mincho", "Hiragino Mincho ProN", serif;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; color: var(--ink); background: var(--paper); font-family: var(--ui-font); }
button, input, select { color: inherit; font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgb(27 95 160 / 34%); outline-offset: 3px; }

.demo-ribbon { position: sticky; top: 0; z-index: 20; min-height: 44px; display: flex; align-items: center; gap: 16px; padding: 8px 20px; color: #fff; background: #090909; border-bottom: 4px solid #ff5a1f; font-size: 11px; }
.demo-ribbon strong { flex: 0 0 auto; color: #ff5a1f; font-family: ui-monospace, monospace; letter-spacing: .14em; }
.demo-ribbon span { color: #ddd2c1; }
.demo-ribbon a { margin-left: auto; white-space: nowrap; font-weight: 800; }

.app-shell { min-height: calc(100vh - 44px); display: grid; grid-template-columns: 188px 1fr; }
.sidebar { position: sticky; top: 44px; z-index: 5; height: calc(100vh - 44px); display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); }
.brand { height: 104px; display: flex; align-items: center; gap: 12px; padding: 25px 23px; color: var(--ink); border-bottom: 1px solid var(--line); font-family: Georgia, var(--editorial-font); font-size: 20px; line-height: 1.08; letter-spacing: .02em; text-decoration: none; }
.brand-mark { font-size: 38px; line-height: 1; }
.step-nav { padding-top: 18px; }
.step-link { width: 100%; height: 64px; display: flex; align-items: center; gap: 9px; padding: 0 15px; color: var(--ink-2); background: transparent; border: 0; font-size: 13px; text-align: left; }
.step-link.active { background: #eef3f8; font-weight: 700; }
.step-link:disabled { color: #93a1b0; cursor: not-allowed; }
.step-number { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border: 1.5px solid currentcolor; border-radius: 50%; }
.step-link.active .step-number, .step-link.done .step-number { color: #fff; background: var(--ink); border-color: var(--ink); }
.sidebar-foot { display: grid; gap: 10px; margin-top: auto; padding: 18px 18px 22px; border-top: 1px solid var(--line); }
.sidebar-foot a { min-height: 36px; display: flex; align-items: center; color: var(--ink-2); font-size: 12px; font-weight: 700; }

.app-main { min-width: 0; }
.topbar { position: sticky; top: 44px; z-index: 4; height: 104px; display: flex; align-items: center; gap: 34px; padding: 0 36px; background: rgb(255 255 255 / 96%); border-bottom: 1px solid var(--line); }
.target { min-width: 245px; padding-right: 30px; border-right: 1px solid var(--line); }
.target strong { display: block; margin-top: 5px; font-family: var(--editorial-font); font-size: 25px; letter-spacing: .05em; }
.meta-label { display: block; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.visit { min-width: 210px; display: flex; align-items: center; gap: 12px; }
.visit strong { display: block; margin-top: 5px; font-family: var(--editorial-font); font-size: 15px; }
.progress { display: flex; align-items: center; margin-left: auto; }
.progress-dot { position: relative; width: 27px; height: 27px; flex: 0 0 auto; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 50%; font-size: 11px; }
.progress-dot.filled { color: #fff; background: var(--ink); }
.progress-dot small { position: absolute; top: 34px; left: 50%; width: 110px; color: var(--ink); font-size: 9px; font-weight: 600; text-align: center; white-space: nowrap; transform: translateX(-50%); }
.progress-dot:last-child small { right: 0; left: auto; text-align: right; transform: none; }
.progress-line { width: clamp(36px, 5vw, 86px); height: 1.5px; background: var(--ink); }

.workspace { min-height: calc(100vh - 148px); display: grid; grid-template-columns: minmax(590px, 1fr) 390px; }
.primary-column, .proposal-canvas { min-width: 0; padding: 38px 44px 72px; }
.evidence-column { padding: 36px 26px; background: #fff; border-left: 1px solid var(--line); }
.page-heading > span, .canvas-heading > span { display: block; margin-bottom: 8px; color: var(--accent); font: 800 10px/1 ui-monospace, monospace; letter-spacing: .1em; }
.page-heading h1, .canvas-heading h1 { margin: 0; font-family: var(--editorial-font); font-size: 29px; font-weight: 600; line-height: 1.35; letter-spacing: .07em; }
.page-heading p, .rail-heading p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.rail-heading { margin-bottom: 22px; padding-left: 14px; border-left: 3px solid var(--accent); }
.rail-heading h2 { margin: 0; font-family: var(--editorial-font); font-size: 18px; letter-spacing: .06em; }
.rail-heading p { margin: 6px 0 0; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; }
.field { display: grid; gap: 9px; font-size: 13px; font-weight: 700; }
.field.full { grid-column: 1 / -1; }
.field em { margin-left: 8px; color: var(--accent); font-size: 10px; font-style: normal; }
.field input, .field select { height: 48px; padding: 0 15px; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 14px; }
.quality-inline { display: flex; align-items: center; gap: 15px; margin: 30px 0; padding: 20px 0; color: var(--sage); border-block: 1px solid var(--line); }
.quality-inline strong { display: block; color: var(--ink); font-size: 14px; }
.quality-inline p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.document-panel { overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.document-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.document-head strong, .document-head small { display: block; }
.document-head small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.document-content { max-height: 390px; overflow: auto; padding: 20px 24px; font-size: 12px; line-height: 1.8; }
.document-content h3 { margin: 20px 0 6px; font-size: 14px; }
.document-content h3:first-child { margin-top: 0; }
.document-content p { margin: 0 0 8px; }
.document-content .quote { padding-left: 12px; color: var(--muted); border-left: 2px solid var(--accent); }

.sample-notice { margin-bottom: 15px; padding: 11px 14px; color: #8d2a20; background: var(--accent-soft); border-left: 3px solid var(--accent); }
.sample-notice strong, .sample-notice span { display: block; font-size: 11px; }
.sample-notice span { margin-top: 3px; color: #86554f; }
.source-list { display: grid; gap: 12px; }
.source-card { padding: 15px; border: 1px solid var(--line-strong); border-radius: 9px; }
.source-name { display: flex; align-items: center; gap: 9px; overflow-wrap: anywhere; font-size: 12px; }
.source-card dl { display: grid; gap: 7px; margin: 14px 0 0; }
.source-card dl > div { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.source-card dt { color: var(--muted); }
.source-card dd { margin: 0; text-align: right; }
.valid { display: inline-flex; align-items: center; gap: 4px; color: var(--sage); }
.source-types { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.source-types h3 { margin: 0 0 12px; font-family: var(--editorial-font); font-size: 14px; }
.source-types > div { display: flex; align-items: center; gap: 9px; padding: 8px 0; font-size: 12px; }
.primary-action { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 24px; color: #fff; background: var(--ink); border: 0; border-radius: 7px; box-shadow: 0 7px 18px rgb(8 37 74 / 12%); font-family: var(--editorial-font); font-size: 17px; letter-spacing: .08em; }
.primary-action:hover { background: #10345f; }

.quality-band { display: flex; align-items: center; gap: 16px; margin: 30px 0 38px; padding: 20px 22px; background: var(--sage-soft); border-left: 4px solid var(--sage); }
.quality-band > svg { color: var(--sage); }
.quality-band span, .quality-band strong, .quality-band p { display: block; }
.quality-band span { color: var(--sage); font-size: 11px; font-weight: 700; }
.quality-band strong { margin-top: 4px; font-size: 15px; }
.quality-band p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.review-section { margin-top: 34px; }
.section-title { display: flex; justify-content: space-between; padding-bottom: 11px; border-bottom: 1px solid var(--line-strong); }
.section-title h2 { margin: 0; font-family: var(--editorial-font); font-size: 18px; }
.section-title span { color: var(--muted); font-size: 12px; }
.claim-row { display: flex; gap: 18px; padding: 19px 4px; border-bottom: 1px solid var(--line); }
.claim-row > span { color: var(--accent); font-family: Georgia, serif; font-size: 21px; }
.claim-row strong, .claim-row small { display: block; }
.claim-row strong { font-size: 14px; line-height: 1.55; }
.claim-row small { margin-top: 6px; color: var(--muted); font-size: 11px; }
.caution-box { margin-top: 15px; padding: 20px; background: var(--wash); }
.caution-box strong { font-size: 13px; }
.caution-box p { margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }

.evidence-review, .proposal-rail { display: flex; flex-direction: column; }
.evidence-card { margin-bottom: 11px; padding: 13px; border: 1px solid var(--line-strong); border-radius: 9px; transition: border-color .2s, background .2s; }
.evidence-card.approved { background: #fcfffc; border-color: #8eb499; }
.evidence-top { display: grid; grid-template-columns: 25px 1fr auto; gap: 9px; align-items: start; }
.evidence-index { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid var(--line-strong); font-family: Georgia, serif; font-size: 10px; }
.evidence-top strong, .evidence-top small { display: block; }
.evidence-top strong { font-size: 12px; line-height: 1.45; }
.evidence-top small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.score { font-family: Georgia, serif; font-size: 21px; }
.score small { display: inline; margin-left: 1px; font-size: 10px; }
.evidence-value { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 13px 0; }
.evidence-value strong { font-family: var(--editorial-font); font-size: 20px; }
.evidence-value span { color: var(--muted); font-size: 10px; text-align: right; }
.toggle { position: relative; display: flex; align-items: center; justify-content: space-between; padding-top: 11px; border-top: 1px solid var(--line); cursor: pointer; font-size: 10px; }
.toggle input { position: absolute; opacity: 0; }
.toggle i { position: relative; width: 35px; height: 19px; background: #aab6c2; border-radius: 20px; }
.toggle i::after { position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgb(0 0 0 / 20%); content: ""; transition: transform .2s; }
.toggle input:checked + i { background: var(--ink); }
.toggle input:checked + i::after { transform: translateX(16px); }

.proposal-view { grid-template-columns: minmax(690px, 1fr) 390px; }
.proposal-canvas { padding-top: 24px; padding-bottom: 28px; }
.canvas-heading { padding-bottom: 18px; border-bottom: 1px solid var(--line-strong); }
.canvas-heading h1 { margin-top: 6px; font-size: 30px; }
.canvas-heading p { margin: 8px 0 0; color: #9b554c; font-size: 9px; }
.insights { padding: 19px 0; border-bottom: 1px solid var(--line-strong); }
.insights h2, .chart-section h2, .recommendations > h2 { margin: 0 0 20px; padding-left: 12px; border-left: 3px solid var(--accent); font-family: var(--editorial-font); font-size: 17px; }
.insights article { display: grid; grid-template-columns: 47px 1fr; gap: 10px; padding: 7px 0; }
.insights article > span { color: var(--accent); font-family: Georgia, serif; font-size: 27px; }
.insights h3 { margin: 0; font-size: 14px; line-height: 1.55; }
.insights p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.chart-section { padding: 19px 0; border-bottom: 1px solid var(--line-strong); }
.line-chart { width: 100%; height: 180px; overflow: visible; }
.grid-line { stroke: #dfe6ed; stroke-width: 1; stroke-dasharray: 3 4; }
.chart-line { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.line-chart circle { fill: #fff; stroke: var(--accent); stroke-width: 3; }
.line-chart text { fill: var(--muted); font: 10px var(--ui-font); }
.line-chart .point-label { fill: var(--ink); font-weight: 700; }
.recommendations { padding-top: 19px; }
.recommendation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.recommendation-grid article { padding: 11px 5px 0; border-top: 2px solid var(--ink); }
.recommendation-number { color: var(--accent); font-family: Georgia, serif; font-size: 19px; }
.recommendation-grid h3 { margin: 7px 0; font-size: 14px; }
.recommendation-grid p, .recommendation-grid li { color: var(--muted); font-size: 9px; line-height: 1.5; }
.recommendation-grid ul { padding: 0; list-style: none; }
.recommendation-grid li::before { margin-right: 7px; color: var(--accent); content: "✓"; }
.quality-compact { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; padding: 13px; background: var(--sage-soft); border: 1px solid #a9c7ae; }
.quality-compact svg { color: var(--sage); }
.quality-compact strong, .quality-compact span { display: block; }
.quality-compact strong { font-size: 11px; }
.quality-compact span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.proposal-rail .primary-action { margin-top: auto; }
.export-note { min-height: 18px; color: var(--muted); font-size: 10px; text-align: center; }

.loading-screen { min-height: calc(100vh - 44px); display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; }
.loading-screen span { color: var(--muted); font-size: 12px; }
.spinner { width: 34px; height: 34px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 76px 1fr; }
  .brand { justify-content: center; padding: 15px; }
  .brand span:last-child, .step-link span:last-child, .sidebar-foot { display: none; }
  .step-link { justify-content: center; padding: 0; }
  .topbar { padding: 0 22px; }
  .target { min-width: 190px; }
  .workspace, .proposal-view { grid-template-columns: 1fr 330px; }
  .primary-column, .proposal-canvas { padding-inline: 30px; }
}

@media (max-width: 760px) {
  .demo-ribbon { position: static; flex-wrap: wrap; gap: 4px 12px; padding: 9px 14px; }
  .demo-ribbon span { width: calc(100% - 88px); }
  .demo-ribbon a { margin-left: 0; }
  .app-shell { display: block; min-height: 100vh; }
  .sidebar { position: fixed; inset: auto 0 0; z-index: 10; width: 100%; height: 68px; border: 0; border-top: 1px solid var(--line); }
  .brand, .sidebar-foot { display: none; }
  .step-nav { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; }
  .step-link { height: 67px; flex-direction: column; gap: 3px; font-size: 9px; }
  .step-link span:last-child { display: block; }
  .step-number { width: 24px; height: 24px; }
  .topbar { position: static; height: 86px; gap: 15px; padding: 0 17px; }
  .target { min-width: 0; padding: 0; border: 0; }
  .target strong { font-size: 19px; }
  .visit { min-width: 0; margin-left: auto; }
  .visit > span:first-child { display: none; }
  .visit strong { font-size: 11px; }
  .progress { display: none; }
  .workspace, .proposal-view { display: block; padding-bottom: 68px; }
  .primary-column, .proposal-canvas { padding: 26px 18px 42px; }
  .evidence-column { padding: 26px 18px 38px; border: 0; border-top: 8px solid var(--wash); }
  .page-heading h1, .canvas-heading h1 { font-size: 24px; }
  .form-grid, .recommendation-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .document-content { max-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
