/* CPDS — Cool Plus Design System component styles. Every value comes from tokens.css. */

/* ---------- base ---------- */
body { margin: 0; font-family: var(--font-sans); font-size: 14px; line-height: 22px; background: var(--surface-50); color: var(--ink); -webkit-font-smoothing: antialiased; }
.cp-pad { padding: var(--space-4); }
.cp-stack { display: flex; flex-direction: column; gap: var(--space-3); }
.cp-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.cp-label { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.cp-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; }
.cp-unit { color: var(--ink-3); font-family: var(--font-sans); font-weight: 400; margin-left: 0.2em; }
.cp-code { font-family: var(--font-mono); font-size: 12px; line-height: 16px; color: var(--link); text-decoration: none; }
.cp-code:hover { text-decoration: underline; }
.cp-muted { color: var(--ink-3); }
.cp-link { color: var(--link); text-decoration: none; border-bottom: 1px solid currentColor; }
:where(a, button, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cp-panel { background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-2); }
.cp-panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--line); min-height: 40px; box-sizing: border-box; }
.cp-panel__title { font-size: 14px; line-height: 20px; font-weight: 600; margin: 0; }

/* ---------- status glyphs ---------- */
.cp-g { display: inline-block; width: 8px; height: 8px; flex: none; vertical-align: middle; box-sizing: border-box; }
.cp-g--ok { background: var(--ok); border-radius: 50%; }
.cp-g--warn { background: var(--warn); clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 10px; height: 9px; }
.cp-g--crit { background: var(--crit); }
.cp-g--info { background: var(--info); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); width: 10px; height: 10px; }
.cp-g--idle { border: 1.5px solid var(--idle); border-radius: 50%; }

