/* ================================================================
   STUDIO UI v2 — capa visual de PolygonPlus Studio
   Se carga DESPUÉS de polygon-design-system.css y de los estilos de cada página.
   Sidebar oscura de marca + lienzo claro cálido, superficies suaves, movimiento con intención.
   Respeta prefers-reduced-motion.
   ================================================================ */

:root {
  --ui-sidebar-w: 248px;
  --ui-sidebar-w-collapsed: 72px;
  --ui-topbar-h: 64px;

  --ui-canvas: #f4f4f1;
  --ui-canvas-2: #ecece7;
  --ui-surface: #ffffff;
  --ui-surface-2: #fafaf8;
  --ui-ink: #0b0b0c;
  --ui-ink-2: #3a3a3d;
  --ui-ink-3: #77777c;
  --ui-line: rgba(11, 11, 12, 0.08);
  --ui-line-2: rgba(11, 11, 12, 0.14);

  --ui-lime: #d3ff2a;
  --ui-lime-ink: #0b0b0c;
  --ui-blue: #1751f5;
  --ui-blue-soft: rgba(23, 81, 245, 0.10);
  --ui-ok: #12b76a;
  --ui-ok-soft: rgba(18, 183, 106, 0.12);
  --ui-warn: #f79009;
  --ui-warn-soft: rgba(247, 144, 9, 0.12);
  --ui-bad: #f04438;
  --ui-bad-soft: rgba(240, 68, 56, 0.10);

  --ui-r-sm: 10px;
  --ui-r-md: 14px;
  --ui-r-lg: 20px;
  --ui-r-xl: 28px;

  --ui-shadow-1: 0 1px 2px rgba(11, 11, 12, 0.04), 0 1px 1px rgba(11, 11, 12, 0.03);
  --ui-shadow-2: 0 2px 4px rgba(11, 11, 12, 0.04), 0 8px 24px -6px rgba(11, 11, 12, 0.10);
  --ui-shadow-3: 0 4px 10px rgba(11, 11, 12, 0.05), 0 24px 60px -12px rgba(11, 11, 12, 0.22);
  --ui-glow-lime: 0 0 0 1px rgba(211, 255, 42, 0.6), 0 8px 30px -6px rgba(211, 255, 42, 0.55);

  --ui-ease: cubic-bezier(0.22, 1, 0.36, 1);       /* easeOutQuint */
  --ui-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ui-fast: 160ms;
  --ui-med: 280ms;
  --ui-slow: 380ms;
}

/* ---------- Lienzo ---------- */
html.has-shell, html.has-shell body {
  background: var(--ui-canvas);
  color: var(--ui-ink);
}
html.has-shell body {
  padding-left: var(--ui-sidebar-w);
  transition: padding-left var(--ui-med) var(--ui-ease);
  min-height: 100vh;
}
html.has-shell.shell-collapsed body { padding-left: var(--ui-sidebar-w-collapsed); }
html.has-shell body::before {         /* retícula de puntos muy sutil + halo de marca */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(211, 255, 42, 0.16), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(23, 81, 245, 0.08), transparent 60%),
    radial-gradient(rgba(11, 11, 12, 0.06) 1px, transparent 1px) 0 0 / 22px 22px;
}
html.has-shell .app-header { display: none !important; }
html.has-shell[data-theme="dark"], html.has-shell[data-theme="dark"] body { background: #070708; color: #fff; }
html.has-shell[data-theme="dark"] body::before {
  background:
    radial-gradient(1100px 600px at 80% -10%, rgba(211, 255, 42, 0.10), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(23, 81, 245, 0.12), transparent 60%),
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 22px 22px;
}
html.has-shell .dot-field { display: none; }

/* ---------- Sidebar ---------- */
.ui-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--ui-sidebar-w); z-index: 60;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 14px 14px;
  background: linear-gradient(180deg, #0d0d0f 0%, #08080a 100%);
  color: #e8e8ea;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: width var(--ui-med) var(--ui-ease);
  overflow: hidden;
}
.ui-sidebar::after {   /* brillo lima en la esquina */
  content: ""; position: absolute; width: 260px; height: 260px; left: -120px; bottom: -140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(211, 255, 42, 0.18), transparent 70%); pointer-events: none;
}
html.shell-collapsed .ui-sidebar { width: var(--ui-sidebar-w-collapsed); }
.ui-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; text-decoration: none !important; color: inherit; min-height: 44px; }
.ui-brand img { height: 22px; width: auto; display: block; }
.ui-brand .ui-brand-full { height: 20px; }
.ui-brand .ui-brand-tag { font: 500 10px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ui-lime);
  border: 1px solid rgba(211, 255, 42, 0.35); padding: 4px 6px; border-radius: 6px; }
html.shell-collapsed .ui-brand-full, html.shell-collapsed .ui-brand-tag { display: none; }
html:not(.shell-collapsed) .ui-brand-iso { display: none; }

