
  :root {
    --bg: #070B14; --panel: #0E1426; --panel2: #121B33; --border: #1E2A47;
    --text: #F3F6FF; --muted: #8C97B2; --cyan: #22D3EE; --pink: #EC4899; --violet: #8B5CF6; --ok: #34D399; --teal: #22D3EE; --coral: #EC4899;
    box-sizing: border-box;
  }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) { --bg: #070B14; --panel: #0E1426; --panel2: #121B33; --border: #1E2A47; --text: #F3F6FF; --muted: #8C97B2; }
  }
  :root[data-theme="dark"] { --bg: #070B14; --panel: #0E1426; --panel2: #121B33; --border: #1E2A47; --text: #F3F6FF; --muted: #8C97B2; }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; scroll-padding-top: 130px; }
  body {
    margin: 0; color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background:
      radial-gradient(900px 420px at 85% -5%, rgba(139,92,246,.28), transparent 60%),
      radial-gradient(700px 360px at 0% 0%, rgba(34,211,238,.10), transparent 60%),
      var(--bg);
    background-color: var(--bg);
    padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  }
  button { font-family: inherit; }
  .grad { background: linear-gradient(90deg, var(--violet), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }

  /* ---------- Encabezado fijo ---------- */
  .topbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px;
    padding: 10px 20px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
    background: rgba(7,11,20,.9); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }
  .topbar .logo { height: 32px; display: block; }
  .tabs { display: flex; gap: 6px; flex: 1; }
  .tab { background: none; border: 1px solid transparent; color: var(--muted); padding: 8px 14px; border-radius: 10px; font-size: 14px; cursor: pointer; }
  .tab.active { color: var(--text); background: rgba(34,211,238,.09); border-color: rgba(34,211,238,.35); }
  .top-right { display: flex; align-items: center; gap: 10px; margin-left: auto; position: relative; }
  .pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; border: 1px solid rgba(34,211,238,.55); background: rgba(34,211,238,.07); font-size: 13px; font-weight: 600; white-space: nowrap; }
  .pill b { color: var(--cyan); }
  .icon-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; font-size: 17px; display: grid; place-items: center; }
  .dot { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #EF4444; color: #fff; font-size: 10px; font-weight: 700; display: none; place-items: center; }
  .dot.on { display: grid; }
  .user-btn { display: flex; align-items: center; gap: 8px; background: none; border: none; color: var(--text); cursor: pointer; font-size: 14px; padding: 2px; }
  .avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--pink)); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
  .dropdown { position: absolute; top: 48px; right: 0; width: 320px; max-width: calc(100vw - 32px); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.5); padding: 12px; display: none; z-index: 120; }
  .dropdown.open { display: block; }
  .dropdown h4 { margin: 0 0 8px; font-size: 14px; }
  .notif { padding: 10px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--border); margin-bottom: 8px; font-size: 13px; }
  .notif.unread { border-color: rgba(34,211,238,.5); }
  .notif .nt { font-weight: 600; margin-bottom: 2px; }
  .notif .nm { color: var(--muted); }
  .notif .nd { color: var(--muted); font-size: 11px; margin-top: 4px; }
  .menu-item { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text); padding: 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
  .menu-item:hover { background: var(--panel2); }
  @media (max-width: 760px) {
    .tabs { order: 5; flex-basis: 100%; }
    .user-name, .pill .lbl-long { display: none; }
    .topbar { padding-left: 14px; padding-right: 14px; }
  }


  .wrap { max-width: 1240px; margin: 0 auto; padding: 8px 20px 24px; }
  .hero h1 { font-size: clamp(28px, 5vw, 44px); margin: 18px 0 6px; letter-spacing: -0.02em; }
  .hero p { margin: 0 0 16px; color: var(--muted); font-size: 15px; }

  /* ---------- Pasos ---------- */
  .stepper { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 12px; margin-bottom: 8px; scrollbar-width: none; }
  .stepper::-webkit-scrollbar { display: none; }
  .step { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 6px 12px 6px 6px; border-radius: 999px; text-decoration: none; font-size: 13px; color: var(--muted); border: 1px solid transparent; }
  .step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 1.5px solid var(--border); background: var(--panel); }
  .step.done .n { background: var(--ok); border-color: var(--ok); color: #04210f; }
  .step.active { color: var(--text); border-color: rgba(34,211,238,.45); background: rgba(34,211,238,.07); }
  .step.active .n { border-color: var(--cyan); color: var(--cyan); }
  @media (max-width: 700px) { .step .t { display: none; } .step.active .t { display: inline; } }

  .card { background: linear-gradient(180deg, var(--panel), #0B1122); border: 1px solid var(--border); border-radius: 18px; padding: 18px; }
  .card h2 { margin: 0 0 2px; font-size: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .card h2 .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: var(--panel2); border: 1px solid var(--border); flex: 0 0 auto; }
  .card .sub { margin: 0 0 14px 40px; font-size: 13px; color: var(--muted); }
  @media (max-width: 520px) { .card .sub { margin-left: 0; } }

  /* ---------- Mis diseños (últimos 10) ---------- */
  .mine { margin-bottom: 16px; }
  .mine-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
  .mine-head h2 { margin: 0; }
  .mine-count { color: var(--cyan); font-size: 13px; font-weight: 600; }
  .mine-note { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
  .strip { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
  .strip::-webkit-scrollbar { height: 6px; } .strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
  .mcard { position: relative; flex: 0 0 auto; height: 190px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--panel2); scroll-snap-align: start; cursor: pointer; }
  .mcard img { height: 100%; width: auto; display: block; }
  .mcard .tagf { position: absolute; top: 8px; left: 8px; font-size: 10px; background: rgba(0,0,0,.55); padding: 3px 7px; border-radius: 999px; }
  .mcard .foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 8px 7px; display: flex; justify-content: space-between; align-items: flex-end; font-size: 11px; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
  .kebab { width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.45); color: #fff; cursor: pointer; font-size: 15px; line-height: 1; }
  .kmenu { position: absolute; right: 6px; bottom: 36px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 4px; display: none; z-index: 5; min-width: 130px; }
  .kmenu.open { display: block; }
  .kmenu a, .kmenu button { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text); padding: 8px 10px; font-size: 12.5px; border-radius: 6px; cursor: pointer; text-decoration: none; }
  .kmenu a:hover, .kmenu button:hover { background: var(--panel2); }
  .empty { color: var(--muted); font-size: 13px; padding: 18px 4px; }

  /* ---------- Layout ---------- */
  .grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
  @media (min-width: 1000px) { .grid { grid-template-columns: minmax(0, 1fr) 350px; } .col-side { position: sticky; top: 76px; } body { padding-bottom: 24px; } .mobile-bar { display: none !important; } }
  .col-main, .col-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

  .goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .goal { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px; text-align: left; background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 14px; cursor: pointer; font-size: 13.5px; line-height: 1.25; }
  .goal .ic { font-size: 22px; flex: 0 0 auto; }
  .goal:hover { border-color: rgba(34,211,238,.5); }
  .goal.active { border-color: var(--cyan); background: rgba(34,211,238,.09); box-shadow: 0 0 0 1px rgba(34,211,238,.25), 0 0 22px rgba(34,211,238,.15); }
  .goal.active::after { content: "✓"; position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--cyan); color: #04202a; font-size: 11px; font-weight: 800; display: grid; place-items: center; }

  textarea { width: 100%; background: #0A1020; color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 12px; font: inherit; font-size: 14px; resize: vertical; }
  textarea:focus { outline: 2px solid rgba(34,211,238,.5); outline-offset: 1px; }
  .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .chip { background: var(--panel2); border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; }
  .chip:hover { border-color: var(--violet); }
  .chip.on { border-color: var(--cyan); background: rgba(34,211,238,.1); }
  .chips-label { font-size: 12px; color: var(--muted); margin-top: 12px; }
  details.adv { margin-top: 12px; border: 1px dashed var(--border); border-radius: 12px; padding: 10px 12px; }
  details.adv summary { cursor: pointer; font-size: 13px; color: var(--muted); }
  details.adv textarea { margin-top: 10px; min-height: 140px; }

  /* Referencias */
  .refs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
  .ref { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--panel2); border: 1.5px dashed var(--border); border-radius: 14px; }
  .ref.filled { border-style: solid; border-color: rgba(52,211,153,.55); }
  .ref-top { display: flex; align-items: flex-start; gap: 8px; }
  .ref .ico { font-size: 22px; }
  .ref .ttl { font-size: 13px; font-weight: 600; }
  .ref .st { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
  .ref.filled .st { color: var(--ok); }
  .ref .meta { font-size: 11px; color: var(--muted); }
  .trash { margin-left: auto; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; border: none; background: #DC2626; color: #fff; cursor: pointer; display: none; place-items: center; box-shadow: 0 2px 12px rgba(220,38,38,.5); }
  .trash:hover { background: #EF4444; }
  .trash svg { width: 19px; height: 19px; display: block; }
  .ref.filled .trash { display: grid; }
  .ref-media { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
  .thumb { position: relative; width: 48px; height: 48px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); display: grid; place-items: center; font-size: 11px; color: var(--muted); }
  .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .thumb .rn { position: absolute; top: 2px; left: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #DC2626; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
  .ref-btn { margin-top: auto; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px; font-size: 12.5px; cursor: pointer; }
  .ref-btn:hover { border-color: var(--cyan); }

  .formats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
  .fmt { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--panel2); border: 1px solid var(--border); border-radius: 14px; }
  .fmt.on { border-color: var(--cyan); background: rgba(34,211,238,.07); box-shadow: 0 0 20px rgba(34,211,238,.12); }
  .fmt-top { display: flex; align-items: center; gap: 10px; cursor: pointer; }
  .fmt-top input { accent-color: var(--cyan); width: 17px; height: 17px; }
  .fmt-top svg { width: 30px; height: 30px; flex: 0 0 auto; }
  .fmt-name { font-size: 13.5px; font-weight: 600; }
  .fmt-sub { font-size: 11.5px; color: var(--muted); }
  .stepper-qty { display: inline-flex; align-items: center; align-self: flex-start; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
  .stepper-qty button { width: 34px; height: 32px; background: var(--bg); color: var(--text); border: none; font-size: 17px; cursor: pointer; }
  .stepper-qty span { min-width: 34px; text-align: center; font-weight: 700; font-size: 14px; }

  .tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
  .tier { position: relative; text-align: left; padding: 14px; background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 14px; cursor: pointer; }
  .tier.active { border-color: var(--cyan); background: rgba(34,211,238,.08); box-shadow: 0 0 20px rgba(34,211,238,.12); }
  .tier .tn { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
  .tier .td { font-size: 12px; color: var(--muted); }
  .tier .tp { margin-top: 8px; font-size: 12.5px; color: var(--cyan); font-weight: 600; }
  .pop { position: absolute; top: 10px; right: 10px; background: rgba(139,92,246,.25); color: #C9B8FF; font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 999px; }
  .admin-only { display: none; }
  body.is-admin .admin-only { display: block; }
  body.is-admin .order .row.admin-only { display: flex; }
  body.is-admin .pill .admin-only, body.is-admin .tier .tp.admin-only { display: block; }

  /* ---------- Pedido ---------- */
  .order .oh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
  .order .oh h2 { margin: 0; }
  .count-tag { background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.4); color: var(--cyan); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
  .order .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
  .order .row .k { color: var(--muted); }
  .order .row .v { text-align: right; font-weight: 600; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .tag { background: var(--panel2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 600; }
  .keep { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 4px; font-size: 13px; cursor: pointer; }
  .keep input { margin-top: 2px; accent-color: var(--cyan); }
  .cta { width: 100%; margin-top: 12px; padding: 15px; border: none; border-radius: 14px; font-size: 16px; font-weight: 700; cursor: pointer; color: #06121C; background: linear-gradient(90deg, var(--cyan), var(--pink)); box-shadow: 0 6px 26px rgba(34,211,238,.25); }
  .cta:disabled { opacity: .55; cursor: not-allowed; }
  .cta-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
  .msg { margin-top: 10px; font-size: 13px; color: #FF8AB8; min-height: 18px; text-align: center; }

  /* ---------- Robot + etapas graduales ---------- */
  .robot-card h2 { font-size: 16px; margin-bottom: 10px; }
  .rc-body { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 8px; min-height: 196px; }
  .stages-g { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
  .stages-g li { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); max-height: 0; opacity: 0; overflow: hidden; transform: translateY(8px); transition: max-height .45s ease, opacity .45s ease, transform .45s ease, margin .45s ease; }
  .stages-g li.show { max-height: 54px; opacity: 1; transform: none; margin-bottom: 6px; }
  .stages-g li i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border); flex: 0 0 auto; display: grid; place-items: center; font-style: normal; font-size: 10px; margin-top: 1px; }
  .stages-g li.active { color: var(--text); }
  .stages-g li.active i { border-color: var(--violet); background: var(--violet); box-shadow: 0 0 0 4px rgba(139,92,246,.22); animation: ping 1.4s ease-in-out infinite; }
  .stages-g li.done { color: var(--text); }
  .stages-g li.done i { border-color: var(--ok); background: var(--ok); color: #04210f; }
  .stages-g li.pulse i { animation: ping .5s ease-in-out 2; border-color: var(--cyan); }
  .idle-hint { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
  @keyframes ping { 0%,100% { box-shadow: 0 0 0 3px rgba(139,92,246,.2); } 50% { box-shadow: 0 0 0 7px rgba(139,92,246,.05); } }

  .robot-stage { position: relative; width: 150px; height: 190px; }
  .halo { position: absolute; left: 50%; top: 50px; width: 150px; height: 150px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(139,92,246,.55), rgba(34,211,238,.18) 45%, transparent 70%); filter: blur(7px); animation: pulse 3.2s ease-in-out infinite; }
  .robot-img { position: absolute; left: 0; top: 0; width: 150px; display: block; animation: floaty 4.5s ease-in-out infinite;
    -webkit-mask-image: radial-gradient(ellipse 62% 66% at 52% 46%, #000 52%, transparent 100%);
            mask-image: radial-gradient(ellipse 62% 66% at 52% 46%, #000 52%, transparent 100%); }
  .orbit { position: absolute; left: 50%; top: 50px; border-radius: 50%; border: 1px solid rgba(139,92,246,.35); transform: translate(-50%, -50%); animation: spin 9s linear infinite; pointer-events: none; }
  .orbit.o1 { width: 132px; height: 132px; }
  .orbit.o2 { width: 108px; height: 108px; border-color: rgba(34,211,238,.3); animation-duration: 6s; animation-direction: reverse; }
  .orbit i { position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px 2px rgba(34,211,238,.8); }
  .orbit.o2 i { background: var(--pink); box-shadow: 0 0 10px 2px rgba(236,72,153,.8); }
  .streak { position: absolute; height: 2px; width: 44px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--cyan)); opacity: .0; animation: streak 2.6s ease-in infinite; }
  .streak.s1 { left: -6px; top: 34px; animation-delay: 0s; }
  .streak.s2 { left: 4px; top: 62px; animation-delay: .9s; background: linear-gradient(90deg, transparent, var(--pink)); }
  .streak.s3 { left: -10px; top: 80px; animation-delay: 1.7s; background: linear-gradient(90deg, transparent, var(--violet)); }
  .spark { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 2px rgba(139,92,246,.9); opacity: 0; animation: rise 3.4s ease-in infinite; }
  .spark.k1 { left: 20px; top: 90px; animation-delay: .2s; } .spark.k2 { left: 60px; top: 100px; animation-delay: 1.1s; }
  .spark.k3 { left: 120px; top: 90px; animation-delay: 2s; } .spark.k4 { left: 92px; top: 104px; animation-delay: .6s; } .spark.k5 { left: 140px; top: 60px; animation-delay: 1.6s; }
  .robot-stage:not(.working) .orbit { animation-duration: 22s; opacity: .45; }
  .robot-stage:not(.working) .streak { animation-play-state: paused; opacity: 0; }
  .robot-stage.working .halo { animation-duration: 1.3s; }
  .robot-stage.working .streak { opacity: 1; }
  .bubble { position: absolute; left: -6px; right: 0; bottom: 0; padding: 10px 12px; border-radius: 12px; font-size: 12px; line-height: 1.35; background: rgba(12,18,38,.92); border: 1px solid rgba(139,92,246,.55); backdrop-filter: blur(6px); transition: opacity .25s; min-height: 62px; }
  .bubble.swap { opacity: 0; }
  @keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
  @keyframes pulse { 0%,100% { opacity: .75; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } }
  @keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
  @keyframes streak { 0% { transform: translateX(0); opacity: 0; } 15% { opacity: 1; } 80% { opacity: .9; } 100% { transform: translateX(110px); opacity: 0; } }
  @keyframes rise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-70px) scale(1.1); opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { .halo, .robot-img, .orbit, .streak, .spark, .stages-g li i { animation: none !important; } .streak, .spark { display: none; } }

  .rc-foot { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
  .battery-vertical { width: 26px; height: auto; flex: 0 0 auto; }
  .rc-stats { flex: 1; display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

  /* Banner */
  .banner { padding: 0; overflow: hidden; }
  .banner a { display: block; }
  .banner img { width: 100%; display: block; }
  .banner-admin { padding: 10px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
  .banner-lbl { padding: 6px 12px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); }

  .toast { position: fixed; top: 74px; right: 16px; z-index: 200; background: var(--panel); border: 1px solid rgba(52,211,153,.6); color: var(--text); padding: 12px 16px; border-radius: 12px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.5); display: none; max-width: calc(100vw - 32px); }
  .toast.on { display: block; }

  .mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(7,11,20,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--border); }
  .mobile-bar .info { font-size: 12.5px; color: var(--muted); line-height: 1.3; flex: 1; }
  .mobile-bar .info b { color: var(--text); font-size: 14px; }
  .mobile-bar .cta { margin: 0; width: auto; padding: 12px 20px; font-size: 14.5px; white-space: nowrap; }


/* ---------- Compatibilidad: login y panel de administrador ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { height: 34px; width: auto; display: block; }
.demo-tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px; }
.primary-btn { width: 100%; margin-top: 8px; padding: 14px; border: none; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; background: linear-gradient(90deg, var(--cyan), var(--pink)); color: #06121C; font-family: inherit; }
.primary-btn:disabled { opacity: .5; cursor: not-allowed; }
select, input[type="text"], input[type="password"], input[type="number"] { font-family: inherit; }

/* ---------- Estados de subida de referencias ---------- */
.ref .st.err { color: #FF8AB8; }
.ref .st.busy { color: var(--cyan); }
.banner video { width: 100%; display: block; }
.banner[hidden] { display: none; }


/* ---------- Visor de diseños a pantalla completa ---------- */
body.no-scroll { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 300; background: rgba(4,7,14,.97); display: flex; flex-direction: column; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.viewer[hidden] { display: none; }
.v-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; flex: 0 0 auto; }
.v-count { font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.v-close { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--panel); color: var(--text); font-size: 18px; cursor: pointer; }
.v-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 64px; touch-action: pan-y; }
.v-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 10px; box-shadow: 0 10px 50px rgba(0,0,0,.6); user-select: none; -webkit-user-drag: none; }
.v-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.10); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; display: grid; place-items: center; z-index: 2; }
.v-nav:hover { background: rgba(255,255,255,.22); }
.v-nav[hidden] { display: none; }
.v-prev { left: 10px; } .v-next { right: 10px; }
.v-info { flex: 0 0 auto; padding: 12px 16px 16px; max-width: 760px; width: 100%; margin: 0 auto; }
.v-meta { font-size: 12px; color: var(--cyan); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.v-copy { font-size: 14px; line-height: 1.45; max-height: 18vh; overflow-y: auto; white-space: pre-wrap; margin-bottom: 12px; }
.v-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.v-actions a, .v-actions button { background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; font-size: 14px; cursor: pointer; text-decoration: none; }
.v-actions .v-dl { color: var(--cyan); border-color: rgba(34,211,238,.5); }
.v-actions .v-del { color: #FF8AB8; margin-left: auto; }
@media (max-width: 700px) {
  .v-stage { padding: 0 8px; }
  .v-nav { width: 42px; height: 42px; font-size: 26px; background: rgba(0,0,0,.45); }
  .v-prev { left: 6px; } .v-next { right: 6px; }
}