/* ---------- status badge ---------- */
.cp-badge { display: inline-flex; align-items: center; gap: var(--space-1); height: 20px; padding: 0 6px; border-radius: var(--radius-1); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.cp-badge--ok { background: var(--ok-soft); color: var(--ok-ink); }
.cp-badge--warn { background: var(--warn-soft); color: var(--warn-ink); }
.cp-badge--crit { background: var(--crit-soft); color: var(--crit-ink); }
.cp-badge--info { background: var(--info-soft); color: var(--info-ink); }
.cp-badge--idle { background: var(--idle-soft); color: var(--idle-ink); }
.cp-badge--solid.cp-badge--crit { background: var(--crit); color: var(--on-crit); }
.cp-badge--solid.cp-badge--crit .cp-g { background: var(--on-crit); }
.cp-badge--solid.cp-badge--warn { background: var(--warn); color: var(--on-warn); }
.cp-badge--solid.cp-badge--warn .cp-g { background: var(--on-warn); }
.cp-badge--stage { background: transparent; color: inherit; border: 1px solid currentColor; }

/* ---------- button ---------- */
.cp-btn { font: inherit; font-size: 13px; font-weight: 600; line-height: 18px; height: var(--control-h); padding: 0 var(--space-3); border-radius: var(--radius-2); border: 1px solid var(--line-strong); background: var(--surface-0); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; transition: background-color 120ms ease-out; }
.cp-btn:hover { background: var(--surface-100); }
.cp-btn--primary { background: var(--action); border-color: var(--action); color: var(--on-action); }
.cp-btn--primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.cp-btn--approve { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.cp-btn--reject { color: var(--crit-ink); border-color: var(--crit); }
.cp-btn--ghost { border-color: transparent; background: transparent; color: var(--link); padding: 0 var(--space-2); }
.cp-btn--ghost:hover { background: var(--surface-100); }
.cp-btn[disabled] { background: var(--surface-100); border-color: var(--line); color: var(--ink-disabled); cursor: not-allowed; }
.cp-btn--sm { height: 24px; font-size: 12px; padding: 0 var(--space-2); }

/* ---------- CP Project Health ---------- */
.cp-health { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; min-width: 0; }
.cp-health__seg { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cp-health__bar { height: var(--health-seg); border-radius: var(--radius-0); background: var(--idle); position: relative; }
.cp-health__seg--ok .cp-health__bar { background: var(--ok); }
.cp-health__seg--warn .cp-health__bar { background: var(--warn); }
.cp-health__seg--crit .cp-health__bar { background: var(--crit); }
.cp-health__seg--info .cp-health__bar { background: var(--info); }
.cp-health__name { font-size: 10px; line-height: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
.cp-health__val { font-family: var(--font-mono); font-size: 12px; line-height: 16px; color: var(--ink); white-space: nowrap; }
.cp-health--mini { gap: 1px; width: 132px; }
.cp-health--mini .cp-health__name, .cp-health--mini .cp-health__val { display: none; }
.cp-health--mini .cp-health__bar { height: 10px; }
.cp-health--mini .cp-health__seg--warn .cp-health__bar::after, .cp-health--mini .cp-health__seg--crit .cp-health__bar::after { content: ""; position: absolute; inset: 3px 50% auto auto; width: 4px; height: 4px; transform: translateX(50%); background: var(--surface-0); }
.cp-health--mini .cp-health__seg--warn .cp-health__bar::after { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.cp-health--on-brand .cp-health__name { color: var(--on-brand-muted); }
.cp-health--on-brand .cp-health__val { color: var(--on-brand); }

/* ---------- Project Pulse ---------- */
.cp-pulse { display: grid; grid-template-columns: 112px 1fr; gap: var(--space-4); align-items: start; }
.cp-pulse__dial { position: relative; width: 112px; height: 112px; }
.cp-pulse__dial svg { width: 112px; height: 112px; transform: rotate(-90deg); }
.cp-pulse__track { fill: none; stroke: var(--surface-100); stroke-width: 8; }
.cp-pulse__arc { fill: none; stroke: var(--brand-500); stroke-width: 8; }
.cp-pulse__score { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cp-pulse__score b { font-family: var(--font-mono); font-size: 28px; line-height: 32px; font-weight: 500; }
.cp-pulse__score span { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }
.cp-pulse__concern { font-size: 14px; line-height: 22px; margin: 2px 0 var(--space-2); }
.cp-pulse__factors { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 16px; }
.cp-pulse__factors td { padding: 3px 0; border-top: 1px solid var(--line); }
.cp-pulse__factors td:nth-child(2) { width: 46%; padding: 3px var(--space-2); }
.cp-pulse__factors td:last-child { text-align: right; font-family: var(--font-mono); width: 56px; }
.cp-pulse__meter { height: 4px; background: var(--surface-100); }
.cp-pulse__meter i { display: block; height: 4px; background: var(--brand-500); }
.cp-pulse__meter--warn i { background: var(--warn); }
.cp-pulse__meter--crit i { background: var(--crit); }
.cp-pulse__formula { font-size: 12px; line-height: 16px; color: var(--ink-3); margin-top: var(--space-2); }

/* ---------- Entity Header ---------- */
.cp-entity { background: var(--brand-900); color: var(--on-brand); }
.cp-entity__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-6) var(--space-3); flex-wrap: wrap; }
.cp-entity__code { font-family: var(--font-mono); font-size: 12px; line-height: 16px; color: var(--on-brand-muted); display: flex; gap: var(--space-3); align-items: center; }
.cp-entity__name { font-size: 22px; line-height: 28px; font-weight: 600; margin: 2px 0 0; }
.cp-entity__stage { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid var(--on-brand-muted); padding: 1px 6px; border-radius: var(--radius-1); color: var(--on-brand); }
.cp-entity__facts { display: flex; flex-wrap: wrap; gap: 0; padding: 0 var(--space-6) var(--space-4); }
.cp-entity__fact { padding: 0 var(--space-6) 0 0; margin-right: var(--space-6); border-right: 1px solid var(--brand-700); }
.cp-entity__fact:last-child { border-right: 0; }
.cp-entity__fact dt { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-brand-muted); }
.cp-entity__fact dd { margin: 0; font-family: var(--font-mono); font-size: 17px; line-height: 24px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.cp-entity__fact dd small { font-size: 12px; color: var(--on-brand-muted); font-family: var(--font-sans); }
.cp-entity__health { padding: 0 var(--space-6) var(--space-4); max-width: 640px; }
.cp-tabs { display: flex; gap: 0; background: var(--surface-0); border-bottom: 1px solid var(--line); padding: 0 var(--space-4); overflow-x: auto; }
.cp-tabs a { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-2); text-decoration: none; padding: 11px var(--space-3) 9px; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.cp-tabs a:hover { background: var(--surface-100); }
.cp-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand-900); background: var(--brand-100); font-weight: 600; }

/* ---------- Metric ---------- */
.cp-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-0); }
.cp-metric { padding: var(--space-3) var(--space-4); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
.cp-metric:last-child { border-right: 0; }
.cp-metric:hover { background: var(--surface-100); }
.cp-metric__value { font-family: var(--font-mono); font-size: 28px; line-height: 32px; font-weight: 500; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 4px; }
.cp-metric__value small { font-size: 13px; color: var(--ink-3); font-family: var(--font-sans); font-weight: 400; }
.cp-metric__vs { font-size: 12px; line-height: 16px; color: var(--ink-3); display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.cp-delta { font-family: var(--font-mono); font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.cp-delta--good { color: var(--ok-ink); }
.cp-delta--bad { color: var(--crit-ink); }
.cp-delta--watch { color: var(--warn-ink); }
.cp-metric__bar { height: 4px; background: var(--surface-100); position: relative; margin-top: 6px; }
.cp-metric__bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--data-actual); }
.cp-metric__bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-2); }

