/* ==========================================================================
   Enhansys chat kit (UI v2): loader, reasoning trace, streamed replies with
   sources and follow-ups, approval and recommendation cards, prompt bar,
   command palette, sidebar polish, selection actions, chart styles.
   Ported from design/ui-lab/prototype/uikit.css. Every element carries the
   .uik class and is gated on <html data-design="proposed">.
   Colour rule (Andrea, 2026-09-29): ink/monochrome like the platform tokens;
   the pink accent #FCC4AC — the Enhansys signature — only on live details
   (spinner arc, loader pixels, running dots, streaming caret).
   ========================================================================== */
html:not([data-design=proposed]) .uik { display: none !important; }

[data-design=proposed] {
  --radius-chip: 6px; --radius-control: 8px; --radius-card: 10px; --radius-window: 14px;
  --pink: #FCC4AC;
  --ink: var(--text); --ink-tint: var(--panel-2);
  --ok: var(--ok-text); --ok-tint: var(--ok-bg);
  --warn: var(--warn-text); --warn-tint: var(--warn-bg);
  --bad: var(--error-text); --bad-tint: var(--error-bg);
  --shadow-hairline: 0 0 0 1px var(--border);
  --shadow-card: 0 0 0 1px rgba(27, 27, 26, .06), 0 1px 2px rgba(0, 0, 0, .04), 0 2px 6px rgba(0, 0, 0, .04);
  --shadow-raised: 0 0 0 1px rgba(27, 27, 26, .08), 0 2px 10px rgba(0, 0, 0, .08);
  --shadow-overlay: 0 0 0 1px rgba(27, 27, 26, .08), 0 8px 28px rgba(0, 0, 0, .16);
  --ease-out-strong: cubic-bezier(.23, 1, .32, 1);
  /* semantic chart colours (validated with the dataviz palette script): bright line, pastel area */
  --c-pv: #eda100; --c-dis: #e34948; --c-chg: #008300; --c-cash: #008300; --c-grid: #2a78d6;
  --c-tint: .14; --c-fill: .28;
}
[data-design=proposed][data-theme=dark] {
  --c-pv: #c98500; --c-dis: #ee6a6a; --c-chg: #1fa44c; --c-cash: #1fa44c; --c-grid: #3987e5;
  --c-tint: .2; --c-fill: .32;
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, .1), 0 1px 2px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .25);
  --shadow-raised: 0 0 0 1px rgba(255, 255, 255, .12), 0 2px 10px rgba(0, 0, 0, .3);
  --shadow-overlay: 0 0 0 1px rgba(255, 255, 255, .14), 0 8px 28px rgba(0, 0, 0, .4);
}

