/* Panel y zona de cliente de Grappl.
   Mismo sistema que la landing: papel cálido, ámbar = el peldaño, azul marino = el muro, Instrument Sans
   (servida en local) y mono para etiquetas técnicas. Bordes finos antes que sombras. Claro u oscuro según el
   sistema. Sin estilos en línea (la CSP no los permite). */

@font-face {
  font-family: "Instrument Sans";
  src: url("vendor/fonts/instrument-sans-var.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #f6f4ef;          /* papel cálido */
  --surface: #ffffff;
  --surface-2: #efece5;
  --line: #e4dfd4;
  --line-strong: #cfc8b9;
  --ink: #151b2e;         /* tinta marina */
  --ink-dim: #535b6c;
  --accent: #f2b33d;      /* peldaño */
  --accent-hover: #e5a22a;
  --accent-ink: #8a5800;  /* ámbar usado como texto */
  --on-accent: #19213a;
  --navy: #19213a;       /* muro */
  --navy-deep: #11172b;
  --joint: #34426e;
  --ok: #17724a;
  --ok-bg: #e1f1e7;
  --bad: #b3261e;
  --bad-bg: #fae6e2;
  --warn: #8a5600;
  --warn-bg: #fbeccb;
  --info: #2c4cb0;
  --info-bg: #e6e9f6;
  --focus: #3556d6;
  --code-bg: #19213a;
  --code-ink: #e6e9f2;
  --chart-rx: #5b72c7;
  --chart-tx: #f2b33d;
  --shadow: 0 1px 0 rgb(0 0 0 / .03), 0 12px 32px -16px rgb(21 27 46 / .25);

  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem;
  --r-sm: 8px;
  --r-md: 12px;
  --r-card: var(--r-md);
  --r-ctl: var(--r-sm);
  --side-w: 15rem;
  --tile: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='240'%20height='96'%3E%3Crect%20width='240'%20height='96'%20fill='%2310172b'/%3E%3Crect%20x='-59'%20y='1'%20width='58'%20height='22'%20fill='%231c2542'/%3E%3Crect%20x='1'%20y='1'%20width='58'%20height='22'%20fill='%2319213a'/%3E%3Crect%20x='1'%20y='1'%20width='58'%20height='1'%20fill='%232d3a66'/%3E%3Crect%20x='61'%20y='1'%20width='58'%20height='22'%20fill='%231c2542'/%3E%3Crect%20x='121'%20y='1'%20width='58'%20height='22'%20fill='%23172036'/%3E%3Crect%20x='121'%20y='1'%20width='58'%20height='1'%20fill='%232d3a66'/%3E%3Crect%20x='181'%20y='1'%20width='58'%20height='22'%20fill='%231c2542'/%3E%3Crect%20x='241'%20y='1'%20width='58'%20height='22'%20fill='%2319213a'/%3E%3Crect%20x='241'%20y='1'%20width='58'%20height='1'%20fill='%232d3a66'/%3E%3Crect%20x='-29'%20y='25'%20width='58'%20height='22'%20fill='%23172036'/%3E%3Crect%20x='31'%20y='25'%20width='58'%20height='22'%20fill='%23172036'/%3E%3Crect%20x='91'%20y='25'%20width='58'%20height='22'%20fill='%2319213a'/%3E%3Crect%20x='91'%20y='25'%20width='58'%20height='1'%20fill='%232d3a66'/%3E%3Crect%20x='151'%20y='25'%20width='58'%20height='22'%20fill='%231c2542'/%3E%3Crect%20x='211'%20y='25'%20width='58'%20height='22'%20fill='%23172036'/%3E%3Crect%20x='271'%20y='25'%20width='58'%20height='22'%20fill='%23172036'/%3E%3Crect%20x='-59'%20y='49'%20width='58'%20height='22'%20fill='%2319213a'/%3E%3Crect%20x='-59'%20y='49'%20width='58'%20height='1'%20fill='%232d3a66'/%3E%3Crect%20x='1'%20y='49'%20width='58'%20height='22'%20fill='%231c2542'/%3E%3Crect%20x='1'%20y='49'%20width='58'%20height='1'%20fill='%232d3a66'/%3E%3Crect%20x='61'%20y='49'%20width='58'%20height='22'%20fill='%23172036'/%3E%3Crect%20x='121'%20y='49'%20width='58'%20height='22'%20fill='%2319213a'/%3E%3Crect%20x='181'%20y='49'%20width='58'%20height='22'%20fill='%2319213a'/%3E%3Crect%20x='181'%20y='49'%20width='58'%20height='1'%20fill='%232d3a66'/%3E%3Crect%20x='241'%20y='49'%20width='58'%20height='22'%20fill='%231c2542'/%3E%3Crect%20x='241'%20y='49'%20width='58'%20height='1'%20fill='%232d3a66'/%3E%3Crect%20x='-29'%20y='73'%20width='58'%20height='22'%20fill='%231c2542'/%3E%3Crect%20x='31'%20y='73'%20width='58'%20height='22'%20fill='%23172036'/%3E%3Crect%20x='91'%20y='73'%20width='58'%20height='22'%20fill='%231c2542'/%3E%3Crect%20x='151'%20y='73'%20width='58'%20height='22'%20fill='%23172036'/%3E%3Crect%20x='151'%20y='73'%20width='58'%20height='1'%20fill='%232d3a66'/%3E%3Crect%20x='211'%20y='73'%20width='58'%20height='22'%20fill='%231c2542'/%3E%3Crect%20x='271'%20y='73'%20width='58'%20height='22'%20fill='%23172036'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c111e;
    --surface: #131a2c;
    --surface-2: #19213a;
    --line: #253050;
    --line-strong: #3a4670;
    --ink: #e9ecf4;
    --ink-dim: #a0a9be;
    --accent-hover: #ffc457;
    --accent-ink: #f2b33d;
    --navy-deep: #0a0e1a;
    --ok: #52c98d;
    --ok-bg: #11301f;
    --bad: #ff8a80;
    --bad-bg: #3a1a1c;
    --warn: #f5b83d;
    --warn-bg: #3a2c0e;
    --info: #9db2ff;
    --info-bg: #1b2547;
    --focus: #9db2ff;
    --code-bg: #0a0e1a;
    --chart-rx: #8fa3e8;
    --shadow: 0 1px 0 rgb(255 255 255 / .03), 0 16px 36px -18px rgb(0 0 0 / .7);
  }
}

