/* ANVAR Studio — demo "Panel del dueño" (Taller Los Aromos, negocio ficticio).
   Mismo sistema que el sitio (Young Serif + Onest, índigo, cobalto, amarillo solo para dinero),
   con aspecto de app: lienzo gris frío, tarjetas blancas, barra inferior en el celular. */

@font-face { font-family: "Onest Fallback"; src: local("Arial"), local("ArialMT"), local("Helvetica"), local("Roboto"); font-weight: 100 549; size-adjust: 104%; ascent-override: 93%; descent-override: 30%; line-gap-override: 0%; }
@font-face { font-family: "Onest Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Roboto Bold"); font-weight: 550 900; size-adjust: 99.4%; ascent-override: 97%; descent-override: 31%; line-gap-override: 0%; }
@font-face { font-family: "Young Serif Fallback"; src: local("Georgia"), local("Noto Serif"); size-adjust: 112.7%; ascent-override: 93%; descent-override: 33%; line-gap-override: 0%; }

:root {
  --bg: #FFFFFF;
  --canvas: #F1F2F6;
  --ink: #16163A;
  --ink-2: #55557A;
  --ink-3: #6B6B8C;
  --on-ink: rgba(255, 255, 255, .72);
  --on-ink-accent: #AEB7FF;
  --line: #E1E3EC;
  --grid: #E8E9F0;
  --cobalt: #3346F0;
  --cobalt-press: #2B3BD6;
  --cobalt-soft: #E6E9FE;
  --cobalt-ink: #2433C4;
  --prev: #8489AE;          /* periodo anterior: gris de apoyo, 3:1 sobre blanco (validado) */
  --sale: #FFD23F;          /* solo dinero */
  --ok: #1E9E57;
  --ok-ink: #157A42;
  --ok-on-ink: #7BDDA4;
  --bad: #C2304A;
  --bad-on-ink: #FF9AAD;
  --bubble-in: #FFFFFF;
  --bubble-out: #DAF4E0;
  --wall: #ECEEF4;

  --serif: "Young Serif", "Young Serif Fallback", Georgia, "Times New Roman", serif;
  --sans: "Onest", "Onest Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-card: 24px;
  --r-inner: 14px;
  --r-btn: 14px;

  --sh-1: 0 1px 2px rgba(22, 22, 58, .05), 0 2px 10px -4px rgba(22, 22, 58, .08);
  --sh-2: 0 1px 2px rgba(22, 22, 58, .06), 0 8px 20px -8px rgba(22, 22, 58, .16), 0 24px 48px -24px rgba(22, 22, 58, .22);

  --gutter: clamp(16px, 4vw, 40px);
  --appbar-h: 64px;
  --tabbar-h: 64px;
  --ease-out: cubic-bezier(.22, .8, .32, 1);

  --z-appbar: 30;
  --z-tabbar: 30;
  --z-toast: 35;
  --z-skip: 40;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--appbar-h) + 16px);
  scroll-padding-bottom: calc(var(--tabbar-h) + 16px);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}
svg { display: block; }
a { color: inherit; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 400; }
ul, ol { margin: 0; padding: 0; list-style: none; }
blockquote { margin: 0; }
button, textarea { font: inherit; color: inherit; }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }
.card-pagos :focus-visible, .demo-strip :focus-visible, .toast :focus-visible { outline-color: var(--on-ink-accent); }
main:focus { outline: none; }

.skip {
  position: fixed; left: 16px; top: 12px; z-index: var(--z-skip);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-btn);
  text-decoration: none; font-weight: 600;
  transform: translateY(-160%);
  transition: transform .2s var(--ease-out);
}
.skip:focus { transform: none; }