@keyframes uik-shimmer { 0% { background-position: 150% } to { background-position: -50% } }
@keyframes uik-pixel { 0%, to { opacity: .18 } 50% { opacity: 1 } }
@keyframes uik-fade-up { 0% { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@keyframes uik-pop { 0% { opacity: 0; transform: scale(.96) } to { opacity: 1; transform: none } }
@keyframes uik-caret { 0%, to { opacity: 1 } 50% { opacity: 0 } }
@keyframes uik-spin { to { transform: rotate(1turn) } }
@keyframes uik-pulse { 0%, to { opacity: .35; transform: scale(.8) } 50% { opacity: 1; transform: scale(1) } }

[data-design=proposed] .message, [data-design=proposed] .report-chip, [data-design=proposed] .reasoning { animation: uik-fade-up .28s var(--ease-out-strong) both; }

/* shared bits */
.uik-shimmer { background: linear-gradient(90deg, var(--text-muted) 0%, var(--text) 45%, var(--text-muted) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: uik-shimmer 1.8s linear infinite; }
.uik-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.uik-kbd { font: 500 9px/1 var(--font-mono); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 3px 5px; color: var(--text-muted); background: var(--bg); }
.uik-btn { font: inherit; font-size: 11px; font-weight: 500; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: var(--radius-control); padding: 7px 12px; cursor: pointer; box-shadow: 0 1px 1px rgba(0, 0, 0, .03); transition: background .15s, transform .15s; }
.uik-btn:hover { background: var(--panel-2); }
.uik-btn:active { transform: translateY(1px); }
.uik-btn.primary { background: var(--btn-bg); color: var(--btn-tx); border-color: var(--btn-bg); }
.uik-btn.primary:hover { opacity: .9; }
.uik-btn:disabled { opacity: .45; cursor: default; transform: none; }
.uik-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; font-weight: 600; letter-spacing: .04em; padding: 2px 7px; border-radius: var(--radius-chip); background: var(--panel-2); color: var(--text-muted); text-transform: uppercase; white-space: nowrap; }
.uik-tag.ok { background: var(--ok-tint); color: var(--ok); }
.uik-tag.warn { background: var(--warn-tint); color: var(--warn); }
.uik-tag.bad { background: var(--bad-tint); color: var(--bad); }
.uik-tag.ink { background: var(--text); color: var(--bg); }
.uik-entity { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px 1px 3px; border-radius: var(--radius-chip); background: var(--panel-2); font-weight: 500; font-size: .92em; vertical-align: baseline; white-space: nowrap; }
.uik-entity i { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 4px; background: var(--text); color: var(--bg); font: 600 8.5px/1 var(--font-sans); font-style: normal; }
.uik-num { font-family: var(--font-mono); font-size: .92em; padding: 1px 5px; border-radius: 4px; background: var(--panel-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.uik-num.neg { background: var(--bad-tint); color: var(--bad); }
.uik-num.pos { background: var(--ok-tint); color: var(--ok); }
.uik-eyebrow { font-size: 9px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted); font-weight: 500; }
.uik-card { background: var(--bg); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 16px 18px; }
[data-theme=dark] .uik-card { background: var(--panel); }
/* the platform's own wheel: neutral ring, one pink arc */
.uik-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--pink); animation: uik-spin .8s linear infinite; display: inline-block; box-sizing: border-box; flex: 0 0 auto; }
/* The wheel turns only while the agent works; a settled trace shows no wheel (Andrea, 2026-09-30). */
.uik-spin.still { display: none; }
.uik-status { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 9px; flex: 0 0 auto; box-sizing: border-box; }
.uik-status.idle { border: 1.5px dashed var(--border); }
.uik-status.done { background: var(--ok-tint); color: var(--ok); }
.uik-status.warn { background: var(--warn-tint); color: var(--warn); }
.uik-status.fail { background: var(--bad-tint); color: var(--bad); }
.uik-status.wait { border: 1.5px solid var(--warn); }
.uik-status.wait::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); animation: uik-pulse 1.4s infinite; }
.uik-status.running { border: 2px solid var(--border); border-top-color: var(--pink); animation: uik-spin .8s linear infinite; }

