/* MMINT Retail — shared tokens and components (glass design, dark only).
   Source of truth: the approved mockup retail-glass.html. Palette, glass recipe, radii and components are lifted from it. */

/* ===== Tokens ===== */
:root {
  color-scheme: dark;

  /* base */
  --bg:#0d0c13;
  --ink:#f6f5fb;          /* primary text */
  --ink-2:#cfcede;        /* secondary text, AA on every glass surface */
  --ink-3:#b3b2c6;        /* captions; still >= 4.5:1 over the brightest orb behind glass */

  /* brand, sampled from mmint_logo_solo.png */
  --pink:#fb3dcb; --pink-text:#ffa3e6; --pink-deep:#e0167f; --magenta:#a5149a;
  --blue-brand:#219cfc; --blue-text:#93cdff;
  --violet-brand:#8b7bff; --violet-text:#c8c0ff;
  --amber-text:#ffcd85;
  /* profit / loss */
  --gain:#62e49e; --loss:#ff8a92;

  /* glass */
  --glass-top:rgba(255,255,255,.10);
  --glass-bot:rgba(255,255,255,.065);
  --glass-flat:rgba(255,255,255,.075);
  --glass-base:rgba(12,11,18,.45);   /* dark under-layer: keeps AA when an orb sits right behind a panel */
  --glass:linear-gradient(180deg,var(--glass-top),var(--glass-bot)),var(--glass-base);
  --glass-tile:linear-gradient(var(--glass-flat),var(--glass-flat)),var(--glass-base);
  --tinted:linear-gradient(180deg,rgba(14,12,22,.62),rgba(9,8,15,.55)); /* behind dense data */
  --well:rgba(8,7,14,.32);           /* inset boxes inside a panel */
  --input-bg:rgba(8,7,14,.45);
  --line:rgba(255,255,255,.12);
  --line-soft:rgba(255,255,255,.08);
  --hi:inset 0 1px 0 rgba(255,255,255,.16), inset 1px 0 0 rgba(255,255,255,.04);
  --drop:0 24px 60px -28px rgba(0,0,0,.75);
  --blur:blur(10px);
  --solid:rgba(26,23,38,.94);        /* floating bits without real blur: toast, banner, menus */
  --chip-base:rgba(8,7,14,.35);      /* dark floor under tinted chips: keeps their text >= 4.5:1 over the brightest orb */
  --r-xl:22px; --r-lg:18px; --r-md:14px; --r-sm:10px;
  --font:"Manrope", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --brand-grad:linear-gradient(135deg,#e0167f 0%,#a5149a 100%);
  --ribbon:linear-gradient(90deg,#fb3dcb,#219cfc);

  /* Legacy names kept for screens, inline styles and chart code (js reads some via getComputedStyle, so literals). */
  --bg-soft:rgba(8,7,14,.4);
  --surface:#1a1724;                 /* solid: chart dot outlines, small opaque fills */
  --surface2:rgba(255,255,255,.05);
  --text:#f6f5fb; --text-soft:#cfcede; --text-faint:#b3b2c6;
  --hover:rgba(255,255,255,.06); --hover-strong:rgba(255,255,255,.10);
  --border:rgba(255,255,255,.12); --border2:rgba(255,255,255,.20);
  --accent:#ffa3e6; --accent-soft:rgba(251,61,203,.12); --on-accent:#2b0a25;
  --blue:#93cdff; --green:#62e49e; --red:#ff8a92; --amber:#ffcd85; --violet:#c8c0ff;
  --rail:transparent; --rail-soft:rgba(255,255,255,.08); --rail-ink:#cfcede; --rail-ink-strong:#f6f5fb;
  --shadow:0 24px 60px -20px rgba(0,0,0,.8);
  --r:22px; --r2:14px;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); }
html:has(.app), html:has(.app) body { overflow: hidden; }
body {
  font: 400 15px/1.55 var(--font); color: var(--ink);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1;
}
button, input, select, textarea { font-family: inherit; }
a { color: var(--pink-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--pink-text); outline-offset: 3px; border-radius: 8px; }
::selection { background: rgba(251,61,203,.32); color: #fff; }
iconify-icon { display: inline-block; vertical-align: -0.125em; flex-shrink: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ===== Background orbs: static radial gradients (no animation, no filter), painted once ===== */
.orbs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; }
.orb--pink { width: 64vmax; height: 64vmax; top: -26vmax; right: -16vmax;
  background: radial-gradient(closest-side, rgba(232,20,150,.42), rgba(232,20,150,.17) 46%, transparent 74%); }
.orb--teal { width: 54vmax; height: 54vmax; bottom: -26vmax; left: -14vmax;
  background: radial-gradient(closest-side, rgba(18,192,186,.26), rgba(18,192,186,.10) 50%, transparent 74%); }
.orb--amber { width: 30vmax; height: 30vmax; bottom: -8vmax; right: 14vw;
  background: radial-gradient(closest-side, rgba(245,160,50,.22), rgba(245,160,50,.08) 50%, transparent 74%); }
.orb--violet { width: 40vmax; height: 40vmax; top: 6vmax; left: 16vw;
  background: radial-gradient(closest-side, rgba(110,92,255,.18), transparent 72%); }

/* ===== Glass utilities (mockup) ===== */
.glass { background: var(--glass); border: 1px solid var(--line); box-shadow: var(--hi), var(--drop); border-radius: var(--r-xl); }
/* backdrop-filter only on the few large surfaces; cards, rows and pills are plain translucent */
.sidebar, .topbar, .modal, .login-card {
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.tinted { background: var(--tinted); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar, .topbar, .modal, .login-card { background: rgba(26,23,38,.94); }
}

/* ===== App shell ===== */
.app { position: relative; z-index: 1; display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* Sidebar (floating glass panel; drawer on phones) */
.sidebar {
  width: 240px; min-width: 240px; margin: 16px 0 16px 16px; padding: 18px 12px 12px;
  display: flex; flex-direction: column; gap: 14px; min-height: 0; user-select: none; z-index: 30;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--hi), var(--drop);
}
.side-head { display: flex; align-items: center; gap: 11px; padding: 0 8px; text-decoration: none; color: var(--ink); }
.brand-mark { display: block; flex-shrink: 0; object-fit: contain; }
.brand-txt { display: inline-flex; align-items: baseline; gap: 5px; line-height: 1.15; white-space: nowrap; }
.brand-txt b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.brand-txt small { font-size: 17px; font-weight: 500; color: var(--ink-2); }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding: 2px 0; }
.side-section { font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 12px 12px 4px; }
.side-section:first-child { padding-top: 0; }
.side-list-item {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px;
  border-radius: 12px; border: 1px solid transparent; font-size: 14.5px; font-weight: 600; color: var(--ink-2);
  text-decoration: none; cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.side-list-item:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.side-list-item.active { color: var(--ink); background: rgba(255,255,255,.11); border-color: var(--line-soft); box-shadow: var(--hi); }
.side-list-item.active iconify-icon { color: var(--pink); }

.side-foot { display: flex; flex-direction: column; gap: 4px; }
.user-row { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: var(--r-md); background: rgba(255,255,255,.05); border: 1px solid var(--line-soft); }
.rail-user {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #fff; background: var(--brand-grad);
}
.user-meta { flex: 1; min-width: 0; line-height: 1.3; }
.user-meta b { display: block; font-size: 14px; font-weight: 700; }
.user-meta small { display: block; font-size: 12.5px; color: var(--ink-2); }
.rail-btn {
  width: 38px; height: 38px; border-radius: 999px; border: 0; background: transparent; padding: 0;
  display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0;
  color: var(--ink-2); text-decoration: none; transition: background-color .15s ease, color .15s ease;
}
.rail-btn:hover { background: rgba(255,255,255,.08); color: var(--ink); }
.side-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink-2);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background-color .15s ease, color .15s ease; text-decoration: none;
}
.side-btn:hover { background: rgba(255,138,146,.10); color: var(--loss); }

/* Main + topbar: only .main scrolls, and only when its content is taller */
.main { flex: 1; min-width: 0; height: 100%; overflow-y: auto; overflow-x: hidden; position: relative; }
.topbar {
  position: sticky; top: 16px; z-index: 10; margin: 16px 20px 0;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  min-height: 64px; padding: 10px 14px 10px 22px;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--hi), var(--drop);
}
.menu-btn { display: none; }
.greet { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.greet small { font-size: 13px; color: var(--ink-2); }
.greet b { font-size: 19px; font-weight: 800; letter-spacing: -.015em; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.top-date { font-size: 13px; color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px 0 10px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.08); box-shadow: var(--hi);
  color: var(--ink); font-size: 13.5px; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease;
}
.back-btn:hover { background: rgba(255,255,255,.13); }

/* Read-only chip (mockup .chip) */
.ro-badge {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; min-height: 32px; padding: 0 13px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; text-decoration: none;
  border: 1px solid var(--line-soft); border-radius: 999px;
  background: linear-gradient(rgba(255,255,255,.07), rgba(255,255,255,.07)), var(--chip-base);
}
a.ro-badge:hover { color: var(--ink); background: linear-gradient(rgba(255,255,255,.11), rgba(255,255,255,.11)), var(--chip-base); }
.ro-badge.warn { color: var(--loss); border-color: rgba(255,138,146,.4); background: linear-gradient(rgba(255,138,146,.10), rgba(255,138,146,.10)), var(--chip-base); }

/* Segmented switch (mockup .seg) */
.cal-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line-soft); max-width: 100%; }
.cal-switch-b {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 30px; padding: 0 12px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.cal-switch-b:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.cal-switch-b.on, .cal-switch-b[aria-pressed="true"] { background: rgba(255,255,255,.16); color: var(--ink); box-shadow: var(--hi); }
.cal-switch.full { display: flex; width: 100%; border-radius: var(--r-lg); padding: 4px; }
.cal-switch.full .cal-switch-b { flex: 1; min-height: 38px; border-radius: var(--r-md); }
.cal-switch.wrap { flex-wrap: wrap; border-radius: var(--r-md); }
.cal-switch.wrap .cal-switch-b { border-radius: var(--r-sm); }

/* Buttons: pills */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; cursor: pointer;
  min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; font-weight: 700; letter-spacing: .005em; text-decoration: none;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary:active:not([disabled]), .btn-ghost:active:not([disabled]) { transform: translateY(1px); }
.btn-primary {
  color: #fff; background: var(--brand-grad);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 10px 26px -10px rgba(224,22,127,.75);
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 14px 32px -10px rgba(224,22,127,.95); }
.btn-primary[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-ghost { color: var(--ink); background: rgba(255,255,255,.08); border-color: var(--line); box-shadow: var(--hi); }
.btn-ghost:hover { background: rgba(255,255,255,.13); }
.btn-ghost[disabled] { opacity: .45; cursor: not-allowed; }
.btn-ghost.danger:hover { border-color: rgba(255,138,146,.5); color: var(--loss); background: linear-gradient(rgba(255,138,146,.10), rgba(255,138,146,.10)), var(--chip-base); }
.btn-ghost.sm, .btn-primary.sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; gap: 6px; }
.btn-block { width: 100%; min-height: 46px; }
.btn-primary.following { background: rgba(251,61,203,.12); color: var(--pink-text); border-color: rgba(255,163,230,.4); box-shadow: var(--hi); }

/* ===== Content ===== */
.content { padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.app:has(.mini-banner.on) .content, body:has(.mini-banner.on) .content { padding-bottom: 96px; }

/* KPI tiles: look like glass, no real blur */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Competencia: five stats in one row; the last one ("-62.2% vs mercado") gets more room so it stays on one line */
.kpis.k5 { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.45fr); }
.kpi {
  display: flex; flex-direction: column; min-width: 0; padding: 16px 18px 15px;
  background: var(--glass-tile); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--hi);
}
.kpi.flat { background: var(--well); border-color: var(--line-soft); box-shadow: none; }
.kpi-l { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.kpi-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.kpi-v { font-size: 27px; font-weight: 800; letter-spacing: -.03em; margin-top: 8px; font-variant-numeric: tabular-nums; line-height: 1.15; overflow-wrap: anywhere; }
.kpi-v.empty { color: var(--ink-3); font-weight: 700; }
.kpi-v.sm { font-size: 21px; }
.kpi-s { font-size: 12.5px; color: var(--ink-2); margin-top: 5px; line-height: 1.4; }
.kpi-s b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-s.ref { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up { color: var(--gain) !important; }
.down { color: var(--loss) !important; }

.grid-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 14px; }
.grid-bottom { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.grid-side.wide { grid-template-columns: minmax(0, 1fr) 360px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Cards: glass look without real blur; a darker tint where they hold dense data */
.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--hi), var(--drop); padding: 18px 20px; min-width: 0;
}
.card:has(.tbl), .card:has(.act-list), .card:has(.follow-list), .card:has(.bd-grid), .card:has(.rank-list),
.card:has(> .kv), .card:has(.chart-host), .card.hcard { background: var(--tinted); }
.card-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 15.5px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 12px;
}
.card-h-t { display: inline-flex; align-items: center; gap: 9px; }
.card-h-t iconify-icon { color: var(--blue-text); }
.card-sub { font-size: 13px; color: var(--ink-2); font-weight: 500; margin-top: 2px; letter-spacing: 0; }
.link-btn {
  background: none; border: none; padding: 0; cursor: pointer; text-decoration: none;
  color: var(--pink-text); font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.muted { color: var(--ink-2); }
.link-btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }

/* CTA panels (Inicio): real blur */
.cta { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; padding: 24px; }
.cta-ico {
  width: 46px; height: 46px; border-radius: var(--r-md); display: grid; place-items: center; margin-bottom: 14px;
  color: var(--pink-text); background: rgba(255,255,255,.08); border: 1px solid var(--line-soft); box-shadow: var(--hi);
}
.cta-label { font-size: 13.5px; font-weight: 700; color: var(--pink-text); }
.cta-title { margin: 4px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -.015em; line-height: 1.25; max-width: 32ch; }
.cta .card-sub { font-size: 14px; margin-top: 6px; max-width: 46ch; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cta.alt .cta-ico { color: var(--blue-text); }
.cta.alt .cta-label { color: var(--blue-text); }
.cta-steps { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14px; color: var(--ink); counter-reset: s; }
.cta-steps li { display: flex; gap: 12px; align-items: center; }
.cta-steps li::before {
  counter-increment: s; content: counter(s); width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 800; color: var(--blue-text); background: rgba(33,156,252,.14); border: 1px solid rgba(147,205,255,.28);
}
.cta-steps b { color: var(--ink); }
.grid-cta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* Tables */
.tbl-scroll { overflow-x: auto; margin: 0 -20px -18px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
/* .tbl.stack also matches the .stack layout helper (display:flex), which shrank these tables on desktop; phones still switch to cards below. */
.tbl.stack { display: table; }
.tbl th {
  text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-3);
  padding: 4px 20px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap;
}
.tbl td { padding: 12px 20px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl.click tbody tr { cursor: pointer; }
.tbl tbody tr td { transition: background-color .15s ease; }
.tbl tbody tr:hover td { background: rgba(255,255,255,.045); }
.tbl .sku { font-size: 13px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .name { font-weight: 600; }
.tbl .num { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.tbl .num.strong { color: var(--ink); font-weight: 700; }
.tbl .sub { display: none; font-size: 12px; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.tbl .ellip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }
.tbl .empty-row td { text-align: center; color: var(--ink-2); padding: 26px 16px; }
.inline-num { display: inline-flex; gap: 4px; align-items: center; }
.inline-num .input { width: 66px; height: 32px; min-height: 32px; padding: 0 8px; font-size: 13px; border-radius: var(--r-sm); }

/* Status chip (mockup .state) */
.pill {
  --pc: var(--blue-text); --pb: rgba(33,156,252,.14);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: linear-gradient(var(--pb), var(--pb)), var(--chip-base); color: var(--pc);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.g { --pc: var(--gain); --pb: rgba(98,228,158,.12); }
.pill.r { --pc: var(--loss); --pb: rgba(255,138,146,.13); }
.pill.a { --pc: var(--amber-text); --pb: rgba(245,160,50,.14); }
.pill.n { --pc: var(--ink-2); --pb: rgba(255,255,255,.08); }
.pill.nodot::before { display: none; }

/* Empty state (mockup .empty) */
.empty-box {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 28px 20px; text-align: center; font-size: 14px; color: var(--ink-2);
}
.empty-box > iconify-icon:first-child {
  box-sizing: content-box; padding: 12px; border-radius: 50%; color: var(--pink-text);
  background: rgba(251,61,203,.10); border: 1px solid rgba(255,163,230,.22);
}
.empty-box strong { color: var(--ink); font-size: 15px; }
.empty-box p { margin: 0; max-width: 44ch; }

.act-list { display: flex; flex-direction: column; gap: 2px; }
.act-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; }
.act-item + .act-item { border-top: 1px solid var(--line-soft); border-radius: 0; }
.rfi-ico {
  width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; flex-shrink: 0;
  background: rgba(255,255,255,.07); color: var(--ink-2); border: 1px solid var(--line-soft);
}
.rfi-ico.accent { background: rgba(251,61,203,.12); color: var(--pink-text); border-color: rgba(255,163,230,.22); }
.rfi-ico.blue { background: rgba(33,156,252,.14); color: var(--blue-text); border-color: rgba(147,205,255,.22); }
.rfi-ico.red { background: rgba(255,138,146,.12); color: var(--loss); border-color: rgba(255,138,146,.22); }
.rfi-ico.amber { background: rgba(245,160,50,.13); color: var(--amber-text); border-color: rgba(255,205,133,.22); }
.rfi-ico.lg { width: 46px; height: 46px; border-radius: var(--r-md); }
.rfi-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.rfi-txt b { font-size: 14px; font-weight: 700; }
.rfi-txt small { font-size: 12.5px; color: var(--ink-2); }
.rfi-txt b .num { font-variant-numeric: tabular-nums; }
.clamp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.overlay { display: none; }

/* ===== Stepper ===== */
.stepper { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--r-lg); }
.step { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.step-n {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800;
  border: 1px solid var(--line); color: var(--ink-3); background: rgba(255,255,255,.04);
}
.step.done { color: var(--ink-2); }
.step.done .step-n { background: rgba(251,61,203,.12); color: var(--pink-text); border-color: rgba(255,163,230,.3); }
.step.on { color: var(--ink); }
.step.on .step-n { background: var(--brand-grad); color: #fff; border-color: rgba(255,255,255,.2); box-shadow: 0 6px 16px -6px rgba(224,22,127,.8); }
.step-line { flex: 1; height: 2px; border-radius: 2px; background: var(--line-soft); min-width: 10px; }
.step-line.done { background: var(--ribbon); opacity: .8; }

/* ===== Forms ===== */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.form-grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.req { color: var(--loss); }
.opt { color: var(--ink-3); font-weight: 500; }
.input {
  height: 42px; padding: 0 14px; width: 100%; min-width: 0;
  background: var(--input-bg); border: 1px solid var(--line); border-radius: var(--r-md);
  color: var(--ink); font-size: 14px; box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: #a3a2b6; opacity: 1; }
.input:focus { outline: none; border-color: rgba(255,163,230,.7); box-shadow: 0 0 0 3px rgba(251,61,203,.22); }
.input[disabled] { opacity: .5; cursor: not-allowed; }
select.input { cursor: pointer; }
select.input option, select.input optgroup { background: #1a1724; color: var(--ink); }
.affix-wrap { position: relative; display: flex; align-items: center; }
.affix-wrap .input { padding-right: 40px; }
.affix-wrap.pre .input { padding-left: 28px; padding-right: 14px; }
.affix { position: absolute; right: 14px; font-size: 13px; color: var(--ink-3); font-weight: 600; pointer-events: none; }
.affix-wrap.pre .affix { left: 13px; right: auto; }
.eye-btn { position: absolute; right: 4px; width: 34px; height: 34px; border-radius: var(--r-sm); }
.file-btn {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: var(--r-md);
  border: 1px dashed rgba(255,255,255,.22); color: var(--ink-2); font-size: 13.5px; cursor: pointer; background: var(--well); width: 100%;
}
.file-btn:hover { border-color: rgba(255,163,230,.6); color: var(--ink); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--pink); }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 13px; white-space: nowrap;
  border: 1px solid var(--line-soft); border-radius: 999px; background: linear-gradient(rgba(255,255,255,.07), rgba(255,255,255,.07)), var(--chip-base);
  font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; font-family: inherit;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { background: linear-gradient(rgba(255,255,255,.11), rgba(255,255,255,.11)), var(--chip-base); color: var(--ink); }
.chip input { width: 14px; height: 14px; margin: 0; accent-color: var(--pink); }
.chip:has(input:checked), .chip.on { background: linear-gradient(rgba(251,61,203,.12), rgba(251,61,203,.12)), var(--chip-base); color: var(--pink-text); border-color: rgba(255,163,230,.4); }
.chip.disabled { opacity: .5; cursor: not-allowed; }
.vsep { width: 1px; align-self: stretch; background: var(--line-soft); }

/* Tabs (mockup .tabs: segmented pill) */
.tabs {
  display: inline-flex; gap: 2px; padding: 4px; align-self: flex-start; max-width: 100%; flex-shrink: 0;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  border-radius: 999px; background: var(--glass-tile); border: 1px solid var(--line); box-shadow: var(--hi);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
  background: none; border: 0; border-radius: 999px; min-height: 36px; padding: 0 16px;
  font-size: 14px; font-weight: 700; color: var(--ink-2); cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); background: rgba(255,255,255,.15); box-shadow: var(--hi); }
.tab[disabled] { opacity: .4; pointer-events: none; }
.tab .count { font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.09); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tab.on .count { background: linear-gradient(rgba(251,61,203,.16), rgba(251,61,203,.16)), rgba(8,7,14,.45); color: var(--pink-text); }

.note { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.note-box { font-size: 13px; color: var(--ink-2); padding: 11px 13px; background: var(--well); border: 1px solid var(--line-soft); border-radius: var(--r-md); line-height: 1.55; }
.note-box strong { color: var(--ink); }
.msg { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: var(--r-md); line-height: 1.45; border: 1px solid transparent; }
.msg.ok { background: rgba(33,156,252,.12); color: var(--blue-text); border-color: rgba(147,205,255,.22); }
.msg.err { background: rgba(255,138,146,.11); color: var(--loss); border-color: rgba(255,138,146,.25); }

.numlist { display: flex; flex-direction: column; gap: 12px; }
.num-i { display: flex; gap: 12px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.num-i strong { color: var(--ink); font-weight: 700; }
.num-b {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 12.5px; font-weight: 800;
  color: var(--blue-text); background: rgba(33,156,252,.14); border: 1px solid rgba(147,205,255,.28);
}

.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--ink-2); white-space: nowrap; }
.kv > b { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }

/* ===== Nuevo análisis ===== */
.drop {
  border: 1.5px dashed rgba(255,255,255,.22); border-radius: var(--r-xl); padding: 32px 20px; text-align: center; cursor: pointer;
  background: radial-gradient(120% 90% at 0% 0%, rgba(251,61,203,.10), transparent 60%), var(--glass);
  box-shadow: var(--hi);
  display: flex; flex-direction: column; align-items: center; gap: 6px; transition: border-color .15s ease;
}
.drop:hover, .drop.dragover { border-color: rgba(255,163,230,.7); }
.drop-ico {
  width: 54px; height: 54px; border-radius: var(--r-md); display: grid; place-items: center; margin-bottom: 6px;
  background: rgba(251,61,203,.12); color: var(--pink-text); border: 1px solid rgba(255,163,230,.22);
}
.drop-t { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.drop-d { font-size: 13.5px; color: var(--ink-2); max-width: 44ch; }
.drop-or { font-size: 13px; font-weight: 600; color: var(--ink-3); margin: 4px 0; }
.drop.has-file { border-style: solid; }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.slot {
  position: relative; aspect-ratio: 4 / 3; max-height: 230px; border-radius: var(--r-md); border: 1.5px dashed rgba(255,255,255,.2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12.5px; color: var(--ink-2); background: var(--well); cursor: pointer; overflow: hidden; padding: 6px;
}
.slot:hover { border-color: rgba(255,163,230,.6); color: var(--ink); }
.slot-tag { position: absolute; top: 6px; left: 6px; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: rgba(13,12,19,.78); color: var(--ink); border: 1px solid var(--line); max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.filled { border-style: solid; border-color: var(--line); }
.slot .rm { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 999px; border: 1px solid var(--line); background: rgba(13,12,19,.72); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ph { background: linear-gradient(160deg, rgba(33,156,252,.22), rgba(251,61,203,.18)), #17151f; color: var(--ink-2); }
.tips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tip { display: flex; gap: 10px; align-items: flex-start; }
.tip .rfi-txt b { font-size: 13.5px; }

/* Modals: one real-blur layer on top of a plain scrim */
.modal-bg {
  position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px;
  background: rgba(5,4,10,.62);
}
.modal-bg.on { display: flex; }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(34,30,50,.84), rgba(20,18,30,.86));
  border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--hi), var(--shadow);
}
.modal.wide { width: min(760px, 100%); }
.modal.narrow { width: min(400px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 14px 20px; border-bottom: 1px solid var(--line-soft); font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.modal-b { padding: 18px 20px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.progress { height: 8px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--ribbon); border-radius: 999px; transition: width .3s; }
.progress.blue > div { background: var(--blue-brand); }
.prog-rows { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--tinted); }
.prog-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.prog-row:last-child { border-bottom: 0; }
.prog-row .sku { font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.prog-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); border-top-color: var(--pink); animation: spin .8s linear infinite; }
.dot-wait { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.22); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }

.mini-banner {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 55; display: none; align-items: center; gap: 10px;
  padding: 6px 6px 6px 16px; border-radius: 999px; background: var(--solid); border: 1px solid var(--line); box-shadow: var(--hi), var(--shadow);
  font-size: 13px; font-weight: 600; max-width: calc(100vw - 32px);
}
.mini-banner.on { display: flex; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 3px rgba(251,61,203,.22); animation: pulse 1.2s ease-in-out infinite; flex-shrink: 0; }

.toast {
  position: fixed; left: 50%; top: 18px; transform: translate(-50%, -8px); z-index: 80; opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 700;
  background: var(--solid); border: 1px solid var(--line); box-shadow: var(--hi), var(--shadow); transition: opacity .18s, transform .18s;
  max-width: calc(100vw - 32px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast .td { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-text); flex-shrink: 0; }
.toast.err .td { background: var(--loss); }

/* ===== Revisión ===== */
.photo-main { aspect-ratio: 1 / 1; border-radius: var(--r-md); display: grid; place-items: center; border: 1px solid var(--line); background: var(--well); }
.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.thumb { aspect-ratio: 1 / 1; border-radius: var(--r-sm); display: grid; place-items: center; border: 1px solid var(--line); cursor: pointer; }
.thumb.on { border: 2px solid var(--pink-text); }
.ai-badge { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 11px 13px; border-radius: var(--r-md); background: rgba(251,61,203,.10); border: 1px solid rgba(255,163,230,.22); }
.ai-badge b { display: block; font-size: 13.5px; color: var(--pink-text); }
.ai-badge small { font-size: 12.5px; color: var(--ink-2); }
.margin-type { display: flex; flex-direction: column; justify-content: center; padding: 0 14px; height: 42px; border-radius: var(--r-md); background: rgba(251,61,203,.10); border: 1px solid rgba(255,163,230,.22); line-height: 1.15; }
.margin-type small { font-size: 12px; font-weight: 700; color: var(--pink-text); }
.margin-type b { font-size: 13px; }
.action-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.action-bar .grp { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ===== Procesando ===== */
.proc-title { text-align: center; font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; }
.proc-title span { color: var(--pink-text); }
.proc-sub { text-align: center; font-size: 13.5px; color: var(--ink-2); max-width: 46ch; margin: 4px auto 0; }
.psteps { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.pstep { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--well); }
.pstep .rfi-txt { flex: 1; }
.pstep .st { width: 22px; height: 22px; display: grid; place-items: center; }
.pstep.ok .st { color: var(--pink-text); }
.pstep.run { border-color: rgba(255,163,230,.4); background: rgba(251,61,203,.07); }
.live-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--pink-text); padding: 4px 11px; border-radius: 999px; background: rgba(251,61,203,.12); white-space: nowrap; }
.counter-v { font-size: 28px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.counter-v span { font-size: 14px; color: var(--ink-2); font-weight: 600; }

/* ===== Resultado ===== */
/* The result numbers card is the screen's hero: real blur and the logo ribbon on top */
.card.res-hero { position: relative; overflow: hidden; padding: 22px 24px; }
.card.res-hero::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 2px; border-radius: 2px; background: var(--ribbon); opacity: .9; }
.prod-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.prod-head .rfi-txt { flex: 1; min-width: 160px; }
.prod-head .rfi-txt b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.res-hero-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.res-hero-h .card-h-t { font-size: 15.5px; font-weight: 800; }
.res-hero-h .row { gap: 8px; }
/* Precio típico tab: one line that says what the median is, under the hero title */
.res-tip-hint { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.res-tip-hint iconify-icon { flex-shrink: 0; margin-top: 1px; color: var(--violet-text); }
.comp-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.comp-badge.ok { background: linear-gradient(rgba(98,228,158,.12), rgba(98,228,158,.12)), var(--chip-base); color: var(--gain); }
.comp-badge.no { background: linear-gradient(rgba(255,138,146,.13), rgba(255,138,146,.13)), var(--chip-base); color: var(--loss); }
.comp-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.metric { padding: 14px 16px; border-radius: var(--r-md); background: var(--well); border: 1px solid var(--line-soft); min-width: 0; }
.metric.hl { background: rgba(251,61,203,.09); border-color: rgba(255,163,230,.28); }
.metric.hl .kpi-v { color: var(--ink); }
.metric .kpi-v { font-size: 23px; letter-spacing: -.025em; }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 12px 16px; border-radius: var(--r-md); background: var(--well); border: 1px solid var(--line-soft); }
.price-row .lbl { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.price-row .v { font-size: 26px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bd { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: rgba(255,255,255,.04); min-width: 0; }
.bd .rfi-txt b { font-variant-numeric: tabular-nums; }
.bd.neg .rfi-txt b { color: var(--loss); }
.bd.total { background: rgba(251,61,203,.09); border-color: rgba(255,163,230,.28); }
.bd.total .rfi-txt b { font-size: 16px; font-weight: 800; }
.mock-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 14px; border: 1px solid var(--line-soft); border-radius: var(--r-md); font-size: 12.5px; color: var(--ink-2); background: var(--well); }
.mock-bar b { color: var(--ink); font-weight: 700; }
.oport-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.oport-ico { width: 58px; height: 58px; border-radius: var(--r-lg); display: grid; place-items: center; background: rgba(251,61,203,.12); color: var(--pink-text); border: 1px solid rgba(255,163,230,.25); }
.oport-lbl { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--pink-text); }

/* ===== Competencia ===== */
.strip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.strip .rfi-txt { flex: 1; min-width: 180px; }
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: rgba(255,255,255,.04); }
.rank.top { border-color: rgba(255,163,230,.45); background: rgba(251,61,203,.08); }
.rank-n { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; background: rgba(255,255,255,.07); border: 1px solid var(--line-soft); font-weight: 800; font-size: 13.5px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.rank.top .rank-n { background: var(--brand-grad); color: #fff; border-color: rgba(255,255,255,.18); }
.rank .rfi-txt { flex: 1; }
.rank-p { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.rank-p b { font-size: 17px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sep-label { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.sep-label::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.rank.muted { background: rgba(255,255,255,.025); }
.rank.muted .rfi-txt b { font-weight: 600; color: var(--ink-2); }
.rank.muted .rank-p b { font-size: 14.5px; color: var(--ink-2); }

/* ===== Historial ===== */
.filters { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.filters .field { width: 160px; }
.filters .field.grow { flex: 1; min-width: 180px; width: auto; }
.filters .chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 42px; }
.filters .btns { display: flex; gap: 8px; margin-left: auto; }
.hcard { box-shadow: var(--hi); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; display: flex; flex-direction: column; gap: 10px; }
.hcard:hover { border-color: rgba(255,255,255,.2); }
.hcard-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sku-tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  color: var(--pink-text); background: linear-gradient(rgba(251,61,203,.12), rgba(251,61,203,.12)), var(--chip-base); border: 1px solid rgba(255,163,230,.25); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hcard-t { font-weight: 700; font-size: 14.5px; flex: 1; min-width: 0; }
.hcard-d { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.hcard-desc { font-size: 13.5px; color: var(--ink-2); }
.meta { display: flex; gap: 6px; flex-wrap: wrap; }
.meta span { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2); padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid var(--line-soft); white-space: nowrap; }
.hboxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.hbox { padding: 11px 13px; border-radius: var(--r-md); border: 1px solid var(--line-soft); background: var(--well); }
.hbox-t { font-size: 13px; font-weight: 700; color: var(--ink-3); margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.hbox .kv { padding: 5px 0; font-size: 13px; }
.hbox.op { background: rgba(251,61,203,.09); border-color: rgba(255,163,230,.25); }
.hbox.op .hbox-t { color: var(--pink-text); }
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }

/* ===== Seguimiento ===== */
.prod-pick { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--glass-tile); box-shadow: var(--hi); min-width: 0; flex: 1; max-width: 460px; }
.prod-pick .rfi-txt { flex: 1; }
.date-range { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.date-range .field { width: 150px; }
.date-range .arrow { color: var(--ink-3); height: 42px; display: grid; place-items: center; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.follow-list { display: flex; flex-direction: column; gap: 4px; }
.follow-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-md); cursor: pointer; border: 1px solid transparent; transition: background-color .15s ease; }
.follow-item:hover { background: rgba(255,255,255,.06); }
.follow-item.on { background: rgba(251,61,203,.10); border-color: rgba(255,163,230,.3); }
.follow-item .rfi-txt { flex: 1; }
.follow-item .rt { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums; }
.follow-item .rt b { font-size: 14px; }

/* Charts (SVG drawn in js; colors come from the tokens above) */
.chart-host { width: 100%; min-height: 120px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-svg text { fill: var(--ink-3); font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart-svg .gl { stroke: var(--line); stroke-dasharray: 3 4; }
.chart-empty { display: grid; place-items: center; min-height: 150px; font-size: 13px; color: var(--ink-2); border: 1px dashed rgba(255,255,255,.16); border-radius: var(--r-md); text-align: center; padding: 10px; background: var(--well); }
.chart-card-h { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 800; margin-bottom: 10px; }
.chart-card-h i { width: 9px; height: 9px; border-radius: 50%; }

/* ===== Evolución ===== */
.filters-ev { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: end; }
.filters-ev .sku-field { grid-column: span 2; }
.filters-ev .sku-field label { color: var(--pink-text); }
.filters-ev .foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hint { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--amber-text); }
.ev-strip { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ev-strip .main-i { flex: 1; min-width: 220px; }
.ev-strip .main-i b { font-size: 16px; display: block; }
.ev-strip .main-i small { display: block; font-size: 13px; color: var(--ink-2); }
.ev-stat { display: flex; flex-direction: column; padding-left: 16px; border-left: 1px solid var(--line-soft); }
.ev-stat small { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.ev-stat b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.charts4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* ===== Admin ===== */
.pw { cursor: pointer; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.country { font-size: 11.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid var(--line-soft); color: var(--ink-2); margin-right: 4px; white-space: nowrap; }
.chip-grid { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Login (centered glass card, mockup) ===== */
.login { position: fixed; inset: 0; z-index: 1; overflow-y: auto; display: flex; padding: 32px 16px; }
.login-stage { position: relative; margin: auto; width: 100%; max-width: 420px; }
.login-card { display: flex; flex-direction: column; gap: 14px; padding: 36px 32px 28px; }
.login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; margin-bottom: 10px; }
.login-brand h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.login-brand p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.login-card .input { height: 46px; }
.login-card .btn-block { margin-top: 6px; }
.login-forgot { align-self: center; font-size: 14px; }
.login-legal { font-size: 13px; color: var(--ink-2); line-height: 1.6; text-align: center; }
.login-legal a { color: var(--pink-text); text-decoration: none; font-weight: 700; }
.login-legal a:hover { text-decoration: underline; }
.login-ver { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }

/* Floating decorative widgets beside the login card (mockup); only on wide screens */
.widget { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-lg); }
.widget-text strong { display: block; font-size: 14.5px; font-weight: 700; }
.widget-text span { display: block; font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.ring { position: relative; width: 68px; height: 68px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 7; }
.ring-bar { fill: none; stroke: url(#ribbon); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 188.5; stroke-dashoffset: 50.9; }
.ring-val { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.switch-deco { position: relative; width: 52px; height: 30px; flex: none; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: var(--brand-grad); }
.switch-deco::after { content: ""; position: absolute; top: 3px; left: 25px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.login-float { position: absolute; display: none; }
@media (min-width: 1100px) {
  .login-float { display: flex; }
  .login-float.f-ring { top: 46px; right: -196px; }
  .login-float.f-toggle { bottom: 70px; left: -232px; }
}

/* ===== Responsive ===== */
@media (max-width: 1280px) {
  .kpis, .kpis.k5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.k5 > :last-child { grid-column: span 2; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-ev { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters-ev .sku-field { grid-column: span 3; }
}
@media (max-width: 1180px) {
  .grid-top { grid-template-columns: minmax(0, 1fr); }
  .grid-side, .grid-side.wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .grid-bottom { grid-template-columns: minmax(0, 1fr); }
  .grid-cta { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; margin: 0; width: min(300px, 86vw); min-width: 0;
    border-radius: 0 var(--r-xl) var(--r-xl) 0; padding-top: 20px;
    background: linear-gradient(180deg, rgba(30,26,44,.86), rgba(20,18,30,.86));
    transform: translateX(-105%); visibility: hidden;
    transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear .28s;
  }
  .app.nav-open .sidebar { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2,.8,.2,1); }
  .app.nav-open .overlay { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(5,4,10,.6); }
  .menu-btn { display: inline-grid; width: 42px; height: 42px; background: rgba(255,255,255,.08); border: 1px solid var(--line); box-shadow: var(--hi); color: var(--ink); }
  .topbar { margin: 12px 12px 0; top: 12px; padding: 10px 12px; gap: 10px; }
  .greet b { font-size: 16.5px; }
  .greet small { font-size: 12.5px; }
  .content { padding: 14px 12px 20px; }
  .app:has(.mini-banner.on) .content, body:has(.mini-banner.on) .content { padding-bottom: 88px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tips { grid-template-columns: minmax(0, 1fr); }
  .charts4 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
  .top-date { display: none; }
  .top-cta { order: 1; margin-left: auto; }
  .top-right { order: 2; margin-left: 0; width: 100%; }
  .stepper .step:not(.on) .step-label { display: none; }
  .filters .field { width: calc(50% - 5px); }
  .filters .field.grow { width: 100%; flex: none; }
  .filters .btns { margin-left: 0; width: 100%; }
  .filters .btns > * { flex: 1; justify-content: center; }
  .filters .vsep { display: none; }
  .filters-ev { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-ev .sku-field { grid-column: 1 / -1; }
  .ev-stat { padding-left: 0; border-left: 0; }
  .prod-pick { max-width: none; flex-basis: 100%; }
  .date-range .field { width: calc(50% - 20px); }
  .action-bar .grp { width: 100%; }
  .action-bar .grp .btn-primary { flex: 1; justify-content: center; }
  .tabs { display: flex; width: 100%; }
  .tabs .tab { flex: 1 0 auto; padding: 0 12px; }

  /* Stacked tables on phone: each row becomes a card */
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
  .tbl.stack tr:last-child { border-bottom: 0; }
  .tbl.stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0 !important; border: 0; text-align: right; min-height: 28px; }
  .tbl.stack td::before { content: attr(data-label); flex-shrink: 0; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
  .tbl.stack td[data-label=""]::before { display: none; }
  .tbl.stack td[data-label=""] { justify-content: flex-end; padding-top: 8px !important; }
  .tbl.stack td.head { font-size: 14.5px; font-weight: 700; text-align: left; }
  .tbl.stack .ellip { white-space: normal; }
  .tbl.stack td.ellip { max-width: none; }
  .tbl.stack .actions { justify-content: flex-end; }
  .tbl.stack tbody tr:hover td { background: transparent; }
}

@media (max-width: 520px) {
  /* Resultado: the three bases fit side by side without icons */
  #resTabs .tab { flex: 1 1 auto; min-width: 0; padding: 0 9px; }
  #resTabs .tab iconify-icon { display: none; }
  .topbar { position: relative; top: 0; }
  .kpis, .kpis.k3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 14px 12px; }
  .kpi-v { font-size: 21px; }
  .kpi-l { font-size: 12.5px; gap: 6px; align-items: flex-start; }
  .kpi-l .kpi-dot { margin-top: 5px; }
  .kpi-s { font-size: 12px; }
  .card { padding: 16px; }
  .tbl-scroll { margin: 0 -16px -16px; }
  .tbl.stack tr { padding: 12px 16px; }
  .cta { padding: 18px; }
  .cta-title { font-size: 18px; }
  .card.res-hero { padding: 20px 18px; }
  .card.res-hero::before { left: 18px; right: 18px; }
  .metrics { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .metric { padding: 12px; }
  .metric .kpi-v { font-size: 18px; }
  .tbl .col-size { display: none; }
  .tbl .sub { display: block; }
  .tbl:not(.stack) th, .tbl:not(.stack) td { padding-left: 10px; padding-right: 10px; }
  .tbl:not(.stack) th:first-child, .tbl:not(.stack) td:first-child { padding-left: 16px; }
  .tbl:not(.stack) th:last-child, .tbl:not(.stack) td:last-child { padding-right: 16px; }
  .tbl .sku { font-size: 12px; }
  .top-cta .lbl, .back-btn .lbl { display: none; }
  .top-cta { width: 42px; padding: 0; }
  .back-btn { width: 38px; padding: 0; justify-content: center; }
  .cta-actions > * { flex: 1; justify-content: center; }
  .form-grid, .form-grid.c2, .form-grid.c3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid.dims { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: auto; }
  .bd { padding: 10px; gap: 8px; }
  .bd .rfi-ico { display: none; }
  .slots { gap: 8px; }
  .hcard-t { order: 3; flex-basis: 100%; }
  .hcard-d { margin-left: auto; }
  .rank { flex-wrap: wrap; }
  .rank .rfi-txt { flex-basis: calc(100% - 54px); }
  .rank-p { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; padding-left: 54px; }
  .cal-switch.wrap .cal-switch-b { flex: 1 1 45%; }
  .mini-banner { left: 12px; right: 12px; transform: none; border-radius: var(--r-lg); max-width: none; font-size: 12.5px; }
  .mini-banner .mb-t { flex: 1; min-width: 0; line-height: 1.35; }
  .login-card { padding: 28px 20px 22px; }
  .modal-h { padding-left: 16px; }
  .modal-b { padding: 16px; }
  .modal-f { padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .side-list-item, .rail-btn, .btn-primary, .btn-ghost, .toast, .chip, .tab, .cal-switch-b, .tbl tbody tr td { transition: none; }
  .spin, .live-dot { animation: none; }
}

/* ===== Additions for the live app (not in the mockup) ===== */
textarea.input { height: auto; min-height: 80px; padding: 10px 14px; resize: vertical; line-height: 1.45; }
.page-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px; color: var(--ink-2); font-size: 13.5px; }
.hide-mobile { }
.only-mobile { display: none; }
.text-faint { color: var(--ink-3); }
.text-soft { color: var(--ink-2); }
.mono { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.mt-0 { margin-top: 0; }

/* Listing attribute chips (competition): Full and condition (mockup .badge) */
.badge-full {
  display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
  font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px;
  background: rgba(33,156,252,.16); color: var(--blue-text);
}
.cond-chip {
  display: inline-flex; align-items: center; white-space: nowrap;
  font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 999px;
  color: var(--violet-text); border: 1px solid rgba(200,192,255,.35); background: transparent;
}
.cond-chip.used { color: var(--amber-text); border-color: rgba(255,205,133,.4); }
.attr-line { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }

/* Confirm dialog text */
.modal-b p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.55; }

@media (max-width: 700px) {
  .hide-mobile { display: none !important; }
  .only-mobile { display: initial; }
}
.sr-only:focus { position: fixed; left: 12px; top: 12px; width: auto; height: auto; clip: auto; z-index: 100; padding: 8px 14px; background: var(--solid); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; }

/* Our SKU · SKU publicación ML (skuPairHtml in js/format.js) */
.tbl .sku { white-space: normal; }
.sku-own, .sku-ml { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sku-sep { color: var(--ink-3); }
a.sku-ml { color: var(--blue-text); text-decoration: none; border-bottom: 1px dotted currentColor; }
a.sku-ml:hover { text-decoration: none; border-bottom-style: solid; }
a.sku-ml:focus-visible { outline: 2px solid var(--pink-text); outline-offset: 2px; border-radius: 2px; }
.sku-ml.none { color: var(--ink-3); }
.sku-tag a.sku-ml { color: var(--blue-text); }

/* Procesando / Resultado: the analysis takes too long or failed (never spin forever) */
.proc-slow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: start; margin-top: 16px; padding: 14px;
  border-radius: var(--r-md); background: rgba(245, 160, 50, .08); border: 1px solid rgba(255, 205, 133, .3); }
.proc-slow[hidden] { display: none; }
.proc-slow p { margin: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.proc-slow p small { color: var(--ink-2); font-size: 13px; }
.proc-slow-acts, .res-wait-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.res-wait-acts { justify-content: center; margin-top: 8px; }
.proc-slow-acts .btn-primary, .proc-slow-acts .btn-ghost, .res-wait-acts .btn-primary, .res-wait-acts .btn-ghost { min-height: 40px; }

/* Resultado fits one 1920x840 screen: thinner stepper, tighter cards, "Precio a competir" as the 5th tile */
.res-content { gap: 12px; padding-top: 14px; }
.res-content .stepper { padding: 7px 16px; }
.res-content .step-n { width: 22px; height: 22px; font-size: 11.5px; }
.res-content .tabs .tab { min-height: 40px; }
.res-content .card.pv-head { padding: 14px 18px; }
.res-content .card.res-hero { padding: 16px 20px; }
.res-content .res-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.res-content .res-metrics .metric { padding: 10px 14px; }
.res-content .res-metrics .kpi-v { font-size: 21px; margin-top: 6px; }
.res-content .res-metrics .kpi-s { margin-top: 4px; }
.res-content .metric.price { background: rgba(33, 156, 252, .08); border-color: rgba(147, 205, 255, .28); }
.res-content .metric.price .pill { font-size: 11.5px; padding: 1px 8px; }
.res-content .card:has(.bd-grid) { padding: 14px 18px; }
.res-content .card:has(.bd-grid) .card-h { margin-bottom: 10px; }
.res-content .bd-grid { gap: 8px; }
.res-content .bd { padding: 8px 12px; min-height: 40px; }
.res-content aside .card { padding: 14px 18px; }
.res-content aside .card-h { margin-bottom: 8px; }
.res-content .res-resumen .kv { padding: 7px 0; }
.res-content .res-resumen .kv:last-child { border-bottom: 0; }
.res-content .res-resumen .kv b { text-align: right; overflow-wrap: anywhere; }
@media (max-width: 1280px) {
  .res-content .res-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .res-content .res-metrics .metric.price { grid-column: 1 / -1; }
}

/* ===== Shared spinner ring: Procesando hero, "Analizando con IA" modal and the modal's active step.
   One ~270° gradient arc (blue tail -> violet -> pink head, round caps) over a faint full track. The whole SVG
   rotates around the centre of the box, and the core (icon or logo) is the only grid child, so arc and core
   always share the same centre. The SVG comes from MM.ui.ringSvg(); boxes with [data-mm-ring] get it on load.
   Size with --ring-size / --ring-core; --ring-stroke is in viewBox units (120). ===== */
.mm-ring { --ring-size: 92px; --ring-core: 56px; --ring-stroke: 6; --ring-speed: 1.1s;
  position: relative; flex: none; display: grid; place-items: center; width: var(--ring-size); height: var(--ring-size); }
.mm-ring-svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible;
  animation: mm-ring-spin var(--ring-speed) linear infinite; filter: drop-shadow(0 0 6px rgba(224, 22, 127, .45)); }
.mm-ring-track { fill: none; stroke: rgba(255, 255, 255, .09); stroke-width: var(--ring-stroke); }
.mm-ring-arc { fill: none; stroke-width: var(--ring-stroke); stroke-linecap: round; }
.mm-ring-core { position: relative; width: var(--ring-core); height: var(--ring-core); border-radius: 50%; display: grid; place-items: center;
  color: var(--accent); background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03));
  border: 1px solid var(--line-soft); box-shadow: inset 0 0 18px rgba(165, 20, 154, .25); }
.mm-ring-core > * { display: block; }
.mm-ring--xs { --ring-size: 18px; --ring-stroke: 14; }
.mm-ring--xs .mm-ring-svg { filter: none; }
.mm-ring--xs .mm-ring-track { stroke: rgba(255, 255, 255, .14); }
@keyframes mm-ring-spin { to { transform: rotate(360deg); } }

/* "Analizando con IA" modal (Nuevo análisis, while POST /retail/capturas/imagen runs) */
.modal.ai-modal { width: min(420px, 100%); }
.ai-modal .modal-b { align-items: center; gap: 0; padding: 28px; text-align: center; }
.ai-modal-t { margin-top: 18px; font-size: 18px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
.ai-steps { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 264px; margin-top: 20px; text-align: left; }
.ai-step { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 20px; color: var(--ink-3); transition: color .2s ease; }
.ai-step .st { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; }
.ai-step.wait .st { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .24); }
.ai-step.run { color: var(--ink); font-weight: 600; }
.ai-step.ok { color: var(--ink-2); }
.ai-step.ok .st { color: #fff; background: linear-gradient(135deg, #ff3fae, #8b7bff); box-shadow: 0 0 0 3px rgba(251, 61, 203, .12);
  animation: ai-step-pop .34s cubic-bezier(.3, 1.6, .5, 1) both; }
.ai-step.ok .st iconify-icon { display: block; }
@keyframes ai-step-pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.14); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@media (max-width: 420px) {
  .ai-modal .modal-b { padding: 26px 20px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .mm-ring-svg, .ai-step.ok .st { animation: none; }
}

/* ===== Procesando hero: listing cards fly in, get scanned by the ring, some are kept (green check) and
   others discarded; the target-cost chip pulses at the end. CSS/SVG only, 4.8 s loop. ===== */
.scan { display: grid; place-items: center; margin: 4px auto 6px; }
.scan-stage { position: relative; width: min(100%, 340px); height: 150px; }
.scan-ring, .scan-card, .scan-target { position: absolute; left: 50%; top: 50%; }
.scan-ring { --ring-size: 112px; --ring-core: 76px; margin: -56px 0 0 -56px; }
.scan-card {
  --fx: -170px; --tx: -112px; --y: -40px;
  width: 92px; height: 34px; margin: -17px 0 0 -46px; display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 10px;
  background: rgba(22, 19, 32, .92); border: 1px solid var(--line); box-shadow: 0 6px 16px rgba(0, 0, 0, .35); opacity: 0;
  animation: scan-ok 4.8s cubic-bezier(.3, .7, .3, 1) infinite;
}
.scan-card.out { animation-name: scan-out; }
.scan-card.r1, .scan-card.r2, .scan-card.r3 { --fx: 170px; --tx: 112px; }
.scan-card.l1, .scan-card.r1 { --y: -44px; }
.scan-card.l2, .scan-card.r2 { --y: 0px; }
.scan-card.l3, .scan-card.r3 { --y: 44px; }
.scan-card.r1 { animation-delay: .4s; }
.scan-card.l2 { animation-delay: .8s; }
.scan-card.r2 { animation-delay: 1.2s; }
.scan-card.l3 { animation-delay: 1.6s; }
.scan-card.r3 { animation-delay: 2s; }
.sc-thumb { width: 24px; height: 24px; flex: none; border-radius: 6px; background: linear-gradient(135deg, rgba(147, 205, 255, .35), rgba(255, 163, 230, .3)); }
.sc-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.sc-body b { font-size: 11.5px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.sc-tag { font-style: normal; font-size: 9.5px; font-weight: 700; color: var(--ink-2); }
.sc-tag.full { color: #7ee2a8; }
.sc-mark { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  color: #062a16; background: var(--gain); opacity: 0; transform: scale(.4); animation: scan-mark 4.8s ease infinite; animation-delay: inherit; }
.scan-card.out .sc-mark { display: none; }
.scan-target {
  margin: 0; transform: translate(-50%, 66px) scale(.9); display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; color: #fff; background: var(--brand-grad); box-shadow: 0 6px 18px -6px rgba(224, 22, 127, .8);
  white-space: nowrap; opacity: 0; animation: scan-target 4.8s ease infinite;
}
.scan[data-fase="calculo"] .scan-target { animation: scan-target-on 1.6s ease-in-out infinite; opacity: 1; }
@keyframes scan-ok {
  0% { opacity: 0; transform: translate(var(--fx), var(--y)) scale(.9); }
  14% { opacity: 1; }
  42% { opacity: 1; transform: translate(var(--tx), var(--y)) scale(1); border-color: var(--line); }
  52% { border-color: rgba(98, 228, 158, .7); box-shadow: 0 0 0 1px rgba(98, 228, 158, .35), 0 6px 18px rgba(46, 160, 100, .35); }
  82% { opacity: 1; transform: translate(var(--tx), var(--y)) scale(1); border-color: rgba(98, 228, 158, .7); }
  100% { opacity: 0; transform: translate(var(--tx), var(--y)) scale(.96); border-color: rgba(98, 228, 158, .7); }
}
@keyframes scan-out {
  0% { opacity: 0; transform: translate(var(--fx), var(--y)) scale(.9); }
  14% { opacity: 1; }
  42% { opacity: 1; transform: translate(var(--tx), var(--y)) scale(1); filter: none; }
  60% { opacity: .35; transform: translate(var(--tx), calc(var(--y) + 6px)) scale(.94); filter: grayscale(1); }
  72%, 100% { opacity: 0; transform: translate(var(--tx), calc(var(--y) + 10px)) scale(.9); filter: grayscale(1); }
}
@keyframes scan-mark { 0%, 48% { opacity: 0; transform: scale(.4); } 56% { opacity: 1; transform: scale(1.15); } 62%, 82% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }
@keyframes scan-target { 0%, 66% { opacity: 0; transform: translate(-50%, 66px) scale(.9); } 76% { opacity: 1; transform: translate(-50%, 66px) scale(1.08); }
  84%, 92% { opacity: 1; transform: translate(-50%, 66px) scale(1); } 100% { opacity: 0; transform: translate(-50%, 66px) scale(1); } }
@keyframes scan-target-on { 0%, 100% { transform: translate(-50%, 66px) scale(1); } 50% { transform: translate(-50%, 66px) scale(1.07); } }
.scan + .proc-title { margin-top: 18px; margin-bottom: 0; }
@media (max-width: 420px) {
  .scan-card { --fx: -150px; --tx: -104px; width: 84px; margin-left: -42px; }
  .scan-card.r1, .scan-card.r2, .scan-card.r3 { --fx: 150px; --tx: 104px; }
  .scan-ring { --ring-size: 100px; --ring-core: 66px; margin: -50px 0 0 -50px; }
}
@media (prefers-reduced-motion: reduce) {
  .scan-core, .scan-card, .sc-mark, .scan-target, .scan[data-fase="calculo"] .scan-target { animation: none; }
  .scan-card { opacity: 1; transform: translate(var(--tx), var(--y)); }
  .scan-card.ok { border-color: rgba(98, 228, 158, .7); }
  .scan-card.out { opacity: .35; filter: grayscale(1); }
  .scan-card.ok .sc-mark { opacity: 1; transform: none; }
  .scan-target { opacity: 1; transform: translate(-50%, 66px); }
}

/* Dubious model under Modelo (Revisión, manual form): muted, never blocking */
.mod-warn { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: -2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
.mod-warn[hidden] { display: none; }
.mod-warn > iconify-icon { color: var(--amber-text); flex-shrink: 0; align-self: flex-start; margin-top: 1px; }
.mod-warn > span { flex: 1 1 220px; min-width: 0; }
.mod-warn .link-btn { font-size: 12.5px; min-height: 28px; margin-left: 22px; }
.rev-reanalisis { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.rev-reanalisis[hidden] { display: none; }
.rev-reanalisis > iconify-icon { color: var(--blue-text); flex-shrink: 0; margin-top: 2px; }

/* Resultado without competition: why, and what to do */
.comp-badge.warn { background: linear-gradient(rgba(245,160,50,.14), rgba(245,160,50,.14)), var(--chip-base); color: var(--amber-text); white-space: normal; }
.res-diag { display: flex; flex-direction: column; align-items: center; gap: 6px; }
/* Resultado "Seguir este producto": every link and button wraps inside the card at any width */
.seg-card { min-width: 0; }
.seg-card .seg-ver { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: 100%; min-width: 0;
  white-space: normal; overflow-wrap: anywhere; }
.seg-card .seg-ver-t { display: inline-flex; align-items: center; gap: 4px; }
.seg-card .seg-ver-sub { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.seg-card .btn-primary, .seg-card .btn-ghost { white-space: normal; text-align: center; min-width: 0; max-width: 100%;
  overflow-wrap: anywhere; justify-content: center; }
/* Resultado: only the user's reference applied */
.res-soloref { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 12px; padding: 10px 12px;
  border-radius: var(--r-md, 12px); border: 1px solid rgba(255, 196, 92, .3); background: rgba(255, 196, 92, .08);
  color: var(--ink-2); font-size: 13px; }
.res-soloref > span { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.res-soloref .btn-ghost { flex: none; }
.res-diag p { margin: 0; }
.res-diag .res-diag-t { color: var(--ink); font-size: 14px; max-width: 52ch; }
.oport-diag { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.oport-diag[hidden] { display: none; }
.oport-diag .res-wait-acts { margin-top: 2px; }

/* Bulk upload summary (progress modal and history panel) */
.lote-res-wrap { margin-top: 12px; }
.lote-res-wrap[hidden] { display: none; }
.lote-res { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--well); border: 1px solid var(--line-soft); }
.lote-res-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lote-res-t { display: inline-flex; align-items: flex-start; gap: 8px; font-weight: 700; font-size: 14px; color: var(--ink); }
.lote-res-t iconify-icon { color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.lote-res .note { margin: 0; }
.lote-todos { align-self: flex-start; }
.lote-res-rows { max-height: 280px; overflow-y: auto; }
.lote-fila { flex-wrap: wrap; row-gap: 6px; }
.lote-fila .nm { flex: 1 1 140px; }
.prog-row.lote-fila .pill { flex-shrink: 1; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lote-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.lote-acts .btn-ghost.sm { min-height: 32px; }
.lote-sub { margin: 14px 0 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
#logBody > #lotesServidor > .lote-sub:first-child { margin-top: 0; }
.lote-cnt { display: block; margin-top: 2px; white-space: normal; }
#logBody > [data-log-volver] { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; }

/* Estimated measures (Revisión, manual form, bulk preview, Resultado): a calm amber chip offering the estimate,
   a dashed outline and an "estimado" tag on the fields it filled. */
.med-est {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--well); border: 1px dashed rgba(255,205,133,.35); font-size: 13px; color: var(--ink-2); line-height: 1.45;
}
.form-grid .med-est { margin-top: 0; }
.med-est-ico { display: inline-flex; color: var(--amber-text); flex-shrink: 0; }
.med-est-txt { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.med-est-txt b { color: var(--ink); font-weight: 600; }
.med-est-txt small { display: block; color: var(--text-faint); font-size: 12px; }
.med-est .btn-ghost { flex-shrink: 0; }
.input.est-auto { border-style: dashed; border-color: rgba(255,205,133,.55); }
.field.est-on > label::after {
  content: "estimado"; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: var(--amber-text); background: rgba(245,160,50,.14); vertical-align: 1px;
}
.med-est-nota { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; font-size: 13px; color: var(--amber-text); }
.med-est-nota iconify-icon { flex-shrink: 0; margin-top: 1px; }
.med-est-nota .link-btn { font-size: 13px; display: inline; }
.mv-est { display: flex; flex-direction: column; gap: 4px; }
.mv-est-opt { white-space: normal; }
#previewTbody .pill { margin-left: 4px; }
@media (max-width: 520px) {
  .med-est { flex-wrap: wrap; }
  .med-est .btn-ghost { margin-left: auto; }
}

/* "Características clave" chips (Revisión and the manual form; MM.ui.rasgosInput) */
.rasgos { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rasgos-l { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.rasgos-l .opt { font-weight: 500; color: var(--ink-3); }
.rasgos-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rasgos-chips { display: contents; }
.rasgo-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-height: 32px; padding: 0 2px 0 11px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--ink); background: var(--chip-base); border: 1px solid rgba(255, 163, 230, .32); overflow-wrap: anywhere; }
/* Essential = filled (required in the search); secondary = outlined (only adds to the score). The text toggles. */
.rasgo-chip.sec { background: transparent; border-style: dashed; border-color: rgba(255, 255, 255, .28); color: var(--ink-2); font-weight: 500; }
.rasgo-t { display: inline-flex; align-items: center; min-height: 30px; padding: 0 2px; border: 0; background: transparent;
  color: inherit; font: inherit; cursor: pointer; text-align: left; overflow-wrap: anywhere; border-radius: 6px; }
.rasgo-t:hover { text-decoration: underline; text-underline-offset: 3px; }
.rasgo-t:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rasgos-aviso { font-size: 12px; color: var(--amber); line-height: 1.4; }
.rasgos-aviso:empty { display: none; }
.rasgo-x { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2); cursor: pointer; flex: none; }
.rasgo-x:hover, .rasgo-x:focus-visible { background: rgba(255, 255, 255, .1); color: var(--ink); }
.rasgos-add { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 220px; min-width: 0; }
.rasgos-add .input { flex: 1 1 auto; min-width: 0; height: 34px; font-size: 13px; }
.rasgos-add .btn-ghost { flex: none; }
.rasgos-hint { font-size: 12px; color: var(--ink-3); line-height: 1.4; }

/* ===== Long lists: "Ver más" appends the next page (MM.ui.listaPaginada) ===== */
.ver-mas { display: flex; justify-content: center; padding: 12px 0 2px; }
.hgrid > .ver-mas { grid-column: 1 / -1; padding: 0; }

/* Any remaining motion stops for people who ask for less of it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
