/* Mi Puesto · CMA — estilos. Marca: manual del club (Marino, Rojo Aranjuez, Amarillo Sol; Barlow). */

@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url('/fonts/barlow-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url('/fonts/barlow-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url('/fonts/barlow-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url('/fonts/barlow-500-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url('/fonts/barlow-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url('/fonts/barlow-600-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url('/fonts/barlow-condensed-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url('/fonts/barlow-condensed-600-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('/fonts/barlow-condensed-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('/fonts/barlow-condensed-700-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --marino: #1E3A6E;
  --marino-2: #2B4E8C;
  --rojo: #D62E25;
  --sol: #FAD24A;
  --gris: #5B6472;
  --asfalto: #15181E;
  --ok: #1F8A4C;
  --warn: #B86E00;

  --bg: #FFFFFF;
  --surface: #F3F5F9;
  --surface-2: #E8ECF3;
  --text: #15181E;
  --muted: #5B6472;
  --line: #DDE2EA;
  --accent: var(--marino);
  --accent-text: #FFFFFF;
  --link: #1E4FA0;
  --shadow: 0 6px 24px rgba(21, 24, 30, .16), 0 1px 3px rgba(21, 24, 30, .12);

  --top-offset: 0px;
  --sheet-h: 46dvh;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151B;
    --surface: #1B2029;
    --surface-2: #252C38;
    --text: #EEF1F6;
    --muted: #A2ABBA;
    --line: #2C3442;
    --accent: #3F6CC0;
    --link: #8FB4FF;
    --shadow: 0 6px 24px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px; line-height: 1.45; color: var(--text); background: var(--bg);
  overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body.is-admin { --top-offset: 30px; }
h1, h2, h3, .cond { font-family: 'Barlow Condensed', 'Barlow', sans-serif; font-weight: 700; letter-spacing: .01em; line-height: 1.1; }
h1 { font-size: 1.7rem; margin: 0 0 .25rem; }
h2 { font-size: 1.35rem; margin: 1.2rem 0 .5rem; }
h3 { font-size: 1.1rem; margin: 1rem 0 .4rem; }
p { margin: .35rem 0; }
a { color: var(--link); }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
[hidden] { display: none !important; }

/* ── Mapa ─────────────────────────────────────────────────────────────── */
.map { position: fixed; inset: 0; background: #E9ECE4; }
.maplibregl-ctrl-top-right { top: calc(var(--safe-t) + var(--top-offset) + 64px); right: 2px; }
.maplibregl-ctrl-group { border-radius: 10px !important; box-shadow: var(--shadow) !important; }
.maplibregl-ctrl-group button { width: 38px; height: 38px; }
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: calc(var(--sheet-h) + 2px); transition: bottom .25s; }
.ctrl-text-btn { font-weight: 700 !important; font-size: 12px !important; font-family: 'Barlow Condensed', sans-serif; color: #15181E !important; }
.ctrl-text-btn.on { background: var(--marino) !important; color: #fff !important; }
.layer-menu { position: absolute; right: 46px; top: 0; background: var(--bg); color: var(--text); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 170px; z-index: 5; }
.layer-menu button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 8px; text-align: left; cursor: pointer; font-size: 15px; }
.layer-menu button[aria-checked="true"] { background: var(--surface-2); font-weight: 600; }

/* Marcadores de puesto (HTML) */
.pm {
  --c: var(--marino);
  width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid #fff; background: var(--c); color: #fff;
  display: grid; place-items: center; font: 700 13px/1 'Barlow Condensed', sans-serif; cursor: pointer; padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.45); position: relative; transition: transform .15s;
}
.pm-wrap { line-height: 0; }
.pm.t-avituallamiento { --c: #1F8A4C; border-radius: 9px; }
.pm.t-base { --c: var(--sol); color: var(--asfalto); border-radius: 8px; width: 34px; height: 34px; font-size: 16px; }
.pm.hole::after { content: ''; position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--rojo); border: 2px solid #fff; }
.pm.checked::before { content: '✓'; position: absolute; bottom: -6px; right: -6px; width: 15px; height: 15px; border-radius: 50%; background: var(--ok); border: 2px solid #fff; font: 700 9px/11px 'Barlow', sans-serif; text-align: center; }
.pm.approx { outline: 2px dashed var(--warn); outline-offset: 2px; }
.pm.sel { transform: scale(1.35); z-index: 5; box-shadow: 0 0 0 4px rgba(214,46,37,.35), 0 2px 8px rgba(0,0,0,.5); }
.pm.dim { opacity: .45; }
.pm.dragging { transform: scale(1.5); box-shadow: 0 0 0 6px rgba(250,210,74,.6); }
.scrub-dot { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid var(--rojo); box-shadow: 0 1px 6px rgba(0,0,0,.5); pointer-events: none; }
.maplibregl-popup-content { font-family: 'Barlow', sans-serif; border-radius: 10px; padding: 8px 12px; color: #15181E; }

/* ── Barra superior y buscador ───────────────────────────────────────── */
.topbar {
  position: fixed; z-index: 40; left: 10px; right: 10px; top: calc(var(--safe-t) + var(--top-offset) + 8px);
  display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 6px 0 6px;
  background: var(--bg); border-radius: 14px; box-shadow: var(--shadow);
}
.brand { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; flex: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.search { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.search-ico { position: absolute; left: 10px; width: 18px; height: 18px; fill: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: 0 12px 0 34px; font: 500 16px 'Barlow', sans-serif; color: var(--text); outline: none;
}
.search input:focus { border-color: var(--marino-2); background: var(--bg); }
.results {
  position: absolute; top: 46px; left: -44px; right: -8px; max-height: min(60dvh, 440px); overflow-y: auto;
  background: var(--bg); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 50;
}
@media (min-width: 900px) { .results { left: 0; right: 0; } }
.result { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 9px; text-align: left; cursor: pointer; min-height: 48px; }
.result:hover, .result[aria-selected="true"] { background: var(--surface-2); }
.result .r-main { flex: 1; min-width: 0; }
.result .r-title { font-weight: 600; }
.result .r-sub { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result mark { background: rgba(250,210,74,.55); color: inherit; border-radius: 2px; }
.results-empty { padding: 14px 10px; color: var(--muted); }
.me-btn { flex: none; height: 40px; border: 0; border-radius: 10px; background: var(--rojo); color: #fff; font: 700 15px 'Barlow Condensed', sans-serif; padding: 0 12px; cursor: pointer; }

.admin-bar {
  position: fixed; top: var(--safe-t); left: 0; right: 0; height: 30px; z-index: 45; display: flex; align-items: center; justify-content: center; gap: 14px;
  background: var(--sol); color: var(--asfalto); font: 600 14px 'Barlow', sans-serif;
}
.admin-bar a { color: var(--asfalto); font-weight: 700; }
.admin-bar button { border: 1px solid rgba(0,0,0,.25); background: transparent; border-radius: 6px; padding: 1px 8px; cursor: pointer; }

.route-chips { position: fixed; z-index: 20; left: 10px; top: calc(var(--safe-t) + var(--top-offset) + 66px); display: flex; gap: 6px; flex-wrap: wrap; }
.rchip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; border: 0;
  background: var(--bg); color: var(--text); box-shadow: var(--shadow); font: 700 15px 'Barlow Condensed', sans-serif; cursor: pointer;
}
.rchip i { width: 14px; height: 4px; border-radius: 2px; background: var(--c); }
.rchip[aria-pressed="false"] { opacity: .55; }
.rchip[aria-pressed="false"] i { background: var(--muted); }

/* ── Panel inferior (móvil) / lateral (escritorio) ───────────────────── */
.sheet {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: var(--sheet-h);
  background: var(--bg); border-radius: 18px 18px 0 0; box-shadow: 0 -4px 24px rgba(0,0,0,.18);
  display: flex; flex-direction: column; transition: height .25s ease;
}
.sheet.dragging { transition: none; }
.sheet-grip { flex: none; height: 26px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet-grip span { width: 42px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px calc(28px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
@media (min-width: 900px) {
  /* --panel-w: ancho del panel en el ordenador; se cambia arrastrando su borde derecho (app.js). */
  /* --panel-ef: el que se usa, que nunca deja menos de 300 px de mapa aunque se estreche la ventana. */
  :root { --sheet-h: 0px; --panel-w: 400px; --panel-ef: min(var(--panel-w), max(340px, calc(100vw - 300px))); }
  .sheet { top: calc(var(--top-offset) + 70px); left: 10px; bottom: 10px; width: var(--panel-ef); height: auto !important; border-radius: 16px; box-shadow: var(--shadow); }
  .sheet-grip { display: none; }
  .sheet-body { padding-top: 14px; }
  .topbar { right: auto; width: var(--panel-ef); }
  .route-chips { left: calc(var(--panel-ef) + 20px); top: calc(var(--top-offset) + 18px); }
  /* Asa para cambiar el ancho: una franja en el borde derecho, con una rayita al pasar el ratón. */
  .sheet-resize { position: absolute; top: 0; bottom: 0; right: -7px; width: 14px; cursor: ew-resize; z-index: 2; touch-action: none; }
  .sheet-resize::after { content: ''; position: absolute; top: 50%; left: 5px; width: 4px; height: 48px; margin-top: -24px; border-radius: 2px; background: var(--line); opacity: 0; transition: opacity .15s; }
  .sheet-resize:hover::after, .sheet-resize:focus-visible::after, .sheet.resizing .sheet-resize::after { opacity: 1; background: var(--marino-2); }
  .sheet-resize:focus-visible { outline: none; }
  .sheet.resizing, .sheet.resizing * { user-select: none; }
  .maplibregl-ctrl-top-right { top: calc(var(--top-offset) + 10px); }
  .maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: 0; }
}

/* ── Componentes ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 600 15px 'Barlow', sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--marino); border-color: var(--marino); color: #fff; }
.btn-red { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--rojo); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 0 10px; font-size: 14px; border-radius: 9px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.btn-row .btn { flex: 1 1 auto; }

.badge {
  display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 7px; border-radius: 50%;
  background: var(--marino); color: #fff; font: 700 15px/1 'Barlow Condensed', sans-serif; flex: none;
}
.badge.t-avituallamiento { background: #1F8A4C; border-radius: 9px; }
.badge.t-base { background: var(--sol); color: var(--asfalto); border-radius: 8px; }
.badge.t-tarea, .badge.t-escoba, .badge.t-corre { background: var(--surface-2); color: var(--text); border-radius: 9px; font-size: 13px; }
.badge.sm { min-width: 26px; height: 26px; font-size: 13px; }

.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--surface-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: rgba(31,138,76,.14); color: var(--ok); }
.chip.warn { background: rgba(214,46,37,.12); color: var(--rojo); }
.chip.amber { background: rgba(184,110,0,.14); color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.card.carrera.actual { box-shadow: inset 0 0 0 2px var(--marino-2); }
.card.carrera .btn-row { margin-top: 8px; }
.chip.route { background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
@media (prefers-color-scheme: dark) { .chip.route { color: color-mix(in srgb, var(--c) 55%, white); } }

.card { background: var(--surface); border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.card.peligro { border: 2px solid var(--rojo); }
.card.hl { background: color-mix(in srgb, var(--sol) 22%, var(--bg)); }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head .ch-main { flex: 1; min-width: 0; }
.card-kicker { font: 700 12px 'Barlow', sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card-title { font: 700 1.2rem/1.15 'Barlow Condensed', sans-serif; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.head { display: flex; align-items: flex-start; gap: 12px; margin: 4px 0 8px; }
.head .badge { min-width: 44px; height: 44px; font-size: 19px; }
.head .h-main { flex: 1; min-width: 0; }
/* Fila superior de la ficha de puesto: volver a la izquierda, saltar de puesto a la derecha. */
.pnav-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pnav-arrows { display: flex; align-items: center; gap: 2px; }
.pnav-pos { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: center; }
/* 40px de alto: el día de la carrera se usa con prisa y a veces con guantes. */
.pnav { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px;
  border-radius: 10px; color: var(--link); text-decoration: none; font-size: 1.35rem; line-height: 1; }
.pnav:active { background: rgba(127,127,127,.18); }
.pnav.off { color: var(--muted); opacity: .35; pointer-events: none; }

.back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--link); padding: 4px 0; font-weight: 600; cursor: pointer; }

.notice { border-left: 4px solid var(--warn); background: rgba(184,110,0,.10); padding: 8px 12px; border-radius: 8px; margin: 8px 0; font-size: .92rem; }
.notice.info { border-color: var(--marino-2); background: rgba(43,78,140,.10); }

.people { list-style: none; margin: 6px 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: 0; }
.people a { color: var(--text); font-weight: 600; text-decoration: none; flex: 1; }
.people .me { color: var(--rojo); }
.tick { color: var(--ok); font-weight: 700; font-size: .85rem; }

/* Pestañas: pastillas, para que se vea que se pueden tocar. Con más de tres se deslizan
   de lado; el borde cortado de la última ya avisa de que hay más. */
.tabs {
  display: flex; gap: 6px; margin: 14px -16px 10px; padding: 8px 16px 10px;
  position: sticky; top: -1px; background: var(--bg); z-index: 3;
  border-bottom: 1px solid var(--line);
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-radius: 22px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 700 17px/1 'Barlow Condensed', sans-serif; letter-spacing: .02em; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.tabs button:hover { border-color: var(--muted); }
.tabs button[aria-selected="true"] {
  background: var(--rojo); border-color: var(--rojo); color: #fff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--rojo) 35%, transparent);
}

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.stat { background: var(--surface); border-radius: 10px; padding: 6px 8px; }
.stat b { display: block; font: 700 1.25rem/1.1 'Barlow Condensed', sans-serif; }
.stat span { font-size: .78rem; color: var(--muted); }

/* Mismo lenguaje que las pestañas: pastillas, y la elegida en rojo para que se vea
   de un vistazo que son botones. Blanco sobre #D62E25 da 4,9:1 de contraste. */
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  min-height: 40px; padding: 0 14px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 700 16px/1 'Barlow Condensed', sans-serif; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.seg button:hover { border-color: var(--muted); }
.seg button[aria-pressed="true"] {
  background: var(--rojo); border-color: var(--rojo); color: #fff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--rojo) 35%, transparent);
}

/* Perfil de altitud */
.profile { position: relative; margin: 6px 0 4px; user-select: none; -webkit-user-select: none; }
.profile svg { display: block; width: 100%; height: 160px; touch-action: pan-y; }
.profile .pf-read { height: 22px; font-size: .9rem; font-weight: 600; display: flex; gap: 10px; }
.profile .pf-read span { color: var(--muted); font-weight: 500; }
.pf-grid { stroke: var(--line); stroke-width: 1; }
.pf-axis { fill: var(--muted); font: 500 10px 'Barlow', sans-serif; }
.pf-line { fill: none; stroke-width: 2; }
.pf-mark { font: 700 10px 'Barlow Condensed', sans-serif; fill: var(--text); }
.pf-cursor { stroke: var(--rojo); stroke-width: 1.5; }

/* Tablas de pasos */
.passes { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 6px 0; }
.passes th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; padding: 4px 6px 4px 0; }
.passes td { padding: 6px 6px 6px 0; border-top: 1px solid var(--line); }
.passes td b { font-family: 'Barlow Condensed', sans-serif; font-size: 1.05rem; }

/* Lista de puestos */
.plist { list-style: none; margin: 0; padding: 0; }
.plist li > a { display: flex; gap: 10px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.plist .pl-main { flex: 1; min-width: 0; }
.plist .pl-name { font-weight: 600; line-height: 1.2; }
.plist .pl-sub { font-size: .84rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-title { font: 700 13px 'Barlow', sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 2px; }

/* Programa */
.sched { width: 100%; border-collapse: collapse; }
.sched td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.sched td:first-child { font: 700 1.05rem 'Barlow Condensed', sans-serif; width: 58px; }

/* Comentarios y fotos */
.feed-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 8px 0; }
.feed-photos button { padding: 0; border: 0; background: var(--surface-2); aspect-ratio: 1; border-radius: 8px; overflow: hidden; cursor: pointer; position: relative; }
.feed-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-photos .hidden-tag { position: absolute; left: 4px; top: 4px; }
.feed-photos .ph { display: flex; flex-direction: column; gap: 2px; }
.feed-photos .ph > button { width: 100%; }
.ph-actions { display: flex; gap: 10px; justify-content: center; }
/* Zona para arrastrar fotos: solo con ratón o trackpad. En el móvil se usa el botón. */
.dropzone { display: none; }
@media (hover: hover) and (pointer: fine) {
  .dropzone {
    display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
    border: 2px dashed var(--line); border-radius: 12px; padding: 16px 14px; margin: 10px 0;
    background: var(--surface); cursor: pointer;
    transition: border-color .15s, background .15s;
  }
  .dropzone b { font: 700 1.05rem 'Barlow Condensed', sans-serif; }
  .dropzone span { font-size: .86rem; color: var(--muted); }
  .dropzone:hover, .dropzone:focus-visible { border-color: var(--muted); }
  .dropzone.encima { border-color: var(--rojo); background: color-mix(in srgb, var(--rojo) 10%, transparent); }
  .dropzone.subiendo { opacity: .55; pointer-events: none; }
}

.comment { padding: 8px 0; border-bottom: 1px solid var(--line); }
.comment .c-meta { font-size: .8rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.comment .c-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment.is-hidden { opacity: .5; }
.linkbtn { border: 0; background: none; color: var(--link); padding: 0; cursor: pointer; font-size: .8rem; }

.field { display: block; margin: 8px 0; }
.field > span { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text);
  padding: 8px 10px; font: 16px 'Barlow', sans-serif;
}
.field textarea { min-height: 76px; resize: vertical; }
.field-row { display: flex; gap: 8px; }
.field-row > * { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.check input { flex: none; }   /* con textos de dos líneas, la casilla no se encoge */
.check input { width: 20px; height: 20px; }

.progress { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.progress i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .2s; }

/* Editor de trazado */
.anchor { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--c, #D62E25); box-shadow: 0 1px 4px rgba(0,0,0,.5); cursor: grab;
  display: grid; place-items: center; font: 700 10px/1 'Barlow Condensed', sans-serif; color: #15181E; }
.anchor.first, .anchor.last { width: 24px; height: 24px; background: var(--c, #D62E25); color: #fff; border-color: #fff; }
.edit-pop { display: flex; flex-direction: column; gap: 6px; min-width: 190px; }
.edit-pop .btn { width: 100%; }

/* Barra flotante (mover punto, crear punto) */
.floatbar {
  position: fixed; z-index: 45; left: 10px; right: 10px; bottom: calc(var(--sheet-h) + 10px + var(--safe-b));
  background: var(--bg); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 12px;
}
@media (min-width: 900px) { .floatbar { left: calc(var(--panel-ef) + 20px); right: auto; width: 460px; bottom: 20px; } }
/* Crear puntos en serie: el formulario cabe en la barra sin tapar todo el mapa */
.floatbar.serie { max-height: 62vh; overflow-y: auto; }
.floatbar.serie .field { margin-bottom: 4px; }
.floatbar.serie .field > span { font-size: .78rem; }
.floatbar.serie .field-row { gap: 8px; }
.floatbar.serie p { margin-bottom: 6px; }
.floatbar.serie .hecho:empty { display: none; }
.floatbar.serie .hecho { background: color-mix(in srgb, var(--ok) 12%, transparent); border-radius: 8px; padding: 6px 8px; }
.floatbar p { margin: 0 0 8px; font-weight: 600; }

/* Puerta con clave */

.toast {
  /* Encima del panel, pero nunca más arriba de la zona visible: con el panel desplegado del todo,
     el aviso quedaba bajo la isla del iPhone y no se veía. */
  position: fixed; z-index: 120; left: 50%; bottom: min(calc(var(--sheet-h) + 16px + var(--safe-b)), calc(100dvh - var(--safe-t) - 140px)); transform: translateX(-50%) translateY(20px);
  background: var(--asfalto); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* Visor de fotos a pantalla completa (public/js/visor.js) */
body.sin-scroll { overflow: hidden; }
.visor { position: fixed; inset: 0; z-index: 110; background: #000; display: flex; flex-direction: column; overscroll-behavior: contain; }
.visor-top { position: absolute; inset: var(--safe-t) 0 auto 0; z-index: 2; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: linear-gradient(rgba(0,0,0,.65), transparent); }
.visor-n { color: #fff; font-variant-numeric: tabular-nums; font-weight: 600; }
.visor-cerrar { width: 44px; height: 44px; border: 0; border-radius: 22px; background: rgba(255,255,255,.15); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.visor-btn { margin-left: auto; border: 0; border-radius: 22px; min-height: 44px; padding: 0 16px; background: var(--rojo, #d62e25); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.visor-pista { flex: 1; display: flex; width: 100%; min-height: 0; touch-action: pan-y; will-change: transform; }
.visor-slide { flex: 0 0 100%; display: flex; align-items: center; justify-content: center; padding: 8px; }
.visor-slide img { max-width: 100%; max-height: 100%; object-fit: contain; -webkit-user-select: none; user-select: none; }
.visor-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; border-radius: 10px;
  background: rgba(255,255,255,.14); color: #fff; font-size: 32px; line-height: 1; cursor: pointer; z-index: 2; }
.visor-nav.prev { left: 6px; } .visor-nav.next { right: 6px; }
.visor-abajo { padding: 10px 16px calc(14px + var(--safe-b)); }
.visor-pie { color: #fff; text-align: center; font-size: 14px; opacity: .9; }
@media (hover: none) { .visor-nav { display: none; } }   /* en el móvil se pasa con el dedo */

/* Pintar encima de una foto */
.editor { position: absolute; inset: 0; z-index: 3; background: #0b0b0d; display: flex; flex-direction: column; }
.editor-barra { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: calc(8px + var(--safe-t)) 10px 8px; background: #16171b; }
.editor-grupo { display: flex; gap: 6px; }
.editor-herr, .editor-grosor { min-width: 44px; height: 44px; border: 2px solid transparent; border-radius: 10px; background: #2a2c33; color: #fff; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.editor-color { width: 34px; height: 44px; border: 2px solid rgba(255,255,255,.3); border-radius: 10px; cursor: pointer; }  /* el borde hace visible el negro sobre la barra oscura */
.editor-grosor i { display: block; width: 24px; background: #fff; border-radius: 9px; }
.editor-herr[aria-pressed="true"], .editor-color[aria-pressed="true"], .editor-grosor[aria-pressed="true"] { border-color: #fff; }
.editor-marco { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; }
.editor-lienzo { max-width: 100%; max-height: 100%; touch-action: none; cursor: crosshair; background: #000; }
.editor-pie { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; padding: 8px 10px calc(10px + var(--safe-b)); background: #16171b; }
.editor-pie .btn { min-height: 44px; }
.editor-nombre { display: flex; align-items: center; gap: 8px; width: 100%; color: #fff; font-size: 14px; }
.editor-nombre input { flex: 1; min-height: 44px; border: 1px solid #3a3d46; border-radius: 10px; background: #22242a; color: #fff; padding: 0 12px; font: inherit; }

.loading { padding: 30px 0; text-align: center; color: var(--muted); }
.empty { color: var(--muted); font-size: .92rem; padding: 6px 0; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.foot { margin-top: 22px; font-size: .78rem; color: var(--muted); }

/* ── Hojas imprimibles ───────────────────────────────────────────────── */
.print-root { position: fixed; inset: 0; z-index: 90; overflow: auto; background: #D9DDE4; color: #15181E; }
.print-toolbar { position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: var(--marino); color: #fff; }
.print-toolbar b { flex: 1; }
.print-page { width: 210mm; min-height: 297mm; margin: 14px auto; background: #fff; padding: 14mm 14mm 12mm; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.pp-head { display: flex; align-items: center; gap: 12px; border-bottom: 3px solid #1E3A6E; padding-bottom: 8px; margin-bottom: 10px; }
.pp-head img { height: 40px; }
.pp-head .pp-ev { flex: 1; font: 600 13px 'Barlow', sans-serif; color: #5B6472; text-align: right; }
.pp-title { display: flex; align-items: center; gap: 14px; margin: 6px 0 10px; }
.pp-title .badge { min-width: 64px; height: 64px; font-size: 28px; }
.pp-title h1 { font-size: 30px; margin: 0; }
.pp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; font-size: 14px; }
.pp-cols h3 { margin: 6px 0 4px; font-size: 16px; }
.pp-people { list-style: none; margin: 0; padding: 0; }
.pp-people li { padding: 5px 0; border-bottom: 1px solid #DDE2EA; font-size: 15px; }
.pp-people li::before { content: '☐ '; }
.smap { position: relative; overflow: hidden; border-radius: 6px; border: 1px solid #C9CFD9; background: #EEE; }
.smap img { position: absolute; width: 256px; height: 256px; max-width: none; }
.smap svg { position: absolute; inset: 0; }
.smap .smap-attr { position: absolute; right: 3px; bottom: 2px; font-size: 8px; background: rgba(255,255,255,.75); padding: 0 3px; }
.pp-maps { display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; margin: 10px 0; }
.pp-foot { margin-top: 10px; font-size: 11px; color: #5B6472; }
@media print {
  @page { size: A4; margin: 0; }
  html, body { overflow: visible !important; height: auto !important; background: #fff !important; }
  body > *:not(#print) { display: none !important; }
  .print-root { position: static; overflow: visible; background: #fff; }
  .print-toolbar { display: none; }
  .print-page { margin: 0; box-shadow: none; page-break-after: always; break-after: page; }
  .print-page:last-child { page-break-after: auto; break-after: auto; }
}

/* Los saltos a «Acceso» y «Ocultar a los socios» no deben quedar bajo la barra de pestañas fija */
#acceso-carrera, #ocultar-socios { scroll-margin-top: 72px; }

/* Formularios plegables del panel (nueva carrera, duplicar, recorrido, lote) */
details.duplicar { margin: 10px 0 2px; border-top: 1px solid var(--line, rgba(127,127,127,.25)); padding-top: 8px; }
details.duplicar > summary { cursor: pointer; font-weight: 600; color: var(--link); padding: 6px 0; min-height: 32px; list-style: none; }
details.duplicar > summary::-webkit-details-marker { display: none; }
details.duplicar[open] > summary { margin-bottom: 4px; }
details.duplicar textarea { width: 100%; }
details.nueva { border: 0; background: var(--surface); border-radius: 14px; padding: 8px 14px; }
.card.sub { background: var(--surface-2); margin: 8px 0; }
.linkbtn.peligro { color: var(--rojo); font-size: .85rem; }

/* En el móvil el panel no se ensancha: el asa no existe. */
@media (max-width: 899px) { .sheet-resize { display: none; } }

/* Casilla de clave con «Mostrar» (util.js conMostrar y la pantalla de entrada) */
.campo-clave { position: relative; }
.campo-clave input { padding-right: 104px !important; }
.ver-clave { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px;
  background: var(--surface-2); color: var(--text); font: 600 14px 'Barlow', sans-serif; cursor: pointer; }
.campo-error { color: var(--rojo); font-weight: 600; min-height: 1.2em; margin: 4px 0 10px; }
.campo-error:empty { margin: 0; min-height: 0; }


/* ── Portada: inicio con las carreras, clave de una carrera y administración (portada.js) ── */
.portada { position: fixed; inset: 0; z-index: 100; overflow-y: auto; background: var(--marino); color: #fff;
  padding: calc(var(--safe-t) + 20px) 16px calc(var(--safe-b) + 24px); -webkit-overflow-scrolling: touch; }
body.con-portada { overflow: hidden; }
.pt-caja { max-width: 560px; margin: 0 auto; }
.pt-cabecera { text-align: center; padding: 8px 0 18px; }
.pt-logo { width: 150px; display: block; margin: 0 auto 10px; }
.pt-cabecera h1 { font-size: 2rem; margin: 0 0 4px; line-height: 1.1; }
.pt-cabecera p { margin: 0; opacity: .85; }
.pt-cuerpo { background: var(--bg); color: var(--text); border-radius: 18px; padding: 16px; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.pt-cargando { text-align: center; opacity: .8; }
.pt-seccion h2, .pt-anteriores > summary { font: 700 1rem 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 6px 0 8px; }
.pt-seccion + .pt-seccion { margin-top: 14px; }
.pt-carrera { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); border-radius: 14px; padding: 12px 14px; margin: 0 0 8px; cursor: pointer; font: inherit; min-height: 64px; }
.pt-carrera:hover { border-color: var(--marino-2); }
.pt-nombre { font: 700 1.15rem 'Barlow Condensed', sans-serif; grid-column: 1; }
.pt-fecha { grid-column: 1; font-size: .9rem; color: var(--muted); }
.pt-accion { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 600; color: var(--rojo); font-size: .92rem; white-space: nowrap; }
.pt-anteriores { margin-top: 14px; }
.pt-anteriores > summary { cursor: pointer; list-style: none; }
.pt-anteriores > summary::-webkit-details-marker { display: none; }
.pt-anteriores .pt-accion { color: var(--muted); }
.pt-vacio, .pt-ayuda { color: var(--muted); font-size: .92rem; }
.pt-etiqueta { display: block; font-weight: 600; margin: 0 0 6px; }
.pt-cuerpo .campo-clave input { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font: 500 18px 'Barlow', sans-serif; background: var(--surface); color: var(--text); }
.pt-cuerpo .btn-block { margin-top: 10px; min-height: 50px; }
.pt-pie { text-align: center; margin: 16px 0 0; font-size: .92rem; }
.pt-pie a { color: var(--link); }
.pt-admin .tabs { margin: 6px 0 10px; }

.cambiar-carrera { margin: -4px 0 10px; }
.cambiar-carrera a { color: var(--link); font-weight: 600; }
.panel-volver { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-volver a.back { text-decoration: none; }

/* ── Carreras de relevos: equipos, tramos y puntos de relevo ─────────── */
.plist li.mio > a, .relevos li.mio a { background: color-mix(in srgb, var(--sol) 22%, transparent); border-radius: 8px; }
.tramo-ruta { margin: 8px 0 2px; font-weight: 600; }
.tramos { list-style: none; margin: 12px 0; padding: 0; }
.tramos li { padding: 10px 2px; border-bottom: 1px solid var(--line); }
.tramos li.mio { background: color-mix(in srgb, var(--sol) 22%, transparent); border-radius: 8px; padding-inline: 8px; }
.tramos .tr-cab { font-size: .84rem; color: var(--muted); }
.tramos .tr-nombre { font-size: 1.1rem; font-weight: 600; margin: 2px 0 6px; overflow-wrap: anywhere; }
.relevos { list-style: none; margin: 0 0 8px; padding: 0; }
.relevos li a { display: block; padding: 7px 4px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.relevos .rl-flecha { color: var(--muted); }
.relevos .rl-eq { color: var(--muted); font-size: .84rem; }
.equipo-form .tramo-fila { display: flex; gap: 6px; align-items: flex-end; }
.equipo-form .tramo-fila .field { flex: 1; min-width: 0; }
.equipo-form .tramo-mover { display: flex; gap: 4px; padding-bottom: 10px; }
.equipo-form .tramo-mover .btn { min-width: 40px; }
.plist .pl-row { display: flex; gap: 10px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.plist .pl-row > a { color: var(--text); text-decoration: none; }
.cambios { list-style: none; margin: 0; padding: 0; }
.cambios li { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.cambios s { color: var(--muted); }
.miembros li { gap: 10px; }
.miembros li.mio { background: color-mix(in srgb, var(--sol) 22%, transparent); border-radius: 8px; padding-inline: 8px; }
.miembros .mb-main { flex: 1; min-width: 0; }
.miembros .mb-nombre { font-weight: 600; overflow-wrap: anywhere; }
.tramos .tr-cab .chip.route { vertical-align: 1px; }
.tramos .quien { display: grid; gap: 4px; }
.tramos .tr-info { margin: 3px 0 0; line-height: 1.35; }
/* Cartel oficial de la modalidad: miniatura que se abre en grande en el visor */
.cartel-btn { display: flex; align-items: center; gap: 10px; width: 100%; margin: 8px 0; padding: 6px; text-align: left;
  font: inherit; font-size: .9rem; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.cartel-btn img { width: 52px; height: 60px; object-fit: cover; object-position: top; border-radius: 6px; flex: none; background: #fff; }
.tramo-info { margin: 10px 0 4px; }
.tramo-info p { margin: 0 0 4px; }
.relevos li { display: flex; align-items: center; gap: 8px; }
.relevos li a { flex: 1; min-width: 0; }
.equipo-form .field.sobra input { border-color: var(--warn); }
.seg .seg-color { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.seg-tramos { margin-top: 6px; }

/* Cobertura: rellenar huecos sin salir de la pestaña */
.plist.huecos li.hueco { display: block; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.plist.huecos li.hueco > a { border-bottom: 0; padding-bottom: 2px; }
.quitables { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip.quitable { display: inline-flex; align-items: center; gap: 4px; padding-right: 2px; }
.chip.quitable button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; min-width: 28px; min-height: 28px; border-radius: 50%; }
.chip.quitable button:hover { background: var(--surface-2); }
form.anadir { margin-top: 4px; }
form.anadir input, .colocar select {
  min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text);
  padding: 6px 10px; font: 16px 'Barlow', sans-serif;   /* 16 px: el iPhone no hace zoom al escribir */
}
form.anadir input { flex: 1; min-width: 0; }
form.anadir .btn { flex: 0 0 auto; }
.people.sin-puesto li { flex-wrap: wrap; }
.people.sin-puesto li.abierto .colocar { flex-basis: 100%; }
.colocar { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.colocar select { flex: 1; min-width: 0; }

/* Toledo: lo esencial de cada punto y los coches compartidos */
.nota-general p { margin: 0 0 6px; }
p.descripcion { margin: 0 0 8px; }
details.esencial { margin: 6px 0 10px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: var(--surface); }
details.esencial > summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
details.esencial p { margin: 6px 0; }
.card.coche-mio { border-color: var(--sol); background: color-mix(in srgb, var(--sol) 14%, var(--bg)); }
.coches { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.coches-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.coches-lista { list-style: none; margin: 6px 0 0; padding: 0; }
.coches-lista li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.coches-lista li:last-child { border-bottom: 0; }
.coches-lista .btn-row { margin-top: 4px; }

/* ── Organización a pantalla completa: tablero y panel en vivo (tablero.js, envivo.js) ── */
.pantalla { position: fixed; inset: 0; z-index: 95; overflow: auto; background: var(--bg); color: var(--text);
  padding: calc(var(--safe-t) + 10px) 16px calc(var(--safe-b) + 24px); }
body.con-pantalla { overflow: hidden; }
.tablero-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 8px; }
.tablero-cab h1 { margin: 0; font-size: 1.6rem; }
.tablero-datos { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .9rem; color: var(--muted); }
.tablero-datos b { color: var(--text); }
.tablero-datos .rojo, .tablero-datos .rojo b { color: var(--rojo); }
.tablero-cab .btn-row { margin: 0 0 0 auto; }
.tablero-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tablero-barra input[type=search] { flex: 1 1 220px; max-width: 360px; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font: 16px 'Barlow', sans-serif; background: var(--bg); color: var(--text); }
.tablero-barra .check { margin: 0; }
.tablero-barra .seleccion { background: color-mix(in srgb, var(--sol) 30%, transparent); border-radius: 8px; padding: 4px 10px; font-weight: 600; }
.tablero-cuerpo { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.tablero-personas { position: sticky; top: 0; max-height: calc(100dvh - 160px); overflow: auto; background: var(--surface); border-radius: 12px; padding: 10px; }
.tablero-personas h2, .tablero-fase h2 { font-size: 1rem; margin: 0 0 8px; }
/* Puestos (2.3): barra de orden y filtros, y tarjetas en rejilla agrupadas por fase */
.tablero-puestos { min-width: 0; }
.tablero-puestos-barra { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.tablero-puestos-barra .seg-filtro { margin-top: 0; }
.tablero-puestos-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.tablero-puestos-pie .check { margin: 0; }
.seg-orden button[aria-pressed="true"] { background: var(--marino-2, var(--marino)); border-color: transparent; }
.tablero-fase { margin-bottom: 16px; }
.tp-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; align-items: start; }
.tpuesto.destacado { outline: 3px solid var(--sol); outline-offset: 2px; }
.tp-cab .tp-nombre { flex: 1; }
.tablero-personas .seg-filtro { margin: 0 0 8px; }
.tablero-personas .seg-filtro button { min-height: 30px; padding: 0 10px; font-size: .82rem; }
.tablero-dato { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.tablero-dato:hover { text-decoration: underline; }
/* Tablero con el mapa a la derecha (ordenador, ≥ 1100 px): el tablero deja libre la derecha y se
   esconde todo lo que va encima del mapa (barra de búsqueda, panel, chips de rutas). */
body.tablero-mapa { --tablero-mapa-ancho: 38vw; }
body.tablero-mapa .pantalla { right: var(--tablero-mapa-ancho); box-shadow: 2px 0 12px rgba(0,0,0,.25); }
body.tablero-mapa .topbar, body.tablero-mapa .admin-bar, body.tablero-mapa .sheet,
body.tablero-mapa .route-chips, body.tablero-mapa .floatbar { display: none !important; }
body.tablero-mapa .tablero-personas { max-height: calc(100dvh - 40px); }
.pm.encima { transform: scale(1.5); box-shadow: 0 0 0 5px rgba(255,196,0,.6), 0 2px 8px rgba(0,0,0,.5); }
.tpuesto { border: 1px solid var(--line); border-left: 5px solid var(--muted); border-radius: 10px; padding: 8px 10px; background: var(--bg); }
.tpuesto.falta { border-left-color: var(--rojo); }
.tpuesto.ok { border-left-color: var(--ok); }
.tpuesto.gris { border-left-color: var(--line); }
.tpuesto.encima { outline: 3px dashed var(--marino-2); outline-offset: 2px; background: var(--surface); }
.tp-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tp-nombre { color: var(--text); text-decoration: none; font-size: .95rem; line-height: 1.25; }
.tp-plazas { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; white-space: nowrap; }
.tp-hora { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.tp-gente { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }
.tp-gente .vacio { font-size: .85rem; color: var(--muted); }
.tp-anadir input { width: 100%; min-height: 36px; border: 1px dashed var(--line); border-radius: 8px; padding: 4px 8px; font: 16px 'Barlow', sans-serif; background: transparent; color: var(--text); }
.tpuesto .aqui { width: 100%; }
.tchip-grupo { display: inline-flex; align-items: center; border-radius: 14px; background: var(--surface-2); }
.tchip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 14px; background: var(--surface-2); font-size: .88rem; font-weight: 600; cursor: grab; user-select: none; }
.tchip-grupo .tchip { padding-right: 4px; }
.tchip.sel { background: var(--sol); color: var(--asfalto); }
.tchip.jefe .estrella { color: var(--warn); }
.tchip .n { color: var(--muted); font-weight: 400; }
.tchip .aviso { color: var(--warn); }
.mini { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .9rem; min-width: 26px; min-height: 28px; border-radius: 8px; cursor: pointer; }
.mini:hover { background: var(--line); color: var(--text); }
.mini[aria-pressed="true"] { color: var(--warn); }
.mini:disabled { opacity: .3; cursor: default; }
.panel-grande { margin: 4px 0 10px; }
.linkbtn.encargado { margin-right: 10px; color: var(--muted); }
.linkbtn.encargado.on { color: var(--warn); font-weight: 600; }
@media (max-width: 760px){
  .tablero-cuerpo { grid-template-columns: 1fr; }
  .tablero-personas { position: static; max-height: 40vh; }
  .tablero-cab .btn-row { margin: 0; }
}
/* Panel en vivo */
.vivo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; align-items: start; }
.vivo { border-radius: 12px; border: 1px solid var(--line); border-top: 6px solid var(--line); background: var(--bg); overflow: hidden; }
.vivo.verde { border-top-color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, var(--bg)); }
.vivo.ambar { border-top-color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, var(--bg)); }
.vivo.rojo { border-top-color: var(--rojo); background: color-mix(in srgb, var(--rojo) 8%, var(--bg)); }
.vivo.abierto { grid-column: 1 / -1; }
.vivo-cab { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 10px 12px 4px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.vivo-cod { font-weight: 700; }
.vivo-nombre { flex: 1; min-width: 0; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vivo-cuenta { font: 700 1.3rem 'Barlow Condensed', sans-serif; }
.vivo-nombres { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 0 12px 10px; font-size: .85rem; color: var(--muted); }
.vivo-nombres .ok { color: var(--ok); font-weight: 600; }
.vivo-detalle { padding: 4px 12px 12px; }
.vivo-gente { list-style: none; margin: 0 0 8px; padding: 0; }
.vivo-gente li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.vivo-gente li a { flex: 1 1 140px; color: var(--text); font-weight: 600; }
.vivo-reasignar select { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font: 16px 'Barlow', sans-serif; background: var(--bg); color: var(--text); margin-bottom: 6px; }

/* «Mi día»: las dos señales arriba, el día en orden y las tareas que no son el puesto principal plegadas */
.mi-dia-acciones { margin: 6px 0 12px; }
.mi-dia-acciones .btn-ok, .btn-grande { width: 100%; min-height: 52px; font-size: 1.1rem; }
.chip.grande { height: auto; padding: 6px 12px; font-size: .95rem; white-space: normal; }
ol.mi-dia { list-style: none; margin: 0 0 12px; padding: 0; border-left: 3px solid var(--line); }
ol.mi-dia li { position: relative; padding: 4px 0 4px 14px; display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
ol.mi-dia li::before { content: ''; position: absolute; left: -7px; top: 10px; width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
ol.mi-dia li.hl::before { background: var(--rojo); }
ol.mi-dia .md-fase { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
ol.mi-dia .md-hora { font-weight: 600; }
details.card.plegada > summary { cursor: pointer; list-style: none; }
details.card.plegada > summary::-webkit-details-marker { display: none; }
details.card.plegada[open] > summary { margin-bottom: 8px; }
details.card.plegada > .card { box-shadow: none; border: 0; padding: 0; margin: 0; }
.que-hacer { margin: 8px 0; }
.tu-equipo { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.people .estrella, .estrella { color: var(--warn); margin-right: 2px; }

/* Plano «Dónde colocarte» (2.1) */
.plano { margin: 10px 0 12px; }
.plano figcaption { margin-bottom: 6px; }
.plano-img { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; cursor: zoom-in; }
.plano-img img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: contain; }
.pp-plano { margin: 0; display: flex; flex-direction: column; }
.pp-plano img { width: 100%; height: 300px; object-fit: contain; border: 1px solid #D9DDE4; border-radius: 6px; }
.pp-plano figcaption { font-size: 12px; color: #5B6472; margin-top: 2px; }

/* Socios del club en el tablero (2.2) */
.tp-lista { margin-bottom: 10px; }
.tp-lista button { font-size: .85rem; }
.tchip.nosocio { box-shadow: inset 0 0 0 1px var(--line); background: transparent; }
.tchip.socio .apodo { color: var(--muted); font-weight: 400; font-style: italic; }
.tchip.socio.con { opacity: .6; }
.tchip.socio.con.sel { opacity: 1; }
.tp-vincular { margin: 0 0 10px; padding: 8px; border: 1px dashed var(--line); border-radius: 10px; font-size: .88rem; }
.tp-vincular summary { cursor: pointer; font-weight: 600; }
.tp-vincular ul { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tp-vincular-fila { display: flex; gap: 6px; margin-top: 2px; }
.tp-vincular select { flex: 1; min-width: 0; min-height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: 14px 'Barlow', sans-serif; }
.tp-vincular .btn-ok { margin-top: 6px; }

/* Filtro por tipo de puesto, debajo de los botones de orden */
.seg-filtro { margin-top: 8px; }
.seg-filtro button { min-height: 34px; padding: 0 12px; font-size: .88rem; }
/* 2.3: quien ya no está activo en Socios, y borrar a los que no vienen de Socios */
.tchip.baja { text-decoration: line-through; text-decoration-color: var(--warn); }
.tp-borrar { margin: 0 0 8px; }
.tp-borrar .btn { margin-top: 4px; }
/* 2.3.1: un buscador para la gente y otro para los puestos */
.tp-busca input { width: 100%; max-width: 420px; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font: 16px 'Barlow', sans-serif; background: var(--bg); color: var(--text); }
.tablero-personas .tp-busca { margin: 0 0 8px; }
.tablero-personas .tp-busca input { max-width: none; }
.tablero-barra { min-height: 0; }
