/* Panel de la boda · Ariadna y Max
   Primero celular (lo usan Ari, Max y la wedding planner en el teléfono).
   Diseño: estructura de Linear (filas densas, líneas finas, un solo color de acción)
   con el pulido de Apple (barras de vidrio, títulos grandes, botones píldora).
   Claro por defecto; oscuro estilo Linear si el teléfono está en modo oscuro.
   El plano del salón siempre queda en claro (es un dibujo del lugar). */

@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 200 500; font-display: swap; src: url(/fonts/fraunces-normal-200-500.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 200 500; font-display: swap; src: url(/fonts/fraunces-italic-200-500.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 200 700; font-display: swap; src: url(/fonts/dm-sans-normal-200.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-normal-400.woff2) format('woff2'); }

/* ── tokens ── */
:root {
  /* superficies */
  --paper: #F4F2EC;          /* lienzo */
  --card: #FDFCF9;           /* tarjetas, campos */
  --raised: #FFFFFF;         /* hoja, menús */
  --warm: #EFEADF;           /* fichas, mesa */
  --hover: rgba(26, 24, 20, 0.035);
  --press: rgba(26, 24, 20, 0.06);
  /* texto */
  --ink: #1A1814;
  --ink-soft: rgba(26, 24, 20, 0.64);
  --ink-mute: rgba(26, 24, 20, 0.42);
  /* líneas */
  --line: rgba(26, 24, 20, 0.12);
  --line-soft: rgba(26, 24, 20, 0.07);
  --hair: 0 0 0 1px rgba(26, 24, 20, 0.07);
  /* color: vino es el único color de acción */
  --wine: #722F37;
  --wine-soft: rgba(114, 47, 55, 0.08);
  --primary: #722F37;
  --primary-hover: #5E262D;
  --on-primary: #FDFCF9;
  --olive: #5F7050;
  --olive-soft: rgba(95, 112, 80, 0.12);
  --amber: #8F621A;
  --amber-soft: rgba(154, 107, 30, 0.11);
  --blue: #3F5A73;
  --blue-soft: rgba(63, 90, 115, 0.10);
  --danger: #B23A3A;
  /* inverso (barra de selección, aviso, toast, filtro activo) */
  --inv-bg: #1A1814;
  --inv-fg: #F4F2EC;
  --inv-line: rgba(244, 242, 236, 0.22);
  --inv-fill: rgba(244, 242, 236, 0.10);
  /* vidrio */
  --glass: rgba(244, 242, 236, 0.86);
  --glass-tab: rgba(253, 252, 249, 0.94);
  --shadow-pop: 0 1px 2px rgba(26, 24, 20, 0.06), 0 12px 32px rgba(26, 24, 20, 0.16);
  --backdrop: rgba(26, 24, 20, 0.32);
  /* tipografía */
  --f-display: 'Fraunces', Georgia, serif;
  --f-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;
  /* forma */
  --r: 12px;        /* tarjetas */
  --r-in: 8px;      /* campos */
  --r-sm: 6px;      /* insignias */
  --tabs-h: 60px;
  --side-w: 232px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0B0C0D;
    --card: #141516;
    --raised: #1A1B1D;
    --warm: #202125;
    --hover: rgba(255, 255, 255, 0.035);
    --press: rgba(255, 255, 255, 0.06);
    --ink: #E8E8E6;
    --ink-soft: rgba(232, 232, 230, 0.66);
    --ink-mute: rgba(232, 232, 230, 0.42);
    --line: rgba(255, 255, 255, 0.11);
    --line-soft: rgba(255, 255, 255, 0.065);
    --hair: 0 0 0 1px rgba(255, 255, 255, 0.07);
    --wine: #DB8E97;
    --wine-soft: rgba(219, 142, 151, 0.12);
    --primary: #8E3B45;
    --primary-hover: #A2454F;
    --on-primary: #FBF4F2;
    --olive: #A9BC90;
    --olive-soft: rgba(169, 188, 144, 0.14);
    --amber: #D9A757;
    --amber-soft: rgba(217, 167, 87, 0.13);
    --blue: #93B2CF;
    --blue-soft: rgba(147, 178, 207, 0.13);
    --danger: #E07070;
    --inv-bg: #26282C;
    --inv-fg: #EDEDEB;
    --inv-line: rgba(255, 255, 255, 0.16);
    --inv-fill: rgba(255, 255, 255, 0.07);
    --glass: rgba(11, 12, 13, 0.84);
    --glass-tab: rgba(20, 21, 22, 0.94);
    --shadow-pop: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 40px rgba(0, 0, 0, 0.5);
    --backdrop: rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

/* ── base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.5 var(--f-body);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
b, strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
::selection { background: var(--wine-soft); }

.eyebrow { font: 400 11px/1.4 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.01em; }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ── controles ── */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.input, .select, .textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-in);
  background: var(--card);
  font-size: 16px; /* evita el zoom de iOS */
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-mute); }
.select { -webkit-appearance: none; appearance: none; padding-right: 38px; background: var(--card) no-repeat right 13px center / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px var(--wine-soft); }
input[type="search"].input { padding-left: 38px; background: var(--card) no-repeat 13px 50% / 16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink);
  font-size: 14px; font-weight: 550; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 120ms ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); border-color: transparent; color: var(--on-primary); }
