/* Plan de demanda (/planeamiento).
 *
 * Numbers are Flutter logical px (the page is zoomed to 90% like the app).
 * Sources: lib/presentation/screens/planeamiento/widgets/{demand_tab,
 * plan_summary_table,demand_monthly_table,series_detail_panel,...}.dart.
 */

.page.plan-page { padding: 18px var(--gutter) var(--gutter); overflow: hidden; display: flex; flex-direction: column; }
.plan { flex: 1; min-height: 0; display: flex; flex-direction: column; --accent: #2F6BFF; --violet: #7C3AED; --violet-text: #7C3AED; }
:root[data-theme="dark"] .plan, :root[data-theme="dark"] .psp { --violet-text: #C4B5FD; }
.plan-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.plan[data-view="chart"] .plan-body { flex: none; }
.plan[data-view="chart"] .page, .page.plan-page:has(.plan[data-view="chart"]) { padding-bottom: 0; }
.plan .num, .psp .num { font-variant-numeric: tabular-nums; }

/* ── Top bar actions ──────────────────────────────────────────────────── */

.pl-actions { display: flex; align-items: center; }
.pl-ibtn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); transition: background-color 80ms linear; }
.pl-ibtn:hover { background: var(--hover); }
.pl-ibtn:active { background: var(--pressed); }
.pl-ibtn.is-open { color: var(--text); }
.pl-ibtn[disabled] { color: var(--muted); opacity: .5; pointer-events: none; }
.pl-ibtn .sw { display: grid; }
.pl-seg { position: relative; display: inline-flex; margin-left: 12px; padding: 2px; background: var(--hover); border: 1px solid var(--border); border-radius: 8px; }
.pl-seg button { position: relative; z-index: 1; padding: 5px 8px; border-radius: 6px; font-size: 11px; line-height: 16px; color: var(--text-2); white-space: nowrap; transition: color 150ms linear; }
.pl-seg button:hover { color: var(--text); }
.pl-seg button.is-on { font-weight: 600; color: var(--text); }
.pl-seg-thumb { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 2px; width: 0; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); transition: left 180ms var(--ease-out-cubic), width 180ms var(--ease-out-cubic); }
.pl-seg-thumb.no-anim { transition: none; }
.pl-trailing { display: flex; align-items: center; gap: 10px; margin-left: 12px; }
.pl-freeze { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px; background: #2F6BFF; color: #fff; font-size: 12.5px; font-weight: 500; white-space: nowrap; transition: background-color 100ms linear, box-shadow 100ms linear; }
.pl-freeze:hover { background: #2a60e6; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.pl-freeze:active { background: #2556cc; }
.pl-freeze[disabled] { background: rgba(var(--tint-rgb), .12); color: rgba(var(--tint-rgb), .38); box-shadow: none; }

/* HoverExpandAction: the icon slides its label out (180 ms easeOutCubic). */
.hx-act {
  display: inline-flex; align-items: center; height: 38px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--hover); color: var(--text-2); cursor: pointer;
  transition: padding 180ms var(--ease-out-cubic), background-color 180ms var(--ease-out-cubic);
}
.hx-act.h34 { height: 34px; }
.hx-ic { display: grid; place-items: center; width: 16px; height: 16px; }
.hx-lbl { display: grid; grid-template-columns: 0fr; transition: grid-template-columns 180ms var(--ease-out-cubic); }
.hx-lbl > span { overflow: hidden; min-width: 0; }
.hx-in { display: inline-flex; align-items: baseline; gap: 7px; padding-left: 8px; white-space: nowrap; }
.hx-in b { font-size: 12.5px; font-weight: 600; color: var(--text); }
.hx-in em { font-style: normal; font-size: 12px; color: var(--muted); }
.hx-act:hover { padding: 0 12px; background: var(--selected); }
.hx-act:hover .hx-lbl { grid-template-columns: 1fr; }
.hx-act.is-soon { cursor: default; }
.hx-act.is-soon .hx-ic { opacity: .55; }
.hx-act.is-busy .hx-ic svg { display: none; }
.hx-act.is-busy .hx-ic::before { content: ""; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--primary); border-right-color: transparent; animation: plspin .8s linear infinite; box-sizing: border-box; }
@keyframes plspin { to { transform: rotate(360deg); } }

/* ── Toolbar ──────────────────────────────────────────────────────────── */

.pl-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex: none; }
.pl-tb-left { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.pl-search {
  flex: 1 1 auto; max-width: 420px; min-width: 140px; height: 38px; display: flex; align-items: center;
  background: var(--surface-light); border: 1px solid var(--border); border-radius: 8px; transition: border-color 100ms linear;
}
:root[data-theme="dark"] .pl-search, :root[data-theme="dark"] .sp-input { background: var(--surface); }
.pl-search:focus-within { border-color: var(--primary); }
.pl-search { transition: border-color 100ms linear, max-width 220ms cubic-bezier(.2, .8, .2, 1); }
/* The header filters' card is in the toolbar: the box narrows to make room. */
.pl-search.is-narrow { max-width: 240px; }
.pl-search > .ic { width: 40px; flex: none; color: var(--muted); padding: 0 12px; box-sizing: content-box; width: 16px; }
.pl-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 13px; letter-spacing: .25px; padding: 8px 12px 8px 0; color: var(--text); }
.pl-search input::placeholder, .sp-input::placeholder, .pill input::placeholder { color: var(--muted); opacity: .75; font-style: italic; font-weight: 300; }
.pl-horizon, .pl-badge { flex: 0 1 auto; min-width: 0; height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 8px; white-space: nowrap; }
.pl-horizon { background: var(--hover); border: 1px solid var(--border); color: var(--muted); }
/* The header filters, in the toolbar's free room between the periods chip
   and the buttons: one line, the filter text cut first (its tip says it whole). */