/* ---------- Action Queue ---------- */
.cp-queue { list-style: none; margin: 0; padding: 0; background: var(--surface-0); }
.cp-queue__group { display: flex; align-items: baseline; gap: var(--space-2); padding: var(--space-2) var(--space-4); background: var(--surface-100); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cp-queue__group b { font-family: var(--font-mono); font-size: 13px; }
.cp-queue__item { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: var(--space-3); align-items: start; padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--line); }
.cp-queue__item:hover { background: var(--surface-50); }
.cp-queue__item .cp-g { margin-top: 7px; }
.cp-queue__what { font-size: 14px; line-height: 22px; }
.cp-queue__meta { font-size: 12px; line-height: 16px; color: var(--ink-3); display: flex; gap: var(--space-3); flex-wrap: wrap; }
.cp-queue__next { color: var(--ink-2); }
.cp-queue__act { display: flex; gap: var(--space-2); align-items: center; }
.cp-queue__rank { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }

/* ---------- Approval Queue ---------- */
.cp-approval { background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-2); }
.cp-approval__item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-4); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); }
.cp-approval__item:last-child { border-bottom: 0; }
.cp-approval__title { font-size: 14px; line-height: 22px; font-weight: 600; display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.cp-approval__rule { margin-top: 4px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.cp-approval__rule .cp-num { color: var(--ink); }
.cp-approval__chain { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.cp-approval__chain span { display: inline-flex; align-items: center; gap: 4px; }
.cp-approval__chain .is-done { color: var(--ok-ink); }
.cp-approval__chain .is-now { color: var(--info-ink); font-weight: 600; }
.cp-approval__wait { font-family: var(--font-mono); font-size: 12px; text-align: right; color: var(--ink-3); }
.cp-approval__wait.is-late { color: var(--crit-ink); }
.cp-approval__btns { display: flex; gap: var(--space-2); margin-top: var(--space-2); justify-content: flex-end; }

/* ---------- Decision Node ---------- */
.cp-decision { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--space-4); align-items: start; background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-2); padding: var(--space-4); }
.cp-diamond { width: 96px; height: 96px; position: relative; display: flex; align-items: center; justify-content: center; text-align: center; }
.cp-diamond::before { content: ""; position: absolute; inset: 14px; transform: rotate(45deg); border: 2px solid var(--ink-2); background: var(--surface-0); }
.cp-diamond--warn::before { border-color: var(--warn); background: var(--warn-soft); }
.cp-diamond--crit::before { border-color: var(--crit); background: var(--crit-soft); }
.cp-diamond--ok::before { border-color: var(--ok); background: var(--ok-soft); }
.cp-diamond span { position: relative; font-size: 11px; line-height: 13px; font-weight: 600; max-width: 56px; }
.cp-decision__q { font-size: 15px; line-height: 20px; font-weight: 600; margin: 0 0 var(--space-2); }
.cp-decision__grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px var(--space-4); margin: 0; font-size: 13px; line-height: 20px; }
.cp-decision__grid dt { color: var(--ink-3); }
.cp-decision__grid dd { margin: 0; }
.cp-decision__rule { font-family: var(--font-mono); font-size: 12px; line-height: 18px; background: var(--surface-100); padding: var(--space-2) var(--space-3); margin-top: var(--space-3); border-radius: var(--radius-1); white-space: pre-wrap; }
.cp-decision__rule .is-hit { background: var(--warn-soft); color: var(--warn-ink); outline: 1px solid var(--warn); }

