:root {
  --ink: #18232f;
  --muted: #6c7784;
  --line: #e5e9ed;
  --paper: #f5f7f8;
  --card: #ffffff;
  --nav: #12222a;
  --nav-soft: #21343c;
  --accent: #e65c3a;
  --accent-soft: #fff0eb;
  --blue: #316ca6;
  --blue-soft: #eaf2f9;
  --green: #27806d;
  --green-soft: #e5f3ef;
  --amber: #a86f17;
  --amber-soft: #fff5df;
  --red: #b44439;
  --red-soft: #faeae8;
  --shadow: 0 10px 28px rgba(20, 33, 42, .07);
}

* { box-sizing: border-box; }
body { margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink); font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
button, input, select { font: inherit; }
button, label.file-button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--nav); color: #fff; padding: 28px 18px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; font-weight: 800; letter-spacing: -.04em; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 15px; }
.brand span { margin-top: 3px; color: #95a5ad; font-size: 12px; letter-spacing: .04em; }
nav { display: grid; gap: 7px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #aebbc1; padding: 12px 13px; border-radius: 10px; text-align: left; display: flex; gap: 12px; align-items: center; }
.nav-item span { font-size: 11px; opacity: .6; }
.nav-item:hover { background: var(--nav-soft); color: #fff; }
.nav-item.active { background: #fff; color: var(--nav); font-weight: 700; }
.nav-item.active span { color: var(--accent); opacity: 1; }
.export-image-button { background: #ffe8ec; color: #a43d52; border-color: #ffcbd4; box-shadow: none; }
.export-image-button:hover { background: #ffdce3; color: #8e3046; border-color: #f5aebe; }
.export-image-button:disabled { opacity: .65; cursor: wait; }
.sidebar-note { margin-top: auto; padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.1); color: #d8e0e4; font-size: 13px; line-height: 1.6; }
.sidebar-note small { color: #8fa0a8; }
.status-dot { display: inline-block; width: 8px; height: 8px; background: #58c59d; border-radius: 50%; margin-right: 7px; }
.workspace { min-width: 0; padding: 34px 38px 56px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; font-weight: 700; }
h1 { margin: 7px 0 6px; font-size: 29px; letter-spacing: -.03em; }
h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 15px; }
.topbar p { margin: 0; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.button, .file-button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 9px; padding: 9px 14px; font-size: 13px; font-weight: 700; box-shadow: 0 2px 8px rgba(20,33,42,.04); }
.button:hover, .file-button:hover { border-color: #bdc7cd; }
.button.ghost { color: var(--muted); background: transparent; box-shadow: none; }
.file-button input { display: none; }
.kpi-strip { display: none; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin: 28px 0 20px; }
.kpi-strip.is-visible { display: grid; }
.kpi-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.kpi-card label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 9px; }
.kpi-card p { color: var(--muted); margin: 7px 0 0; font-size: 12px; }
.money-input { display: flex; align-items: center; gap: 4px; color: var(--ink); font-size: 22px; font-weight: 800; }
.money-input input { width: 100%; border: 0; border-bottom: 1px dashed #cdd5da; outline: 0; color: var(--ink); background: transparent; font-size: 22px; font-weight: 800; padding: 0 0 3px; }
.view { display: grid; gap: 18px; margin-top: 24px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.panel-head .tag { flex: none; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.mini-stat { padding: 13px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.mini-stat:last-child { border-bottom: 0; }
.mini-stat span { color: var(--muted); font-size: 13px; }
.mini-stat strong { font-size: 18px; }
.tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 700; color: var(--blue); background: var(--blue-soft); }
.tag.good { color: var(--green); background: var(--green-soft); }
.tag.warn { color: var(--amber); background: var(--amber-soft); }
.tag.risk { color: var(--red); background: var(--red-soft); }
.bar-list { display: grid; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 118px 1fr 82px; gap: 12px; align-items: center; font-size: 12px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 9px; background: #eef1f3; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--blue); }
.bar-fill.accent { background: var(--accent); }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.timeline { display: grid; grid-template-columns: repeat(31, minmax(5px, 1fr)); gap: 2px; align-items: end; min-height: 155px; padding-top: 10px; }
.day-column { display: grid; gap: 5px; align-content: end; text-align: center; min-width: 0; }
.day-bar { width: 100%; min-height: 8px; border-radius: 4px 4px 2px 2px; background: var(--accent); }
.day-column small { font-size: 9px; color: var(--muted); }
.timeline-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.legend-item::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); margin-right: 6px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; vertical-align: middle; }
th { color: var(--muted); font-weight: 700; background: #fafbfc; position: sticky; top: 0; z-index: 1; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.roi-matrix { min-width: 0; table-layout: fixed; }
.roi-matrix th:first-child { width: 80px; }
.roi-matrix th:not(:first-child) { text-align: right; min-width: 0; }
.roi-matrix .roi-value { font-size: 18px; font-weight: 700; padding-top: 15px; padding-bottom: 15px; }
.roi-matrix .roi-value.best { color: var(--green); background: var(--green-soft); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfd; }
.cell-input { width: 100px; border: 1px solid transparent; border-bottom-color: #cbd3d8; background: transparent; padding: 6px 5px; text-align: right; border-radius: 5px 5px 0 0; font-variant-numeric: tabular-nums; }
.cell-input:hover, .cell-input:focus { border-color: #bdc7cd; background: #fff; outline: 0; }
.cell-input.text { width: 170px; text-align: left; }
.cell-input.date { width: 128px; text-align: left; }
.select-input { border: 1px solid #cbd3d8; background: #fff; border-radius: 7px; padding: 6px 8px; min-width: 150px; }
.progress { width: 92px; height: 7px; border-radius: 99px; overflow: hidden; background: #e9edef; display: inline-block; vertical-align: middle; }
.progress > span { display: block; height: 100%; background: var(--green); }
.progress.over > span { background: var(--red); }
.subtle { color: var(--muted); }
.hero-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.hero-number { font-size: 38px; font-weight: 800; letter-spacing: -.04em; margin: 8px 0 2px; }
.hero-caption { color: var(--muted); font-size: 12px; }
.decision-list { display: grid; gap: 10px; margin-top: 13px; }
.decision { display: grid; grid-template-columns: 8px 1fr; gap: 10px; align-items: start; font-size: 13px; line-height: 1.55; }
.decision::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 7px; }
.cycle-chart { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: end; min-height: 220px; padding-top: 20px; }
.cycle { display: grid; gap: 8px; align-content: end; text-align: center; }
.cycle-bars { height: 145px; display: flex; justify-content: center; align-items: end; gap: 7px; }
.cycle-bar { width: 28px; border-radius: 5px 5px 2px 2px; background: var(--blue); position: relative; min-height: 6px; }
.cycle-bar.roi { background: var(--accent); }
.cycle strong { font-size: 12px; }
.cycle small { color: var(--muted); font-size: 11px; }
.empty-state { text-align: center; padding: 36px; color: var(--muted); }
.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 13px 15px; border-radius: 0 10px 10px 0; font-size: 12px; line-height: 1.65; color: #5f372d; }
#toast { position: fixed; right: 24px; bottom: 24px; background: var(--nav); color: #fff; padding: 11px 15px; border-radius: 9px; font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; box-shadow: var(--shadow); }
#toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 16px 18px; }
  .brand { padding-bottom: 14px; }
  nav { display: flex; overflow-x: auto; }
  .nav-item { width: auto; white-space: nowrap; }
  .sidebar-note { display: none; }
  .workspace { padding: 24px 20px 44px; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .two-col, .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1220px) and (min-width: 981px) {
  .kpi-strip { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 620px) {
  .topbar { display: grid; }
  .top-actions { justify-content: flex-start; }
  .kpi-strip, .three-col { grid-template-columns: 1fr; }
  .workspace { padding: 20px 14px 40px; }
  h1 { font-size: 24px; }
  .timeline { gap: 1px; }
  .day-column small { display: none; }
}

/* Interactive ROI decision flow */
.decision-flow { display: grid; grid-template-columns: minmax(250px, .82fr) minmax(360px, 1.45fr) minmax(270px, 1fr); gap: 16px; align-items: stretch; }
.flow-panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.step-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 13px; }
.step-label span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--nav); font-size: 11px; }
.scenario-options { display: grid; gap: 8px; margin: 14px 0 18px; }
.scenario-option { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 11px 12px; text-align: left; color: var(--ink); transition: border-color .15s, background .15s, transform .15s; }
.scenario-option:hover { border-color: #b8c4ca; transform: translateY(-1px); }
.scenario-option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.scenario-option span, .scenario-option small { display: block; }
.scenario-option span { font-size: 13px; font-weight: 800; }
.scenario-option small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.field-label { display: block; color: var(--muted); font-size: 11px; font-weight: 700; margin-bottom: 6px; }
.input-panel .select-input { width: 100%; min-width: 0; }
.locked-input { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.locked-input span, .locked-input small, .locked-input strong { display: block; }
.locked-input span { color: var(--muted); font-size: 11px; }
.locked-input strong { margin: 4px 0 2px; font-size: 19px; }
.locked-input small { color: var(--muted); font-size: 11px; }
.output-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.output-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.output-roi { color: var(--accent); font-size: 38px; line-height: 1; letter-spacing: -.04em; }
.output-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 19px 0 7px; }
.output-metrics > div { padding: 11px 10px; background: #f7f9fa; border-radius: 9px; }
.output-metrics span, .output-metrics strong, .output-metrics small { display: block; }
.output-metrics span, .output-metrics small { color: var(--muted); font-size: 10px; }
.output-metrics strong { margin: 4px 0 2px; font-size: 17px; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.roi-spark { width: 100%; height: auto; display: block; overflow: visible; }
.roi-spark text { fill: var(--muted); font-size: 9px; }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.chart-point.active { fill: var(--accent); }
.judgment-panel { position: relative; overflow: hidden; }
.judgment-panel::after { content: ""; position: absolute; width: 110px; height: 110px; border-radius: 50%; right: -45px; top: -45px; background: var(--blue-soft); opacity: .7; }
.judgment-panel.good::after { background: var(--green-soft); }
.judgment-panel.risk::after { background: var(--amber-soft); }
.judgment-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; margin-bottom: 11px; }
.judgment-panel.good .judgment-badge { color: var(--green); background: var(--green-soft); }
.judgment-panel.risk .judgment-badge { color: var(--amber); background: var(--amber-soft); }
.judgment-panel h2 { line-height: 1.45; max-width: 90%; }
.judgment-panel > p { color: var(--muted); font-size: 12px; line-height: 1.65; margin: 10px 0 15px; }
.evidence-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.evidence-grid span, .evidence-grid strong { display: block; }
.evidence-grid span { color: var(--muted); font-size: 10px; }
.evidence-grid strong { margin-top: 3px; font-size: 15px; }
.use-note { display: grid; gap: 4px; margin-top: 13px; font-size: 11px; line-height: 1.55; }
.use-note span { color: var(--muted); }
.overall-judgment { display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: start; border-left: 3px solid var(--green); background: var(--green-soft); color: #245a4e; padding: 14px 16px; border-radius: 0 10px 10px 0; font-size: 12px; line-height: 1.65; }
.comparison-panel { box-shadow: none; }
.table-scenario, .stage-link { border: 0; background: transparent; color: inherit; padding: 0; }
.table-scenario { width: 100%; text-align: right; }
.stage-link { text-align: left; }
.stage-link strong, .stage-link span { display: block; }
.stage-link span { color: var(--muted); font-size: 10px; margin-top: 2px; }
.active-row td { box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.roi-matrix .selected-column { background-color: var(--accent-soft); }
.roi-matrix .best.selected-column { background: linear-gradient(90deg, var(--accent-soft), var(--green-soft)); }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; }
.method-grid section { padding: 16px 0; border-top: 2px solid var(--line); }
.method-index { color: var(--accent); font-size: 11px; font-weight: 800; }
.method-grid h3 { margin: 7px 0 9px; }
.method-grid p { margin: 5px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
@media (max-width: 1280px) {
  .decision-flow { grid-template-columns: minmax(240px, .8fr) minmax(360px, 1.2fr); }
  .judgment-panel { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .decision-flow, .method-grid { grid-template-columns: 1fr; }
  .judgment-panel { grid-column: auto; }
  .output-metrics { grid-template-columns: 1fr; }
  .overall-judgment { grid-template-columns: 1fr; }
}

/* Eight-week channel reference */
.money-input.compact { font-size: 17px; line-height: 1.35; }
.reference-controls { display: grid; grid-template-columns: 150px minmax(170px, 220px) minmax(160px, 200px) 1fr; gap: 12px; align-items: end; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); }
.reference-controls.summary-controls { grid-template-columns: 150px minmax(170px, 1fr) minmax(160px, 220px); }
.control-block label { display: block; color: var(--muted); font-size: 11px; font-weight: 700; margin-bottom: 6px; }
.control-block .select-input { width: 100%; min-width: 0; }
.metric-control { justify-self: end; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 3px; background: #f7f9fa; }
.segmented button { border: 0; background: transparent; color: var(--muted); padding: 7px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.segmented button:hover { color: var(--ink); }
.segmented button.active { background: var(--nav); color: #fff; }
.reference-panel { padding: 0; overflow: hidden; }
.reference-panel .panel-head { padding: 20px 20px 0; }
.wide-table-wrap { overflow: auto; max-width: 100%; border-top: 1px solid var(--line); }
.reference-table { min-width: 880px; }
.reference-table.all-metrics { min-width: 2450px; }
.reference-table th, .reference-table td { white-space: nowrap; }
.reference-table th { position: sticky; top: 0; z-index: 3; }
.reference-table th:first-child, .reference-table td:first-child { position: sticky; left: 0; z-index: 2; background: #fff; }
.reference-table th:first-child { z-index: 4; background: #fafbfc; }
.reference-table td.dimension { font-weight: 600; }
.reference-table tbody tr:hover td { background: var(--blue-soft); }
.reference-table tbody tr:hover td:first-child { background: var(--blue-soft); }
.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.source-grid section { padding: 16px; background: #f8fafb; border-radius: 10px; }
.source-grid h3 { margin: 8px 0; }
.source-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.definition-list { display: grid; gap: 0; margin-top: 18px; border-top: 1px solid var(--line); }
.definition-list > div { display: grid; grid-template-columns: 90px 1fr; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.6; }
.definition-list span { color: var(--muted); }
@media (max-width: 1120px) {
  .reference-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-control { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 720px) {
  .reference-controls, .source-grid { grid-template-columns: 1fr; }
  .metric-control { grid-column: auto; }
  .segmented { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .segmented button { padding-inline: 5px; }
}

/* Nine-day mixed-pool calculator */
.plan-inputs { display: grid; grid-template-columns: minmax(205px, 1.25fr) repeat(4, minmax(125px, 1fr)) auto; gap: 14px; align-items: end; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.plan-input-title h2 { margin: 3px 0; }
.plan-input-title p { margin: 0; color: var(--muted); font-size: 11px; }
.plan-inputs > label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.plan-inputs > label strong { color: var(--ink); font-size: 18px; }
.plan-inputs > label small { font-weight: 400; }
.plan-inputs input[type="range"] { width: 100%; accent-color: var(--accent); }
.number-input { width: 100%; border: 1px solid #cbd3d8; background: #fff; color: var(--ink); border-radius: 7px; padding: 8px 9px; font-size: 14px; }
.inline-input { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px; }
.inline-input b { color: var(--ink); font-size: 14px; }
.plan-apply { align-self: end; min-height: 38px; background: var(--nav); color: #fff; border-color: var(--nav); }
.month-archive { display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; align-items: center; margin-bottom: 18px; padding: 14px 18px; border: 1px solid #eadde4; border-radius: 14px; background: linear-gradient(90deg,#fff8fb,#fbf8ff); box-shadow: var(--shadow); }
.month-archive-main, .month-archive-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.month-archive-main label { color: var(--muted); font-size: 11px; font-weight: 800; }
.month-archive-main .select-input { min-width: 132px; }
.month-archive-actions { justify-content: flex-end; }
.month-archive-actions .button { min-height: 36px; }
.archive-status, .archive-version { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.archive-status.final { color: #236f5d; background: #e4f5ef; }
.archive-status.draft { color: #8d6414; background: #fff2cf; }
.archive-status.archived { color: #65717b; background: #edf0f2; }
.archive-version { color: #6f5362; background: #f3e9ee; }
.archive-message { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; }
.archive-message.success { color: #2f8c6f; }
.archive-message.error { color: #b84e42; }
@media (max-width: 900px) {
  .month-archive { grid-template-columns: 1fr; }
  .month-archive-actions { justify-content: flex-start; }
}
.plan-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.plan-summary article { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.plan-summary span, .plan-summary strong, .plan-summary small { display: block; }
.plan-summary span { color: var(--muted); font-size: 11px; }
.plan-summary strong { margin: 7px 0 4px; font-size: 20px; }
.plan-summary small { color: var(--muted); font-size: 10px; }
.plan-formula { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 13px 15px; background: var(--blue-soft); color: #264f75; border-left: 3px solid var(--blue); border-radius: 0 9px 9px 0; font-size: 12px; line-height: 1.6; }
.plan-table { min-width: 980px; }
.plan-table th:first-child, .plan-table td:first-child { min-width: 82px; }
.dashboard-note { padding: 12px 14px; background: var(--blue-soft); border-left: 3px solid var(--blue); color: #264f75; font-size: 12px; }
.dashboard-section { overflow: hidden; }
.dashboard-title { display: inline-block; min-width: 185px; padding: 9px 16px; background: #fff4cf; color: #f05d43; font-weight: 700; }
.dashboard-title-row { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding-right: 18px; }
.dashboard-title-row p { margin: 6px 16px 12px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.channel-override-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.channel-override-actions span { color: var(--muted); font-size: 11px; }
.channel-override-actions .button { white-space: nowrap; }
.plan-panel-tools { display: grid; justify-items: end; gap: 10px; }
.dashboard-table { min-width: 740px; }
.dashboard-table thead th { background: #dfe9ff; color: #253449; text-align: center; }
.dashboard-table td { text-align: center; }
.dashboard-table tfoot td { background: #f5f7f9; font-weight: 700; border-top: 1px solid var(--line); }
.completion-meter { position: relative; min-width: 112px; height: 28px; overflow: hidden; background: #edf1f3; border-radius: 4px; display: grid; place-items: center; }
.completion-meter > span { position: absolute; inset: 0 auto 0 0; background: #88d777; }
.completion-meter > strong { position: relative; z-index: 1; font-weight: 700; }
.plan-judgment { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; background: var(--green-soft); border-left: 3px solid var(--green); color: #245a4e; font-size: 12px; line-height: 1.65; }
.plan-judgment strong { flex: none; }
.channel-budget-table { min-width: 1560px; }
.channel-budget-table .override-cell { background: #fffaf0; }
.channel-override-input { width: 118px; border: 1px solid #cbd3d8; background: #fff; color: var(--ink); border-radius: 7px; padding: 7px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.channel-override-input::placeholder { color: #9aa5ad; }
.channel-override-input:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.channel-override-note { padding: 11px 16px; border-top: 1px solid var(--line); background: #fffaf0; color: #765c2b; font-size: 11px; line-height: 1.6; }
.phase-tabs { display: inline-flex; gap: 4px; padding: 4px; width: max-content; background: #e9eef2; border-radius: 10px; }
.phase-tabs button { border: 0; background: transparent; color: var(--muted); border-radius: 7px; padding: 9px 18px; font-size: 13px; font-weight: 700; }
.phase-tabs button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 5px rgba(20, 33, 42, .09); }
.schedule-upload-panel { display: grid; grid-template-columns: minmax(300px, 1fr) auto; gap: 18px 28px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.schedule-upload-copy { display: flex; align-items: flex-start; gap: 12px; }
.schedule-upload-copy h2 { margin: 0 0 5px; }
.schedule-upload-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.schedule-upload-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 9px; }
.schedule-file-button { background: #f7dce4; border-color: #edbdca; color: #a83d5c; }
.schedule-file-button input { display: none; }
.schedule-status { flex-basis: 100%; color: var(--muted); font-size: 11px; text-align: right; }
.schedule-status.error, .schedule-diff { color: #b84e42; font-weight: 700; }
.schedule-same, .schedule-summary .ok { color: #2f8c6f; font-weight: 700; }
.schedule-summary .warn { color: #d05c43; }
.schedule-paste { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line); }
.schedule-paste summary { color: var(--muted); font-size: 12px; font-weight: 700; }
.schedule-paste textarea { width: 100%; min-height: 96px; margin: 12px 0 9px; border: 1px solid #cbd3d8; border-radius: 8px; padding: 10px 12px; resize: vertical; color: var(--ink); font: inherit; }
.schedule-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.schedule-summary article { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.schedule-summary span, .schedule-summary strong, .schedule-summary small { display: block; }
.schedule-summary span, .schedule-summary small { color: var(--muted); font-size: 11px; }
.schedule-summary strong { margin: 7px 0 4px; font-size: 20px; }
.recovery-table { min-width: 1540px; }
.recovery-table .subtotal-row td { background: #f5f7f9; font-weight: 700; border-top: 1px solid #cfd6dc; }
.recovery-table .roi-low { color: var(--blue); font-weight: 700; }
.channel-target-table th:first-child, .channel-target-table td:first-child,
.recovery-table th:first-child, .recovery-table td:first-child { width: 92px; min-width: 92px; max-width: 92px; left: 0; }
.channel-target-table th:nth-child(2), .channel-target-table td:nth-child(2),
.recovery-table th:nth-child(2), .recovery-table td:nth-child(2) { position: sticky; left: 92px; z-index: 2; width: 124px; min-width: 124px; max-width: 124px; background: var(--card); }
.channel-target-table th:nth-child(2), .recovery-table th:nth-child(2) { z-index: 4; background: #fafbfc; }
.channel-target-table tbody tr:hover td:nth-child(2), .recovery-table tbody tr:hover td:nth-child(2) { background: var(--blue-soft); }
.recovery-table .subtotal-row td:nth-child(2), .recovery-table tfoot td:nth-child(2) { background: #f5f7f9; }
.channel-target-table th:nth-child(2), .channel-target-table td:nth-child(2),
.recovery-table th:nth-child(2), .recovery-table td:nth-child(2) { box-shadow: 1px 0 0 var(--line); }
@media (max-width: 1180px) {
  .plan-inputs { grid-template-columns: repeat(3, 1fr); }
  .plan-input-title { grid-column: 1 / -1; }
  .plan-summary { grid-template-columns: repeat(3, 1fr); }
  .plan-apply { width: 100%; }
  .dashboard-title-row { align-items: flex-start; }
  .reference-panel .panel-head { flex-wrap: wrap; }
  .plan-panel-tools { justify-items: start; width: 100%; }
  .channel-override-actions { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .plan-inputs, .plan-summary { grid-template-columns: 1fr; }
  .plan-input-title { grid-column: auto; }
  .plan-formula { grid-template-columns: 1fr; }
  .dashboard-title-row { display: block; padding-right: 0; }
  .channel-override-actions { justify-content: flex-start; padding: 0 16px 14px; }
  .schedule-upload-panel { grid-template-columns: 1fr; }
  .schedule-upload-actions { justify-content: flex-start; }
  .schedule-status { text-align: left; }
  .schedule-summary { grid-template-columns: 1fr; }
}
[hidden]{display:none!important}.portal-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:20px;margin:20px 0}.portal-card{display:block;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:26px;color:var(--ink);text-decoration:none;box-shadow:var(--shadow)}a.portal-card:hover{border-color:var(--accent)}.portal-card h2{margin:16px 0;font-size:25px}.portal-card p{color:var(--muted);line-height:1.8}.portal-card strong{color:var(--blue)}.portal-tools{display:flex;flex-wrap:wrap;align-items:center;gap:16px}.portal-tools label{display:flex;align-items:center;gap:8px}
.portal-standalone .sidebar{display:none}.portal-standalone .app-shell{display:block}.portal-standalone .workspace{max-width:1280px;margin:auto;padding:48px 32px}.portal-entry{padding:48px;min-height:230px}.portal-entry h2{font-size:32px}.portal-upload-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin:24px 0}.portal-file-label{display:block;border:1px dashed var(--blue);border-radius:12px;padding:24px;margin-top:18px}.portal-standalone .topbar a{ text-decoration:none }@media(max-width:700px){.portal-upload-grid{grid-template-columns:1fr}.portal-standalone .workspace{padding:24px 16px}}

.plan-summary { grid-template-columns:repeat(auto-fit,minmax(175px,1fr)); }
.day-drilldown{border:0;background:none;color:#dc5944;text-align:left;font:inherit;cursor:pointer;padding:0}.day-drilldown:hover{text-decoration:underline}.filter-scope{font-size:13px;color:#5c6b75;align-self:center}.source-grid p{line-height:1.8}.definition-list span{line-height:1.8}.reference-table th{white-space:nowrap}.button:disabled{opacity:.4;cursor:default}#dayDetails{scroll-margin-top:24px}
.view{grid-template-columns:minmax(0,1fr);min-width:0}.view>*{min-width:0}.wide-table-wrap{min-width:0;max-width:100%;overflow-x:auto}.dashboard-note{white-space:normal;line-height:1.7}.overview-cards{grid-template-columns:repeat(4,minmax(0,1fr))}#copyMonth,#saveFinal{display:none}.overview-cards strong{font-size:24px}@media(max-width:720px){.overview-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.overview-cards article{padding:13px}.overview-cards strong{font-size:21px}.month-archive{padding:10px 14px}.brand{padding-bottom:8px}.sidebar{padding-top:12px;padding-bottom:12px}}
@media(max-width:980px){.app-shell{grid-template-columns:minmax(0,1fr)}.sidebar{min-width:0}.workspace{min-width:0;max-width:100%}}
@media(max-width:720px){.reference-controls.summary-controls{display:flex;flex-wrap:wrap;gap:12px}.filter-scope{flex:1 1 100%}.reference-controls .control-block{min-width:0;flex:1 1 150px}}
.selection-cards{grid-template-columns:repeat(3,minmax(0,1fr))}.roi-profitable{color:#23775d}.roi-deficit{color:#bb4635}@media(max-width:720px){.selection-cards{grid-template-columns:1fr}.selection-cards article{display:grid;grid-template-columns:1fr auto;gap:4px 12px}.selection-cards strong{grid-column:2;grid-row:1/3;margin:0}.selection-cards small{font-size:11px}}
.overview-cards{grid-template-columns:repeat(auto-fit,minmax(175px,1fr))}@media(max-width:720px){.overview-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.overview-cards article:last-child{grid-column:1/-1}}
#budgetComparison{min-width:0;display:grid;gap:12px}#budgetComparison .dashboard-table tbody tr:last-child{background:#fff8df;font-weight:600}.comparison-note{font-size:12px}.completion-meter{min-width:92px}