.pg-fbar { flex: 1 1 0; min-width: 0; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 4px 0 12px; border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); border-radius: 8px; background: color-mix(in srgb, var(--primary) 7%, transparent); font-size: 12.5px; color: var(--text-2); white-space: nowrap; animation: pgfbarin 220ms cubic-bezier(.2, .8, .2, 1); }
@keyframes pgfbarin { from { opacity: 0; transform: translateX(-6px); } }
.pg-fbar-ic { flex: none; display: grid; color: var(--primary); }
.pg-fbar-t { flex: 0 1 auto; min-width: 40px; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 600; }
.pg-fbar-n { flex: none; color: var(--muted); }
.pg-fbar-x { flex: none; margin-left: auto; height: 30px; padding: 0 10px; border-radius: 6px; font-weight: 600; color: var(--primary); }
.pg-fbar-x:hover { background: var(--hover); }
.pg-fbar + .pl-stepcard { margin-left: 0; }
@media (prefers-reduced-motion: reduce) { .pl-search { transition: none; } .pg-fbar { animation: none; } }
.pl-horizon > span { font-size: 11.5px; font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
/* The periods chip picks the Forecast IA window (plan_window). */
button.pl-horizon { cursor: pointer; }
button.pl-horizon:hover { color: var(--text); }
.pl-horizon.is-on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); color: var(--primary); }
.pl-horizon.is-on > span { color: var(--primary); }
.pmenu-window { width: 300px; }
.pw-range { display: flex; gap: 8px; padding: 6px 12px 4px; }
.pw-range label { flex: 1; display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); min-width: 0; }
.pw-range select { height: 44px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 16px; }
.pw-bad { margin: 2px 12px 0; font-size: 11px; color: var(--error); }
.pl-badge { background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); color: var(--c); font-size: 11px; font-weight: 600; }
.pl-badge + .pl-badge { margin-left: -4px; }
.pl-pager { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.pl-pager span { margin-right: 4px; }
.pl-pager button { padding: 5px; border-radius: 7px; background: var(--hover); color: var(--text); display: grid; }
.pl-pager button[disabled] { color: var(--muted); cursor: default; }
.pl-tb-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.pl-tb-actions > span { display: inline-flex; }
.pl-save { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 8px; background: #2F6BFF; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pl-save:hover { background: #2a60e6; }
.pl-save > span { display: inline-flex; }
.pl-spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid #fff; border-right-color: transparent; animation: plspin .8s linear infinite; }

.pl-vbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 10px; border-radius: 8px; flex: none;
  background: color-mix(in srgb, var(--warning) 9%, transparent); border: 1px solid color-mix(in srgb, var(--warning) 32%, transparent); color: var(--warning); }
.pl-vbar p { flex: 1; margin: 0; font-size: 12.5px; line-height: 1.35; color: var(--text-2); }
.pl-textbtn { color: var(--primary); font-size: 12.5px; padding: 6px 8px; border-radius: 6px; white-space: nowrap; }
.pl-textbtn:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.pl-textbtn.sm { font-size: 12px; padding: 4px 6px; }
.pl-textbtn.is-on { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.pl-filled { background: var(--primary); color: #fff; font-size: 12.5px; font-weight: 500; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.pl-filled.sm { font-size: 12px; padding: 5px 11px; }
/* A step's snapshot (plan_steps.py): one compact card in the toolbar, one
   line, the sentence cut with an ellipsis (its tip says it whole). What
   the step changed is the shared changes panel's (app.css, .chg-*). */
.pl-stepcard { flex: 0 100 auto; min-width: 0; margin-left: auto; height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 5px 0 10px; border-radius: 8px;
  background: color-mix(in srgb, var(--warning) 9%, transparent); border: 1px solid color-mix(in srgb, var(--warning) 32%, transparent); color: var(--warning); }
.pl-stepcard > .ic { flex: none; }
.pl-stepcard p { flex: 0 1 auto; min-width: 60px; margin: 0; font-size: 12px; line-height: 1; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-stepcard > .pl-textbtn, .pl-stepcard > .pl-filled { flex: none; }
/* "Agrupar por mes" (plan_months): the toggle reads on while grouped; on a
   phone the toolbar has no room for the card, and the toggle says it. */
.hx-act.is-on { color: var(--warning); background: color-mix(in srgb, var(--warning) 9%, transparent); }
/* Its scores are the run's own when the held-out window has no whole month
   (plan_months.own_scores_note): a short label that keeps its width. */
.pl-monthnote { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; font-size: 12px; font-weight: 600; color: var(--warning); white-space: nowrap; }
@media (max-width: 767.98px) { .pl-monthcard { display: none; } }
/* The cycle's plan anchored to another run (plan_scope.anchor_notice): a
   quiet line in the same free room, muted, no tint; it shrinks first. */
.pl-anchornote { flex: 0 1000 auto; min-width: 0; margin-left: auto; height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 8px; color: var(--muted); }
.pl-stepcard + .pl-anchornote { margin-left: 4px; }
.pl-anchornote > .ic { flex: none; }
.pl-anchornote p { flex: 0 1 auto; min-width: 40px; margin: 0; font-size: 12px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-anchornote > .pl-textbtn { flex: none; }
/* Its folded form, drawn only beside the stage screens' open filters. */
.pl-anchor-fold { display: none; flex: none; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--muted); }
.pl-anchor-fold:hover { background: var(--hover); color: var(--text); }

/* ── Popup menus ─────────────────────────────────────────────────────── */

.pmenu { position: fixed; z-index: var(--z-popover); min-width: 180px; padding: 4px 0; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--menu-shadow); transform-origin: top left; }
.pmenu-enter { transition: opacity 110ms linear, transform 140ms var(--ease-out-cubic); }
.pmenu-from { opacity: 0; transform: scale(.97) translateY(-4px); }
.pmenu-to { opacity: 1; transform: none; }
.pmenu-item { display: flex; align-items: center; width: 100%; height: 40px; padding: 0 16px 0 12px; font-size: 13px; color: var(--text-2); text-align: left; white-space: nowrap; }
.pmenu-item:hover { background: var(--hover); }
.pmenu-item.h40 { font-size: 12.5px; color: var(--text); }
.pmenu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.pmenu-head { height: 28px; display: flex; align-items: center; padding: 0 12px; font-size: 11px; font-weight: 600; letter-spacing: .4px; color: var(--muted); }
.pm-slot { width: 22px; flex: none; display: flex; align-items: center; color: var(--text); }
.pm-on { font-weight: 700; color: var(--text); }
.pm-off { color: var(--text-2); }
.pm-cb { display: grid; color: var(--muted); }
.pm-cb.on { color: var(--text); }
.pm-r-on { color: var(--text); }
.pm-r-off { color: var(--text-2); }
.pm-r-txt { display: flex; flex-direction: column; min-width: 0; }
/* A rung that would not nest with the ones on: its reason under the label. */
.pm-rung.is-off { height: auto; min-height: 44px; padding-top: 6px; padding-bottom: 6px; cursor: not-allowed; }
.pm-rung.is-off:hover { background: none; }
.pm-rung.is-off .pm-cb, .pm-rung.is-off .pm-r-off { opacity: .5; }
.pm-why { font-size: 11px; line-height: 1.3; color: var(--muted); white-space: normal; }
.pmenu-status .pm-check { display: none; }
.pmenu-status .pmenu-item.is-on .pm-check { display: grid; }
.pmenu-status .pmenu-item.is-on .pm-lbl { font-weight: 700; color: var(--text); }
.pmenu-version { border-radius: 10px; }

/* ── The summary grid ────────────────────────────────────────────────── */

.pg-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pg { position: relative; flex: 1; min-height: 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; }
.pg-x { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; display: flex; }
/* A grid declares its tracks in --cols (--cols-open with the months open)
   and its min-width in --minw; the widths the person drags come on top as
   --cols-fit and --minw-fit (grid-cols.js). */
.pg { --cols-now: var(--cols); --minw-now: var(--minw); }
.pg.mo { --cols-now: var(--cols-open); --minw-now: var(--minw-open); }
.pg-inner { flex: 1; min-width: var(--minw-fit, var(--minw-now)); display: flex; flex-direction: column; }
.pg-head, .pr { display: grid; grid-template-columns: var(--cols-fit, var(--cols-now)); column-gap: 12px; padding: 0 14px; }
.pg:not(.mo) .c-m, .pg.mo .c-real { display: none !important; }
.pg-head { flex: none; height: 40px; align-items: stretch; background: color-mix(in srgb, var(--surface-light) 35%, transparent); border-bottom: 1px solid var(--border); }
.pg-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; }
/* A native scrollbar narrows the rows but not the header, so every column
   past the 1fr name sat ~15px left of its title. */

.h { display: flex; align-items: center; min-width: 0; gap: 2px; }
/* The edge a column is dragged by (grid-cols.js), over the gap after it. */
.pg[data-cols] .pg-head > .h { position: relative; }
.pg-grip { position: absolute; top: 6px; bottom: 6px; right: -7px; width: 10px; z-index: 1; cursor: col-resize; touch-action: none; }
.pg-grip::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; border-radius: 1px; background: transparent; transition: background 120ms linear; }
.pg-head > .h:hover .pg-grip::after { background: var(--border); }
.pg-grip:hover::after, .pg-grip.is-drag::after { background: var(--primary); }
.pg-resizing, .pg-resizing * { cursor: col-resize !important; user-select: none !important; }
.h-r, .h.c-real, .h.c-m { justify-content: flex-end; }
.h-c { justify-content: center; }
.hs, .hs-static { display: inline-flex; align-items: center; gap: 3px; min-width: 0; padding: 4px 2px; border-radius: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .4px; color: var(--muted); white-space: nowrap; }
.hs span, .hs-static span { overflow: hidden; text-overflow: ellipsis; }
.hs:hover { background: var(--hover); }
.hs.is-sort { color: var(--text); }
.arr { display: none; width: 11px; height: 11px; flex: none; background: currentColor; -webkit-mask: var(--arr) center / 11px 11px no-repeat; mask: var(--arr) center / 11px 11px no-repeat; }
.hs.is-asc .arr { display: block; --arr: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M450-160v-526L202-438l-42-42 320-320 320 320-42 42-248-248v526h-60Z'/%3E%3C/svg%3E"); }
.hs.is-desc .arr { display: block; --arr: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M450-800v526L202-522l-42 42 320 320 320-320-42-42-248 248v-526h-60Z'/%3E%3C/svg%3E"); }
.h-fc { background: color-mix(in srgb, var(--primary) 10%, transparent); padding-right: 8px; }
.h-tog { display: grid; place-items: center; padding: 2px 1px; border-radius: 3px; color: var(--muted); }
.h-tog:hover { background: var(--hover); color: var(--text); }
/* The precision column's metric switch (plan_metrics): an arrow beside its
   name, always shown, so the choice is found without hovering. */
.h-met { display: grid; place-items: center; width: 18px; height: 22px; border-radius: 4px; color: var(--muted); flex: none; }
.h-met:hover, .h-met:focus-visible { background: var(--hover); color: var(--text); }
.pmenu-metric { width: 280px; }
.pmenu-metric .pm-metric { height: auto; min-height: 44px; padding-top: 6px; padding-bottom: 6px; align-items: flex-start; }
.h-st { gap: 0; }
.h-filter { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); flex: none; }
.h-filter:hover { background: var(--hover); }
.h-filter .f-on { display: none; }
.h-filter.is-on { color: var(--text); }
.h-filter.is-on .f-on { display: grid; }
.h-filter.is-on .f-off { display: none; }
.h-filter > span { display: grid; }
/* Each header's funnel shows on hover of its header, or while it filters. */
.pg-head .h-filter { width: 0; opacity: 0; overflow: hidden; transition: opacity 120ms linear, width 120ms var(--ease-out-cubic); }
.pg-head .h:hover .h-filter, .pg-head .h-filter.is-on, .pg-head .h-filter:focus-visible { width: 22px; opacity: 1; }
.pmenu-col { min-width: 220px; }
.pmenu-col .pmenu-item.is-on .pm-lbl { font-weight: 700; color: var(--text); }
.pm-range { display: flex; align-items: flex-end; gap: 8px; padding: 6px 12px 4px; }
.pm-range label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.pm-range input { width: 76px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 13px; }
.pm-unit { padding-bottom: 7px; font-size: 12px; color: var(--muted); }
.pm-acts { display: flex; justify-content: flex-end; gap: 6px; padding: 8px 12px 6px; }
.pm-clear, .pm-apply { height: 30px; padding: 0 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600; }
.pm-clear { color: var(--text-2); }
.pm-clear:hover { background: var(--hover); }
.pm-apply { background: var(--primary); color: #fff; }
.pm-level { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; font-size: 12px; color: var(--muted); }
.pm-level select { height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 13px; }
/* The filter bar over the grid, and the rows drawn only to lead to a match. */

.pr.is-ctx { opacity: .5; }
.pr.is-ctx:hover { opacity: .8; }

.pr {
  height: 44px; align-items: stretch; cursor: pointer; position: relative;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  background-color: color-mix(in srgb, var(--surface-light) var(--tint, 0%), transparent);
  font-size: 12.5px; font-weight: 500;
}
.pr:hover { background-image: linear-gradient(var(--hover), var(--hover)); }
.pr:active { background-image: linear-gradient(var(--pressed), var(--pressed)); }
.pr > div { display: flex; align-items: center; min-width: 0; }
.c-name { gap: 0; }
.chev { width: 21px; height: 21px; flex: none; display: grid; place-items: center; border-radius: 4px; color: var(--muted); }
.chev:hover { background: var(--hover); }
.pr.open .chev svg, .mb.open .mchev svg { transform: rotate(90deg); }
.chev-sp { width: 21px; flex: none; }
.nm { margin-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.w7 { font-weight: 700; } .w6 { font-weight: 600; } .w5 { font-weight: 500; }
.cnt { margin-left: 7px; flex: none; font-size: 11px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.c-real, .c-m, .c-num, .c-fc, .c-delta, .c-hz { justify-content: flex-end; white-space: nowrap; }
.pr .nil, .pr .c-num.nil, .pr .c-real.nil { color: var(--muted); }
.c-fc { background: color-mix(in srgb, var(--primary) 4.5%, transparent); padding-right: 8px; }
.c-trend { justify-content: center; padding: 10px 4px; }
.c-trend svg { width: 104px; height: 24px; overflow: visible; }
.c-trend polyline { fill: none; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sp-past { stroke: color-mix(in srgb, var(--muted) 55%, transparent); stroke-width: 1.2; }
.sp-fut { stroke: var(--text); stroke-width: 1.6; }
.c-trend circle { fill: var(--text); }
.c-adj { justify-content: center; }
.c-delta { font-size: 12px; font-weight: 600; }
.c-delta.pos { color: var(--success); } .c-delta.neg { color: var(--error); }
.c-acc { justify-content: flex-end; gap: 7px; }
.bar { width: 30px; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; flex: none; }
.bar i { display: block; height: 4px; border-radius: 2px; background: currentColor; }
.pv { font-size: 11px; color: var(--text-2); font-weight: 400; }
.mdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.mdot.t-muted { opacity: .5; }
.t-success { color: var(--success); } .t-warning { color: var(--warning); } .t-error { color: var(--error); } .t-muted { color: var(--muted); }
.c-hz { font-weight: 600; }
/* A shaped series' cells (demand_shape): a quiet pill in Precisión, its
   mean per period in Δ Horizonte. */
.shp { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap; color: var(--primary); background: color-mix(in srgb, currentColor 10%, transparent); border: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.shp-dormant { color: var(--muted); }
.shp-new { color: var(--warning); }
.shp-low_volume { color: var(--text-2); }
/* Too short to measure: the longest name, on two lines inside its column. */
.shp-too_short { color: var(--muted); white-space: normal; height: auto; min-height: 20px; padding: 2px 8px; line-height: 1.15; text-align: center; }
.c-hz.is-shape { font-size: 12px; font-weight: 500; }
.c-st { justify-content: flex-start; }
.stp { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 20px; font-size: 10.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; background: color-mix(in srgb, currentColor 12%, transparent); }
.stp i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.st-auto { color: var(--success); } .st-monitor { color: var(--warning); } .st-review { color: var(--error); } .st-muted { color: var(--muted); } .st-dormant { color: var(--muted); } .st-shape { color: var(--primary); }
.pr .st-dash { color: var(--muted); font-size: 12.5px; }

/* The Ajuste pill: a dashed stadium when empty, solid once set. */
.pill { position: relative; display: block; height: 26px; flex: none; cursor: text; }
.pill-b { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pill-b rect { fill: none; stroke-width: 1; stroke-dasharray: 4 3; stroke: color-mix(in srgb, var(--border) 65%, transparent); transition: stroke 80ms linear; }
.pill:hover .pill-b rect { stroke: var(--border); }
.pill:focus-within:not(.is-set) .pill-b rect { stroke: color-mix(in srgb, var(--muted) 70%, transparent); }
.pill.is-set .pill-b rect { stroke-dasharray: none; stroke: color-mix(in srgb, var(--text) 70%, transparent); }
.pill.is-set.is-warn .pill-b rect { stroke: color-mix(in srgb, var(--warning) 70%, transparent); }
.pill input { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; outline: 0; background: transparent; padding: 0 8px; text-align: center; font-size: 12.5px; font-weight: 700; letter-spacing: .25px; color: var(--text); font-variant-numeric: tabular-nums; cursor: text; }
.pill.is-warn input { color: var(--warning); }
.pill input::placeholder { font-size: 12.5px; }
/* An adjustment Claude wrote for a person (plan_claude): the pill's outline and
   a dot take Claude's colour, the same as its line in the chart. */
.pill.is-claude.is-set .pill-b rect { stroke: #D6409F; }
.pill.is-claude::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: #D6409F; border: 1.5px solid var(--card); pointer-events: none; }
.adj-ro.is-claude.is-set { color: #D6409F; }
.prov.is-claude { color: #D6409F; font-weight: 600; }
.adj-ro { font-size: 12.5px; color: var(--muted); }
.adj-ro.is-set { color: var(--text); font-weight: 700; }

.pr-more { height: 44px; display: flex; align-items: center; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.pr-more button { display: inline-flex; align-items: center; gap: 8px; padding: 0 8px; height: 32px; border-radius: 16px; color: var(--primary); font-size: 12.5px; font-weight: 500; }
.pr-more button:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.pg-empty { padding: 28px; text-align: center; font-size: 12.5px; color: var(--muted); }
.pg-fab { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 3; display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 24px; background: var(--card); color: #2F6BFF; font-size: 12.5px; font-weight: 600; box-shadow: 0 2px 4px rgba(0, 0, 0, .14), 0 4px 10px rgba(0, 0, 0, .12); }
.pg-fab[hidden] { display: none; }

/* A node's children on their way: name (or a bar), spinner, shimmer. */
.pr-ph { cursor: default; color: var(--muted); }
.pr-ph:hover { background-image: none; }
.pr-ph .nm.sk { display: block; width: 140px; height: 10px; border-radius: 4px; }
.ph-spin { flex: none; width: 12px; height: 12px; margin-left: 8px; border-radius: 50%; border: 1.5px solid var(--muted); border-right-color: transparent; animation: plspin .8s linear infinite; }
.ph-fill { grid-column: 2 / -1; display: flex; align-items: center; padding-right: 8px; }
.ph-fill .sk { display: block; width: 100%; height: 8px; border-radius: 4px; opacity: .5; }

/* Loading rows (header stays, body shimmers) */
.pg-shim .pr { cursor: default; background: none; padding-top: 13px; padding-bottom: 13px; }
.pg-shim .pr:hover { background-image: none; }
.pg-shim .pr > div { justify-content: flex-end; }
.pg-shim .sk { height: 10px; border-radius: 4px; width: 70%; }
.pg-shim .c-name .sk { width: 55%; }
.pg-shim .pr:first-child .c-name .sk { width: 30%; }

/* ── Por período ─────────────────────────────────────────────────────── */

.mt-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mt { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.mt-head { flex: none; display: flex; height: 34px; }
.mt .ml { width: 240px; flex: none; display: flex; align-items: center; min-width: 0; border-right: 1px solid var(--border); border-bottom: .5px solid var(--border); }
.mt .mc { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; border-bottom: .5px solid var(--border); position: relative; }
.mt .mc[hidden] { display: none; }
.mh { font-size: 10px; font-weight: 600; color: var(--text-2); }
.mt-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; position: relative; overscroll-behavior: contain; }
.mt-colhl { position: absolute; top: 0; left: 0; width: 0; pointer-events: none; z-index: 2; background: color-mix(in srgb, var(--muted) 7%, transparent); }
.mr { display: flex; height: 28px; }
.mr-t { height: 34px; }
.mr-t.tint { background: var(--hover); }
.mr-t.sep { border-top: 1px solid var(--border); }
.mb.focus .mr-t { background: var(--selected); }
.mchev { width: 16px; height: 16px; display: grid; place-items: center; color: var(--muted); flex: none; border-radius: 3px; }
.mchev:hover { background: var(--hover); }
.mchev-sp { width: 16px; flex: none; }
.mt-name { margin-left: 4px; font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.mt-name:hover { text-decoration: underline; text-underline-offset: 2px; }
.mt-n { margin-left: 6px; font-size: 10px; color: var(--muted); flex: none; }
.kfl { display: inline-flex; align-items: center; font-size: 11px; white-space: nowrap; }
.kfl .eye { width: 13px; height: 13px; margin-left: 3px; opacity: 0; background: var(--muted); transition: opacity 100ms linear;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Z'/%3E%3C/svg%3E") center / 13px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Z'/%3E%3C/svg%3E") center / 13px no-repeat; }
.kfl:hover .eye { opacity: 1; }
.t-fc { color: var(--text); } .t-ly { color: var(--muted); } .t-team { color: var(--team); } .t-ac { color: var(--violet-text); }
.v-fc { font-size: 11px; font-weight: 600; color: var(--text); }
.v-ly { font-size: 11px; color: var(--muted); }
.v-team { font-size: 11px; color: var(--team); }
.mr-ac { background: rgba(124, 58, 237, .078); }
.ac-c { padding: 2px; }
.ac { width: 100%; height: 100%; margin: 0; padding: 0 2px; border: 1px solid transparent; border-radius: 2px; outline: 0; background: transparent; text-align: center; font-size: 11px; font-weight: 500; letter-spacing: .25px; color: var(--violet-text); font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: center; }
input.ac { cursor: text; }
.ac.ed { font-weight: 700; }
.ac:focus { border-color: var(--violet); }
.ac-good { color: #1FA971; background: rgba(31, 169, 113, .10); }
.ac-warn { color: #F59E0B; background: rgba(245, 158, 11, .10); }
.ac-bad { color: #EF4444; background: rgba(239, 68, 68, .10); }
.ac-dot { position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--violet); padding: 0; }
.ac-dot::after { font-size: 11px; }
/* Hidden key figures dim (their chart is gone; the dim stays) */
.mt.hide-fc .mr[data-kf="fc"] .kfl, .mt.hide-ly .mr[data-kf="ly"] .kfl, .mt.hide-tg .mr[data-kf="tg"] .kfl, .mt.hide-tg0 .mr[data-kf="tg0"] .kfl, .mt.hide-ac .mr[data-kf="ac"] .kfl { opacity: .45; text-decoration: line-through; }
.mt.hide-fc .mr[data-kf="fc"] .mc, .mt.hide-ly .mr[data-kf="ly"] .mc, .mt.hide-tg .mr[data-kf="tg"] .mc, .mt.hide-tg0 .mr[data-kf="tg0"] .mc, .mt.hide-ac .mr[data-kf="ac"] .mc { opacity: .35; }
.mt.hide-fc .mr[data-kf="fc"] .eye, .mt.hide-ly .mr[data-kf="ly"] .eye, .mt.hide-tg .mr[data-kf="tg"] .eye, .mt.hide-tg0 .mr[data-kf="tg0"] .eye, .mt.hide-ac .mr[data-kf="ac"] .eye { opacity: 1;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Z'/%3E%3C/svg%3E"); }
.mb-more { height: 32px; display: flex; align-items: center; border-bottom: .5px solid var(--border); }
.mb-more button { display: inline-flex; align-items: center; gap: 6px; color: #2F6BFF; font-size: 11px; padding: 4px 8px; border-radius: 12px; }

/* ── Side panels (showSidePanel / SidePanelShell) ─────────────────────── */

.psp-barrier { position: fixed; inset: 0; z-index: calc(var(--z-drawer) + 10); background: transparent; }
.psp {
  position: fixed; z-index: calc(var(--z-drawer) + 11); top: 0; right: 0; width: min(var(--w, 560px), 100vw); height: calc(100dvh / var(--zoom));
  background: var(--bg); border-left: 1px solid var(--border); box-shadow: -6px 0 20px rgba(0, 0, 0, .18);
  display: flex; flex-direction: column; will-change: transform;
}
/* Fetched panels slide by class, so they are laid out (and their chart
   measured) before they move. */
.psp.slide { transform: translateX(100%); transition: transform 220ms var(--ease-in-cubic); }
.psp.slide.is-open { transform: none; transition-timing-function: var(--ease-out-cubic); }
.psp-enter { transition: transform 220ms var(--ease-out-cubic); }
.psp-leave { transition: transform 220ms var(--ease-in-cubic); }
.psp-from { transform: translateX(100%); }
.psp-to { transform: translateX(0); }
.psp-head { flex: none; display: flex; align-items: flex-start; gap: 8px; padding: 11px 6px 10px 16px; background: var(--card); border-bottom: 1px solid var(--border); }
.psp-hcol { flex: 1; min-width: 0; }
.psp-title { font-size: 14.5px; font-weight: 700; line-height: 1.25; letter-spacing: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.psp-sub { margin-top: 3px; font-size: 12px; line-height: 1.45; color: var(--text-2); }
.psp-x { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--text-2); }
.psp-x:hover { background: var(--hover); }
.psp-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 18px; }
.psp-form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.psp-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 16px 12px; background: var(--card); border-top: 1px solid var(--border); }
.sp-primary { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 12px; font-weight: 500; transition: opacity 100ms linear; }
.sp-primary:hover { opacity: .88; }
.sp-primary[disabled] { background: rgba(var(--tint-rgb), .12); color: rgba(var(--tint-rgb), .38); opacity: 1; cursor: default; }
.sp-outline { border: 1px solid var(--border); color: var(--text); padding: 9px 18px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.sp-outline:hover { background: var(--hover); }
.sp-danger { background: var(--error); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.sp-label { font-size: 11px; font-weight: 600; letter-spacing: .6px; color: var(--muted); margin-bottom: 8px; }
.mt10 { margin-top: 10px; } .mt16 { margin-top: 16px; } .mt18 { margin-top: 18px; }
.sp-input { width: 100%; font-size: 13px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-light); outline: 0; resize: vertical; color: var(--text); line-height: 1.4; transition: border-color 100ms linear; }
.sp-input:focus { border-color: var(--primary); }
.sp-hint { margin: 8px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
/* Exportar el plan: SidePanelCard checkbox rows (export_options_sheet.dart _check). */
.exp-ck { display: flex; align-items: flex-start; padding: 2px 0; border-radius: 8px; cursor: pointer; }
.exp-ck.has-help { margin-bottom: 4px; }
.exp-ck:hover { background: var(--hover); }
.exp-ck input { flex: none; width: 18px; height: 18px; margin: 8px; accent-color: var(--primary); cursor: pointer; }
.exp-ck-t { flex: 1; min-width: 0; padding-top: 7px; display: flex; flex-direction: column; gap: 2px; }
.exp-ck-t b { font-size: 12.5px; font-weight: 500; color: var(--text); }
.exp-ck-t em { font-style: normal; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.exp-none { margin: 4px 0 0 2px; font-size: 11.5px; color: var(--error); }
.sp-note { margin: 8px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.sp-note.lg { font-size: 13px; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.sm { gap: 6px; margin: 10px 0; }
.rchip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); white-space: nowrap; transition: background-color 80ms linear; }
.rchip:hover { background: var(--hover); }
.rchip.is-on { border-color: color-mix(in srgb, var(--text) 35%, transparent); background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); font-weight: 600; }
.rchip.sm { padding: 5px 10px; font-size: 11px; }
.rchip.static { cursor: default; }
.cap-intro { margin: 0 0 18px; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.cap-list { margin-top: 18px; }
.cap-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.cap-cell { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-sel { font-size: 12px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text); }
.cap-sel.is-hint { color: var(--muted); font-style: italic; }
/* The space between the panel's cards: one token, so "Tu decisión" and the
   thread under it sit apart like every other card. */
.plan, .psp { --card-gap: 12px; }
.spc { background: var(--card); border: 1px solid var(--border); border-radius: 14px; margin-bottom: var(--card-gap, 12px); }
.cards .spc { padding: 12px 14px 13px; }
.spc-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; padding: 11px 14px 10px; border-bottom: 1px solid var(--border); }
.spc-title b { font-size: 13px; font-weight: 700; }
.spc-title span { font-size: 10.5px; color: var(--muted); }
.spc-body { padding: 12px 14px 13px; }
.spc-head { display: flex; align-items: center; justify-content: space-between; }
.spc-head .sp-label { margin: 0; }
.spc-head + .chips { margin-top: 8px; }
.spc-sum p { margin: 0; font-size: 12.5px; color: var(--text-2); }
.bulk-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bulk-num { position: relative; width: 120px; flex: none; }
.bulk-num input { text-align: right; padding-right: 26px; }
.bulk-num span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--muted); }

/* ── Series detail panel ─────────────────────────────────────────────── */

.sdp-head { flex: none; display: flex; align-items: flex-start; gap: 8px; padding: 11px 6px 10px 16px; background: var(--card); border-bottom: 1px solid var(--border); }
.sdp-hcol { flex: 1; min-width: 0; }
.sdp-l1 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.sdp-title { font-size: 14.5px; font-weight: 700; line-height: 1.25; margin-right: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vpill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 8.5px; font-weight: 700; letter-spacing: .5px; line-height: 1.2; white-space: nowrap;
  background: color-mix(in srgb, currentColor 10%, transparent); border: 1px solid color-mix(in srgb, currentColor 28%, transparent); }
.vpill i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.sdp-l2 { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 11.5px; color: var(--muted); }
.sdp-l2 > * + *::before { content: "·"; margin: 0 6px; color: var(--muted); }
.sdp-meta { display: inline-flex; align-items: center; gap: 3px; }
.sdp-meta.is-warn { color: var(--warning); }
.sdp-explain { padding: 0; font: inherit; color: var(--primary); background: none; border: 0; cursor: pointer; }
.sdp-explain:hover { text-decoration: underline; }
.sdp-tabs { flex: none; margin: 10px 16px 0; padding: 3px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--hover); border-radius: 9px; }
.sdp-tabs button { padding: 7px 0; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--text-2); border: 1px solid transparent; }
.sdp-tabs button.is-on { background: var(--card); border-color: var(--border); box-shadow: 0 1px 4px rgba(0, 0, 0, .06); color: var(--text); font-weight: 600; }
.sdp-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px 16px 18px; }
.sdp-switch { display: grid; overflow: hidden; margin-top: 12px; }
.sdp-pane { grid-area: 1 / 1; min-width: 0; }
.pane-enter { transition: transform 260ms var(--ease-out-cubic); }
.pane-leave { transition: transform 260ms var(--ease-in-cubic); }
.pane-in-from { transform: translateX(calc(var(--dir, 1) * 100%)); }
.pane-rest { transform: none; }
.pane-out-to { transform: translateX(calc(var(--dir, 1) * -100%)); }
.md p { margin: 0 0 6px; padding-left: 12px; position: relative; font-size: 12.5px; line-height: 1.55; color: var(--text-2); }
.md p::before { content: "•"; position: absolute; left: 0; color: var(--muted); }
.md b { color: var(--text); font-weight: 700; }
.pp-box { background: color-mix(in srgb, var(--surface-light) 50%, transparent); border-radius: 10px; padding: 12px 10px; }
.pp-row { display: grid; grid-template-columns: 74px 1fr 1fr; align-items: center; font-size: 11.5px; font-weight: 500; padding: 3px 0; }
.pp-row span:not(:first-child) { text-align: right; }
.pp-h { font-size: 9.5px; font-weight: 700; letter-spacing: .6px; color: var(--muted); padding-bottom: 6px; }
.pp-ag.warn { color: var(--warning); }
.pp-div { height: 1px; background: var(--border); margin: 8px 0; }
.pp-t { font-weight: 700; }
.kv { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; font-size: 12.5px; }
.kv span { color: var(--text-2); }
.kv i { flex: 1; min-width: 12px; border-bottom: 1px dotted var(--border); transform: translateY(-4px); }
.kv b { font-weight: 600; white-space: nowrap; }
.kv b.big { font-size: 13.5px; font-weight: 700; }
.kv.muted span, .kv.muted b { color: var(--muted); font-weight: 400; }
.kv .prim { color: var(--primary); }
.ev-line { display: flex; align-items: center; gap: 7px; padding: 7px 9px; margin: 6px 0; border-radius: 8px; background: color-mix(in srgb, var(--primary) 7%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); color: var(--primary); }
.ev-line b { font-size: 11.5px; font-weight: 700; color: var(--text); }
.ev-line span { font-size: 10.5px; color: var(--muted); }
.ev-line .ev-chip { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--text-2); background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1px 7px; }
.adj-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.adj-line > b { font-size: 12.5px; font-weight: 700; }
.adj-line .pill input::placeholder { font-size: 11.5px; }
.prov { margin-top: 6px; text-align: right; font-size: 11px; color: var(--muted); }
.warn-box { display: flex; gap: 8px; margin-top: 10px; padding: 9px 10px; border-radius: 8px; background: color-mix(in srgb, var(--warning) 8%, transparent); color: var(--warning); }
.warn-box span { font-size: 11.5px; line-height: 1.45; color: var(--text-2); }
.fb-score { display: flex; align-items: baseline; gap: 10px; }
.fb-score b { font-size: 26px; font-weight: 700; }
.fb-score span { font-size: 12px; color: var(--text-2); }
.fb-list { margin: 0; padding-left: 16px; font-size: 12px; line-height: 1.5; color: var(--text-2); }
.unc { display: flex; gap: 26px; padding: 12px 16px; border-radius: 10px; background: color-mix(in srgb, var(--surface-light) 50%, transparent); }
.unc span { display: block; font-size: 9.5px; font-weight: 600; color: var(--muted); letter-spacing: .4px; }
.unc b { font-size: 14px; font-weight: 700; }
.raw-id { margin: 4px 2px 0; font-size: 10.5px; color: var(--muted); user-select: text; word-break: break-all; }
.sdp-foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; width: 100%; }
.sdp-off { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; color: var(--error); font-size: 12px; font-weight: 500; }
.sdp-off:hover { background: color-mix(in srgb, var(--error) 8%, transparent); }
.sdp-off[disabled] { opacity: .45; }
.sdp-confirm p { flex: 1 1 100%; margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--text-2); }

/* Decision block */
.dec { margin-top: 0; margin-bottom: var(--card-gap, 12px); background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 14px 12px; }
.spc + div > .dec, .spc + .dec { margin-top: 0; }
.dec-top { display: flex; flex-direction: column; gap: 2px; }
.dec-top-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dec-title { font-size: 14px; font-weight: 700; }
.dec-span { font-size: 11.5px; color: var(--muted); }
.dec-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.mpill { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 10px; border-radius: 20px; background: color-mix(in srgb, currentColor 10%, transparent); border: 1px solid color-mix(in srgb, currentColor 35%, transparent); }
.mpill span { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.mpill b { font-size: 11.5px; font-weight: 700; }
.mpill.t-muted { color: var(--text-2); }
.dchip { padding: 4px 9px; border-radius: 20px; font-size: 10.5px; font-weight: 700; background: color-mix(in srgb, currentColor 12%, transparent); }
.dc-approved { color: var(--success); } .dc-adjusted { color: var(--primary); } .dc-flagged { color: var(--warning); }
/* "Tu decisión" (mockup A): the horizon it sums, the forecast and the
   Acuerdo big in two cells, one box per period, the backtest in words, the
   hint when its total missed, three verdicts; Ajustar opens the box, the
   motivo and the note. */
.dec-big { display: flex; margin: 10px 0 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.dec-cell { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; }
.dec-cell + .dec-cell { border-left: 1px solid var(--border); }
.dec-k { font-size: 11px; color: var(--muted); }
.dec-v { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; color: var(--text); white-space: nowrap; }
.dec-v small { margin-left: 3px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.dec-v.is-dim { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.dec-n { font-size: 11px; color: var(--text-2); }
.dec-n.is-mut { color: var(--muted); }
.dec-strip { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 5px; margin: 12px 0 4px; }
.dec-weeks {
  display: inline-flex; align-items: center; gap: 2px; margin-top: 8px; min-height: 28px; padding: 0 4px 0 0;
  font-size: 12px; color: var(--muted); border-radius: 6px;
}
.dec-weeks:hover { color: var(--text-2); }
.dec-weeks + .dec-strip { margin-top: 6px; }
.dec-weeks .ic { transition: transform .2s ease; }
.dec-weeks.is-open .ic { transform: rotate(90deg); }
@media (max-width: 720px) { .dec-weeks { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .dec-weeks .ic { transition: none; } }
.dec-wk { min-width: 0; padding: 5px 7px; border-radius: 7px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.dec-wk span { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.dec-wk b { display: block; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dec-wk b i { display: block; font-style: normal; color: var(--primary); overflow: hidden; text-overflow: ellipsis; }
.dec-more { display: flex; align-items: center; justify-content: center; }
.dec-more b { font-size: 12px; color: var(--muted); }
.sdp-model { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 8px 10px 8px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.sdp-model .dec-pills { margin-left: auto; }
.sdp-model .mpill { align-items: center; }
.sdp-model-t { font-size: 12px; color: var(--muted); white-space: nowrap; }
.dec-hint-box { display: flex; align-items: center; gap: 12px; margin: 10px 0 0; padding: 8px 11px; border-radius: 8px; font-size: 12px; line-height: 1.45; color: var(--text-2); background: var(--hover); border: 1px solid var(--border); }
.dec-hint-box p { flex: 1; margin: 0; }
.dec-hint-box .dec-sug-btn { flex: none; }
.dec-hint-box b { font-weight: 700; }
.dec-sug { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; background: color-mix(in srgb, var(--primary) 6%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 24%, transparent); }
.dec-sug-t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12px; color: var(--text-2); }
.dec-sug-t b { color: var(--text); font-weight: 700; }
.dec-sug-t small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dec-sug-btn { flex: none; padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.dec-sug-btn:hover { background: color-mix(in srgb, var(--primary) 18%, transparent); }
.dec-flag > * + * { margin-top: 8px; }
.dec-flag-in { display: block; width: 100%; box-sizing: border-box; padding: 8px 10px; font-size: 12.5px; line-height: 1.4; resize: vertical; min-height: 52px; font-family: inherit; }
.dec-spark { color: var(--primary); display: inline-flex; margin-right: 5px; }
.dec-verdicts { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; margin-top: 14px; }
.dec-verdicts .vchip { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 8px 12px; font-size: 13px; white-space: nowrap; }
.vchip { padding: 7px 12px; border-radius: 20px; border: 1px solid var(--border); font-size: 12px; color: var(--text-2); transition: background-color 100ms linear; }
.vchip:hover { background: var(--hover); }
.vchip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.vchip.is-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.vchip.is-primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.dec-form { margin: 0; }
.dec-acts { margin-top: 10px; }
.dec-acts > * + * { margin-top: 10px; }
.dec-save { display: flex; align-items: center; gap: 10px; }
.dec-hint { flex: 1; font-size: 11px; color: var(--muted); }
.dec-err { margin: 10px 0 0; font-size: 12px; color: var(--error); }
.dec-btn { background: var(--primary); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.dec-btn[disabled] { background: rgba(var(--tint-rgb), .12); color: rgba(var(--tint-rgb), .38); }
#plan-overlay .spc + [id^="sdp-decision"] { margin-top: 0; }
/* Ajustar's focus mode (_decision.html, Lucas 2026-10-15): the card's two
   faces share one grid cell, so the swap can crossfade them while the
   stage's height follows (planDec.swap, plan-grid.js). */
.dec-stage { display: grid; }
.dec-stage > .dec-face { grid-area: 1 / 1; min-width: 0; align-self: start; }
.dec-face[hidden] { display: none; }
.dec-cell.is-edit { cursor: pointer; transition: background-color 120ms linear; }
.dec-cell.is-edit:hover { background: var(--hover); }
.dec-cell.is-edit:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.dec-tap { color: var(--primary); }
/* The number the card is about leads: the Forecast IA alone, or the
   Acuerdo once adjusted, with the Forecast IA smaller beside it. */
.dec-cell.is-lead .dec-v { font-size: 28px; }
/* With no adjustment: the Forecast IA as the card's one number, its weekly
   pace beside it and the shape of the horizon in small bars. */
.dec-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 12px 0 0; padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 6%, var(--card)); }
.dec-hero-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dec-hero .dec-k { font-weight: 600; color: var(--primary); }
.dec-hero .dec-v { font-size: 34px; letter-spacing: -.02em; }
.dec-bars { flex: 0 1 140px; height: 44px; display: flex; align-items: flex-end; gap: 3px; }
.dec-bars i { flex: 1; min-width: 4px; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--primary) 30%, transparent); }
.dec-bars i.is-top { background: var(--primary); }
.dec-big.is-adjusted .dec-cell.is-lead { flex: 1.5 1 0; }
.dec-cell.is-side { background: color-mix(in srgb, var(--muted) 5%, transparent); }
.dec-cell.is-side .dec-v { font-size: 17px; color: var(--text-2); }
.dec-v.is-flash { align-self: flex-start; margin: 0 -5px; padding: 0 5px; border-radius: 6px; animation: dec-flash 600ms ease-out; }
@keyframes dec-flash { from { background: color-mix(in srgb, var(--primary) 24%, transparent); } to { background: transparent; } }
.dec-focus { text-align: center; }
.dec-focus .dec-top { text-align: left; }
.dec-from { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); }
.dec-from b { color: var(--text); font-weight: 700; }
.dec-fnum-row { display: flex; justify-content: center; margin-top: 4px; }
.dec-fnum { display: inline-flex; align-items: baseline; gap: 6px; padding: 0 12px 2px; border-bottom: 2px solid var(--primary); }
.dec-fin { width: 6.5ch; min-width: 3ch; max-width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 40px; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; text-align: center; font-variant-numeric: tabular-nums; }
@supports (field-sizing: content) { .dec-fin { field-sizing: content; width: auto; } }
.dec-fnum small { font-size: 15px; color: var(--muted); }
.dec-fnum:focus-within { box-shadow: 0 2px 0 0 color-mix(in srgb, var(--primary) 30%, transparent); }
.dec-delta { margin: 6px 0 0; min-height: 18px; font-size: 12.5px; font-weight: 700; }
.dec-delta.is-up { color: var(--success); }
.dec-delta.is-down { color: var(--error); }
.dec-delta.is-mut { color: var(--muted); font-weight: 500; }
.dec-nudges { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.dec-nudge { padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; color: var(--text-2); transition: background-color 100ms linear; }
.dec-nudge:hover { background: var(--hover); }
.dec-nudge.is-on { border-color: color-mix(in srgb, var(--primary) 40%, transparent); color: var(--primary); font-weight: 600; }
.dec-focus .dec-fstrip { margin: 14px 0 0; text-align: left; }
.dec-fstrip .dec-old { display: block; font-size: 11.5px; font-style: normal; color: var(--muted); white-space: nowrap; }
.dec-fstrip .dec-old.is-moved { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 70%, transparent); }
.dec-fstrip .dec-wk b { font-size: 13.5px; }
.dec-why { min-width: 0; margin: 14px 0 0; padding: 12px 0 0; border: 0; border-top: 1px dashed var(--border); text-align: left; }
.dec-why legend { float: left; width: 100%; margin: 0 0 8px; padding: 0; font-size: 12px; color: var(--text-2); }
.dec-why legend span { color: var(--muted); }
.dec-mots { clear: both; display: flex; flex-wrap: wrap; gap: 6px; }
.dec-mot { position: relative; padding: 4px 11px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: background-color 100ms linear; }
.dec-mot:hover { background: var(--hover); }
.dec-mot input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.dec-mot:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 1px; }
.dec-mot.is-on { background: color-mix(in srgb, var(--primary) 10%, transparent); border-color: color-mix(in srgb, var(--primary) 35%, transparent); color: var(--primary); font-weight: 600; }
.dec-fnote { margin-top: 12px; text-align: left; }
.dec-ffoot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.dec-addnote { font-size: 12.5px; color: var(--primary); }
.dec-addnote:hover { text-decoration: underline; }
.dec-cancel { margin-left: auto; padding: 9px 16px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; color: var(--text); background: var(--card); }
.dec-cancel:hover { background: var(--hover); }
/* No motion asked: the swap, the flight and the rolls are instant in JS
   (planDec), and nothing here moves either. */
@media (prefers-reduced-motion: reduce) {
  .dec-v.is-flash { animation: none; }
  .dec-cell.is-edit, .dec-nudge, .dec-mot, .vchip { transition: none; }
}

/* Explain / bridge */
.xp-box { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.xp-col b { display: block; font-size: 18px; font-weight: 700; }
.xp-col .sp-label { margin-bottom: 4px; display: block; }
.xp-arrow { color: var(--muted); display: grid; }
.xp-delta { margin-left: auto; font-size: 16px; font-weight: 700; }
.xp-delta.pos { color: var(--success); } .xp-delta.neg { color: var(--error); }
.xp-band { margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: var(--text-2); }
.xp-band.out { color: var(--warning); }
.xp-comment { margin: 10px 0 0; font-size: 13px; line-height: 1.45; }
.xp-evidence { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12px; color: var(--text-2); }
.xp-by { margin: 10px 0 0; font-size: 11.5px; color: var(--muted); }
.br-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); font-size: 12px; }
.br-uid { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-m { width: 84px; color: var(--text-2); }
.br-k { width: 78px; color: var(--muted); }
.br-d { width: 96px; text-align: right; font-weight: 600; }

/* ── Chart card (ChartCard + CTSeriesChart) ──────────────────────────── */

.cc { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; transition: border-color 150ms linear, box-shadow 150ms linear; }
.cc.is-live { border-color: color-mix(in srgb, var(--primary) 50%, transparent); box-shadow: 0 0 0 .5px color-mix(in srgb, var(--primary) 50%, transparent); }
.cc-head { flex: none; display: flex; align-items: center; gap: 6px; padding: 10px 8px 0 14px; min-width: 0; }
.cc-title { font-size: 13px; font-weight: 600; letter-spacing: -.1px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-sp { flex: 1; }
.ct .cc-title { flex: 0 1 auto; }
.cc-btns { display: flex; align-items: center; flex: none; }
.cc-ib { width: 26px; height: 26px; margin-left: 2px; display: grid; place-items: center; border-radius: 5px; color: var(--text-2); border: 1px solid transparent; }
.cc-ib > span { display: grid; }
.cc-ib:hover { background: var(--hover); }
.cc-ib.is-on { background: var(--selected); border-color: var(--border); color: var(--text); }
.rng { display: inline-flex; margin-left: 6px; padding: 2px; background: var(--hover); border: 1px solid var(--border); border-radius: 6px; }
.rng button { padding: 3px 8px; border-radius: 4px; font-size: 10px; color: var(--muted); border: 1px solid transparent; transition: background-color 120ms linear, color 120ms linear; }
.rng button.is-on { background: var(--surface); border-color: var(--border); box-shadow: 0 1px 2px var(--shadow); color: var(--text); font-weight: 600; }
.cc-plot { position: relative; margin-top: 4px; flex: 1; min-height: 0; transition: height 260ms var(--ease-out-cubic); }
.sdp .cc-plot { flex: none; }
.cc-canvas { position: absolute; inset: 0; }
/* Interaction off (the default, ChartCard's initialInteractive: false): the
   plot takes no pointer at all, as Flutter's iframe with pointer-events
   none. No hover, zoom or pan, and the wheel scrolls the page. It has to
   reach every descendant: Plotly sets pointer-events on its own drag and
   legend layers, so a `none` on the canvas alone never got to them. */
.cc:not(.is-live) .cc-canvas, .cc:not(.is-live) .cc-canvas * { pointer-events: none !important; }
.cc-ib:disabled { opacity: .4; cursor: default; }
.cc-ib:disabled:hover { background: none; }
.cc-shimmer { position: absolute; inset: 6px 10px 48px 10px; display: flex; gap: 10px; }
.cc-yax { width: 34px; display: flex; flex-direction: column; justify-content: space-between; padding: 4px 0; }
.cc-yax i { display: block; height: 8px; border-radius: 3px; }
.cc-area { flex: 1; border-radius: 8px; opacity: .7; }
.cc-events { border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
/* EventsBelowPlot */
.cce { padding: 8px 14px; container-type: inline-size; }
.cce-head { display: flex; align-items: center; gap: 4px; }
.cce-t { flex: 1; font-size: 9.5px; letter-spacing: .6px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.cce-scope { padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); font-size: 10.5px; color: var(--text-2); }
.cce-scope:hover { background: var(--hover); }
.cce-scope.on { background: var(--selected); border-color: var(--muted); color: var(--text); font-weight: 600; }
.cce-cap { margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.cce-empty { padding: 6px 0; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.cce-list { margin-top: 4px; max-height: 300px; overflow: auto; }
.cce-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 6px; border-radius: 6px; text-align: left; }
.cce-row:hover { background: var(--hover); }
.cce-row.is-on { background: var(--selected); }
.cce-row.is-flag { border-left: 2px solid var(--warning); border-radius: 0 6px 6px 0; }
.cce-row.is-alert { border-left-color: var(--error); }
/* The band's own amber: filled once the band is on the plot. */
.cce-mk { flex: none; width: 8px; height: 8px; border-radius: 2px; border: 1px solid #FFB432; background: rgba(255, 180, 50, .18); }
.cce-row.is-on .cce-mk { background: rgba(255, 180, 50, .95); }
.cce-who { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.cce-who b { font-size: 12px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.cce-row.is-on .cce-who b { font-weight: 700; }
.cce-who span { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.cce-nums { flex: none; display: flex; align-items: center; gap: 12px; }
.cce-dir { display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--warning); }
.cce-row.is-alert .cce-dir, .cce-row.is-alert .cce-st.is-main b { color: var(--error); }
.cce-row.is-flag:not(.is-alert) .cce-st.is-main b { color: var(--warning); }
.cce-st { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.cce-st em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.cce-st b { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.cce-st.is-main b { font-size: 12.5px; font-weight: 700; color: var(--text); }
.cce-st.is-none b { color: var(--muted); }
/* Below 480px the name and dates stack and the numbers wrap on the right. */
@container (max-width: 479.98px) {
  .cce-who { flex-direction: column; gap: 0; }
  .cce-who b, .cce-who span { max-width: 100%; }
  .cce-nums { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; gap: 2px 10px; }
}
/* The model picker (_ModelPickerPopup) */
.mp { position: absolute; z-index: 40; top: 40px; right: 8px; width: 300px; max-height: 420px; display: flex; flex-direction: column; overflow: hidden;
  background: color-mix(in srgb, var(--card) 96%, transparent); border: .5px solid color-mix(in srgb, var(--border) 35%, transparent); border-radius: 12px;
  box-shadow: 0 8px 24px -2px rgba(0, 0, 0, .10), 0 1px 2px rgba(0, 0, 0, .04); transform-origin: top right; }
.mp-head { flex: none; display: flex; align-items: center; padding: 12px 10px 6px 14px; }
.mp-head b { flex: 1; font-size: 12px; font-weight: 600; color: var(--text); }
.mp-head button { min-height: 28px; padding: 0 8px; font-size: 11px; color: var(--text-2); border-radius: 6px; }
.mp-head button:hover:not(:disabled) { background: var(--hover); }
.mp-head button:disabled { color: var(--muted); opacity: .6; cursor: default; }
/* flex: none: a long list in the 420px menu squeezed the search box flat. */
.mp-q { flex: none; margin: 0 10px 6px; height: 30px; display: flex; align-items: center; gap: 2px; padding: 0 0 0 7px; border-radius: 8px; border: 1px solid transparent;
  background: color-mix(in srgb, var(--surface-light) 60%, transparent); color: var(--muted); }
.mp-q:focus-within { border-color: color-mix(in srgb, var(--primary) 50%, transparent); }
.mp-q input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: 12px; color: var(--text); padding: 0 4px; }
.mp-q input::placeholder { color: var(--muted); }
.mp-q button { width: 28px; height: 28px; display: grid; place-items: center; color: var(--muted); }
.mp-list { flex: 1; min-height: 0; border-top: .5px solid color-mix(in srgb, var(--border) 25%, transparent); padding: 4px 0; overflow: auto; }
.mp-row { display: flex; align-items: center; gap: 8px; width: calc(100% - 12px); margin: 1px 6px; padding: 4px; border-radius: 8px; border: .5px solid transparent; text-align: left; }
.mp-row:hover { background: var(--hover); }
.mp-row.is-win { background: color-mix(in srgb, var(--success) 6%, transparent); border-color: color-mix(in srgb, var(--success) 25%, transparent); box-shadow: 0 0 10px -1px color-mix(in srgb, var(--success) 12%, transparent); }
.mp-cb { flex: none; width: 16px; height: 16px; margin: 2px; display: grid; place-items: center; border-radius: 2px; border: 1.5px solid color-mix(in srgb, var(--muted) 50%, transparent); color: transparent; }
.mp-cb.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.mp-trophy { font-size: 13px; line-height: 1; }
.mp-sw { flex: none; width: 10px; height: 3px; border-radius: 2px; }
.mp-name { flex: 1; min-width: 0; font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-row.is-win .mp-name { font-weight: 600; }
.mp-none { padding: 16px; text-align: center; font-size: 12px; color: var(--muted); }
/* Header pills: the winner (while picking), the event alert, the hint. */
.sdp .cc-head { gap: 0; }
/* Title and pills take what the buttons leave; on a narrow card the pills
   are clipped, never the buttons (Flutter: an Expanded row). */
.cc-tl { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; overflow-x: clip; }
.sdp .cc-title { flex: 0 1 auto; }
/* Flutter's spacing: 8 after the title, 6 before the alert, 8 before the hint. */
.cc-pills { display: inline-flex; gap: 6px; min-width: 0; margin-left: 8px; }
.cc-pills .win-pill { border-radius: 4px; color: var(--muted); }
.cc-pills .win-pill i { display: inline-grid; color: var(--muted); }
.rec-pill { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 10px; font-size: 10px; white-space: nowrap;
  color: var(--secondary); background: color-mix(in srgb, var(--secondary) 12%, transparent); border: .8px solid color-mix(in srgb, var(--secondary) 45%, transparent); }
.rec-pill em { font-style: normal; font-weight: 500; color: var(--muted); }
.rec-pill b { font-weight: 600; }
.cc-alert { --c: var(--warning); margin-left: 6px; display: inline-flex; align-items: center; flex: none; border-radius: 10px; color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent); border: .8px solid color-mix(in srgb, var(--c) 55%, transparent); }
.cc-alert.is-alert { --c: var(--error); }
.cc-alert-go { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px 3px 8px; font-size: 10px; font-weight: 600; color: inherit; border-radius: 10px 0 0 10px; }
.cc-alert-x { display: grid; place-items: center; padding: 3px 6px 3px 2px; color: color-mix(in srgb, var(--c) 85%, transparent); border-radius: 0 10px 10px 0; }
.cc-hint { margin-left: 8px; display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 3px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent); border: .8px solid color-mix(in srgb, var(--primary) 40%, transparent); }
.win-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border); background: rgba(var(--tint-rgb), .03); color: var(--muted); font-size: 10.5px; white-space: nowrap; min-width: 0; overflow: hidden; }
.win-pill span { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cc .hoverlayer .hovertext { filter: drop-shadow(0 6px 16px rgba(26, 26, 26, .28)); }
:root[data-theme="dark"] .cc .hoverlayer .hovertext { filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .55)); }
.cc .hoverlayer .hovertext path { rx: 10px; }

/* ── Gráficos (Control Tower overview, embedded) ─────────────────────── */

.plan-charts { flex: 1; min-height: 0; overflow-y: auto; margin: 0 calc(-1 * var(--gutter)); padding: 8px 24px 24px; }
.ct-skel { display: flex; flex-direction: column; gap: 20px; padding: 16px 0; }
.ct-skel .sk { border-radius: 12px; }
.ct-top { display: flex; gap: 14px; height: 420px; transition: height 200ms var(--ease-out); }
.ct-top.is-exp { height: 540px; }
.ct-total { flex: 3; min-width: 0; }
.ct-side { width: 300px; flex: none; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.ct-sum, .ct-ev { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; min-height: 0; }
.ct-sum { flex: 1; }
.ct-sum-head { display: flex; align-items: center; padding: 10px 10px 4px 14px; border-bottom: 1px solid var(--border); }
.ct-sum-head b { flex: 1; font-size: 13px; font-weight: 600; letter-spacing: -.1px; }
.ct-sum-head .rng button { padding: 3px 7px; }
.ct-sum-body { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px 24px; }
.ct-sum-sub { margin: 0 0 10px; font-size: 10px; color: var(--muted); }
.ct-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ct-bl { width: 72px; flex: none; font-size: 11px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-bt { flex: 1; height: 16px; border-radius: 3px; background: rgba(var(--tint-rgb), .04); overflow: hidden; }
.ct-bt i { display: block; height: 100%; border-radius: 3px; background: color-mix(in srgb, var(--c) 65%, transparent); transition: width 300ms var(--ease-out-cubic); }
.ct-bv { width: 42px; flex: none; text-align: right; font-size: 10px; color: var(--text-2); }
.ct-ev { flex: none; }
.ct-ev-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 6px 14px; color: var(--text-2); border-bottom: 1px solid var(--border); }
.ct-ev-head b { font-size: 13px; font-weight: 600; letter-spacing: -.1px; color: var(--text); }
.ct-ev-body { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ct-evt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface-light) 50%, transparent); }
.ct-evt > div { flex: 1; min-width: 0; }
.ct-evt b { display: block; font-size: 12px; font-weight: 600; }
.ct-evt span { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.ct-evp { padding: 3px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; flex: none; border: .8px solid; }
.ct-evp.pos { color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.ct-evp.neg { color: var(--error); background: color-mix(in srgb, var(--error) 14%, transparent); border-color: color-mix(in srgb, var(--error) 45%, transparent); }
.ct-evp.nd { color: var(--muted); }
.ct-ev-empty { margin: 0; padding: 14px; text-align: center; font-size: 11px; color: var(--muted); }
.ct-sec { margin-top: 28px; }
.ct-sec-head { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.ct-sec-head h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0; }
.ct-eye { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.ct-eye:hover { background: var(--hover); }
.ct-pager { display: inline-flex; align-items: center; height: 36px; padding: 0 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); margin-right: 8px; font-size: 11px; color: var(--text-2); }
.ct-pager button { width: 26px; height: 26px; display: grid; place-items: center; color: var(--text-2); border-radius: 6px; }
.ct-pager button[disabled] { color: var(--muted); opacity: .5; }
.ct-search { width: 220px; height: 36px; display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); }
.ct-search:focus-within { border-color: color-mix(in srgb, var(--primary) 50%, transparent); }
.ct-search .ic { margin: 0 8px; }
.ct-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 12px; color: var(--text); }
.ct-search input::placeholder { color: var(--muted); }
.ct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ct-card { height: 280px; }
.ct-card.is-exp { grid-column: 1 / -1; height: 380px; }
.ct-foot { display: flex; align-items: center; gap: 4px; margin-top: 16px; font-size: 11px; color: var(--muted); }
.ct-foot span { margin-right: 12px; }

/* ── Toast (SnackBar) ──────────────────────────────────────────────── */

.pl-toast-host { position: absolute; left: 0; right: 0; bottom: 0; z-index: 60; pointer-events: none; }
.pl-toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 14px 16px; background: var(--surface); color: var(--text); font-size: 14px; box-shadow: 0 -1px 10px rgba(0, 0, 0, .16), 0 3px 5px rgba(0, 0, 0, .1); }
.pl-toast span { flex: 1; }
.pl-toast-act { color: var(--primary); font-weight: 500; font-size: 14px; padding: 4px 8px; border-radius: 4px; }
.toast-enter { transition: transform 250ms var(--ease-out-cubic), opacity 250ms linear; }
.toast-from { transform: translateY(100%); opacity: 0; }
.toast-to { transform: none; opacity: 1; }

/* Which data the screen is showing (the demo tenant, or the session's org) */
.pl-source { color: var(--success); font-weight: 500; }
.pl-source.is-error { color: var(--warning); }
.pl-source.is-demo { color: var(--muted); }

/* A panel that replaces its skeleton is already in place: no second slide. */
.sdp-instant .psp.slide { transition: none; }

/* The cycle control in the top bar (_partchip.html, cycle_stage.py): where
   the S&OP cycle is, for everyone, quiet (small type, muted, a dot per
   step, no pill), with the person's part in the same control when they
   have one and "Enviar mi parte" inline when it is their turn. The popover
   lists the steps over the parts, why rows are locked and the way to
   Ciclo S&OP. "Solo mis filas" stays over the grid. */
.pl-part { display: flex; align-items: center; min-width: 0; }
.pl-part:empty { display: none; }
.pl-part-in { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; margin-right: 12px; }
.pl-cyc { display: inline-flex; align-items: center; gap: 8px; height: 30px; min-width: 0; max-width: 520px; padding: 0 6px 0 8px; border-radius: 6px;
  color: var(--muted); font-size: 12px; white-space: nowrap; }
.pl-cyc:hover, .pl-cyc[aria-expanded="true"] { background: var(--hover); color: var(--text-2); }
.pl-cyc > svg { flex: none; color: var(--muted); }
.pl-cyc-dots { flex: none; display: inline-flex; align-items: center; gap: 3px; }
.pl-cyc-dots i { width: 6px; height: 6px; border-radius: 50%; box-sizing: border-box; border: 1px solid color-mix(in srgb, var(--muted) 70%, transparent); }
.pl-cyc-dots i.is-done { background: var(--success, #16a34a); border-color: var(--success, #16a34a); opacity: .75; }
.pl-cyc-dots i.is-current { width: 8px; height: 8px; background: var(--primary); border-color: var(--primary); }
.pl-cyc-dots i.is-late { border-color: var(--warning); }
.pl-cyc-txt { flex: none; }
.pl-cyc-step { min-width: 0; margin-left: -4px; overflow: hidden; text-overflow: ellipsis; }
.pl-cyc-title { color: var(--text-2); font-weight: 500; }
.pl-cyc-part { flex: none; padding-left: 8px; border-left: 1px solid var(--border); color: var(--text-2); }
.pl-cyc-part b { color: var(--text); font-weight: 600; }
.pl-cyc.t-warn .pl-part-state { color: var(--warning); font-weight: 600; }
.pl-cyc.t-ok .pl-part-state { color: var(--success, #16a34a); font-weight: 600; }
.pl-part-go { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pl-part-go[disabled] { background: rgba(var(--tint-rgb), .12); color: rgba(var(--tint-rgb), .38); cursor: default; }
.pl-part-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; width: 360px; max-width: calc(100vw - 32px); max-height: calc(100vh - 96px); overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--menu-shadow); }
/* The cycle's steps, compact: a dot on a thin rail, name, owner and day, state. */
.pl-pp-cycle { display: flex; flex-direction: column; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.pl-pp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; font-size: 12.5px; color: var(--text); }
.pl-pp-head span { font-size: 11.5px; color: var(--muted); }
.pl-pp-drift { margin: 6px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.pl-pp-anchor p { margin: 0; }
.pl-pp-anchor .pl-pp-anchor-acts { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.pl-pp-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pl-pp-st { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 4px 6px; border-radius: 6px; }
.pl-pp-st:not(:last-child)::before { content: ""; position: absolute; left: 11.5px; top: 18px; bottom: -6px; width: 1px; background: color-mix(in srgb, var(--border) 80%, transparent); }
.pl-pp-dot { position: relative; flex: none; display: grid; place-items: center; width: 12px; height: 12px; margin-top: 2px; border-radius: 50%; box-sizing: border-box;
  border: 1.5px solid color-mix(in srgb, var(--muted) 70%, transparent); background: var(--card); color: #fff; }
.pl-pp-st.is-done .pl-pp-dot { background: var(--success, #16a34a); border-color: var(--success, #16a34a); }
.pl-pp-st.is-overdue .pl-pp-dot { border-color: var(--warning); }
.pl-pp-st.is-current { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.pl-pp-st.is-current .pl-pp-dot { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.pl-pp-name { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; font-size: 12px; line-height: 1.35; }
.pl-pp-name b { color: var(--text-2); font-weight: 500; }
.pl-pp-st.is-current .pl-pp-name b { color: var(--text); font-weight: 600; }
.pl-pp-name small { flex-basis: 100%; font-size: 11px; color: var(--muted); }
.pl-pp-mine { font-size: 10.5px; font-weight: 600; color: var(--primary); }
.pl-pp-state { flex: none; font-size: 11px; color: var(--muted); padding-top: 1px; }
.pl-pp-state.t-ok { color: var(--success, #16a34a); }
.pl-pp-state.t-warn { color: var(--warning); font-weight: 600; }
.pl-pp-state.t-err { color: var(--error); font-weight: 600; }
.pl-pp-view { flex: none; font-size: 11px; color: var(--primary); padding: 0 4px; border-radius: 4px; line-height: 18px; }
.pl-pp-view:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.pl-pp-view.is-on { color: var(--muted); }
.pl-pp-nophoto { color: var(--muted); font-style: italic; }
.pl-pp-part { display: flex; flex-direction: column; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.pl-pp-part .pl-pb-send { align-self: flex-start; margin-top: 4px; }
.pl-pp-row { display: flex; align-items: center; gap: 8px; }
.pl-pp-row p { flex: 1; min-width: 0; margin: 0; font-size: 12.5px; line-height: 1.35; color: var(--text); }
.pl-pp-step { margin: 0; font-size: 12px; color: var(--muted); }
.pl-pp-hint { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 12px; line-height: 1.4; color: var(--text-2); }
.pl-pp-hint svg { flex: none; margin-top: 1px; color: var(--muted); }
.pl-pp-link { align-self: flex-start; margin-left: -6px; }
.pl-pb-state { flex: none; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--muted); }
.pl-pb-state.t-warn { color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.pl-pb-state.t-ok { color: var(--success, #16a34a); background: color-mix(in srgb, var(--success, #16a34a) 12%, transparent); }
.pl-pb-send { flex: none; display: inline-flex; align-items: center; gap: 6px; background: var(--primary); color: #fff; font-size: 12.5px; font-weight: 500; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.pl-pb-send[disabled] { background: rgba(var(--tint-rgb), .12); color: rgba(var(--tint-rgb), .38); cursor: default; }
.pl-go-short { display: none; }
/* Under ~1440px the part's details and, beside a part, the step's name
   leave the control (they are in the popover) and the inline button says
   only its verb, so the header keeps one line; under 1280 the step's name
   leaves for everyone. */
@media (max-width: 1440px) {
  .pl-cyc.has-part .pl-cyc-step, .pl-part-detail { display: none; }
  .pl-cyc { max-width: 420px; }
  .pl-go-long { display: none; }
  .pl-go-short { display: inline; }
}
@media (max-width: 1280px) {
  .pl-cyc-step { display: none; }
}
.pl-mine { flex: none; height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pl-mine:hover { background: var(--hover); }
.pl-mine.is-on { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 50%, transparent); background: color-mix(in srgb, var(--primary) 8%, transparent); }
/* A row outside the person's part: drawn, not edited. Muted, with a lock
   where the dash would be; the faded parts are the pill's own, never the
   label. */
.pill.is-locked { cursor: not-allowed; }
.pill.is-locked .pill-b, .pill.is-locked input { opacity: .55; }
.pill.is-locked input { cursor: not-allowed; }
.pill.is-locked .pill-b rect { stroke-dasharray: 2 3; }
.pill-lock { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; }
.pr.locked { background-color: color-mix(in srgb, var(--muted) 7%, transparent); }
.pr.locked .nm { color: var(--text-2); }
/* A locked row with rows of the person's part inside: not muted, and
   "Tu parte" (an unfold glyph, the primary color) where the lock would be;
   a click on it opens the row. With a number in the pill, a dot beside it. */
.pr.locked.holds { background-color: transparent; }
.pr.locked.holds .nm { color: inherit; }
.pill.is-holds .pill-b rect { stroke: color-mix(in srgb, var(--primary) 55%, transparent); }
.pill-mine { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 13px; color: var(--primary); font-size: 10.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.pill-mine:hover { background: color-mix(in srgb, var(--primary) 9%, transparent); }
.pill-mine i { position: absolute; top: 3px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.mb.locked .mr-ac { background: color-mix(in srgb, var(--muted) 7%, transparent); }
.adj-wrap { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.adj-d { font-size: 10.5px; line-height: 1; font-weight: 600; color: var(--success, #16a34a); white-space: nowrap; }
.adj-d.neg { color: var(--error, #dc2626); }
.adj-line .adj-wrap { align-items: flex-end; }
/* The grid's Ajuste (Lucas, 2026-10-13): one 80px box per row, the pill,
   its lock, its dash or the read-only number, centred in the column; the
   change against the model is on the pill's tooltip, not beside it. The
   header centres "Ajuste" over that same box (its sort arrow hangs
   outside it). */
.c-adj { justify-content: center; }
.c-adj .adj-wrap { display: block; }
.c-adj .adj-ro { width: 80px; text-align: center; }
.h-adj .hs { position: relative; width: 80px; justify-content: center; }
.h-adj .hs .arr { position: absolute; right: -6px; }
.mc input.ac[disabled] { opacity: .55; cursor: not-allowed; }
/* The Acuerdo seen from another level (plan_view.AcuerdoRefs): where the
   adjustment is, in the pill's place, as reference; never spread here. */
.c-adj.has-ref:not(.own) > .adj-wrap, .c-adj.has-ref:not(.own) > .adj-ro { display: none; }
.c-adj.has-ref.own > .adj-ref { display: none; }
.adj-ref { position: relative; display: flex; justify-content: center; width: 100%; cursor: help; outline: 0; }
.adj-ref-l { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; color: var(--muted); font-size: 10.5px; font-weight: 500; line-height: 1.2; font-style: italic; }
.adj-ref-l > svg { flex: none; }
.adj-ref-l > span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.adj-ref:hover .adj-ref-l, .adj-ref:focus-within .adj-ref-l { color: var(--text-2); }
/* The note is fixed and placed by plan-grid.js (uiTip.place, from the
   trigger's rect, clamped to the viewport): absolute inside the grid, the
   grid's overflow cut it at the column's edge. ::before bridges the gap to
   the trigger so the pointer can reach its link. */
.adj-ref-pop { position: fixed; top: 0; left: 0; z-index: var(--z-popover); width: 260px; padding: 8px 10px;
  display: none; flex-direction: column; align-items: flex-start; gap: 6px; background: var(--tooltip-bg); color: #fff; border-radius: 6px;
  font-size: 12px; line-height: 1.35; font-style: normal; text-align: left; cursor: default; box-shadow: var(--menu-shadow); }
.adj-ref-pop::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.adj-ref-pop[data-side="top"]::before { top: auto; bottom: -8px; }
.adj-ref:hover .adj-ref-pop, .adj-ref:focus-within .adj-ref-pop { display: flex; }
.adj-ref-go { color: #9CC8FF; font-size: 12px; font-weight: 600; padding: 0; }
.adj-ref-go:hover { text-decoration: underline; }
.pl-acuerdo-note { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12px; color: var(--muted); flex: none; }
.pl-acuerdo-note > svg { flex: none; }
.pl-acuerdo-note .pl-textbtn { margin-left: 2px; }
.pr.flash { animation: pr-flash 2s var(--ease-out) 1; }
@keyframes pr-flash { 0%, 30% { background-color: color-mix(in srgb, var(--primary) 16%, transparent); } 100% { background-color: color-mix(in srgb, var(--surface-light) var(--tint, 0%), transparent); } }

/* A series panel whose request failed (planGrid.panelFailed). */
.sdp-error { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 24px 4px; color: var(--text-2); font-size: 13px; }
.sdp-error .sdp-retry { min-height: 44px; }

/* "Apagar estos N SKUs" (plan_dormant): under the toolbar while the Sin
   ventas filter is on alone; its confirmation is drawn in place. */
.pl-offbar { margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.pl-offbar-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pl-offbar-row.is-confirm { border-left: 3px solid var(--error); padding-left: 10px; }
.pl-offbar-t { flex: 1 1 260px; margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--text-2); }
.pl-offbar-go { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--error) 40%, transparent); color: var(--error); font-size: 13px; font-weight: 600; }
.pl-offbar-go:hover { background: color-mix(in srgb, var(--error) 8%, transparent); }
.pl-offbar-acts { display: flex; gap: 8px; }
.pl-offbar-acts button { min-height: 44px; }
/* The panel's error by distance (plan_lags): label, bar, value, count. */
.lag-rows { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.lag-row { display: grid; grid-template-columns: 96px 1fr 56px 28px; align-items: center; gap: 8px; min-height: 24px; font-size: 12px; }
.lag-l { color: var(--text-2); white-space: nowrap; }
.lag-bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.lag-bar i { display: block; height: 6px; border-radius: 3px; background: var(--primary); }
.lag-v { text-align: right; font-weight: 600; }
.lag-n { text-align: right; font-size: 11px; color: var(--muted); }
/* ── The per-series rules (plan_rules.py): the row's chip, and the panel's
   card with "Volver al modelo". ─────────────────────────────────────── */
.rl-chip { margin-left: 7px; flex: none; display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; font-size: 10px; font-weight: 600; white-space: nowrap; color: var(--warning); background: color-mix(in srgb, currentColor 10%, transparent); border: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.rl-chip.rl-dormant { color: var(--muted); }
.rl-chip.rl-reverted { color: var(--primary); }
.rl-card { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 12px 10px 14px; border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--warning) 6%, var(--card)); }
.rl-card.rl-dormant { border-color: var(--border); background: var(--card); }
.rl-card.rl-reverted { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: color-mix(in srgb, var(--primary) 5%, var(--card)); }
.rl-text { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12.5px; color: var(--text-2); }
.rl-text b { font-size: 13px; color: var(--text); }
.rl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--border); background: var(--card); font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; }
.rl-btn:hover { background: var(--hover); }
@media (max-width: 720px) {
  .rl-btn { min-height: 44px; flex: 1 1 100%; }
}

/* ── "Explicar el forecast" (series panel, forecast_parts.py) ──────────── */

.fxp-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.fxp-fold > summary::-webkit-details-marker { display: none; }
.fxp-fold > summary::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform 120ms linear; }
.fxp-fold[open] > summary::after { transform: rotate(45deg); }
.fxp-fold:not([open]) > summary { border-bottom-color: transparent; }
.fxp-sk { display: block; height: 12px; border-radius: 6px; margin: 6px 0; }
.fxp-bar { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; margin-bottom: 10px; }
.fxp-bar i { display: block; min-width: 3px; }
.fxp-level { background: color-mix(in srgb, var(--muted) 45%, transparent); }
.fxp-trend { background: var(--primary); }
.fxp-seasonality { background: var(--secondary); }
.fxp-events { background: var(--warning); }
.fxp-other { background: color-mix(in srgb, var(--text-2) 25%, transparent); }
/* A part that takes units away: the same hue, striped. */
.fxp-bar i.is-neg, .fxp-dot.is-neg { background-image: repeating-linear-gradient(135deg, transparent 0 3px, color-mix(in srgb, var(--card) 70%, transparent) 3px 5px); }
.fxp-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.fxp-legend small, .fxp-drivers small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.fxp-total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 7px; }
.fxp-total span { color: var(--text); font-weight: 600; }
.fxp-drivers { margin: 0; padding: 0; list-style: none; counter-reset: fxp; }
.fxp-drivers li { counter-increment: fxp; display: flex; align-items: baseline; gap: 8px; padding: 4px 0; font-size: 12.5px; }
.fxp-drivers li::before { content: counter(fxp); font-size: 10.5px; font-weight: 700; color: var(--muted); width: 12px; }
.fxp-drivers li span { flex: 1; color: var(--text-2); }
.fxp-pos { color: var(--success); }
.fxp-neg { color: var(--error); }
.fxp-said { margin: 0; padding-left: 16px; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.fxp-said li + li { margin-top: 5px; }
/* Eventos is off by default; while this series has event alerts, its
   toggle carries a dot (the alerts themselves wait for it). */
.cc-ib.has-dot { position: relative; }
.cc-ib.has-dot::after { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--error); }
