/* Paleta de huerta: hoja (verde), berenjena (morado), tomate (rojo) y blanco. */
:root {
  --bg: #f6faf2;           /* blanco con un toque de hoja */
  --surface: #ffffff;
  --surface-2: #ebf3e4;    /* verde muy claro */
  --text: #1f2a1d;
  --muted: #66735f;
  --line: #dbe7d2;
  --primary: #5b2a86;      /* berenjena */
  --primary-ink: #ffffff;
  --leaf: #2f6b34;         /* verde hoja: cabecera, barra del móvil */
  --leaf-ink: #ffffff;
  --green: #2f7d32;
  --green-bg: #e3f1dc;
  --tomato: #d23c2a;       /* rojo tomate */
  --warn-bg: #fde5e0;
  --star: #e2a019;
  --shadow: 0 1px 2px rgba(30, 60, 20, .06), 0 4px 14px rgba(30, 60, 20, .07);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131a12; --surface: #1c241a; --surface-2: #253023; --text: #e8f0e2; --muted: #9dab95; --line: #2f3c2c;
    --primary: #c39be6; --primary-ink: #1d1229; --leaf: #1f4a24; --leaf-ink: #f1f8ec;
    --green: #8fd08a; --green-bg: #22351f; --tomato: #f0806c; --warn-bg: #3e2420;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 1.5rem; line-height: 1.2; margin: .3em 0 .25em; }
h2 { font-size: 1.1rem; margin: 1.4em 0 .5em; }
h3.day { font-size: .95rem; margin: 1.2em 0 .4em; color: var(--muted); }
p { margin: .4em 0; }
img { max-width: 100%; }
.small { font-size: .85rem; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; }
.row.top { align-items: flex-start; }
.between { justify-content: space-between; }
.gap { gap: 8px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

main { max-width: 960px; margin: 0 auto; padding: 8px 16px 24px; }
.loading, .empty { text-align: center; padding: 40px 12px; }

/* Cabecera */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top)); background: var(--leaf); color: var(--leaf-ink);
  border-bottom: 3px solid var(--tomato);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--leaf-ink); font-size: 1.05rem; }