/* ---------- Workflow Lane ---------- */
.cp-flow { background: var(--surface-0); border: 1px solid var(--line); overflow-x: auto; }
.cp-flow__lane { display: grid; grid-template-columns: 112px 1fr; border-bottom: 1px solid var(--line); min-height: 76px; }
.cp-flow__lane:last-child { border-bottom: 0; }
.cp-flow__who { background: var(--brand-100); color: var(--ink); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: var(--space-2) var(--space-3); display: flex; align-items: center; border-right: 1px solid var(--line); }
.cp-flow__track { position: relative; display: flex; align-items: center; gap: 28px; padding: var(--space-3) var(--space-4) var(--space-6); }
.cp-node { position: relative; flex: none; min-width: 104px; max-width: 140px; box-sizing: border-box; padding: 6px var(--space-2); border: 1.5px solid var(--line-strong); background: var(--surface-0); border-radius: var(--radius-1); font-size: 12px; line-height: 16px; font-weight: 600; text-align: left; cursor: pointer; color: var(--ink); font-family: inherit; }
.cp-node + .cp-node::before, .cp-node + .cp-node-d::before, .cp-node-d + .cp-node::before { content: ""; position: absolute; left: -29px; top: 50%; width: 28px; height: 1.5px; background: var(--ink-3); }
.cp-node small { display: flex; align-items: center; gap: 4px; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; margin-top: 2px; color: var(--ink-3); }
.cp-node--start { border-radius: 999px; padding: 6px var(--space-3); min-width: 0; text-align: center; }
.cp-node--done { border-color: var(--ok); }
.cp-node--done small { color: var(--ok-ink); }
.cp-node--now { border-color: var(--info); box-shadow: inset 0 0 0 1px var(--info); background: var(--info-soft); }
.cp-node--now small { color: var(--info-ink); }
.cp-node--hold { border-color: var(--crit); background: var(--crit-soft); }
.cp-node--hold small { color: var(--crit-ink); }
.cp-node--todo { border-style: dashed; color: var(--ink-2); }
.cp-node--doc { border-radius: var(--radius-1) var(--radius-1) 0 0; clip-path: polygon(0 0, 100% 0, 100% 86%, 75% 100%, 50% 90%, 25% 100%, 0 86%); padding-bottom: 12px; }
.cp-node-d { position: relative; flex: none; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; cursor: pointer; background: none; border: 0; padding: 0; font: inherit; color: var(--ink); }
.cp-node-d::after { content: ""; position: absolute; inset: 10px; transform: rotate(45deg); border: 1.5px solid var(--line-strong); background: var(--surface-0); }
.cp-node-d.is-warn::after { border-color: var(--warn); background: var(--warn-soft); border-width: 2px; }
.cp-node-d.is-ok::after { border-color: var(--ok); }
.cp-node-d.is-crit::after { border-color: var(--crit); background: var(--crit-soft); border-width: 2px; }
.cp-node-d span { position: relative; z-index: 1; font-size: 10px; line-height: 12px; font-weight: 600; text-align: center; max-width: 44px; }
.cp-flow__flag { position: absolute; top: -6px; right: -6px; z-index: 2; width: 16px; height: 16px; border-radius: 50%; background: var(--warn); color: var(--on-warn); font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }
.cp-flow__flag--crit { background: var(--crit); color: var(--on-crit); border-radius: 0; }
.cp-flow__alt { font-size: 11px; line-height: 14px; color: var(--crit-ink); position: absolute; left: 50%; top: 100%; transform: translateX(-50%); white-space: nowrap; margin-top: 2px; }

/* ---------- Control Table ---------- */
.cp-table-wrap { background: var(--surface-0); border: 1px solid var(--line); overflow-x: auto; }
.cp-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.cp-table th { text-align: left; font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); background: var(--surface-100); padding: 6px var(--space-3); border-bottom: 1px solid var(--line-strong); white-space: nowrap; position: sticky; top: 0; }
.cp-table td { padding: 0 var(--space-3); height: var(--row-comfortable); border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.cp-table .is-num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13px; }
.cp-table tbody tr:hover { background: var(--surface-50); }
.cp-table tbody tr[aria-selected="true"] { background: var(--brand-100); }
.cp-table--compact { font-size: 13px; line-height: 18px; }
.cp-table--compact td { height: var(--row-compact); padding: 0 var(--space-2); }
.cp-table--compact th { padding: 4px var(--space-2); }
.cp-table__name { display: flex; flex-direction: column; line-height: 16px; padding: 4px 0; }
.cp-table__name b { font-weight: 600; font-size: 13px; }
.cp-table tfoot td { font-weight: 600; background: var(--surface-100); border-top: 1px solid var(--line-strong); }
.cp-table .is-bad { color: var(--crit-ink); }
.cp-table .is-watch { color: var(--warn-ink); }