/* 01 · Loading state ------------------------------------------------------ */
[data-design=proposed] #agentPending { display: none !important; }
.uik-loader { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 4px auto 0; padding-left: 2px; font-size: 12px; }
.uik-loader.hidden { display: none; }
.uik-pixels { display: grid; grid-template-columns: repeat(4, 4px); gap: 2px; flex: 0 0 auto; }
.uik-pixels i { width: 4px; height: 4px; background: var(--pink); border-radius: 1px; animation: uik-pixel 1.2s ease-in-out infinite; }
.uik-pixels i:nth-child(1) { animation-delay: 0s } .uik-pixels i:nth-child(2) { animation-delay: .1s } .uik-pixels i:nth-child(3) { animation-delay: .2s } .uik-pixels i:nth-child(4) { animation-delay: .3s }
.uik-pixels i:nth-child(5) { animation-delay: .1s } .uik-pixels i:nth-child(6) { animation-delay: .2s } .uik-pixels i:nth-child(7) { animation-delay: .3s } .uik-pixels i:nth-child(8) { animation-delay: .4s }
.uik-pixels i:nth-child(9) { animation-delay: .2s } .uik-pixels i:nth-child(10) { animation-delay: .3s } .uik-pixels i:nth-child(11) { animation-delay: .4s } .uik-pixels i:nth-child(12) { animation-delay: .5s }
.uik-pixels i:nth-child(13) { animation-delay: .3s } .uik-pixels i:nth-child(14) { animation-delay: .4s } .uik-pixels i:nth-child(15) { animation-delay: .5s } .uik-pixels i:nth-child(16) { animation-delay: .6s }
.uik-loader-label { font-weight: 500; }
.uik-loader-elapsed { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.uik-loader-tool { font-size: 11px; color: var(--text-muted); border-left: 1px solid var(--border); padding-left: 10px; }

/* 02 · Thinking trace + 05 · tool chips + 10 · context cards ------------- */
[data-design=proposed] .reasoning { border: 0; box-shadow: var(--shadow-hairline); border-radius: var(--radius-card); background: var(--panel); max-width: 760px; }
[data-design=proposed] .reasoning summary { padding: 9px 12px; gap: 9px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
[data-design=proposed] .reasoning-label { font-weight: 500; }
[data-design=proposed] .reasoning.live .reasoning-label { animation: none; }
[data-design=proposed] .uik-orig { display: none !important; }
.uik-count { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
[data-design=proposed] .reasoning.live .reasoning-label { background: linear-gradient(90deg, var(--text-muted) 0%, var(--text) 45%, var(--text-muted) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: uik-shimmer 1.8s linear infinite; }
.uik-summary-chips { display: none; flex-basis: 100%; flex-wrap: wrap; gap: 4px; padding: 6px 0 0 25px; }
.reasoning:not([open]) .uik-summary-chips:not(:empty) { display: flex; }
.uik-summary-chips span { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-chip); padding: 2px 7px; }
[data-design=proposed] .reasoning-body { padding: 10px 14px 12px 14px; gap: 0; max-height: 360px; border-top: 1px solid var(--border); background: var(--bg); border-radius: 0 0 var(--radius-card) var(--radius-card); }
[data-theme=dark][data-design=proposed] .reasoning-body { background: var(--panel); }
[data-design=proposed] .reasoning-entry { display: block; padding: 0; font-family: var(--font-sans); font-size: 12px; color: var(--text-2); }
[data-design=proposed] .reasoning-entry::before { content: none; }
.uik-step, .uik-ctx-entry { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; column-gap: 10px; align-items: start; padding: 5px 0; }
[data-design=proposed] .reasoning-entry + .reasoning-entry .uik-step::after, [data-design=proposed] .reasoning-entry + .uik-ctx-entry::after { content: ''; position: absolute; left: 9.5px; top: -8px; height: 12px; border-left: 1px solid var(--border); }
.uik-step-ico { width: 20px; height: 20px; border-radius: 6px; background: var(--panel-2); color: var(--text-muted); display: grid; place-items: center; font-size: 10px; margin-top: 1px; }
.reasoning-entry.tool .uik-step-ico { background: var(--text); color: var(--bg); }
.uik-step-main { min-width: 0; display: flex; flex-wrap: wrap; gap: 5px 7px; align-items: center; line-height: 1.5; }
.uik-tool-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-chip); padding: 2px 8px; color: var(--text); }
.uik-tool-chip b { font-weight: 500; }
.uik-tool-chip .st { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }
.uik-tool-chip.running .st { background: var(--pink); animation: uik-pulse 1s infinite; }
.uik-step-detail { color: var(--text-muted); font-size: 11.5px; }
.uik-dur { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); white-space: nowrap; margin-top: 3px; }
.uik-dur:empty { display: none; }
.uik-file-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-chip); padding: 2px 7px; }
.uik-file-chip em { font-style: normal; font-size: 8.5px; font-weight: 700; letter-spacing: .04em; color: var(--text-muted); }
[data-design=proposed] .reasoning-entry.text { border: 0; padding-left: 0; }
[data-design=proposed] .reasoning-entry.text .uik-step-main { display: block; color: var(--text-muted); border-left: 2px solid var(--border); padding-left: 8px; }
[data-design=proposed] .reasoning-entry.text .uik-step-main p { margin: 0 0 4px; }
[data-design=proposed] .reasoning-entry.text .uik-step-main p:last-child { margin: 0; }
.uik-ctx { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 4px 0 6px; }
.uik-ctx-card { background: var(--panel); border-radius: var(--radius-card); box-shadow: var(--shadow-hairline); padding: 10px 12px; font-size: 11.5px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.uik-ctx-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.uik-ctx-head strong { font-weight: 550; font-size: 11.5px; }
.uik-ctx-head span { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-faint); white-space: nowrap; }
.uik-ctx-excerpt { color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.uik-ctx-src { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-2); }