/* ── Base ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 1.1rem; height: 1.1rem; flex: none; display: block; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* barra fina mientras HTMX trabaja */
body:has(.htmx-request)::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 20;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: sweep 1s ease-in-out infinite;
}
@keyframes sweep { from { background-position: -40% 0; } to { background-position: 140% 0; } }

a { color: var(--info); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.015em; margin: 2rem 0 .75rem; font-weight: 650; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.12; margin: 0 0 1rem; letter-spacing: -.03em; font-weight: 700; text-wrap: balance; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }
h2 small, h3 small { font-size: .95rem; font-weight: 400; letter-spacing: 0; color: var(--ink-dim); margin-left: .6rem; }

p { margin: 0 0 1rem; max-width: 70ch; }
code, pre, .mono { font-family: var(--mono); }
.mono { word-break: break-all; font-size: .875rem; }
td .mono, dd .mono { letter-spacing: 0; }
pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 1rem 1.1rem;
  margin: 0 0 1rem;
  border-radius: var(--r-md);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: .85rem;
  line-height: 1.6;
}
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: .05rem .35rem; font-size: .85em; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
::selection { background: var(--accent); color: var(--navy); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.kicker { font: 500 .8rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); margin: 0 0 var(--s3); }

.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.muted { color: var(--ink-dim); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--ink-dim); }
.small-note { font-size: .82rem; max-width: 18rem; font-weight: 400; }

/* ── Estructura: barra lateral + contenido ────────────────────────────── */

.shell { min-height: 100vh; }

.side {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0 2rem;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  background: var(--navy);
  color: #fff;
  border-bottom: 1px solid var(--navy-deep);
}