/* ---------- Form ---------- */
.cp-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-3) var(--space-4); }
.cp-field { display: flex; flex-direction: column; gap: 4px; }
.cp-field__label { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-2); display: flex; justify-content: space-between; }
.cp-field__label em { font-style: normal; color: var(--crit-ink); }
.cp-input { font: inherit; font-size: 14px; height: var(--control-h); box-sizing: border-box; padding: 0 var(--space-2); border: 1px solid var(--line-strong); border-radius: var(--radius-1); background: var(--surface-0); color: var(--ink); width: 100%; }
.cp-input::placeholder { color: var(--ink-3); }
.cp-input--num { font-family: var(--font-mono); text-align: right; }
.cp-input[readonly] { background: var(--surface-100); border-color: var(--line); }
.cp-input-unit { display: flex; }
.cp-input-unit .cp-input { border-radius: var(--radius-1) 0 0 var(--radius-1); }
.cp-input-unit span { display: flex; align-items: center; padding: 0 var(--space-2); border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--radius-1) var(--radius-1) 0; background: var(--surface-100); color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.cp-field__help { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.cp-field--error .cp-input { border-color: var(--crit); border-width: 2px; }
.cp-field--error .cp-field__help { color: var(--crit-ink); display: flex; gap: 4px; align-items: center; }
.cp-field__source { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }

/* ---------- Engineering Panel ---------- */
.cp-eng { background: var(--surface-0); border: 1px solid var(--line-strong); }
.cp-eng__head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4); background: var(--surface-100); border-bottom: 1px solid var(--line-strong); flex-wrap: wrap; }
.cp-eng__head h3 { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; }
.cp-eng__ver { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); display: flex; gap: var(--space-3); align-items: center; }
.cp-eng__body { display: grid; grid-template-columns: 1fr 1fr; }
.cp-eng__col { padding: var(--space-3) var(--space-4); }
.cp-eng__col + .cp-eng__col { border-left: 1px solid var(--line); }
.cp-eng__list { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; gap: 0 var(--space-2); margin: var(--space-2) 0 0; font-size: 13px; line-height: 18px; }
.cp-eng__list dt { padding: 4px 0; border-bottom: 1px dotted var(--line); color: var(--ink-2); }
.cp-eng__list dd { margin: 0; padding: 4px 0; border-bottom: 1px dotted var(--line); font-family: var(--font-mono); text-align: right; font-weight: 500; }
.cp-eng__list dd.u { text-align: left; color: var(--ink-3); font-family: var(--font-sans); font-weight: 400; }
.cp-eng__result { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-mono); font-size: 20px; line-height: 24px; font-weight: 500; }
.cp-eng__result small { font-family: var(--font-sans); font-size: 13px; color: var(--ink-3); font-weight: 400; }
.cp-eng__margin { margin-top: var(--space-3); }
.cp-eng__scale { height: 8px; background: var(--surface-100); position: relative; margin-top: 4px; }
.cp-eng__scale i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand-500); }
.cp-eng__scale b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.cp-eng__foot { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-4); border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }

/* ---------- Alert / exception ---------- */
.cp-alert { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-2) var(--space-4); border: 1px solid var(--line); background: var(--surface-0); font-size: 14px; line-height: 22px; }
.cp-alert__tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; }
.cp-alert--crit { border-color: var(--crit); background: var(--crit-soft); }
.cp-alert--crit .cp-alert__tag { background: var(--crit); color: var(--on-crit); }
.cp-alert--crit .cp-alert__tag .cp-g { background: var(--on-crit); }
.cp-alert--warn { border-color: var(--warn); background: var(--warn-soft); }
.cp-alert--warn .cp-alert__tag { background: var(--warn); color: var(--on-warn); }
.cp-alert--warn .cp-alert__tag .cp-g { background: var(--on-warn); }
.cp-alert--info { border-color: var(--info); background: var(--info-soft); }
.cp-alert--info .cp-alert__tag { color: var(--info-ink); padding-left: 0; }
.cp-alert--ok { border-color: var(--ok); background: var(--ok-soft); }
.cp-alert--ok .cp-alert__tag { color: var(--ok-ink); padding-left: 0; }
.cp-alert__owner { font-size: 12px; color: var(--ink-2); white-space: nowrap; }

