/* Conyso Cadence — component styles. Built on the shared Conyso design system
   (styles.css provides the palette + type; the primitives below are ported from
   the Ledger component layer since styles.css does NOT ship .btn / modal / toast). */

/* ---------- primitives (buttons, modal, toast) ---------- */
.btn { font-family: var(--font-body); font-size: 13px; padding: 9px 18px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: transparent; color: var(--ink); cursor: pointer;
  letter-spacing: .02em; transition: var(--transition); text-decoration: none; display: inline-flex;
  align-items: center; gap: 6px; line-height: 1; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
a.btn { text-decoration: none; }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 500; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--bg); }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.lg-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.lg-modal { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); width: 460px; max-width: 92vw; max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg); }
.lg-modal.wide { width: min(780px, 92vw); }
.lg-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.lg-modal-head h3 { margin: 0; font-family: var(--font-display); font-size: 18px; }
.lg-modal-body { padding: 20px; }
.lg-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }

#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--surface); border: 1px solid var(--line-2); border-left-width: 3px; border-radius: var(--radius); padding: 12px 16px; min-width: 240px; max-width: 360px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 3px; }
.toast strong { font-size: 13px; } .toast span { font-size: 12px; color: var(--ink-2); }
.toast.success { border-left-color: var(--success); } .toast.error { border-left-color: var(--danger); } .toast.info { border-left-color: var(--accent); }


/* ---------- header ---------- */
.cad-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 30; }
.cad-brand { display: flex; align-items: center; gap: 11px; color: var(--accent); }
.cad-brand-name { font-family: var(--font-display); letter-spacing: .14em; font-size: 14px; color: var(--ink); }
.cad-brand-sub { font-size: 9px; letter-spacing: .22em; color: var(--muted); }
.cad-header-right { display: flex; align-items: center; gap: 10px; }
.cad-conyso { font-size: 11px; letter-spacing: .18em; color: var(--muted); text-decoration: none; }
.cad-free { font-size: 9px; letter-spacing: .14em; border: 1px solid var(--line-2); border-radius: 100px; padding: 2px 8px; color: var(--accent); }
.cad-persona { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 5px 9px; font-size: 12px; }

.btn.sm { padding: 5px 10px; font-size: 12px; }
.icon-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: var(--radius-sm); }
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }

/* ---------- landing ---------- */
.cad-home-main { grid-template-columns: minmax(0, 1fr); }   /* full-bleed home, no sidebar; minmax(0,…) clamps min-content so the hero never forces page-wide overflow */
.cad-home { max-width: 960px; margin: 0 auto; }
.cad-landing { text-align: center; padding: 40px 0 18px; max-width: 760px; margin: 0 auto; }
.cad-landing h1 { font-family: var(--font-display); font-size: 50px; line-height: 1.06; margin: 0 0 20px; }
.cad-hero-accent { color: var(--accent); }
.cad-landing-sub { color: var(--ink-2); font-size: 16.5px; line-height: 1.65; max-width: 60ch; margin: 0 auto; }
.cad-hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.cad-hero-cta .btn { padding: 11px 22px; }

.cad-home-projects { margin: 54px 0 10px; }
.cad-home-projects-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cad-proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cad-proj-card { display: block; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); cursor: pointer; transition: var(--transition); font: inherit; color: inherit; }
.cad-proj-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.cad-proj-name { font-family: var(--font-display); font-size: 18px; margin-bottom: 4px; }
.cad-proj-open { display: inline-block; margin-top: 14px; font-size: 12.5px; color: var(--accent); }
.cad-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px; margin-top: 60px; border-top: 1px solid var(--line); padding-top: 36px; }
.cad-feature h3 { font-size: 15px; margin: 0 0 7px; }
.cad-feature p { font-size: 13.5px; line-height: 1.55; margin: 0; }

