/* DYSFLOW – shared, responsive workspace design. */
:root {
  color-scheme: light;
  --bg: #f3f5ef;
  --surface: #fff;
  --text: #20382f;
  --muted: #5e7168;
  --line: #dce5dc;
  --accent: #227565;
  --accent-hover: #185c4e;
  --soft: #eaf3ed;
  --sidebar: #173b31;
  --lime: #d7ecaa;
  --danger: #a43e36;
  --phase-accent: var(--accent);
  --phase-soft: var(--soft);
  --phase-line: var(--line);
  --shadow: 0 4px 18px rgb(25 53 39 / 3%);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 "Manrope", "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled, input:disabled, textarea:disabled { cursor: not-allowed; opacity: .6; }
button:disabled { transform: none; }
:focus-visible { outline: 3px solid #bd8b30; outline-offset: 4px; }
[hidden], .hidden-view, .hidden-install, .print-report { display: none !important; }
.show-install { display: inline-flex; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.25; }
h1 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.04em; }
h2 { font-size: 1.18rem; font-weight: 800; letter-spacing: -.025em; }
h3 { font-size: 1.04rem; font-weight: 750; }
h4 { font-size: .9rem; font-weight: 750; }
small { font-size: .8rem; }
button, input, select, textarea { border-radius: 10px; }
.app-shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.app-sidebar { position: sticky; top: 0; height: 100dvh; background: var(--sidebar); color: #e7efe7; padding: 32px 20px 24px; display: flex; flex-direction: column; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 54px; letter-spacing: .08em; }
.sidebar-brand strong { font-size: 1.05rem; font-weight: 800; }
.brand-mark { background: var(--lime); color: var(--sidebar); width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px 12px 12px 3px; font-size: .8rem; font-weight: 800; letter-spacing: -.04em; }
.sidebar-section-title { padding: 0 12px; margin-bottom: 14px; color: #c1d3c7; font-size: .69rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; }
.primary-nav { display: grid; gap: 7px; }
.nav-link { display: flex; gap: 13px; align-items: center; width: 100%; padding: 13px 15px; border: 1px solid transparent; background: transparent; color: #d6e3d9; text-align: left; font-weight: 600; min-height: 49px; }
.nav-link:hover { color: #fff; background: #244b40; }
.nav-link.active { background: var(--lime); color: #1c3d2b; font-weight: 800; box-shadow: 0 3px 10px rgb(0 0 0 / 4%); }
.nav-icon { width: 20px; height: 20px; flex: 0 0 20px; }
.nav-icon svg { display: block; width: 20px; height: 20px; }
.sidebar-footer { margin-top: auto; padding: 26px 9px 0; border-top: 1px solid #3d5d4f; display: flex; gap: 9px; align-items: baseline; font-size: .69rem; color: #bdd1c2; line-height: 1.8; }
.sidebar-footer strong { font-weight: 500; }
.project-dot { width: 6px; height: 6px; background: var(--lime); border-radius: 50%; flex-shrink: 0; }
.app-main { min-width: 0; width: 100%; max-width: 1550px; margin: 0 auto; padding: 0 44px 52px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 27px 0; border-bottom: 1px solid var(--line); }
.kicker, .section-eyebrow { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .15em; color: var(--accent); }
.kicker { margin-bottom: 5px; color: var(--muted); }
.hero-meta { display: flex; gap: 18px; align-items: center; min-width: 0; }
.hero-core-status { display: flex; gap: 24px; }
.hero-core-status > div { display: grid; gap: 3px; }
.hero-core-status span { font-size: .68rem; color: var(--muted); }
.hero-core-status strong { font-size: .73rem; font-weight: 650; max-width: 310px; overflow-wrap: anywhere; }
#saveStatus.status-ok { color: var(--accent); }
#saveStatus.status-error { color: var(--danger); }
.hero-tools { position: relative; }
.hero-tools > summary { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: .8rem; font-weight: 700; cursor: pointer; list-style: none; white-space: nowrap; }
.hero-tools > summary::after { content: " +"; padding-left: 10px; }
.hero-tools[open] > summary::after { content: " −"; }
summary::-webkit-details-marker { display: none; }
.hero-tools-grid { position: absolute; right: 0; top: calc(100% + 10px); min-width: 215px; display: grid; gap: 8px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgb(18 48 32 / 14%); z-index: 20; }
.layout { display: grid; gap: 22px; padding-top: 30px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 26px; box-shadow: var(--shadow); }
.panel-title-row, .phase-block-head, .entry-input-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.workspace-welcome { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 10px 0 6px; border: 0; background: transparent; box-shadow: none; }
.welcome-copy h2 { font-size: clamp(1.65rem, 2.5vw, 2.3rem); line-height: 1.2; font-weight: 800; letter-spacing: -.055em; margin: 9px 0 12px; }
.welcome-copy p:last-child { color: var(--muted); font-size: .87rem; max-width: 70ch; }
.section-intro { color: var(--muted); font-size: .86rem; line-height: 1.7; margin: 12px 0 22px; max-width: 80ch; }
.mini-note, .phase-note, .calc-denom { color: var(--muted); font-size: .76rem; line-height: 1.65; }
.phase-note { margin: 12px 0; }
.status-chip { border-radius: 100px; background: var(--soft); color: var(--accent); font-size: .7rem; padding: 5px 10px; font-weight: 700; }
.primary-btn, .ghost-btn, .tab-btn, .milestone-tab { min-height: 44px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; padding: 10px 15px; border: 1px solid var(--line); background: #fff; color: var(--text); font-size: .8rem; font-weight: 750; text-decoration: none; transition: background-color .15s, border-color .15s; }
.primary-btn { background: var(--accent); color: #fff; border-color: var(--accent); }
.primary-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.ghost-btn:hover, .tab-btn:hover { background: var(--soft); border-color: #bdd2c4; }
.danger-btn { color: var(--danger); }
.danger-btn:hover { border-color: #d7a39f; background: #fff3ef; }
input[type="number"], input[type="date"], input[type="text"], select, textarea { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #cbd8ce; background: #fff; color: var(--text); padding: 11px 12px; font-size: .94rem; font-variant-numeric: tabular-nums; }
input:hover, select:hover, textarea:hover { border-color: #92b3a1; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 180px; font-size: .85rem; }
.input-label { display: block; font-size: .78rem; font-weight: 750; margin-bottom: 8px; }
.stats-grid, .phase-grid, .calc-grid, .headline-grid, .graph-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr)); gap: 14px; margin-top: 18px; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card, .calc-card { display: flex; flex-direction: column; gap: 9px; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 17px; background: #fff; }
.stat-card > span, .calc-card > span { color: var(--muted); font-size: .77rem; font-weight: 650; line-height: 1.5; }
.stat-card strong, .calc-card > strong { font-size: 1.5rem; line-height: 1.2; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-card.readonly { background: #f6f8f3; justify-content: space-between; }
#quickOverviewPanel { padding: 0; border: 0; background: transparent; box-shadow: none; }
#quickOverviewPanel .panel-title-row { padding: 0 2px; }
#quickOverviewPanel .stat-card { min-height: 140px; padding: 22px; background: #fff; justify-content: space-between; border-top: 3px solid #8fb7a0; box-shadow: var(--shadow); }
#quickOverviewPanel .stat-card:first-of-type { border-top-color: var(--accent); }
#quickOverviewPanel .stat-card strong { font-size: 2.1rem; }
.overview-key-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 22px 0; }
.overview-key-metrics .calc-card { background: #f7f9f4; border-color: #e4e9df; }
.overview-key-metrics .calc-card strong { font-size: 1.65rem; }
.overview-tabs { display: flex; gap: 8px; margin: 22px 0; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.overview-tabs .tab-btn { border: 0; min-width: 100px; color: var(--muted); background: transparent; }
.overview-tabs .tab-btn.active { background: var(--soft); color: var(--accent); }
.phase-selector { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 22px 0; }
.phase-selector .tab-btn { justify-content: flex-start; text-align: left; font-size: .77rem; min-height: 62px; padding: 12px; background: #f8faf6; }
.phase-selector .tab-btn.active { background: var(--soft); color: var(--accent); border-color: var(--accent); }
.phase-number { width: 25px; height: 25px; border-radius: 8px; display: inline-grid; place-items: center; flex-shrink: 0; background: #e4eade; font-size: .72rem; }
.tab-btn.active .phase-number { background: var(--accent); color: #fff; }
.phase-pane { min-width: 0; }
.phase-pane > h3 { margin: 24px 0 14px; font-size: 1.1rem; }
.entry-status-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f7f9f5; }
.status-pill { flex: 1 1 130px; display: grid; gap: 4px; }
.status-pill span { font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.status-pill strong { font-size: .75rem; font-weight: 750; }
.entry-status-hint { color: var(--muted); font-size: .79rem; margin: 12px 0 20px; line-height: 1.7; }
.entry-input-block { margin-top: 20px; }
.phase1-section { margin-top: 26px; }
.phase-block-head, .entry-input-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.core-grid { background: #f8faf6; border-radius: 14px; padding: 14px; }
.core-grid .stat-card { background: #fff; }
.registration-context { margin-top: 22px; padding-top: 20px; border-top: 1px dashed #d5e0d4; }
.registration-context h4 { color: var(--muted); }
.registration-context .phase-grid { margin-top: 12px; }
.registration-context .readonly { background: transparent; }
.headline-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.headline-card { background: #f5f8f1; }
.headline-card > strong { color: var(--accent); font-size: 1.9rem; }
.headline-card small { color: var(--muted); font-size: .72rem; }
.headline-card small strong { font-size: inherit; font-weight: 650; }
.full-width { grid-column: 1 / -1; }
.phase-more, .analysis-details, .eat-entry { margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; padding: 15px 18px; background: #fafbf8; }
.phase-more > summary, .analysis-details > summary, .eat-entry > summary { cursor: pointer; font-size: .82rem; font-weight: 750; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.phase-more > summary::after, .analysis-details > summary::after, .eat-entry > summary::after { content: "+"; font-size: 1rem; }
.phase-more[open] > summary::after, .analysis-details[open] > summary::after, .eat-entry[open] > summary::after { content: "−"; }
.analysis-details > h3 { margin-top: 22px; }
.analysis-note, .denominator-note { font-size: .77rem; line-height: 1.7; background: #f4f1e4; border-left: 3px solid #b8994c; padding: 12px 14px; color: #645c37; border-radius: 0 8px 8px 0; margin: 16px 0; }
.phase1-matrix-wrap { margin-top: 18px; }
.phase1-matrix-scroll { overflow-x: auto; }
.phase1-matrix { width: 100%; border-collapse: collapse; font-size: .8rem; font-variant-numeric: tabular-nums; }
.phase1-matrix th, .phase1-matrix td { border-bottom: 1px solid var(--line); padding: 12px; text-align: right; }
.phase1-matrix th:first-child { text-align: left; }
.phase1-matrix thead, .phase1-matrix tfoot { background: var(--soft); }
.notice { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px 22px; background: #eef4e2; border: 1px solid #cbdab0; border-radius: 14px; font-size: .82rem; }
.notice p { margin-top: 5px; color: #50603e; max-width: 70ch; }
.notice-warning { background: #fcf5e5; border-color: #e8d4a6; }
.notice-warning p { color: #735a30; }
.validation-list { display: grid; gap: 8px; margin: 16px 0; }
.validation-item { display: block; text-align: left; width: 100%; border: 1px solid #e1b5ab; padding: 12px 14px; font-size: .8rem; background: #fff5f1; color: #923b32; line-height: 1.6; }
.validation-item:hover { background: #fde9e1; }
.has-error { border-color: #c76c5e; background: #fffaf8; }
input[aria-invalid="true"] { border: 2px solid #b65446; }
.field-error, .status-danger, .stability-error { color: var(--danger); }
.field-error { display: block; font-size: .73rem; line-height: 1.65; font-weight: 650; }
.stability-warn { color: #8a682e; }
.stability-ok { color: var(--accent); }
.snapshot-delta-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.snapshot-delta-strip .calc-card { padding: 13px; background: #f8faf6; }
.snapshot-delta-strip strong { font-size: 1.15rem; }
.focus-mode .snapshot-delta-strip, .focus-mode #deltaSnapshotInfo { display: none; }
.delta-pos { color: var(--accent); }
.delta-neg { color: var(--danger); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.view-actions, .report-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0; }
.snapshot-create { border: 1px solid #d4e0c8; border-radius: 14px; background: #f4f8ed; padding: 22px; margin: 22px 0 28px; }
.snapshot-copy p { font-size: .82rem; color: var(--muted); margin-top: 8px; }
.snapshot-form { display: grid; grid-template-columns: minmax(160px, 1fr) auto; gap: 8px 12px; margin-top: 18px; }
.snapshot-form .input-label { grid-column: 1 / -1; margin: 0; }
#savedView > .phase-grid { max-width: 650px; }
#savedView > .phase-grid > .stat-card { padding: 0; border: 0; }
#exportView .report-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 26px; }
#exportView .report-actions button { min-height: 95px; padding: 20px; background: #f7f9f3; font-size: .85rem; }
#exportView .report-actions button:hover { background: var(--soft); border-color: var(--accent); }
.milestone-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; }
.milestone-tab { min-height: 38px; padding: 8px 10px; font-size: .72rem; }
.milestone-tab.active { color: var(--accent); background: var(--soft); border-color: #9cbba8; }
.milestone-pane { display: none; }
.milestone-pane.active { display: grid; gap: 8px; }
.check-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .8rem; }
.check-item input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.milestone-progress { height: 7px; border-radius: 20px; background: #e5ebdf; margin-top: 15px; overflow: hidden; }
.milestone-progress-fill { height: 100%; background: var(--accent); border-radius: inherit; }
.consort-diagram { display: grid; justify-items: stretch; gap: 9px; margin-top: 20px; }
.consort-node { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 10px; font-size: .8rem; background: #f9fbf7; }
.consort-node strong { font-size: 1rem; }
.consort-arrow { text-align: center; color: #809686; }
.consort-branch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.consort-branch .consort-node { flex-direction: column; text-align: center; font-size: .7rem; }
.consort-muted { background: #f7f3eb; }
.flow-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.flow-item { display: flex; justify-content: space-between; gap: 8px; font-size: .77rem; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.graphs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
.graph-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; min-width: 0; }
.graph-card-wide { grid-column: 1 / -1; }
.chart-bars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 14px; margin-top: 22px; }
.chart-col { display: grid; justify-items: center; gap: 9px; }
.chart-col > span { font-size: .68rem; text-align: center; color: var(--muted); }
.chart-col > strong { font-size: .8rem; font-variant-numeric: tabular-nums; }
.chart-bar-wrap { height: 150px; width: 100%; display: flex; align-items: flex-end; border-radius: 8px; background: repeating-linear-gradient(to top,#f0f4eb 0,#f0f4eb 1px,transparent 1px,transparent 25%); border-bottom: 1px solid #d0decb; overflow: hidden; }
.chart-bar { width: 100%; height: 0; background: #2a7b66; border-radius: 6px 6px 0 0; }
.chart-bar-strong { background: #174c3d; }
.chart-bar-soft { background: #89ae93; }
.chart-bar-muted { background: #c2d4b1; }
.funnel-list { display: grid; gap: 17px; margin-top: 25px; }
.funnel-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 30px; gap: 12px; align-items: center; font-size: .73rem; }
.funnel-track { height: 20px; border-radius: 5px; background: #edf2e8; overflow: hidden; }
.funnel-fill { height: 100%; width: 0; border-radius: inherit; background: var(--accent); }
.graph-donut-layout { display: grid; grid-template-columns: 140px 1fr; gap: 24px; align-items: center; margin-top: 25px; }
.graph-donut { width: 140px; aspect-ratio: 1; border-radius: 50%; position: relative; }
.graph-donut::after { content: ""; position: absolute; inset: 27px; background: #fff; border-radius: 50%; }
.graph-legend { display: grid; gap: 13px; }
.legend-row { display: grid; grid-template-columns: 8px 1fr auto; gap: 9px; align-items: center; font-size: .75rem; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-pos { background: #207766; }
.dot-neg { background: #c9dcd5; }
.dot-drop { background: #b29862; }
.trend-bars, .phase-trend-bars { display: grid; grid-template-columns: repeat(auto-fit,minmax(45px,1fr)); align-items: end; gap: 12px; margin-top: 25px; min-height: 180px; }
.trend-col { height: 170px; display: grid; grid-template-rows: 130px 20px 20px; align-items: end; justify-items: center; }
.trend-bar { width: 100%; align-self: end; background: #477f62; border-radius: 6px 6px 0 0; }
.trend-col strong { font-size: .78rem; }
.trend-col > span, .phase-trend-date { font-size: .68rem; color: var(--muted); }
.phase-trend-group { display: grid; gap: 9px; justify-items: center; }
.phase-trend-mini-bars { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; align-items: end; height: 130px; width: 100%; border-bottom: 1px solid var(--line); }
.phase-trend-mini-bar { display: block; border-radius: 4px 4px 0 0; }
.p1 { background: #2a7b66; } .p2 { background: #b6985d; } .p3 { background: #4d789c; } .p4 { background: #ac6c79; }
.progress-wrap { display: flex; align-items: center; gap: 20px; margin-top: 20px; }
.progress-ring { width: 110px; aspect-ratio: 1; border-radius: 50%; position: relative; display: grid; place-items: center; }
.progress-ring::before { content: ""; inset: 12px; background: #fff; position: absolute; border-radius: 50%; }
.progress-ring > div { position: relative; display: grid; text-align: center; }
@media (min-width: 1500px) { .app-main { padding-inline: 60px; } }
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 205px minmax(0,1fr); }
  .app-sidebar { padding-inline: 14px; }
  .app-main { padding-inline: 26px; }
  .hero { align-items: flex-start; }
  .hero-core-status { flex-direction: column; gap: 7px; }
  .hero-core-status > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; }
  .stats-grid, .overview-key-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .phase-selector { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .two-col, .graphs-grid { grid-template-columns: 1fr; }
  .headline-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,190px),1fr)); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .app-sidebar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid #cedbcb; background: #fff; z-index: 50; box-shadow: 0 -5px 22px rgb(24 53 36 / 6%); }
  .sidebar-brand, .sidebar-section-title, .sidebar-footer { display: none; }
  .primary-nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
  .nav-link { min-height: 57px; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 7px 2px; font-size: .64rem; text-align: center; color: #536d5e; }
  .nav-link.active { background: var(--soft); color: var(--accent); box-shadow: none; }
  .nav-link:hover { background: #edf3e8; color: var(--accent); }
  .nav-icon, .nav-icon svg { width: 19px; height: 19px; }
  .app-main { padding: 0 18px calc(105px + env(safe-area-inset-bottom)); }
  .hero { padding: 18px 0; gap: 12px; }
  .hero h1 { font-size: 1.02rem; }
  .hero .kicker { font-size: .55rem; }
  .hero-meta { gap: 8px; }
  .hero-core-status > div:first-child { display: none; }
  .hero-core-status > div { max-width: 170px; }
  .hero-core-status span { display: none; }
  .hero-core-status strong { font-size: .65rem; }
  .hero-tools > summary { padding: 9px 10px; font-size: .68rem; }
  .hero-tools > summary::after { padding-left: 4px; }
  .layout { padding-top: 20px; gap: 19px; }
  .panel { padding: 20px; border-radius: 15px; }
  .workspace-welcome { padding: 4px 0; flex-direction: column; align-items: flex-start; }
  .welcome-copy h2 { font-size: 1.8rem; margin-top: 8px; }
  .welcome-copy p:last-child { font-size: .8rem; }
  .section-intro { font-size: .8rem; }
  .stats-grid { gap: 10px; }
  #quickOverviewPanel .stat-card { padding: 17px; min-height: 125px; }
  #quickOverviewPanel .stat-card strong { font-size: 1.85rem; }
  .stat-card > span, .calc-card > span { font-size: .72rem; }
  .overview-key-metrics { gap: 10px; }
  .overview-key-metrics .calc-card { padding: 14px; }
  .overview-key-metrics .calc-card strong { font-size: 1.4rem; }
  .entry-status-bar { padding: 12px; gap: 12px; }
  .entry-status-bar .status-pill { flex-basis: calc(50% - 12px); }
  .entry-status-bar .status-pill:nth-child(4) { display: none; }
  #saveNextPhaseBtn { flex: 1 1 180px; }
  .phase-selector .tab-btn { font-size: .71rem; padding: 10px; min-height: 60px; }
  .core-grid { padding: 10px; gap: 10px; }
  .phase-grid, .headline-grid { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .overview-key-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .phase-grid .stat-card { padding: 14px; }
  input[type="number"], input[type="date"], input[type="text"], select, textarea { font-size: 16px; }
  .headline-card { padding: 18px; }
  .headline-card > strong { font-size: 1.8rem; }
  .notice { align-items: flex-start; flex-direction: column; padding: 17px; }
  .notice .view-actions { margin: 0; }
  .snapshot-create { padding: 17px; }
  .snapshot-form { grid-template-columns: 1fr; }
  .snapshot-form .primary-btn { margin-top: 4px; }
  .snapshot-delta-strip { grid-template-columns: 1fr; }
  #exportView .report-actions { grid-template-columns: 1fr; }
  #exportView .report-actions button { min-height: 70px; }
  .graph-card { padding: 16px; }
  .graph-donut-layout { grid-template-columns: 1fr; justify-items: center; }
  .graph-legend { width: 100%; }
  .chart-bars { gap: 9px; }
  .chart-bar-wrap { height: 125px; }
  .graph-card-wide { grid-column: auto; }
  .funnel-row { grid-template-columns: 70px minmax(0,1fr) 25px; gap: 8px; }
  .phase1-matrix th, .phase1-matrix td { padding: 10px 7px; font-size: .72rem; }
}
@media (max-width: 380px) {
  .app-main { padding-inline: 12px; }
  .panel { padding: 16px; }
  .hero-core-status { display: none; }
  .calc-grid { grid-template-columns: 1fr; }
  .overview-key-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .phase-selector { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
@media print {
  body { background: #fff; color: #111; }
  .app-shell { display: none; }
  .print-report { display: block !important; white-space: pre-wrap; font: 11pt/1.5 sans-serif; padding: 12mm; }
}