/* 03 · Streaming text: sources + follow-ups --------------------------------- */
.uik-caret { display: inline-block; width: 2px; height: 1em; background: var(--pink); box-shadow: 0 0 0 .5px var(--text-faint); vertical-align: -2px; margin-left: 2px; animation: uik-caret .9s steps(1) infinite; }
.uik-sources { margin: 6px 0 0 27px; font-size: 11px; }
.uik-sources > button { font: inherit; font-size: 11px; color: var(--text-muted); background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.uik-sources > button:hover { color: var(--text); }
.uik-src-stack { display: inline-flex; }
.uik-src-stack i { width: 16px; height: 16px; border-radius: 5px; background: var(--panel-2); border: 1.5px solid var(--bg); display: inline-grid; place-items: center; font: 700 7px/1 var(--font-sans); font-style: normal; color: var(--text-muted); margin-left: -5px; }
.uik-src-stack i:first-child { margin-left: 0; }
.uik-src-list { display: none; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.uik-sources.open .uik-src-list { display: flex; animation: uik-fade-up .2s var(--ease-out-strong); }
.uik-src { display: inline-flex; align-items: center; gap: 7px; background: var(--panel); box-shadow: var(--shadow-hairline); border-radius: var(--radius-chip); padding: 5px 9px; cursor: pointer; font-size: 11px; }
.uik-src:hover { background: var(--panel-2); }
.uik-src em { font-style: normal; font-size: 8.5px; font-weight: 700; color: var(--text-muted); letter-spacing: .04em; }
.uik-followups { margin: 12px 0 0 27px; }
.uik-followups .uik-eyebrow { margin-bottom: 7px; }
.uik-followups div { display: flex; flex-wrap: wrap; gap: 6px; }
.uik-followups button { font: inherit; font-size: 12.5px; color: var(--text-2); background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, border-color .15s; }
.uik-followups button:hover { background: var(--panel); border-color: var(--text-faint); }
.uik-followups button span { color: var(--text-faint); }

/* 04 · Approval card ------------------------------------------------------- */
.uik-approval { max-width: 560px; margin-left: 27px; display: flex; flex-direction: column; gap: 12px; }
.uik-approval h3 { font-size: 15px; font-weight: 550; letter-spacing: -.2px; margin: 2px 0 0; }
.uik-approval-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.uik-approval-params div { background: var(--panel); border-radius: var(--radius-chip); padding: 7px 9px; min-width: 0; }
.uik-approval-params small { display: flex; justify-content: space-between; gap: 6px; font-size: 9.5px; color: var(--text-muted); }
.uik-approval-params b { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uik-approval-params b i { font-style: normal; color: var(--text-muted); font-size: 10px; }
.uik-options { display: flex; flex-direction: column; gap: 6px; }
.uik-option { display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; font-size: 13px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 9px 12px; cursor: pointer; color: var(--text); transition: border-color .15s, background .15s; }
.uik-option:hover { background: var(--panel); }
.uik-option[aria-checked=true] { border-color: var(--text); background: var(--panel); }
.uik-option .rad { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--text-faint); flex: 0 0 auto; display: grid; place-items: center; }
.uik-option[aria-checked=true] .rad { border-color: var(--text); }
.uik-option[aria-checked=true] .rad::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text); }
.uik-option small { margin-left: auto; color: var(--text-faint); font-size: 10.5px; white-space: nowrap; }
.uik-approval-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.uik-approval-foot .step { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); margin-right: auto; }
.uik-approval.answered { opacity: .72; }
.uik-approval.answered .uik-options, .uik-approval.answered .uik-approval-input, .uik-approval.answered .uik-approval-foot .uik-btn { display: none; }
.uik-approval-input textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; line-height: 1.5; border: 1px solid var(--text); border-radius: var(--radius-control); padding: 9px 11px; background: var(--bg); color: var(--text); resize: vertical; outline: none; }
.uik-approval-input[hidden] { display: none; }
.uik-approval-answer { display: none; font-size: 12px; color: var(--text-2); background: var(--panel); border-radius: var(--radius-chip); padding: 8px 10px; }
.uik-approval.answered .uik-approval-answer { display: flex; gap: 8px; align-items: center; }

