@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Bricolage+Grotesque:wght@600;700;800&family=Kalam:wght@700&display=swap');

:root {
  color-scheme: light;
  --radius: 1rem;

  --cream: oklch(0.985 0.006 84);
  --ink: oklch(0.28 0.028 58);
  --ink-soft: oklch(0.52 0.03 62);
  --line: oklch(0.92 0.012 78);

  --background: oklch(0.995 0.004 84);
  --foreground: oklch(0.28 0.028 58);
  --card: oklch(1 0 0);

  --muted: oklch(0.94 0.025 82);
  --muted-foreground: oklch(0.52 0.03 62);

  --brick: oklch(0.55 0.175 27);
  --primary-foreground: oklch(0.98 0.012 84);
  --mustard: oklch(0.8 0.14 82);
  --mustard-tint: oklch(0.94 0.06 88);
  --forest: oklch(0.52 0.1 156);
  --forest-tint: oklch(0.93 0.04 156);
  --brick-tint: oklch(0.93 0.045 30);
  --whatsapp: oklch(0.62 0.13 155);
  --whatsapp-tint: oklch(0.93 0.045 155);

  --cork: oklch(0.68 0.05 68);
  --cork-fleck-a: oklch(0.56 0.055 65 / 0.4);
  --cork-fleck-b: oklch(0.82 0.035 78 / 0.5);
  --frame-wood: oklch(0.33 0.045 55);
  --paper: oklch(0.985 0.012 85);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }

body {
  background: var(--background);
  background-image: radial-gradient(color-mix(in oklch, var(--ink) 5%, transparent) 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--foreground);
  font-family: 'Instrument Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .font-display {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--brick); color: var(--primary-foreground); }

.wrap {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 640px) {
  .wrap { padding: 0 1.5rem; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px dashed var(--line);
  background: var(--cream);
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 0.6rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.brand-logo {
  position: relative;
  display: grid;
  place-items: center;
  height: 2.3rem;
  width: 2.3rem;
  flex: none;
  margin: 0.2rem 0.15rem 0.2rem 0;
  border-radius: 999px;
  background: var(--brick);
  color: var(--primary-foreground);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  transform: rotate(-5deg);
  box-shadow: 0 0 0 3px var(--background), 3px 4px 8px oklch(0.25 0.03 50 / 0.3);
}
.brand-logo::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 1.5px dashed color-mix(in oklch, var(--brick) 55%, transparent);
}
.brand-name { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; white-space: nowrap; }
.brand-sub {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; font-weight: 500; color: var(--ink-soft);
}
.brand-sub svg { flex: none; color: var(--brick); }
.nav-links { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pill-link {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
}
.pill-link:hover { border-color: var(--brick); color: var(--brick); }
.pill-link.active { background: var(--ink); border-color: var(--ink); color: var(--background); }
.pill-link.pill-cta { background: var(--brick); border-color: var(--brick); color: var(--primary-foreground); }
.pill-link.pill-cta:hover { background: var(--brick); color: var(--primary-foreground); opacity: 0.9; }

/* ---------- Hero ---------- */
.hero { padding-top: 1.5rem; }
.hero-grid { display: grid; gap: 2rem; align-items: end; }
@media (min-width: 768px) {
  .hero-grid { grid-template-columns: 1.5fr 1fr; }
}
.hero h1 {
  margin: 0;
  font-size: 2.1rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em;
}
@media (min-width: 640px) { .hero h1 { font-size: 3rem; } }
.hero h1 .accent { position: relative; color: var(--ink); white-space: nowrap; }
.hero h1 .accent::after {
  content: ""; position: absolute; left: -0.1em; right: -0.1em; bottom: 0.03em; height: 0.32em;
  background: var(--mustard); opacity: 0.55; z-index: -1; transform: rotate(-1deg);
}
.hero p { margin-top: 1.1rem; max-width: 34rem; font-size: 1rem; line-height: 1.6; color: var(--ink-soft); }

.stat-panel {
  position: relative;
  margin-top: 1.5rem;
  border-radius: 0.3rem;
  background: var(--paper);
  padding: 1.35rem 1.25rem;
  box-shadow: 3px 6px 16px oklch(0.25 0.03 50 / 0.22);
  transform: rotate(-0.8deg);
}
@media (min-width: 768px) { .stat-panel { margin-top: 0; } }
.stat-panel .label {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; font-weight: 700; color: var(--ink-soft);
}
.live-dot {
  height: 0.5rem; width: 0.5rem; border-radius: 999px; background: var(--forest);
  animation: pulse-ring 2s infinite;
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--forest) 45%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.stat-panel::before {
  content: "";
  position: absolute; top: -0.6rem; left: 50%; transform: translateX(-50%);
  height: 1.05rem; width: 1.05rem; border-radius: 999px;
  background: radial-gradient(circle at 32% 30%, oklch(0.92 0.03 30), oklch(0.55 0.19 25) 62%, oklch(0.33 0.15 20) 100%);
  box-shadow: 0 2px 3px oklch(0.2 0.02 40 / 0.55);
}
.stat-panel .stat-line { margin-top: 0.9rem; font-size: 0.95rem; line-height: 1.6; color: var(--ink); }
.stat-panel .stat-line strong { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.05rem; font-weight: 800; color: var(--brick); }
.stat-panel .stat-sep { margin: 0 0.4rem; color: var(--ink-soft); }

/* ---------- Search / filters ---------- */
.search-section { position: sticky; top: 60px; z-index: 20; margin-top: 1.5rem; }
@media (min-width: 1024px) { .search-section { position: static; } }
.search-card {
  border-radius: 1rem; border: 1px solid var(--line);
  background: var(--card);
  padding: 0.75rem;
  box-shadow: 3px 6px 16px oklch(0.25 0.03 50 / 0.16);
}
.search-input-wrap {
  display: flex; align-items: center; gap: 0.6rem;
  border-radius: 0.7rem; background: var(--background);
  padding: 0.75rem 1rem;
}
.search-input-wrap input {
  width: 100%; border: none; background: transparent; outline: none;
  font-size: 1rem; color: var(--ink);
}
.search-input-wrap input::placeholder { color: color-mix(in oklch, var(--ink-soft) 70%, transparent); }
.search-input-wrap svg { flex: none; color: var(--ink-soft); }

.type-tabs { margin-top: 0.85rem; display: flex; gap: 1.35rem; border-bottom: 1px solid var(--line); padding: 0 0.25rem; }
.type-tabs button {
  border: none; background: transparent; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 0.55rem 0.1rem; font-size: 0.9rem; font-weight: 700; color: var(--ink-soft);
  transition: all .15s;
}
.type-tabs button.active { color: var(--brick); border-bottom-color: var(--brick); }

.chip-row { position: relative; margin-top: 0.75rem; }
.chip-scroll { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: flex; align-items: center; gap: 0.5rem;
  border-radius: 0.65rem; border: 1px solid var(--line); background: var(--background);
  padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 600; color: var(--ink);
  transition: all .1s;
}
.chip:hover { border-color: color-mix(in oklch, var(--ink) 40%, transparent); }
.chip.active { background: var(--brick); border-color: var(--brick); color: var(--primary-foreground); }
.chip .dot { height: 0.5rem; width: 0.5rem; border-radius: 999px; }

/* ---------- Results ---------- */
.results-section { padding-top: 2rem; padding-bottom: 2.5rem; }
.results-head { margin-bottom: 1rem; display: flex; align-items: baseline; justify-content: space-between; }
.results-head h2 { margin: 0; font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }
.results-count { font-size: 0.875rem; font-weight: 500; color: var(--ink-soft); }

.empty-state {
  border-radius: 1rem; border: 1px dashed var(--line);
  background: color-mix(in oklch, var(--card) 50%, transparent);
  padding: 3rem 1.5rem; text-align: center;
}
.empty-state .big-icon {
  display: grid; place-items: center; margin: 0 auto 1rem; height: 3.5rem; width: 3.5rem;
  border-radius: 999px; background: var(--mustard-tint); color: color-mix(in oklch, var(--ink) 70%, transparent);
}
.empty-state h3 { margin: 0 0 0.4rem; font-size: 1.05rem; font-weight: 700; }
.empty-state p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.5; }

.card-grid { column-count: 1; column-gap: 1rem; }
@media (min-width: 640px) { .card-grid { column-count: 2; } }
.card-grid > .biz-card { break-inside: avoid; margin-bottom: 1rem; }

.biz-card {
  position: relative; display: flex; flex-direction: column; gap: 0.9rem;
  border-radius: 1.1rem;
  background:
    radial-gradient(color-mix(in oklch, var(--ink) 4%, transparent) 1px, transparent 1px) 0 0 / 16px 16px,
    var(--card);
  padding: 1.6rem 1.25rem 1.25rem;
  box-shadow: 0 14px 28px -20px oklch(0.28 0.03 60 / 0.55), 0 1px 0 oklch(1 0 0 / 0.6) inset, 0 0 0 1px var(--line);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
/* Cinta pegada arriba, como las notas del tablón del barrio */
.biz-card::before {
  content: "";
  position: absolute; top: -0.5rem; left: 1.4rem;
  width: 2.4rem; height: 1rem;
  background: var(--mustard);
  opacity: 0.55;
  border-radius: 1px;
  transform: rotate(-5deg);
  box-shadow: 0 1px 3px oklch(0.25 0.03 50 / 0.2);
}
.card-grid > .biz-card:nth-child(3n+2)::before { left: auto; right: 1.7rem; background: var(--forest); transform: rotate(4deg); }
.card-grid > .biz-card:nth-child(3n+3)::before { left: 2.6rem; background: var(--brick); opacity: 0.4; transform: rotate(-2deg); }
/* Giro sutil por tarjeta, como los avisos del corcho */
.card-grid > .biz-card:nth-child(4n+1) { transform: rotate(-0.5deg); }
.card-grid > .biz-card:nth-child(4n+2) { transform: rotate(0.4deg); }
.card-grid > .biz-card:nth-child(4n+3) { transform: rotate(-0.35deg); }
.card-grid > .biz-card:nth-child(4n+4) { transform: rotate(0.5deg); }
.biz-card:hover { transform: rotate(0deg) translateY(-3px); box-shadow: 0 18px 32px -18px oklch(0.28 0.03 60 / 0.55), 0 1px 0 oklch(1 0 0 / 0.6) inset, 0 0 0 1px var(--line); }
@media (prefers-reduced-motion: reduce) { .biz-card { transition: none; } .biz-card:hover { transform: none; } }
.biz-card .top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.biz-card .head { display: flex; align-items: center; gap: 0.85rem; }
.biz-card .avatar {
  position: relative; display: grid; place-items: center;
  height: 3.4rem; width: 3.4rem; flex: none; border-radius: 999px;
}
.biz-card .avatar::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 999px;
  border: 1.5px dashed color-mix(in oklch, var(--ink) 20%, transparent);
}
.biz-card .avatar .avatar-icon { display: block; }
.biz-card .name { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1rem; font-weight: 700; line-height: 1.2; }
.biz-card .cat-label { margin-top: 0.25rem; font-size: 0.74rem; font-weight: 700; }
.badge-open, .badge-closed {
  position: relative; display: flex; flex: none; align-items: center; gap: 0.4rem;
  transform: rotate(-3deg);
  border-radius: 0.4rem;
  padding: 0.32rem 0.6rem 0.32rem 0.95rem;
  font-size: 0.7rem; font-weight: 700;
  box-shadow: 2px 3px 6px oklch(0.25 0.03 50 / 0.2);
}
.badge-open::before, .badge-closed::before {
  content: ""; position: absolute; left: 0.4rem; top: 50%; transform: translateY(-50%);
  width: 0.28rem; height: 0.28rem; border-radius: 999px;
  background: oklch(1 0 0 / 0.85); box-shadow: inset 0 0 0 1px oklch(0.3 0.02 50 / 0.3);
}
.badge-open { background: var(--forest-tint); color: var(--forest); }
.badge-closed { background: var(--muted); color: var(--ink-soft); }
.biz-card .desc { font-size: 0.875rem; line-height: 1.5; color: var(--ink-soft); }
.biz-card .meta {
  display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.75rem; color: var(--ink-soft);
  padding-top: 0.75rem; border-top: 1px dashed var(--line);
}
.biz-card .meta span { display: flex; align-items: center; gap: 0.35rem; }
.biz-card .meta svg { flex: none; }
.biz-card .meta .meta-horario svg { color: color-mix(in oklch, var(--mustard) 55%, var(--ink-soft) 45%); transform: rotate(-6deg); }
.biz-card .meta .meta-direccion svg { color: var(--brick); transform: rotate(-4deg); }
.biz-card .actions { margin-top: auto; display: flex; align-items: center; gap: 0.5rem; padding-top: 0.25rem; }
.btn-call {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: 0.85rem; border: none; background: var(--brick); color: var(--primary-foreground);
  padding: 0.65rem 1rem; font-size: 0.875rem; font-weight: 700;
}
.btn-wa {
  display: grid; place-items: center; flex: none; height: 2.75rem; width: 2.75rem;
  border-radius: 999px; background: var(--whatsapp-tint); color: var(--whatsapp);
}

.highlight-card {
  animation: highlightPulse 2.6s ease-out;
}
@keyframes highlightPulse {
  0% { box-shadow: 0 0 0 3px var(--brick); }
  70% { box-shadow: 0 0 0 3px var(--brick); }
  100% { box-shadow: 0 2px 12px -4px oklch(0.28 0.03 60 / 0.12); }
}

/* ---------- Community board (JAC) ---------- */
.tablon-heading {
  display: flex; align-items: center; gap: 0.65rem;
  margin: 0.5rem 0 0; font-family: 'Kalam', cursive; font-weight: 700;
  font-size: 2.1rem; line-height: 1.1; letter-spacing: -0.01em; color: var(--ink);
}
.tablon-heading svg { flex: none; color: var(--brick); transform: rotate(-6deg); }
@media (min-width: 640px) { .tablon-heading { font-size: 2.5rem; } }

.board-section { padding-top: 1.5rem; padding-bottom: 2rem; }
.board-panel {
  position: relative;
  border-radius: 1.25rem;
  border: 10px solid var(--frame-wood);
  padding: 2rem 1rem 1.5rem;
  background:
    radial-gradient(var(--cork-fleck-a) 1px, transparent 1.5px) 0 0 / 15px 15px,
    radial-gradient(var(--cork-fleck-b) 1px, transparent 1.5px) 7px 8px / 19px 19px,
    var(--cork);
  box-shadow: inset 0 3px 14px oklch(0.25 0.03 50 / 0.4), 0 16px 32px -18px oklch(0.28 0.03 60 / 0.45);
}
@media (min-width: 640px) { .board-panel { padding: 2.5rem 2rem 2rem; } }

.notice-grid { column-count: 1; column-gap: 1.3rem; }
@media (min-width: 640px) { .notice-grid { column-count: 2; } }
@media (min-width: 960px) { .notice-grid { column-count: 3; } }

/* Estilo base funcional: lo usa también el panel de administración de la JAC */
.notice {
  position: relative; border-radius: 0.2rem; background: var(--paper);
  padding: 1.1rem 1.15rem; box-shadow: 0 1px 3px oklch(0.25 0.03 50 / 0.18);
}
.notice .row { margin-bottom: 0.5rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.notice .tag { border-radius: 0.2rem; padding: 0.25rem 0.6rem; font-size: 0.68rem; font-weight: 700; }
.notice .fecha { font-size: 0.7rem; color: var(--ink-soft); }
.notice h3 { margin: 0; font-family: 'Bricolage Grotesque', sans-serif; font-size: 0.95rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.notice p { margin: 0.45rem 0 0; font-size: 0.875rem; line-height: 1.5; color: var(--ink-soft); overflow-wrap: anywhere; }
.notice-toggle { display: block; margin-top: 0.5rem; background: none; border: none; padding: 0; font-size: 0.78rem; font-weight: 700; color: var(--brick); text-decoration: underline; cursor: pointer; }

/* Nota pegada al corcho: solo en el tablón público, no en el panel de administración */
.board-panel .notice {
  break-inside: avoid; margin: 0 0 1.6rem;
  padding: 1.7rem 1.15rem 1.2rem;
  box-shadow: 3px 6px 14px oklch(0.25 0.03 50 / 0.32), 0 1px 0 oklch(1 0 0 / 0.6) inset;
  transition: transform 0.15s ease;
}
.board-panel .notice::before {
  content: ""; position: absolute; top: -0.65rem; left: 50%; transform: translateX(-50%);
  height: 1.15rem; width: 1.15rem; border-radius: 999px;
  background: radial-gradient(circle at 32% 30%, oklch(0.92 0.03 30), oklch(0.55 0.19 25) 62%, oklch(0.33 0.15 20) 100%);
  box-shadow: 0 2px 3px oklch(0.2 0.02 40 / 0.55);
}
.board-panel .notice:nth-child(4n+1) { transform: rotate(-1.4deg); }
.board-panel .notice:nth-child(4n+2) { transform: rotate(1deg); }
.board-panel .notice:nth-child(4n+3) { transform: rotate(-0.5deg); }
.board-panel .notice:nth-child(4n+4) { transform: rotate(0.9deg); }
.board-panel .notice:hover { transform: rotate(0deg); z-index: 2; }
@media (prefers-reduced-motion: reduce) { .board-panel .notice { transition: none; } }
.board-panel .notice .tag { box-shadow: 1px 2px 3px oklch(0.25 0.03 50 / 0.2); }
.board-panel .notice h3 { font-family: 'Kalam', cursive; font-size: 1.2rem; font-weight: 700; line-height: 1.25; }

.board-panel .empty-state { background: var(--paper); border-radius: 0.2rem; box-shadow: 3px 6px 14px oklch(0.25 0.03 50 / 0.3); break-inside: avoid; }

.tag-convocatoria { background: var(--forest-tint); color: var(--forest); }
.tag-aviso { background: var(--mustard-tint); color: oklch(0.45 0.1 75); }
.tag-alerta { background: var(--brick-tint); color: var(--brick); }

/* ---------- CTA / footer ---------- */
.cta-panel {
  overflow: hidden; border-radius: 1.5rem; background: var(--brick); color: var(--primary-foreground);
  padding: 2rem 1.5rem;
}
@media (min-width: 640px) { .cta-panel { padding: 2.5rem 2rem; } }
.cta-panel h2 { margin: 0; max-width: 28rem; font-size: 1.5rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; }
.cta-btn {
  margin-top: 1.25rem; display: inline-flex; align-items: center; gap: 0.5rem;
  border-radius: 999px; background: var(--card); color: var(--brick);
  padding: 0.75rem 1.25rem; font-size: 0.875rem; font-weight: 700;
  transform: rotate(-1deg);
  box-shadow: 2px 3px 0 oklch(0.3 0.02 40 / 0.25);
}
.site-footer { padding-top: 2rem; padding-bottom: 3rem; }
.footer-note { margin-top: 1.5rem; text-align: center; font-size: 0.75rem; color: var(--ink-soft); }

/* ---------- Simple page header for JAC ---------- */
.page-title-block { padding-top: 2rem; padding-bottom: 0.5rem; }
.page-title-block h1 { margin: 0.6rem 0 0; font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; }
.page-title-block p { margin-top: 0.75rem; max-width: 34rem; color: var(--ink-soft); line-height: 1.6; }
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.back-link:hover { color: var(--brick); }

.cta-login-note { margin: 0.85rem 0 0; font-size: 0.8rem; color: color-mix(in oklch, var(--primary-foreground) 85%, transparent); }
.cta-login-note a { text-decoration: underline; font-weight: 700; color: var(--primary-foreground); }

/* ==========================================================================
   PANEL DE COMERCIANTE — registro / ingreso / panel
   ========================================================================== */
.auth-shell { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 90px); padding-top: 2rem; padding-bottom: 2rem; }
.auth-card {
  width: 100%; max-width: 26rem; margin: 0 auto; border-radius: 1.5rem; border: 1px solid var(--line);
  background: var(--card); padding: 1.75rem; box-shadow: 0 8px 30px -12px oklch(0.28 0.03 60 / 0.2);
}
.auth-card .kicker { margin: 0; font-size: 0.82rem; font-weight: 700; color: var(--brick); }
.auth-card h1 { margin: 0.5rem 0 0.35rem; font-size: 1.4rem; font-weight: 800; letter-spacing: -0.01em; }
.auth-card > p.lead { margin: 0 0 1.25rem; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.5; }

.field { margin-bottom: 1.1rem; }
.field label { display: block; margin-bottom: 0.4rem; font-size: 0.82rem; font-weight: 700; color: var(--ink); }
.field .hint { display: block; margin-top: 0.35rem; font-size: 0.75rem; color: var(--ink-soft); }
.field input[type="text"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%; border-radius: 0.85rem; border: 1px solid var(--line); background: var(--background);
  padding: 0.75rem 0.9rem; font-size: 0.95rem; font-family: inherit; color: var(--ink); outline: none;
  overflow-wrap: anywhere;
}
.field textarea { resize: vertical; min-height: 5rem; word-break: break-word; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brick); }
.field-count { display: block; margin-top: 0.3rem; text-align: right; font-size: 0.72rem; color: var(--ink-soft); }

.tipo-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.tipo-choice label {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; cursor: pointer;
  border-radius: 0.85rem; border: 1px solid var(--line); background: var(--background);
  padding: 0.75rem 0.5rem; font-size: 0.88rem; font-weight: 700; color: var(--ink-soft); text-align: center;
}
.tipo-choice input { position: absolute; opacity: 0; pointer-events: none; }
.tipo-choice input:checked + span { color: inherit; }
.tipo-choice label:has(input:checked) { border-color: var(--brick); background: var(--brick-tint); color: var(--brick); }

.tag-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.tag-choice label {
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border-radius: 0.85rem; border: 1px solid var(--line); background: var(--background);
  padding: 0.65rem 0.4rem; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); text-align: center;
}
.tag-choice input { position: absolute; opacity: 0; pointer-events: none; }
.tag-choice label:has(input:checked) { border-color: var(--brick); background: var(--brick-tint); color: var(--brick); }

.btn-mini {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  padding: 0.45rem 0.85rem; font-size: 0.78rem; font-weight: 700; color: var(--ink);
}
.btn-mini-danger { color: var(--brick); border-color: var(--brick-tint); background: var(--brick-tint); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-radius: 0.85rem; border: 1px solid var(--line); background: var(--background); padding: 0.75rem 1rem; margin-bottom: 1.1rem; }
.switch-row .txt { font-size: 0.88rem; }
.switch-row .txt strong { display: block; font-weight: 700; color: var(--ink); }
.switch-row .txt span { font-size: 0.78rem; color: var(--ink-soft); }
.switch { position: relative; flex: none; display: inline-block; width: 2.75rem; height: 1.6rem; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--muted); transition: .15s; }
.switch .track::before { content: ""; position: absolute; height: 1.2rem; width: 1.2rem; left: 0.2rem; top: 0.2rem; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .15s; }
.switch input:checked + .track { background: var(--forest); }
.switch input:checked + .track::before { transform: translateX(1.15rem); }