.brand img { width: 32px; height: 32px; border-radius: 8px; background: #fff; padding: 2px; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: none; border: 0; font-size: 1.15rem; cursor: pointer; color: var(--text); }
.iconbtn:hover { background: var(--surface-2); }
.top .iconbtn:hover { background: rgba(255,255,255,.15); }
.top .btn { background: #fff; color: var(--leaf); }
.top .btn.install { background: var(--tomato); color: #fff; }
.brand { min-width: 0; white-space: nowrap; }
@media (max-width: 440px) { .install-tx { display: none; } .top .btn.install { padding: 6px 10px; } }
.top .av { box-shadow: 0 0 0 2px #fff; }
.install-card { padding: 14px; margin-top: 20px; border-left: 4px solid var(--green); }
.badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tomato); color: #fff; font-size: 11px; line-height: 18px; font-weight: 700; }
.seg .badge { position: static; display: inline-block; }
.mebtn { margin-left: 4px; }
.demo { background: var(--surface-2); color: var(--muted); font-size: .8rem; text-align: center; padding: 4px 12px; }

/* Navegación inferior */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around;
  background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
}
.tabs a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 0; font-size: .72rem; color: var(--muted); border-radius: 10px; }
.tabs a span { font-size: 1.3rem; filter: grayscale(.7); opacity: .8; }
.tabs a.on { color: var(--leaf); font-weight: 700; background: var(--surface-2); }
@media (prefers-color-scheme: dark) { .tabs a.on { color: var(--green); } }
.tabs a.on span { filter: none; opacity: 1; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer;
  background: var(--primary); color: var(--primary-ink); font: inherit; font-weight: 600;
  padding: 10px 16px; border-radius: 999px; min-height: 42px; text-align: center;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: .88rem; }
.btn.ghost { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.danger { color: var(--tomato); }
.btn.wide { width: 100%; margin-top: 6px; }
.btn.file { cursor: pointer; }
.link { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; text-decoration: underline; }
.back { display: inline-block; margin: 4px 0 8px; color: var(--muted); }
.logout { display: block; margin: 32px auto 0; color: var(--muted); }

/* Chips y filtros */
.chips { display: flex; gap: 6px; margin: 10px 0; }
.chips.scroll, .seg.scroll { overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
.chips.scroll::-webkit-scrollbar, .seg.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: .88rem;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
select, input, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 50%, transparent); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.count { margin: 4px 0 8px; }

.hero { background: linear-gradient(135deg, #2f6b34 0%, #4a7f2f 35%, #5b2a86 80%, #d23c2a 125%); color: #fff; border-radius: 18px; padding: 18px 16px; margin-top: 8px; }
.hero h1 { margin-top: 0; }
.hero p { opacity: .92; }
.search input { width: 100%; margin-top: 10px; padding: 12px 14px; border-radius: 12px; border: 0; font-size: 1rem; }

/* Tarjetas */
.card { display: block; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); border: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr 1fr; gap: 10px; } }
.prod { overflow: hidden; display: flex; flex-direction: column; }
.prod.off { opacity: .6; }
.prod .body { padding: 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.prod .name { font-size: .98rem; line-height: 1.25; }
.price { font-weight: 700; color: var(--tomato); white-space: nowrap; margin-left: 6px; }
.price small { font-weight: 500; color: var(--muted); }
.price.big { font-size: 1.4rem; margin-left: 0; }
.prod .row.between { flex-direction: column; align-items: flex-start; gap: 2px; }
.prod .price { margin-left: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.tag { display: inline-block; font-size: .74rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.warn { background: var(--warn-bg); color: var(--tomato); }
.next { margin-top: auto; padding-top: 6px; font-size: .8rem; color: var(--primary); border-top: 1px dashed var(--line); }
.stars { color: var(--star); letter-spacing: 1px; }

.thumb { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.emoji { font-size: 3rem; }
.thumb.big { aspect-ratio: 16 / 9; font-size: 5rem; border-radius: var(--radius) var(--radius) 0 0; }
.thumb.xs { width: 54px; height: 54px; aspect-ratio: auto; border-radius: 10px; font-size: 1.7rem; flex: none; }
.thumb[data-cat="hortalizas"], .thumb[data-cat="frutas"] { background: #fbe2d9; }
.thumb[data-cat="hoja"], .thumb[data-cat="aromaticas"], .thumb[data-cat="plantel"] { background: #e2efdc; }
.thumb[data-cat="miel"], .thumb[data-cat="huevos"], .thumb[data-cat="lacteos"] { background: #f8ecc9; }
.thumb[data-cat="conservas"], .thumb[data-cat="aceite"] { background: #ece3d0; }
@media (prefers-color-scheme: dark) { .thumb[data-cat] { background: var(--surface-2) !important; } }

.product { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.pad { padding: 14px 16px; }
.note { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.seller-mini, .rank, .userpick, .notice { display: flex; align-items: center; gap: 12px; padding: 12px; margin-top: 12px; }
.userpick { width: 100%; font: inherit; text-align: left; cursor: pointer; }
.chev { color: var(--muted); font-size: 1.5rem; }
.list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.list .rank, .list .userpick, .list .notice { margin-top: 0; }
.rank .pos { width: 28px; text-align: center; font-weight: 700; font-size: 1.1rem; }
.rank .right { text-align: right; font-size: .85rem; }
.trip { display: flex; gap: 12px; padding: 12px; align-items: flex-start; }
.trip .kind { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); font-size: 1.4rem; }
.new-dot { display: inline-block; font-size: .7rem; font-weight: 700; color: #fff; background: var(--tomato); border-radius: 6px; padding: 1px 6px; margin-bottom: -4px; align-self: flex-start; }
.infobox { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin: 10px 0; display: flex; flex-direction: column; gap: 4px; }

/* Avatares */
.av { width: 44px; height: 44px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; object-fit: cover; font-weight: 700; color: #fff; background: hsl(var(--h, 280) 40% 45%); vertical-align: middle; }
.av.sm { width: 30px; height: 30px; font-size: .85rem; }
.av.lg { width: 72px; height: 72px; font-size: 1.8rem; }
.profile-head { display: flex; align-items: center; gap: 14px; margin: 8px 0; }
.profile-head h1 { margin: 0; }

/* Segmentos (pestañas internas) */
.seg { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; margin: 12px 0; width: max-content; max-width: 100%; }
.seg.scroll { width: auto; border-radius: 0; background: none; padding: 0 16px; }
.seg a { padding: 7px 14px; border-radius: 999px; color: var(--muted); white-space: nowrap; font-size: .9rem; }
.seg.scroll a { background: var(--surface-2); }
.seg a.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.seg.scroll a.on { background: var(--primary); color: var(--primary-ink); }

/* Formularios */
.form { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.form label:not(.check):not(.btn) { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); }
.form label > input:not([type=checkbox]):not([type=radio]), .form label > select, .form label > textarea { color: var(--text); font-size: 1rem; }
.form h2 { margin: 0 0 4px; }
.form .qty { flex-direction: row !important; align-items: center; justify-content: space-between; gap: 10px; color: var(--text) !important; font-size: 1rem !important; }
.form .qty input { width: 84px; text-align: right; }
.total { text-align: right; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: .88rem; color: var(--muted); margin-bottom: 6px; }
.roles { display: flex; flex-direction: column; gap: 6px; }
.roles label { flex-direction: row !important; }
.roles input { position: absolute; opacity: 0; }
.roles span { display: block; width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; color: var(--text); cursor: pointer; }
.roles input:checked + span { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); font-weight: 600; }
.roles input:focus-visible + span { outline: 2px solid var(--primary); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.rate { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.rate label { cursor: pointer; }
.rate input { position: absolute; opacity: 0; }
.rate span { font-size: 2rem; color: var(--line); line-height: 1; }
.rate label:has(input:checked) span, .rate label:has(input:checked) ~ label span,
.rate label:hover span, .rate label:hover ~ label span { color: var(--star); }.rate input:focus-visible + span { outline: 2px solid var(--primary); border-radius: 4px; }
.minimap { height: 200px; border-radius: 12px; margin-top: 6px; border: 1px solid var(--line); }

/* Pedidos */
.order { padding: 12px; margin: 8px 0; display: flex; flex-direction: column; gap: 4px; border-left: 4px solid var(--line); }
.order.st-pendiente { border-left-color: var(--star); }
.order.st-aceptado { border-left-color: var(--green); }
.order.st-rechazado, .order.st-cancelado { opacity: .7; }
.order .status { font-size: .8rem; font-weight: 600; }
.items { margin: 4px 0; padding-left: 18px; }
.prep { padding: 12px; margin: 8px 0; background: var(--green-bg); }
.myprod { display: flex; gap: 12px; padding: 10px; align-items: center; }
.myprod.off { opacity: .65; }

a.prep { color: var(--text); }

/* Hoja de reparto */
.lead { font-size: 1.05rem; margin: 0 0 10px; }
.printonly { display: none; }
.progress { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; margin: 6px 0; }
.progress div { height: 100%; background: var(--green); transition: width .3s; }
.route-actions { margin: 12px 0; }
.loadlist { padding: 6px 12px; }
.loadlist .line { padding: 8px 0; border-bottom: 1px solid var(--line); }
.loadlist .line:last-child { border-bottom: 0; }
.loadlist input:checked + span { text-decoration: line-through; color: var(--muted); }
.stops { display: flex; flex-direction: column; gap: 10px; }
.stop { padding: 12px; display: flex; flex-direction: column; gap: 4px; border-left: 4px solid var(--star); }
.stop.done { border-left-color: var(--green); opacity: .6; }
.stop.done b { text-decoration: line-through; }
.stop .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-size: .8rem; margin-right: 4px; }
.stop .mv { display: flex; }
.stop .mv .iconbtn { width: 34px; height: 34px; border: 1px solid var(--line); margin-left: 4px; }
.ticks { margin-top: 6px; }
.tick { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; }
.tick input { width: 22px; height: 22px; accent-color: var(--green); }
.tick:has(input:checked) { border-color: var(--green); background: var(--green-bg); color: var(--green); }

@media print {
  body { background: #fff; color: #000; padding: 0; }
  .top, #demo-bar, .tabs, .noprint, #toast { display: none !important; }
  .printonly { display: block; }
  main { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .stop.done { opacity: 1; }
  .tick { border-color: #999; padding: 4px 10px; }
  a { color: #000; }
}

/* ───── Mejoras de experiencia ───── */
.brand-tx { overflow: hidden; text-overflow: ellipsis; }
.center { text-align: center; }
.end { justify-content: flex-end; }
.rel { position: relative; }
.big-emoji { font-size: 3rem; line-height: 1; margin-bottom: 6px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 2px; }
a.card { transition: transform .12s, box-shadow .12s; }
@media (hover: hover) { a.card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(30, 60, 20, .12); } }
.btn:active, .chip:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Buscador y atajos */
.search { position: relative; }
.search .clear { position: absolute; right: 8px; top: calc(50% + 5px); transform: translateY(-50%); border: 0; background: var(--surface-2); color: var(--text); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }
.shortcuts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.shortcuts a { color: #fff; background: rgba(255,255,255,.16); padding: 5px 10px; border-radius: 999px; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.shortcuts a:hover { background: rgba(255,255,255,.26); }

/* Bajan pronto */
.strip-title { margin: 16px 0 6px; }
.strip { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.soon { flex: none; width: 168px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; scroll-snap-align: start; border-top: 3px solid var(--tomato); }
.soon .kind { font-size: 1.3rem; }
.soon .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Favoritos */
.prod { position: relative; }
.fav { border: 0; background: rgba(255,255,255,.92); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1rem; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.fav.over { position: absolute; top: 8px; right: 8px; z-index: 2; }
.fav.big { width: 44px; height: 44px; font-size: 1.3rem; top: 12px; right: 12px; }
.fav.on { animation: pop .25s; }
@keyframes pop { 50% { transform: scale(1.25); } }

/* Reserva: cantidades con + y − */
.form .qty { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; margin: 0 -8px; border-radius: 10px; }
.form .qty.has { background: var(--green-bg); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); flex: none; }
.stepper button { border: 0; background: none; width: 34px; height: 34px; font-size: 1.2rem; cursor: pointer; color: var(--primary); font-weight: 700; }
.form .qty .stepper input { width: 52px; border: 0; text-align: center; padding: 4px 0; background: transparent; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pw { display: flex; align-items: center; gap: 8px; }
.pw input { flex: 1; }

/* Mensajes */
.msgbtn { position: relative; }
.msgbtn .badge { top: -6px; right: -6px; }
.thread { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; min-height: 140px; overflow-y: auto; padding: 8px; background: var(--surface-2); border-radius: 12px; }
.msg { align-self: flex-start; max-width: 82%; background: var(--surface); border-radius: 14px 14px 14px 4px; padding: 8px 12px; box-shadow: var(--shadow); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; background: var(--green-bg); border-radius: 14px 14px 4px 14px; }
.msg .small { display: block; margin-top: 2px; }

/* Panel del productor */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 6px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat b { font-size: 1.25rem; }
.warn-tx { color: var(--tomato); }
@media (max-width: 400px) { .stat b { font-size: 1.05rem; } .stat .small { font-size: .72rem; } }
.checklist { padding: 12px 14px; margin: 10px 0; border-left: 4px solid var(--green); }
.checklist ul { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 4px; }
.checklist li.ok { color: var(--muted); text-decoration: line-through; }
.bars { padding: 10px 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 32px 1fr 24px; align-items: center; gap: 8px; font-size: .85rem; }
.bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--star); }

/* Cuenta, legal, temporada */
.me-links { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin-top: 24px; font-size: .9rem; }
.danger-zone { padding: 12px 14px; margin-top: 16px; border-color: color-mix(in srgb, var(--tomato) 40%, var(--line)); }
.danger-zone summary { cursor: pointer; color: var(--tomato); font-weight: 600; }
.danger-zone[open] { display: flex; flex-direction: column; gap: 8px; }
.danger-zone label { display: flex; flex-direction: column; gap: 4px; }
.legal { max-width: 720px; }
.legal li { margin: 4px 0; }
.chips.wrap { flex-wrap: wrap; }
.chip.have { border-color: var(--green); color: var(--green); font-weight: 600; }
.season-now { padding: 12px 14px; margin: 10px 0; }
.season-now h2 { margin-top: 0; }
.pad-sm { padding: 10px 14px; margin-top: 16px; }
.pad-sm summary { cursor: pointer; font-weight: 600; }
.foot-actions { margin-top: 18px; }

.order.manual { background: linear-gradient(0deg, var(--surface), var(--surface)), var(--surface); border-style: dashed; }
.extra { margin-top: 4px; }
.extra select { padding: 8px 6px; }

/* Comprar / Vender */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 14px; margin: 10px 0 4px; }
.modes button { position: relative; border: 0; background: none; padding: 10px; border-radius: 10px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.modes button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.modes button .badge { position: static; display: inline-block; margin-left: 4px; }

/* Administración */
.stats.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 520px) { .stats.four { grid-template-columns: repeat(2, 1fr); } }
.report { padding: 12px; display: flex; flex-direction: column; gap: 4px; border-left: 4px solid var(--tomato); }
.report.done { border-left-color: var(--green); opacity: .7; }
.danger-tx { color: var(--tomato) !important; }

/* Publicaciones */
.feed { display: flex; flex-direction: column; gap: 12px; max-width: 620px; }
.post { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.post .row.gap { color: var(--text); }
.post-img { border-radius: 10px; width: 100%; max-height: 480px; object-fit: cover; }
.review { padding: 12px; }

/* Mapa */
.map-wrap { position: relative; margin: 8px -16px 0; }
#map { height: calc(100vh - 160px); min-height: 360px; }
.map-legend { position: absolute; z-index: 500; left: 12px; right: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface); padding: 8px 12px; border-radius: 12px; box-shadow: var(--shadow); font-size: .82rem; }
.map-legend .btn { margin-left: auto; }
.pin span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #fff; border: 2px solid var(--primary); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.pin span { font-size: 18px; }
.pin.trip span { border-color: var(--tomato); }
.leaflet-popup-content a { font-weight: 600; }

/* Diálogo */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(30, 20, 10, .45); }
.dlg-body .form { padding: 18px; }

#toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 1000;
  background: #2a2620; color: #fff; padding: 10px 16px; border-radius: 12px; max-width: calc(100vw - 32px); transition: .2s; font-size: .92rem; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--tomato); }
