/* Trail Tracker · tema oscuro */
:root {
  color-scheme: dark;
  --bg: #0b0f12;
  --bg2: #0f1418;
  --card: #141a1f;
  --card2: #1a2127;
  --soft: #1c242a;
  --line: #242d34;
  --line2: #1e262c;
  --txt: #e7ecea;
  --muted: #8a979e;
  --muted2: #5f6b72;
  --acc: #ff7a33;
  --acc2: #ff9a5c;
  --accbg: rgba(255, 122, 51, .12);
  --green: #3fb97a;
  --greenbg: rgba(63, 185, 122, .12);
  --red: #f85149;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: var(--txt); background: var(--bg); -webkit-tap-highlight-color: transparent;
  background-image: radial-gradient(1200px 600px at 85% -10%, rgba(255, 122, 51, .07), transparent 60%),
                    radial-gradient(900px 500px at -10% 110%, rgba(63, 185, 122, .05), transparent 60%);
  background-attachment: fixed; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(255, 122, 51, .35); }
* { scrollbar-width: thin; scrollbar-color: #2a343b transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a343b; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- layout ---------- */
.side { position: fixed; left: 0; top: 0; bottom: 0; width: 230px; background: rgba(15, 20, 24, .85); backdrop-filter: blur(12px);
  border-right: 1px solid var(--line); color: var(--muted); padding: 22px 14px; display: flex; flex-direction: column; z-index: 10; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--txt); white-space: nowrap; letter-spacing: -.2px; }
.logo .mk { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--acc2), var(--acc) 60%, #e85d1a);
  display: grid; place-items: center; flex: none; box-shadow: 0 4px 14px rgba(255, 122, 51, .35); }
.logo .mk svg { width: 18px; height: 18px; }
.side .logo { margin: 0 4px 30px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--muted); margin-bottom: 4px;
  font-weight: 500; transition: background .15s, color .15s; position: relative; }
.nav a:hover { background: var(--card); color: var(--txt); }
.nav a.on { background: var(--accbg); color: var(--acc); font-weight: 700; }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--acc); }
.nav svg, .bnav svg { width: 18px; height: 18px; flex: none; }
.side .spacer { flex: 1; }
.userbox { border-top: 1px solid var(--line); padding: 14px 4px 0; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.userbox .av { width: 32px; height: 32px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); display: grid; place-items: center;
  font-weight: 700; color: var(--acc); text-transform: uppercase; flex: none; }
.userbox b { color: var(--txt); display: block; font-size: 13px; }
.userbox button { background: none; border: 0; color: var(--acc); cursor: pointer; padding: 0; }
.main { margin-left: 230px; padding: 26px 32px 44px; max-width: 1580px; }
.mtop, .bnav { display: none; }