.btn-primary {
  display: flex; width: 100%; align-items: center; justify-content: center; gap: 0.5rem;
  border: none; border-radius: 999px; background: var(--brick); color: var(--primary-foreground);
  padding: 0.85rem 1rem; font-size: 0.95rem; font-weight: 700;
}
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink);
  padding: 0.6rem 1rem; font-size: 0.85rem; font-weight: 700;
}
.auth-foot { margin-top: 1.25rem; text-align: center; font-size: 0.85rem; color: var(--ink-soft); }
.auth-foot a { font-weight: 700; color: var(--brick); }

.alert { border-radius: 0.85rem; padding: 0.8rem 1rem; font-size: 0.85rem; margin-bottom: 1.1rem; line-height: 1.45; }
.alert-error { background: var(--brick-tint); color: var(--brick); }
.alert-success { background: var(--forest-tint); color: var(--forest); }
.recovery-code-box {
  margin-top: 0.7rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  border-radius: 0.7rem; background: var(--card); padding: 0.65rem 0.9rem;
}
.recovery-code-box code { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.05rem; font-weight: 800; letter-spacing: 0.04em; color: var(--ink); }

/* Panel header (comerciante logueado) */
.panel-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid color-mix(in oklch, var(--line) 70%, transparent); background: color-mix(in oklch, var(--background) 85%, transparent); backdrop-filter: blur(10px); }
.panel-header .inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; row-gap: 0.4rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.panel-header .who { font-size: 0.85rem; min-width: 0; max-width: 55%; text-align: right; }
.panel-header .who strong { display: block; font-family: 'Bricolage Grotesque', sans-serif; font-size: 1rem; overflow-wrap: break-word; }
.panel-header .who span { color: var(--ink-soft); font-size: 0.78rem; }

.completion-banner { display: flex; align-items: flex-start; gap: 0.75rem; border-radius: 1rem; background: var(--mustard-tint); color: oklch(0.4 0.1 75); padding: 1rem 1.1rem; margin-bottom: 1.25rem; font-size: 0.85rem; line-height: 1.5; }
.completion-banner strong { display: block; margin-bottom: 0.15rem; font-size: 0.9rem; }

.panel-card { border-radius: 1.5rem; border: 1px solid var(--line); background: var(--card); padding: 1.5rem; box-shadow: 0 2px 12px -4px oklch(0.28 0.03 60 / 0.1); }
.panel-card h2 { margin: 0 0 1.25rem; font-size: 1.1rem; font-weight: 800; letter-spacing: -0.01em; }
.panel-section-title { margin: 1.75rem 0 1rem; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.panel-section-title:first-child { margin-top: 0; }