/* 09 · Recommendation card ------------------------------------------------- */
.uik-reco { max-width: 560px; margin-left: 27px; display: flex; flex-direction: column; gap: 12px; }
.uik-reco h3 { font-size: 15px; font-weight: 550; margin: 0; letter-spacing: -.2px; }
.uik-reco p { margin: 0; font-size: 13px; line-height: 1.75; color: var(--text-2); }
.uik-reco-alts { display: flex; flex-direction: column; gap: 4px; }
.uik-reco-alt { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; padding: 7px 10px; background: var(--panel); border-radius: var(--radius-chip); }
.uik-meter { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--text-muted); }
.uik-meter div { display: flex; gap: 3px; }
.uik-meter i { width: 14px; height: 6px; border-radius: 2px; background: var(--panel-2); }
.uik-meter i.on { background: var(--text); }
.uik-meter i.on.mid { background: var(--warn); }
.uik-reco-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.uik-reco-foot .btns { display: flex; gap: 6px; }

/* 06 · Task rows (Analysis dashboard) --------- */
.uik-tasks { display: flex; flex-direction: column; box-shadow: var(--shadow-hairline); border-radius: var(--radius-card); background: var(--bg); overflow: hidden; }
[data-theme=dark] .uik-tasks { background: var(--panel); }
.uik-task { display: flex; align-items: center; gap: 9px; padding: 9px 12px; font-size: 13px; border-top: 1px solid var(--border); }
.uik-task:first-child { border-top: 0; }
.uik-task .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.uik-task .det { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.uik-task.sub { padding: 5px 12px 5px 34px; border-top: 0; font-size: 12px; }
.uik-task.sub .name { font-weight: 400; color: var(--text-2); }
.uik-task.sub .uik-status { width: 12px; height: 12px; font-size: 7px; }
.uik-task.sub + .uik-task:not(.sub) { border-top: 1px solid var(--border); }
.uik-task.sub:last-child { padding-bottom: 9px; }

/* 17 · Insight cards + charts (Analysis dashboard) --------------------------- */
.uik-insights { box-shadow: var(--shadow-card); border-radius: var(--radius-card); background: var(--bg); overflow: hidden; }
[data-theme=dark] .uik-insights { background: var(--panel); }
.uik-insights[hidden] { display: none; }
.uik-ins-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 550; }
.uik-ins-head .cnt { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); background: var(--panel-2); padding: 1px 6px; border-radius: 4px; }
.uik-ins-head nav { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.uik-ins-head nav span { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); padding: 0 4px; }
.uik-ins-head nav button { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); cursor: pointer; font-size: 11px; }
.uik-ins-head nav button:hover { background: var(--panel-2); color: var(--text); }
.uik-ins-body { padding: 12px 12px 10px; animation: uik-fade-up .25s var(--ease-out-strong); }
.uik-ins-body p { margin: 0 0 10px; font-size: 13px; line-height: 1.75; color: var(--text-2); }
.uik-ins-title { font-size: 9.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-faint); margin: 0 0 6px; font-weight: 500; }
.uik-chart { position: relative; width: 100%; }
.uik-chart svg { width: 100%; height: auto; display: block; overflow: visible; font-family: var(--font-mono); }
.uik-chart .grid { stroke: var(--border); stroke-width: 1; }
.uik-chart .axis { fill: var(--text-faint); font-size: 10px; }
.uik-chart .lbl { fill: var(--text-2); font-size: 10.5px; }
.uik-chart .bar { fill: var(--text); }
.uik-chart .bar.dim { fill: var(--text); opacity: .3; }
.uik-chart .bar.s2 { fill: var(--text); opacity: .3; }
.uik-chart .bar.neg { fill: var(--text); opacity: .3; }
.uik-chart .line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.uik-chart .line.s2 { stroke: var(--text-faint); stroke-dasharray: 4 3; }
.uik-chart .area { fill: var(--text); opacity: .06; }
.uik-chart .zero { stroke: var(--text-faint); stroke-dasharray: 3 3; }
.uik-chart .dot { fill: var(--bg); stroke: var(--text); stroke-width: 2; }
.uik-chart .hit { fill: transparent; cursor: crosshair; }
.uik-chart .cross { stroke: var(--text-faint); stroke-width: 1; display: none; }
.uik-chart .band { fill: var(--pink); }
.uik-chart .band.f1 { opacity: .45; } .uik-chart .band.f2 { opacity: .2; } .uik-chart .band.f3 { opacity: 0; }
/* load: ink line, grey area · PV: yellow · grid import: the pink accent · money: green */
.uik-chart .line.c-load { stroke: var(--text); } .uik-chart .area.c-load { fill: var(--text); opacity: .1; }
.uik-chart .line.c-load2 { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 3 3; }
.uik-chart .line.c-pv { stroke: var(--c-pv); } .uik-chart .area.c-pv { fill: var(--c-pv); opacity: var(--c-tint); }
.uik-chart .line.c-cash { stroke: var(--c-cash); } .uik-chart .area.c-cash { fill: var(--c-cash); opacity: var(--c-tint); }
.uik-chart .line.c-grid { stroke: var(--c-grid); } .uik-chart .area.c-grid { fill: var(--c-grid); opacity: var(--c-tint); }
.uik-chart .bstrip { fill: var(--text); } .uik-chart .bstrip.f1 { opacity: .4; } .uik-chart .bstrip.f2 { opacity: .18; } .uik-chart .bstrip.f3 { opacity: .06; }
.uik-chart .dot.c-cash { stroke: var(--c-cash); }
.uik-chart .pt { fill: var(--bg); stroke: var(--text); stroke-width: 2; }
.uik-chart .hline { stroke: var(--text-muted); stroke-dasharray: 5 4; stroke-width: 1.2; }
/* bars: bright outline, pastel inside */
.uik-chart .bar.c-dis { fill: var(--c-dis); fill-opacity: var(--c-fill); stroke: var(--c-dis); stroke-width: 1.5; opacity: 1; }
.uik-chart .bar.c-chg { fill: var(--c-chg); fill-opacity: var(--c-fill); stroke: var(--c-chg); stroke-width: 1.5; opacity: 1; }
.uik-chart .bar.c-pink { fill: var(--pink); fill-opacity: .55; stroke: var(--pink); stroke-width: 1.5; opacity: 1; }
.uik-chart .bar.c-base { fill: var(--text); fill-opacity: .12; stroke: var(--text-faint); stroke-width: 1.2; opacity: 1; }
.uik-chart .bar.c-load { fill: var(--text); fill-opacity: .12; stroke: var(--text); stroke-width: 1.2; opacity: 1; }
.uik-legend i.c-load { border-color: var(--text); } .uik-legend i.c-load2 { border-top: 2px dashed var(--text); } .uik-legend i.c-pv { border-color: var(--c-pv); } .uik-legend i.c-cash { border-color: var(--c-cash); }
.uik-legend i.c-grid { border-color: var(--c-grid); }
.uik-legend i.box { background: transparent; }
.uik-legend i.box.c-dis { border: 1.5px solid var(--c-dis); background: rgba(227, 73, 72, .28); }
.uik-legend i.box.c-chg { border: 1.5px solid var(--c-chg); background: rgba(0, 131, 0, .28); }
.uik-legend i.box.c-pink { border: 1.5px solid var(--pink); background: rgba(252, 196, 172, .55); }
.uik-legend i.box.c-base { border: 1.2px solid var(--text-faint); background: rgba(27, 27, 26, .12); }
.uik-legend i.box.c-load { border: 1.2px solid var(--text); background: rgba(27, 27, 26, .12); }
.uik-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-muted); margin: 6px 0 0; }
.uik-legend span { display: inline-flex; align-items: center; gap: 5px; }
.uik-legend i { width: 14px; height: 0; border-top: 2px solid var(--text); }
.uik-legend i.s2 { border-top: 2px dashed var(--text-faint); }
.uik-legend i.box { width: 10px; height: 10px; border: 0; background: var(--text); border-radius: 2px; }
.uik-legend i.box.s2 { background: var(--text); opacity: .3; }
.uik-hbar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 44px; align-items: center; gap: 8px; font-size: 12px; margin: 6px 0; color: var(--text-2); }
.uik-hbar i { display: block; height: 10px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.uik-hbar i::after { content: ''; display: block; height: 100%; width: var(--w, 0%); background: rgba(252, 196, 172, .55); box-shadow: inset 0 0 0 1.5px var(--pink); border-radius: 3px; box-sizing: border-box; }
.uik-hbar.c-cash i::after { background: rgba(0, 131, 0, .22); box-shadow: inset 0 0 0 1.5px var(--c-cash); }
[data-theme=dark] .uik-hbar.c-cash i::after { background: rgba(31, 164, 76, .28); box-shadow: inset 0 0 0 1.5px var(--c-cash); }
.uik-hbar b { font-family: var(--font-mono); font-weight: 500; text-align: right; color: var(--text); }
.uik-ins-stats { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.uik-ins-stat { flex: 1; min-width: 80px; background: var(--panel); border-radius: var(--radius-chip); padding: 7px 9px; }
.uik-ins-stat small { display: block; font-size: 10.5px; color: var(--text-muted); }
.uik-ins-stat b { font-family: var(--font-mono); font-weight: 500; font-size: 13px; }
.uik-ins-foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-faint); }
.uik-ins-foot button { font: inherit; font-size: 10.5px; color: var(--text-2); background: none; border: 0; cursor: pointer; padding: 0; }
.uik-ins-foot button:hover { color: var(--text); text-decoration: underline; }
.uik-tip { position: fixed; z-index: 200; pointer-events: none; background: var(--text); color: var(--bg); font-size: 11.5px; max-width: 320px; white-space: normal; font-family: var(--font-mono); padding: 5px 8px; border-radius: 6px; box-shadow: var(--shadow-raised); display: none; }
.uik-tip.show { display: block; animation: uik-pop .12s var(--ease-out-strong); }