/* ---------- AI Insight ---------- */
.cp-insight { border: 1px solid var(--info); background: var(--surface-0); }
.cp-insight__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 6px var(--space-4); background: var(--info-soft); border-bottom: 1px solid var(--info); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--info-ink); }
.cp-insight__body { padding: var(--space-3) var(--space-4); }
.cp-insight__claim { font-size: 14px; line-height: 22px; margin: 0; }
.cp-insight__evidence { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: var(--space-3) 0 0; border-top: 1px solid var(--line); }
.cp-insight__evidence div { padding: var(--space-2) var(--space-3) 0 0; }
.cp-insight__evidence dt { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.cp-insight__evidence dd { margin: 0; font-size: 12px; line-height: 18px; }
.cp-confidence { display: inline-flex; gap: 2px; vertical-align: middle; margin-right: 4px; }
.cp-confidence i { width: 6px; height: 10px; background: var(--surface-100); border: 1px solid var(--line-strong); box-sizing: border-box; }
.cp-confidence i.on { background: var(--info); border-color: var(--info); }
.cp-insight__acts { display: flex; gap: var(--space-2); padding: var(--space-2) var(--space-4); border-top: 1px solid var(--line); flex-wrap: wrap; }
.cp-insight--empty { border-color: var(--line-strong); border-style: dashed; }
.cp-insight--empty .cp-insight__head { background: var(--surface-100); color: var(--ink-2); border-bottom-color: var(--line); }

/* ---------- Timeline ---------- */
.cp-tl { background: var(--surface-0); border: 1px solid var(--line); font-size: 12px; }
.cp-tl__scale, .cp-tl__row { display: grid; grid-template-columns: 168px 1fr; }
.cp-tl__scale { border-bottom: 1px solid var(--line-strong); background: var(--surface-100); }
.cp-tl__weeks { display: grid; grid-template-columns: repeat(13, 1fr); }
.cp-tl__weeks span { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); padding: 4px 4px; border-left: 1px solid var(--line); }
.cp-tl__row { border-bottom: 1px solid var(--line); min-height: 34px; }
.cp-tl__row:last-child { border-bottom: 0; }
.cp-tl__label { padding: 6px var(--space-3); display: flex; flex-direction: column; line-height: 14px; border-right: 1px solid var(--line); }
.cp-tl__label b { font-weight: 600; font-size: 12px; }
.cp-tl__label span { color: var(--ink-3); font-size: 11px; }
.cp-tl__lane { position: relative; background-image: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px calc(100% / 13)); }
.cp-tl__bar { position: absolute; top: 9px; height: 16px; background: var(--data-budget); }
.cp-tl__bar--actual { background: var(--data-actual); top: 13px; height: 8px; }
.cp-tl__bar--late { background: var(--crit); top: 13px; height: 8px; }
.cp-tl__ms { position: absolute; top: 10px; width: 12px; height: 12px; transform: translateX(-6px) rotate(45deg); background: var(--ink); border: 2px solid var(--surface-0); box-sizing: border-box; }
.cp-tl__ms--crit { background: var(--crit); }
.cp-tl__ms--ok { background: var(--ok); }
.cp-tl__today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--info); }
.cp-tl__cash { position: absolute; bottom: 4px; height: 6px; background: var(--data-cash); }