.brand { display: flex; align-items: center; gap: .65rem; padding: .7rem 0; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { width: 2.3rem; height: 2.3rem; display: block; }
.brand b { font-size: 1.3rem; font-weight: 700; letter-spacing: -.03em; }
.side .brand { color: #fff; }

.menu { display: flex; align-self: stretch; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.menu a {
  position: relative;
  display: flex;
  align-items: center;
  flex: none;
  padding: 0 .85rem;
  color: #aeb7d0;
  font-weight: 550;
  text-decoration: none;
}
.menu a:hover { color: #fff; }
/* el peldaño: la sección actual lleva una marca ámbar */
.menu a[aria-current="page"] { color: #fff; font-weight: 650; }
.menu a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: .85rem;
  right: .85rem;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
}
.side :focus-visible { outline-color: #fff; }

.side .out { margin-left: auto; }
.side .out button { margin: 0; }
.side button.secondary { --b: transparent; --b-hover: rgb(255 255 255 / .1); --b-ink: #fff; border-color: rgb(255 255 255 / .35); }

main { min-width: 0; padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem; }
.page { max-width: 68rem; margin: 0 auto; }
main.public { padding: 0; }
main.public .page { max-width: none; }

/* Escritorio: barra lateral marina fija, con el muro (ladrillo muy tenue) al pie. */
@media (min-width: 861px) {
  .shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); align-items: start; }
  .side {
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    padding: 1.25rem .85rem 1rem;
    border-bottom: 0;
    border-right: 1px solid var(--navy-deep);
    overflow: hidden;
  }
  .side::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 9rem;
    background: var(--tile) 0 0 / 240px 96px;
    opacity: .9;
    -webkit-mask-image: linear-gradient(transparent, #000);
    mask-image: linear-gradient(transparent, #000);
    pointer-events: none;
  }
  .side .brand { padding: .25rem .5rem .75rem; }
  .menu { flex-direction: column; align-self: auto; gap: .15rem; overflow: visible; }
  .menu a { min-height: 44px; padding: 0 .75rem; border-radius: var(--r-sm); }
  .menu a:hover { background: rgb(255 255 255 / .07); }
  .menu a[aria-current="page"] { background: rgb(255 255 255 / .09); }
  .menu a[aria-current="page"]::before { left: 0; right: auto; top: 9px; bottom: 9px; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .side .out { position: relative; z-index: 1; margin: auto 0 0; }
  .side .out button { width: 100%; }
  main { padding-top: 2.5rem; }
}

/* ── Avisos ───────────────────────────────────────────────────────────── */

.flash, .error {
  margin: 0 0 1.25rem;
  padding: .7rem 1rem;
  border-radius: var(--r-sm);
  border-left: 4px solid var(--bad);
  background: var(--bad-bg);
  color: var(--ink);
  max-width: none;
}
.flash { border-left-color: var(--ok); background: var(--ok-bg); }
.flash.err { border-left-color: var(--bad); background: var(--bad-bg); }
.flash.info { border-left-color: var(--info); background: var(--info-bg); }

/* ── Tarjetas ─────────────────────────────────────────────────────────── */

.win, details:not(.bare), .stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.win { padding: 1.25rem 1.5rem 1.4rem; margin-bottom: 1.25rem; min-width: 0; }
.win > .win-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -.01em;
}
.win > .win-title .step {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--navy);
  font: 600 .8rem/1 var(--mono);
}
.win > :last-child { margin-bottom: 0; }

.danger { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.danger > .win-title { color: var(--bad); }
.alert { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); background: var(--warn-bg); }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 0 1.25rem; align-items: start; }

/* ── Resumen ──────────────────────────────────────────────────────────── */

.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { padding: 1rem 1.2rem; }
.stat .k { font: 500 .75rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-dim); }
.stat .n { font-size: 2.1rem; font-weight: 650; line-height: 1.15; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat.c-amber .n { color: var(--warn); }
.stat.c-green .n { color: var(--ok); }
.stat.c-red .n { color: var(--bad); }

ul.list { list-style: none; padding: 0; margin: 0; }
ul.list li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
ul.list li:first-child { padding-top: 0; }
ul.list li:last-child { border-bottom: 0; padding-bottom: 0; }

/* ── Indicadores ──────────────────────────────────────────────────────── */

.led { display: inline-block; width: 8px; height: 8px; margin-right: .5rem; border-radius: 50%; background: var(--line-strong); vertical-align: 1px; }
.led.ok { background: var(--ok); }
.led.bad { background: var(--bad); }
.led.warn { background: var(--warn); }

.tag {
  display: inline-block;
  padding: .1rem .6rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}
.tag.ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.tag.bad { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
.tag.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.tag.china, .tag.opt { background: var(--info-bg); border-color: transparent; color: var(--info); }

/* ── Tablas ───────────────────────────────────────────────────────────── */

.scroll { overflow-x: auto; margin: 0 -1.5rem; padding: 0 1.5rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th {
  text-align: left;
  font: 500 .7rem/1.3 var(--mono);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-dim);
  padding: .5rem .6rem;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
td { padding: .75rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.empty { padding: 1rem 0; }
.svc-pair { display: inline-flex; gap: 1rem; }
/* Fila de error bajo el nodo: comparte hover y sin borde entre ambas; una línea con elipsis. */
tr:has(+ tr.sub) td { border-bottom: 0; }
tr.sub td { padding-top: 0; max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tbody tr:has(+ tr.sub:hover) td, tbody tr.sub:hover td { background: var(--surface-2); }
/* Columnas prescindibles: .opt-md se ocultan antes que .opt (ver móvil). */
@media (max-width: 1100px) { th.opt-md, td.opt-md { display: none; } }

/* ── Formularios ──────────────────────────────────────────────────────── */

label { display: block; margin-bottom: 1rem; font-size: .875rem; font-weight: 550; color: var(--ink-dim); }
input:not([type=hidden]):not([type=checkbox]):not([type=radio]), select, textarea {
  display: block;
  width: 100%;
  margin-top: .3rem;
  padding: .6rem .8rem;
  min-height: 44px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font: 400 1rem/1.4 var(--font);
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--ink-dim) 65%, transparent); }
input:user-invalid { border-color: var(--bad); }
textarea { resize: vertical; }
textarea.mono { font: 400 .875rem/1.4 var(--mono); }
select {
  appearance: none;
  padding-right: 2.2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-dim) 50%), linear-gradient(-45deg, transparent 50%, var(--ink-dim) 50%);
  background-size: 5px 5px;
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-repeat: no-repeat;
}
.search { margin-bottom: 1.25rem; }
.search input[type=search] { margin: 0; }

fieldset.checks { border: 0; padding: 0; margin: 0 0 1rem; }
fieldset.checks legend { padding: 0; margin-bottom: .5rem; font-size: .875rem; font-weight: 550; color: var(--ink-dim); }
fieldset.checks label { margin-bottom: .4rem; font-weight: 400; color: var(--ink); }
input[type=checkbox], input[type=radio] { display: inline-block; width: 1rem; height: 1rem; margin: 0 .6rem 0 0; accent-color: var(--navy); vertical-align: -2px; }
label.check { display: flex; align-items: center; gap: .6rem; line-height: 1.35; font-weight: 400; color: var(--ink); }
label.check input { margin: 0; flex: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0 1.25rem; }

/* ── Botones ──────────────────────────────────────────────────────────── */

button, [role=button], input[type=submit] {
  --b: var(--accent);
  --b-hover: var(--accent-hover);
  --b-ink: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: 0 1.25rem;
  margin: 0 .35rem .5rem 0;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--b);
  color: var(--b-ink);
  font: 650 .95rem/1.2 var(--font);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background .15s, transform .15s, border-color .15s;
}
button:hover, [role=button]:hover { background: var(--b-hover); text-decoration: none; transform: translateY(-1px); }
button:active, [role=button]:active { transform: translateY(0); }
button.btn-lg, [role=button].btn-lg { min-height: 48px; font-size: 1.05rem; }
button.wide { width: 100%; margin-right: 0; }

button.secondary, [role=button].secondary {
  --b: transparent;
  --b-hover: rgb(128 128 128 / .12);
  --b-ink: var(--ink);
  border-color: var(--line-strong);
}
button.contrast, [role=button].contrast { --b: var(--bad); --b-hover: color-mix(in srgb, var(--bad) 85%, #000); --b-ink: #fff; }
@media (prefers-color-scheme: dark) { button.contrast, [role=button].contrast { --b-ink: #1a0b0b; } }
button.outline, [role=button].outline { background: transparent; border-color: var(--b); color: var(--b); }
button.outline:hover, [role=button].outline:hover { background: var(--surface-2); }
button.secondary.outline { --b: var(--line-strong); color: var(--ink-dim); }
button.contrast.outline { --b: var(--bad); }
button.small { min-height: 36px; padding: 0 .8rem; font-size: .85rem; }
button:disabled, button[disabled] { opacity: .55; cursor: wait; transform: none; }

.inline { display: inline-block; margin: 0; vertical-align: top; }
.inline select { display: inline-block; width: auto; margin: 0 .5rem .5rem 0; }
.inline select { min-height: 44px; }
.actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 .25rem; margin: 0 0 1rem; }
.actions button { margin-bottom: 0; }

/* ── Desplegables ─────────────────────────────────────────────────────── */

details:not(.bare) { margin-bottom: 1.25rem; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details:not(.bare) > summary { display: flex; align-items: center; gap: .6rem; padding: .85rem 1.25rem; font-weight: 600; border-radius: var(--r-card); }
details:not(.bare) > summary::before {
  content: "";
  width: .45rem;
  height: .45rem;
  border-right: 2px solid var(--ink-dim);
  border-bottom: 2px solid var(--ink-dim);
  transform: rotate(-45deg);
  transition: transform .15s;
}
details[open]:not(.bare) > summary::before { transform: rotate(45deg); }
details:not(.bare) > summary:hover { background: var(--surface-2); }
details:not(.bare) > :not(summary) { margin-left: 1.25rem; margin-right: 1.25rem; }
details:not(.bare) > summary + * { margin-top: .25rem; }
details:not(.bare) > :last-child { margin-bottom: 1.25rem; }
/* los «Añadir …» son el botón principal de la página */
details:not(.bare) > summary[role=button] {
  display: inline-block;
  margin: 1rem 1.25rem;
  padding: .7rem 1.25rem;
  background: var(--accent);
  color: var(--navy);
  font-weight: 650;
  border-radius: var(--r-sm);
}
details:not(.bare) > summary[role=button]::before { display: none; }
details:not(.bare) > summary[role=button]:hover { background: var(--accent-hover); }
details[open]:not(.bare) > summary[role=button] { margin-bottom: 1rem; }

details.bare > summary { display: inline-block; font-size: .875rem; color: var(--info); margin: .25rem 0; }
details.bare > summary::before { content: "▸ "; }
details.bare[open] > summary::before { content: "▾ "; }

.link-row { margin-bottom: 1rem; }
.link-row .lbl { font-size: .85rem; font-weight: 600; color: var(--ink-dim); margin-bottom: .25rem; }
.link-row .mono { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .55rem .75rem; margin: 0; max-width: none; }

/* ── QR ───────────────────────────────────────────────────────────────── */

.qr-wrap { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.qr-wrap > div { flex: 1 1 18rem; min-width: 0; }
.qr { width: 13rem; height: 13rem; padding: 10px; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-md); shape-rendering: crispEdges; }
.qr path { fill: #151b2e; }
.qr.small { width: 10rem; height: 10rem; }

.sub-url { font-size: .9rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .65rem .8rem; max-width: none; }

/* ── Detalle de nodo y cuenta ─────────────────────────────────────────── */

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.75rem; margin: 0 0 1rem; }
.kv dt { color: var(--ink-dim); font-size: .9rem; }
.kv dd { margin: 0; min-width: 0; }

.meta { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin: -.5rem 0 1.5rem; color: var(--ink-dim); font-size: .92rem; }
.meta b { color: var(--ink); font-weight: 600; }

.fingerprint { font-size: .95rem; background: var(--ok-bg); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); border-radius: var(--r-sm); padding: .7rem .9rem; max-width: none; }

/* ── Consumo: cupo (20 peldaños) y gráfico de 30 días ─────────────────── */

.meter { --mc: var(--ok); display: inline-flex; align-items: center; gap: .3rem .75rem; flex-wrap: wrap; vertical-align: middle; }
.meter.warn { --mc: var(--warn); }
.meter.crit { --mc: #d9730d; }
.meter.full { --mc: var(--bad); }
.meter .seg { display: flex; gap: 2px; width: 10rem; height: 8px; }
.meter .seg i { flex: 1; background: var(--line-strong); border-radius: 1px; }
.meter .seg i.on { background: var(--mc); }
.meter .seg i.on.std { background: var(--info); }
.meter .txt { color: var(--ink); font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meter.small .seg { width: 6rem; height: 6px; }
.meter.small .txt { font-size: .82rem; }

.chart { display: flex; align-items: flex-end; gap: 3px; height: 9rem; padding: 0 0 2px; border-bottom: 1px solid var(--line-strong); }
.chart .day { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; gap: 1px; border-radius: 2px; }
.chart .day i { flex: 1; min-height: 0; background: var(--chart-rx); border-radius: 2px 2px 0 0; }
.chart .day i.tx { background: var(--chart-tx); }
.chart .day:hover { background: var(--surface-2); }
.legend .key { display: inline-block; width: 10px; height: 10px; margin: 0 .35rem 0 1rem; border-radius: 2px; background: var(--chart-rx); }
.legend .key:first-child { margin-left: 0; }
.legend .key.tx { background: var(--chart-tx); }
.h0 { height: 0; } .h1 { height: 5%; } .h2 { height: 10%; } .h3 { height: 15%; } .h4 { height: 20%; }
.h5 { height: 25%; } .h6 { height: 30%; } .h7 { height: 35%; } .h8 { height: 40%; } .h9 { height: 45%; }
.h10 { height: 50%; } .h11 { height: 55%; } .h12 { height: 60%; } .h13 { height: 65%; } .h14 { height: 70%; }
.h15 { height: 75%; } .h16 { height: 80%; } .h17 { height: 85%; } .h18 { height: 90%; } .h19 { height: 95%; }
.h20 { height: 100%; }

/* ── Progreso de la instalación ───────────────────────────────────────── */

ol.steps { list-style: none; margin: 0 0 1rem; padding: 0; }
ol.steps li { display: flex; align-items: baseline; padding: .25rem 0; color: var(--ink-dim); }
ol.steps li.done { color: var(--ok); }
ol.steps li.cur { color: var(--ink); font-weight: 600; }
ol.steps li.fail { color: var(--bad); }
ol.steps li .t { margin-left: auto; padding-left: 1rem; font-size: .82rem; font-weight: 400; color: var(--ink-dim); }
pre.log { max-height: 22rem; overflow: auto; }

/* Confirmación por patrón: el botón se ve apagado hasta que el campo coincide (sin JS: lo bloquearía la CSP) */
form.guard:invalid button[type=submit] { opacity: .5; cursor: not-allowed; }
.when-busy { display: none; }
.htmx-request .when-busy { display: inline; }
.htmx-request .when-idle { display: none; }

/* ── Acceso (sin sesión) y 404 ────────────────────────────────────────── */

.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1.5rem;
  padding: clamp(2rem, 6vw, 4.5rem);
  padding-bottom: clamp(7rem, 14vw, 10rem);
  background: var(--accent);
  color: var(--navy);
  overflow: hidden;
}
/* muro con albardilla al pie, como en la landing */
.auth-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: clamp(4.5rem, 10vw, 7rem);
  border-top: .7rem solid #243058;
  box-shadow: inset 0 2px 0 #4a5a94;
  background: var(--navy) var(--tile) 0 0 / 240px 96px;
}
.auth-art img { width: min(9rem, 40%); height: auto; display: block; border-radius: 22%; }
.auth-art p { margin: 0; max-width: 18ch; font-size: clamp(1.8rem, 3.4vw, 2.8rem); font-weight: 700; line-height: 1.08; letter-spacing: -.04em; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-form form { width: 100%; max-width: 22rem; }
.auth-form .brand { padding: 0; margin-bottom: 2rem; }
.auth-form h1 { margin: 0 0 .25rem; font-size: 1.75rem; letter-spacing: -.03em; font-weight: 700; }
.auth-form .lead { color: var(--ink-dim); margin-bottom: 1.5rem; }
.auth-form button { width: 100%; margin: .5rem 0 0; min-height: 48px; }

.notfound { max-width: 30rem; margin: 0 auto; padding: 4rem 1.25rem; }
main:not(.public) .notfound { margin: 0; padding-left: 0; }
.notfound img { width: 9rem; height: auto; display: block; margin-bottom: 1.5rem; }
.notfound h2 { margin-bottom: .5rem; }
.notfound p { color: var(--ink-dim); }

/* ── Móvil: la barra lateral pasa a ser una barra superior ────────────── */

@media (max-width: 860px) {
  .side { flex-wrap: wrap; gap: 0 1rem; padding-top: .25rem; }
  .brand { padding: .4rem 0; }
  .menu { order: 3; width: 100%; margin: 0 -1rem; padding: 0 .15rem; }
  .menu a { padding: .7rem .85rem; min-height: 44px; }
  .side .out { margin-left: auto; }
  .side .out button { min-height: 40px; }
  main { padding-top: 1.5rem; }
  th.opt, td.opt { display: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { min-height: 0; padding: 1.5rem 1.25rem 4.25rem; flex-direction: row; align-items: center; justify-content: flex-start; }
  .auth-art img { width: 4rem; }
  .auth-art p { font-size: 1.3rem; }
  .auth-art::after { height: 2.75rem; border-top-width: .5rem; }
}

@media (max-width: 640px) {
  html { font-size: 15px; }
  h2 { font-size: 1.5rem; }
  .win { padding: 1rem 1rem 1.15rem; }
  .scroll { margin: 0 -1rem; padding: 0 1rem; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dd { margin-bottom: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ── Zona de cliente (grappl.net/account) ─────────────────────────── */

.cbar { display: flex; align-items: center; gap: 1rem; padding: .85rem clamp(1rem, 3vw, 2.5rem); background: var(--accent); color: var(--navy); position: relative; z-index: 2; }
.cbar .brand { padding: 0; color: var(--navy); }
.cbar .out { margin-left: auto; }
.cbar .support { margin-left: auto; }
.cbar .support + .out { margin-left: 0; }
.cbar .out button { margin: 0; }
.cbar :focus-visible { outline-color: var(--navy); outline-width: 3px; }
.cbar button.secondary { --b: transparent; --b-hover: rgb(25 33 58 / .08); --b-ink: var(--navy); border-color: rgb(25 33 58 / .4); }
.cbar [role=button], .cbar button:not(.secondary) { --b: var(--navy); --b-hover: #0f1630; --b-ink: #fff; }
/* franja de muro con albardilla bajo la cabecera */
.wall-strip { position: relative; height: 2.5rem; background: var(--navy) var(--tile) 0 .7rem / 240px 96px; }
.wall-strip::before { content: ""; position: absolute; inset: 0 0 auto; height: .7rem; background: #243058; box-shadow: inset 0 2px 0 #4a5a94, 0 2px 0 #0d1325; }
body.cust main { padding-top: 2.5rem; }
body.cust { display: flex; flex-direction: column; }
body.cust main { flex: 1 0 auto; width: 100%; }
.cfoot { background: var(--navy-deep); color: #dfe4f1; padding: 1.5rem clamp(1rem, 3vw, 2.5rem); }
.cfoot-in { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 2rem; max-width: 72rem; margin: 0 auto; }
.cfoot .brand { padding: 0; color: #fff; }
.cfoot .brand b { font-size: 1.1rem; }
.cfoot .brand img { width: 1.9rem; height: 1.9rem; }
.cfoot nav { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin-left: auto; }
.cfoot nav a { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; color: #dfe4f1; font-size: .95rem; text-decoration: none; }
.cfoot nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.cfoot :focus-visible { outline-color: #fff; }
@media (max-width: 640px) { .cfoot nav { margin-left: 0; width: 100%; } }
.plain-link { margin-left: auto; font-size: .95rem; font-weight: 550; color: inherit; display: inline-flex; align-items: center; min-height: 44px; }
.narrow { max-width: 32rem; margin-inline: auto; }
.head-row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-start; justify-content: space-between; }
.head-row .meta { margin-top: -.25rem; }
.head-row [role=button] { margin-top: .25rem; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; align-items: start; }
.apps-list { list-style: none; padding: 0; margin: 0 0 .75rem; }
.apps-list li { padding: .65rem 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; }
.apps-list li:first-child { border-top: 0; padding-top: 0; }
.apps-list span { color: var(--ink-dim); font-size: .92rem; }
.apps-list.dl span a { font-weight: 600; }
.connect-stack { grid-template-columns: minmax(0, 1fr); }
.connect-stack > section + section { margin-top: 1.5rem; }
.dl-note { margin: .25rem 0 1rem; padding: .6rem .85rem; border-radius: var(--r-sm); background: var(--info-bg); font-size: .88rem; }
.dl-feature { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; gap: .85rem; align-items: center; padding: .85rem 1rem; border: 1px solid var(--accent); border-radius: var(--r-md); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.dl-feature .dl-btn { margin: 0; }
.dl-badge { font: 700 .66rem/1 var(--mono); letter-spacing: .09em; color: var(--accent-ink); }
.dl-feature h4 { margin: .2rem 0 .1rem; font-size: 1.1rem; }
.dl-sub { margin: 1.25rem 0 .5rem; font-size: .78rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); }
.dl-list { list-style: none; margin: 0 0 .5rem; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.dl-plat { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; gap: .85rem; align-items: center; padding: .7rem 1rem; border-top: 1px solid var(--line); }
.dl-plat:first-child { border-top: 0; }
.dl-plat.mine { box-shadow: inset 3px 0 0 var(--accent); }
.dl-ic { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line); color: var(--ink); }
.dl-ic svg { width: 1.3rem; height: 1.3rem; }
.sub-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.sub-actions > * { margin: 0; }
.add-app img { width: 1.25rem; height: 1.25rem; border-radius: 5px; }
.dl-logo { background: none; border: 0; }
.dl-logo img { width: 100%; height: 100%; border-radius: var(--r-sm); }
.dl-main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.dl-main h5 { margin: 0; font-size: 1rem; font-weight: 650; display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .5rem; }
.dl-main .muted { font-size: .84rem; }
.dl-help summary { margin: 0; font-size: .82rem; }
.dl-help p { margin: .25rem 0 0; font-size: .82rem; max-width: 34rem; }
.dl-actions { display: flex; align-items: center; gap: .6rem; justify-content: flex-end; }
.dl-progs { display: flex; flex-wrap: wrap; gap: .5rem; }
.dl-split { position: relative; display: flex; align-items: stretch; }
.dl-btn { margin: 0; padding: .45rem .9rem; white-space: nowrap; }
.dl-btn small { font-weight: 500; font-size: .75rem; opacity: .75; margin-left: .35rem; }
.dl-btn.has-more { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.dl-more { display: flex; }
.dl-more.bare > summary { display: grid; place-items: center; margin: 0; padding: 0 .55rem; height: 100%; font-size: 1rem; background: var(--accent); color: var(--on-accent); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; border-left: 1px solid rgb(0 0 0 / .25); }
.dl-more.bare > summary::before, .dl-more.bare[open] > summary::before { content: none; }
.dl-more.bare > summary:hover { background: var(--accent-hover); }
.dl-more.alt.bare > summary { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); border-left: 0; }
.dl-more.alt.bare > summary:hover { background: rgb(128 128 128 / .12); }
.dl-more.bare > summary svg { width: 1rem; height: 1rem; }
.dl-more[open] > summary svg { transform: rotate(180deg); }
.dl-menu { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 10; min-width: 15rem; margin: 0; padding: .25rem; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow); }
.dl-menu a { display: flex; flex-direction: column; padding: .45rem .65rem; border-radius: var(--r-sm); text-decoration: none; color: var(--ink); }
.dl-menu a:hover { background: var(--bg); }
.dl-menu span { font-size: .8rem; color: var(--ink-dim); }
.dl-stores { display: flex; gap: .35rem; margin-left: auto; }
.dl-store { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink-dim); }
.dl-store:hover { color: var(--ink); border-color: var(--line-strong); }
.dl-store svg { width: 1.3rem; height: 1.3rem; }
.dl-more > summary:focus-visible, .dl-store:focus-visible, .dl-help summary:focus-visible, .dl-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.dl-verify { margin-top: .25rem; font-size: .85rem; }
.dl-meta { display: flex; flex-direction: column; gap: .15rem; margin: .6rem 0 0; }
.dl-meta .mono { font-size: .76rem; word-break: break-all; color: var(--ink-dim); }
/* El diseño depende del ancho de la lista, no de la ventana: con poco sitio las acciones bajan debajo del nombre. */
.dl-list { container-type: inline-size; }
@container (min-width: 840px) { .dl-actions { width: 30rem; } .dl-progs { flex: 1; flex-wrap: nowrap; } .dl-progs > .dl-split:first-child .dl-btn { min-width: 11rem; } }
@container (max-width: 839px) {
  .dl-plat { grid-template-columns: 2.4rem minmax(0, 1fr); gap: .5rem .75rem; }
  .dl-actions { grid-column: 1 / -1; flex-wrap: wrap; justify-content: flex-start; }
  .dl-progs { flex-wrap: wrap; }
}
@container (max-width: 520px) {
  .dl-progs { flex-wrap: nowrap; }
  .dl-btn { padding: .45rem .7rem; }
  .dl-actions .dl-btn small { display: none; }
}
@media (max-width: 640px) {
  .dl-feature { grid-template-columns: 2.4rem minmax(0, 1fr); }
  .dl-feature .dl-btn { grid-column: 1 / -1; width: 100%; }
}
.acct { font-size: 1.15rem; letter-spacing: .04em; }
input.acct { font-family: var(--mono); font-size: 1.45rem; font-weight: 500; letter-spacing: .14em; min-height: 56px; padding: .7rem 1rem; text-align: center; }
input.acct::placeholder { letter-spacing: .14em; }
.acct-big { font-size: clamp(1.2rem, 4.4vw, 1.9rem); letter-spacing: .08em; font-weight: 500; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: .8rem 1rem; max-width: none; word-break: normal; overflow-wrap: anywhere; }
.acct-line { margin-bottom: .75rem; }
.top-gap { margin-top: 1rem; }
.opt:not(th) { font-size: .85rem; font-weight: 400; }
.welcome { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.hint { font-size: .85rem; }
@media (max-width: 860px) { .cols2 { grid-template-columns: minmax(0, 1fr); } }
.security .sec-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 2rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.security .sec-row:first-of-type { padding-top: 0; border-top: 0; }
.security .sec-row:last-child { padding-bottom: 0; }
.security .sec-row > div { flex: 1 1 22rem; min-width: 0; }
.security .sec-row h3 { margin: 0 0 .25rem; font-size: 1rem; font-weight: 650; }
.security .sec-row p { margin: 0; }
.security .sec-row form, .security .sec-row button { margin: 0; }
@media (max-width: 640px) { .security .sec-row form, .security .sec-row button { width: 100%; } }
.withdraw { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.withdraw p { margin-bottom: .4rem; }
.status-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem 1rem; }
.summary { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; align-items: center; }
.summary-main { flex: 1 1 20rem; min-width: 0; }
.facts { display: flex; flex-wrap: wrap; gap: .75rem 2.5rem; margin: 0 0 1.25rem; }
.facts dt { font: 500 .75rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-dim); margin: 0 0 .25rem; }
.facts dd { margin: 0; }
.facts .days { color: var(--ink-dim); }
.facts .days.soon { color: var(--warn); font-weight: 600; }
.acct-box { display: flex; flex-direction: column; gap: .35rem; }
.acct-box .sub-h { margin: 0; }
.acct-box .actions button { margin: 0; }
.sub-h { font: 500 .75rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-dim); margin: 0 0 .5rem; }
.connect .cols2 > section > .win-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 1rem; font-size: 1.05rem; font-weight: 650; }
.connect .cols2 > section > .win-title .step { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: var(--navy); font: 600 .8rem/1 var(--mono); }
.flash:has([role=button]) { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.flash [role=button] { margin: 0; min-height: 36px; padding: 0 .9rem; }
.flash.err a, .flash a { color: inherit; }
.win > :first-child:is(h3, h4) { margin-top: 0; }

/* ── Compra (/buy): tarjeta centrada con precio, ventajas y un solo botón, como la tarjeta del plan de la landing ── */
.narrow.buy { max-width: 58rem; margin-inline: auto; }
.buy .buy-narrow { max-width: 31rem; margin-inline: auto; }
.buy h2 { text-align: center; }
.buy .buy-lead { text-align: center; color: var(--ink-dim); margin: -.2rem auto 1.6rem; max-width: 28rem; font-size: 1.05rem; }
.buy-card { padding: var(--s6); box-shadow: var(--shadow); }
.buy-plan { text-align: center; margin: .2rem 0 1.25rem; }
.buy-price b { font-size: clamp(3rem, 10vw, 4.25rem); font-weight: 700; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.buy-price span { color: var(--ink-dim); font-size: 1rem; }
.buy-name { margin: .5rem 0 0; font: 500 .8rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); }
.buy-points { list-style: none; margin: 0 0 1.25rem; padding: var(--s5) 0 0; border-top: 1px solid var(--line); display: grid; gap: .1rem; font-size: .97rem; }
.buy-points li { position: relative; padding: .35rem 0 .35rem 2rem; border-left: 3px solid transparent; }
.buy-points li::before { content: "✓"; position: absolute; left: .6rem; font-weight: 700; color: var(--accent-ink); }
.buy-points li.hl { border-left-color: var(--accent); font-weight: 650; background: linear-gradient(90deg, rgb(242 179 61 / .14), transparent 80%); }
.buy .buy-cta { width: 100%; margin-top: 1rem; min-height: 48px; font-size: 1.05rem; }
.buy .buy-fine { margin: .8rem 0 0; font-size: .82rem; color: var(--ink-dim); text-align: center; }
.buy .buy-after { text-align: center; margin: 2rem auto 0; padding-bottom: 3rem; max-width: 31rem; }
.cbar .lang-chip { display: inline-grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; font: 650 .85rem/1 var(--font); border: 1px solid rgb(25 33 58 / .4); border-radius: var(--r-sm); color: var(--navy); text-decoration: none; }
.cbar .lang-chip:hover { background: rgb(25 33 58 / .08); }
.cbar .plain-link + .lang-chip { margin-left: .25rem; }
.buy-grid { display: grid; grid-template-columns: minmax(0, 31rem) minmax(0, 1fr); gap: 1.5rem 3rem; align-items: start; justify-content: center; }
.buy-grid .buy-card { margin-bottom: 0; }
.buy-usage { padding-top: .4rem; }
.buy-usage h3 { font-size: 1.25rem; letter-spacing: -.02em; margin: 0 0 1rem; }
.buy-usage ul { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .8rem; }
.buy-usage .muted { font-size: .88rem; }
@media (max-width: 860px) { .buy-grid { grid-template-columns: minmax(0, 1fr); max-width: 31rem; margin-inline: auto; } }

/* Zona de cliente: desglose del consumo mensual entre servidores premium y estándar */
.split { margin: .5rem 0; }
.split td { padding: .4rem .6rem; border-top: 1px solid var(--line); }
.split td:not(:first-child) { text-align: right; white-space: nowrap; }
.split { --mc: var(--ok); }
.split.lvl-warn { --mc: var(--warn); }
.split.lvl-crit { --mc: #d9730d; }
.split.lvl-full { --mc: var(--bad); }
.split .dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .5rem; background: var(--mc); }
.split .dot.std { background: var(--info); }
.data-meter .meter .seg { width: 16rem; max-width: 100%; height: 16px; gap: 3px; }
.data-meter .meter .seg i { border-radius: 2px; }
.split tr:hover td { background: var(--surface-2); }
/* Al pasar por una fila, la barra atenúa los tramos del otro tipo */
.data-split:has(tr.prem:hover) .seg i.on.std,
.data-split:has(tr.std:hover) .seg i.on:not(.std) { opacity: .25; }