.btn-wa { background: #1F6E43; border-color: transparent; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-danger { color: var(--wine); border-color: color-mix(in srgb, var(--wine) 32%, transparent); background: transparent; }
.btn-dark { background: var(--ink); border-color: transparent; color: var(--paper); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: default; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); font-size: 17px;
  transition: background 140ms ease;
}
.icon-btn:active { background: var(--press); }
@media (hover: hover) {
  .btn:hover { border-color: color-mix(in srgb, var(--ink) 26%, transparent); background: color-mix(in srgb, var(--card) 94%, var(--ink)); }
  .btn-primary:hover { background: var(--primary-hover); border-color: transparent; }
  .btn-wa:hover { background: #185a36; border-color: transparent; }
  .btn-ghost:hover { background: var(--hover); border-color: transparent; color: var(--ink); }
  .btn-danger:hover { background: var(--wine-soft); }
  .btn-dark:hover { background: color-mix(in srgb, var(--ink) 88%, var(--paper)); border-color: transparent; }
  .icon-btn:hover { background: var(--hover); color: var(--ink); }
}

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.stepper button { width: 42px; height: 42px; border: 0; background: none; font-size: 18px; color: var(--ink-soft); border-radius: 999px; }
.stepper button:active { background: var(--press); }
.stepper output { min-width: 28px; text-align: center; font-family: var(--f-mono); font-size: 14px; font-variant-numeric: tabular-nums; }

.check { gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--primary); }

/* ── acceso ── */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card {
  width: 100%; max-width: 400px; display: grid; gap: 18px;
  padding: 28px 22px 24px; border-radius: 16px;
  background: var(--card); box-shadow: var(--hair);
}
.gate-title { font-size: 34px; line-height: 1.08; letter-spacing: -0.025em; }
.gate-sub { color: var(--ink-soft); }
.gate .btn-primary { min-height: 48px; font-size: 15px; }
.form-error { color: var(--wine); font-size: 14px; }

/* ── estructura ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-soft);
  padding-top: env(safe-area-inset-top);
}
.topbar-in { max-width: 920px; margin: 0 auto; padding: 11px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { font-family: var(--f-display); font-size: 19px; letter-spacing: -0.01em; }
.brand span { font-style: italic; color: var(--wine); }
.brand em {
  font: 500 10px/1 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); font-style: normal;
  margin-left: 6px; padding: 3px 6px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line); vertical-align: 3px;
}
.who { font-size: 13px; color: var(--ink-soft); text-align: right; }

.view { max-width: 920px; margin: 0 auto; padding: 20px 16px calc(var(--tabs-h) + 28px + env(safe-area-inset-bottom)); outline: none; }
.view-head { display: grid; gap: 4px; margin-bottom: 18px; }
.view-title { font-size: 30px; line-height: 1.1; letter-spacing: -0.025em; }
.view-head.row-between { display: flex; align-items: center; flex-wrap: wrap; row-gap: 10px; }

/* pestañas: barra inferior de vidrio en celular */
.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--glass-tab);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line-soft);
}
.tab {
  display: grid; justify-items: center; align-content: center; gap: 3px;
  border: 0; background: none; color: var(--ink-mute);
  font-size: 10.5px; font-weight: 550; letter-spacing: 0; min-width: 0; padding: 0 2px;
  transition: color 140ms ease;
}
.tab-ico { display: block; width: 24px; height: 24px; line-height: 1; }
.tab-ico svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--wine); }
.tab[aria-current="page"] .tab-ico svg { stroke-width: 2; }