/* ---------- two-rail project workspace (uses shared main / nav.sidebar.two-rail / .nav-rail / .nav-panel / section.workspace) ---------- */
nav.sidebar.two-rail { background: color-mix(in srgb, var(--ink) 3%, var(--bg)); border-right: 1px solid var(--line); }
.nav-rail { background: color-mix(in srgb, var(--ink) 4%, var(--bg)); }
.cad-inner { max-width: 1020px; animation: cad-fade .28s ease both; }
.cad-rail-home { border-bottom: 1px solid var(--line); margin-bottom: 6px; padding-bottom: 12px; }
.nav-panel .cad-pname { font-family: var(--font-display); font-size: 17px; line-height: 1.25; padding: 0 4px; }
.nav-panel .cad-pmeta { font-size: 12px; color: var(--muted); margin: 3px 0 12px; padding: 0 4px; }
.cad-pgrade { display: flex; align-items: baseline; gap: 4px; border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: var(--radius); padding: 9px 12px; background: var(--surface); cursor: pointer; margin-bottom: 12px; }
.cad-pgrade strong { font-family: var(--font-display); font-size: 24px; font-weight: 400; }
.cad-pgrade.good { border-left-color: var(--success); } .cad-pgrade.warn { border-left-color: var(--warn); } .cad-pgrade.bad { border-left-color: var(--danger); }
.cad-pactions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.cad-pactions .btn { justify-content: flex-start; width: 100%; }
.cad-switch-title { margin-top: auto; padding-top: 14px !important; border-top: 1px solid var(--line); }
.cad-switch { list-style: none; padding: 0; margin: 0; }
.cad-switch-item { padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12.5px; color: var(--ink-2); transition: var(--transition); }
.cad-switch-item:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
.cad-switch-item.active { color: var(--accent); }
.cad-switch-item.cad-new { color: var(--muted); margin-top: 2px; }
.cad-loading { padding: 80px; text-align: center; color: var(--muted); }

h2 { font-family: var(--font-display); font-size: 21px; margin: 0 0 4px; }
h3 { font-family: var(--font-display); font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.cad-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: var(--surface); margin: 16px 0; }
.cad-block-head-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 4px 0 14px; flex-wrap: wrap; }
.cad-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cad-divider { height: 1px; background: var(--line); margin: 30px 0; }
.cad-segmented { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.cad-seg { background: none; border: none; padding: 7px 16px; cursor: pointer; font-size: 13px; color: var(--ink-2); border-right: 1px solid var(--line); }
.cad-seg:last-child { border-right: none; }
.cad-seg:hover { background: var(--surface-2); }
.cad-seg.on { background: var(--accent); color: var(--bg); }
@media (max-width: 900px) { .cad-two { grid-template-columns: 1fr; } }

/* ---------- KPIs ---------- */
.cad-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 4px 0 18px; }
.cad-kpi { border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); }
.cad-kpi.clickable { cursor: pointer; transition: var(--transition); }
.cad-kpi.clickable:hover { border-color: var(--accent); }
.cad-kpi.good { border-left-color: var(--success); }
.cad-kpi.warn { border-left-color: var(--warn); }
.cad-kpi.bad { border-left-color: var(--danger); }
.cad-kpi-l { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cad-kpi-v { font-family: var(--font-display); font-size: 21px; margin-top: 3px; }
.cad-kpi-sub { font-size: 12px; color: var(--muted); font-family: var(--font-body); }

/* ---------- dashboard ---------- */
.cad-hero-grade { display: flex; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; background: var(--surface); margin: 16px 0; }
.cad-grade-badge { font-family: var(--font-display); font-size: 38px; font-weight: 700; border: 2px solid; border-radius: var(--radius); width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; }
.cad-grade-score { font-family: var(--font-display); font-size: 20px; }
.cad-issues { list-style: none; padding: 0; margin: 0; }
.cad-issues li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.cad-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.cad-cp-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cad-cp-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 100px; padding: 4px 11px; font-size: 12.5px; cursor: pointer; }
.cad-cp-chip:hover { border-color: var(--accent); }
.cad-cp-arr { color: var(--muted); }
.cad-cycle { border-color: var(--danger); }

/* ---------- quality ---------- */
.cad-quality-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.cad-quality-score { font-family: var(--font-display); font-size: 40px; line-height: 1; }
.cad-quality-score .muted { font-size: 16px; }
.cad-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.cad-check { border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); }
.cad-check.pass { border-left-color: var(--success); }
.cad-check.watch { border-left-color: var(--warn); }
.cad-check.fail { border-left-color: var(--danger); }
.cad-check.na { opacity: .65; }
.cad-check-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cad-check-badge { color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 100px; }
.cad-check-name { font-family: var(--font-display); font-size: 14px; }
.cad-check-val { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 13px; }
.cad-check-expl { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin: 8px 0 0; }
.cad-check-offenders { font-size: 12px; margin-top: 6px; color: var(--ink-2); }