/* ---------- Variance Chart ---------- */
.cp-var { background: var(--surface-0); border: 1px solid var(--line); padding: var(--space-3) var(--space-4); }
.cp-var__row { display: grid; grid-template-columns: 140px 1fr 96px 80px; gap: var(--space-3); align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.cp-var__row:last-child { border-bottom: 0; }
.cp-var__bars { position: relative; height: 20px; }
.cp-var__budget { position: absolute; top: 2px; height: 16px; background: var(--data-budget); opacity: 0.45; }
.cp-var__actual { position: absolute; top: 6px; height: 8px; background: var(--data-actual); }
.cp-var__fcst { position: absolute; top: 0; height: 20px; width: 0; border-left: 2px dashed var(--data-forecast); }
.cp-var__over { position: absolute; top: 6px; height: 8px; background: var(--crit); }
.cp-var__num { text-align: right; font-family: var(--font-mono); font-size: 12px; }
.cp-var__legend { display: flex; gap: var(--space-4); font-size: 12px; color: var(--ink-2); margin-bottom: var(--space-2); flex-wrap: wrap; }
.cp-var__legend span { display: inline-flex; align-items: center; gap: 6px; }
.cp-var__legend i { display: inline-block; width: 14px; height: 8px; }

/* ---------- Money Flow ---------- */
.cp-money { background: var(--surface-0); border: 1px solid var(--line); }
.cp-money__step { display: grid; grid-template-columns: 180px 1fr 120px 64px; gap: var(--space-3); align-items: center; padding: 0 var(--space-4); height: 36px; border-bottom: 1px solid var(--line); font-size: 13px; text-decoration: none; color: inherit; }
.cp-money__step:hover { background: var(--surface-50); }
.cp-money__step:last-child { border-bottom: 0; }
.cp-money__name { display: flex; align-items: center; gap: var(--space-2); font-weight: 500; }
.cp-money__name i { font-style: normal; color: var(--ink-3); font-family: var(--font-mono); width: 14px; }
.cp-money__bar { height: 14px; background: var(--surface-100); position: relative; }
.cp-money__bar b { position: absolute; top: 0; bottom: 0; background: var(--brand-500); }
.cp-money__bar b.is-out { background: var(--data-budget); }
.cp-money__bar b.is-cash { background: var(--data-cash); }
.cp-money__bar b.is-debt { background: var(--ink-2); }
.cp-money__val { text-align: right; font-family: var(--font-mono); font-weight: 500; }
.cp-money__pct { text-align: right; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.cp-money__step--total { background: var(--surface-100); font-weight: 600; }
.cp-money__conv { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line-strong); flex-wrap: wrap; }

/* ---------- Debt to Wealth ---------- */
.cp-dw { background: var(--surface-0); border: 1px solid var(--line); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
.cp-dw__track { display: grid; grid-template-columns: 96px 1fr; gap: var(--space-4); align-items: center; }
.cp-dw__name { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.cp-dw__name b { display: block; font-family: var(--font-mono); font-size: 20px; line-height: 24px; letter-spacing: 0; color: var(--ink); font-weight: 500; text-transform: none; }
.cp-dw__rail { position: relative; height: 52px; }
.cp-dw__line { position: absolute; left: 0; right: 0; top: 22px; height: 6px; background: var(--surface-100); }
.cp-dw__done { position: absolute; top: 22px; height: 6px; background: var(--data-actual); }
.cp-dw__plan { position: absolute; top: 20px; height: 10px; border-right: 2px solid var(--data-budget); }
.cp-dw__fc { position: absolute; top: 22px; height: 6px; background: repeating-linear-gradient(90deg, var(--data-forecast) 0 6px, transparent 6px 10px); }
.cp-dw__tick { position: absolute; top: 34px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); transform: translateX(-50%); white-space: nowrap; }
.cp-dw__tick--end { transform: translateX(-100%); }
.cp-dw__tick--start { transform: none; }
.cp-dw__mark { position: absolute; top: 0; font-family: var(--font-mono); font-size: 11px; line-height: 14px; transform: translateX(-50%); white-space: nowrap; font-weight: 600; }
.cp-dw__mark::after { content: ""; position: absolute; left: 50%; top: 15px; width: 1px; height: 7px; background: currentColor; }
.cp-dw__table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cp-dw__table th { text-align: right; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); padding: 4px var(--space-2); border-bottom: 1px solid var(--line-strong); }
.cp-dw__table th:first-child, .cp-dw__table td:first-child { text-align: left; }
.cp-dw__table td { text-align: right; font-family: var(--font-mono); padding: 5px var(--space-2); border-bottom: 1px solid var(--line); }
.cp-dw__table td:first-child { font-family: var(--font-sans); font-weight: 600; }

/* ---------- Owner Dependency Map ---------- */
.cp-odm { background: var(--surface-0); border: 1px solid var(--line); }
.cp-odm__flow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; border-bottom: 1px solid var(--line); }
.cp-odm__proc { padding: var(--space-3); border-right: 1px solid var(--line); position: relative; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; }
.cp-odm__proc:last-child { border-right: 0; }
.cp-odm__proc:hover { background: var(--surface-50); }
.cp-odm__proc[aria-current="true"] { background: var(--brand-100); }
.cp-odm__proc h4 { margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; }
.cp-odm__level { height: 6px; }
.cp-odm__level--ok { background: var(--ok); }
.cp-odm__level--warn { background: var(--warn); }
.cp-odm__level--crit { background: var(--crit); }
.cp-odm__pct { font-family: var(--font-mono); font-size: 20px; line-height: 24px; font-weight: 500; }
.cp-odm__pct small { font-size: 11px; color: var(--ink-3); font-family: var(--font-sans); font-weight: 400; display: block; line-height: 14px; }
.cp-odm__state { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; display: flex; gap: 4px; align-items: center; }
.cp-odm__state.ok { color: var(--ok-ink); } .cp-odm__state.warn { color: var(--warn-ink); } .cp-odm__state.crit { color: var(--crit-ink); }
.cp-odm__detail { padding: var(--space-3) var(--space-4); }

/* ---------- Document list ---------- */
.cp-docs { list-style: none; margin: 0; padding: 0; background: var(--surface-0); border: 1px solid var(--line); }
.cp-doc { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: var(--space-3); align-items: center; padding: 6px var(--space-4); border-bottom: 1px solid var(--line); font-size: 13px; }
.cp-doc:last-child { border-bottom: 0; }
.cp-doc__type { width: 24px; height: 28px; position: relative; background: var(--surface-100); border: 1px solid var(--line-strong); clip-path: polygon(0 0, 70% 0, 100% 25%, 100% 100%, 0 100%); font-family: var(--font-mono); font-size: 8px; font-weight: 600; color: var(--ink-2); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 2px; box-sizing: border-box; }
.cp-doc__name { display: flex; flex-direction: column; line-height: 18px; min-width: 0; }
.cp-doc__name b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-doc__name span { font-size: 12px; color: var(--ink-3); }
.cp-doc__rev { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }

/* ---------- Command Bar ---------- */
.cp-cmd { background: var(--surface-0); border: 1px solid var(--line-strong); border-radius: var(--radius-2); box-shadow: var(--shadow-pop); max-width: 640px; overflow: hidden; }
.cp-cmd__input { display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-4); height: 48px; border-bottom: 1px solid var(--line); }
.cp-cmd__input input { flex: 1; border: 0; font: inherit; font-size: 15px; background: transparent; color: var(--ink); outline: none; }
.cp-kbd { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); border: 1px solid var(--line-strong); border-radius: var(--radius-1); padding: 0 4px; line-height: 16px; }
.cp-cmd__group { padding: var(--space-1) 0; border-bottom: 1px solid var(--line); }
.cp-cmd__group:last-child { border-bottom: 0; }
.cp-cmd__group > .cp-label { display: block; padding: 4px var(--space-4); }
.cp-cmd__item { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: 6px var(--space-4); font-size: 13px; line-height: 18px; }
.cp-cmd__item[aria-selected="true"] { background: var(--brand-100); }
.cp-cmd__item .cp-code { color: var(--ink-2); }
.cp-cmd__item small { color: var(--ink-3); font-size: 12px; }
.cp-cmd__verb { font-weight: 600; font-size: 12px; color: var(--ink-2); }

/* ---------- Nav Rail ---------- */
.cp-rail { width: var(--nav-rail); background: var(--brand-900); color: var(--on-brand); display: flex; flex-direction: column; min-height: 100%; }
.cp-rail__brand { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-align: center; padding: var(--space-3) 0; border-bottom: 1px solid var(--brand-700); line-height: 12px; }
.cp-rail a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; font-size: 10px; line-height: 12px; font-weight: 500; color: var(--on-brand-muted); text-decoration: none; position: relative; }
.cp-rail a:hover { background: var(--brand-700); color: var(--on-brand); }
.cp-rail a[aria-current="page"] { background: var(--brand-700); color: var(--on-brand); }
.cp-rail a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: var(--on-brand); }
.cp-rail svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cp-rail__count { position: absolute; top: 4px; right: 12px; min-width: 14px; height: 14px; padding: 0 3px; box-sizing: border-box; background: var(--crit); color: var(--on-crit); font-family: var(--font-mono); font-size: 9px; line-height: 14px; text-align: center; }
.cp-rail__sep { height: 1px; background: var(--brand-700); margin: 4px 12px; }

/* ---------- Field Mode ---------- */
.cp-field-mode { width: 360px; background: var(--surface-50); border: 1px solid var(--line-strong); font-size: 15px; line-height: 22px; }
.cp-fm__bar { background: var(--brand-900); color: var(--on-brand); padding: var(--space-3) var(--space-4); }
.cp-fm__bar .cp-code { color: var(--on-brand-muted); }
.cp-fm__bar b { display: block; font-size: 17px; line-height: 24px; }
.cp-fm__step { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); background: var(--surface-0); }
.cp-fm__q { font-weight: 600; margin-bottom: var(--space-2); }
.cp-fm__choice { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-2); }
.cp-fm__btn { min-height: var(--touch-min); border-radius: var(--radius-3); border: 1.5px solid var(--line-strong); background: var(--surface-0); font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.cp-fm__btn[aria-pressed="true"].is-pass { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.cp-fm__btn[aria-pressed="true"].is-pass .cp-g { background: var(--on-ok); }
.cp-fm__btn[aria-pressed="true"].is-fail { background: var(--crit); border-color: var(--crit); color: var(--on-crit); }
.cp-fm__btn[aria-pressed="true"].is-na { background: var(--idle-soft); border-color: var(--idle); color: var(--idle-ink); }
.cp-fm__measure { display: flex; gap: var(--space-2); align-items: stretch; }
.cp-fm__measure input { flex: 1; min-height: var(--touch-min); font-family: var(--font-mono); font-size: 22px; text-align: right; border: 1.5px solid var(--line-strong); border-radius: var(--radius-3); padding: 0 var(--space-3); background: var(--surface-0); color: var(--ink); box-sizing: border-box; min-width: 0; }
.cp-fm__measure span { display: flex; align-items: center; font-size: 15px; color: var(--ink-2); min-width: 40px; }
.cp-fm__spec { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.cp-fm__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); padding: var(--space-3) var(--space-4); }
.cp-fm__cta { min-height: 56px; border-radius: var(--radius-3); background: var(--action); color: var(--on-action); border: 0; font: inherit; font-size: 16px; font-weight: 600; grid-column: 1 / -1; cursor: pointer; }
.cp-fm__progress { display: flex; gap: 2px; margin-top: var(--space-2); }
.cp-fm__progress i { flex: 1; height: 4px; background: var(--brand-700); }
.cp-fm__progress i.on { background: var(--on-brand); }
