/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f0efec;
  --line: #e2e1dc;
  --text: #0b0b0b;
  --muted: #52514e;
  --faint: #8a8984;
  --accent: #2a78d6;
  --accent-hover: #1f63b5;
  --accent-ink: #ffffff;
  --accent-soft: #e5effb;
  --good: #1a7f37;
  --good-soft: #e5f4e9;
  --warn: #9a5b00;
  --warn-soft: #fff1d9;
  --bad: #c62828;
  --bad-soft: #fdeaea;
  --series-1: #2a78d6;
  --grid: #e8e7e2;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 16px rgb(0 0 0 / .06);
  --radius: 12px;
  --nav-h: 64px;
  --top-h: 56px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211;
    --surface: #1a1a19;
    --surface-2: #242423;
    --line: #33332f;
    --text: #f0efec;
    --muted: #c3c2b7;
    --faint: #8f8e86;
    --accent: #3987e5;
    --accent-hover: #5a9dec;
    --accent-ink: #ffffff;
    --accent-soft: #1b2b40;
    --good: #4cc26a;
    --good-soft: #15291b;
    --warn: #f0a531;
    --warn-soft: #33260f;
    --bad: #f06b6b;
    --bad-soft: #3a1718;
    --series-1: #3987e5;
    --grid: #2c2c29;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 4px 16px rgb(0 0 0 / .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --surface-2: #242423; --line: #33332f;
  --text: #f0efec; --muted: #c3c2b7; --faint: #8f8e86;
  --accent: #3987e5; --accent-hover: #5a9dec; --accent-ink: #ffffff; --accent-soft: #1b2b40;
  --good: #4cc26a; --good-soft: #15291b; --warn: #f0a531; --warn-soft: #33260f; --bad: #f06b6b; --bad-soft: #3a1718;
  --series-1: #3987e5; --grid: #2c2c29;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--font);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; color: var(--muted); font-weight: 600; }
a { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.right { text-align: right; }
.error { color: var(--bad); font-size: 14px; min-height: 1.2em; margin: 0; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.strike { text-decoration: line-through; color: var(--faint); }

/* ---------- Controles ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: 16px; /* 16px: iOS no hace zoom */
  color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type="checkbox"] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--accent); }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); }
textarea { resize: vertical; min-height: 70px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
  min-height: 44px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.btn:hover { border-color: var(--faint); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.lg { min-height: 52px; font-size: 17px; }
.btn.sm { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }
.icon-btn { min-width: 44px; padding: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.plain::before { display: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.spacer { flex: 1; }
.narrow { max-width: 480px; }
.mt { margin-top: 16px; }
.my { margin: 16px 0; }
.markup { width: 80px; }
.list a.item { color: var(--text); text-decoration: none; font-weight: 600; min-height: 48px; }
.list a.item svg { width: 22px; height: 22px; color: var(--muted); }

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; padding: 24px; box-shadow: var(--shadow); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; }
.brand.big { font-size: 26px; margin-bottom: 6px; }
.login-card .center, .center { text-align: center; }
.login-card h2 { margin-bottom: 4px; }
.auth-tabs { margin-bottom: 14px; }
.auth-tabs button { flex: 1; }
#auth { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top-h);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar .brand { min-width: 0; flex: 0 1 auto; }
.topbar .brand img { flex: none; }
#brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .brand.switch { cursor: pointer; }
.topbar .brand.switch::after { content: "▾"; color: var(--muted); font-size: 14px; margin-left: -2px; }
.biz-item { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text); font: inherit; padding: 12px 4px; }
.biz-item.current strong { color: var(--accent); }
.access-row { flex-wrap: wrap; }
.access-row .seg button { min-height: 34px; padding: 2px 10px; font-size: 13px; }
#mbiz, #tbiz, #vbiz { margin-bottom: 8px; }
.topbar .chip { flex: none; }
.account { margin-left: auto; font-weight: 600; max-width: 30vw; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.view { padding: 16px; padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); max-width: 1200px; margin: 0 auto; }

.nav-top { display: none; }
.nav-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: var(--surface); border-top: 1px solid var(--line);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
}
.nav-bottom a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; position: relative;
}
.nav-bottom a svg { width: 24px; height: 24px; }
.nav-bottom a.active { color: var(--accent); }
.nav-bottom a.secondary { display: none; }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center;
}
.nav-bottom .badge { position: absolute; top: 6px; left: calc(50% + 6px); }

@media (min-width: 900px) {
  .nav-bottom { display: none; }
  .nav-top { display: flex; gap: 2px; margin-left: 8px; }
  .nav-top a {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px;
    color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px;
  }
  .nav-top a:hover { background: var(--surface-2); }
  .nav-top a.active { color: var(--accent); background: var(--accent-soft); }
  .nav-top a.mobile-only { display: none; }
  .view { padding: 24px; padding-bottom: 40px; }
}

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin-right: auto; }