/* escritorio: barra lateral (Linear) */
@media (min-width: 1024px) {
  .app > .topbar {
    position: fixed; top: 0; left: 0; width: var(--side-w); z-index: 31;
    background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none;
    border: 0; padding: 0;
  }
  .topbar-in { display: grid; gap: 2px; justify-content: start; padding: 22px 20px 14px; max-width: none; }
  .who { text-align: left; font-size: 12px; color: var(--ink-mute); }
  .tabs {
    position: fixed; inset: 0 auto 0 0; width: var(--side-w); height: auto; z-index: 30;
    display: flex; flex-direction: column; gap: 2px;
    padding: 86px 10px 20px;
    background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none;
    border: 0; border-right: 1px solid var(--line-soft);
  }
  .tab {
    display: flex; align-items: center; justify-content: flex-start; gap: 10px;
    min-height: 36px; padding: 6px 10px; border-radius: 8px;
    font-size: 14px; font-weight: 500; color: var(--ink-soft);
  }
  .tab-ico { width: 18px; height: 18px; }
  .tab:hover { background: var(--hover); color: var(--ink); }
  .tab[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: var(--hair); }
  .tab[aria-current="page"] .tab-ico { color: var(--wine); }
  .tab[aria-current="page"] .tab-ico svg { stroke-width: 1.8; }
  .app > .view { margin-left: var(--side-w); max-width: none; padding: 36px clamp(24px, 4vw, 56px) 56px; }
  .app > .view > * { max-width: 1040px; margin-left: auto; margin-right: auto; }
  .view-title { font-size: 34px; }
}

/* ── tarjetas y números ── */
.card { background: var(--card); border: 0; box-shadow: var(--hair); border-radius: var(--r); padding: 16px; }
.cards { display: grid; gap: 10px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--card); box-shadow: var(--hair); border-radius: var(--r); padding: 14px 14px 13px; display: grid; gap: 1px; align-content: start; }
.kpi-n { font-family: var(--f-display); font-weight: 400; font-size: 34px; line-height: 1.05; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi-l { font-size: 13px; font-weight: 550; color: var(--ink); margin-top: 4px; }
.kpi-s { font-size: 12px; color: var(--ink-mute); }
.kpi.is-wine .kpi-n { color: var(--wine); }
.kpi.is-olive .kpi-n { color: var(--olive); }

.section { margin-top: 26px; display: grid; gap: 10px; }
.section-title { font-family: var(--f-body); font-size: 16px; font-weight: 600; letter-spacing: -0.015em; display: flex; align-items: baseline; gap: 8px; }
.section-title .count { font-weight: 400; }

.bar { height: 6px; border-radius: 99px; background: var(--line-soft); overflow: hidden; display: flex; gap: 2px; }
.bar > i { display: block; height: 100%; }
.b-ok { background: var(--olive); }
.b-no { background: var(--wine); }
.b-open { background: var(--blue); }
.b-sent { background: var(--amber); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-soft); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }

/* listas dentro de tarjeta: filas densas con línea fina */
.list { display: grid; }
.card.list { padding: 0 16px; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow p { overflow: hidden; text-overflow: ellipsis; }
.list-item[data-act] { cursor: pointer; }
.card.list > .empty { padding: 22px 0; }
.quote { font-family: var(--f-display); font-style: italic; font-size: 16px; line-height: 1.45; }

/* ── insignias de estado ── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 550; letter-spacing: -0.005em; white-space: nowrap;
  background: var(--line-soft); color: var(--ink-soft);
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.st-borrador { background: transparent; color: var(--ink-mute); box-shadow: inset 0 0 0 1px var(--line); }
.st-borrador::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.st-enviada { background: var(--amber-soft); color: var(--amber); }
.st-abierta { background: var(--blue-soft); color: var(--blue); }
.st-confirmo { background: var(--olive-soft); color: var(--olive); }
.st-declino { background: var(--wine-soft); color: var(--wine); }
.chip-plain::before { display: none; }
.chip-test { background: var(--blue-soft); color: var(--blue); }
.chip-fisica { background: var(--amber-soft); color: var(--amber); }

/* ── filtros ── */
.toolbar { display: grid; gap: 10px; margin-bottom: 14px; }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none; min-height: 34px; padding: 5px 12px; border-radius: 99px;
  border: 0; box-shadow: inset 0 0 0 1px var(--line); background: transparent;
  font-size: 13px; font-weight: 500; color: var(--ink-soft);
  transition: background 140ms ease, color 140ms ease;
}
.filter[aria-pressed="true"] { background: var(--ink); box-shadow: none; color: var(--paper); }
.filter b { font-weight: 400; font-family: var(--f-mono); font-size: 11px; margin-left: 5px; opacity: 0.6; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .filter:not([aria-pressed="true"]):hover { background: var(--hover); color: var(--ink); } }
@media (min-width: 1024px) { .filters { margin: 0; padding: 0 0 2px; flex-wrap: wrap; overflow: visible; } }