/* ---------- tables ---------- */
.cad-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cad-table th { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line-2); color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.cad-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.cad-grid tbody tr { cursor: pointer; }
.cad-grid tbody tr:hover { background: var(--surface-2); }
.cad-row-crit .cad-tname { color: var(--danger); }
.cad-row-sum { font-weight: 600; }
.cad-id { color: var(--muted); font-variant-numeric: tabular-nums; }
.cad-preds { color: var(--ink-2); font-size: 12.5px; }
.cad-neg { color: var(--danger); font-weight: 600; }
.cad-slip td { background: color-mix(in srgb, var(--danger) 7%, transparent); }
.cad-quickadd { margin-top: 12px; }
.cad-quickadd input { width: 100%; max-width: 420px; }

/* ---------- gantt ---------- */
.cad-gantt-zoom { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-bottom: 6px; }
.cad-gantt-scroll, .cad-net-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cad-gantt-svg { display: block; min-width: 100%; }
.cad-grid { stroke: var(--line); stroke-width: 1; }
.cad-axis { fill: var(--muted); font-size: 9px; }
.cad-datadate { stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 3 3; }
.cad-datadate-lbl { fill: var(--accent); }
.cad-deadline { stroke: var(--danger); stroke-width: 1.4; stroke-dasharray: 2 4; }
.cad-tlabel { fill: var(--ink-1); font-size: 11.5px; }
.cad-tlabel.sum { font-weight: 700; }
.cad-bar { fill: var(--accent); }
.cad-bar.crit { fill: var(--danger); }
.cad-bar.norm { fill: #5a7d9a; }
.cad-prog { fill: color-mix(in srgb, var(--ink) 34%, transparent); pointer-events: none; }
.cad-float { fill: var(--line-2); }
.cad-ms { fill: var(--ink); }
.cad-sumbar { fill: var(--ink-2); }
.cad-critdot { fill: var(--danger); }
.cad-dep { fill: none; stroke: var(--muted); stroke-width: 1; opacity: .5; }
.cad-dep.crit { stroke: var(--danger); opacity: .8; }
.cad-legend { display: flex; gap: 14px; }
.cad-legend-item { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.cad-legend-dot { width: 11px; height: 9px; border-radius: 2px; display: inline-block; }
.cad-legend-dot.crit { background: var(--danger); } .cad-legend-dot.norm { background: #5a7d9a; }
.cad-legend-dot.float { background: var(--line-2); } .cad-legend-dot.ms { background: var(--ink); transform: rotate(45deg); width: 8px; height: 8px; }

/* ---------- network ---------- */
.cad-net-svg { display: block; }
.cad-node-box { fill: var(--surface-2); stroke: var(--line-2); }
.cad-node-box.crit { stroke: var(--danger); }
.cad-node-name { fill: var(--ink); font-size: 12px; font-weight: 600; }
.cad-node-meta { fill: var(--muted); font-size: 10px; }

/* ---------- charts ---------- */
.cad-chart { display: block; background: var(--surface); border-radius: var(--radius-sm); }
.cad-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.cad-marker { stroke-width: 1.2; stroke-dasharray: 3 3; }
.cad-hbar { display: flex; align-items: center; gap: 8px; }
.cad-hbar-track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 100px; overflow: hidden; min-width: 80px; }
.cad-hbar-fill { height: 8px; background: var(--accent); border-radius: 100px; }
.cad-hbar-lbl { font-size: 12px; color: var(--ink-2); min-width: 44px; text-align: right; }

/* ---------- forms / modal ---------- */
.cad-form { display: flex; flex-direction: column; gap: 12px; }
.cad-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cad-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.cad-input { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 10px; color: var(--ink); font-size: 14px; font-family: var(--font-body); width: 100%; }
.cad-input:focus { outline: none; border-color: var(--accent); }
.cad-sub { border-top: 1px solid var(--line); padding-top: 12px; }
.cad-sub h4 { margin: 0 0 8px; font-size: 13px; }
.cad-pred-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.cad-pred-name { font-weight: 500; }
.cad-pred-add { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.cad-pred-add .cad-input { width: auto; flex: 1; min-width: 120px; }
.cad-del { color: var(--danger); margin-top: 6px; }

/* ---------- feedback ---------- */
.cad-fb-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cad-fb { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.cad-fb-vote { display: flex; flex-direction: column; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 9px; cursor: pointer; font-size: 11px; color: var(--muted); }
.cad-fb-vote.on { color: var(--accent); border-color: var(--accent); }
.cad-fb-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.cad-fb-kind, .cad-fb-status { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; border: 1px solid var(--line-2); border-radius: 100px; padding: 1px 7px; color: var(--muted); }

/* ---------- palette / tour ---------- */
.cad-palette { display: flex; flex-direction: column; gap: 8px; min-width: 420px; }
.cad-palette-results { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.cad-palette-item { text-align: left; background: none; border: none; padding: 9px 11px; border-radius: var(--radius-sm); cursor: pointer; color: var(--ink); font-size: 13.5px; }
.cad-palette-item:hover { background: var(--accent-bg); color: var(--accent); }
.cad-tour-dots { display: flex; gap: 6px; margin-bottom: 12px; }
.cad-tour-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.cad-tour-dot.on { background: var(--accent); }
.cad-tour h3 { font-size: 18px; }
.cad-tour p { color: var(--ink-2); line-height: 1.6; }

/* ---------- quality (redesigned: list + detail page) ---------- */
.cad-quality-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cad-quality-top > div:first-child { display: flex; align-items: center; gap: 16px; }
.cad-qgrade { font-family: var(--font-display); font-size: 34px; font-weight: 700; border: 2px solid; border-radius: var(--radius); width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cad-qscore { font-family: var(--font-display); font-size: 20px; }
.cad-qlist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cad-qrow { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: none; border: none; border-bottom: 1px solid var(--line); border-left: 3px solid var(--line-2); cursor: pointer; text-align: left; font: inherit; color: var(--ink); transition: background .14s, border-color .14s; width: 100%; }
.cad-qrow:last-child { border-bottom: none; }
.cad-qrow:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.cad-qrow.pass { border-left-color: var(--success); } .cad-qrow.watch { border-left-color: var(--warn); } .cad-qrow.fail { border-left-color: var(--danger); } .cad-qrow.na { border-left-color: var(--line-2); opacity: .72; }
.cad-qbadge { color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 3px 8px; border-radius: 100px; flex: 0 0 auto; min-width: 46px; text-align: center; }
.cad-qbadge.lg { font-size: 12px; padding: 5px 12px; }
.cad-qnum { font-variant-numeric: tabular-nums; color: var(--muted); width: 18px; text-align: right; flex: 0 0 auto; }
.cad-qname { flex: 1; display: flex; flex-direction: column; gap: 1px; font-family: var(--font-display); font-size: 15px; }
.cad-qmetric { font-family: var(--font-body); font-size: 12px; color: var(--muted); }
.cad-qval { font-variant-numeric: tabular-nums; font-size: 14px; flex: 0 0 auto; }
.cad-qchev { color: var(--muted); font-size: 20px; flex: 0 0 auto; }
.cad-checkpage { animation: cad-fade .28s ease both; }
.cad-checkhero { display: flex; align-items: center; gap: 14px; margin: 14px 0 6px; }
.cad-checkhero h2 { font-size: 22px; }
.cad-checkval { margin-left: auto; font-family: var(--font-display); font-size: 26px; font-variant-numeric: tabular-nums; }
.cad-offenders { display: flex; flex-wrap: wrap; gap: 7px; }
.cad-offender { background: var(--surface-2); border: 1px solid var(--line); border-radius: 100px; padding: 4px 11px; font-size: 12.5px; }

/* ---------- resources legibility ---------- */
.cad-resstat { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.cad-pill { display: inline-block; border: 1px solid var(--line-2); border-radius: 100px; padding: 2px 9px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.cad-pill-bad { color: var(--danger); border: 1px solid var(--danger); border-radius: 100px; padding: 2px 9px; font-size: 11px; }
.cad-pill-ok { color: var(--success); border: 1px solid var(--success); border-radius: 100px; padding: 2px 9px; font-size: 11px; }
.cad-chartbox { width: 100%; min-height: 60px; }

/* ---------- animations / polish ---------- */
@keyframes cad-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes cad-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.cad-kpi { animation: cad-rise .34s ease both; }
.cad-kpis .cad-kpi:nth-child(2) { animation-delay: .04s; }
.cad-kpis .cad-kpi:nth-child(3) { animation-delay: .08s; }
.cad-kpis .cad-kpi:nth-child(4) { animation-delay: .12s; }
.cad-kpi.clickable:hover, .cad-proj-card:hover { transform: translateY(-2px); }
.cad-block { transition: border-color .15s; }
.cad-cp-chip, .cad-rail-btn, .rail-btn, .cad-switch-item, .btn { transition: all .15s ease; }
.cad-bar, .cad-prog, .cad-sumbar, .cad-ms { transition: opacity .2s; }
@media (prefers-reduced-motion: reduce) { .cad-inner, .cad-kpi, .cad-checkpage { animation: none !important; } .cad-kpi.clickable:hover, .cad-proj-card:hover { transform: none; } }

/* ---------- rail 2 contextual sub-nav (Bench category → sub-category) ---------- */
.nav-panel .panel-title { margin-top: 14px; }
.cad-subnav { display: flex; flex-direction: column; gap: 1px; margin: 2px 0; }
.cad-subitem { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; border-left: 2px solid transparent; color: var(--ink-2); padding: 7px 8px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; cursor: pointer; font: inherit; font-size: 13px; transition: background .14s, color .14s, border-color .14s; }
.cad-subitem:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
.cad-subitem.active { color: var(--accent); border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.cad-subitem.muted { color: var(--muted); font-size: 12px; margin-top: 4px; }
.cad-subitem-lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cad-subitem-right { color: var(--danger); font-weight: 700; }
.cad-subdot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.cad-subnav-empty { font-size: 12px; padding: 6px 8px; }
.cad-railfoot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.cad-railfoot .cad-pactions { margin-bottom: 8px; }

/* ---------- deeper check detail page ---------- */
.cad-verdict-line { font-size: 15px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); border-left: 3px solid var(--line-2); background: var(--surface); margin: 8px 0 4px; }
.cad-verdict-line.pass { border-left-color: var(--success); } .cad-verdict-line.watch { border-left-color: var(--warn); } .cad-verdict-line.fail { border-left-color: var(--danger); }
.cad-calc { display: flex; flex-direction: column; gap: 0; }
.cad-calc-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cad-calc-row:last-of-type { border-bottom: none; }
.cad-calc-row strong { font-variant-numeric: tabular-nums; }
.cad-detail-table td { vertical-align: top; }
.cad-detail-table .btn { padding: 3px 9px; font-size: 11px; }
.cad-related { display: flex; flex-wrap: wrap; gap: 8px; }
.cad-relchip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 100px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--ink); transition: border-color .15s; }
.cad-relchip:hover { border-color: var(--accent); }

/* ---------- inline-editable grid ---------- */
.cad-grid-edit td { padding: 4px 8px; }
.cad-cell { background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 5px 7px; color: var(--ink); font: inherit; font-size: 13.5px; width: 100%; transition: border-color .12s, background .12s; }
.cad-cell:hover { border-color: var(--line); }
.cad-cell:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }
.cad-cell.num { text-align: right; max-width: 72px; font-variant-numeric: tabular-nums; }
.cad-cell-name { font-family: var(--font-body); }
.cad-row-crit .cad-cell-name { color: var(--danger); }
.cad-ms-mark { color: var(--ink); margin-right: 2px; }
.cad-date { color: var(--ink-2); white-space: nowrap; }
.cad-preds { cursor: pointer; }
.cad-preds:hover { color: var(--accent); }

/* ---------- overview sub-pages ---------- */
.cad-issue-row { cursor: pointer; border-radius: var(--radius-sm); transition: background .12s; }
.cad-issue-row:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.cad-healthbar { display: flex; gap: 3px; height: 30px; border-radius: var(--radius-sm); overflow: hidden; }
.cad-healthseg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 600; min-width: 24px; }
.cad-healthseg.pass { background: var(--success); } .cad-healthseg.watch { background: var(--warn); } .cad-healthseg.fail { background: var(--danger); } .cad-healthseg.na { background: var(--line-2); color: var(--ink-2); }

/* ---------- drag & drop ---------- */
.cad-grid-edit tbody tr { cursor: default; }
.cad-draghandle { cursor: grab; color: var(--muted); user-select: none; padding: 0 4px; }
.cad-draghandle:active { cursor: grabbing; }
tr.cad-dragging { opacity: .4; }
tr.cad-dragover td { box-shadow: inset 0 2px 0 var(--accent); }
.cad-bar.cad-bar-drag { cursor: grab; }
.cad-bar.cad-bar-drag:active { cursor: grabbing; }
.cad-gantt-svg.cad-dragging-bar { cursor: grabbing; }

/* ---------- deeper analysis pages ---------- */
.cad-evm-table td:first-child { font-size: 13px; }
.cad-ok { color: var(--success) !important; }
.cad-bad { color: var(--danger) !important; }
.cad-link { color: var(--accent); cursor: pointer; }
.cad-link:hover { text-decoration: underline; }

/* ---------- newcomer-friendly: glossary, tooltips, empty state, advanced ---------- */
.cad-has-def { cursor: help; display: inline-flex; align-items: center; gap: 4px; }
.cad-info { font-size: 10px; color: var(--muted); opacity: .65; }
.cad-has-def:hover .cad-info { opacity: 1; color: var(--accent); }
.cad-gloss-list { display: flex; flex-direction: column; gap: 2px; max-height: 56vh; overflow-y: auto; margin-top: 8px; }
.cad-gloss-item { padding: 10px 10px; border-radius: var(--radius-sm); border-bottom: 1px solid var(--line); }
.cad-gloss-item.hi { background: var(--accent-bg); }
.cad-gloss-term { font-family: var(--font-display); font-size: 14px; text-transform: capitalize; margin-bottom: 2px; }
.cad-gloss-def { font-size: 13px; line-height: 1.5; }

.cad-empty { max-width: 680px; padding: 16px 0 40px; animation: cad-fade .3s ease both; }
.cad-empty h2 { font-size: 26px; margin-bottom: 8px; }
.cad-steps { list-style: none; padding: 0; margin: 22px 0; display: flex; flex-direction: column; gap: 14px; }
.cad-step { display: flex; gap: 14px; align-items: flex-start; }
.cad-stepn { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.cad-step strong { font-size: 14.5px; }
.cad-step .muted { font-size: 13px; line-height: 1.5; margin-top: 2px; }

.cad-advanced { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; background: color-mix(in srgb, var(--ink) 2%, transparent); }
.cad-advanced > summary { cursor: pointer; font-size: 13px; color: var(--ink-2); font-weight: 500; list-style-position: inside; }
.cad-advanced > summary:hover { color: var(--ink); }
.cad-advanced[open] > summary { color: var(--accent); margin-bottom: 4px; }

/* ---------- header tooltips + intro ---------- */
.cad-th-def { cursor: help; border-bottom: 1px dotted var(--line-2); }
.cad-legend-item[title] { cursor: help; }
.cad-introrow { padding: 8px 0; border-bottom: 1px solid var(--line); }
.cad-introrow:last-child { border-bottom: none; }
.cad-introrow strong { font-size: 14px; }
.cad-introrow .muted { font-size: 13px; line-height: 1.5; margin-top: 2px; }

/* ---------- template gallery ---------- */
.cad-tmpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cad-tmpl-card { display: block; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; background: var(--surface); cursor: pointer; font: inherit; color: inherit; transition: var(--transition); }
.cad-tmpl-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.cad-tmpl-cat { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 5px; }
.cad-tmpl-name { font-family: var(--font-display); font-size: 16px; margin-bottom: 5px; }
.cad-tmpl-blurb { font-size: 12.5px; line-height: 1.5; }
.cad-tmpl-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 12px; color: var(--muted); }
.cad-tmpl-go { color: var(--accent); }

/* ---------- export menu ---------- */
.cad-exp-list { display: flex; flex-direction: column; gap: 6px; }
.cad-exp-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); text-decoration: none; color: var(--ink); cursor: pointer; transition: var(--transition); }
.cad-exp-item:hover { border-color: var(--accent); }
.cad-exp-label { font-weight: 500; font-size: 14px; }
.cad-exp-item .muted { font-size: 12px; }
.cad-exp-dl { color: var(--accent); font-size: 16px; }

/* ---------- explain-this-page ---------- */
.cad-explain { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: color-mix(in srgb, var(--accent) 5%, transparent); margin: 10px 0 4px; }
.cad-explain > summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 500; }
.cad-explain-body { font-size: 13px; line-height: 1.6; margin-top: 8px; }
.cad-explain-body strong, .cad-explain-body em { color: var(--ink-2); font-style: normal; }

/* ---------- risk register & settings ---------- */
.cad-range-row { display: flex; align-items: center; gap: 12px; }
.cad-range { flex: 1; accent-color: var(--accent); }
.cad-range-val { font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; font-family: var(--font-display); }
.cad-risk-add { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- delay analysis ---------- */
.cad-delay-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cad-delay-row .cad-input { width: auto; }
.cad-delay-row select.cad-input { max-width: 240px; }
.cad-delay-out { border-top: 1px solid var(--line); padding-top: 10px; font-size: 13.5px; }

/* ---------- activity codes ---------- */
.cad-codechip { display: inline-block; margin-left: 8px; font-size: 10px; letter-spacing: .04em; padding: 1px 7px; border-radius: 100px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-2); cursor: pointer; vertical-align: middle; }
.cad-codechip:hover { border-color: var(--accent); color: var(--accent); }
.cad-codefilter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.cad-codetab { background: none; border: 1px solid var(--line); border-radius: 100px; padding: 3px 12px; font-size: 12px; cursor: pointer; color: var(--ink-2); }
.cad-codetab:hover { border-color: var(--accent); }
.cad-codetab.on { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* ---------- calendars ---------- */
.cad-dayrow { display: flex; gap: 6px; flex-wrap: wrap; }
.cad-daycheck { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 8px; cursor: pointer; }
.cad-daycheck input { accent-color: var(--accent); }

/* ---------- resource availability + curves ---------- */
.cad-res-item { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.cad-res-item:last-child { border-bottom: none; }
.cad-avail-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }

/* ---------- plain-English interpretation ---------- */
.cad-reading { border-left: 3px solid var(--muted); background: var(--surface-2, rgba(127,127,127,0.05)); padding: 10px 14px; border-radius: var(--radius-sm); margin: 0 0 14px; line-height: 1.55; font-size: 14px; }
.cad-reading strong { font-weight: 600; }
.cad-exec .cad-exec-summary { font-size: 15px; line-height: 1.6; margin: 0 0 14px; }
.cad-findings { display: flex; flex-direction: column; gap: 8px; }
.cad-finding { border-left: 3px solid var(--muted); padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2, rgba(127,127,127,0.04)); }
.cad-finding-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.cad-finding-tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

/* ---------- guided tour (two-mode coachmark, matches Bench/Lens) ---------- */
.tour-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade-in 200ms ease; }
.tour-anchored { position: fixed; inset: 0; z-index: 500; pointer-events: none; }
.tour-anchored .tour-card, .tour-anchored .tour-mask { pointer-events: auto; }
.tour-mask { position: fixed; background: rgba(0,0,0,0.60); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); transition: top .28s cubic-bezier(.16,1,.3,1), left .28s cubic-bezier(.16,1,.3,1), width .28s cubic-bezier(.16,1,.3,1), height .28s cubic-bezier(.16,1,.3,1); }
:root[data-theme="light"] .tour-mask { background: rgba(20,17,11,0.42); }
.tour-ring { position: fixed; pointer-events: none; border: 2px solid var(--accent); border-radius: var(--radius-sm); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 0 0 1px rgba(255,255,255,0.04); transition: top .28s cubic-bezier(.16,1,.3,1), left .28s cubic-bezier(.16,1,.3,1), width .28s cubic-bezier(.16,1,.3,1), height .28s cubic-bezier(.16,1,.3,1); z-index: 510; animation: tour-pulse 1.8s ease-in-out infinite; }
@keyframes tour-pulse { 0%,100% { box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 38%, transparent); } 50% { box-shadow: 0 0 26px color-mix(in srgb, var(--accent) 65%, transparent); } }
.tour-card { background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-lg); width: 430px; max-width: 94vw; padding: 22px 26px; box-shadow: var(--shadow-lg); z-index: 520; transition: top .28s cubic-bezier(.16,1,.3,1), left .28s cubic-bezier(.16,1,.3,1); }
.tour-card.centered { position: relative; transition: none; }
.tour-card.anchored { position: fixed; }
.tour-card-meta { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.20em; margin-bottom: 9px; }
.tour-card h3 { font-family: var(--font-display); font-weight: var(--w-display); font-size: 23px; margin: 0 0 11px; color: var(--ink); }
.tour-card .tour-body { color: var(--ink-2); line-height: 1.65; font-size: 14.5px; margin-bottom: 20px; }
.tour-card .tour-body strong { color: var(--ink); font-weight: 500; }
.tour-card .tour-body em { color: var(--accent); font-style: normal; font-family: var(--font-mono); font-size: 13px; }
.tour-card .tour-body kbd { font-size: 11px; border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; }
.tour-progress { display: flex; gap: 6px; margin-bottom: 18px; }
.tour-pip { flex: 1; height: 2px; background: var(--line-2); cursor: pointer; transition: background .15s ease; }
.tour-pip:hover { background: var(--ink-2); }
.tour-pip.on { background: var(--accent); }
.tour-pip.done { background: var(--ink-2); }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-chooser { max-width: 500px; text-align: left; }
.tour-choices { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 8px; }
.tour-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; width: 100%; text-align: left; padding: 13px 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .1s ease; }
.tour-choice:hover { border-color: var(--accent); background: var(--accent-bg); }
.tour-choice:active { transform: translateY(1px); }
.tour-choice-head { display: flex; align-items: baseline; gap: 10px; }
.tour-choice-tag { font-family: var(--font-display); font-size: 16px; color: var(--ink); }
.tour-choice-time { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.tour-choice-desc { font-size: 12.5px; line-height: 1.45; color: var(--muted); }

/* ---------- Gantt: pinned activity table + bars (P6/MSP-style split) ---------- */
.cad-gx-scroll { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.cad-gx { display: flex; align-items: flex-start; width: max-content; min-width: 100%; }
.cad-gx-table { position: sticky; left: 0; z-index: 3; background: var(--bg); border-collapse: collapse; flex: 0 0 auto; box-shadow: 1px 0 0 var(--line); }
.cad-gx-table thead th { height: 34px; padding: 0 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; white-space: nowrap; background: var(--surface-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.cad-gx-table thead th.num { text-align: right; }
.cad-gx-table td { height: 30px; padding: 0 10px; font-size: 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cad-gx-id { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.cad-gx-name { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.cad-gx-date { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12px; }
.cad-gx-float.neg { color: var(--danger); }
.cad-gx-msdot { color: var(--accent); }
.cad-gx-trow { cursor: pointer; transition: background .1s; }
.cad-gx-trow:hover td { background: var(--surface-2); }
.cad-gx-trow.crit .cad-gx-name, .cad-gx-trow.crit .cad-gx-id { color: var(--danger); }
.cad-gx-trow.sum td { font-weight: 600; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.cad-gx-chart { flex: 0 0 auto; }
.cad-gx-chart svg { display: block; }

/* ---------- P6-familiarity: context menu, predecessor cell, WBS, cheat-sheet ---------- */
.cad-cell-pred { min-width: 130px; font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--accent); }
.cad-cell-pred::placeholder { color: var(--muted); }
.cad-row-child .cad-cell-name { padding-left: 16px; }
.cad-row-sum .cad-cell-name { font-weight: 600; }
.cad-ctxmenu { position: fixed; z-index: 600; min-width: 196px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 5px; }
.cad-ctxitem { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; text-align: left; background: none; border: 0; border-radius: var(--radius-sm); padding: 7px 10px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.cad-ctxitem:hover { background: var(--surface-2); }
.cad-ctxitem.danger { color: var(--danger); }
.cad-ctxkey { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cad-ctxsep { height: 1px; background: var(--line); margin: 4px 6px; }
.cad-cheat { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.cad-cheat summary { cursor: pointer; padding: 10px 14px; font-size: 13px; color: var(--accent); }
.cad-cheat-body { padding: 4px 14px 14px; }
.cad-cheat-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cad-cheat-tbl td { padding: 4px 8px 4px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.cad-cheat-tbl td:first-child { white-space: nowrap; color: var(--ink); }

/* ---------- editable network: link handles, drag-to-link, click-to-remove ---------- */
.cad-net-svg .cad-node { cursor: grab; }
.cad-net-svg .cad-node:active { cursor: grabbing; }
.cad-net-handle { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; cursor: crosshair; opacity: 0; transition: opacity .12s; }
.cad-node:hover .cad-net-handle { opacity: 1; }
.cad-net-handle:hover { fill: var(--accent); }
.cad-node.linktarget .cad-node-box { stroke: var(--accent); stroke-width: 2; }
.cad-dep { pointer-events: none; }
.cad-dep-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.cad-dep-hit:hover { stroke: color-mix(in srgb, var(--danger) 24%, transparent); }
.cad-net-templine { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 4; pointer-events: none; }

/* ---------- Gantt direct-manipulation: resize grip, draggable milestone & data-date ---------- */
.cad-bar-grip { fill: transparent; cursor: ew-resize; }
.cad-bar-grip:hover { fill: color-mix(in srgb, var(--accent) 55%, transparent); }
.cad-ms.cad-bar-drag { cursor: grab; }
.cad-datadate-hit { stroke: transparent; stroke-width: 10; cursor: ew-resize; }
.cad-datadate-hit:hover { stroke: color-mix(in srgb, var(--accent) 20%, transparent); }

/* ---------- one-click DCMA fix ---------- */
.cad-quickfix { display: flex; align-items: center; gap: 12px; }