/* 08 · Prompt bar ----------------------------------------------------------- */
[data-design=proposed] .composer { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px 12px 10px; position: relative; }
[data-design=proposed] .composer textarea { padding: 2px 4px; }
.uik-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.uik-bar-left, .uik-bar-right { display: flex; align-items: center; gap: 4px; }
[data-design=proposed] .uik-bar .attach-button { width: 28px; height: 28px; border-radius: var(--radius-control); font-size: 16px; }
[data-design=proposed] .uik-bar .send-button { width: 30px; height: 30px; }
.uik-bar-btn { height: 28px; padding: 0 9px; display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 11px; color: var(--text-muted); background: transparent; border: 0; border-radius: var(--radius-control); cursor: pointer; }
.uik-bar-btn:hover { background: var(--panel-2); color: var(--text); }
.uik-bar-btn b { font-family: var(--font-mono); font-weight: 500; font-size: 12px; }
.uik-popover { position: absolute; left: 12px; bottom: calc(100% + 8px); width: min(340px, calc(100% - 24px)); background: var(--bg); border-radius: var(--radius-card); box-shadow: var(--shadow-overlay); padding: 6px; z-index: 30; animation: uik-pop .14s var(--ease-out-strong); }
[data-theme=dark] .uik-popover { background: var(--panel-2); }
.uik-popover[hidden] { display: none; }
.uik-pop-head { display: flex; justify-content: space-between; font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-faint); padding: 6px 8px 5px; }
.uik-pop-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 7px; font-size: 12px; cursor: pointer; }
.uik-pop-item .ico { width: 22px; height: 22px; border-radius: 6px; background: var(--panel-2); display: grid; place-items: center; font-size: 10px; font-family: var(--font-mono); color: var(--text-muted); flex: 0 0 auto; }
.uik-pop-item .lab { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uik-pop-item .hint { font-size: 10.5px; color: var(--text-faint); white-space: nowrap; }
.uik-pop-item.active, .uik-pop-item:hover { background: var(--panel); }
.uik-pop-empty { padding: 12px 8px; font-size: 11.5px; color: var(--text-muted); text-align: center; }

/* 15 · Command palette ------------------------------------------------------ */
.uik-search { display: flex; align-items: center; gap: 8px; margin: 0 20px 6px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--bg); color: var(--text-muted); font: inherit; font-size: 11.5px; cursor: pointer; text-align: left; }
.uik-search:hover { background: var(--panel-2); }
.uik-search span { flex: 1; }
.uik-palette-wrap { position: fixed; inset: 0; z-index: 120; display: grid; place-items: start center; padding-top: 14vh; background: rgba(16, 23, 28, .32); backdrop-filter: blur(3px); }
.uik-palette-wrap.hidden { display: none; }
.uik-palette { width: min(560px, calc(100% - 32px)); background: var(--bg); border-radius: var(--radius-window); box-shadow: var(--shadow-overlay); overflow: hidden; animation: uik-pop .16s var(--ease-out-strong); }
[data-theme=dark] .uik-palette { background: var(--panel); }
.uik-palette-in { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.uik-palette-in input { flex: 1; font: inherit; font-size: 14px; border: 0; background: transparent; color: var(--text); outline: none; }
.uik-palette-list { max-height: 360px; overflow: auto; padding: 6px; }
.uik-palette-group { font-size: 9.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-faint); padding: 8px 10px 4px; }
.uik-palette-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 12.5px; }
.uik-palette-item .ico { width: 24px; height: 24px; border-radius: 6px; background: var(--panel-2); display: grid; place-items: center; font-size: 11px; color: var(--text-muted); flex: 0 0 auto; }
.uik-palette-item .lab { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uik-palette-item .lab mark { background: var(--pink); color: var(--text); border-radius: 2px; }
.uik-palette-item .meta { font-size: 10px; color: var(--text-faint); }
.uik-palette-item.active { background: var(--panel); }
.uik-palette-empty { padding: 28px 12px; text-align: center; color: var(--text-muted); font-size: 12px; }
.uik-palette-empty b { display: block; color: var(--text); font-weight: 500; margin-bottom: 4px; }
.uik-palette-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-faint); }

