:root {
  --bg: #07111f;
  --surface: #0d1a2b;
  --surface-2: #132238;
  --surface-3: #182b45;
  --text: #eef5ff;
  --muted: #95a8bf;
  --line: rgba(164, 190, 220, .16);
  --line-strong: rgba(164, 190, 220, .28);
  --accent: #38d39f;
  --accent-2: #4ea1ff;
  --danger: #ff6b7a;
  --warning: #f6c85f;
  --success: #4cdfa0;
  --live: #ff4d5f;
  --shadow: 0 16px 44px rgba(0, 0, 0, .24);
  --radius: 16px;
  --radius-sm: 11px;
  --sidebar: 226px;
  --topbar: 74px;
  --density-gap: 14px;
  --density-pad: 15px;
}


html[data-theme="dark"] {
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #edf2f8;
  --text: #122033;
  --muted: #5f7186;
  --line: rgba(24, 52, 82, .12);
  --line-strong: rgba(24, 52, 82, .22);
  --shadow: 0 14px 36px rgba(25, 45, 68, .11);
}

html[data-theme="system"] { color-scheme: dark light; }
@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    --bg: #f3f6fa; --surface: #ffffff; --surface-2: #f7f9fc; --surface-3: #edf2f8;
    --text: #122033; --muted: #5f7186; --line: rgba(24,52,82,.12); --line-strong: rgba(24,52,82,.22);
    --shadow: 0 14px 36px rgba(25,45,68,.11);
  }
}
html[data-density="compact"] { --density-gap: 8px; --density-pad: 10px; }

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-2); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 18px 13px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); z-index: 30; }
.brand { display: flex; align-items: center; gap: 11px; padding: 7px 8px 20px; }
.brand strong { display: block; letter-spacing: .1em; font-size: 15px; }
.brand span { display: block; color: var(--muted); font-size: 11px; }
.brand.compact { padding: 0 0 14px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-weight: 900; letter-spacing: -.04em; color: #06150f; background: linear-gradient(135deg, #5ff2bd, #2db58a); box-shadow: 0 8px 22px rgba(56, 211, 159, .2); }
.brand-mark.small { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.brand-mark.large { width: 66px; height: 66px; border-radius: 20px; font-size: 20px; }

.main-nav { display: grid; gap: 5px; }
.main-nav button { width: 100%; border: 0; border-radius: 11px; background: transparent; color: var(--muted); padding: 11px 12px; display: flex; gap: 10px; align-items: center; text-align: left; }
.main-nav button:hover { background: var(--surface-2); color: var(--text); }
.main-nav button.active { background: linear-gradient(90deg, rgba(56,211,159,.16), rgba(56,211,159,.04)); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.main-nav button span { width: 20px; text-align: center; }
.main-nav button b { font-weight: 650; }
.admin-nav { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.admin-nav p { margin: 0 9px 6px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.sidebar-foot { margin-top: auto; display: grid; gap: 9px; padding: 12px 8px 2px; }
.role-badge, .top-role, .access-chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 6px 10px; font-size: 11px; }
.role-badge.admin, .top-role.admin { color: var(--warning); border-color: rgba(246,200,95,.35); }
.link-button { border: 0; background: transparent; padding: 3px; color: var(--accent-2); text-align: left; }
.legal-mini { display: flex; gap: 10px; font-size: 11px; }
.version-label { color: var(--muted); font-size: 10px; }

.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 25; height: var(--topbar); padding: 12px 22px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); }
.topbar h1 { margin: 0; font-size: 20px; }
.topbar p { margin: 2px 0 0; font-size: 11px; }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.mobile-brand { display: none; align-items: center; gap: 8px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button, .ghost, .primary, .today-button, .date-arrow, .access-chip { border: 1px solid var(--line); border-radius: 10px; min-height: 36px; padding: 8px 12px; background: var(--surface-2); }
.icon-button { width: 38px; padding: 0; display: grid; place-items: center; }
.primary { border-color: transparent; background: var(--accent); color: #06150f; font-weight: 750; }
.primary:disabled { opacity: .5; cursor: not-allowed; }
.ghost:hover, .icon-button:hover { border-color: var(--line-strong); background: var(--surface-3); }
.access-chip { display: none; }

main { min-height: calc(100vh - var(--topbar)); }
.tab { display: none; }
.tab.active { display: block; }
.home-tab { padding: 13px 16px 20px; }
.standard-tab { padding: 22px; max-width: 1320px; margin: 0 auto; }
.section-title { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.section-title h2 { margin: 0; font-size: 22px; }
.section-title p { margin: 4px 0 0; }

.home-tools { display: flex; align-items: center; gap: 12px; max-width: 1250px; margin: 0 auto 10px; }
.search-box { flex: 1; min-width: 180px; height: 42px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; }
.main-filters { display: flex; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.main-filters button, .segmented button, .detail-tabs button, .analysis-nav button { border: 0; border-radius: 9px; padding: 8px 12px; background: transparent; color: var(--muted); white-space: nowrap; }
.main-filters button.active, .segmented button.active, .detail-tabs button.active, .analysis-nav button.active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.competition-picker { max-width: 1250px; margin: 0 auto 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.picker-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.league-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.league-chip { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 7px 11px; }
.league-chip.selected { border-color: var(--accent); color: var(--accent); }

.date-strip { max-width: 1250px; margin: 0 auto 10px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto 38px; gap: 8px; align-items: stretch; }
.date-buttons { display: grid; grid-template-columns: repeat(7, minmax(68px, 1fr)); gap: 6px; }
.date-buttons button { min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); padding: 7px 4px; display: grid; gap: 1px; color: var(--muted); }
.date-buttons button strong { color: var(--text); }
.date-buttons button.active { border-color: var(--accent); background: rgba(56,211,159,.1); }
.date-buttons button.today strong { color: var(--accent); }

.home-content { max-width: 1250px; margin: 0 auto; min-height: calc(100vh - 204px); display: grid; grid-template-columns: minmax(330px, 42%) minmax(0, 58%); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.match-list-panel { min-width: 0; border-right: 1px solid var(--line); background: var(--surface); }
.list-heading { padding: 14px 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.list-heading h2 { margin: 0; font-size: 17px; }
.list-heading p { margin: 2px 0 0; font-size: 11px; }
.live-automatic { color: var(--live); font-size: 10px; font-weight: 900; letter-spacing: .05em; animation: livePulse 1.4s ease-in-out infinite; }
.desktop-match-list { max-height: calc(100vh - 270px); overflow: auto; overscroll-behavior: contain; }
.competition-group { border-bottom: 1px solid var(--line); }
.competition-head { width: 100%; border: 0; background: var(--surface-2); padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; text-align: left; }
.competition-head strong { font-size: 12px; }
.competition-head span { color: var(--muted); font-size: 11px; }
.competition-group.collapsed .competition-body { display: none; }
.match-card { position: relative; padding: var(--density-pad); display: grid; grid-template-columns: 78px minmax(0,1fr) 38px; gap: 10px; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; }
.match-card, .match-card * { touch-action: pan-y pinch-zoom; }
.match-card { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.match-card img { pointer-events: none; -webkit-user-drag: none; user-select: none; }
.match-card.is-touch-scrolling { cursor: default; }

.match-card:hover { background: var(--surface-2); }
.match-card.selected { background: rgba(78,161,255,.08); box-shadow: inset 3px 0 0 var(--accent-2); }
.match-time { display: grid; align-content: center; gap: 3px; font-size: 11px; color: var(--muted); }
.match-time strong { color: var(--text); font-size: 13px; }
.match-teams { display: grid; gap: 7px; min-width: 0; }
.team-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; min-width: 0; }
.team-row img, .team-logo { width: 24px; height: 24px; object-fit: contain; }
.team-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.favorite-button { border: 0; background: transparent; color: var(--muted); font-size: 19px; }
.favorite-button.active { color: var(--warning); }
.minute-confirmed { color: var(--live); font-weight: 900; text-shadow: 0 0 14px color-mix(in srgb, var(--live) 55%, transparent); }
.minute-estimated { color: var(--warning); font-size: 10px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 7px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 9px; line-height: 1.2; }
.badge.live, .badge.half { color: var(--live); border-color: color-mix(in srgb, var(--live) 45%, transparent); background: color-mix(in srgb, var(--live) 10%, var(--surface-2)); }
.badge.final { color: var(--accent-2); }
.badge.delayed, .badge.postponed, .badge.rescheduled { color: var(--warning); border-color: rgba(246,200,95,.35); }
.badge.cancelled, .badge.suspended { color: var(--danger); border-color: rgba(255,107,122,.35); }

.detail-pane { min-width: 0; background: var(--surface-2); }
.detail-empty { height: 100%; min-height: 550px; display: grid; place-content: center; justify-items: center; text-align: center; padding: 30px; color: var(--muted); }
.detail-empty h2 { color: var(--text); margin-bottom: 4px; }
.detail-shell { min-height: 100%; }
.mobile-back { display: none; width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 11px 14px; text-align: left; background: var(--surface); }
.match-hero { padding: 18px 20px 14px; background: linear-gradient(135deg, rgba(78,161,255,.08), rgba(56,211,159,.05)); border-bottom: 1px solid var(--line); }
.hero-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; color: var(--muted); font-size: 11px; }
.hero-score { display: grid; grid-template-columns: minmax(0,1fr) 126px minmax(0,1fr); align-items: center; gap: 16px; margin-top: 12px; }
.hero-team { display: grid; justify-items: center; gap: 7px; text-align: center; }
.hero-team img { width: 58px; height: 58px; object-fit: contain; }
.hero-team strong { font-size: 15px; }
.hero-center { display: grid; place-items: center; gap: 4px; text-align: center; }
.hero-center .score { font-size: 27px; font-weight: 900; }
.hero-center .kickoff { color: var(--muted); font-size: 11px; }
.reschedule-note { margin-top: 11px; padding: 9px 11px; border-radius: 10px; background: rgba(246,200,95,.1); color: var(--warning); font-size: 11px; }
.detail-actions { padding: 10px 14px; display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); background: var(--surface); }
.detail-tabs { display: flex; gap: 5px; overflow-x: auto; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface); scrollbar-width: thin; }
.detail-content { padding: 14px; min-height: 380px; }

.stack { display: grid; gap: var(--density-gap); }
.card, .section-block { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--density-pad); }
.card.elevated { box-shadow: 0 7px 20px rgba(0,0,0,.06); }
.card-title, .dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.card h3, .section-block h3 { margin: 0 0 10px; font-size: 14px; }
.card p { margin: 7px 0; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 8px; }
.metrics.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.metrics.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.metric { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.metric span, .metric small { display: block; color: var(--muted); font-size: 10px; }
.metric strong { display: block; margin: 3px 0; font-size: 16px; overflow-wrap: anywhere; }
.notice { border-radius: 11px; padding: 10px 12px; background: rgba(78,161,255,.09); border: 1px solid rgba(78,161,255,.18); }
.notice.warning { background: rgba(246,200,95,.09); border-color: rgba(246,200,95,.2); }
.notice.error { background: rgba(255,107,122,.09); border-color: rgba(255,107,122,.2); }
.empty, .loading { min-height: 130px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; }
.loading::before { content: ""; width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.analysis-nav { display: flex; gap: 5px; overflow-x: auto; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.analysis-layout { display: grid; gap: 12px; }
.analysis-header { border-left: 4px solid var(--accent); }
.score-bar { display: grid; gap: 5px; }
.score-bar-head { display: flex; justify-content: space-between; }
.score-track { height: 7px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.score-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.quality-grid, .availability-grid, .pick-grid, .evaluation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 9px; }
.quality-card, .availability, .pick-card, .evaluation-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 11px; }
.quality-card strong, .availability strong, .pick-card strong { display: block; margin-bottom: 4px; }
.quality-pill { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: 10px; background: var(--surface-3); }
.quality-pill.good { color: var(--success); }.quality-pill.mid { color: var(--warning); }.quality-pill.bad { color: var(--danger); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 520px; background: var(--surface); }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; }
th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); }
.matrix { display: grid; gap: 3px; min-width: 360px; }
.matrix-cell { min-height: 38px; display: grid; place-items: center; border-radius: 7px; background: var(--surface-2); font-size: 10px; }
.matrix-cell.label { color: var(--muted); background: transparent; }
.matrix-cell.heat-1 { background: rgba(78,161,255,.12); }.matrix-cell.heat-2 { background: rgba(78,161,255,.22); }.matrix-cell.heat-3 { background: rgba(56,211,159,.25); }.matrix-cell.heat-4 { background: rgba(56,211,159,.4); color: var(--text); font-weight: 800; }
.raw-details summary { cursor: pointer; color: var(--accent-2); }
.raw-details pre { max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; padding: 10px; border-radius: 10px; background: var(--surface-2); font-size: 10px; }

.lineup-toolbar { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.segmented { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); overflow-x: auto; }
.lineup-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.lineup-team-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.lineup-team-head { padding: 12px; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.pitch { position: relative; min-height: 470px; margin: 12px; border: 2px solid rgba(255,255,255,.65); border-radius: 9px; overflow: hidden; background: linear-gradient(90deg, #167241 0 10%, #1b7b48 10% 20%, #167241 20% 30%, #1b7b48 30% 40%, #167241 40% 50%, #1b7b48 50% 60%, #167241 60% 70%, #1b7b48 70% 80%, #167241 80% 90%, #1b7b48 90% 100%); }
.pitch::before { content: ""; position: absolute; inset: 50% 0 auto; border-top: 2px solid rgba(255,255,255,.65); }
.pitch::after { content: ""; position: absolute; width: 90px; height: 90px; border: 2px solid rgba(255,255,255,.65); border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%,-50%); }
.pitch-player { position: absolute; transform: translate(-50%,-50%); width: 78px; z-index: 2; text-align: center; color: white; text-shadow: 0 1px 3px #000; }
.player-dot { width: 31px; height: 31px; margin: 0 auto 3px; border-radius: 50%; display: grid; place-items: center; background: #08223a; border: 2px solid white; font-size: 10px; font-weight: 800; }
.pitch-player.captain .player-dot::after { content: "C"; position: absolute; transform: translate(17px,-13px); width: 14px; height: 14px; border-radius: 50%; background: var(--warning); color: #111; font-size: 8px; display: grid; place-items: center; text-shadow: none; }
.pitch-player small { display: block; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lineup-lists { padding: 0 12px 12px; display: grid; gap: 8px; }
.player-list { display: flex; flex-wrap: wrap; gap: 5px; }
.player-list span { border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); padding: 4px 7px; font-size: 10px; }
.change-list { display: grid; gap: 5px; }
.change-in { color: var(--success); }.change-out { color: var(--danger); }

.live-scoreboard { display: grid; grid-template-columns: 1fr 150px 1fr; align-items: center; gap: 15px; padding: 18px; border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in srgb, var(--live) 12%, transparent), rgba(78,161,255,.08)); border: 1px solid var(--line); }
.live-scoreboard > div { display: grid; justify-items: center; gap: 6px; text-align: center; }
.live-scoreboard img { width: 56px; height: 56px; object-fit: contain; }
.live-scoreboard section { text-align: center; }
.live-scoreboard section b { display: block; font-size: 28px; }
.live-timeline { display: grid; gap: 7px; }
.live-event { display: grid; grid-template-columns: 44px 1fr; gap: 9px; padding: 9px; border-bottom: 1px solid var(--line); }
.live-event small { display: block; color: var(--muted); }

.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 11px; }
.config-field, .editor-controls label { display: grid; gap: 6px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.config-field span, .editor-controls span { color: var(--muted); font-size: 11px; }
.config-field select, .config-field input, .editor-controls select, .editor-controls input, .token-dialog input { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 9px 10px; }
.admin-config { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }

.history-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; }
.history-result { min-width: 115px; text-align: right; }
.history-result strong { display: block; font-size: 21px; }
.family-row { display: flex; gap: 6px; flex-wrap: wrap; grid-column: 1 / -1; }
.family-row span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 10px; }

.token-dialog, .lineup-editor-dialog { width: min(94vw, 560px); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); padding: 0; box-shadow: var(--shadow); }
.lineup-editor-dialog { width: min(96vw, 820px); }
.token-dialog::backdrop, .lineup-editor-dialog::backdrop { background: rgba(0,0,0,.62); backdrop-filter: blur(3px); }
.token-dialog form, .lineup-editor-dialog form { padding: 20px; display: grid; gap: 12px; }
.editor-controls { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.lineup-player-list { max-height: 52vh; overflow: auto; display: grid; gap: 6px; }
.editor-player { display: grid; grid-template-columns: 24px minmax(0,1fr) 90px 74px; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.editor-player[draggable="true"] { cursor: grab; }
.editor-player.dragging { opacity: .45; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; right: 18px; bottom: 18px; max-width: min(390px, calc(100vw - 36px)); padding: 11px 14px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); transform: translateY(30px); opacity: 0; pointer-events: none; transition: .2s; z-index: 100; }
.toast.show { transform: none; opacity: 1; }
.toast.error { background: var(--danger); color: white; }
.connection-badge, .update-banner { position: fixed; z-index: 110; }
.connection-badge { left: 50%; top: 8px; transform: translateX(-50%); padding: 7px 11px; border-radius: 999px; background: var(--warning); color: #111; }
.update-banner { left: 50%; bottom: 16px; transform: translateX(-50%); width: min(94vw, 520px); display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.app-footer { padding: 18px 22px; display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 11px; }
.app-footer nav { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 1020px) {
  :root { --sidebar: 78px; }
  .brand > div:not(.brand-mark), .main-nav button b, .admin-nav p, .sidebar-foot > *:not(.role-badge) { display: none; }
  .sidebar { align-items: center; }
  .main-nav button { justify-content: center; padding: 11px; }
  .main-nav button span { width: auto; }
  .role-badge { width: 38px; height: 38px; padding: 0; overflow: hidden; display: grid; place-items: center; font-size: 0; }
  .role-badge::before { content: "●"; font-size: 12px; }
  .home-content { grid-template-columns: 42% 58%; }
}

@media (max-width: 760px) {
  :root { --topbar: 64px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: 100%; height: 64px; padding: 6px 9px calc(6px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line); flex-direction: row; z-index: 60; }
  .sidebar .brand, .sidebar-foot, .admin-nav { display: none !important; }
  .main-nav { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .main-nav > button { display: flex; justify-content: center; }
  .main-nav button b { display: block; }
  .workspace { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .topbar { padding: 9px 12px; }
  .topbar h1 { font-size: 15px; }
  .mobile-brand { display: flex; }
  .topbar-title > div:nth-child(2) { display: none; }
  .top-role { display: none; }
  .access-chip { display: inline-flex; align-items: center; }
  .home-tab { padding: 9px 8px 14px; }
  .home-tools { display: grid; gap: 8px; }
  .main-filters { display: grid; grid-template-columns: repeat(3,1fr); }
  .main-filters button { padding: 8px 5px; }
  .date-strip { grid-template-columns: 32px minmax(0,1fr) auto 32px; }
  .date-buttons { display: flex; overflow-x: auto; }
  .date-buttons button { min-width: 64px; }
  .home-content { display: block; min-height: calc(100vh - 215px); }
  .match-list-panel { border: 0; }
  .desktop-match-list { max-height: none; }
  .detail-pane { position: fixed; inset: 0 0 calc(64px + env(safe-area-inset-bottom)) 0; z-index: 55; transform: translateX(105%); transition: transform .22s ease; overflow: auto; background: var(--surface-2); }
  .detail-pane.mobile-open { transform: none; pointer-events: auto; }
  .mobile-back { display: block; position: sticky; top: 0; z-index: 5; }
  .hero-score { grid-template-columns: 1fr 90px 1fr; gap: 8px; }
  .hero-team img { width: 46px; height: 46px; }
  .hero-team strong { font-size: 12px; }
  .detail-content { padding: 10px; }
  .metrics.two, .metrics.three, .lineup-grid, .editor-controls { grid-template-columns: 1fr; }
  .lineup-grid { gap: 10px; }
  .pitch { min-height: 430px; }
  .live-scoreboard { grid-template-columns: 1fr 110px 1fr; padding: 12px; }
  .live-scoreboard img { width: 42px; height: 42px; }
  .history-card { grid-template-columns: 1fr; }
  .history-result { text-align: left; }
  .editor-player { grid-template-columns: 22px minmax(0,1fr) 72px; }
  .editor-player .bench-toggle { grid-column: 2 / -1; }
  .app-footer { padding-bottom: 76px; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }


/* V28.5.1 · Correcciones de experiencia del análisis */
.pick-indicators { display: block; margin-top: 5px; color: var(--accent-2); }
.adjustment-card { border-left: 4px solid var(--accent-2); }
.adjustment-explanation { margin: 10px 0 0; color: var(--muted); line-height: 1.55; }
.classification-team { display: flex; align-items: center; gap: 8px; min-width: 230px; }
.classification-team .team-logo { width: 25px; height: 25px; }
.team-marker { margin-left: auto; border-radius: 999px; padding: 3px 7px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.team-marker.local { color: var(--accent); background: rgba(56,211,159,.12); border: 1px solid rgba(56,211,159,.28); }
.team-marker.away { color: var(--accent-2); background: rgba(78,161,255,.12); border: 1px solid rgba(78,161,255,.28); }
.classification-row.local-team td { background: rgba(56,211,159,.08); }
.classification-row.away-team td { background: rgba(78,161,255,.08); }
.classification-row.local-team td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.classification-row.away-team td:first-child { box-shadow: inset 4px 0 0 var(--accent-2); }

@media (min-width: 761px) {
  .home-content { height: calc(100vh - 204px); min-height: 560px; }
  .match-list-panel { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); overflow: hidden; }
  .desktop-match-list { min-height: 0; height: 100%; max-height: none; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  .detail-pane { height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  .detail-shell { min-height: 100%; }
  .detail-tabs { position: sticky; top: 0; z-index: 8; box-shadow: 0 1px 0 var(--line); }
  .analysis-nav { position: sticky; top: 48px; z-index: 7; scrollbar-gutter: stable; }
}


/* V28.7 · Automatización, perfiles, evolución y desplazamiento móvil */
@keyframes livePulse { 0%,100% { opacity: .72; } 50% { opacity: 1; } }
.automation-notice { display: grid; gap: 3px; border-left: 4px solid var(--accent-2); }
.automation-notice.confirmed { border-left-color: var(--success); background: color-mix(in srgb, var(--success) 8%, var(--surface)); }
.automation-notice strong { color: var(--text); }
.automation-notice span { color: var(--muted); }
.confirmed-lineup { color: var(--success) !important; border-color: color-mix(in srgb, var(--success) 40%, transparent) !important; }
.automation-list { display: grid; gap: 8px; }
.automation-row, .automation-note { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.automation-row small, .automation-note small { color: var(--muted); }
.automation-row p, .automation-note span { grid-column: 1 / -1; margin: 0; }
.event-icon { display: inline-grid; min-width: 20px; place-items: center; }
.live-event.goal { border-left: 3px solid var(--live); }
.live-event.card { border-left: 3px solid var(--warning); }

@media (max-width: 760px) {
  html, body { width: 100%; min-height: 100%; overflow-x: hidden; overscroll-behavior-x: none; }
  body { touch-action: pan-y pinch-zoom; }
  body.detail-open { overflow: hidden; width: 100%; overscroll-behavior: none; }
  .workspace, main, .home-tab, .home-content, .match-list-panel { min-height: 0; }
  .desktop-match-list {
    max-height: none;
    height: auto;
    overflow: visible !important;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
  }
  .match-card, .match-card *, .favorite-button { touch-action: pan-y pinch-zoom; }

  .detail-pane {
    height: calc(100vh - 64px - env(safe-area-inset-bottom));
    height: calc(100dvh - 64px - env(safe-area-inset-bottom));
    max-height: calc(100vh - 64px - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 64px - env(safe-area-inset-bottom));
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    scroll-behavior: smooth;
  }
  .detail-shell { min-height: max-content; height: auto; overflow: visible; }
  .detail-content, .stack, .card, .table-wrap, .lineup-team-card { touch-action: pan-y; }
  .detail-tabs { position: sticky; top: 43px; z-index: 9; }
  .analysis-nav { position: sticky; top: 88px; z-index: 8; }
  .mobile-back { min-height: 43px; }
  .automation-row, .automation-note { grid-template-columns: 1fr; }
}

.automation-changes { color: var(--accent-2); font-size: 11px; font-weight: 700; }

/* V28.7 · Perfiles de equipos, búsqueda y evolución ordenada */
.global-search-wrap { position: relative; flex: 1; min-width: 220px; }
.global-search-wrap .search-box { width: 100%; }
.global-search-results { position: absolute; z-index: 40; top: calc(100% + 7px); left: 0; right: 0; max-height: min(70vh, 560px); overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.global-search-results > strong { display: block; padding: 8px 9px 5px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.global-search-results button { width: 100%; display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 2px 9px; align-items: center; padding: 9px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.global-search-results button:hover { background: var(--surface-2); }
.global-search-results button .team-logo { grid-row: 1 / 3; width: 30px; height: 30px; }
.global-search-results button small { color: var(--muted); }
.followed-teams { max-width: 1250px; margin: 0 auto 10px; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px; align-items: center; }
.followed-head { display: grid; font-size: 11px; color: var(--muted); }
.followed-head strong { color: var(--text); }
.followed-scroll { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: thin; }
.followed-scroll button { flex: 0 0 auto; display: flex; gap: 7px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: var(--surface); }
.followed-scroll .team-logo { width: 24px; height: 24px; }
.team-link, .team-inline, .hero-team-link, .historical-team, .comparison-team { min-width: 0; display: flex; align-items: center; gap: 8px; }
.team-link.clickable, .team-inline.clickable, .hero-team-link.clickable, .historical-team.clickable, .comparison-team.clickable, [data-open-team] { cursor: pointer; }
.team-inline { display: grid; grid-template-columns: 24px minmax(0,1fr); width: 100%; min-width: 0; }
.team-inline span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-team-link { flex-direction: column; text-align: center; }
.hero-team-link .team-logo { width: 58px; height: 58px; }
.hero-team-link:hover span:last-child, .classification-row[data-open-team]:hover strong { color: var(--accent-2); }
.analysis-state.automatic { color: var(--accent-2); }
.analysis-state.review { color: var(--warning); }
.analysis-state.confirmed-lineup { color: var(--success); }
.analysis-state.frozen { color: var(--muted); }

.team-profile-tab { padding: 14px 16px 24px; }
.team-profile-shell { width: min(1320px, 100%); margin: 0 auto; display: grid; gap: 12px; }
.team-profile-header { position: relative; display: grid; grid-template-columns: minmax(0,1.2fr) auto; gap: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(135deg, color-mix(in srgb,var(--accent-2) 9%,var(--surface)), color-mix(in srgb,var(--accent) 6%,var(--surface))); box-shadow: var(--shadow); }
.team-back { position: absolute; top: 12px; left: 12px; min-height: 31px; padding: 5px 9px; }
.team-identity { display: grid; grid-template-columns: 94px minmax(0,1fr); gap: 16px; align-items: center; padding-top: 22px; }
.team-identity > .team-logo { width: 90px; height: 90px; }
.team-identity h2 { margin: 1px 0 4px; font-size: clamp(24px,3vw,38px); }
.team-identity p { margin: 0 0 8px; color: var(--muted); }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.team-profile-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-content: start; gap: 8px; padding-top: 22px; }
.team-match-snapshot { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.team-match-snapshot > div { display: grid; gap: 3px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb,var(--surface-2) 88%,transparent); }
.team-match-snapshot span, .team-match-snapshot small { color: var(--muted); font-size: 10px; }
.form-strip { display: flex; gap: 4px; align-items: center; }
.form-strip span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: #06110d; font-size: 10px; font-weight: 900; }
.form-g { background: var(--success); }.form-e { background: var(--warning); }.form-p { background: var(--danger); color: white !important; }
.team-profile-toolbar { display: flex; justify-content: flex-end; align-items: center; }
.team-profile-toolbar label { display: grid; gap: 4px; min-width: min(100%,320px); color: var(--muted); font-size: 10px; }
.team-profile-toolbar select, .compare-controls select { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--surface); }
.team-tabs { position: sticky; top: var(--topbar); z-index: 20; display: flex; gap: 5px; overflow-x: auto; padding: 7px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb,var(--surface) 93%,transparent); backdrop-filter: blur(12px); scrollbar-width: thin; }
.team-tabs button { flex: 0 0 auto; border: 0; border-radius: 9px; padding: 9px 13px; background: transparent; color: var(--muted); }
.team-tabs button.active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.team-profile-content { min-height: 420px; }
.team-overview-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(280px,.75fr); gap: 12px; }
.team-stat-grid { display: grid; grid-template-columns: repeat(5,minmax(100px,1fr)); gap: 8px; margin-top: 12px; }
.team-fixture-list { display: grid; gap: 6px; }
.team-fixture-card { width: 100%; display: grid; grid-template-columns: 100px minmax(0,1fr) auto 20px; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); text-align: left; }
.team-fixture-card:hover { border-color: var(--line-strong); background: var(--surface-3); }
.fixture-date { color: var(--muted); font-size: 10px; }
.fixture-opponent { min-width: 0; display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 1px 8px; align-items: center; }
.fixture-opponent .team-logo { grid-row: 1 / 3; width: 27px; height: 27px; }
.fixture-opponent strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fixture-opponent small { color: var(--muted); }
.fixture-result { min-width: 44px; border-radius: 9px; padding: 6px 8px; background: var(--surface); text-align: center; font-weight: 900; }
.fixture-result.win { color: var(--success); }.fixture-result.loss { color: var(--danger); }.fixture-result.draw { color: var(--warning); }
.fixture-action { color: var(--muted); font-size: 20px; }
.team-standings tr.current-team td { background: color-mix(in srgb,var(--accent) 12%,var(--surface)); font-weight: 700; }
.team-standings tr.current-team td:first-child { box-shadow: inset 4px 0 var(--accent); }
.team-standings td:nth-child(2) { min-width: 220px; }
.team-standings td:nth-child(2) .team-logo { vertical-align: middle; margin-right: 8px; }
.team-stat-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.team-stats-sections { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.trend-chart { height: 190px; display: flex; align-items: end; gap: 8px; overflow-x: auto; padding: 15px 4px 4px; }
.trend-column { flex: 1 0 38px; min-width: 38px; height: 100%; display: grid; grid-template-rows: minmax(0,1fr) auto; gap: 5px; justify-items: center; }
.trend-bars { height: 100%; display: flex; gap: 3px; align-items: end; }
.trend-bars i { width: 9px; min-height: 3px; border-radius: 4px 4px 1px 1px; background: var(--accent); }
.trend-bars i + i { background: var(--danger); }
.trend-column span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--surface-3); font-size: 9px; font-weight: 800; }
.squad-groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.squad-list { display: grid; gap: 6px; }
.squad-list article { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.squad-list small { display: block; color: var(--muted); }
.player-number { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); color: var(--accent-2); font-weight: 900; }
.historical-match-hero > div { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 16px; align-items: center; margin: 18px 0; }
.historical-team { flex-direction: column; text-align: center; }
.historical-team:last-child { justify-self: end; }
.historical-team .team-logo { width: 58px; height: 58px; }
.historical-score { font-size: clamp(25px,5vw,40px); }
.fixture-stats-table { display: grid; }
.fixture-stat-head, .fixture-stats-table > div { display: grid; grid-template-columns: minmax(0,1fr) minmax(150px,.8fr) minmax(0,1fr); gap: 12px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); text-align: center; }
.fixture-stat-head { padding: 12px 4px; color: var(--muted); }
.fixture-stats-table > div strong:first-child { text-align: right; }.fixture-stats-table > div strong:last-child { text-align: left; }
.team-compare-dialog { width: min(96vw,900px); border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.team-compare-dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(3px); }
.team-compare-dialog form { padding: 18px; display: grid; gap: 14px; }
.dialog-head { display: flex; justify-content: space-between; gap: 12px; }
.dialog-head h2 { margin: 0; }.dialog-head p { margin: 3px 0 0; }
.compare-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; align-items: end; }
.compare-controls label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.comparison-table { display: grid; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.comparison-table header, .comparison-table > div { display: grid; grid-template-columns: minmax(0,1fr) 150px minmax(0,1fr); gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: center; }
.comparison-table header { background: var(--surface-2); }
.comparison-team { justify-content: center; }.comparison-team .team-logo { width: 40px; height: 40px; }

.evolution-intro { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.evolution-intro h3, .evolution-intro p { margin: 0; }
.evolution-timeline { position: relative; display: grid; gap: 10px; padding-left: 18px; }
.evolution-timeline::before { content: ""; position: absolute; top: 13px; bottom: 13px; left: 7px; width: 2px; background: var(--line-strong); }
.evolution-card { position: relative; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.evolution-card::before { content: ""; position: absolute; left: -17px; top: 17px; width: 11px; height: 11px; border: 3px solid var(--bg); border-radius: 50%; background: var(--accent-2); }
.evolution-card header, .version-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; }
.evolution-card header small, .version-row small { display: block; color: var(--muted); }
.evolution-card .metrics { margin-top: 11px; }
.evolution-card p, .version-row p { margin: 7px 0 0; color: var(--muted); }
.evolution-index { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); color: var(--accent-2); font-weight: 900; }
.version-list { display: grid; gap: 8px; }
.version-row { padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.version-row .raw-details { grid-column: 1 / -1; }
.version-flags { display: flex; gap: 5px; }

@media (max-width: 900px) {
  .team-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .team-overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .team-profile-tab { padding: 8px 8px calc(76px + env(safe-area-inset-bottom)); min-height: calc(100dvh - var(--topbar)); touch-action: pan-y; }
  .team-profile-shell, .team-profile-content, .team-profile-header, .team-overview-grid, .team-stats-sections, .squad-groups { touch-action: pan-y; }
  .team-profile-header { grid-template-columns: 1fr; padding: 17px 13px 13px; gap: 10px; }
  .team-identity { grid-template-columns: 72px minmax(0,1fr); padding-top: 28px; }
  .team-identity > .team-logo { width: 68px; height: 68px; }
  .team-profile-actions { justify-content: flex-start; padding-top: 0; }
  .team-match-snapshot { grid-template-columns: 1fr; }
  .team-tabs { top: var(--topbar); border-radius: 11px; -webkit-overflow-scrolling: touch; }
  .team-profile-toolbar { justify-content: stretch; }
  .team-profile-toolbar label { width: 100%; }
  .team-stat-grid, .team-stats-sections, .squad-groups { grid-template-columns: 1fr; }
  .team-fixture-card { grid-template-columns: 72px minmax(0,1fr) auto 15px; padding: 9px 7px; }
  .fixture-date { font-size: 9px; }
  .team-stat-toolbar, .evolution-intro { align-items: stretch; flex-direction: column; }
  .evolution-controls { display: flex; overflow-x: auto; }
  .historical-match-hero > div { gap: 7px; }
  .historical-team .team-logo { width: 43px; height: 43px; }
  .fixture-stat-head, .fixture-stats-table > div { grid-template-columns: minmax(0,1fr) 120px minmax(0,1fr); gap: 5px; }
  .comparison-table header, .comparison-table > div { grid-template-columns: minmax(0,1fr) 100px minmax(0,1fr); padding: 8px 5px; }
  .compare-controls { grid-template-columns: 1fr; }
  .team-compare-dialog { max-height: 92dvh; overflow-y: auto; }
  .global-search-results { position: fixed; top: calc(var(--topbar) + 54px); left: 8px; right: 8px; max-height: calc(100dvh - 155px); }
  .followed-teams { grid-template-columns: 1fr; }
  body:not(.detail-open) { overflow-y: auto; touch-action: pan-y; }
}

/* V28.8 · partidos en vivo fijados y estadísticas compactas */
.competition-group.live-pinned {
  border: 1px solid color-mix(in srgb, var(--live) 42%, var(--line));
  background: color-mix(in srgb, var(--live) 5%, transparent);
  box-shadow: inset 3px 0 0 var(--live);
}
.live-head { cursor: default; color: var(--live); }
.live-dot { display:inline-block; width:9px; height:9px; margin-right:8px; border-radius:50%; background:var(--live); box-shadow:0 0 0 5px color-mix(in srgb,var(--live) 16%,transparent); animation:livePulse 1.5s infinite; }
@keyframes livePulse { 50% { opacity:.45; transform:scale(.84); } }
.simple-match-stats { display:grid; gap:2px; }
.simple-stat-head, .simple-stat-row { display:grid; grid-template-columns:minmax(70px,1fr) minmax(150px,1.3fr) minmax(70px,1fr); align-items:center; gap:12px; text-align:center; }
.simple-stat-head { padding:4px 0 12px; color:var(--muted); }
.simple-stat-head strong:first-child, .simple-stat-row > strong:first-child { text-align:right; }
.simple-stat-head strong:last-child, .simple-stat-row > strong:last-child { text-align:left; }
.simple-stat-row { padding:10px 0; border-top:1px solid var(--line); }
.simple-stat-row > div { display:grid; gap:6px; }
.simple-stat-row span { color:var(--muted); font-size:12px; }
.dual-bar { height:5px; display:flex; gap:3px; direction:ltr; }
.dual-bar i, .dual-bar b { display:block; min-width:0; border-radius:999px; }
.dual-bar i { margin-left:auto; background:var(--accent-2); }
.dual-bar b { margin-right:auto; background:var(--live); }
@media (max-width:760px) {
  .simple-stat-head, .simple-stat-row { grid-template-columns:minmax(42px,.7fr) minmax(120px,1.5fr) minmax(42px,.7fr); gap:7px; }
  .simple-stat-head { font-size:11px; }
}

/* V28.9: el enlace del equipo ocupa toda la primera columna. */
.team-row > .team-inline { grid-column: 1; min-width: 0; }
.team-row > b { grid-column: 2; }


/* =====================================================================
   V28.9 · Perfil de equipo estilo ProbaxIA y estadísticas independientes
   ===================================================================== */
.team-profile-header-v289 { grid-template-columns:minmax(280px,1fr) auto; }
.team-profile-header-v289 .team-match-snapshot { grid-column:1/-1; display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.team-snapshot { display:grid; gap:5px; min-width:0; padding:12px; border:1px solid var(--line); border-radius:13px; background:color-mix(in srgb,var(--surface-2) 92%,transparent); color:var(--text); text-align:left; }
.team-snapshot:hover { border-color:var(--accent); transform:translateY(-1px); }
.team-snapshot>span { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.08em; }
.team-snapshot>small,.team-snapshot>em { color:var(--muted); font-size:10px; font-style:normal; }
.team-snapshot>div { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:center; }
.team-snapshot>div>span { display:flex; min-width:0; align-items:center; gap:7px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.team-snapshot .team-logo { width:20px; height:20px; }
.team-page-layout { display:grid; grid-template-columns:minmax(285px,340px) minmax(0,1fr) 150px; gap:12px; align-items:start; }
.team-match-browser { position:sticky; top:calc(var(--topbar) + 12px); max-height:calc(100dvh - var(--topbar) - 28px); display:grid; grid-template-rows:auto minmax(0,1fr) auto; overflow:hidden; padding:0; }
.team-match-browser-head { display:grid; gap:10px; padding:13px; border-bottom:1px solid var(--line); }
.team-match-browser-head>div:first-child { display:flex; justify-content:space-between; align-items:center; }
.team-match-browser-head h3 { margin:0; }
.team-match-browser .segmented { display:grid; grid-template-columns:1fr 1fr; }
.team-fixture-scroll { overflow:auto; padding:7px; overscroll-behavior:contain; }
.team-fixture-rich { grid-template-columns:70px minmax(0,1fr) 74px 14px; border:0; border-bottom:1px solid var(--line); border-radius:8px; }
.team-fixture-rich .fixture-date { display:grid; gap:3px; color:var(--muted); }
.team-fixture-rich .fixture-date b { color:var(--text); font-size:10px; }
.fixture-matchup { min-width:0; display:grid; gap:4px; }
.fixture-matchup>span { display:grid; grid-template-columns:20px minmax(0,1fr) auto; gap:6px; align-items:center; }
.fixture-matchup .team-logo { width:20px; height:20px; }
.fixture-matchup strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.fixture-matchup small { color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.team-fixture-rich .fixture-result { display:grid; gap:3px; justify-items:end; }
.team-fixture-rich .fixture-result strong { font-size:12px; }
.team-fixture-rich .fixture-result small { color:var(--muted); font-size:9px; }
.team-fixture-rich .fixture-result.win strong { color:var(--success); }
.team-fixture-rich .fixture-result.loss strong { color:var(--danger); }
.team-main-panel { min-width:0; display:grid; gap:10px; }
.team-main-panel .team-tabs { top:calc(var(--topbar) + 2px); }
.team-ad-rail { position:sticky; top:calc(var(--topbar) + 12px); display:grid; gap:10px; }
.team-inline-ad,.team-content-ad,.match-stats-ad { min-height:78px; margin:8px; }
.global-ad-rail { position:fixed; right:8px; top:calc(var(--topbar) + 14px); width:128px; z-index:4; display:none; gap:12px; }
.ad-slot { min-height:76px; display:grid; place-items:center; border:1px dashed color-mix(in srgb,var(--muted) 45%,transparent); border-radius:11px; background:color-mix(in srgb,var(--surface-2) 78%,transparent); color:var(--muted); font-size:9px; text-transform:uppercase; letter-spacing:.08em; }
.ad-slot.ad-enabled { border-style:solid; }
.team-standings-v289 th,.team-standings-v289 td { white-space:nowrap; }
.team-standings-v289 .form-strip { min-width:128px; }
.team-standings-v289 .form-strip span { width:21px; height:21px; }
.impactful-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
.match-statistics-card { overflow:hidden; }
.live-stat-badge { display:flex; gap:7px; align-items:center; color:var(--danger); font-weight:800; }
.live-stat-badge i { width:8px; height:8px; border-radius:50%; background:var(--danger); box-shadow:0 0 0 5px color-mix(in srgb,var(--danger) 15%,transparent); animation:livePulse 1.4s infinite; }
.google-like-stats { display:grid; gap:1px; margin-top:10px; }
.stats-team-head { display:grid; grid-template-columns:1fr auto 1fr; gap:12px; align-items:center; padding:10px 4px 16px; }
.stats-team-head strong { display:flex; align-items:center; gap:7px; min-width:0; }
.stats-team-head strong:last-child { justify-content:flex-end; text-align:right; }
.stats-team-head .team-logo { width:25px; height:25px; }
.stats-team-head>span { font-size:20px; font-weight:900; }
.google-stat-row { display:grid; grid-template-columns:56px minmax(0,1fr) 56px; gap:10px; align-items:center; padding:9px 5px; border-top:1px solid var(--line); }
.google-stat-row>strong:last-child { text-align:right; }
.google-stat-row>div>span { display:block; margin-bottom:5px; text-align:center; color:var(--muted); font-size:10px; }
.google-stat-row.unavailable { opacity:.48; }
.match-stats-waiting { min-height:190px; }
@media (min-width:1600px) { .global-ad-rail { display:grid; } .workspace { padding-right:142px; } }
@media (max-width:1150px) { .team-page-layout { grid-template-columns:minmax(270px,330px) minmax(0,1fr); } .team-ad-rail { display:none; } }
@media (max-width:760px) {
  .team-profile-header-v289 { grid-template-columns:1fr; }
  .team-profile-header-v289 .team-match-snapshot { grid-template-columns:1fr; }
  .team-page-layout { display:flex; flex-direction:column; }
  .team-match-browser { position:relative; top:auto; width:100%; max-height:none; order:1; }
  .team-fixture-scroll { max-height:420px; -webkit-overflow-scrolling:touch; }
  .team-main-panel { width:100%; order:2; }
  .team-fixture-rich { grid-template-columns:58px minmax(0,1fr) 65px 12px; }
  .impactful-stats { grid-template-columns:1fr; }
  .google-stat-row { grid-template-columns:48px minmax(0,1fr) 48px; }
  .team-standings-v289 .form-strip { min-width:112px; }
  .ad-slot { min-height:62px; }
}

/* =====================================================================
   V28.10 · Agenda segura, filtros de estado y competiciones aisladas
   ===================================================================== */
.agenda-toolbar {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
}
.agenda-toolbar > .muted { margin: 0; font-size: 10px; }
.agenda-status-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.agenda-status-filters button {
  min-width: 0;
  border: 0;
  border-radius: 8px;
  padding: 8px 7px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  font-size: 10px;
}
.agenda-status-filters button.active {
  color: var(--text);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line);
}
.agenda-status-filters button[data-status-filter="vivo"].active { color: var(--danger); }
.league-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}
.league-chip-logo, .league-logo {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  object-fit: contain;
  border-radius: 7px;
}
.competition-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.competition-title > span { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-inline.static { cursor: default; }
.team-inline.static:hover span:last-child { color: inherit; }
.agenda-ad-slot {
  min-height: 96px;
  margin: 10px 12px;
  flex: 0 0 auto;
  overflow: hidden;
}
.match-list-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.desktop-match-list { flex: 1 1 auto; min-height: 220px; }
.global-ad-rail {
  width: 260px;
  gap: 16px;
}
.global-ad-rail .ad-slot {
  min-height: 250px;
  padding: 14px;
  font-size: 10px;
}
.team-page-layout { grid-template-columns: minmax(285px,340px) minmax(0,1fr) 220px; }
.team-ad-rail .ad-slot { min-height: 300px; }
.ad-slot { overflow: hidden; isolation: isolate; }
.ad-slot iframe, .ad-slot ins { max-width: 100%; width: 100%; }
@media (min-width: 1720px) {
  .global-ad-rail { display: grid; }
  .workspace { padding-right: 282px; }
}
@media (max-width: 1719px) {
  .global-ad-rail { display: none; }
  .workspace { padding-right: 0; }
}
@media (max-width: 760px) {
  .agenda-status-filters { overflow-x: auto; display: flex; -webkit-overflow-scrolling: touch; }
  .agenda-status-filters button { flex: 0 0 auto; min-width: 88px; }
  .agenda-ad-slot { min-height: 82px; margin: 8px; }
  .league-chip { flex: 1 1 130px; justify-content: flex-start; }
}
@media (max-width: 1150px) {
  .team-page-layout { grid-template-columns: minmax(270px,330px) minmax(0,1fr); }
  .team-ad-rail { display: none; }
}

/* ProbaxIA V28.11 */
.global-error-banner{position:sticky;top:0;z-index:80;display:flex;gap:1rem;align-items:center;justify-content:space-between;padding:.85rem 1rem;border:1px solid var(--danger,#c43);border-radius:12px;background:var(--panel,#fff);box-shadow:0 8px 25px rgba(0,0,0,.15)}.global-error-banner.hidden{display:none}.global-error-banner>div{display:grid;gap:.25rem}.global-error-banner pre{max-height:12rem;overflow:auto;white-space:pre-wrap}.live-freshness{display:grid;gap:.2rem;padding:.65rem .85rem;border-radius:10px;background:var(--surface-2,#f4f5f7);font-size:.83rem}.live-freshness.stale{border:1px solid #d78b00}.live-freshness.stale strong{font-weight:800}.live-change-flash{animation:probaxia-change 1.1s ease-out}.reduce-motion .live-change-flash{animation:none}@keyframes probaxia-change{0%{filter:brightness(1.2)}100%{filter:brightness(1)}}.no-pick{display:grid;gap:.3rem}.odds-timeline{display:grid;gap:.6rem}.odds-timeline article{display:grid;grid-template-columns:minmax(100px,1.3fr) repeat(4,minmax(70px,1fr));gap:.5rem;align-items:center;padding:.6rem;border-bottom:1px solid var(--border,#ddd)}.automation-list{display:grid;gap:.75rem}.automation-list article{display:grid;gap:.35rem}.ad-slot{contain:layout paint;max-width:100%;overflow:hidden;min-height:0}.ad-slot[hidden]{display:none!important}.ad-enabled{min-height:90px}.methodology-page{min-height:100vh;padding:clamp(1rem,4vw,4rem);background:var(--background,#f4f5f8)}.methodology-card{max-width:850px;margin:auto;padding:clamp(1.2rem,4vw,3rem);background:var(--panel,#fff);border-radius:20px;box-shadow:0 20px 50px rgba(0,0,0,.1)}.methodology-card p{line-height:1.7}.methodology-card footer{margin-top:2rem;font-weight:700}@media(max-width:800px){.odds-timeline article{grid-template-columns:1fr 1fr}.global-error-banner{align-items:flex-start;flex-direction:column}}


/* ProbaxIA V28.11.1 · navegación táctil móvil */
@media (max-width: 760px) {
  .match-list-panel, .competition-group, .competition-body { touch-action: pan-y pinch-zoom; }
  .match-card { min-height: 78px; overscroll-behavior-y: auto; }
}

/* V28.13: introducción SEO visible y panel administrativo */
.app-seo-intro{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin:12px 0 18px;padding:18px;border:1px solid var(--line);border-radius:16px;background:linear-gradient(145deg,var(--panel),var(--panel-2));contain:layout paint}.app-seo-intro h2{margin:4px 0 8px;font-size:clamp(20px,3vw,28px)}.app-seo-intro p{margin:0;color:var(--muted);max-width:760px}.app-seo-intro nav{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.app-seo-intro a,.seo-keyword-chips span{padding:7px 10px;border:1px solid var(--line);border-radius:999px;color:var(--accent);text-decoration:none;font-size:13px}.seo-keyword-chips{display:flex;flex-wrap:wrap;gap:8px}@media(max-width:760px){.app-seo-intro{flex-direction:column}.app-seo-intro nav{justify-content:flex-start}}