.wrap { width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Botones ---------- */
.btn {
  --bh: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--bh); padding: 0 20px;
  border-radius: var(--r-btn); border: 0;
  font-family: var(--sans); font-weight: 600; font-size: 16px; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease, opacity .18s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn:disabled { cursor: default; opacity: .55; transform: none; }
.btn-sm { --bh: 44px; padding: 0 16px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-primary {
  background: var(--cobalt); color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 1px 2px rgba(22, 22, 58, .2), 0 6px 16px -8px rgba(51, 70, 240, .7);
}
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(22, 22, 58, .2); }
@media (hover: hover) {
  .btn-primary:not(:disabled):hover { background: var(--cobalt-press); }
  .btn-ghost:not(:disabled):hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
}

/* ---------- Franja de demostración ---------- */
.demo-strip { background: var(--ink); color: #fff; font-size: 14px; }
.demo-strip-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding-block: 6px; }
.demo-strip p { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.demo-strip-mark {
  flex: none; width: 10px; height: 10px; border-radius: 3px;
  background: repeating-linear-gradient(135deg, var(--on-ink-accent) 0 2px, transparent 2px 4px);
  box-shadow: inset 0 0 0 1px var(--on-ink-accent);
}
.demo-strip a {
  color: var(--on-ink-accent); font-weight: 600; text-underline-offset: 3px; white-space: nowrap;
  min-height: 40px; display: inline-flex; align-items: center;
}
@media (max-width: 479px) { .demo-strip a { display: none; } }

/* ---------- Barra superior ---------- */
.appbar {
  position: sticky; top: 0; z-index: var(--z-appbar);
  height: var(--appbar-h);
  background: rgba(241, 242, 246, .86);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  box-shadow: 0 1px 0 rgba(22, 22, 58, .07);
}
.appbar-in { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.biz { display: flex; align-items: center; gap: 12px; min-width: 0; }
.biz-mark { flex: none; border-radius: 12px; box-shadow: 0 0 0 1px rgba(22, 22, 58, .08); }
.biz-words { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.biz-name { font-family: var(--serif); font-size: 18px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz-sub { font-size: 13px; color: var(--ink-2); }
.topnav { display: none; }
.topnav a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 12px; text-decoration: none; font-weight: 500; font-size: 15px; color: var(--ink-2);
  transition: background-color .15s ease, color .15s ease;
}
@media (hover: hover) { .topnav a:hover { background: rgba(22, 22, 58, .06); color: var(--ink); } }
.count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--cobalt); color: #fff; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 16px;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(22, 22, 58, .1);
}

/* ---------- Distribución ---------- */
.layout { display: grid; gap: 28px; padding-top: 24px; padding-bottom: 40px; }
.intro h1 { font-family: var(--serif); font-size: clamp(2rem, 6.4vw, 2.75rem); line-height: 1.06; letter-spacing: -.01em; }
.intro-sub { margin-top: 6px; font-size: 17px; color: var(--ink-2); }
.intro-note {
  margin-top: 16px; max-width: 64ch; font-size: 14px; color: var(--ink-2);
  padding: 12px 14px; border-radius: var(--r-inner); background: rgba(255, 255, 255, .6);
  box-shadow: inset 0 0 0 1px var(--line);
}
.soon {
  flex: none; display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border-radius: 999px; background: var(--cobalt-soft); color: var(--cobalt-ink);
  font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.soon-inline { vertical-align: 1px; height: 20px; padding: 0 8px; }

.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sec-head h2 { font-family: var(--serif); font-size: clamp(1.5rem, 4.6vw, 1.85rem); line-height: 1.1; letter-spacing: -.01em; }
.sec-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Selector de periodo */
.seg {
  display: inline-flex; padding: 4px; gap: 2px; border-radius: 14px;
  background: rgba(22, 22, 58, .06);
}
.seg button {
  min-height: 40px; min-width: 64px; padding: 0 12px; border: 0; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.seg button:active { transform: scale(.97); }
.seg button[aria-checked="true"] { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(22, 22, 58, .12), 0 2px 6px -2px rgba(22, 22, 58, .12); }
@media (hover: hover) { .seg button[aria-checked="false"]:hover { color: var(--ink); } }
.seg button:focus-visible { outline-offset: 1px; }

.sec-sub { margin-top: 6px; color: var(--ink-2); font-size: 15px; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--bg); border-radius: var(--r-card); padding: 20px;
  box-shadow: var(--sh-1);
  min-width: 0;
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.card-head h2, .card-head h3 { font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: 0; font-family: var(--sans); }
.card-sub { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.mini-t { margin-top: 18px; font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* Cifras: sans semibold, figuras proporcionales a tamaño grande */
.fig { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; }
.fig-val { font-size: clamp(2.25rem, 9vw, 2.75rem); font-weight: 600; line-height: 1; letter-spacing: -.025em; transition: opacity .3s ease; }
.fig-note { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.fig-note-end { margin-top: 12px; }
.is-loading .fig-val, .is-loading .chart-svg { opacity: .35; transition: none; }
.chart-svg { transition: opacity .3s ease; }

.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.delta svg { width: 16px; height: 16px; flex: none; }
.delta .tnum { font-weight: 600; }
.delta.is-bueno svg, .delta.is-bueno .tnum { color: var(--ok-ink); }
.delta.is-malo svg, .delta.is-malo .tnum { color: var(--bad); }
.delta-ink { color: var(--on-ink); }
.delta-ink.is-bueno svg, .delta-ink.is-bueno .tnum { color: var(--ok-on-ink); }
.delta-ink.is-malo svg, .delta-ink.is-malo .tnum { color: var(--bad-on-ink); }

/* ---------- Gráficos ---------- */
.chart { position: relative; margin-top: 14px; }
.chart-svg { width: 100%; height: auto; overflow: visible; touch-action: pan-y; cursor: crosshair; -webkit-tap-highlight-color: transparent; }
.chart-svg:focus-visible { outline-offset: 4px; border-radius: 10px; }
.chart-svg .grid { stroke: var(--grid); stroke-width: 1; }
.chart-svg .axis { stroke: #C9CCDA; stroke-width: 1; }
.chart-svg .tick { fill: var(--ink-3); font-size: 11px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart-svg .area-now { fill: var(--cobalt); opacity: .1; }
.chart-svg .line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .line-now { stroke: var(--cobalt); }
.chart-svg .line-prev { stroke: var(--prev); stroke-dasharray: 5 4; }
.chart-svg .dot { stroke: var(--bg); stroke-width: 2; }
.chart-svg .dot-now { fill: var(--cobalt); }
.chart-svg .dot-prev { fill: var(--prev); }
.chart-svg .end-label { fill: var(--ink); font-size: 12px; font-weight: 600; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart-svg .end-label-prev { fill: var(--ink-3); font-weight: 500; }
.chart-svg .cross-line { stroke: var(--ink-3); stroke-width: 1; }
.chart-svg .hit { fill: transparent; }

.chart-ink .chart-svg .axis { stroke: rgba(255, 255, 255, .22); }
.chart-ink .chart-svg .tick { fill: var(--on-ink); }
.chart-ink .chart-svg .bar { fill: var(--sale); transition: opacity .15s ease, fill .15s ease; }
.chart-ink .chart-svg .bar.is-on { fill: #FFE47F; }
.chart-ink .chart-svg:has(.bar.is-on) .bar:not(.is-on) { opacity: .45; }
.chart-ink .chart-svg .bar-label { fill: #fff; font-size: 12px; font-weight: 600; font-family: var(--sans); font-variant-numeric: tabular-nums; }

.tip {
  position: absolute; top: -6px; left: 0; z-index: 2; pointer-events: none;
  min-width: 150px; max-width: 240px; padding: 8px 10px; border-radius: 12px;
  background: var(--bg); color: var(--ink); font-size: 13px; line-height: 1.35;
  box-shadow: 0 0 0 1px rgba(22, 22, 58, .08), 0 8px 20px -8px rgba(22, 22, 58, .35);
  transform: translateY(-100%);
}
.tip-h { font-weight: 600; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tip-row b { color: var(--ink); font-weight: 600; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.key { flex: none; display: inline-block; }
.key-line { width: 18px; height: 0; border-top: 2px solid; border-radius: 2px; }
.key-now { border-color: var(--cobalt); }
.key-prev { border-top-style: dashed; border-color: var(--prev); }
.key-box { width: 12px; height: 12px; border-radius: 4px; }
.key-ia { background: var(--cobalt); }
.key-tu { background: var(--ink); }
.legend-split b { color: var(--ink); font-weight: 600; }

/* Barra dividida: asistente vs. tú (2px de separación del color de la superficie) */
.split { display: flex; gap: 2px; height: 12px; margin-top: 16px; }
.split span { min-width: 4px; border-radius: 4px; transition: flex-grow .4s var(--ease-out); }
.seg-ia { background: var(--cobalt); }
.seg-tu { background: var(--ink); }

/* Reservas */
.facts { margin-top: 12px; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.facts b { color: var(--ink); font-weight: 600; }
.agenda { margin-top: 8px; display: grid; gap: 2px; }
.agenda li {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 10px 12px; border-radius: 12px; background: var(--canvas);
}
.ag-when { display: flex; flex-direction: column; line-height: 1.25; }
.ag-day { font-size: 12px; color: var(--ink-2); }
.ag-hour { font-weight: 600; font-size: 16px; }
.ag-what { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.ag-svc { font-weight: 500; font-size: 14px; }
.ag-who { font-size: 13px; color: var(--ink-2); }

/* Pagos (superficie índigo: aquí sí va el amarillo) */
.card-pagos { background: var(--ink); color: #fff; box-shadow: var(--sh-2); }
.card-pagos .fig-note, .card-pagos .mini-t { color: var(--on-ink); }
.fig-money { color: var(--sale); }
.card-pagos .tip { background: #fff; color: var(--ink); }
.pagos-list { margin-top: 8px; display: grid; }
.pagos-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; box-shadow: 0 1px 0 rgba(255, 255, 255, .1);
}
.pagos-list li:last-child { box-shadow: none; }
.pl-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pl-who { font-weight: 500; font-size: 14px; }
.pl-what { font-size: 13px; color: var(--on-ink); }
.pl-amt { flex: none; font-weight: 600; color: var(--sale); }

/* Tabla */
.tabla { padding: 0; }
.tabla summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 0 20px; cursor: pointer; font-weight: 600; font-size: 15px;
  list-style: none; border-radius: var(--r-card);
}
.tabla summary::-webkit-details-marker { display: none; }
.tabla summary::after {
  content: ""; width: 9px; height: 9px; flex: none; margin-top: -4px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg); transition: transform .2s var(--ease-out);
}
.tabla[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.tabla-scroll { overflow-x: auto; padding: 0 20px 16px; }
.tabla table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 460px; }
.tabla th, .tabla td { padding: 8px 10px; text-align: right; white-space: nowrap; box-shadow: inset 0 -1px 0 var(--line); }
.tabla th:first-child { text-align: left; padding-left: 0; }
.tabla thead th { font-weight: 600; color: var(--ink-2); font-size: 13px; }
.tabla tbody th { font-weight: 500; }

/* ---------- Resumen de las 8:00 (chat) ---------- */
.card-chat { padding: 20px; }
.chat {
  margin-top: 14px; border-radius: 18px; overflow: hidden; background: var(--wall);
  box-shadow: 0 0 0 1px rgba(22, 22, 58, .09);
}
.chat-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.chat-ava { flex: none; width: 32px; height: 32px; }
.chat-who { display: flex; flex-direction: column; line-height: 1.2; }
.chat-name { font-weight: 600; font-size: 15px; }
.chat-state { font-size: 12px; color: var(--ink-2); }
.chat-body {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 12px; max-height: 460px; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin;
}
.chat-day {
  align-self: center; font-size: 12px; font-weight: 500; color: var(--ink-2);
  padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .7);
}
.msg {
  position: relative; max-width: 88%; padding: 9px 12px 20px; border-radius: 16px;
  font-size: 15px; line-height: 1.45;
  box-shadow: 0 1px 1px rgba(22, 22, 58, .08);
  transition: opacity .22s var(--ease-out), transform .22s var(--ease-out);
}
.msg p + p, .msg p + ul, .msg ul + p { margin-top: 6px; }
.msg-in { align-self: flex-start; background: var(--bubble-in); border-top-left-radius: 6px; }
.msg-out { align-self: flex-end; background: var(--bubble-out); border-top-right-radius: 6px; }
.msg.is-in { opacity: 0; transform: translateY(8px); transition: none; }
.msg-list { display: grid; gap: 3px; margin-top: 6px; }
.msg-list li { position: relative; padding-left: 16px; }
.msg-list li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--cobalt); }
.msg-time { position: absolute; right: 10px; bottom: 4px; font-size: 11px; color: var(--ink-3); }
.msg-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.msg-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); opacity: .4; animation: tecleo 1s infinite ease-in-out; }
.msg-typing i:nth-child(2) { animation-delay: .15s; }
.msg-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tecleo { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.chat-replies { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 12px 14px; }
.reply {
  min-height: 44px; padding: 8px 14px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--bg); color: var(--cobalt-ink); font-weight: 600; font-size: 14px; text-align: left;
  box-shadow: inset 0 0 0 1.5px rgba(51, 70, 240, .35);
  transition: background-color .15s ease, box-shadow .15s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.reply:active { transform: scale(.97); }
@media (hover: hover) { .reply:hover { background: var(--cobalt-soft); box-shadow: inset 0 0 0 1.5px var(--cobalt); } }
.chat-fine { margin-top: 10px; font-size: 13px; color: var(--ink-3); }

/* ---------- Pendientes ---------- */
.grid-pend { display: grid; gap: 16px; margin-top: 16px; }
.reviews, .dormidos { display: grid; gap: 12px; margin-top: 16px; }
.review {
  padding: 16px; border-radius: 18px; background: var(--canvas);
  transition: opacity .25s ease;
}
.rv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rv-who { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rv-name { font-weight: 600; }
.rv-when { font-size: 13px; color: var(--ink-2); }
.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 16px; height: 16px; }
.stars .on { fill: var(--ink); }
.stars .off { fill: #CDD0DD; }
.rv-text { margin-top: 8px; font-size: 15px; }
.rv-reply { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg); box-shadow: 0 1px 2px rgba(22, 22, 58, .06); }
.rv-label { font-size: 12px; font-weight: 600; color: var(--cobalt-ink); }
label.rv-label { display: block; }
.rv-resp { margin-top: 4px; font-size: 15px; }
.rv-flag { margin-top: 10px; font-size: 13px; color: var(--ink-2); padding-left: 12px; box-shadow: inset 2px 0 0 var(--prev); }
.rv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rv-edit {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; resize: vertical; min-height: 110px;
  font-size: 16px; line-height: 1.45; border: 0; border-radius: 10px; background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: box-shadow .15s ease;
}
.rv-edit:focus { outline: none; box-shadow: inset 0 0 0 2px var(--cobalt); }
.rv-edit[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--bad); }
.rv-err { margin-top: 6px; font-size: 13px; color: var(--bad); font-weight: 500; }
.rv-status, .dm-status { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; font-weight: 500; color: var(--ok-ink); }
.rv-status svg, .dm-status svg { width: 20px; height: 20px; flex: none; color: var(--ok); }
.rv-status:focus, .dm-status:focus { outline: none; }
.rv-status:focus-visible, .dm-status:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }
.review.is-done .rv-text { color: var(--ink-2); }

.plantilla { margin-top: 12px; }
.plantilla summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--cobalt-ink); list-style: none;
}
.plantilla summary::-webkit-details-marker { display: none; }
.plantilla summary::before {
  content: ""; width: 7px; height: 7px; flex: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .2s var(--ease-out);
}
.plantilla[open] summary::before { transform: rotate(45deg); }
.plantilla-msg {
  margin-top: 4px; padding: 10px 12px 12px; border-radius: 14px; border-top-left-radius: 6px;
  background: var(--wall); font-size: 14px;
}
.dormido {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-radius: 18px; background: var(--canvas);
}
.dm-info { min-width: 0; flex: 1 1 180px; line-height: 1.35; }
.dm-name { font-weight: 600; }
.dm-car { font-size: 14px; }
.dm-last { font-size: 13px; color: var(--ink-2); }
.dormido .dm-status { margin-top: 0; }
.card-dormidos .btn-block { margin-top: 14px; }

/* ---------- Cierre ---------- */
.about {
  padding: 24px 20px; border-radius: var(--r-card); background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.about h2 { font-family: var(--serif); font-size: clamp(1.5rem, 4.6vw, 1.85rem); line-height: 1.1; }
.about p { margin-top: 10px; max-width: 62ch; color: var(--ink-2); }
.about-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.foot { padding: 8px 0 32px; font-size: 13px; color: var(--ink-2); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.foot a { text-underline-offset: 3px; }

/* ---------- Barra inferior (celular) ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: var(--z-tabbar);
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  box-shadow: 0 -1px 0 rgba(22, 22, 58, .08), 0 -10px 24px -18px rgba(22, 22, 58, .3);
}
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; font-size: 12px; font-weight: 500; color: var(--ink-3);
  -webkit-tap-highlight-color: transparent;
  transition: color .15s ease;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current] { color: var(--cobalt); font-weight: 600; }
.tabbar a:focus-visible { outline-offset: -4px; }
.badge {
  position: absolute; top: 7px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--cobalt); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

/* ---------- Aviso (toast) ---------- */
.toast {
  position: fixed; left: 50%; z-index: var(--z-toast);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px);
  width: min(460px, calc(100% - 32px));
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px;
  border-radius: 16px; background: var(--ink); color: #fff; font-size: 14px; line-height: 1.4;
  box-shadow: 0 10px 30px -10px rgba(22, 22, 58, .6);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none; visibility: hidden;
  transition: opacity .2s ease, transform .25s var(--ease-out), visibility 0s linear .25s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; visibility: visible; transition: opacity .2s ease, transform .25s var(--ease-out), visibility 0s; }
.toast-txt { flex: 1; }
.toast-undo {
  flex: none; min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: var(--on-ink-accent); font-weight: 600; font-size: 14px;
}
@media (hover: hover) { .toast-undo:hover { background: rgba(255, 255, 255, .18); } }

@media (prefers-reduced-motion: reduce) {
  .msg, .toast, .split span, .fig-val, .chart-svg, .review { transition: none; }
  .msg-typing i { animation: none; opacity: .6; }
}

/* ---------- Tableta ---------- */
@media (min-width: 680px) {
  .card { padding: 24px; }
  .grid-num { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-consultas, .card-pagos, .tabla { grid-column: 1 / -1; }
  .pagos-top { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
  .pagos-top .fig-note { max-width: 32ch; text-align: right; }
  .tabla { padding: 0; }
  .about { padding: 32px; }
}
.grid-num { display: grid; gap: 16px; margin-top: 16px; }

/* ---------- Escritorio: resumen fijo a la derecha, sin barra inferior ---------- */
@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  html { scroll-padding-bottom: 0; }
  .tabbar { display: none; }
  .topnav { display: flex; gap: 4px; margin-left: auto; }
  .toast { bottom: 24px; }
  .layout {
    grid-template-columns: minmax(0, 1fr) 400px; column-gap: 32px; row-gap: 40px;
    padding-top: 36px; padding-bottom: 56px;
  }
  .intro, .numeros, .pendientes, .about { grid-column: 1; }
  .resumen { grid-column: 2; grid-row: 1 / span 3; }
  .card-chat { position: sticky; top: calc(var(--appbar-h) + 20px); }
  .chat-body { max-height: min(520px, calc(100vh - 360px)); min-height: 300px; }
  .grid-pend { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1280px) {
  .layout { grid-template-columns: minmax(0, 1fr) 420px; column-gap: 40px; }
  .card-resp, .card-reservas { min-height: 100%; }
}
.soon.is-on { background: #E3F5EA; color: #0F5A31; }