.ui-client {
  display: flex; align-items: center; gap: 10px; margin: 0 2px 14px; padding: 10px 12px;
  border-radius: var(--ui-r-md); background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none !important; color: inherit; transition: background var(--ui-fast);
}
.ui-client:hover { background: rgba(255, 255, 255, 0.07); }
.ui-client-avatar { flex: 0 0 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #b2d84f, #124b26); color: #fff; font: 700 12px/1 var(--font-display); }
.ui-client-name { font: 600 13px/1.2 var(--font-display); white-space: nowrap; }
.ui-client-sub { font-size: 11px; color: #8b8b92; white-space: nowrap; }
html.shell-collapsed .ui-client-text { display: none; }

.ui-nav-label { font: 500 10px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: #6f6f76; padding: 14px 12px 8px; white-space: nowrap; }
html.shell-collapsed .ui-nav-label { opacity: 0; }
.ui-nav { display: flex; flex-direction: column; gap: 2px; }
.ui-nav a {
  position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px;
  border-radius: 11px; color: #b4b4bb; text-decoration: none !important; font: 500 14px/1 var(--font-body);
  transition: background var(--ui-fast), color var(--ui-fast), transform var(--ui-fast) var(--ui-ease);
  white-space: nowrap;
}
.ui-nav a svg { flex: 0 0 18px; width: 18px; height: 18px; stroke: currentColor; }
.ui-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.ui-nav a:active { transform: scale(0.98); }
.ui-nav a.active { background: rgba(211, 255, 42, 0.10); color: var(--ui-lime); }
.ui-nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ui-lime);
  box-shadow: 0 0 12px rgba(211, 255, 42, 0.8); }
.ui-nav .ui-step { margin-left: auto; font: 500 10px/1 var(--font-mono); color: #5d5d64; }
html.shell-collapsed .ui-nav a span, html.shell-collapsed .ui-nav .ui-step { display: none; }
html.shell-collapsed .ui-nav a { justify-content: center; padding: 0; }

.ui-sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 1; }
.ui-search-btn {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 11px; cursor: pointer;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); color: #9a9aa1; font: 500 13px var(--font-body);
  transition: background var(--ui-fast), border-color var(--ui-fast);
}
.ui-search-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.14); color: #fff; }
.ui-search-btn svg { width: 16px; height: 16px; stroke: currentColor; flex: 0 0 16px; }
.ui-kbd { margin-left: auto; font: 500 11px/1 var(--font-mono); padding: 4px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); color: #c5c5cb; }
html.shell-collapsed .ui-search-btn span, html.shell-collapsed .ui-search-btn .ui-kbd { display: none; }
html.shell-collapsed .ui-search-btn { justify-content: center; padding: 0; }
.ui-user { display: flex; align-items: center; gap: 10px; padding: 8px 6px 2px; }
.ui-user-avatar { flex: 0 0 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ui-lime); color: #000; font: 700 13px var(--font-display); }
.ui-user-name { font: 600 13px var(--font-display); color: #fff; white-space: nowrap; }
.ui-user-status { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #8b8b92; white-space: nowrap; }
.ui-dot { width: 7px; height: 7px; border-radius: 50%; background: #6f6f76; }
.ui-dot.ok { background: var(--ui-ok); box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.2); animation: ui-pulse 2.4s infinite; }
.ui-dot.bad { background: var(--ui-bad); }
.ui-user button { margin-left: auto; background: none; border: 0; color: #8b8b92; cursor: pointer; padding: 6px; border-radius: 8px; }
.ui-user button:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.ui-user button svg { width: 16px; height: 16px; stroke: currentColor; display: block; }
html.shell-collapsed .ui-user-text, html.shell-collapsed .ui-user button { display: none; }
.ui-collapse { position: absolute; top: 22px; right: 12px; z-index: 2; background: none; border: 0; color: #6f6f76; cursor: pointer; padding: 6px; border-radius: 8px; }
.ui-collapse:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.ui-collapse svg { width: 16px; height: 16px; stroke: currentColor; display: block; transition: transform var(--ui-med) var(--ui-ease); }
html.shell-collapsed .ui-collapse { right: 50%; transform: translateX(50%); top: auto; bottom: 120px; }
html.shell-collapsed .ui-collapse svg { transform: rotate(180deg); }

/* Móvil: barra arriba (respeta la zona del reloj/Dynamic Island), pestañas abajo al alcance del pulgar y menú «Más» como cajón */
.ui-mobilebar, .ui-tabs { display: none; }
.ui-install { display: flex; align-items: center; gap: 10px; cursor: pointer; border: 0; font: 600 13px var(--font-body); }
.ui-install svg { width: 18px; height: 18px; stroke: currentColor; flex: none; }
.ui-install.side { height: 38px; padding: 0 12px; border-radius: 11px; background: var(--ui-lime, #d3ff2a); color: #0b0b0c; margin-bottom: 4px; }
.ui-install.side:hover { filter: brightness(1.05); }
html.shell-collapsed .ui-install.side span { display: none; } html.shell-collapsed .ui-install.side { justify-content: center; padding: 0; }
.ui-install-steps { margin: 8px 0 4px; padding-left: 20px; font-size: 14px; line-height: 1.5; } .ui-install-steps li { margin: 4px 0; }
@media (max-width: 900px) {
  :root { --ui-safe-top: env(safe-area-inset-top, 0px); --ui-safe-bottom: env(safe-area-inset-bottom, 0px); }
  html.has-shell body, html.has-shell.shell-collapsed body { padding-left: 0; padding-top: calc(52px + var(--ui-safe-top)); padding-bottom: calc(64px + var(--ui-safe-bottom)); }
  .ui-sidebar { transform: translateX(-100%); transition: transform var(--ui-med) var(--ui-ease); width: min(300px, 86vw) !important; box-shadow: var(--ui-shadow-3);
    padding-top: calc(14px + var(--ui-safe-top)) !important; padding-bottom: calc(10px + var(--ui-safe-bottom)) !important; }
  html.shell-open .ui-sidebar { transform: none; }
  .ui-collapse { display: none; }
  html.shell-collapsed .ui-nav a span, html.shell-collapsed .ui-client-text, html.shell-collapsed .ui-brand-full { display: initial; }
  .ui-mobilebar { display: flex; align-items: center; gap: 10px; position: fixed; top: 0; left: 0; right: 0; z-index: 55;
    height: calc(52px + var(--ui-safe-top)); padding: var(--ui-safe-top) max(14px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    background: #0b0b0c; color: #fff; }
  .ui-mobilebar button { background: none; border: 0; color: #fff; padding: 10px; margin-right: -6px; border-radius: 10px; cursor: pointer; }
  .ui-mobilebar svg { width: 21px; height: 21px; stroke: currentColor; display: block; }
  .ui-mobilebar img { height: 18px; }
  .ui-mobilebar .ui-mobile-title { flex: 1; font: 600 15px var(--font-display); }
  .ui-mobilebar .ui-install.top { background: var(--ui-lime, #d3ff2a); color: #0b0b0c; height: 32px; padding: 0 12px; border-radius: 99px; font-size: 12.5px; margin: 0; }
  .ui-mobilebar .ui-install.top svg { width: 16px; height: 16px; }
  .ui-tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 56; background: #0b0b0c; border-top: 1px solid rgba(255,255,255,.08);
    height: calc(60px + var(--ui-safe-bottom)); padding: 0 6px var(--ui-safe-bottom); align-items: stretch; }
  .ui-tabs a, .ui-tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; position: relative;
    color: rgba(255,255,255,.62); text-decoration: none; background: none; border: 0; font: 500 10.5px var(--font-body); cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .ui-tabs a.on { color: #fff; } .ui-tabs a.on svg { stroke: var(--ui-lime, #d3ff2a); }
  .ui-tabs svg { width: 23px; height: 23px; stroke: currentColor; }
  .ui-tabs .ui-tab-new { flex: 0 0 64px; } .ui-tabs .ui-tab-new svg { width: 26px; height: 26px; padding: 11px; box-sizing: content-box; border-radius: 16px; background: var(--ui-lime, #d3ff2a); stroke: #0b0b0c; stroke-width: 2.4; }
  .ui-tabs .ui-badge { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; }
  .ui-scrim { position: fixed; inset: 0; z-index: 58; background: rgba(0, 0, 0, 0.45); opacity: 0; pointer-events: none; transition: opacity var(--ui-med); }
  html.shell-open .ui-scrim { opacity: 1; pointer-events: auto; }
  .ui-install.side { display: none; }
  /* lo flotante de cada página se sube para no quedar detrás de las pestañas */
  .ui-toasts { right: 12px; left: 12px; bottom: calc(76px + var(--ui-safe-bottom)); }
  .bulkbar { bottom: calc(76px + var(--ui-safe-bottom)) !important; }
}

/* ---------- Encabezado de página ---------- */
html.has-shell[data-theme="light"] .page-hero {
  background: transparent !important; border: 0 !important; padding: 40px 48px 8px !important; position: relative; overflow: visible;
}
html.has-shell[data-theme="light"] .page-hero-grid { max-width: 1180px; margin: 0 auto; }
html.has-shell[data-theme="light"] .page-title {
  font-family: var(--font-display) !important; font-weight: 500 !important; font-size: clamp(34px, 4vw, 52px) !important;
  letter-spacing: -0.035em !important; line-height: 1.02 !important; color: var(--ui-ink) !important;
}
html.has-shell[data-theme="light"] .page-title em {
  font-style: normal; color: var(--ui-ink) !important;
  background: linear-gradient(100deg, #0b0b0c 0%, #1751f5 55%, #7fbf00 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
html.has-shell[data-theme="light"] .page-desc { color: var(--ui-ink-3) !important; font-size: 15px !important; max-width: 620px; margin-top: 10px; }
html.has-shell[data-theme="light"] .eyebrow { font: 500 11px/1 var(--font-mono) !important; letter-spacing: 0.14em !important; color: var(--ui-ink-3) !important; text-transform: uppercase; }

/* ---------- Contenedores y tarjetas ---------- */
html.has-shell[data-theme="light"] .container, html.has-shell[data-theme="light"] .container-narrow { max-width: 1180px; padding-left: 48px; padding-right: 48px; }
html.has-shell[data-theme="light"] .card, html.has-shell[data-theme="light"] .form-section, html.has-shell[data-theme="light"] .piece-row, html.has-shell[data-theme="light"] .result-block .result-head, html.has-shell[data-theme="light"] .ro-block, html.has-shell[data-theme="light"] .design-agent {
  border-radius: var(--ui-r-lg) !important;
}
html.has-shell[data-theme="light"] .card, html.has-shell[data-theme="light"] .form-section, html.has-shell[data-theme="light"] .piece-row {
  background: var(--ui-surface) !important; border: 1px solid var(--ui-line) !important; box-shadow: var(--ui-shadow-1) !important;
  transition: box-shadow var(--ui-med) var(--ui-ease), transform var(--ui-med) var(--ui-ease), border-color var(--ui-med);
}
html.has-shell[data-theme="light"] .card-interactive:hover, html.has-shell[data-theme="light"] .strip-card:hover { transform: translateY(-2px); box-shadow: var(--ui-shadow-2) !important; }
html.has-shell[data-theme="light"] .form-section-title { font: 600 18px/1.2 var(--font-display) !important; letter-spacing: -0.02em; }
html.has-shell[data-theme="light"] .form-section-desc { color: var(--ui-ink-3) !important; }

/* Historial (tiras de parrillas/planes) */
html.has-shell[data-theme="light"] .history-strip { max-width: 1180px; margin: 8px auto 0 !important; padding: 0 48px !important; background: none !important; border: 0 !important; }
html.has-shell[data-theme="light"] .strip-scroll { gap: 12px !important; padding: 4px 2px 14px !important; scroll-snap-type: x mandatory; }
html.has-shell[data-theme="light"] .strip-card {
  scroll-snap-align: start; min-width: 220px !important; border-radius: var(--ui-r-md) !important; background: var(--ui-surface) !important;
  border: 1px solid var(--ui-line) !important; box-shadow: var(--ui-shadow-1); padding: 14px 16px !important;
  transition: transform var(--ui-med) var(--ui-ease), box-shadow var(--ui-med) var(--ui-ease), border-color var(--ui-fast);
}
html.has-shell[data-theme="light"] .strip-card.active, html.has-shell[data-theme="light"] .strip-card[aria-current] { border-color: var(--ui-ink) !important; box-shadow: 0 0 0 3px rgba(211, 255, 42, 0.7) !important; }
html.has-shell[data-theme="light"] .strip-label { color: var(--ui-ink-3) !important; }

/* ---------- Botones ---------- */
html.has-shell[data-theme="light"] .btn {
  border-radius: 12px !important; font: 600 14px/1 var(--font-body) !important; letter-spacing: -0.01em !important; height: 40px; padding: 0 16px !important;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  transition: transform var(--ui-fast) var(--ui-ease), box-shadow var(--ui-med) var(--ui-ease), background var(--ui-fast), border-color var(--ui-fast), color var(--ui-fast) !important;
}
html.has-shell[data-theme="light"] .btn:active:not(:disabled) { transform: scale(0.97); }
html.has-shell[data-theme="light"] .btn:disabled { opacity: 0.45; cursor: not-allowed; }
html.has-shell[data-theme="light"] .btn-sm { height: 32px; padding: 0 12px !important; font-size: 13px !important; border-radius: 10px !important; }
html.has-shell[data-theme="light"] .btn-lg { height: 48px; padding: 0 22px !important; font-size: 15px !important; border-radius: 14px !important; }
html.has-shell[data-theme="light"] .btn-primary { background: var(--ui-ink) !important; color: #fff !important; border: 1px solid var(--ui-ink) !important; }
html.has-shell[data-theme="light"] .btn-primary:hover:not(:disabled) { background: #232326 !important; box-shadow: var(--ui-shadow-2); }
html.has-shell[data-theme="light"] .btn-accent { background: var(--ui-lime) !important; color: var(--ui-lime-ink) !important; border: 1px solid rgba(11, 11, 12, 0.08) !important; }
html.has-shell[data-theme="light"] .btn-accent:hover:not(:disabled) { box-shadow: var(--ui-glow-lime); }
html.has-shell[data-theme="light"] .btn-blue { background: var(--ui-blue) !important; color: #fff !important; border: 1px solid var(--ui-blue) !important; }
html.has-shell[data-theme="light"] .btn-blue:hover:not(:disabled) { box-shadow: 0 8px 26px -8px rgba(23, 81, 245, 0.7); }
html.has-shell[data-theme="light"] .btn-ghost { background: var(--ui-surface) !important; color: var(--ui-ink) !important; border: 1px solid var(--ui-line-2) !important; }
html.has-shell[data-theme="light"] .btn-ghost:hover:not(:disabled) { background: var(--ui-surface-2) !important; border-color: rgba(11, 11, 12, 0.24) !important; }
html.has-shell[data-theme="light"] .btn-accent.is-loading, html.has-shell[data-theme="light"] .btn.is-loading { position: relative; color: transparent !important; }
html.has-shell[data-theme="light"] .btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor;
  border-color: var(--ui-ink) transparent var(--ui-ink) transparent; animation: ui-spin 0.8s linear infinite; }

/* ---------- Campos ---------- */
html.has-shell[data-theme="light"] .input, html.has-shell[data-theme="light"] .textarea, html.has-shell[data-theme="light"] textarea, html.has-shell[data-theme="light"] select, html.has-shell[data-theme="light"] input[type="text"], html.has-shell[data-theme="light"] input[type="number"], html.has-shell[data-theme="light"] input[type="email"], html.has-shell[data-theme="light"] input[type="password"] {
  border-radius: 12px !important; border: 1px solid var(--ui-line-2) !important; background: var(--ui-surface) !important; color: var(--ui-ink) !important;
  font-family: var(--font-body); transition: border-color var(--ui-fast), box-shadow var(--ui-med) var(--ui-ease), background var(--ui-fast) !important;
}
html.has-shell[data-theme="light"] .input:hover, html.has-shell[data-theme="light"] textarea:hover, html.has-shell[data-theme="light"] select:hover { border-color: rgba(11, 11, 12, 0.28) !important; }
html.has-shell[data-theme="light"] .input:focus, html.has-shell[data-theme="light"] textarea:focus, html.has-shell[data-theme="light"] select:focus, html.has-shell[data-theme="light"] input:focus {
  outline: none !important; border-color: var(--ui-blue) !important; box-shadow: 0 0 0 4px var(--ui-blue-soft) !important;
}
html.has-shell[data-theme="light"] .field-label, html.has-shell[data-theme="light"] .edit-label, html.has-shell[data-theme="light"] .copy-label, html.has-shell[data-theme="light"] .label-mono {
  font: 500 11px/1.2 var(--font-mono) !important; letter-spacing: 0.08em !important; color: var(--ui-ink-3) !important; text-transform: uppercase;
}
html.has-shell[data-theme="light"] :focus-visible { outline: 2px solid var(--ui-blue); outline-offset: 2px; }

/* ---------- Badges / chips ---------- */
html.has-shell[data-theme="light"] .badge {
  border-radius: 999px !important; font: 600 11px/1 var(--font-body) !important; letter-spacing: 0 !important; padding: 6px 10px !important;
  text-transform: none !important; border: 1px solid transparent !important;
}
html.has-shell[data-theme="light"] .badge-instagram { background: linear-gradient(120deg, rgba(225, 48, 108, 0.12), rgba(131, 58, 180, 0.12)) !important; color: #b4235a !important; }
html.has-shell[data-theme="light"] .badge-tiktok { background: rgba(11, 11, 12, 0.07) !important; color: var(--ui-ink) !important; }
html.has-shell[data-theme="light"] .badge-pillar { background: var(--ui-canvas) !important; color: var(--ui-ink-2) !important; border-color: var(--ui-line) !important; }
html.has-shell[data-theme="light"] .badge-approved { background: var(--ui-ok-soft) !important; color: #067647 !important; }
html.has-shell[data-theme="light"] .badge-pending { background: var(--ui-warn-soft) !important; color: #b54708 !important; }
html.has-shell[data-theme="light"] .badge-changes { background: var(--ui-bad-soft) !important; color: #b42318 !important; }

/* ---------- Toast ---------- */
html.has-shell .toast {
  left: 50% !important; right: auto !important; bottom: 28px !important; top: auto !important; transform: translate(-50%, 20px) scale(0.96) !important;
  border-radius: 14px !important; background: rgba(11, 11, 12, 0.92) !important; color: #fff !important; padding: 12px 18px !important;
  box-shadow: var(--ui-shadow-3) !important; backdrop-filter: blur(12px); font: 500 14px var(--font-body) !important;
  transition: opacity var(--ui-med) var(--ui-ease), transform var(--ui-med) var(--ui-ease-spring) !important; z-index: 90 !important;
}
html.has-shell .toast.show, html.has-shell .toast.visible { transform: translate(-50%, 0) scale(1) !important; }
.ui-toasts { position: fixed; right: 24px; bottom: 24px; z-index: 95; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.ui-toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px; padding: 12px 16px; border-radius: 14px;
  background: rgba(11, 11, 12, 0.94); color: #fff; box-shadow: var(--ui-shadow-3); font: 500 14px/1.35 var(--font-body);
  animation: ui-toast-in var(--ui-slow) var(--ui-ease-spring) both;
}
.ui-toast.out { animation: ui-toast-out var(--ui-med) var(--ui-ease) both; }
.ui-toast i { flex: 0 0 8px; height: 8px; border-radius: 50%; background: var(--ui-lime); box-shadow: 0 0 10px var(--ui-lime); }
.ui-toast.error i { background: var(--ui-bad); box-shadow: 0 0 10px var(--ui-bad); }
.ui-toast.warn i { background: var(--ui-warn); box-shadow: 0 0 10px var(--ui-warn); }

/* ---------- Command palette (⌘K) ---------- */
.ui-cmdk-scrim { position: fixed; inset: 0; z-index: 100; background: rgba(11, 11, 12, 0.38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; animation: ui-fade var(--ui-med) var(--ui-ease) both; }
.ui-cmdk { width: min(640px, calc(100vw - 32px)); background: rgba(255, 255, 255, 0.96); border-radius: 20px; box-shadow: var(--ui-shadow-3), 0 0 0 1px var(--ui-line);
  overflow: hidden; animation: ui-pop var(--ui-slow) var(--ui-ease-spring) both; }
.ui-cmdk-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--ui-line); }
.ui-cmdk-input svg { width: 18px; height: 18px; stroke: var(--ui-ink-3); flex: 0 0 18px; }
.ui-cmdk-input input { flex: 1; border: 0 !important; outline: 0 !important; box-shadow: none !important; font: 500 16px var(--font-body); background: transparent !important; padding: 0 !important; }
.ui-cmdk-list { max-height: 52vh; overflow: auto; padding: 8px; }
.ui-cmdk-group { font: 500 10px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ui-ink-3); padding: 12px 12px 6px; }
.ui-cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; color: var(--ui-ink); text-decoration: none !important; }
.ui-cmdk-item svg { width: 18px; height: 18px; stroke: var(--ui-ink-3); flex: 0 0 18px; }
.ui-cmdk-item small { margin-left: auto; color: var(--ui-ink-3); font-size: 12px; }
.ui-cmdk-item[aria-selected="true"] { background: var(--ui-canvas); }
.ui-cmdk-item[aria-selected="true"] svg { stroke: var(--ui-ink); }
.ui-cmdk-empty { padding: 28px; text-align: center; color: var(--ui-ink-3); }
.ui-cmdk-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--ui-line); font-size: 12px; color: var(--ui-ink-3); background: var(--ui-surface-2); }

/* ---------- Skeleton / spinners ---------- */
.ui-skel { position: relative; overflow: hidden; background: var(--ui-canvas-2); border-radius: 10px; }
.ui-skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent); animation: ui-shimmer 1.4s infinite; }
html.has-shell .spinner { border-color: rgba(11, 11, 12, 0.12) !important; border-top-color: var(--ui-ink) !important; }

/* ---------- Entrada escalonada ---------- */
.ui-reveal { animation: ui-rise var(--ui-slow) var(--ui-ease) both; animation-delay: calc(var(--i, 0) * 45ms); }

@keyframes ui-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ui-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-pop { from { opacity: 0; transform: translateY(-8px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes ui-toast-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes ui-toast-out { to { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes ui-spin { to { transform: rotate(360deg); } }
@keyframes ui-shimmer { to { transform: translateX(100%); } }
@keyframes ui-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.22); } 50% { box-shadow: 0 0 0 6px rgba(18, 183, 106, 0.05); } }

/* Transición entre páginas (navegadores con View Transitions) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: ui-vt-out 180ms var(--ui-ease) both; }
::view-transition-new(root) { animation: ui-vt-in 320ms var(--ui-ease) both; }
@keyframes ui-vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes ui-vt-in { from { opacity: 0; transform: translateY(6px); } }
.ui-sidebar { view-transition-name: ui-sidebar; }
::view-transition-old(ui-sidebar), ::view-transition-new(ui-sidebar) { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ================================================================
   PARRILLA — espacio de trabajo (grid-ux.js)
   ================================================================ */
html.has-shell .form-container { max-width: 1180px !important; padding: 0 48px !important; margin: 18px auto 0 !important; }
html.has-shell .result-block { margin-top: 8px; }
.gx-newgrid { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); box-shadow: var(--ui-shadow-1); margin-bottom: 22px; overflow: hidden;
  transition: box-shadow var(--ui-med) var(--ui-ease); }
.gx-newgrid[open] { box-shadow: var(--ui-shadow-2); }
.gx-newgrid > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 18px 22px; }
.gx-newgrid > summary::-webkit-details-marker { display: none; }
.gx-plus { flex: 0 0 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--ui-lime); color: #000; font: 600 20px/1 var(--font-display);
  transition: transform var(--ui-med) var(--ui-ease-spring); }
.gx-newgrid[open] .gx-plus { transform: rotate(45deg); }
.gx-newgrid-title { display: flex; flex-direction: column; gap: 3px; }
.gx-newgrid-title b { font: 600 16px var(--font-display); letter-spacing: -0.01em; }
.gx-newgrid-title small { color: var(--ui-ink-3); font-size: 13px; }
.gx-newgrid-body { padding: 0 22px 22px; display: flex; flex-direction: column; gap: 14px; animation: ui-rise var(--ui-slow) var(--ui-ease) both; }
.gx-newgrid-body .form-section { box-shadow: none !important; background: var(--ui-surface-2) !important; margin: 0 !important; }

/* Encabezado del resultado */
html.has-shell[data-theme="light"] .result-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 6px 2px 14px !important;
  border: 0 !important; background: none !important; }
html.has-shell[data-theme="light"] .result-id { font: 500 11px var(--font-mono) !important; letter-spacing: 0.12em; color: var(--ui-ink-3) !important; }
html.has-shell[data-theme="light"] .result-title { font: 500 30px/1.05 var(--font-display) !important; letter-spacing: -0.03em !important; color: var(--ui-ink) !important; }
html.has-shell[data-theme="light"] .result-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Barra fija de la parrilla */
.gx-toolbar { position: sticky; top: 12px; z-index: 30; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 16px; padding: 10px 12px 10px 16px;
  border-radius: 16px; background: rgba(255, 255, 255, 0.82); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border: 1px solid var(--ui-line); box-shadow: var(--ui-shadow-2); animation: ui-rise var(--ui-slow) var(--ui-ease) both; }
@media (max-width: 900px) { .gx-toolbar { top: calc(52px + env(safe-area-inset-top, 0px)); } }
.gx-stats { display: flex; gap: 16px; }
.gx-stat { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--ui-ink-3); }
.gx-stat b { font: 600 18px var(--font-display); color: var(--ui-ink); }
.gx-stat.ok b { color: #067647; } .gx-stat.warn b { color: #b54708; }
.gx-filters { display: flex; gap: 4px; padding: 4px; background: var(--ui-canvas); border-radius: 12px; margin-left: auto; }
.gx-filters button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font: 500 13px var(--font-body); color: var(--ui-ink-3); cursor: pointer;
  transition: background var(--ui-fast), color var(--ui-fast), box-shadow var(--ui-med) var(--ui-ease); }
.gx-filters button:hover { color: var(--ui-ink); }
.gx-filters button[aria-selected="true"] { background: var(--ui-surface); color: var(--ui-ink); box-shadow: var(--ui-shadow-1); }
.gx-tools { display: flex; gap: 8px; }

/* Tarjeta de pieza */
html.has-shell[data-theme="light"] .result-pieces { gap: 12px !important; }
html.has-shell[data-theme="light"] .piece-row.gx-card { padding: 0 !important; overflow: hidden; }
html.has-shell[data-theme="light"] .piece-row.gx-card:hover { border-color: var(--ui-line-2) !important; box-shadow: var(--ui-shadow-2) !important; }
html.has-shell[data-theme="light"] .piece-row.gx-card.gx-open { box-shadow: var(--ui-shadow-3) !important; border-color: rgba(11, 11, 12, 0.18) !important; }
.gx-head { width: 100%; display: flex; align-items: center; gap: 18px; padding: 16px 18px; background: none; border: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.gx-head:focus-visible { outline: 2px solid var(--ui-blue); outline-offset: -2px; border-radius: var(--ui-r-lg); }
.gx-date { flex: 0 0 58px; height: 64px; border-radius: 14px; background: var(--ui-canvas); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  transition: background var(--ui-med), color var(--ui-med); }
.gx-date b { font: 600 22px/1 var(--font-display); letter-spacing: -0.03em; }
.gx-date small { font: 500 10px/1.1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ui-ink-3); }
.gx-card.gx-open .gx-date { background: var(--ui-ink); color: #fff; }
.gx-card.gx-open .gx-date small { color: var(--ui-lime); }
.gx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.gx-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gx-num { font: 600 11px var(--font-mono); color: var(--ui-ink-3); }
.gx-chip { font: 500 12px/1 var(--font-body); padding: 5px 9px; border-radius: 999px; background: var(--ui-canvas); color: var(--ui-ink-2); border: 1px solid var(--ui-line); }
.gx-fmt { background: var(--ui-ink); color: #fff; border-color: var(--ui-ink); }
.gx-time { font: 500 12px var(--font-mono); color: var(--ui-ink-3); }
.gx-title { font: 600 18px/1.25 var(--font-display); letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-sub { font-size: 13px; color: var(--ui-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.gx-flags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 320px; }
.gx-flag { font: 600 11px/1 var(--font-body); padding: 6px 9px; border-radius: 999px; white-space: nowrap; }
.gx-flag.ok { background: var(--ui-ok-soft); color: #067647; }
.gx-flag.warn { background: var(--ui-warn-soft); color: #b54708; }
.gx-flag.bad { background: var(--ui-bad-soft); color: #b42318; }
.gx-ring { position: relative; width: 44px; height: 44px; flex: 0 0 44px; }
.gx-ring svg { width: 44px; height: 44px; display: block; }
.gx-ring span { position: absolute; inset: 0; display: grid; place-items: center; font: 600 10px var(--font-mono); color: var(--ui-ink-2); }
.gx-ver { font: 600 11px var(--font-mono); padding: 5px 8px; border-radius: 8px; background: var(--ui-blue-soft); color: var(--ui-blue); }
.gx-chev { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--ui-ink-3); transition: transform var(--ui-med) var(--ui-ease), background var(--ui-fast); }
.gx-chev svg { width: 18px; height: 18px; }
.gx-head:hover .gx-chev { background: var(--ui-canvas); color: var(--ui-ink); }
.gx-card.gx-open .gx-chev { transform: rotate(180deg); }
.gx-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--ui-slow) var(--ui-ease); }
.gx-card.gx-open .gx-body { grid-template-rows: 1fr; }
.gx-inner { overflow: hidden; min-height: 0; padding: 0 22px; opacity: 0; transform: translateY(-6px); transition: opacity var(--ui-med) var(--ui-ease), transform var(--ui-med) var(--ui-ease), padding var(--ui-med); }
.gx-card.gx-open .gx-inner { opacity: 1; transform: none; padding: 4px 22px 22px; border-top: 1px solid var(--ui-line); }
.gx-inner > .piece-row-top { display: none; }   /* el encabezado nuevo ya muestra número, plataforma y pilar */
@media (max-width: 760px) {
  .gx-head { flex-wrap: wrap; gap: 12px; }
  .gx-side { width: 100%; justify-content: space-between; }
  .gx-filters { margin-left: 0; width: 100%; overflow-x: auto; }
  html.has-shell .form-container, html.has-shell .history-strip, html.has-shell[data-theme="light"] .page-hero { padding-left: 18px !important; padding-right: 18px !important; }
}

/* Bloques internos de la pieza (editor existente) */
html.has-shell[data-theme="light"] .edit-section-label { font: 500 11px var(--font-mono); letter-spacing: 0.08em; color: var(--ui-ink-3); margin: 16px 0 6px; }
html.has-shell[data-theme="light"] .ro-block { background: var(--ui-surface-2) !important; border: 1px solid var(--ui-line) !important; }
html.has-shell[data-theme="light"] .piece-feedback { border-radius: var(--ui-r-md) !important; border: 1px dashed var(--ui-line-2) !important; background: var(--ui-surface-2) !important; }
html.has-shell[data-theme="light"] .result-block { background: transparent !important; border: 0 !important; padding: 0 !important; margin-top: 4px !important; }
html.has-shell[data-theme="light"] .submit-bar { border-radius: var(--ui-r-md) !important; background: var(--ui-ink) !important; padding: 12px 12px 12px 18px !important; }
html.has-shell[data-theme="light"] .loading-block { border-radius: var(--ui-r-lg) !important; background: var(--ui-surface) !important; border: 1px solid var(--ui-line) !important; box-shadow: var(--ui-shadow-2); }
/* Pestañas dentro de la pieza */
.gx-tabbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 0 6px; position: sticky; top: 0; }
.gx-tabs { display: flex; gap: 4px; padding: 4px; background: var(--ui-canvas); border-radius: 12px; overflow-x: auto; }
.gx-tabs button { border: 0; background: transparent; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 9px; font: 500 13px var(--font-body);
  color: var(--ui-ink-3); cursor: pointer; white-space: nowrap; transition: background var(--ui-fast), color var(--ui-fast), box-shadow var(--ui-med) var(--ui-ease); }
.gx-tabs button:hover { color: var(--ui-ink); }
.gx-tabs button[aria-selected="true"] { background: var(--ui-surface); color: var(--ui-ink); box-shadow: var(--ui-shadow-1); }
.gx-tabs button em { font: 600 10px var(--font-mono); font-style: normal; padding: 3px 6px; border-radius: 6px; background: rgba(11, 11, 12, 0.06); }
.gx-tabs .gx-tab-art span::before { content: none; color: #7fbf00; }
.gx-tabs .gx-tab-art[aria-selected="true"] { background: var(--ui-ink); color: var(--ui-lime); }
.gx-pane { padding-top: 8px; }
.gx-pane-in { animation: ui-rise var(--ui-med) var(--ui-ease) both; }
html.has-shell[data-theme="light"] .piece-version-bar { margin: 0 !important; border: 0 !important; padding: 0 !important; background: none !important; }

/* ARTE: los estilos del Estudio de Arte viven en spn/design-agent.js */
@keyframes ui-sheen { 0% { transform: translateX(-120%); } 35%, 100% { transform: translateX(120%); } }
.ui-lightbox { position: fixed; inset: 0; z-index: 110; background: rgba(11, 11, 12, 0.82); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 32px;
  animation: ui-fade var(--ui-med) var(--ui-ease) both; cursor: zoom-out; }
.ui-lightbox img, .ui-lightbox video { max-width: 92vw; max-height: 88vh; border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); animation: ui-pop var(--ui-slow) var(--ui-ease-spring) both; }
@media (max-width: 760px) {
  html.has-shell[data-theme="light"] .history-strip, html.has-shell[data-theme="light"] .container, html.has-shell[data-theme="light"] .container-narrow { padding-left: 18px !important; padding-right: 18px !important; }
  html.has-shell[data-theme="light"] .page-hero { padding: 24px 18px 4px !important; }
  html.has-shell[data-theme="light"] .result-actions .btn { flex: 1 1 auto; }
}
html.has-shell .strip-scroll { scrollbar-width: none; } html.has-shell .strip-scroll::-webkit-scrollbar { display: none; }
@media (max-width: 760px) {
  .gx-toolbar { position: static; padding: 10px; gap: 10px; }
  .gx-filters { flex-wrap: nowrap; }
  .gx-filters button { padding: 7px 10px; white-space: nowrap; }
  .gx-tools { display: none; }
}

/* pieza abierta desde Art Studio */
.gx-card.gx-focus { box-shadow: 0 0 0 3px rgba(211,255,42,.9), var(--ui-shadow-2); transition: box-shadow .4s; }

/* menú de la cuenta (al picar el perfil) */
.ui-user { position: relative; cursor: pointer; border-radius: 12px; transition: background .15s; }
.ui-user:hover { background: rgba(255,255,255,.05); }
.ui-user-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); background: #18181b; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.45); z-index: 20; animation: ui-rise .18s var(--ui-ease) both; cursor: default; }
.ui-user-menu-who { font-size: 12px; color: #a9a9b0; padding: 6px 8px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-user-menu-tag { font: 600 10px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: #d3ff2a; padding: 0 8px 6px; }
.ui-user-menu button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; color: #fff; padding: 8px; border-radius: 8px; font: 500 13px var(--font-body); cursor: pointer; text-align: left; }
.ui-user-menu button:hover, .ui-user-menu button:focus { background: rgba(255,255,255,.08); outline: 0; }
.ui-user-menu button svg { width: 16px; height: 16px; stroke: currentColor; }

/* ---------- Polygon OS: barra lateral en tres secciones ---------- */
.ui-side-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0 -6px; padding: 0 6px; scrollbar-width: none; }
.ui-side-scroll::-webkit-scrollbar { display: none; }
button.ui-client { width: calc(100% - 4px); font: inherit; cursor: pointer; text-align: left; margin-bottom: 6px; }
.ui-acc-menu { margin: -2px 2px 10px; padding: 6px; border-radius: 12px; background: #18181b; border: 1px solid rgba(255,255,255,.1); box-shadow: 0 12px 32px rgba(0,0,0,.45); animation: ui-rise .18s var(--ui-ease) both; }
.ui-acc-menu button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; color: #e8e8ea; padding: 8px; border-radius: 8px; font: 500 13px var(--font-body); cursor: pointer; text-align: left; }
.ui-acc-menu button:hover, .ui-acc-menu button.cur { background: rgba(255,255,255,.08); }
.ui-acc-menu button i { flex: 0 0 10px; height: 10px; border-radius: 3px; }
.ui-acc-menu button span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-acc-menu button em { font: 600 10.5px var(--font-mono); font-style: normal; color: #0b0b0c; background: var(--ui-lime); border-radius: 99px; padding: 1px 6px; }
.ui-acc-menu a { display: block; font-size: 12px; color: #8b8b92 !important; padding: 8px 8px 4px; text-decoration: none !important; }
.ui-acc-menu a:hover { color: #fff !important; }
html.shell-collapsed .ui-acc-menu { display: none; }
.ui-idea-btn { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: 11px; cursor: pointer; background: rgba(211,255,42,.08); border: 1px solid rgba(211,255,42,.22); color: var(--ui-lime); font: 500 13px var(--font-body); }
.ui-idea-btn:hover { background: rgba(211,255,42,.14); }
.ui-idea-btn svg { flex: 0 0 18px; width: 18px; height: 18px; stroke: currentColor; }
html.shell-collapsed .ui-idea-btn span { display: none; } html.shell-collapsed .ui-idea-btn { justify-content: center; padding: 0; }
.ui-idea-scrim { position: fixed; inset: 0; z-index: 200; background: rgba(11,11,12,.45); display: grid; place-items: center; padding: 20px; animation: ui-fade .2s both; }
.ui-idea { width: min(480px, 100%); background: var(--ui-surface, #fff); color: var(--ui-ink, #0b0b0c); border-radius: 18px; padding: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.3); animation: ui-rise .25s var(--ui-ease) both; }
.ui-idea b { font: 600 18px var(--font-display); display: block; } .ui-idea p { font-size: 13px; color: var(--ui-ink-3, #77777c); margin: 6px 0 12px; }
.ui-idea textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--ui-line-2, rgba(0,0,0,.14)); border-radius: 12px; padding: 12px; font: 400 14px var(--font-body); resize: vertical; }
.ui-idea-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.ui-idea-row button { height: 38px; padding: 0 16px; border-radius: 11px; border: 0; background: #0b0b0c; color: #fff; font: 600 13px var(--font-body); cursor: pointer; }
.ui-idea-row button.ghost { background: var(--ui-canvas, #f4f4f1); color: var(--ui-ink, #0b0b0c); }

.ui-nav .ui-badge { margin-left: auto; font: 700 10.5px/18px var(--font-body); font-style: normal; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 99px; background: rgba(255,255,255,.14); color: #fff; text-align: center; }
.ui-nav .ui-badge.hot { background: #e5484d; }
html.shell-collapsed .ui-nav .ui-badge { position: absolute; top: 4px; right: 6px; min-width: 8px; height: 8px; padding: 0; font-size: 0; }

/* ---------- avisos push ---------- */
.ui-push-btn { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: 11px; cursor: pointer; background: rgba(229,72,77,.12); border: 1px solid rgba(229,72,77,.35); color: #ffb4b1; font: 500 12.5px var(--font-body); text-align: left; }
.ui-push-btn svg { flex: 0 0 18px; width: 18px; height: 18px; stroke: currentColor; }
.ui-push-btn[hidden] { display: none; }
html.shell-collapsed .ui-push-btn span { display: none; } html.shell-collapsed .ui-push-btn { justify-content: center; padding: 0; }
.ui-push .ui-push-state { background: var(--ui-canvas, #f4f4f1); border-radius: 12px; padding: 12px; font-size: 13.5px; margin-bottom: 12px; }
.ui-push .ui-push-state .ok { color: #067647; font-weight: 600; }
.ui-push .ui-push-state ol { margin: 8px 0 0; padding-left: 20px; } .ui-push .ui-push-state li { margin: 3px 0; }
.ui-push .ui-push-state button.big { width: 100%; height: 44px; border-radius: 12px; border: 0; background: #0b0b0c; color: #fff; font: 600 14px var(--font-body); cursor: pointer; }
.ui-push .ui-push-state button.link { display: block; margin-top: 8px; border: 0; background: none; padding: 0; color: #b42318; font: 500 12.5px var(--font-body); cursor: pointer; text-decoration: underline; }
.ui-push .ui-push-prefs { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.ui-push .ui-push-prefs label { display: flex; align-items: center; gap: 10px; }
.ui-push .ui-push-prefs label > span:first-child { min-width: 54px; color: var(--ui-ink-3, #77777c); }
.ui-push .ui-push-prefs select { flex: 1; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--ui-line-2, rgba(0,0,0,.14)); font: 400 13.5px var(--font-body); }
.ui-push .ui-push-prefs .tog input { width: 18px; height: 18px; accent-color: #0b0b0c; }

/* Ficha 2.0: botón para crear en una línea */
.ui-create-btn { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; margin: 2px 0 10px; padding: 0 12px; border-radius: 11px; border: 0; cursor: pointer; background: #fff; color: #0b0b0c; font: 600 13.5px var(--font-body); box-shadow: 0 1px 0 rgba(0,0,0,.2); transition: transform .15s var(--ui-ease); }
.ui-create-btn:hover { transform: translateY(-1px); }
.ui-create-btn b { font-size: 16px; width: 18px; text-align: center; } .ui-create-btn span { flex: 1; text-align: left; }
.ui-create-btn kbd { font: 600 10.5px var(--font-mono); padding: 2px 6px; border-radius: 6px; background: #f0f0f2; color: #6b6b70; }
html.shell-collapsed .ui-create-btn span, html.shell-collapsed .ui-create-btn kbd { display: none; } html.shell-collapsed .ui-create-btn { justify-content: center; padding: 0; }
.ui-push-help { margin-top: 12px; font-size: 13px; color: var(--ui-ink-2); } .ui-push-help summary { cursor: pointer; font-weight: 600; }
.ui-push-help ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.5; }

/* Toast con acción (p. ej. «Abrir ficha →») */
.ui-toast-act { margin-left: 10px; font-weight: 700; color: inherit; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* Celular: nada se sale de la pantalla, campos que no hacen zoom en iPhone, botones del tamaño del dedo y menos efectos pesados */
@media (max-width: 900px) {
  html.has-shell, html.has-shell body { overflow-x: clip; max-width: 100%; }
  html.has-shell input:not([type=checkbox]):not([type=radio]), html.has-shell select, html.has-shell textarea { font-size: 16px !important; }
  html.has-shell body::before { display: none; }
  html.has-shell *, html.has-shell *::before, html.has-shell *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  html.has-shell main, html.has-shell .os-card, html.has-shell .card { animation-duration: .15s !important; }
  html.has-shell input[type=checkbox] { width: 22px !important; height: 22px !important; }
  .os-task { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { html.has-shell * { animation: none !important; transition: none !important; } }