.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.top h1 { font-size: 26px; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 800; letter-spacing: -.5px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.back { color: var(--muted); font-size: 12.5px; cursor: pointer; }
.back:hover { color: var(--acc); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- componentes ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: 10px; border: 1px solid transparent;
  background: linear-gradient(180deg, var(--acc2), var(--acc)); color: #1a0d05; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(255, 122, 51, .25); transition: transform .1s, filter .15s, background .15s; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.g { background: var(--card2); color: var(--txt); border-color: var(--line); font-weight: 500; box-shadow: none; }
.btn.g:hover { background: #222b32; filter: none; }
.btn.gr { background: linear-gradient(180deg, #52cc8c, var(--green)); color: #04140b; box-shadow: 0 4px 14px rgba(63, 185, 122, .22); }
.btn.r { background: rgba(248, 81, 73, .08); color: #ff7b72; border-color: rgba(248, 81, 73, .3); font-weight: 500; box-shadow: none; }
.btn.r:hover { background: rgba(248, 81, 73, .16); filter: none; }
.card { background: linear-gradient(180deg, var(--card2), var(--card)); border-radius: var(--radius); border: 1px solid var(--line); padding: 16px;
  min-width: 0; box-shadow: var(--shadow); }
.h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; letter-spacing: -.1px; }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.b-inscrito { background: rgba(88, 166, 255, .12); color: #79b8ff; border-color: rgba(88, 166, 255, .25); }
.b-interesado { background: rgba(139, 152, 160, .12); color: #a9b5bb; border-color: rgba(139, 152, 160, .22); }
.b-finalizada { background: var(--greenbg); color: #56d364; border-color: rgba(63, 185, 122, .28); }
.b-abandono { background: rgba(248, 81, 73, .12); color: #ff7b72; border-color: rgba(248, 81, 73, .28); }
.b-no_presentado { background: rgba(227, 179, 65, .12); color: #e3b341; border-color: rgba(227, 179, 65, .28); }
.idt { white-space: nowrap; }
.idt b { display: inline-block; min-width: 30px; text-align: center; padding: 2px 8px; border-radius: 7px; color: #0b0f12; font-size: 12px; font-weight: 800; }
.idt span { font-size: 11.5px; font-weight: 700; margin-left: 6px; }
.chip { display: inline-block; padding: 6px 13px; border-radius: 20px; border: 1px solid var(--line); font-size: 12.5px; background: var(--card); color: var(--muted);
  cursor: pointer; margin: 0 4px 4px 0; white-space: nowrap; transition: all .15s; }
.chip:hover { color: var(--txt); border-color: #34404a; }
.chip.on { background: var(--txt); color: var(--bg); border-color: var(--txt); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; }
.lbl { font-size: 11px; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; background: var(--bg2); font-size: 13.5px; min-height: 38px;
  color: var(--txt); transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--muted2); }
.input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(255, 122, 51, .18); }
select.input option { background: var(--card); color: var(--txt); }
textarea.input { resize: vertical; min-height: 60px; }
.range { display: flex; gap: 6px; align-items: center; }
.range .input { min-width: 0; }
.kpi { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0;
  box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--acc), transparent 70%); opacity: .7; }
.kpi .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.kpi .v { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; }
.kpi .d { font-size: 11.5px; color: var(--green); margin-top: 2px; }
.stat { padding: 10px 12px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; min-width: 0; }
.stat .v { font-size: 16px; font-weight: 800; margin-top: 3px; white-space: nowrap; }
.stat .s { color: var(--muted); font-size: 11px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 10px 8px; font-weight: 600;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 8px; border-bottom: 1px solid var(--line2); font-size: 13px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; transition: background .12s; }
.tbl tr.click:hover td { background: rgba(255, 255, 255, .025); }
.nowrap { white-space: nowrap; }
.tablewrap { overflow-x: auto; }

/* ---------- inicio ---------- */
.home-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; margin-bottom: 16px; }
.next { display: flex; flex-direction: column; position: relative; overflow: hidden;
  background: radial-gradient(500px 260px at 100% 0%, rgba(255, 122, 51, .18), transparent 70%), linear-gradient(180deg, #1a2228, #12181c);
  border-color: rgba(255, 122, 51, .25); }
.next .tag { font-size: 11px; letter-spacing: 1.5px; color: var(--acc); font-weight: 800; }
.next .title { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.next .meta { color: var(--muted); margin-top: 4px; }
.next .count { font-size: 48px; font-weight: 800; color: var(--acc); line-height: 1; text-align: right; letter-spacing: -1px;
  text-shadow: 0 0 30px rgba(255, 122, 51, .35); }
.next .boxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.next .box { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); border-radius: 11px; padding: 9px 12px; }
.next .box div { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.next .box b { font-size: 17px; }
.next .prof { background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .05); border-radius: 11px; margin-top: 12px; flex: 1; min-height: 130px; position: relative; overflow: hidden; }
.next .prof .chart { position: absolute; inset: 6px; }
.next .foot { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.next .foot a { color: var(--acc); font-weight: 700; }
.cal { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; margin: -4px; width: calc(100% + 8px); }
.cal th { font-size: 11px; color: var(--muted); padding: 4px 0; font-weight: 600; }
.cal td { height: 64px; vertical-align: top; padding: 5px; border-radius: 9px; background: var(--bg2); border: 1px solid var(--line2); font-size: 11.5px; }
.cal td.out { background: transparent; border-color: transparent; color: var(--muted2); }
.cal td.today { border-color: var(--acc); background: var(--accbg); }
.cal td.today .dn { color: var(--acc); font-weight: 800; }
.cal .ev { display: block; margin-top: 3px; background: linear-gradient(180deg, var(--acc2), var(--acc)); color: #1a0d05; border-radius: 6px; padding: 3px 5px;
  font-size: 10px; font-weight: 800; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; cursor: pointer; }
.cal .ev.past { background: #3a454d; color: var(--txt); }
.calhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mlist { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 9px; }
.dbox { width: 50px; text-align: center; background: var(--accbg); border: 1px solid rgba(255, 122, 51, .2); border-radius: 10px; padding: 5px 0; flex: none; }
.dbox b { display: block; font-size: 19px; color: var(--acc); line-height: 1.1; }
.dbox span { font-size: 10px; color: var(--muted); }

/* ---------- carreras ---------- */
.filters { display: grid; grid-template-columns: 1.6fr .7fr 1fr 1fr .8fr 1fr; gap: 10px; align-items: end; margin-top: 10px; }
.rcard { padding: 12px 14px; margin-bottom: 9px; cursor: pointer; display: block; }
.rcard .r1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rcard .r2 { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12.5px; }
.legend { font-size: 11.5px; color: var(--muted); margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- ficha ---------- */
.race-grid { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(290px, 1fr); gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; }
.tip { position: absolute; pointer-events: none; background: rgba(11, 15, 18, .92); border: 1px solid var(--line); color: var(--muted); border-radius: 9px;
  padding: 7px 11px; font-size: 11.5px; white-space: nowrap; display: none; z-index: 5; backdrop-filter: blur(6px); box-shadow: 0 8px 20px rgba(0, 0, 0, .4); }
.tip b { color: var(--txt); }
.bandrow { display: flex; align-items: center; margin-bottom: 7px; font-size: 12px; gap: 8px; }
.bandrow .n { width: 70px; color: var(--muted); }
.bandrow .bar { flex: 1; background: var(--bg2); border-radius: 5px; height: 12px; overflow: hidden; }
.bandrow .bar div { height: 12px; border-radius: 5px; }
.bandrow .k { width: 64px; text-align: right; }
.idtcard { text-align: center; }
.idtcard .big { font-size: 56px; font-weight: 800; line-height: 1.05; letter-spacing: -2px; }
.idtcard .badge { color: #0b0f12 !important; border: 0; }
.scale { margin: 14px 4px 0; height: 8px; border-radius: 6px; overflow: hidden; position: relative;
  background: linear-gradient(90deg, #3fb97a 0 15%, #e3b341 15% 30%, #f0883e 30% 50%, #f85149 50% 80%, #a371f7 80% 100%); opacity: .9; }
.scale div { position: absolute; top: -1px; bottom: -1px; width: 3px !important; background: #fff !important; border-radius: 2px; box-shadow: 0 0 8px #fff; }
.scalelbl { font-size: 9.5px; color: var(--muted); display: flex; justify-content: space-between; margin: 4px 4px 0; }
.pleg { font-size: 11px; display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); }
.pleg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.menu { position: relative; display: inline-block; }
.menu .pop { position: absolute; right: 0; top: 42px; background: var(--card2); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5); min-width: 200px; z-index: 30; padding: 6px; display: none; }
.menu.open .pop { display: block; }
.menu .pop div { padding: 9px 11px; border-radius: 8px; cursor: pointer; }
.menu .pop div:hover { background: var(--soft); }

/* ---------- estadísticas ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 14px; }
.st-grid1 { display: grid; grid-template-columns: 1fr 1.7fr 1fr; gap: 14px; margin-bottom: 14px; }
.st-grid2 { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 14px; }
.donutwrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.donutleg div { margin-bottom: 7px; font-size: 12px; color: var(--muted); }
.donutleg b { color: var(--txt); }
.donutleg i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }

/* ---------- modal / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(3, 6, 8, .7); backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: flex-start;
  justify-content: center; padding: 50px 14px; overflow-y: auto; }
.modal { background: linear-gradient(180deg, #1b2329, #151b20); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; width: 100%; max-width: 620px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.modal .mh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal .mh h3 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.modal .x { background: var(--bg2); border: 1px solid var(--line); width: 32px; height: 32px; border-radius: 9px; font-size: 15px; color: var(--muted); cursor: pointer; }
.modal .x:hover { color: var(--txt); }
.frow { display: grid; gap: 12px; margin-bottom: 12px; }
.drop { display: block; border: 1.5px dashed #34414a; border-radius: 12px; padding: 16px; text-align: center; background: var(--bg2); cursor: pointer;
  color: var(--muted); transition: border-color .15s, background .15s; }
.drop b { color: var(--txt); }
.drop:hover { border-color: #4a5862; }
.drop.over { border-color: var(--acc); background: var(--accbg); }
[hidden], .drop input[type=file] { display: none !important; }
.drop .ok { margin-top: 6px; font-size: 12.5px; color: var(--green); }
.drop .err { margin-top: 6px; font-size: 12.5px; color: #ff7b72; }
.mfoot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.preview { background: var(--greenbg); border: 1px solid rgba(63, 185, 122, .22); border-radius: 12px; padding: 12px; }
.preview > .lbl { color: var(--green) !important; }
.formerr { color: #ff7b72; font-size: 13px; margin-top: 10px; min-height: 1px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--card2); border: 1px solid var(--line); color: var(--txt);
  padding: 11px 18px; border-radius: 11px; font-size: 13px; z-index: 200; display: none; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
#toast.err { border-color: rgba(248, 81, 73, .5); color: #ff7b72; }

/* ---------- login ---------- */
.login-bg { min-height: 100vh; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-bg svg.mount { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 42%; }
.login-card { position: relative; background: linear-gradient(180deg, rgba(27, 35, 41, .9), rgba(20, 26, 31, .9)); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 20px; padding: 32px; width: 100%; max-width: 390px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.login-card .logo { justify-content: center; margin-bottom: 6px; font-size: 20px; }
.login-card .field { margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 4px 0 20px; cursor: pointer; color: var(--muted); }
.check input { width: 16px; height: 16px; accent-color: var(--acc); }

/* ---------- responsive ---------- */
.only-mobile { display: none !important; }
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .st-grid1, .st-grid2 { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 1fr 1fr 1fr; }
  .race-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .only-mobile { display: block !important; }
  .only-desktop { display: none !important; }
  .side { display: none; }
  .main { margin-left: 0; padding: 14px 14px 96px; }
  .mtop { display: flex; position: sticky; top: 0; z-index: 20; background: rgba(11, 15, 18, .85); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line); padding: 12px 16px; justify-content: space-between; align-items: center; }
  .mtop .logo { font-size: 17px; }
  .mtop .logo .mk { width: 30px; height: 30px; }
  .mtop button { background: none; border: 0; color: var(--txt); font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
  .mtop button[data-new] { color: var(--acc); }
  .bnav { display: flex; position: fixed; left: 10px; right: 10px; bottom: 10px; background: rgba(20, 26, 31, .9); backdrop-filter: blur(14px);
    border: 1px solid var(--line); border-radius: 18px; z-index: 20; margin-bottom: env(safe-area-inset-bottom); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
  .bnav a { flex: 1; text-align: center; padding: 9px 0 10px; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; }
  .bnav a.on { color: var(--acc); font-weight: 700; }
  .top h1 { font-size: 22px; }
  .top > .actions .btn.newbtn { display: none; }
  .home-grid, .row2, .st-grid1, .st-grid2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .fq { grid-column: 1 / -1; }
  .filters.collapsed { display: none; }
  .chips.scroll { flex-wrap: nowrap; overflow-x: auto; }
  .next .title { font-size: 20px; }
  .next .count { font-size: 36px; }
  .next .boxes { gap: 6px; }
  .next .box { padding: 7px 8px; }
  .next .box b { font-size: 14px; }
  .modal { padding: 18px 16px; }
  .overlay { padding: 14px 8px; }
  .frow { grid-template-columns: 1fr 1fr !important; }
  .frow .full { grid-column: 1 / -1; }
}

/* ================= v1.2 · ajustes responsive ================= */
.clamp1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2, .clamp3 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.clamp3 { -webkit-line-clamp: 3; }
.htitle { overflow-wrap: anywhere; }
.top > div:first-child { min-width: 0; flex: 1 1 320px; }
.tbl .c-name { min-width: 170px; }
.tbl .c-name b { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tbl .c-lugar { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .sl { display: none; color: var(--muted); font-size: 11.5px; margin-top: 2px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next .prof.noprof { display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.next .prof.noprof a { color: var(--acc); font-weight: 700; }
.cal .ev .evt { display: block; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.cal .ev .evk { display: block; font-weight: 500; }
.cal .ev { display: block; -webkit-line-clamp: unset; }
#calcard { container-type: inline-size; }
@container (max-width: 470px) {
  .cal td { height: 54px; }
  .cal .ev { height: 7px; padding: 0; margin-top: 4px; border-radius: 4px; font-size: 0; }
  .cal .ev .evt, .cal .ev .evk { display: none; }
}
.st-grid1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(250px, 1fr); }
.st-grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, 1.15fr); }
.donutleg div { white-space: nowrap; }

/* tablas: ocultar Lugar y GPX y mostrar el lugar bajo el nombre */
@media (max-width: 1440px) {
  .tbl .c-lugar, .tbl .c-gpx { display: none; }
  .tbl .sl { display: block; }
  .tbl.races .idt span { display: none; }
}

/* barra lateral compacta (solo iconos) en pantallas medianas */
@media (min-width: 861px) and (max-width: 1100px) {
  .side { width: 76px; padding: 18px 10px; align-items: center; }
  .side .logo { margin: 0 0 26px; font-size: 0; gap: 0; }
  .nav a { justify-content: center; padding: 11px; }
  .nav a span { display: none; }
  .nav a.on::before { left: -10px; }
  .userbox { flex-direction: column; padding-top: 12px; text-align: center; }
  .userbox > div:last-child { font-size: 0; }
  .userbox > div:last-child b { display: none; }
  .userbox button { font-size: 11px; }
  .main { margin-left: 76px; padding: 22px 22px 40px; }
}

/* ficha: en 1 columna, IDT y Resultado van justo después del perfil */
@media (max-width: 1180px) {
  .race-grid { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
  .race-grid > .col { display: contents; }
  .o-prof { order: 1; } .o-idt { order: 2; } .o-res { order: 3; } .o-cmp { order: 4; } .o-notes { order: 5; }
  .st-grid1 > .span-t, .st-grid2 > .span-t { grid-column: 1 / -1; }
  .st-grid1 { grid-template-columns: 1fr 1fr; }
  .st-grid2 { grid-template-columns: 1fr 1fr; }
}

/* tablet vertical: aprovechar 2 columnas */
@media (min-width: 600px) and (max-width: 860px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .st-grid1, .st-grid2 { grid-template-columns: 1fr 1fr; }
  .row2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 599px) {
  .st-grid1, .st-grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .menu .pop { max-width: calc(100vw - 28px); }
  .mtop .logo span { overflow: hidden; text-overflow: ellipsis; }
  .next .title { -webkit-line-clamp: 3; }
}
@media (max-width: 380px) {
  .next .boxes { grid-template-columns: 1fr 1fr; }
  .next .boxes .box:last-child { grid-column: 1 / -1; }
  .btn { padding: 8px 12px; }
}