/* ---------- Vender ---------- */
.pos { display: grid; gap: 16px; }
.searchbar { display: flex; gap: 8px; position: sticky; top: var(--top-h); z-index: 5; background: var(--bg); padding: 4px 0 10px; }
.searchbar input { font-size: 17px; min-height: 50px; }
.searchbar .btn { min-height: 50px; }
.results { display: flex; flex-direction: column; gap: 6px; }
.prod {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit;
}
.prod:hover { border-color: var(--accent); }
.prod:active { transform: scale(.99); }
.prod .name { font-weight: 600; }
.prod .meta { font-size: 13px; color: var(--muted); }
.prod .price { margin-left: auto; font-weight: 700; font-size: 17px; white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tile {
  display: flex; flex-direction: column; gap: 4px; justify-content: space-between; text-align: left; min-height: 84px;
  padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.tile:hover { border-color: var(--accent); }
.tile .name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.tile .price { font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }

.cart { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cart-head { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); gap: 8px; }
.cart-lines { flex: 1; overflow-y: auto; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.line .name { font-weight: 600; }
.line .sub { font-weight: 700; text-align: right; white-space: nowrap; }
.line .unit { font-size: 13px; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 40px; height: 38px; border: 0; background: var(--surface-2); color: var(--text); font-size: 20px; cursor: pointer; }
.stepper .q { min-width: 52px; text-align: center; font-weight: 700; background: none; border: 0; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.line .actions { display: flex; align-items: center; justify-content: flex-end; }
.cart-foot { padding: 16px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); }
.total-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 15px; color: var(--muted); }
.total-row strong { font-size: 30px; color: var(--text); }

.cartbar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 15;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgb(0 0 0 / .08);
}
.cartbar .info { flex: 1; min-width: 0; }
.cartbar .info strong { font-size: 20px; display: block; }
.view.has-cartbar { padding-bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }

/* Carrito en el teléfono: hoja a pantalla completa */
@media (max-width: 899px) {
  .cart { display: none; }
  body.cart-open .cart {
    display: flex; position: fixed; inset: 0; z-index: 40; border-radius: 0; border: 0;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  }
  body.cart-open { overflow: hidden; }
}
@media (min-width: 900px) {
  .pos { grid-template-columns: 1fr 380px; align-items: start; }
  .cart { position: sticky; top: calc(var(--top-h) + 24px); max-height: calc(100vh - var(--top-h) - 48px); }
  .cartbar, .cart-close { display: none !important; }
  .view.has-cartbar { padding-bottom: 40px; }
}

/* ---------- Medios de pago / montos ---------- */
.methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.methods button {
  min-height: 52px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer;
}
.methods button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { min-height: 38px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.bigline { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.bigline strong { font-size: 26px; }
.bigline.accent { background: var(--accent-soft); }
.bigline.good { background: var(--good-soft); }
.bigline.bad { background: var(--bad-soft); }
.bigline.warn { background: var(--warn-soft); }

/* ---------- Caja ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 24px; font-weight: 800; margin-top: 2px; }
.kpi .hint { font-size: 13px; color: var(--faint); }
.kpi.hero { background: var(--accent-soft); border-color: transparent; }
.kpi.hero .value { font-size: 32px; color: var(--accent); }
.list { display: flex; flex-direction: column; }
.list .item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: 0; }
.list .item.click { cursor: pointer; }
.list .item.click:hover { background: var(--surface-2); }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv.total { font-weight: 800; font-size: 17px; border-bottom: 0; border-top: 2px solid var(--line); padding-top: 10px; }
.cols { display: grid; gap: 16px; }
@media (min-width: 900px) { .cols { grid-template-columns: 1fr 1fr; align-items: start; } }

/* ---------- Tablas (en el teléfono se ven como tarjetas) ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
tr.inactive td { color: var(--faint); }
td .sub { display: block; font-size: 13px; color: var(--muted); }
@media (max-width: 699px) {
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.cards tr:last-child { border-bottom: 0; }
  table.cards td { border: 0; padding: 3px 0; display: flex; justify-content: flex-end; align-items: baseline; gap: 6px; text-align: right; }
  table.cards td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; margin-right: auto; }
  table.cards td .sub { display: inline; }
  table.cards td.main { display: block; text-align: left; font-weight: 600; font-size: 16px; padding-bottom: 6px; }
  table.cards td.main::before { display: none; }
  table.cards td.actions::before { display: none; }
  table.cards td.actions { justify-content: flex-end; padding-top: 8px; }
}

/* ---------- Filtros ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  min-height: 38px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.seg button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.filters input[type="date"] { width: auto; min-height: 38px; padding: 6px 10px; }
.filters .grow { flex: 1; min-width: 180px; }
.filters select { width: auto; }
.banner {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px;
  background: var(--warn-soft); color: var(--warn); font-weight: 600; margin-bottom: 14px; cursor: pointer; border: 0; width: 100%; font: inherit; text-align: left;
}
.banner svg { width: 20px; height: 20px; flex: none; }

/* ---------- Gráfico ---------- */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: var(--series-1); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .bar, .chart .bar.on { opacity: .8; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 5; transform: translate(-50%, -100%);
  background: var(--text); color: var(--bg); padding: 6px 10px; border-radius: 8px; font-size: 13px; white-space: nowrap;
  box-shadow: var(--shadow);
}
.tooltip strong { display: block; font-size: 14px; }
details.table-toggle summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-top: 8px; }

/* ---------- Modal ---------- */
.modal {
  border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--text);
  width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: var(--shadow);
}
.modal::backdrop { background: rgb(0 0 0 / .45); }
#modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-head { display: flex; align-items: center; gap: 10px; }
.modal-head h2 { margin-right: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.modal-foot .btn { flex: 1 1 140px; }
@media (max-width: 599px) {
  .modal { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  #modal-body { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
.scanner video { width: 100%; border-radius: 10px; background: #000; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- Avisos ---------- */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 100;
  top: calc(var(--top-h) + 8px + env(safe-area-inset-top));
  display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px));
}
.toast {
  padding: 12px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 600;
  box-shadow: var(--shadow); font-size: 15px;
}
.toast.err { background: var(--bad); color: #fff; }
.toast.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.toast.ok { background: var(--good); color: #fff; }

/* ---------- Impresión (cierre de caja) ---------- */
.print-area { display: none; }
@media print {
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block; color: #000; font-size: 12px; width: 72mm; }
  .print-area .kv { border-bottom: 1px dashed #999; }
}

/* Código de 6 números del mail */
.otp { font-size: 28px; letter-spacing: 8px; text-align: center; font-variant-numeric: tabular-nums; }

/* Importar productos */
.imp-errors { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; margin: 8px 0; }
input[type="file"] { padding: 8px; }

/* Redondeo al cobrar */
.round-box #rounds button { flex: 1 1 auto; }
.round-box #rounds .faint { font-weight: 500; }

/* Primeros pasos */
.onboarding { margin-bottom: 16px; border-color: var(--accent); }
.onboarding ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.onboarding li.done { color: var(--faint); text-decoration: line-through; }
/* Cobrar con dos medios / autorización de fiado */
.split-box { padding: 12px; border-radius: 10px; background: var(--surface-2); }
.auth-box { padding: 12px; border-radius: 10px; border: 1px solid var(--warn); }

/* Pedidos de autorización de fiado (arriba, en cualquier pantalla) */
.approvals { position: sticky; top: var(--top-h); z-index: 18; display: flex; flex-direction: column; gap: 8px; padding: 0 16px; }
.approvals:empty { display: none; }
.approval {
  margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--text);
  border: 1px solid var(--warn); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
}
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--faint); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -1px; margin-right: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cajas */
.chip.clickable { cursor: pointer; }
.chip.clickable::after { content: "▾"; margin-left: 2px; }
.topbar .chip { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 1.6; }
.topbar .chip::before { display: inline-block; margin-right: 6px; vertical-align: middle; }
#brand-name { min-width: 4.5em; }

/* Suscripción */
.sub-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--line); }
.sub-banner.warn { background: var(--warn-soft); color: var(--warn); }
.sub-banner.info { background: var(--accent-soft); color: var(--accent); }
.sub-banner span { flex: 1; min-width: 200px; }
.pre { white-space: pre-line; }

.chip.lock { font-size: 11px; padding: 1px 7px; margin-left: 4px; }
.chip.lock::before { content: "🔒"; width: auto; height: auto; background: none; }

.methods.regs button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.methods.regs button .small { opacity: .8; }

/* ---------- Planes ---------- */
.plans { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 8px 0; }
.plan-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.plan-card.featured { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plan-card h3 { margin: 0; font-size: 1.15rem; }
.plan-card p { margin: 0; }
.plan-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.plan-price strong { font-size: 1.5rem; }
.plan-card ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; font-size: .92rem; }
.plan-card li { padding-left: 22px; position: relative; }
.plan-card li::before { content: "•"; position: absolute; left: 6px; color: var(--muted); }
.plan-card li.yes::before { content: "✓"; left: 4px; color: var(--good); font-weight: 700; }
.plan-card li.no { color: var(--faint); text-decoration: line-through; }
.plan-card li.no::before { content: "–"; left: 5px; color: var(--faint); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#reg-plans { margin-top: 4px; }
