/* V2.39 (Change Request Batch 23). Screen only (media="screen" in index.html), so printing and PDF exports are unchanged.
   1. the profile panel fits its content (no scroll bars) and keeps its free resize
   2. fluid layout: the page uses the whole width next to the menu at every window size
   3. live icons: the motion of each icon (data-kxi, set by js/core/icons23.js) */

/* ---------- 1. Profile panel ---------- */
.popover[data-acct] { overflow: visible !important; max-height: none !important; height: auto !important; }
.popover[data-acct] .li { overflow-wrap: anywhere; }
/* a very short window (a phone on its side): the panel cannot fit, so it scrolls up and down only */
@media (max-height: 520px) { .popover[data-acct] { overflow-x: hidden !important; overflow-y: auto !important; max-height: calc(100dvh - var(--header-h, 56px) - 12px) !important; } }

/* ---------- 2. Fluid layout ---------- */
/* Root cause: .content had max-width: 1600px (css/app.css, since V1). With the menu open the content stopped at 1600 px
   and the rest of the window stayed empty: about 50 px at 1920, 700 px at 2560, more with the menu as a rail or hidden. */
.content, html[data-ui="3"] .content { max-width: none; width: 100%; min-width: 0; box-sizing: border-box; }
.main, #view { min-width: 0; }
/* tables: table.t is already width: 100% with automatic column widths (app.css), so a wider page stretches every column
   in proportion to its content; nothing more is set here (forcing min-width: 0 on cards let a wide table spill out) */
/* the menu column: collapsing to a rail and expanding again re-flows at once. ui3.css animated grid-template-columns, and
   that transition can stop part-way (seen at 2560 px: the column stayed at 73 px after expanding, or the content kept the
   old width), leaving an empty band or a squeezed page until the next resize */
html[data-ui="3"] .app { transition: none; }
/* side panels: a collapsed pane of a split screen already gives its column back (core/resize10.js drops its grid track) */

/* ---------- 3. Live icons ---------- */
/* each icon carries its motion in two variables (--kxi-t: where it moves to, --kxi-a: a motion with a beat); one rule below
   plays it, so every icon has the same timing and the same glow */
svg[data-kxi]:not([data-kxi=""]) { transform-box: fill-box; transform-origin: var(--kxi-o, 50% 50%); transition: transform var(--kxi-d, .22s) cubic-bezier(.2, .8, .2, 1), filter .22s ease; }
svg[data-kxi="lift"]      { --kxi-t: translateY(-2.5px) scale(1.06); }
svg[data-kxi="drop"]      { --kxi-t: translateY(2.5px); }
svg[data-kxi="nudge"]     { --kxi-t: translateX(2.5px); }
svg[data-kxi="back"]      { --kxi-t: translateX(-2.5px); }
svg[data-kxi="spin"]      { --kxi-t: rotate(75deg); --kxi-d: .28s; }
svg[data-kxi="spin-full"] { --kxi-t: rotate(180deg); --kxi-d: .3s; }
svg[data-kxi="turn"]      { --kxi-t: rotate(90deg); }
svg[data-kxi="tilt"]      { --kxi-t: rotate(-12deg) scale(1.06); }
svg[data-kxi="pop"]       { --kxi-t: scale(1.18); }
svg[data-kxi="flip"]      { --kxi-t: rotateY(180deg); --kxi-d: .3s; }
svg[data-kxi="roll"]      { --kxi-t: translateX(2.5px) rotate(-4deg); }
svg[data-kxi="stamp"]     { --kxi-t: translateY(1.5px) scale(.92); --kxi-d: .16s; }
svg[data-kxi="star"]      { --kxi-t: rotate(72deg) scale(1.12); --kxi-d: .3s; }
svg[data-kxi="swing"]     { --kxi-t: none; --kxi-a: kx23-swing .3s ease-in-out; --kxi-o: 50% 8%; }
svg[data-kxi="grow"]      { --kxi-t: scaleY(1.04) translateY(-1px); --kxi-a: kx23-grow .28s cubic-bezier(.2, .8, .2, 1); --kxi-o: 50% 100%; }
svg[data-kxi="open"]      { --kxi-t: perspective(60px) rotateX(-14deg) translateY(-1px) scale(1.05); --kxi-o: 50% 100%; }
svg[data-kxi="blink"]     { --kxi-t: scale(1.06); --kxi-a: kx23-blink .26s ease-in-out; }
svg[data-kxi="pulse"]     { --kxi-t: scale(1.06); --kxi-a: kx23-pulse .3s ease-out; }
/* what plays it: the control that holds the icon (hover, keyboard focus, a tap on touch screens), or a card being hovered */
:is(a, button, summary, label, [role="button"], [role="tab"], [role="menuitem"], [role="link"], .icon-btn, .btn, .tab, .chip, .hub-card, .li):is(:hover, :focus-visible) svg[data-kxi]:not([data-kxi=""]),
:is(.card-h, .kpi, .hub-sh, .md-ch):hover svg[data-kxi]:not([data-kxi=""]),
.kx-tap svg[data-kxi]:not([data-kxi=""]) {
  transform: var(--kxi-t, translateY(-1.5px) scale(1.08));
  animation: var(--kxi-a, none);
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--kx-green, #50d890) 60%, transparent));
}
@keyframes kx23-swing { 0% { transform: rotate(0); } 25% { transform: rotate(14deg); } 55% { transform: rotate(-10deg); } 80% { transform: rotate(5deg); } 100% { transform: rotate(0); } }
@keyframes kx23-grow { 0% { transform: scaleY(.6); } 70% { transform: scaleY(1.12); } 100% { transform: scaleY(1.04) translateY(-1px); } }
@keyframes kx23-blink { 0%, 100% { transform: scaleY(1); } 45% { transform: scaleY(.25); } }
@keyframes kx23-pulse { 0% { transform: scale(1); } 45% { transform: scale(1.2); } 100% { transform: scale(1.06); } }
.icon-btn svg[data-kxi], .nav a svg[data-kxi], .hub-ic svg[data-kxi] { overflow: visible; }

/* reduced motion: every icon stays still (the hover colour of the control still shows) */
@media (prefers-reduced-motion: reduce) {
  svg[data-kxi] { transition: none !important; animation: none !important; transform: none !important; }
}
html[data-motion="reduce"] svg[data-kxi] { transition: none !important; animation: none !important; transform: none !important; }

/* V2.40 (Batch 24 Part A): an AI button that cannot run now stays clickable; its tooltip and a click say why */
.ai24-blocked { opacity: .78; cursor: help; }
