:root { color-scheme: light; --teal: #18b8a8; --deep: #116f68; --ink: #10201f; --muted: #667878; --line: #d6e4e1; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #eef4f2; color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { display: grid; grid-template-columns: minmax(0, 1fr) 350px; column-gap: 20px; width: min(100%, 1600px); min-height: 100vh; margin: auto; padding-bottom: 24px; background: #fbfffe; box-shadow: 0 10px 36px #153d3d14; }
.topbar { grid-column: 1 / -1; height: 76px; display: flex; align-items: center; gap: 14px; padding: 12px 24px; color: white; background: #137d73; }
.topbar h1, .topbar p { margin: 0; }
.topbar h1 { font-size: 20px; }
.eyebrow { font-size: 12px; opacity: .8; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #ffffff2b; color: white; font-size: 26px; }
.company-setup { grid-column: 1; padding: 20px 24px 4px; }
.setup-head, .composer-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.setup-head strong, .composer-title strong { font-size: 15px; }
.setup-fields, .project-actions, .summary-grid, .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.setup-fields { grid-template-columns: 1.4fr 1fr; }
.setup-fields label { color: var(--muted); }
.setup-fields input { color: var(--ink); background: white; border-color: var(--line); }
.allocation-note { min-height: 18px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.project-actions { grid-column: 2; align-self: start; padding: 20px 24px 0 0; }
.summary-grid { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 220px)); padding: 16px 24px 8px; }
.summary-grid article { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.summary-grid span { display: block; color: var(--muted); font-size: 13px; }
.summary-grid strong { display: block; margin-top: 4px; font-size: 24px; font-variant-numeric: tabular-nums; }
.tabs { grid-column: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px 0 8px 24px; }
.tab { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--muted); }
.tab.active { color: white; border-color: var(--deep); background: var(--deep); }
.panel { grid-column: 1; margin: 8px 0 8px 24px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.view { display: none; }
.view.active { display: block; }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 12px; }
.panel-head h2, .panel-head p { margin: 0; }
.panel-head h2 { font-size: 18px; }
.panel-head p { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.flow-tools { display: flex; gap: 4px; flex-shrink: 0; }
.flow-tools .ghost { min-height: 34px; padding: 0 9px; }
.flow-tools .icon-tool { width: 34px; padding: 0; font-size: 21px; line-height: 1; }
.ghost, .primary { min-height: 40px; padding: 0 14px; border: 0; border-radius: 8px; white-space: nowrap; }
.ghost { color: var(--deep); background: #eaf8f5; }
.primary { color: white; background: var(--deep); }
.ghost.danger { color: #b42318; }
.flow-stage { height: min(70vh, 740px); min-height: 460px; border: 1px solid var(--line); border-radius: 8px; background: #f7fcfb; overflow: auto; scrollbar-color: #b6d8d0 #eff7f5; touch-action: pan-x pan-y; }
.flow-graph { display: block; max-width: none; font-family: inherit; }
.graph-node rect { fill: white; stroke: #9bbab4; stroke-width: 1.5; }
.graph-node text { fill: var(--ink); font-size: 13px; font-weight: 600; }
.graph-node .node-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.flow-date { fill: var(--deep); font-size: 12px; font-weight: 700; }
.edge-label { font-size: 12px; font-weight: 700; paint-order: stroke; stroke: #f7fcfb; stroke-width: 5px; stroke-linejoin: round; }
.special-label-box { fill: #fff; stroke: #ba542a; stroke-width: 1.5; }
.flow-light { fill: none; stroke: #c8fff4; stroke-width: 2.8; stroke-linecap: round; stroke-dasharray: 4 96; animation: flow-light-run 2.8s linear infinite; pointer-events: none; }
.flow-light-box { animation-duration: 3.4s; }
@keyframes flow-light-run { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -100; } }
.legend { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 12px; color: var(--muted); font-size: 12px; }
.dot { display: inline-block; width: 9px; height: 9px; margin-right: 4px; border-radius: 50%; }
.dot.add { background: #2563eb; }
.dot.accepted { background: #16805c; }
.dot.rejected { background: #d42e35; }
.dot.reduce { background: #202a30; }
.dash-mark { display: inline-block; width: 14px; height: 0; margin: 0 4px 3px 0; border-top: 2px dashed #667878; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.note-alert { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 7px; border-radius: 50%; color: #fff; background: #c62727; font-size: 13px; font-weight: 800; vertical-align: 1px; }
.timeline li:first-child { border-top: 0; }
.year { color: var(--deep); font-size: 12px; font-weight: 700; }
.event-title { margin: 0; font-size: 15px; font-weight: 700; }
.event-meta, .event-note { margin: 4px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.event-detail { margin: 5px 0 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.recognition-tag { display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 4px; color: var(--deep); background: #e6f5f1; font-size: 11px; }
.recognition-tag.no { color: #a43a31; background: #fcebea; }
.row-actions { display: flex; gap: 14px; margin-top: 8px; }
.row-actions button, .remove-holder, .text-button { padding: 4px 0; border: 0; background: transparent; color: var(--deep); font-size: 13px; }
.row-actions button:last-child, .remove-holder { color: #b42318; }
.holder-list { display: grid; gap: 10px; }
.holder { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.holder > span:not(.holder-details) { font-weight: 700; }
.holder-details { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.remove-holder { grid-column: 1 / -1; justify-self: end; }
.composer { grid-column: 2; grid-row: 4 / span 2; align-self: start; margin: 8px 24px 18px 0; padding: 16px; border-radius: 8px; background: #102c29; color: white; }
.composer .text-button { color: #8ce8db; }
.form-row { margin-top: 10px; }
.form-row[hidden] { display: none; }
.wide-field { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: #ffffffbc; font-size: 13px; }
input, select, textarea { width: 100%; min-width: 0; min-height: 42px; padding: 0 10px; border: 1px solid #ffffff29; border-radius: 8px; color: white; background: #ffffff15; }
select option { color: var(--ink); }
input:disabled { opacity: .45; }
.recognition-field { display: flex; margin: 12px 0 0; padding: 0; border: 0; }
.recognition-field[hidden] { display: none; }
.recognition-field.disabled { opacity: .4; cursor: not-allowed; }
.recognition-field legend { margin-bottom: 6px; color: #ffffffbc; font-size: 13px; }
.recognition-field label { display: flex; align-items: center; justify-content: center; width: 50%; min-height: 38px; border: 1px solid #ffffff4d; }
.recognition-field label:first-of-type { border-radius: 6px 0 0 6px; }
.recognition-field label:last-of-type { border-left: 0; border-radius: 0 6px 6px 0; }
.recognition-field label:has(input:checked) { color: white; background: var(--deep); }
.recognition-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.note-field { margin-top: 12px; }
.manual-basis { margin-top: 12px; }
.manual-basis[hidden] { display: none; }
textarea { min-height: 70px; padding: 10px; resize: vertical; }
.cancel-edit { margin-top: 10px; }
.empty-state { margin: 0; padding: 22px 12px; color: var(--muted); font-size: 14px; text-align: center; }
.flow-stage > .empty-state { margin: auto; }
.toast { position: fixed; left: 50%; bottom: 20px; z-index: 5; padding: 10px 14px; border-radius: 8px; color: white; background: #10201fee; opacity: 0; transform: translate(-50%, 80px); transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.confirm-dialog { width: min(400px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; box-shadow: 0 24px 64px #10201f30; }
.confirm-dialog::backdrop { background: #10201f66; }
.confirm-dialog h2 { margin: 0 0 10px; font-size: 18px; }
.confirm-dialog p { margin: 0; color: var(--muted); line-height: 1.5; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
@media (max-width: 900px) { .app-shell { grid-template-columns: minmax(0, 1fr); } .topbar, .company-setup, .project-actions, .summary-grid, .tabs, .panel, .composer { grid-column: 1; } .project-actions { padding: 8px 24px 0; } .tabs { padding-right: 24px; } .panel { margin-right: 24px; } .composer { grid-row: auto; margin: 8px 24px 18px; } }
@media (prefers-reduced-motion: reduce) { .flow-light { animation: none; } }
