/* =====================================================================
   V2.45 — Change Request Batch 26 (screen only: media="screen", so PDF / print output stays exactly as before)
   Item 10  floating elements: compact AI Assistant, safe area, stacking below windows
   Item 4/5 model loading and processing states
   (theme, sign-in and upload rules follow below in their own sections)
   ===================================================================== */

/* ---------- item 10: floating elements ---------- */
.as25.b26-float, .kx-tasks.b26-float { z-index: 95; transition: bottom .18s ease, right .18s ease; touch-action: none; }
.kx-upl { z-index: 95; }
.as25.b26-float.b26-drag, .kx-tasks.b26-float.b26-drag { transition: none; cursor: grabbing; }
.as25 .as25-fab { width: 52px; height: 52px; padding: 0; justify-content: center; border-radius: 50%; gap: 0; position: relative; cursor: grab;
  background: linear-gradient(135deg, var(--b26-sky-600, #0369a1), var(--b26-green-600, #15803d)); box-shadow: 0 8px 22px -6px rgba(3, 105, 161, .55), 0 0 0 3px color-mix(in srgb, var(--b26-sky-300, #7dd3fc) 45%, transparent); }
.as25 .as25-fab svg { width: 24px; height: 24px; }
.as25 .as25-fab > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.as25 .as25-fab:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -6px rgba(3, 105, 161, .6), 0 0 0 4px color-mix(in srgb, var(--b26-green-300, #86efac) 55%, transparent); }
.as25 .as25-fab:focus-visible { outline: 3px solid var(--focus, #0369a1); outline-offset: 3px; }
/* every page keeps room at the bottom so its last buttons can be scrolled clear of the floating elements */
.content { padding-bottom: calc(var(--b26-safe, 84px) + env(safe-area-inset-bottom, 0px)) !important; }
.modal { scroll-padding-bottom: 16px; }
@media (max-width: 600px) { .as25 .as25-fab { width: 46px; height: 46px; } .content { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; } }

/* ---------- items 4 and 5: model processing and streaming ---------- */
.b26-load, .b26-wait { max-width: 560px; margin: 0 auto; padding: 18px 20px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--shadow); }
.b26-load .ai-bar, .b26-wait .ai-bar { height: 8px; margin-top: 10px; }
.b26-q-state { font-weight: 650; }
.b26-load .ai-bar, .b26-wait .ai-bar, .b26-q .ai-bar { height: 8px; border-radius: 6px; background: var(--border); overflow: hidden; }
.b26-load .ai-bar span, .b26-wait .ai-bar span, .b26-q .ai-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--b26-sky-600, #0369a1), var(--b26-green-600, #15803d)); transition: width .45s ease; }

/* ---------- item 8: several reports in one go ---------- */
.b26-rlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; }
.b26-rlist label { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; }
.b26-rlist label.muted { opacity: .55; cursor: not-allowed; }
.b26-rlist .b26-rall { grid-column: 1 / -1; background: transparent; border-style: dashed; }
.b26-rprog { margin-top: 10px; } .b26-rprog .ai-bar { height: 8px; border-radius: 6px; background: var(--border); overflow: hidden; } .b26-rprog .ai-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--b26-sky-600, #0369a1), var(--b26-green-600, #15803d)); transition: width .3s ease; }
.b26-xlpv { max-height: 56vh; overflow: auto; }

/* =====================================================================
   Item 1 — theme: sky blue + green, no pure white (screen only; print and PDF keep their black-and-white standard).
   Contrast (WCAG 2.1 AA, normal text ≥ 4.5:1), light mode on --bg #eaf5fb / --surface #f5fafd:
     --text #0b2233 14.7:1 · --text-2 #2c4a5e 8.4:1 · --text-3 #48657a 5.5:1 · sky ink #075985 6.8:1 · green ink #166534 6.4:1
     · amber #8a4b06 6.1:1 · red #b42318 5.9:1 · white on primary #0369a1 5.9:1 · white on green #15803d 5.0:1.
   Dark mode on --bg #071a26 / --surface #0c2433:
     --text #e4f1f8 13.9:1 · --text-2 #bcd5e3 10.5:1 · --text-3 #8fb0c3 7.0:1 · sky ink #7dd3fc 9.6:1 · green ink #86efac 11.4:1
     · amber #fbbf24 9.6:1 · red #fca5a5 8.4:1.
   Red and amber stay for warnings and delays.
   ===================================================================== */
:root, html[data-ui="3"] {
  --b26-sky-50: #f0f8fd; --b26-sky-100: #dcf0fb; --b26-sky-300: #7dd3fc; --b26-sky-500: #0ea5e9; --b26-sky-600: #0577b3; --b26-sky-700: #0369a1; --b26-sky-800: #075985;
  --b26-green-100: #dcf5e5; --b26-green-300: #86efac; --b26-green-500: #22c55e; --b26-green-600: #16a34a; --b26-green-700: #15803d; --b26-green-800: #166534;
  --kx-gradient: linear-gradient(135deg, #0ea5e9, #22c55e);
  --primary: #0369a1; --primary-hover: #075985; --primary-ink: #075985; --primary-soft: #dcf0fb; --focus: #0369a1; --kx-green-aa: #0369a1;
  --secondary: #15803d; --secondary-hover: #166534; --secondary-ink: #166534; --accent: #075985;
  --bg: #eaf5fb; --bg-brand: #e6f6f1; --surface: #f5fafd; --surface-2: #eef7fb; --surface-3: #e3f1f7;
  --glass: rgba(242, 249, 253, .82); --glass-strong: rgba(244, 250, 253, .94); --glass-line: rgba(7, 89, 133, .10); --glass-hi: rgba(240, 248, 252, .9);
  --text: #0b2233; --text-2: #2c4a5e; --text-3: #48657a;
  --border: #cfe3ee; --border-strong: #b5d2e2;
  --sidebar-bg: rgba(238, 247, 252, .88); --sidebar-text: #10293b; --sidebar-muted: #48657a; --sidebar-line: #d3e6f0;
  --ok: #166534; --ok-bg: #dcf5e5; --info: #075985; --info-bg: #dcf0fb; --warn: #8a4b06; --warn-bg: #fdf1d3; --danger: #b42318; --danger-bg: #fde7e5; --neutral: #48657a; --neutral-bg: #e6eff4;
  --c-blue: #0369a1; --c-cyan: #0e7490; --c-green: #15803d; --c-amber: #b45309; --c-rose: #be123c;
  --glow: 0 0 0 1px color-mix(in srgb, #0369a1 30%, transparent), 0 8px 24px -6px color-mix(in srgb, #0ea5e9 40%, transparent);
  --shadow: 0 1px 2px rgba(7, 40, 60, .05), 0 8px 24px -10px rgba(7, 60, 90, .16);
}
:root[data-theme="dark"], html[data-ui="3"][data-theme="dark"] {
  --kx-gradient: linear-gradient(135deg, #0ea5e9, #22c55e);
  --primary: #0369a1; --primary-hover: #0577b3; --primary-ink: #7dd3fc; --primary-soft: rgba(14, 165, 233, .16); --focus: #7dd3fc; --kx-green-aa: #0577b3;
  --secondary: #16a34a; --secondary-ink: #86efac; --accent: #7dd3fc;
  --bg: #071a26; --bg-brand: #071a26; --surface: #0c2433; --surface-2: #0f2b3c; --surface-3: #143447;
  --glass: rgba(10, 32, 46, .74); --glass-strong: rgba(10, 32, 46, .92); --glass-line: rgba(125, 211, 252, .12); --glass-hi: rgba(125, 211, 252, .05);
  --text: #e4f1f8; --text-2: #bcd5e3; --text-3: #8fb0c3;
  --border: #1d3d50; --border-strong: #285068;
  --sidebar-bg: rgba(6, 22, 33, .88); --sidebar-text: #d7e9f3; --sidebar-muted: #8fb0c3; --sidebar-line: rgba(125, 211, 252, .12);
  --ok: #86efac; --ok-bg: rgba(34, 197, 94, .16); --info: #7dd3fc; --info-bg: rgba(14, 165, 233, .16); --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .14); --danger: #fca5a5; --danger-bg: rgba(248, 113, 113, .16); --neutral: #8fb0c3; --neutral-bg: #143447;
  --c-blue: #7dd3fc; --c-cyan: #67e8f9; --c-green: #86efac; --c-amber: #fbbf24; --c-rose: #fda4af;
  --glow: 0 0 0 1px rgba(125, 211, 252, .32), 0 0 28px -4px rgba(14, 165, 233, .42);
}
html[data-ui="3"] body, body { background: radial-gradient(1100px 620px at 92% -12%, rgba(14, 165, 233, .13), transparent 62%), radial-gradient(900px 620px at -12% 112%, rgba(34, 197, 94, .10), transparent 62%), var(--bg); background-attachment: fixed; }
html[data-ui="3"][data-theme="dark"] body, :root[data-theme="dark"] body { background: radial-gradient(1200px 700px at 88% -10%, rgba(14, 165, 233, .12), transparent 60%), radial-gradient(900px 600px at -10% 110%, rgba(34, 197, 94, .08), transparent 60%), var(--bg); background-attachment: fixed; }
/* buttons: sky blue for primary, green for approve / confirm / success actions */
html[data-ui="3"] .btn-primary, .btn-primary { background: linear-gradient(180deg, var(--b26-sky-600), var(--b26-sky-700)); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .16) inset, 0 6px 18px -8px rgba(3, 105, 161, .75); }
html[data-ui="3"] .btn-primary:hover, .btn-primary:hover { background: linear-gradient(180deg, var(--b26-sky-700), var(--b26-sky-800)); box-shadow: 0 8px 22px -8px rgba(3, 105, 161, .85); }
.btn.btn-ok, [data-e7="approve"].btn, [data-e7="check"].btn, [data-ai25all].btn, .btn[data-a="approve"] { background: linear-gradient(180deg, var(--b26-green-600), var(--b26-green-700)); color: #fff; border-color: transparent; }
.btn.btn-ok:hover, [data-e7="approve"].btn:hover, [data-e7="check"].btn:hover, [data-ai25all].btn:hover, .btn[data-a="approve"]:hover { background: linear-gradient(180deg, var(--b26-green-700), var(--b26-green-800)); }
html[data-ui="3"] .btn-primary:focus-visible, .btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* cards, windows, inputs and tables: tinted surfaces instead of white */
html[data-ui="3"] .brand .logo-box, .brand .logo-box, html[data-ui="3"] .kx-gate-mhead img { background: #f2f9fd; }
html[data-ui="3"] .nav a.active .num.new { background: #e8f6fd; color: #075985; }
input, select, textarea { background-color: var(--surface); color: var(--text); }
html[data-ui="3"] .nav a.active { background: linear-gradient(135deg, var(--b26-sky-700), var(--b26-green-700)); }
.kpi .val, .card.kpi .val { color: var(--text); }
a { color: var(--primary-ink); }
html[data-ui="3"] #kx-gate.l20 .kx-gate-card { background: rgba(240, 248, 253, .86); }

/* =====================================================================
   Item 2 — sign-in: the glass card in the top-right corner (version, T&C and "Forgot password?" unchanged)
   ===================================================================== */
@media (min-width: 981px) {
  html[data-ui="3"] #kx-gate .kx-gate-side { justify-content: flex-start; align-items: flex-end; padding: clamp(18px, 3.2vh, 34px) clamp(18px, 2.6vw, 40px) 28px; }
  html[data-ui="3"] #kx-gate .kx-gate-side > .kx-gate-card { margin: 0; }
  #kx-gate:not(.kx-gate3) { align-items: flex-start; justify-content: flex-end; padding: clamp(18px, 3.2vh, 34px) clamp(18px, 2.6vw, 40px); }
}
@media (max-width: 980px) { html[data-ui="3"] #kx-gate .kx-gate-side { align-items: stretch; } html[data-ui="3"] #kx-gate .kx-gate-card { margin: 0 auto; } }

/* =====================================================================
   Item 3 — one upload control everywhere (js/core/upl26.js)
   ===================================================================== */
.u26 { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 14px; padding: 16px 18px; margin: 4px 0 12px; border-radius: 14px; text-align: left; cursor: pointer;
  border: 2px dashed color-mix(in srgb, var(--b26-sky-500) 55%, var(--border)); color: var(--text-2);
  background: linear-gradient(135deg, color-mix(in srgb, var(--b26-sky-500) 9%, var(--surface)), color-mix(in srgb, var(--b26-green-500) 8%, var(--surface)));
  transition: border-color .2s ease, box-shadow .25s ease, transform .2s ease, background .25s ease; }
.u26.dropzone { padding: 16px 18px; } /* the earlier drop areas keep their own handlers */
.u26:hover, .u26:focus-within { border-color: var(--b26-sky-600); box-shadow: 0 0 0 4px color-mix(in srgb, var(--b26-sky-500) 18%, transparent), 0 10px 28px -14px rgba(3, 105, 161, .55); }
.u26:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
html.u26-dragging .u26 { border-color: var(--b26-green-600); background: linear-gradient(135deg, color-mix(in srgb, var(--b26-green-500) 14%, var(--surface)), color-mix(in srgb, var(--b26-sky-500) 12%, var(--surface))); }
.u26.u26-over, .u26.over, .dropzone.over.u26 { border-style: solid; border-color: var(--b26-green-600); transform: scale(1.01); box-shadow: 0 0 0 6px color-mix(in srgb, var(--b26-green-500) 22%, transparent), 0 16px 34px -14px rgba(21, 128, 61, .6); }
.u26 > .u26-ico { grid-row: span 2; width: 48px; height: 48px; display: block; margin: 0; padding: 6px; border-radius: 12px; background: linear-gradient(135deg, var(--b26-sky-600), var(--b26-green-600)); box-shadow: 0 8px 18px -8px rgba(3, 105, 161, .7); }
.u26-ico .u26-cloud { fill: rgba(255, 255, 255, .18); stroke: #fff; stroke-width: 2.4; stroke-linejoin: round; }
.u26-ico .u26-arrow path { fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.u26-ico .u26-arrow { animation: u26-lift 1.8s ease-in-out infinite; transform-origin: center; }
.u26:hover .u26-ico .u26-arrow, .u26.u26-over .u26-ico .u26-arrow { animation-duration: .9s; }
@keyframes u26-lift { 0%, 100% { transform: translateY(1.5px); opacity: .85; } 50% { transform: translateY(-2.5px); opacity: 1; } }
.u26 > div:not([class]), .u26 > .small { grid-column: 2; } /* the earlier drop areas' own lines */
.u26-t { display: grid; gap: 2px; min-width: 0; }
.u26-t b { color: var(--text); font-size: 14.5px; font-weight: 650; }
.u26-link { color: var(--primary-ink); text-decoration: underline; text-underline-offset: 3px; }
.u26-sub { font-size: 12px; color: var(--text-3); }
.u26-badges { grid-column: 2; display: flex; flex-wrap: wrap; gap: 5px; }
.u26-badges span { font: 650 10.5px/1 var(--mono); letter-spacing: .04em; padding: 4px 7px; border-radius: 999px; color: var(--primary-ink); background: color-mix(in srgb, var(--b26-sky-500) 13%, var(--surface)); border: 1px solid color-mix(in srgb, var(--b26-sky-500) 30%, transparent); }
.u26-file { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.u26-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; padding: 5px 10px; border-radius: 8px; background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.u26-chip em { font-style: normal; font-weight: 500; opacity: .85; margin-left: 4px; }
.u26.u26-has { border-style: solid; border-color: var(--b26-green-600); }
.u26-prog { grid-column: 1 / -1; position: relative; height: 22px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--b26-sky-500) 12%, var(--surface-3)); }
.u26-prog i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--b26-sky-600), var(--b26-green-600)); transition: width .4s ease; }
.u26-prog span { position: relative; display: block; text-align: center; font: 650 11.5px/22px var(--font); color: var(--text); text-shadow: 0 0 4px var(--surface); }
.u26-prog.u26-done i { background: var(--b26-green-700); } .u26-prog.u26-err i { background: var(--danger); }
.u26 > input.u26-in, .u26.dropzone > input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 1; font-size: 0; }
.u26.u26-top { margin-top: 0; }
label > .u26, .f > .u26 { margin-top: 6px; font-weight: 400; }
@media (max-width: 600px) { .u26 { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 14px; } .u26 > .u26-ico { grid-row: auto; } .u26-badges, .u26 > div:not([class]), .u26 > .small { grid-column: 1; justify-content: center; } }
@media (prefers-reduced-motion: reduce) { .u26-ico .u26-arrow { animation: none; } .u26, .u26-prog i { transition: none; } }

/* Item 10: when a screen has no clear place for the AI Assistant (a phone full of cards), it docks as a small tab at the
   right edge and slides out on hover or keyboard focus; a tap opens the assistant. */
.as25.b26-float { transition: transform .22s ease; }
.as25.b26-dock { transform: translateX(calc(100% - 18px)); }
.as25.b26-dock:hover, .as25.b26-dock:focus-within { transform: none; }
.as25.b26-dock .as25-fab { box-shadow: -4px 4px 14px rgba(3, 40, 64, .35); }
@media (prefers-reduced-motion: reduce) { .as25.b26-float { transition: none; } }