/* ── invitaciones ── */
.inv {
  display: grid; gap: 6px; width: 100%; text-align: left;
  background: var(--card); box-shadow: var(--hair); border: 0; border-radius: var(--r); padding: 13px 16px;
  cursor: pointer; transition: background 120ms ease;
}
.inv:active { background: var(--press); }
@media (hover: hover) { .inv:not(.is-ordenar):hover { background: color-mix(in srgb, var(--card) 96%, var(--ink)); } }
.inv-name { font-family: var(--f-body); font-size: 15.5px; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.inv > .row-between { align-items: flex-start; }
.inv > .row-between > .row { flex: none; gap: 5px; }
.inv-people { font-size: 13px; color: var(--ink-soft); line-height: 1.4; }
.inv-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.inv-meta .btn-wa { min-height: 34px; padding: 6px 12px; font-size: 13px; margin-left: auto; }
.flag { font-size: 12px; color: var(--amber); }
.count { font-family: var(--f-mono); font-size: 12px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.empty { padding: 28px 8px; text-align: center; color: var(--ink-soft); }

/* lista de invitaciones: un solo bloque con filas (Linear) */
.cards.lista { gap: 0; background: var(--card); box-shadow: var(--hair); border-radius: var(--r); overflow: hidden; }
.cards.lista > .inv { box-shadow: none; border-radius: 0; border-bottom: 1px solid var(--line-soft); }
.cards.lista > .inv:last-child { border-bottom: 0; }
.cards.lista > .inv:focus-visible { outline-offset: -2px; }

/* ── hoja (dialog) ── */
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh;
  margin: auto auto 0; padding: 0;
  border: 0; border-radius: 16px 16px 0 0;
  background: var(--raised); color: var(--ink);
  box-shadow: var(--shadow-pop);
}
.sheet[open] { display: flex; flex-direction: column; animation: sheet-in 340ms var(--ease); }
.sheet::backdrop { background: var(--backdrop); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 16px; max-height: 86dvh; } }
@keyframes sheet-in { from { transform: translateY(28px); opacity: 0; } }
.sheet-head { position: relative; display: flex; align-items: center; gap: 8px; padding: 18px 10px 10px 20px; border-bottom: 1px solid var(--line-soft); }
.sheet-head::before { content: ''; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 99px; background: var(--line); }
@media (min-width: 640px) { .sheet-head { padding-top: 14px; } .sheet-head::before { display: none; } }
.sheet-title { flex: 1; font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; }
.sheet-head .icon-btn { width: 32px; height: 32px; font-size: 13px; background: var(--line-soft); color: var(--ink-soft); }
.sheet-body { outline: none; overflow-y: auto; padding: 16px 20px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 20px; overscroll-behavior: contain; }
.sheet-section { display: grid; gap: 10px; }
.sheet-section > h3 { font: 500 11px var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); }
.link-box { font-family: var(--f-mono); font-size: 12px; word-break: break-all; padding: 10px 12px; border-radius: var(--r-in); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-soft); }
.person { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.person:last-child { border-bottom: 0; }
.person .grow { display: grid; }
.person-name { font-size: 15px; font-weight: 500; }
.person-sub { font-size: 12px; color: var(--ink-mute); }
.star { color: var(--wine); }
.timeline { display: grid; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.pick { display: grid; gap: 6px; max-height: 46dvh; overflow-y: auto; }
.pick button { text-align: left; min-height: 44px; padding: 10px 12px; border: 0; box-shadow: inset 0 0 0 1px var(--line-soft); border-radius: var(--r-in); background: var(--card); }
@media (hover: hover) { .pick button:hover { background: var(--hover); } }
.tels { display: grid; gap: 10px; }
.tel-row { display: grid; gap: 4px; font-size: 13px; color: var(--ink-soft); }

/* ── mesas ── */
.mesas { display: grid; gap: 10px; }
@media (min-width: 640px) { .mesas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .mesas { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mesa { background: var(--card); box-shadow: var(--hair); border: 0; border-radius: var(--r); padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.mesa-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mesa-name { font-family: var(--f-body); font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.mesa.is-full .count { color: var(--olive); }
.mesa.is-over .count { color: var(--wine); font-weight: 600; }
.seats { display: flex; flex-wrap: wrap; gap: 6px; }
.seat { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 4px 6px 4px 12px; border-radius: 99px; background: var(--warm); font-size: 13px; border: 0; }
.seat span { color: var(--ink-mute); font-size: 14px; padding: 0 4px; }
.unseated { display: grid; gap: 6px; }
.unseated .seat { background: var(--card); border: 1px dashed var(--line); padding-right: 12px; }

.mesa-top { display: flex; gap: 12px; align-items: center; }
.mesa-svg { width: 80px; height: 80px; flex: none; }
.mesa-tabla { fill: var(--warm); stroke: var(--line); stroke-width: 1; }
.mesa-svg text { font: 400 20px var(--f-display); fill: var(--ink); }
.seat-off { fill: none; stroke: var(--ink-mute); stroke-width: 1.2; stroke-dasharray: 2 2; }
.seat-on { fill: var(--ink-soft); }
.seat-on.l0 { fill: var(--wine); }
.seat-on.l1 { fill: var(--olive); }
.seat-over { fill: var(--danger); }
.mesa.is-full .mesa-tabla { fill: var(--olive-soft); }
.mesa.is-over .mesa-tabla { fill: var(--wine-soft); }

/* contador de mesas */
.kpis.mini { margin-bottom: 12px; }
.kpis.mini .kpi { padding: 12px; }
.kpis.mini .kpi-n { font-size: 26px; }

/* ── personas como fichas (elegir tocando / arrastrar) ── */
.pchip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 6px 12px; border-radius: 99px;
  border: 0; box-shadow: inset 0 0 0 1px var(--line); background: var(--card);
  font-size: 13.5px; line-height: 1.2; text-align: left;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation;
  transition: background 140ms ease, box-shadow 140ms ease, color 140ms ease, transform 140ms ease;
}
.pchip::before { content: ''; width: 7px; height: 7px; border-radius: 99px; background: var(--line); flex: none; }
.pchip.l0::before, .legend-l .l0 { background: var(--wine); }
.pchip.l1::before, .legend-l .l1 { background: var(--olive); }
.pchip.is-no { text-decoration: line-through; color: var(--ink-mute); }
.pchip.is-sel { background: var(--ink); box-shadow: none; color: var(--paper); transform: translateY(-1px); }
.pchip.is-sel::before { background: var(--paper); }
@media (hover: hover) { .pchip:not(.is-sel):hover { background: var(--hover); } }
.legend-l { white-space: nowrap; margin-left: 4px; }
.legend-l i { display: inline-block; width: 7px; height: 7px; border-radius: 99px; margin: 0 4px 1px 6px; }
.selall { min-height: 30px; padding: 4px 10px; border: 1px dashed var(--line); border-radius: 99px; background: transparent; font-size: 12px; color: var(--ink-soft); }

/* bandeja "Sin mesa" agrupada por invitación */
.tray { display: grid; gap: 12px; }
.grupos { display: grid; gap: 12px; max-height: 46dvh; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.grp { display: grid; gap: 6px; }
.grp-name { font-size: 12px; color: var(--ink-mute); display: flex; align-items: center; gap: 8px; }

/* destinos: con gente elegida, mesas e invitaciones se vuelven tocables */
.mesa, .inv.is-ordenar, .tray { position: relative; }
body[data-sel-scope="mesas"] .mesa,
body[data-sel-scope="ordenar"] .inv.is-ordenar { cursor: pointer; box-shadow: 0 0 0 1px color-mix(in srgb, var(--wine) 45%, transparent), 0 0 0 4px var(--wine-soft); }
[data-drop].is-over { background: var(--wine-soft) !important; box-shadow: 0 0 0 2px var(--wine) !important; }
.inv.is-ordenar { gap: 10px; }
.newzone {
  display: grid; place-items: center; gap: 2px; min-height: 64px; padding: 12px;
  border: 1.5px dashed var(--line); border-radius: var(--r); color: var(--ink-soft); font-weight: 550; text-align: center;
}
.newzone span { font-size: 12px; font-weight: 400; color: var(--ink-mute); }
body[data-sel-scope="ordenar"] .newzone { border-color: var(--wine); color: var(--wine); cursor: pointer; }

/* "Sentar aquí" / "Pasar aquí": etiqueta flotante, no mueve el diseño al elegir gente */
.drop-cta {
  display: block; visibility: hidden; opacity: 0;
  position: absolute; right: 12px; bottom: 10px; z-index: 2; pointer-events: none;
  padding: 4px 10px; border-radius: 99px; background: var(--primary); color: var(--on-primary);
  font-size: 12px; font-weight: 550; text-align: center;
  transition: opacity 160ms ease;
}
.tray .drop-cta { left: 50%; right: auto; transform: translateX(-50%); white-space: nowrap; }
body[data-sel-scope="mesas"] .mesa .drop-cta,
body[data-sel-scope="ordenar"] .inv.is-ordenar .drop-cta,
body.is-dragging .tray .drop-cta { visibility: visible; opacity: 1; }

/* barra de selección (encima de las pestañas) */
.selbar {
  position: fixed; left: 12px; right: 12px; z-index: 40;
  bottom: calc(var(--tabs-h) + 10px + env(safe-area-inset-bottom));
  max-width: 640px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 8px 9px 16px; border-radius: 16px;
  background: var(--inv-bg); color: var(--inv-fg);
  box-shadow: var(--shadow-pop);
  animation: sel-in 260ms var(--ease);
}
.selbar p { font-size: 14px; font-weight: 500; line-height: 1.3; }
.selbar p span { font-size: 12px; font-weight: 400; opacity: 0.7; }
.selbar .btn { background: var(--inv-fill); border-color: var(--inv-line); color: var(--inv-fg); min-height: 38px; padding: 7px 12px; }
.selbar .btn-danger { color: #F2B8BE; border-color: rgba(242, 184, 190, 0.4); }
.selbar .icon-btn { color: var(--inv-fg); }
@keyframes sel-in { from { transform: translateY(16px); opacity: 0; } }
body.has-sel .view { padding-bottom: calc(var(--tabs-h) + 110px + env(safe-area-inset-bottom)); }

/* ficha que sigue al dedo al arrastrar */
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none;
  margin: -46px 0 0 -20px; padding: 8px 14px; border-radius: 99px;
  background: var(--primary); color: var(--on-primary); font-size: 14px; font-weight: 550; white-space: nowrap;
  box-shadow: var(--shadow-pop);
}
body.is-dragging { -webkit-user-select: none; user-select: none; cursor: grabbing; }

/* ── toast con "Deshacer" ── */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; align-items: center; gap: 12px;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 99px;
  background: var(--inv-bg); color: var(--inv-fg); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-pop);
  transition: opacity 200ms ease, transform 300ms var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.has-action { pointer-events: auto; padding-right: 6px; }
.toast-btn { border: 0; background: var(--inv-fill); color: #F2D3A0; font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 99px; min-height: 36px; }
body.has-sel .toast { bottom: calc(var(--tabs-h) + 92px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) {
  .toast { bottom: 24px; left: calc(50% + var(--side-w) / 2); }
  .selbar { bottom: 20px; left: calc(var(--side-w) + 24px); right: 24px; }
  body.has-sel .toast { bottom: 96px; }
}

.loading { padding: 48px 0; text-align: center; color: var(--ink-mute); }
.hint { font-size: 13px; color: var(--ink-soft); margin: -6px 0 14px; line-height: 1.45; }
.linkish { border: 0; background: none; padding: 0; color: var(--wine); text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }

/* ── plano del salón (Estación Fluvial) ── */
.seg { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--line-soft); }
.seg button { min-height: 34px; padding: 5px 16px; border: 0; border-radius: 99px; background: transparent; font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); }
.zoom { width: 36px; height: 36px; border: 0; box-shadow: inset 0 0 0 1px var(--line); background: var(--card); color: var(--ink); font-size: 19px; }
.plano-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 26px; flex-wrap: wrap; }
.solo-movil { font-weight: 500; color: var(--ink); }
@media (min-width: 1000px) { .solo-movil { display: none; } }
.plano-hint { margin: 8px 0 0; }

/* el dibujo del lugar va siempre en claro */
.plano-wrap {
  --paper: #F4F1E8; --card: #FBFAF6; --warm: #EFE8D7;
  --ink: #1A1814; --ink-soft: rgba(26, 24, 20, 0.66); --ink-mute: rgba(26, 24, 20, 0.44);
  --line: rgba(26, 24, 20, 0.12); --line-soft: rgba(26, 24, 20, 0.07);
  --wine: #722F37; --wine-soft: rgba(114, 47, 55, 0.09); --olive: #6B7C5A; --blue: #3F5A73;
  color-scheme: light;
  overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  margin: 10px -16px 8px; padding: 6px 16px;
  background: var(--card); border-block: 1px solid var(--line-soft);
}
@media (min-width: 640px) { .plano-wrap { margin-inline: 0; border: 0; box-shadow: var(--hair); border-radius: var(--r); } }
.plano { display: block; max-width: none; touch-action: pan-x pan-y; }
.pl-muro { fill: var(--paper); stroke: var(--ink-soft); stroke-width: 4; stroke-linejoin: round; }
.pl-deco rect, .pl-deco circle { fill: var(--warm); stroke: var(--line); stroke-width: 2; }
.pl-deco text { font: 500 26px var(--f-mono); letter-spacing: 0.12em; fill: var(--ink-mute); text-anchor: middle; }
.pl-deco text.sm { font-size: 18px; }
.pl-deco text.ent { fill: var(--wine); }
.pl-g { cursor: pointer; }
.pl-g:focus { outline: none; }
.pl-g:focus-visible .pl-mesa { stroke: var(--wine); stroke-width: 5; }
.pl-mesa { fill: var(--card); stroke: var(--ink-soft); stroke-width: 2.5; transition: fill 160ms ease; }
.est-parcial .pl-mesa { fill: #F1E6CF; }
.est-llena .pl-mesa { fill: #DCE3D2; stroke: var(--olive); }
.est-pasada .pl-mesa { fill: #F2D9DB; stroke: var(--wine); }
.pl-silla { fill: var(--paper); stroke: var(--ink-mute); stroke-width: 1.6; }
.pl-silla.is-on { fill: var(--ink-soft); stroke: none; }
.pl-silla.is-on.l0 { fill: var(--wine); }
.pl-silla.is-on.l1 { fill: var(--olive); }
.pl-silla.is-over { fill: #B23A3A; stroke: none; }
.pl-num { font: 400 26px var(--f-display); fill: var(--ink); text-anchor: middle; pointer-events: none; }
.pl-num.is-chica { font: 500 17px var(--f-mono); }
.pl-cnt { font: 400 15px var(--f-mono); fill: var(--ink-soft); text-anchor: middle; pointer-events: none; }
body[data-sel-scope="mesas"] .pl-mesa { stroke: var(--wine); stroke-dasharray: 6 4; }
.pl-g.is-over .pl-mesa { fill: var(--wine-soft); stroke: var(--wine); stroke-width: 6; stroke-dasharray: none; }
.pl-k { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(26, 24, 20, 0.14); }
.pl-k.vacia { background: #FBFAF6; } .pl-k.parcial { background: #F1E6CF; } .pl-k.llena { background: #DCE3D2; } .pl-k.pasada { background: #F2D9DB; }

/* plano: colocar y mover mesas */
.plano-aviso {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 10px; padding: 10px 12px 10px 14px; border-radius: var(--r);
  background: var(--inv-bg); color: var(--inv-fg); font-size: 14px;
}
.plano-aviso .btn { background: var(--inv-fill); border-color: var(--inv-line); color: var(--inv-fg); min-height: 38px; }
.plano-aviso .row { flex-wrap: nowrap; }
.plano.is-colocar { cursor: crosshair; }
.plano.is-colocar .pl-g { pointer-events: none; opacity: 0.75; }
.pl-ghost { pointer-events: none; opacity: 0.7; }
.pl-ghost .pl-mesa { fill: var(--wine-soft); stroke: var(--wine); stroke-dasharray: 6 4; }
.plano.is-mover .pl-g { cursor: grab; }
.plano.is-mover .pl-g.is-moving { cursor: grabbing; }
.plano.is-mover .pl-g.is-moving .pl-mesa { stroke: var(--ink); stroke-width: 5; filter: drop-shadow(0 6px 10px rgba(26, 24, 20, 0.25)); }
.plano.is-mover .pl-mesa { stroke-dasharray: 3 3; }
.pl-choque .pl-mesa { stroke: #B23A3A !important; stroke-width: 5 !important; stroke-dasharray: none !important; }
.pl-choque .pl-silla:not(.is-on) { stroke: #B23A3A; }
.pl-k.choque { background: #FBFAF6; border: 2px solid #B23A3A; }

/* tamaño de mesas */
.pl-manija { fill: var(--wine); stroke: #FBFAF6; stroke-width: 3; cursor: nwse-resize; }
.pl-g.is-sel .pl-mesa { stroke: var(--wine); stroke-width: 4; stroke-dasharray: none; }

/* pasillos de circulación */
.pl-pasillo polygon { fill: rgba(63, 90, 115, 0.10); stroke: var(--blue); stroke-width: 2; stroke-dasharray: 8 6; }
.pl-pasillo text { font: 500 13px var(--f-mono); letter-spacing: 0.14em; fill: var(--blue); text-anchor: middle; pointer-events: none; }
.plano.is-mover .pl-pasillo { cursor: pointer; }
.pl-pasillo.is-sel polygon { fill: rgba(63, 90, 115, 0.2); stroke-width: 3; stroke-dasharray: none; }
.pl-manija.pas { fill: var(--blue); cursor: move; }
.pl-k.pasillo { background: rgba(63, 90, 115, 0.15); border: 1px dashed #3F5A73; }

@media (prefers-reduced-motion: reduce) {
  .sheet[open], .selbar { animation: none; }
  .toast { transition: opacity 150ms ease; }
  .pchip, .btn, .inv { transition: none; }
}

.mesas > .empty { grid-column: 1 / -1; }

/* ── buscar (⌘K o /) ── */
.topbar-in .who { margin-left: auto; }
.buscar {
  display: inline-grid; place-items: center; flex: none;
  width: 38px; height: 38px; padding: 0; border: 0; border-radius: 999px;
  background: var(--line-soft); color: var(--ink-soft);
}
.buscar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.buscar span, .buscar kbd { display: none; }
.buscar:active { background: var(--press); }
kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line); background: var(--card);
  font: 500 11px/1 var(--f-mono); color: var(--ink-mute);
}
@media (min-width: 1024px) {
  .topbar-in { gap: 10px; }
  .topbar-in .who { margin-left: 0; }
  .buscar {
    display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 8px 0 10px; margin-top: 8px;
    border-radius: 8px; background: var(--card); box-shadow: var(--hair); font-size: 13px; color: var(--ink-mute); text-align: left;
  }
  .buscar svg { width: 15px; height: 15px; }
  .buscar span { display: block; flex: 1; }
  .buscar kbd { display: inline-grid; }
  .buscar:hover { color: var(--ink-soft); }
  .tabs { padding-top: 150px; }
}
.bres { display: grid; gap: 2px; max-height: 58dvh; overflow-y: auto; overscroll-behavior: contain; margin: 0 -8px; }
.bres-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 10px;
  border: 0; border-radius: 8px; background: transparent; text-align: left;
}
.bres-item .grow { display: grid; gap: 1px; }
.bres-item b { font-weight: 600; font-size: 15px; }
.bres-item.is-cmd { min-height: 42px; color: var(--ink-soft); }
.bres-item.is-cmd::before { content: '→'; color: var(--ink-mute); font-size: 13px; }
.bres-item.is-act { background: var(--wine-soft); color: var(--ink); }
@media (hover: hover) { .bres-item:hover { background: var(--hover); } .bres-item.is-act:hover { background: var(--wine-soft); } }
.solo-escritorio { display: none; }
@media (hover: hover) and (min-width: 900px) { .solo-escritorio { display: block; } }

/* ── para hacer (resumen) ── */
.todo .card.list { padding: 0; overflow: hidden; }
.todo-item {
  width: 100%; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left;
  padding: 13px 14px 13px 16px; gap: 12px; transition: background 120ms ease;
}
.todo-item:active { background: var(--press); }
@media (hover: hover) { .todo-item:hover { background: var(--hover); } }
.todo-item .grow { display: grid; gap: 1px; }
.todo-t { font-size: 15px; font-weight: 600; letter-spacing: -0.012em; }
.todo-s { font-size: 13px; color: var(--ink-soft); }
.todo-chev { font-size: 20px; line-height: 1; color: var(--ink-mute); }
.todo-dot { flex: none; width: 8px; height: 8px; border-radius: 99px; background: var(--ink-mute); }
.todo-dot.t-wine { background: var(--wine); box-shadow: 0 0 0 4px var(--wine-soft); }
.todo-dot.t-amber { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.todo-dot.t-olive { background: var(--olive); box-shadow: 0 0 0 4px var(--olive-soft); }
.todo-ok { color: var(--ink-soft); font-size: 14px; }

/* ── invitaciones: orden y cola ── */
.toolbar-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.cola-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  min-height: 48px; padding: 10px 14px 10px 16px; border: 0; border-radius: var(--r);
  background: var(--wine-soft); color: var(--wine); font-size: 14px; text-align: left;
}
.cola-cta b { font-weight: 600; }
.cola-cta > span:last-child { font-size: 20px; line-height: 1; }
@media (hover: hover) { .cola-cta:hover { background: color-mix(in srgb, var(--wine) 14%, transparent); } }

/* ── cola de envío / recordatorios ── */
.cola-top { display: flex; justify-content: space-between; }
.cola-card { display: grid; gap: 8px; padding: 16px; border-radius: var(--r); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-soft); }
.cola-name { font-family: var(--f-display); font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; }
.cola-msg {
  margin-top: 4px; padding: 12px 14px; border-radius: 4px 14px 14px 14px;
  background: var(--card); box-shadow: var(--hair);
  font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.cola-wa { min-height: 52px; font-size: 16px; }
.cola-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.cola-nav > :first-child { justify-self: start; }
.cola-nav > :last-child { justify-self: end; }
.cola-fin { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 18px 0 6px; }
.cola-fin-n { font-family: var(--f-display); font-size: 64px; line-height: 1; letter-spacing: -0.04em; color: var(--olive); }
.cola-fin .row { margin-top: 14px; justify-content: center; }

/* ── ficha: anterior / siguiente ── */
.sheet-nav { display: flex; align-items: center; gap: 0; flex: none; }
.sheet-nav .icon-btn { width: 34px; height: 34px; font-size: 22px; line-height: 1; padding-bottom: 3px; }
.sheet-nav .icon-btn:disabled { opacity: 0.3; cursor: default; }
.sheet-nav .count { min-width: 52px; text-align: center; }
@media (max-width: 380px) { .sheet-nav .count { display: none; } }