/* 14 · Sidebar nav: gliding hover, groups, usage ----------------------------- */
[data-design=proposed] .thread-list { position: relative; }
[data-design=proposed] .thread-item { position: relative; z-index: 1; background: transparent; }
[data-design=proposed] .thread-item:hover:not(.active) { background: transparent; }
.uik-glide { position: absolute; left: 10px; right: 10px; border-radius: 8px; background: var(--panel-2); opacity: 0; transition: top .22s var(--ease-out-strong), height .22s var(--ease-out-strong), opacity .15s; pointer-events: none; z-index: 0; }
.uik-glide.on { opacity: 1; }
.uik-group { font-size: 9px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-faint); padding: 10px 12px 4px; }

/* 20 · Selection actions ---------------------------------------------------- */
.uik-selbar { position: fixed; z-index: 150; display: flex; gap: 2px; padding: 4px; background: var(--text); border-radius: 9px; box-shadow: var(--shadow-overlay); animation: uik-pop .14s var(--ease-out-strong); }
.uik-selbar.hidden { display: none; }
.uik-selbar button { font: inherit; font-size: 11px; color: var(--bg); background: transparent; border: 0; border-radius: 6px; padding: 5px 9px; cursor: pointer; }
.uik-selbar button:hover { background: rgba(255, 255, 255, .14); }
[data-theme=dark] .uik-selbar button:hover { background: rgba(0, 0, 0, .18); }
.uik-selbar b { width: 1px; background: rgba(255, 255, 255, .2); margin: 4px 3px; }

@media (max-width: 980px) { .uik-approval, .uik-reco { margin-left: 0; } .uik-sources, .uik-followups { margin-left: 0; } }
@media (max-width: 560px) { .uik-bar-btn .txt { display: none; } .uik-loader-tool { display: none; } .uik-reco-foot { flex-wrap: wrap; } .uik-reco-foot .btns { width: 100%; justify-content: flex-end; } .uik-approval-foot { flex-wrap: wrap; } }

.uik-chart .area.stack { opacity: .32; }
.uik-legend i.box.c-grid { border: 1.5px solid var(--c-grid); background: rgba(42, 120, 214, .3); }
.uik-legend i.box.c-pv { border: 1.5px solid var(--c-pv); background: rgba(237, 161, 0, .3); }
.uik-chart .area.c-dis { fill: var(--c-dis); } .uik-chart .line.c-dis { stroke: var(--c-dis); stroke-width: 1.5; }
.uik-chart .area.c-chg { fill: var(--c-chg); } .uik-chart .line.c-chg { stroke: var(--c-chg); stroke-width: 1.5; }
.uik-chart .line.c-grid.stackline { stroke-width: 1.5; }
