:root {
  /* Paleta de Cores - Profissional e Moderna (Inspirada em Apps de Trading/Sports) */
  --primary: #10b981; /* Verde Esmeralda (Sucesso/Green) */
  --primary-hover: #059669;
  --secondary: #6366f1; /* Indigo */
  --danger: #ef4444; /* Vermelho (Red) */
  --warning: #f59e0b; /* Âmbar */
  --info: #3b82f6; /* Azul */
  
  /* Tons de Cinza / Superfícies */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a; /* Azul Marinho Escuro */
  --shell-bg: radial-gradient(1200px 420px at 10% -10%, rgba(16, 185, 129, 0.1), transparent 55%),
    radial-gradient(900px 400px at 105% 0%, rgba(59, 130, 246, 0.12), transparent 52%),
    linear-gradient(180deg, #f4f8ff 0%, #edf3fb 100%);
  --topbar-bg: rgba(255, 255, 255, 0.72);
  --topbar-border: rgba(148, 163, 184, 0.25);
  --sidebar-bg:
    radial-gradient(120% 55% at 14% 100%, rgba(16, 185, 129, 0.16) 0%, rgba(16, 185, 129, 0) 60%),
    radial-gradient(95% 65% at 100% 0%, rgba(59, 130, 246, 0.11) 0%, rgba(59, 130, 246, 0) 58%),
    linear-gradient(170deg, #eaf2ff 0%, #dde8fb 48%, #d4e1f7 100%);
  --sidebar-border: rgba(100, 116, 139, 0.22);
  --sidebar-brand-border: rgba(100, 116, 139, 0.18);
  --sidebar-fg: #0f2540;
  --sidebar-title: #0f2540;
  --sidebar-subtitle: #4f6b8a;
  --sidebar-nav-text: #27405f;
  --sidebar-nav-bg: rgba(255, 255, 255, 0.35);
  --sidebar-nav-hover-bg: rgba(255, 255, 255, 0.6);
  --sidebar-nav-hover-border: rgba(59, 130, 246, 0.25);
  --sidebar-nav-hover-text: #17324f;
  --sidebar-nav-active-bg: linear-gradient(135deg, #20bb86, #0b9e77);
  --sidebar-nav-active-border: rgba(255, 255, 255, 0.5);
  --sidebar-nav-active-shadow: 0 8px 18px rgba(16, 185, 129, 0.26);
  --sidebar-icon-bg: rgba(37, 99, 235, 0.14);
  --sidebar-icon-active-bg: rgba(255, 255, 255, 0.24);
  --sidebar-fx-bottom:
    linear-gradient(150deg, rgba(16, 185, 129, 0.16) 0%, rgba(16, 185, 129, 0.03) 55%, rgba(16, 185, 129, 0) 100%),
    repeating-linear-gradient(157deg, rgba(30, 64, 175, 0.08) 0 2px, transparent 2px 22px);
  --sidebar-fx-corner: radial-gradient(circle at center, rgba(59, 130, 246, 0.24), rgba(59, 130, 246, 0));
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  /* Sombras e Bordas */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
}

/* GreenHunter premium landing */
.ghx-landing {
  --ghx-bg: #121414;
  --ghx-panel: rgba(23, 28, 28, 0.72);
  --ghx-panel-strong: rgba(27, 34, 34, 0.88);
  --ghx-line: rgba(73, 232, 212, 0.18);
  --ghx-line-strong: rgba(73, 232, 212, 0.48);
  --ghx-text: #f6fbff;
  --ghx-muted: rgba(218, 244, 241, 0.62);
  --ghx-cyan: #49e8d4;
  --ghx-blue: #69d9ff;
  --ghx-aqua: #49e8d4;
  --ghx-green: #49e8d4;
  --ghx-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 0;
  color: var(--ghx-text);
  background:
    radial-gradient(1100px 520px at 76% 8%, rgba(73, 232, 212, 0.18), transparent 56%),
    radial-gradient(900px 500px at 14% 20%, rgba(73, 232, 212, 0.1), transparent 54%),
    linear-gradient(180deg, #121414 0%, #0d1111 48%, #080a0a 100%);
  font-family: "Hanken Grotesk", "DM Sans", system-ui, -apple-system, sans-serif;
}

body:has(.ghx-landing) {
  background: #121414;
  overflow-x: hidden;
}

body:has(.ghx-auth-shell) {
  background: #121414;
  overflow-x: hidden;
}

.ghx-landing::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.026) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent 78%);
}

.ghx-landing > * {
  position: relative;
  z-index: 1;
}

.ghx-nav {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 14px auto 0;
  padding: 12px 14px;
  border: 1px solid rgba(148, 222, 255, 0.16);
  border-radius: 999px;
  background: rgba(5, 10, 24, 0.72);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.ghx-brand,
.ghx-nav-links,
.ghx-nav-actions,
.ghx-hero-actions,
.ghx-trust-row,
.ghx-logo-strip,
.ghx-dashboard-top,
.ghx-score-line,
.ghx-tech-list,
.ghx-result-row {
  display: flex;
  align-items: center;
}

.ghx-brand {
  gap: 10px;
  color: var(--ghx-text);
}

.ghx-brand:hover {
  color: #fff;
}

.ghx-brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #02110c;
  font-weight: 900;
  background: linear-gradient(135deg, var(--ghx-green), var(--ghx-cyan));
  box-shadow: 0 0 34px rgba(45, 212, 191, 0.45);
  overflow: hidden;
}

.ghx-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ghx-brand strong,
.ghx-brand small {
  display: block;
  line-height: 1.05;
}

.ghx-brand strong {
  font-family: "Hanken Grotesk", "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 800;
}

.ghx-brand small {
  margin-top: 3px;
  color: var(--ghx-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ghx-nav-links {
  gap: 22px;
}

.ghx-nav-links a,
.ghx-link-btn {
  color: rgba(235, 247, 255, 0.74);
  font-size: 0.92rem;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.ghx-nav-links a:hover,
.ghx-link-btn:hover {
  color: #fff;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.55);
}

.ghx-nav-actions {
  gap: 10px;
}

.ghx-primary-btn,
.ghx-secondary-btn,
.ghx-price-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.ghx-primary-btn {
  gap: 10px;
  color: #071312;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: #49e8d4;
  box-shadow: 0 0 28px rgba(73, 232, 212, 0.26), 0 16px 48px rgba(73, 232, 212, 0.14);
}

.ghx-primary-btn-sm {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.9rem;
}

.ghx-secondary-btn {
  color: #eaffff;
  border: 1px solid rgba(150, 226, 255, 0.24);
  background: rgba(255, 255, 255, 0.055);
}

.ghx-primary-btn:hover,
.ghx-secondary-btn:hover,
.ghx-price-card a:hover {
  transform: translateY(-2px);
  color: #fff;
}

.ghx-primary-btn:hover {
  color: #071312;
  box-shadow: 0 0 42px rgba(73, 232, 212, 0.38), 0 24px 58px rgba(73, 232, 212, 0.18);
}

.ghx-hero {
  min-height: min(820px, 92svh);
  margin-top: -74px;
  padding: 145px 0 70px;
  background:
    linear-gradient(90deg, rgba(18, 20, 20, 0.98) 0%, rgba(18, 20, 20, 0.9) 35%, rgba(18, 20, 20, 0.18) 78%),
    linear-gradient(180deg, rgba(18, 20, 20, 0.08) 0%, #121414 100%),
    var(--ghx-hero-image) center right / min(1040px, 78vw) auto no-repeat;
}

.ghx-particles {
  position: absolute;
  inset: 0;
  opacity: 0.72;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 8% 22%, rgba(73, 232, 212, 0.72) 0 1px, transparent 2px),
    radial-gradient(circle at 31% 72%, rgba(73, 232, 212, 0.55) 0 1px, transparent 2px),
    radial-gradient(circle at 58% 24%, rgba(170, 255, 245, 0.44) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 62%, rgba(73, 232, 212, 0.62) 0 1px, transparent 2px);
  background-size: 240px 240px, 300px 300px, 270px 270px, 320px 320px;
  animation: ghxDrift 18s linear infinite;
}

.ghx-hero-grid,
.ghx-section,
.ghx-final-cta {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.ghx-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(320px, 0.86fr);
  gap: 56px;
  align-items: center;
}

.ghx-hero-copy {
  min-width: 0;
  max-width: 735px;
}

.ghx-kicker,
.ghx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ghx-cyan);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ghx-kicker span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ghx-green);
  box-shadow: 0 0 22px var(--ghx-green);
}

.ghx-hero h1,
.ghx-section-head h2,
.ghx-dashboard-copy h2,
.ghx-tech-copy h2,
.ghx-telegram-copy h2,
.ghx-final-cta h2 {
  font-family: "Hanken Grotesk", "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: 0;
  color: #f8fdff;
}

.ghx-hero h1 {
  margin: 22px 0 20px;
  max-width: 760px;
  font-family: "Hanken Grotesk", "Inter", sans-serif;
  font-size: clamp(3.15rem, 5.7vw, 5.2rem);
  font-weight: 700;
  line-height: 0.98;
  text-wrap: balance;
  letter-spacing: -0.015em;
  text-shadow: 0 0 36px rgba(160, 230, 255, 0.12);
}

.ghx-hero h1 em {
  font-style: normal;
  font-weight: 800;
  color: transparent;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0) 50%),
    linear-gradient(92deg, #f8fffd 0%, #49e8d4 52%, #9df7ee 100%);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 0 16px rgba(73, 232, 212, 0.22));
}

.ghx-hero-copy > p,
.ghx-section-head p,
.ghx-dashboard-copy p,
.ghx-tech-copy p,
.ghx-telegram-copy p,
.ghx-final-cta p,
.ghx-glass-card p,
.ghx-step p,
.ghx-price-card p,
.ghx-faq-item p {
  color: var(--ghx-muted);
}

.ghx-hero-copy > p {
  max-width: 640px;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.75;
}

.ghx-hero-actions {
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.ghx-trust-row {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.ghx-trust-row span {
  padding: 8px 12px;
  border: 1px solid rgba(148, 222, 255, 0.15);
  border-radius: 999px;
  color: rgba(238, 251, 255, 0.78);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.86rem;
}

.ghx-hero-stage {
  position: relative;
  min-height: 450px;
}

.ghx-floating-panel {
  position: absolute;
  border: 1px solid var(--ghx-line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(7, 18, 39, 0.72), rgba(13, 39, 66, 0.46));
  box-shadow: var(--ghx-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.ghx-panel-a {
  right: 12%;
  top: 16%;
  width: 190px;
  padding: 18px;
  animation: ghxFloat 5.2s ease-in-out infinite;
}

.ghx-panel-b {
  right: 2%;
  bottom: 26%;
  gap: 10px;
  padding: 13px 16px;
  color: #d9fffb;
  animation: ghxFloat 6.1s ease-in-out infinite reverse;
}

.ghx-panel-c {
  left: 10%;
  bottom: 12%;
  width: 170px;
  padding: 16px;
  animation: ghxFloat 5.7s ease-in-out infinite;
}

.ghx-panel-label {
  display: block;
  color: var(--ghx-muted);
  font-size: 0.78rem;
}

.ghx-floating-panel strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
}

.ghx-mini-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  height: 46px;
  align-items: end;
  margin-top: 18px;
}

.ghx-mini-bars i,
.ghx-chart-card span {
  display: block;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, var(--ghx-cyan), var(--ghx-green));
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}

.ghx-mini-bars i:nth-child(1) { height: 48%; }
.ghx-mini-bars i:nth-child(2) { height: 70%; }
.ghx-mini-bars i:nth-child(3) { height: 92%; }
.ghx-mini-bars i:nth-child(4) { height: 58%; }

.ghx-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ghx-green);
  box-shadow: 0 0 24px var(--ghx-green);
}

.ghx-section {
  padding: 92px 0;
}

.ghx-section-head {
  max-width: 820px;
  margin-bottom: 34px;
}

.ghx-section-head h2,
.ghx-dashboard-copy h2,
.ghx-tech-copy h2,
.ghx-telegram-copy h2,
.ghx-final-cta h2 {
  margin: 12px 0 12px;
  font-size: clamp(2.1rem, 4.8vw, 4.4rem);
  line-height: 1.02;
}

.ghx-section-head p,
.ghx-dashboard-copy p,
.ghx-tech-copy p,
.ghx-telegram-copy p,
.ghx-final-cta p {
  max-width: 680px;
  font-size: 1.06rem;
  line-height: 1.72;
}

/* Landing: video de apresentacao */
.ghx-video-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 38px;
  align-items: center;
  margin-top: 36px;
  padding: clamp(58px, 7vw, 92px) clamp(18px, 5vw, 64px);
  border: 1px solid rgba(73, 232, 212, .12);
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 0%, rgba(73, 232, 212, .11), transparent 38%),
    linear-gradient(155deg, rgba(255, 255, 255, .035), rgba(4, 12, 18, .2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
  isolation: isolate;
}

.ghx-video-showcase::before,
.ghx-video-showcase::after {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.ghx-video-showcase::before {
  top: 10%;
  left: 7%;
  width: 180px;
  height: 180px;
  background: rgba(31, 166, 98, .1);
  filter: blur(70px);
}

.ghx-video-showcase::after {
  right: 5%;
  bottom: 8%;
  width: 230px;
  height: 230px;
  background: rgba(34, 211, 238, .08);
  filter: blur(82px);
}

.ghx-video-copy {
  max-width: 900px;
  margin: 0;
  text-align: center;
}

.ghx-video-copy .ghx-eyebrow { justify-content: center; }

.ghx-video-copy .ghx-eyebrow i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ghx-green);
  box-shadow: 0 0 18px rgba(73, 232, 212, .7);
}

.ghx-video-copy h2 { margin-top: 16px; }
.ghx-video-copy p { max-width: 760px; margin: 0 auto; }

.ghx-video-stage {
  position: relative;
  width: min(1040px, 100%);
  margin-inline: auto;
  padding: 5px;
  border: 2px solid #42e6bc;
  border-radius: 27px;
  background: linear-gradient(125deg, #31e6ba 0%, #168451 36%, #22d3ee 70%, #31e6ba 100%);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, .5),
    0 0 0 2px #071713,
    0 0 0 6px rgba(49, 230, 186, .2),
    0 30px 80px rgba(0, 0, 0, .52),
    0 0 42px rgba(49, 230, 186, .32);
}

.ghx-video-frame {
  position: relative;
  overflow: hidden;
  padding: 7px;
  border: 1px solid rgba(8, 24, 24, .95);
  border-radius: 23px;
  background: linear-gradient(145deg, rgba(16, 34, 43, .98), rgba(4, 10, 15, .99));
}

.ghx-video-frame::before {
  position: absolute;
  z-index: 0;
  inset: -45% 25% auto -15%;
  height: 75%;
  border-radius: 50%;
  background: rgba(73, 232, 212, .12);
  filter: blur(55px);
  content: "";
  pointer-events: none;
}

.ghx-video-screen {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding: 3px;
  border: 3px solid #1fa662;
  border-radius: 16px;
  background: linear-gradient(135deg, #42e6bc, #168451 52%, #22d3ee);
  box-shadow: inset 0 0 0 1px rgba(225, 255, 247, .24), 0 0 18px rgba(31, 166, 98, .24);
}

.ghx-video-screen video {
  position: relative;
  display: block;
  width: 100%;
  max-height: min(72vh, 760px);
  border-radius: 10px;
  background: #050909;
  object-fit: contain;
}

/* Landing: Jogos do Dia */
.ghx-matchday-showcase {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(520px, 1.18fr);
  gap: clamp(38px, 6vw, 82px);
  align-items: center;
}

.ghx-matchday-copy h2 {
  margin: 14px 0 18px;
  color: #f8fdff;
  font: 700 clamp(2.4rem, 4.6vw, 4.35rem)/1 "Hanken Grotesk", "Inter", sans-serif;
  letter-spacing: -0.018em;
}

.ghx-matchday-copy > p {
  margin: 0;
  color: var(--ghx-muted);
  font-size: 1.06rem;
  line-height: 1.72;
}

.ghx-matchday-points { display: grid; gap: 10px; margin: 28px 0 32px; }
.ghx-matchday-points > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(73, 232, 212, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}
.ghx-matchday-points b {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--ghx-cyan);
  background: rgba(73, 232, 212, 0.09);
  font-size: 0.78rem;
}
.ghx-matchday-points strong, .ghx-matchday-points small { display: block; }
.ghx-matchday-points strong { color: #f5fffd; font-size: 0.96rem; }
.ghx-matchday-points small { margin-top: 3px; color: var(--ghx-muted); font-size: 0.84rem; line-height: 1.45; }

.ghx-matchday-demo {
  position: relative;
  min-width: 0;
  padding: 20px 20px 90px;
  border: 1px solid rgba(73, 232, 212, 0.2);
  border-radius: 28px;
  background: radial-gradient(480px 220px at 90% 0%, rgba(73, 232, 212, 0.13), transparent 68%), linear-gradient(145deg, rgba(255,255,255,0.075), rgba(255,255,255,0.025));
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(18px);
}
.ghx-demo-toolbar { display: grid; grid-template-columns: .7fr 1.35fr .8fr auto; gap: 8px; margin-bottom: 12px; }
.ghx-demo-toolbar > div, .ghx-demo-toolbar > span {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(73, 232, 212, 0.12);
  border-radius: 12px;
  background: rgba(4, 12, 12, 0.58);
}
.ghx-demo-toolbar small, .ghx-demo-toolbar strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ghx-demo-toolbar small { color: var(--ghx-muted); font-size: .67rem; text-transform: uppercase; letter-spacing: .08em; }
.ghx-demo-toolbar strong { margin-top: 3px; color: #f5fffd; font-size: .78rem; }
.ghx-demo-toolbar > span { display: grid; place-items: center; color: var(--ghx-cyan); font-size: .76rem; font-weight: 800; white-space: nowrap; }

.ghx-demo-match { overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 19px; background: rgba(8,15,15,.86); }
.ghx-demo-match header { display: flex; gap: 10px; align-items: center; padding: 14px 16px 0; }
.ghx-demo-match header span { color: var(--ghx-cyan); font-weight: 900; }
.ghx-demo-match header small { color: var(--ghx-muted); }
.ghx-demo-match h3 { margin: 12px 16px 15px; color: #f8fffe; font-size: clamp(1rem, 2vw, 1.2rem); }
.ghx-demo-match h3 em, .ghx-demo-ticket em { margin-inline: 6px; color: rgba(218,244,241,.4); font-style: normal; font-weight: 600; }
.ghx-demo-table > div { display: grid; grid-template-columns: minmax(110px,1.5fr) repeat(3,minmax(52px,.62fr)); border-top: 1px solid rgba(255,255,255,.055); }
.ghx-demo-table span, .ghx-demo-table b { padding: 10px 12px; color: rgba(239,255,252,.74); font-size: .78rem; }
.ghx-demo-table b { border-left: 1px solid rgba(255,255,255,.055); text-align: center; }
.ghx-demo-table .is-head span, .ghx-demo-table .is-head b { color: rgba(218,244,241,.45); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; }
.ghx-demo-table .is-highlight { background: rgba(73,232,212,.09); box-shadow: inset 3px 0 var(--ghx-cyan); }
.ghx-demo-table .is-highlight span, .ghx-demo-table .is-highlight b { color: #eafffc; }

.ghx-demo-ticket {
  position: absolute;
  right: -22px;
  bottom: -24px;
  width: min(310px, 76%);
  padding: 15px;
  border: 1px solid rgba(73,232,212,.3);
  border-radius: 18px;
  color: #f5fffd;
  background: rgba(10,22,21,.96);
  box-shadow: 0 24px 70px rgba(0,0,0,.54), 0 0 34px rgba(73,232,212,.08);
}
.ghx-demo-ticket header, .ghx-demo-ticket > div { display: flex; justify-content: space-between; gap: 12px; }
.ghx-demo-ticket header { padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.ghx-demo-ticket header span, .ghx-demo-ticket > div span { color: var(--ghx-muted); font-size: .74rem; }
.ghx-demo-ticket > b { display: block; margin: 12px 0 7px; font-size: .8rem; }
.ghx-demo-ticket > div { padding-top: 7px; font-size: .76rem; }
.ghx-demo-ticket > div strong { color: var(--ghx-cyan); }

.ghx-logo-strip {
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--ghx-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.ghx-logo-strip span {
  color: rgba(239, 250, 255, 0.48);
  font-family: "Hanken Grotesk", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
}

.ghx-card-grid {
  display: grid;
  gap: 18px;
}

.ghx-card-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ghx-glass-card,
.ghx-dashboard,
.ghx-neural-card,
.ghx-price-card,
.ghx-stat-card,
.ghx-faq-item,
.ghx-final-cta,
.ghx-phone {
  border: 1px solid var(--ghx-line);
  background: linear-gradient(145deg, rgba(255,255,255,0.085), rgba(255,255,255,0.028));
  box-shadow: var(--ghx-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.ghx-glass-card {
  min-height: 250px;
  padding: 26px;
  border-radius: 24px;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.ghx-glass-card:hover,
.ghx-price-card:hover,
.ghx-faq-item:hover,
.ghx-result-row:hover {
  transform: translateY(-4px);
  border-color: var(--ghx-line-strong);
  box-shadow: 0 26px 90px rgba(34, 211, 238, 0.12), var(--ghx-shadow);
}

.ghx-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
  border: 1px solid rgba(34, 211, 238, 0.32);
  border-radius: 18px;
  color: var(--ghx-cyan);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.14);
}

.ghx-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.ghx-glass-card h3,
.ghx-step h3 {
  margin: 0 0 10px;
  color: #fff;
  font-family: "Hanken Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1.28rem;
}

.ghx-glass-card p,
.ghx-step p {
  margin: 0;
  line-height: 1.7;
}

.ghx-dashboard-wrap,
.ghx-split,
.ghx-telegram {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(360px, 1fr);
  gap: 28px;
  align-items: center;
}

.ghx-dashboard {
  padding: 16px;
  border-radius: 30px;
  background: rgba(5, 12, 28, 0.74);
}

.ghx-dashboard-top {
  gap: 7px;
  padding: 8px 8px 14px;
  color: rgba(237, 250, 255, 0.62);
}

.ghx-dashboard-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.ghx-dashboard-top strong {
  margin-left: auto;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.ghx-dashboard-body {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}

.ghx-signal-card,
.ghx-chart-card,
.ghx-metric-stack div {
  border: 1px solid rgba(148, 222, 255, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
}

.ghx-signal-card {
  grid-row: span 2;
  padding: 22px;
}

.ghx-signal-card small,
.ghx-metric-stack small {
  display: block;
  color: var(--ghx-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.ghx-signal-card strong {
  display: block;
  margin: 8px 0 20px;
  color: #fff;
  font-size: 2rem;
}

.ghx-score-line {
  justify-content: space-between;
  gap: 10px;
  color: #d9eefe;
}

.ghx-score-line b {
  color: var(--ghx-green);
  white-space: nowrap;
}

.ghx-progress {
  height: 10px;
  margin-top: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.ghx-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ghx-green), var(--ghx-cyan));
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.42);
}

.ghx-chart-card {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  align-items: end;
  min-height: 156px;
  padding: 18px;
}

.ghx-chart-card span:nth-child(1) { height: 38%; }
.ghx-chart-card span:nth-child(2) { height: 68%; }
.ghx-chart-card span:nth-child(3) { height: 54%; }
.ghx-chart-card span:nth-child(4) { height: 88%; }
.ghx-chart-card span:nth-child(5) { height: 72%; }

.ghx-metric-stack {
  display: grid;
  gap: 10px;
}

.ghx-metric-stack div {
  padding: 14px;
}

.ghx-metric-stack strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 1.24rem;
}

.ghx-timeline {
  position: relative;
  display: grid;
  gap: 18px;
}

.ghx-timeline::before {
  content: "";
  position: absolute;
  left: 29px;
  top: 28px;
  bottom: 28px;
  width: 2px;
  background: linear-gradient(var(--ghx-cyan), var(--ghx-green));
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.4);
}

.ghx-step {
  position: relative;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--ghx-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.035);
}

.ghx-step-number {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: #00110d;
  font-weight: 900;
  background: linear-gradient(135deg, var(--ghx-green), var(--ghx-cyan));
  box-shadow: 0 0 30px rgba(45, 212, 191, 0.42);
}

.ghx-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.ghx-stat-card {
  min-height: 188px;
  padding: 24px;
  border-radius: 24px;
}

.ghx-stat-card strong {
  display: block;
  color: transparent;
  background: linear-gradient(120deg, #fff, var(--ghx-cyan), var(--ghx-green));
  background-clip: text;
  -webkit-background-clip: text;
  font-family: "Hanken Grotesk", sans-serif;
  font-weight: 800;
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  line-height: 1;
}

.ghx-stat-card span {
  display: block;
  margin-top: 14px;
  color: var(--ghx-muted);
}

.ghx-tech-list {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.ghx-tech-list span {
  padding: 9px 12px;
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 999px;
  color: #dffcff;
  background: rgba(34, 211, 238, 0.06);
}

.ghx-neural-card {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  padding: 28px;
  border-radius: 30px;
}

.ghx-neural-grid {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background:
    linear-gradient(rgba(34, 211, 238, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.1) 1px, transparent 1px);
  background-size: 34px 34px;
}

.ghx-neural-core {
  position: relative;
  display: grid;
  place-items: center;
  width: 142px;
  height: 142px;
  margin: 28px auto 46px;
  border: 1px solid rgba(34, 211, 238, 0.5);
  border-radius: 36px;
  color: #fff;
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(45, 212, 191, 0.12));
  box-shadow: 0 0 70px rgba(34, 211, 238, 0.32);
  transform: rotate(45deg);
}

.ghx-neural-core::first-letter {
  transform: rotate(-45deg);
}

.ghx-neural-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 222, 255, 0.14);
  border-radius: 16px;
  background: rgba(5, 8, 22, 0.54);
}

.ghx-neural-row span {
  color: var(--ghx-muted);
}

.ghx-neural-row strong {
  color: var(--ghx-green);
}

.ghx-results {
  display: grid;
  gap: 10px;
}

.ghx-result-row {
  grid-template-columns: 110px 1fr 90px 110px 70px;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--ghx-line);
  border-radius: 18px;
  color: #eafcff;
  background: rgba(255, 255, 255, 0.035);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.ghx-result-row span {
  color: var(--ghx-muted);
}

.ghx-result-status {
  justify-content: center;
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
}

.ghx-result-green { color: #022016 !important; background: var(--ghx-green); }
.ghx-result-pending { color: #041520 !important; background: var(--ghx-cyan); }
.ghx-result-red { color: #fff !important; background: #ef4444; }

.ghx-telegram {
  grid-template-columns: minmax(320px, 0.76fr) minmax(0, 1fr);
}

.ghx-phone {
  width: min(390px, 100%);
  min-height: 560px;
  margin-inline: auto;
  padding: 18px;
  border-radius: 42px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    #071021;
}

.ghx-phone-top {
  width: 92px;
  height: 8px;
  margin: 0 auto 54px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
}

.ghx-message {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 22px 22px 22px 6px;
  background: rgba(34, 211, 238, 0.09);
}

.ghx-message-alt {
  margin-left: 58px;
  border-radius: 22px 22px 6px 22px;
  background: rgba(49, 246, 164, 0.09);
}

.ghx-message small {
  color: var(--ghx-cyan);
}

.ghx-message strong {
  display: block;
  margin: 5px 0;
  color: #fff;
}

.ghx-message p {
  margin: 0;
  color: #cfe8f5;
}

.ghx-testimonial {
  min-height: 220px;
}

.ghx-testimonial p {
  margin-bottom: 24px;
  color: #dceefa;
}

.ghx-testimonial strong,
.ghx-testimonial span {
  display: block;
}

.ghx-testimonial span {
  color: var(--ghx-muted);
}

.ghx-pricing {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.ghx-price-card {
  display: flex;
  flex-direction: column;
  min-height: 500px;
  padding: 28px;
  border-radius: 28px;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.ghx-price-featured {
  border-color: rgba(49, 246, 164, 0.58);
  box-shadow: 0 0 60px rgba(45, 212, 191, 0.15), var(--ghx-shadow);
}

.ghx-price-card > span {
  color: var(--ghx-cyan);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.ghx-price-card h3 {
  margin: 18px 0 12px;
  color: #fff;
  font-family: "Hanken Grotesk", sans-serif;
  font-weight: 800;
  font-size: 3rem;
}

.ghx-price-card ul {
  display: grid;
  gap: 10px;
  margin: 24px 0;
  padding: 0;
  color: #d9eef7;
  list-style: none;
}

.ghx-price-card li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--ghx-green);
  box-shadow: 0 0 12px var(--ghx-green);
}

.ghx-price-card a {
  margin-top: auto;
  color: #eaffff;
  border: 1px solid rgba(148, 222, 255, 0.22);
  background: rgba(255,255,255,0.06);
}

.ghx-price-featured a {
  color: #02110d;
  background: linear-gradient(135deg, var(--ghx-green), var(--ghx-cyan));
}

.ghx-faq {
  display: grid;
  gap: 12px;
}

.ghx-faq-item {
  padding: 20px 22px;
  border-radius: 20px;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.ghx-faq-item summary {
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.ghx-faq-item p {
  margin: 14px 0 0;
}

.ghx-final-cta {
  margin-bottom: 76px;
  padding: 58px;
  border-radius: 34px;
  text-align: center;
  background:
    radial-gradient(560px 220px at 50% 0%, rgba(34, 211, 238, 0.22), transparent 70%),
    linear-gradient(145deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03));
}

.ghx-final-cta p {
  margin-inline: auto;
}

.ghx-final-cta .ghx-primary-btn {
  margin-top: 18px;
}

.ghx-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.ghx-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ghx-hero .ghx-reveal {
  opacity: 1;
  transform: none;
}

@keyframes ghxDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-90px, 60px, 0); }
}

@keyframes ghxFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@media (max-width: 1040px) {
  .ghx-nav-links {
    display: none;
  }

  .ghx-hero {
    background:
      linear-gradient(180deg, rgba(18, 20, 20, 0.72), #121414 88%),
      var(--ghx-hero-image) center 74px / min(820px, 120vw) auto no-repeat;
  }

  .ghx-hero-grid,
  .ghx-video-showcase,
  .ghx-matchday-showcase,
  .ghx-dashboard-wrap,
  .ghx-split,
  .ghx-telegram {
    grid-template-columns: 1fr;
  }

  .ghx-hero-copy {
    padding-top: 180px;
  }

  .ghx-matchday-showcase { gap: 52px; }
  .ghx-video-showcase { gap: 32px; }
  .ghx-matchday-demo { width: min(720px, calc(100% - 20px)); margin-inline: auto; }

  .ghx-hero-stage {
    min-height: 260px;
  }

  .ghx-card-grid-3,
  .ghx-pricing,
  .ghx-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .ghx-nav {
    top: 8px;
    width: calc(100% - 18px);
    border-radius: 24px;
    display: flex;
    align-items: center;
    overflow: hidden;
  }

  .ghx-brand small,
  .ghx-nav .ghx-primary-btn-sm {
    display: none;
  }

  .ghx-brand {
    min-width: 0;
    max-width: calc(100% - 88px);
  }

  .ghx-brand strong {
    font-size: 0.96rem;
  }

  .ghx-nav-actions {
    display: flex;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    justify-content: flex-end;
  }

  .ghx-nav .ghx-link-btn {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    padding: 0 12px;
    border: 1px solid rgba(73, 232, 212, 0.22);
    border-radius: 999px;
    color: #effffd;
    background: rgba(255, 255, 255, 0.045);
  }

  .ghx-primary-btn-sm {
    min-height: 38px;
    padding-inline: 12px;
    font-size: 0.86rem;
  }

  .ghx-hero {
    min-height: auto;
    padding: 118px 0 58px;
    background:
      linear-gradient(180deg, rgba(18, 20, 20, 0.58), #121414 76%),
      var(--ghx-hero-image) center 74px / 720px auto no-repeat;
  }

  .ghx-hero-copy {
    padding-top: 220px;
  }

  .ghx-hero h1 {
    max-width: 100%;
    font-size: clamp(2.15rem, 10.4vw, 2.7rem);
    line-height: 1;
    overflow-wrap: break-word;
  }

  .ghx-hero h1 em {
    display: block;
  }

  .ghx-hero-copy > p {
    max-width: min(342px, 100%);
    font-size: 1rem;
  }

  .ghx-hero-stage {
    display: none;
  }

  .ghx-section {
    padding: 64px 0;
  }

  .ghx-video-showcase { gap: 26px; margin-top: 14px; padding: 46px 12px 16px; border-radius: 24px; }
  .ghx-video-copy h2 { font-size: clamp(2rem, 9vw, 2.7rem); }
  .ghx-video-copy p { font-size: .96rem; line-height: 1.62; }
  .ghx-video-stage { border-radius: 19px; }
  .ghx-video-frame { padding: 4px; border-radius: 16px; }
  .ghx-video-screen { border-radius: 12px; }
  .ghx-video-screen video { max-height: 74vh; }

  .ghx-matchday-showcase { gap: 38px; }
  .ghx-matchday-copy h2 { font-size: clamp(2.15rem, 10vw, 3rem); }
  .ghx-matchday-demo { width: 100%; padding: 12px 12px 70px; border-radius: 22px; }
  .ghx-demo-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ghx-demo-toolbar > span { min-height: 46px; }
  .ghx-demo-table { overflow-x: auto; }
  .ghx-demo-table > div { min-width: 440px; }
  .ghx-demo-ticket { right: 8px; bottom: -22px; width: calc(100% - 34px); }

  .ghx-card-grid-3,
  .ghx-pricing,
  .ghx-stats,
  .ghx-dashboard-body {
    grid-template-columns: 1fr;
  }

  .ghx-logo-strip {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .ghx-result-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .ghx-final-cta {
    padding: 34px 20px;
  }
}

.theme-dark {
  --bg-body: #020617;
  --bg-card: #0f172a;
  --bg-sidebar: #020617;
  --shell-bg: radial-gradient(1200px 420px at 10% -10%, rgba(16, 185, 129, 0.08), transparent 55%),
    radial-gradient(900px 400px at 105% 0%, rgba(59, 130, 246, 0.12), transparent 52%),
    linear-gradient(180deg, #050b18 0%, #070f20 100%);
  --topbar-bg: rgba(15, 23, 42, 0.75);
  --topbar-border: rgba(148, 163, 184, 0.16);
  --sidebar-bg:
    radial-gradient(120% 55% at 14% 100%, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0) 60%),
    radial-gradient(95% 65% at 100% 0%, rgba(59, 130, 246, 0.14) 0%, rgba(59, 130, 246, 0) 58%),
    linear-gradient(170deg, #121c2e 0%, #0c1528 48%, #081122 100%);
  --sidebar-border: rgba(148, 163, 184, 0.16);
  --sidebar-brand-border: rgba(148, 163, 184, 0.16);
  --sidebar-fg: #f8fafc;
  --sidebar-title: #f8fafc;
  --sidebar-subtitle: #94a3b8;
  --sidebar-nav-text: #c8d4e4;
  --sidebar-nav-bg: rgba(15, 23, 42, 0.2);
  --sidebar-nav-hover-bg: rgba(255, 255, 255, 0.07);
  --sidebar-nav-hover-border: rgba(148, 163, 184, 0.2);
  --sidebar-nav-hover-text: #ffffff;
  --sidebar-nav-active-bg: linear-gradient(135deg, #20bb86, #0b9e77);
  --sidebar-nav-active-border: rgba(255, 255, 255, 0.14);
  --sidebar-nav-active-shadow: 0 8px 18px rgba(16, 185, 129, 0.3);
  --sidebar-icon-bg: rgba(148, 163, 184, 0.2);
  --sidebar-icon-active-bg: rgba(255, 255, 255, 0.2);
  --sidebar-fx-bottom:
    linear-gradient(150deg, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0.03) 55%, rgba(16, 185, 129, 0) 100%),
    repeating-linear-gradient(157deg, rgba(148, 163, 184, 0.1) 0 2px, transparent 2px 22px);
  --sidebar-fx-corner: radial-gradient(circle at center, rgba(59, 130, 246, 0.24), rgba(59, 130, 246, 0));
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

.theme-dark .text-muted,
.theme-dark .text-body-secondary,
.theme-dark .form-label,
.theme-dark .table thead th,
.theme-dark .table tbody td,
.theme-dark .btn-outline-secondary,
.theme-dark .btn-outline-secondary:hover {
  color: var(--text-muted) !important;
}

.theme-dark .card,
.theme-dark .topbar,
.theme-dark .form-control,
.theme-dark .form-select {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.theme-dark .form-control::placeholder,
.theme-dark .form-select::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.theme-dark .bg-light,
.theme-dark .bg-white {
  background-color: var(--bg-card) !important;
  color: var(--text-main);
}

.theme-dark .border,
.theme-dark .border-top,
.theme-dark .border-bottom,
.theme-dark .border-start,
.theme-dark .border-end {
  border-color: var(--border-color) !important;
}

.theme-dark .card-header {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-bottom-color: var(--border-color);
}

.theme-dark .table {
  color: var(--text-main);
}

.theme-dark .table tbody tr,
.theme-dark .table tbody td {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.theme-dark .alert {
  background-color: #0b1220;
  color: var(--text-main);
  border-color: var(--border-color);
}

.theme-dark .badge.bg-light {
  background-color: #1f2937 !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}

.theme-dark .nav-tabs .nav-link {
  color: var(--text-muted);
  border-color: var(--border-color);
}

.theme-dark .nav-tabs .nav-link.active {
  color: var(--text-main);
  border-color: var(--primary);
  background-color: transparent;
}

.theme-dark .stat-condition-block {
  background-color: #1a2332 !important;
  border-color: var(--border-color) !important;
}

.theme-dark .stat-condition-block .bg-white {
  background-color: #0f172a !important;
}

.theme-dark .table thead th {
  background-color: #0b1220;
  border-bottom-color: var(--border-color);
}

.theme-dark .table-clean tbody tr:hover {
  background-color: rgba(148, 163, 184, 0.08);
}

.theme-dark .modal-content,
.theme-dark .modal-header,
.theme-dark .modal-footer {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.theme-dark .dropdown-menu {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.theme-dark .page-link {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.theme-dark .page-link:hover {
  background-color: #0b1220;
  color: var(--text-main);
  border-color: var(--border-color);
}

.theme-dark .input-group-text,
.theme-dark .message-preview,
.theme-dark code {
  background-color: #0b1220;
  color: var(--text-main);
  border-color: var(--border-color);
}

.theme-dark .landing-hero {
  background: linear-gradient(120deg, #0b1220 0%, #0f172a 55%, #111827 100%);
  border-color: var(--border-color);
}

.theme-dark .landing-hero::before {
  opacity: 0.35;
}

.theme-dark .landing-card,
.theme-dark .landing-metric {
  background: #0b1220;
  border-color: var(--border-color);
  color: var(--text-main);
}

.theme-dark .landing-step {
  background: rgba(15, 23, 42, 0.6);
  border-color: var(--border-color);
  color: var(--text-main);
}

/* Reset e Base */
* {
  box-sizing: border-box;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body {
  font-family: 'Inter', 'Manrope', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: var(--primary);
}

a:hover {
  color: var(--primary-hover);
}

/* Layout Shell */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--shell-bg);
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
  overflow: hidden;
}

.sidebar::before {
  content: "";
  position: absolute;
  left: -22%;
  bottom: -20%;
  width: 138%;
  height: 46%;
  background: var(--sidebar-fx-bottom);
  opacity: 0.6;
  pointer-events: none;
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 90px;
  height: 90px;
  background: var(--sidebar-fx-corner);
  pointer-events: none;
}

.sidebar-brand {
  padding: 2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--sidebar-brand-border);
  position: relative;
  z-index: 1;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: white;
  font-size: 1.2rem;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--sidebar-title);
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--sidebar-subtitle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  padding: 0.85rem 0.8rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.78rem 0.85rem;
  color: var(--sidebar-nav-text);
  border-radius: 10px;
  font-weight: 600;
  margin-bottom: 0.36rem;
  border: 1px solid transparent;
  background-color: var(--sidebar-nav-bg);
  transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
  background-color: var(--sidebar-nav-hover-bg);
  border-color: var(--sidebar-nav-hover-border);
  color: var(--sidebar-nav-hover-text);
}

.sidebar .nav-link.active {
  background: var(--sidebar-nav-active-bg);
  border-color: var(--sidebar-nav-active-border);
  color: white;
  box-shadow: var(--sidebar-nav-active-shadow);
}

.sidebar .nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  opacity: 1;
  border-radius: 999px;
  background-color: var(--sidebar-icon-bg);
}

.sidebar .nav-link.active .nav-icon {
  background-color: var(--sidebar-icon-active-bg);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--sidebar-brand-border);
}

/* Main Area */
.main-area {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 70px;
  background-color: var(--topbar-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  border-radius: 8px;
  width: 42px;
  height: 38px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}

.menu-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 999px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 95;
}

.content {
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

/* Stats Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.stat-card-kpi {
  gap: 0.7rem;
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.stat-chip {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.18);
}

.mini-sparkline {
  height: 38px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
}

.mini-sparkline span {
  flex: 1 1 0;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.55), rgba(59, 130, 246, 0.22));
}

.mini-sparkline.spark-success span {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.7), rgba(16, 185, 129, 0.25));
}

.mini-sparkline.spark-danger span {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.7), rgba(239, 68, 68, 0.25));
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.stat-sub {
  font-size: 0.875rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Buttons */
.btn {
  border-radius: 8px;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  transition: all 0.2s;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-outline-secondary {
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline-secondary:hover {
  background-color: var(--bg-body);
  border-color: var(--text-muted);
}

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: var(--primary);
}

.btn-outline-info {
  border-color: var(--info);
  color: var(--info);
}

.btn-outline-info:hover {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: var(--info);
}

.btn-outline-danger {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-outline-danger:hover {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
}

.btn-success {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-success:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  background-color: var(--bg-body);
  padding: 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.table tbody td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table-clean tbody tr:hover {
  background-color: rgba(16, 185, 129, 0.02);
}

/* Badges */
.badge-status {
  padding: 0.4rem 0.8rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-on {
  background-color: #10b981;
  color: #ffffff;
}

.badge-off {
  background-color: #ef4444;
  color: #ffffff;
}

.badge-wait {
  background-color: #f59e0b;
  color: #ffffff;
}

/* Forms */
.form-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
  background-color: var(--bg-card);
  color: var(--text-main);
}

.form-control-lg, .form-select-lg {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
  outline: none;
}

.form-check-input {
  border-color: var(--border-color);
  width: 1.25em;
  height: 1.25em;
  margin-top: 0.25em;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.25);
}

.form-switch .form-check-input {
  width: 2.5em;
}

/* Status Pill */
.status-pill {
  padding: 0.4rem 0.8rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-on { background-color: #10b981; color: white; }
.status-off { background-color: #ef4444; color: white; }
.status-wait { background-color: #64748b; color: white; }

/* Auth Shell */
.auth-shell {
  max-width: 450px;
  margin: 10vh auto;
  padding: 2rem;
}

.ghx-auth-shell {
  --ghx-auth-text: #f7fcff;
  --ghx-auth-muted: #9fb4c9;
  --ghx-auth-cyan: #49e8d4;
  --ghx-auth-green: #49e8d4;
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 96px 24px;
  overflow: hidden;
  color: var(--ghx-auth-text);
  background:
    linear-gradient(rgba(73, 232, 212, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(73, 232, 212, 0.035) 1px, transparent 1px),
    radial-gradient(900px 440px at 72% 18%, rgba(73, 232, 212, 0.18), transparent 60%),
    radial-gradient(760px 380px at 12% 80%, rgba(73, 232, 212, 0.09), transparent 60%),
    linear-gradient(180deg, #121414 0%, #0d1111 100%);
  background-size: 64px 64px, 64px 64px, auto, auto, auto;
}

.ghx-auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(73, 232, 212, 0.72) 0 1px, transparent 2px),
    radial-gradient(circle at 42% 76%, rgba(73, 232, 212, 0.5) 0 1px, transparent 2px),
    radial-gradient(circle at 78% 42%, rgba(170, 255, 245, 0.42) 0 1px, transparent 2px);
  background-size: 230px 230px, 310px 310px, 270px 270px;
  animation: ghxDrift 18s linear infinite;
}

.ghx-auth-card {
  position: relative;
  width: min(470px, 100%);
  border: 1px solid rgba(148, 222, 255, 0.2);
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(255,255,255,0.11), rgba(255,255,255,0.035));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(22px);
  overflow: hidden;
}

.ghx-auth-glow {
  position: absolute;
  inset: -140px -110px auto auto;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.28);
  filter: blur(58px);
  pointer-events: none;
}

.ghx-auth-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(148, 222, 255, 0.14);
}

.ghx-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.ghx-auth-brand:hover {
  color: #fff;
}

.ghx-auth-brand span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #02110d;
  font-weight: 900;
  background: linear-gradient(135deg, var(--ghx-auth-green), var(--ghx-auth-cyan));
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.38);
}

.ghx-auth-brand strong {
  font-family: "Hanken Grotesk", "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 800;
}

.ghx-auth-kicker {
  color: var(--ghx-auth-cyan);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.ghx-auth-body {
  position: relative;
  padding: 34px;
}

.ghx-auth-logo {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(34, 211, 238, 0.16);
}

.ghx-auth-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ghx-auth-body h2 {
  margin: 0 0 8px;
  color: #fff;
  font-family: "Hanken Grotesk", "Inter", sans-serif;
  font-size: 2rem;
  font-weight: 700;
}

.ghx-auth-body p,
.ghx-auth-footer {
  color: var(--ghx-auth-muted);
}

.ghx-auth-body .form-label {
  color: #dff7ff;
  font-weight: 700;
  font-size: 0.9rem;
}

.ghx-auth-input {
  min-height: 54px;
  border: 1px solid rgba(148, 222, 255, 0.18) !important;
  border-radius: 16px;
  color: #fff !important;
  background: rgba(5, 12, 28, 0.64) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.ghx-auth-input:focus {
  color: #fff !important;
  background: rgba(6, 15, 33, 0.78) !important;
  border-color: rgba(34, 211, 238, 0.68) !important;
  box-shadow: 0 0 0 0.22rem rgba(34, 211, 238, 0.12), 0 0 28px rgba(34, 211, 238, 0.14) !important;
}

.ghx-auth-input::placeholder {
  color: rgba(195, 218, 232, 0.55) !important;
}

.ghx-auth-submit {
  min-height: 54px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  color: #02110d;
  font-weight: 900;
  background: #49e8d4;
  box-shadow: 0 0 30px rgba(73, 232, 212, 0.28), 0 16px 46px rgba(73, 232, 212, 0.14);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.ghx-auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 44px rgba(73, 232, 212, 0.38), 0 22px 56px rgba(73, 232, 212, 0.18);
}

.ghx-auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.92rem;
}

.ghx-auth-footer a {
  color: var(--ghx-auth-cyan);
  font-weight: 900;
}

@media (max-width: 575.98px) {
  .ghx-auth-shell {
    place-items: start center;
    min-height: 100vh;
    padding: 84px 16px 32px;
    background:
      linear-gradient(rgba(73, 232, 212, 0.035) 1px, transparent 1px),
      linear-gradient(90deg, rgba(73, 232, 212, 0.035) 1px, transparent 1px),
      radial-gradient(520px 300px at 80% 0%, rgba(73, 232, 212, 0.16), transparent 70%),
      linear-gradient(180deg, #121414 0%, #0d1111 100%);
    background-size: 48px 48px, 48px 48px, auto, auto;
  }

  .ghx-auth-card {
    width: 100%;
    border-radius: 26px;
  }

  .ghx-auth-header {
    padding: 18px;
  }

  .ghx-auth-kicker {
    display: none;
  }

  .ghx-auth-body {
    padding: 26px 18px 24px;
  }

  .ghx-auth-logo {
    width: 96px;
    height: 96px;
  }

  .ghx-auth-body h2 {
    font-size: 1.65rem;
  }

  .ghx-auth-body p {
    max-width: 290px;
    margin-inline: auto;
  }
}

.analysis-page {
  display: grid;
  gap: 18px;
}

.analysis-hero,
.analysis-live-band,
.analysis-group-card,
.analysis-panel,
.analysis-upgrade {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.1));
  border-radius: 8px;
  box-shadow: var(--shadow-md, 0 12px 30px rgba(15, 23, 42, 0.06));
}

.analysis-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 22px;
}

.analysis-kicker {
  color: #0f8f61;
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.analysis-hero h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 2.2rem);
  font-weight: 850;
  color: var(--text-main, #0f172a);
}

.analysis-hero h1 span {
  color: var(--text-muted, #64748b);
  font-size: 0.75em;
}

.analysis-hero p,
.analysis-panel p,
.analysis-upgrade p {
  color: var(--text-muted, #64748b);
  margin: 8px 0 0;
}

.analysis-status {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.analysis-status a,
.analysis-upgrade a {
  text-decoration: none;
}

.analysis-live-band {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 1px;
  overflow: hidden;
}

.analysis-live-band > div,
.analysis-metrics > div,
.analysis-phase-row > div,
.analysis-mini-table > div {
  padding: 14px;
  background: color-mix(in srgb, var(--bg-card, #fff) 88%, var(--text-main, #0f172a) 4%);
}

.analysis-live-band span,
.analysis-metrics span,
.analysis-phase-row span,
.analysis-mini-table span,
.analysis-match-row span,
.analysis-match-row small {
  display: block;
  color: var(--text-muted, #64748b);
  font-size: 0.78rem;
  font-weight: 700;
}

.analysis-live-band strong,
.analysis-metrics strong,
.analysis-phase-row strong,
.analysis-mini-table strong {
  display: block;
  color: var(--text-main, #0f172a);
  font-size: 1.2rem;
  margin-top: 4px;
}

.analysis-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.analysis-group-card,
.analysis-panel,
.analysis-upgrade {
  padding: 18px;
}

.analysis-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.analysis-card-head h2,
.analysis-upgrade h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 850;
}

.analysis-card-head span {
  color: var(--text-muted, #64748b);
  font-size: 0.8rem;
  font-weight: 800;
}

.analysis-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
}

.analysis-phase-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.analysis-phase-row > div {
  border: 1px solid rgba(15, 143, 97, 0.16);
  border-radius: 8px;
  background: rgba(15, 143, 97, 0.06);
}

.analysis-phase-row small {
  color: #0f8f61;
  font-weight: 850;
}

.analysis-mini-table {
  display: grid;
  gap: 1px;
  margin-top: 12px;
  border: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
  border-radius: 8px;
  overflow: hidden;
}

.analysis-mini-table > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.analysis-mini-table strong {
  font-size: 0.95rem;
  text-align: right;
}

.analysis-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
}

.analysis-match-list {
  display: grid;
  gap: 8px;
}

.analysis-match-row {
  display: grid;
  grid-template-columns: 88px 80px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
}

.analysis-match-row:last-child {
  border-bottom: 0;
}

.analysis-empty {
  padding: 18px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.08);
  color: #92400e;
  font-weight: 800;
}

.analysis-upgrade {
  max-width: 760px;
}

.analysis-loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
  z-index: 3000;
}

.analysis-loading-overlay.is-visible {
  display: flex;
}

.analysis-loading-box {
  width: min(360px, 100%);
  padding: 24px;
  border-radius: 8px;
  border: 1px solid rgba(15, 143, 97, 0.18);
  background: var(--bg-card, #ffffff);
  box-shadow: var(--shadow-lg, 0 24px 70px rgba(15, 23, 42, 0.22));
  text-align: center;
}

.analysis-loading-spinner {
  display: inline-block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 4px solid rgba(15, 143, 97, 0.18);
  border-top-color: #0f8f61;
  animation: analysis-spin 0.8s linear infinite;
  margin-bottom: 14px;
}

.analysis-loading-box strong {
  display: block;
  color: var(--text-main, #0f172a);
  font-size: 1.08rem;
  font-weight: 850;
}

.analysis-loading-box p {
  margin: 7px 0 0;
  color: var(--text-muted, #64748b);
  font-size: 0.92rem;
}

.theme-dark .analysis-hero,
.theme-dark .analysis-live-band,
.theme-dark .analysis-group-card,
.theme-dark .analysis-panel,
.theme-dark .analysis-upgrade,
.theme-dark .analysis-loading-box {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    var(--bg-card);
  border-color: var(--border-color);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
}

.theme-dark .analysis-live-band > div,
.theme-dark .analysis-metrics > div,
.theme-dark .analysis-mini-table > div {
  background: rgba(255, 255, 255, 0.035);
}

.theme-dark .analysis-phase-row > div {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.22);
}

.theme-dark .analysis-metrics,
.theme-dark .analysis-mini-table,
.theme-dark .analysis-match-row {
  border-color: var(--border-color);
}

.theme-dark .analysis-empty {
  background: rgba(245, 158, 11, 0.12);
  color: #ffd166;
}

@keyframes analysis-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .analysis-summary-grid,
  .analysis-detail-layout {
    grid-template-columns: 1fr;
  }

  .analysis-live-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .analysis-hero {
    flex-direction: column;
  }

  .analysis-status {
    justify-content: flex-start;
  }

  .analysis-live-band,
  .analysis-metrics,
  .analysis-phase-row {
    grid-template-columns: 1fr;
  }

  .analysis-match-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* Landing */
.landing-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.landing-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.landing-brand-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.landing-hero {
  position: relative;
  border-radius: 28px;
  padding: 3rem;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  background: linear-gradient(120deg, #ecfdf5 0%, #f0f9ff 45%, #ffffff 100%);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: -40px;
  background:
    radial-gradient(circle at 15% 20%, rgba(16, 185, 129, 0.25), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(59, 130, 246, 0.18), transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(2, 132, 199, 0.16), transparent 50%);
  opacity: 0.9;
  z-index: 0;
}

.landing-hero-content,
.landing-hero-panel {
  position: relative;
  z-index: 1;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.landing-hero h1 {
  font-size: clamp(2.2rem, 3vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 1rem 0;
}

.landing-hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
}

.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 2.25rem;
}

.landing-metrics {
  display: grid;
  gap: 0.75rem;
}

.landing-metric {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-sm);
}

.landing-metric span {
  display: block;
}

.landing-metric-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.landing-metric-value {
  font-size: 1.05rem;
  font-weight: 700;
}

.landing-hero-panel {
  display: grid;
  gap: 1rem;
  align-content: center;
}

.landing-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-md);
}

.landing-card-title {
  font-weight: 800;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.landing-card-muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.landing-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 3.5rem 0;
}

.landing-feature {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.landing-feature h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.landing-flow {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.landing-step {
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px dashed rgba(15, 23, 42, 0.15);
}

.landing-step span {
  font-weight: 800;
  font-size: 0.9rem;
  color: #0f766e;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.landing-cta-panel {
  margin-top: 3.5rem;
  padding: 2.25rem;
  border-radius: 22px;
  background: linear-gradient(110deg, #0f172a, #0f766e);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.landing-cta-panel p {
  color: rgba(248, 250, 252, 0.75);
  margin-bottom: 0;
}

.landing-animate {
  opacity: 0;
  animation: rise 0.7s ease forwards;
}

.landing-delay-1 { animation-delay: 0.1s; }
.landing-delay-2 { animation-delay: 0.2s; }
.landing-delay-3 { animation-delay: 0.3s; }
.landing-delay-4 { animation-delay: 0.4s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin: 0;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* NAV TABS - MELHORADO */
.nav-tabs {
  border-bottom: 2px solid var(--border-color);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
}

.nav-tabs .nav-link:hover {
  color: var(--text-main);
  border-bottom-color: var(--border-color);
}

.nav-tabs .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background-color: transparent;
}

/* TAB CONTENT */
.tab-content {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.tab-pane {
  animation: fadeIn 0.2s ease;
}

/* STAT CONDITION BLOCK - NOVO COMPONENTE */
.stat-condition-block {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  position: relative;
}

.stat-condition-block:hover {
  box-shadow: var(--shadow-sm);
}

.stat-condition-block .input-group {
  border-radius: 8px;
  overflow: hidden;
}

.stat-condition-block .input-group-text {
  background-color: var(--bg-body);
  border-color: var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.stat-condition-block .form-control,
.stat-condition-block .form-select {
  border-color: var(--border-color);
}

.stat-condition-block .remove-stat-condition {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
}

/* ALERT CUSTOMIZADO */
.alert {
  border-radius: 10px;
  border-left: 4px solid;
  padding: 1rem 1.25rem;
}

.alert-info {
  background-color: rgba(59, 130, 246, 0.05);
  border-left-color: var(--info);
  color: var(--text-main);
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.05);
  border-left-color: var(--warning);
  color: var(--text-main);
}

.alert-light {
  background-color: var(--bg-body);
  border-color: var(--border-color);
  color: var(--text-main);
}

/* INPUT GROUP */
.input-group {
  border-radius: 8px;
  overflow: hidden;
}

.input-group-text {
  background-color: var(--bg-body);
  border-color: var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

/* SEGMENTED BUTTONS */
.btn-group {
  gap: 0.25rem;
}

.btn-group .btn {
  border-radius: 8px;
  flex: 1;
}

.btn-check:checked + .btn {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* MESSAGE PREVIEW */
.message-preview {
  background-color: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-main);
}

/* CODE INLINE */
code {
  background-color: var(--bg-body);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--primary);
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .menu-toggle {
    display: inline-flex;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 80px;
  }
  .sidebar .brand-text, .sidebar .nav-link span:not(.nav-icon) {
    display: none;
  }
  .main-area {
    margin-left: 80px;
  }
  .sidebar-open .sidebar {
    width: 260px;
  }
  .sidebar-open .sidebar .brand-text,
  .sidebar-open .sidebar .nav-link span:not(.nav-icon) {
    display: inline;
  }
  .sidebar-open .main-area {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: flex;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 110;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .topbar-left {
    width: 100%;
    justify-content: space-between;
  }
  .status-block {
    margin-left: auto;
  }
  .sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .main-area {
    margin-left: 0;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .content {
    padding: 1.25rem;
  }
  .auth-shell {
    max-width: 100%;
    margin: 6vh auto;
    padding: 1rem;
  }
  .landing-shell {
    padding: 1.5rem;
  }
  .landing-hero {
    padding: 2rem 1.5rem;
  }
  .landing-nav {
    flex-direction: column;
    align-items: flex-start;
  }
  .card-body {
    padding: 1.25rem;
  }
  .topbar {
    height: auto;
    padding: 0.75rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
  .user-chip .user-name {
    display: none;
  }
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .page-title {
    font-size: 1.5rem;
  }
  .page-subtitle {
    font-size: 0.95rem;
  }
  .btn-lg {
    padding: 0.65rem 1rem;
  }
  .table thead {
    display: none;
  }
  .table tbody td {
    display: block;
    width: 100%;
    padding: 0.75rem 0.75rem;
    border-bottom: 0;
  }
  .table tbody tr {
    display: block;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    background-color: var(--bg-card);
  }
  .table-clean tbody tr:hover {
    background-color: var(--bg-card);
  }
  .table-responsive {
    overflow: visible;
  }

  /* Responsivo para abas */
  .nav-tabs {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .nav-tabs .nav-link {
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
  }

  /* Responsivo para stat condition block */
  .stat-condition-block {
    padding: 1rem;
  }

  .stat-condition-block .row {
    gap: 0.75rem !important;
  }

  .stat-condition-block .col-md-3,
  .stat-condition-block .col-md-2 {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 1rem;
  }
  .card {
    border-radius: 10px;
  }
  .nav-link {
    padding: 0.65rem 0.75rem;
  }
  .form-control,
  .form-select {
    padding: 0.55rem 0.85rem;
  }

  .stat-condition-block {
    padding: 0.75rem;
  }

  .stat-condition-block .form-label {
    font-size: 0.8rem;
  }

  .stat-condition-block .form-control,
  .stat-condition-block .form-select {
    font-size: 0.9rem;
  }
}

/* Custom Chart Bars */
.chart-bar {
  background-color: var(--bg-body);
  border-radius: 10px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.bar {
  width: 100%;
  transition: height 0.5s ease;
}

.weekly-chart {
  height: 220px;
  padding: 0.25rem 0 0.75rem;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.95rem;
  align-items: end;
}

.week-col {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.week-col .chart-bar {
  max-width: 58px;
  height: 100%;
  border: 1px solid var(--border-color);
}

.top-rule-item {
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--bg-card) 85%, var(--bg-body));
}

.top-rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.55rem;
}

.top-rule-name {
  font-weight: 700;
  color: var(--text-main);
}

.top-rule-rate {
  font-weight: 800;
  color: var(--primary);
}

.top-rule-progress {
  height: 10px;
  background: rgba(148, 163, 184, 0.2);
  margin-bottom: 0.45rem;
}

.top-rule-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rules-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.rule-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.rule-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.rule-main {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.rule-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  margin-top: 0.3rem;
  flex-shrink: 0;
}

.rule-dot-on {
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16);
}

.rule-dot-off {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.16);
}

.rule-name {
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.rule-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.rule-card-stats {
  border-top: 1px solid var(--border-color);
  padding-top: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.rule-pill {
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
}

.rule-pill-green {
  background: rgba(16, 185, 129, 0.16);
  color: #059669;
}

.rule-pill-red {
  background: rgba(239, 68, 68, 0.16);
  color: #dc2626;
}

.rule-pill-win {
  background: rgba(14, 165, 233, 0.16);
  color: #0284c7;
}

.rule-last {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rule-rank-list .list-group-item {
  border-color: rgba(73, 232, 212, 0.16);
  background: linear-gradient(135deg, rgba(18, 20, 20, 0.96), rgba(18, 34, 34, 0.9));
  color: #eafffb;
}

.rule-rank-list .list-group-item.text-muted {
  color: rgba(234, 255, 251, 0.58) !important;
}

.rule-rank-more summary {
  cursor: pointer;
  color: #49e8d4;
  font-weight: 800;
  font-size: 0.86rem;
}

.rule-rank-more summary:hover {
  text-decoration: underline;
}

.modal-content:has(.rule-rank-list) {
  color: #f4fffd;
  background: linear-gradient(145deg, #121414, #0c1616);
  border: 1px solid rgba(73, 232, 212, 0.24);
}

.modal-content:has(.rule-rank-list) .modal-header {
  border-bottom-color: rgba(73, 232, 212, 0.16);
}

.modal-content:has(.rule-rank-list) .btn-close {
  filter: invert(1);
}

.live-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) 110px 110px 140px auto auto auto;
  gap: 0.5rem;
  align-items: center;
}

.live-fav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0 0.7rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--bg-card);
  white-space: nowrap;
}

.live-league-picker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 38px;
  border: 1px solid rgba(14, 165, 233, 0.38);
  border-radius: 999px;
  padding: 0 0.85rem;
  color: var(--secondary);
  background: rgba(14, 165, 233, 0.1);
  font-weight: 800;
  white-space: nowrap;
}

.live-league-picker-btn:hover {
  border-color: rgba(14, 165, 233, 0.58);
  background: rgba(14, 165, 233, 0.18);
}

.live-league-picker-btn span {
  min-width: 22px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #031016;
  background: var(--secondary);
  font-size: 0.72rem;
}

.live-league-chip {
  border: 1px solid rgba(73, 232, 212, 0.18);
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  color: var(--text-main);
  background: color-mix(in srgb, var(--bg-card) 88%, #49e8d4 12%);
  font-weight: 700;
  font-size: 0.82rem;
}

.live-league-chip span {
  color: #49e8d4;
  margin-right: 0.35rem;
}

.live-league-chip.is-favorite {
  border-color: rgba(245, 158, 11, 0.42);
  color: #fff7ed;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(73, 232, 212, 0.1));
}

.live-league-modal {
  background:
    radial-gradient(700px 360px at 10% 0%, rgba(14, 165, 233, 0.16), transparent 58%),
    var(--bg-card);
  border: 1px solid rgba(73, 232, 212, 0.16);
  color: var(--text-main);
}

.live-league-modal .modal-header {
  border-bottom-color: rgba(73, 232, 212, 0.16);
}

.live-league-modal .btn-close {
  filter: invert(1);
}

.live-league-modal-subtitle {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-top: 0.18rem;
}

.live-league-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.55rem;
}

.live-league-modal-grid .live-league-chip {
  width: 100%;
  min-height: 42px;
  text-align: left;
}

.live-game-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(18, 20, 20, 0.96), rgba(14, 39, 38, 0.9)),
    var(--bg-card);
  border: 1px solid rgba(73, 232, 212, 0.2) !important;
}

.live-game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(73, 232, 212, 0.32), transparent 45%);
  height: 3px;
}

.live-card-league {
  color: #49e8d4;
  font-size: 0.76rem;
  font-weight: 800;
}

.live-card-teams {
  color: #f6fffd;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.25;
}

.live-minute-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 0.55rem;
  border-radius: 999px;
  color: #071312;
  background: #49e8d4;
  font-weight: 900;
  font-size: 0.78rem;
}

.live-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.6rem 0;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  color: rgba(234, 255, 251, 0.68);
  background: rgba(255, 255, 255, 0.055);
}

.live-score-row strong {
  color: #fff;
  font-size: 1.05rem;
}

@media (max-width: 992px) {
  .live-filter-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .live-filter-bar {
    grid-template-columns: 1fr;
  }
}

.rule-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.rule-more-btn {
  border: 1px solid rgba(14, 165, 233, 0.36);
  background: rgba(14, 165, 233, 0.1);
  color: var(--secondary);
  font-weight: 800;
}

.rule-more-btn:hover {
  border-color: rgba(14, 165, 233, 0.58);
  background: var(--secondary);
  color: #031016;
}

.system-status-card {
  background: color-mix(in srgb, var(--bg-card) 88%, #10b981 12%);
  border: 1px solid color-mix(in srgb, var(--border-color) 70%, #10b981 30%);
}

.status-on-text {
  color: var(--primary);
}

@media (max-width: 768px) {
  .rules-board {
    grid-template-columns: 1fr;
  }

  .rule-card {
    padding: 0.85rem;
  }

  .rule-last {
    width: 100%;
    margin-left: 0;
  }

  .weekly-chart {
    gap: 0.5rem;
    height: 200px;
  }

  .week-col .chart-bar {
    max-width: 44px;
  }

  .stat-card-kpi {
    padding: 1rem;
  }
}

.bg-success { background-color: var(--primary) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-warning { background-color: var(--warning) !important; }
/* History Page - styled to match the provided mockup */
.history-page {
  --history-bg: #060a0f;
  --history-surface: #0d1520;
  --history-surface-2: #111d2e;
  --history-border: rgba(255, 255, 255, 0.08);
  --history-text: #e8f0fe;
  --history-muted: #8a9ab8;
  --history-muted-2: #5a6a82;
  --history-green: #00e5a0;
  --history-red: #ff4d6a;
  --history-accent: #00c3ff;

  background:
    radial-gradient(1100px 540px at 0% -15%, rgba(0, 229, 160, 0.12), transparent 58%),
    radial-gradient(800px 420px at 105% 0%, rgba(0, 195, 255, 0.12), transparent 52%),
    var(--history-bg);
  border: 1px solid var(--history-border);
  border-radius: 22px;
  padding: 1.5rem;
  color: var(--history-text);
  box-shadow: 0 18px 36px rgba(2, 6, 23, 0.45);
}

.history-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.3rem;
}

.history-title {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--history-text);
}

.history-subtitle {
  margin: 0.35rem 0 0;
  color: var(--history-muted);
  font-size: 0.92rem;
}

.history-stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.history-stat-card {
  background: var(--history-surface);
  border: 1px solid var(--history-border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  position: relative;
  overflow: hidden;
}

.history-stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--history-accent);
}

.history-stat-card-green::before {
  background: var(--history-green);
}

.history-stat-card-red::before {
  background: var(--history-red);
}

.history-stat-card-winrate::before {
  background: linear-gradient(90deg, var(--history-green), var(--history-accent));
}

.history-stat-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.62rem;
  color: var(--history-muted-2);
  margin-bottom: 0.5rem;
}

.history-stat-value {
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 800;
  color: var(--history-text);
}

.history-stat-value-green {
  color: var(--history-green);
}

.history-stat-value-red {
  color: var(--history-red);
}

.history-stat-value-gradient {
  color: transparent;
  background: linear-gradient(90deg, var(--history-green), var(--history-accent));
  -webkit-background-clip: text;
  background-clip: text;
}

.history-winrate-track {
  margin-top: 0.7rem;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.history-winrate-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--history-green), var(--history-accent));
}

.history-filters-card {
  background: var(--history-surface);
  border: 1px solid var(--history-border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1.1rem;
}

.history-filters-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.history-filter-group {
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.history-filter-label {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--history-muted-2);
}

.history-filter-control {
  border-radius: 10px;
  border: 1px solid var(--history-border);
  background: var(--history-bg);
  color: var(--history-text);
  min-height: 38px;
  padding: 0.45rem 0.68rem;
  font-size: 0.86rem;
}

.history-filter-control:focus {
  outline: none;
  border-color: rgba(0, 229, 160, 0.48);
  box-shadow: 0 0 0 0.18rem rgba(0, 229, 160, 0.12);
}

.history-filter-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.history-btn {
  border-radius: 10px;
  border: 1px solid transparent;
  min-height: 38px;
  font-size: 0.83rem;
  font-weight: 700;
  padding: 0.48rem 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

.history-btn-primary {
  background: linear-gradient(135deg, var(--history-green), #00c896);
  color: #05110d;
}

.history-btn-primary:hover {
  color: #05110d;
  box-shadow: 0 8px 20px rgba(0, 229, 160, 0.25);
}

.history-btn-danger {
  background: rgba(255, 77, 106, 0.14);
  border-color: rgba(255, 77, 106, 0.38);
  color: var(--history-red);
}

.history-btn-danger:hover:enabled {
  color: #ffd9df;
  background: rgba(255, 77, 106, 0.25);
}

.history-btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.history-btn-ghost {
  background: transparent;
  border-color: var(--history-border);
  color: var(--history-muted);
}

.history-btn-ghost:hover {
  color: var(--history-text);
  border-color: rgba(255, 255, 255, 0.2);
}

.history-btn-inline-danger {
  border-color: var(--history-border);
  background: transparent;
  color: var(--history-muted);
  min-height: 32px;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
}

.history-btn-inline-danger:hover {
  color: var(--history-red);
  border-color: rgba(255, 77, 106, 0.35);
  background: rgba(255, 77, 106, 0.12);
}

.history-actions-col {
  width: 76px;
}

.history-actions-cell {
  white-space: nowrap;
}

.history-actions-group {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(42px, auto));
  gap: 0.4rem;
  justify-content: end;
  align-items: center;
}

.history-action-form {
  margin: 0;
}

.history-action-placeholder {
  display: inline-block;
  width: 42px;
}

.history-action-menu {
  display: inline-flex;
  justify-content: flex-end;
}

.history-action-menu-toggle {
  width: 38px;
  min-width: 38px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-color: var(--history-border);
  background: var(--history-surface-2);
  color: var(--history-text);
}

.history-action-menu-toggle span {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.history-action-menu-toggle:hover,
.history-action-menu-toggle:focus {
  border-color: rgba(0, 229, 160, 0.36);
  color: var(--history-green);
  background: rgba(0, 229, 160, 0.1);
}

.history-action-dropdown {
  min-width: 190px;
  padding: 0.4rem;
  border: 1px solid var(--history-border);
  border-radius: 10px;
  background: var(--history-surface);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.history-action-dropdown .dropdown-item {
  min-height: 36px;
  border-radius: 8px;
  color: var(--history-text);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.history-action-dropdown .dropdown-item:hover,
.history-action-dropdown .dropdown-item:focus {
  color: var(--history-green);
  background: rgba(0, 229, 160, 0.1);
}

.history-action-dropdown .dropdown-divider {
  border-top-color: var(--history-border);
  margin: 0.35rem 0;
}

.history-dropdown-danger {
  color: var(--history-red) !important;
}

.history-dropdown-danger:hover,
.history-dropdown-danger:focus {
  color: var(--history-red) !important;
  background: rgba(255, 77, 106, 0.12) !important;
}

.history-btn-inline-view {
  border-color: rgba(0, 195, 255, 0.28);
  background: rgba(0, 195, 255, 0.08);
  color: var(--history-accent);
  min-height: 32px;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
}

.history-btn-inline-view:hover {
  color: #031016;
  border-color: rgba(0, 195, 255, 0.52);
  background: var(--history-accent);
}

.history-btn-inline-money {
  border-color: rgba(0, 229, 160, 0.3);
  background: rgba(0, 229, 160, 0.1);
  color: var(--history-green);
  min-height: 32px;
  min-width: 36px;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
}

.history-btn-inline-money:hover {
  color: #05110d;
  border-color: rgba(0, 229, 160, 0.52);
  background: var(--history-green);
}

.history-table-card {
  background: var(--history-surface);
  border: 1px solid var(--history-border);
  border-radius: 14px;
  overflow: visible;
}

.history-color-bar {
  height: 3px;
  width: 100%;
  border-radius: 14px 14px 0 0;
}

.history-table-head {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--history-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.history-table-head h2 {
  margin: 0;
  color: var(--history-text);
  font-size: 0.93rem;
  font-weight: 700;
}

.history-table-head span {
  font-size: 0.77rem;
  color: var(--history-muted);
}

.history-table thead th {
  background: var(--history-surface);
  border-bottom: 1px solid var(--history-border);
  color: var(--history-muted-2);
  font-size: 0.63rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.75rem 0.75rem;
}

.history-table tbody td {
  border-bottom: 1px solid var(--history-border);
  padding: 0.78rem 0.75rem;
  color: var(--history-text);
  font-size: 0.84rem;
  background: transparent;
}

.history-table tbody tr:last-child td {
  border-bottom: none;
}

.history-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.history-rule-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.26rem 0.52rem;
  border: 1px solid var(--history-border);
  background: var(--history-surface-2);
  border-radius: 8px;
  color: var(--history-text);
  font-size: 0.71rem;
  font-weight: 600;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-user-chip {
  color: var(--history-muted);
  font-size: 0.8rem;
}

.history-match-name {
  color: var(--history-text);
  font-size: 0.84rem;
  font-weight: 500;
}

.history-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: max-content;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.22rem 0.58rem;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  border: 1px solid transparent;
}

.history-badge::before {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.history-badge-green {
  color: var(--history-green);
  background: rgba(0, 229, 160, 0.12);
  border-color: rgba(0, 229, 160, 0.3);
}

.history-badge-red {
  color: var(--history-red);
  background: rgba(255, 77, 106, 0.14);
  border-color: rgba(255, 77, 106, 0.3);
}

.history-badge-pending {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.3);
}

.history-mono,
.history-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: var(--history-muted);
  font-size: 0.79rem;
}

.history-empty {
  text-align: center;
  color: var(--history-muted);
  padding: 1rem;
}

.history-pagination-wrap {
  border-top: 1px solid var(--history-border);
  padding: 0.82rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.history-pagination-info {
  color: var(--history-muted);
  font-size: 0.76rem;
}

.history-pagination-buttons {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.history-pag-btn {
  min-height: 32px;
  min-width: 32px;
  border-radius: 8px;
  border: 1px solid var(--history-border);
  background: var(--history-surface-2);
  color: var(--history-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.66rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.history-pag-btn:hover {
  color: var(--history-green);
  border-color: rgba(0, 229, 160, 0.35);
}

.history-pag-btn-active {
  color: var(--history-green);
  border-color: rgba(0, 229, 160, 0.35);
  background: rgba(0, 229, 160, 0.12);
}

.history-pag-btn-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.history-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1px solid var(--history-muted-2);
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.history-table input[type="checkbox"]:checked {
  border-color: var(--history-green);
  background: var(--history-green);
}

@media (max-width: 1200px) {
  .history-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .history-page {
    border-radius: 14px;
    padding: 1rem;
  }

  .history-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-stats-row {
    grid-template-columns: 1fr;
  }

  .history-filters-form {
    flex-direction: column;
    align-items: stretch;
  }

  .history-filter-group,
  .history-filter-actions {
    min-width: 100%;
    width: 100%;
    margin-left: 0;
  }

  .history-filter-actions {
    justify-content: stretch;
  }

  .history-filter-actions .history-btn {
    width: 100%;
  }

  .history-table-head,
  .history-pagination-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-table thead {
    display: none;
  }

  .history-table tbody td {
    display: block;
    width: 100%;
    border-bottom: 0;
    padding: 0.45rem 0.55rem;
  }

  .history-actions-cell {
    text-align: left !important;
    white-space: nowrap;
  }

  .history-action-menu {
    width: 100%;
    justify-content: flex-start;
  }

  .history-table tbody tr {
    display: block;
    margin: 0.6rem;
    border: 1px solid var(--history-border);
    border-radius: 10px;
  }

  .history-table tbody tr:last-child {
    margin-bottom: 0;
  }
}

/* Global Mockup Theme */
:root {
  --primary: #10b981;
  --primary-hover: #059669;
  --secondary: #0ea5e9;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  --gh-body: #f3f7fc;
  --gh-surface: #ffffff;
  --gh-surface-2: #eef4fd;
  --gh-border: rgba(15, 23, 42, 0.1);
  --gh-border-strong: rgba(15, 23, 42, 0.16);
  --gh-text: #12243b;
  --gh-muted: #556b86;
  --gh-muted-soft: #7389a4;

  --bg-body: var(--gh-body);
  --bg-card: var(--gh-surface);
  --bg-sidebar: var(--gh-surface);
  --border-color: var(--gh-border);
  --text-main: var(--gh-text);
  --text-muted: var(--gh-muted);

  --shell-bg:
    radial-gradient(1100px 480px at 0% -15%, rgba(16, 185, 129, 0.1), transparent 56%),
    radial-gradient(900px 460px at 100% 0%, rgba(14, 165, 233, 0.11), transparent 55%),
    var(--gh-body);

  --sidebar-bg: var(--gh-surface);
  --sidebar-border: var(--gh-border);
  --sidebar-brand-border: var(--gh-border);
  --sidebar-fg: var(--gh-text);
  --sidebar-title: var(--gh-text);
  --sidebar-subtitle: var(--gh-muted);
  --sidebar-nav-text: #2a3f5f;
  --sidebar-nav-bg: transparent;
  --sidebar-nav-hover-bg: rgba(14, 165, 233, 0.08);
  --sidebar-nav-hover-border: rgba(14, 165, 233, 0.18);
  --sidebar-nav-hover-text: #15304f;
  --sidebar-nav-active-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(14, 165, 233, 0.14));
  --sidebar-nav-active-border: rgba(16, 185, 129, 0.28);
  --sidebar-nav-active-shadow: 0 6px 20px rgba(16, 185, 129, 0.18);
  --sidebar-icon-bg: rgba(15, 23, 42, 0.08);
  --sidebar-icon-active-bg: rgba(16, 185, 129, 0.2);

  --topbar-bg: rgba(255, 255, 255, 0.78);
  --topbar-border: var(--gh-border);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 22px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.14);
  --radius: 14px;
}

.theme-dark {
  --primary: #00e5a0;
  --primary-hover: #00c896;
  --secondary: #00c3ff;
  --danger: #ff4d6a;
  --warning: #ffd166;
  --info: #00c3ff;

  --gh-body: #060a0f;
  --gh-surface: #0d1520;
  --gh-surface-2: #111d2e;
  --gh-border: rgba(255, 255, 255, 0.07);
  --gh-border-strong: rgba(255, 255, 255, 0.14);
  --gh-text: #e8f0fe;
  --gh-muted: #8a9ab8;
  --gh-muted-soft: #5a6a82;

  --bg-body: var(--gh-body);
  --bg-card: var(--gh-surface);
  --bg-sidebar: var(--gh-surface);
  --border-color: var(--gh-border);
  --text-main: var(--gh-text);
  --text-muted: var(--gh-muted);

  --shell-bg: var(--gh-body);
  --sidebar-bg: var(--gh-surface);
  --sidebar-border: var(--gh-border);
  --sidebar-brand-border: var(--gh-border);
  --sidebar-fg: var(--gh-text);
  --sidebar-title: var(--gh-text);
  --sidebar-subtitle: var(--gh-muted);
  --sidebar-nav-text: var(--gh-muted);
  --sidebar-nav-bg: transparent;
  --sidebar-nav-hover-bg: var(--gh-surface-2);
  --sidebar-nav-hover-border: rgba(255, 255, 255, 0.12);
  --sidebar-nav-hover-text: var(--gh-text);
  --sidebar-nav-active-bg: linear-gradient(135deg, rgba(0, 229, 160, 0.18), rgba(0, 195, 255, 0.12));
  --sidebar-nav-active-border: rgba(0, 229, 160, 0.25);
  --sidebar-nav-active-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
  --sidebar-icon-bg: rgba(255, 255, 255, 0.08);
  --sidebar-icon-active-bg: rgba(0, 229, 160, 0.2);

  --topbar-bg: rgba(13, 21, 32, 0.84);
  --topbar-border: var(--gh-border);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 38px rgba(0, 0, 0, 0.45);
}

* {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--shell-bg);
  color: var(--gh-text);
}

h1, h2, h3, h4, h5,
.page-title,
.topbar-title,
.card-title,
.brand-title,
.history-title {
  font-family: 'Syne', 'DM Sans', sans-serif;
}

.app-shell {
  background: var(--shell-bg);
}

.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
}

.sidebar::before,
.sidebar::after {
  display: none;
}

.sidebar-brand {
  padding: 1.1rem 1.05rem 1rem;
  border-bottom: 1px solid var(--sidebar-brand-border);
  margin-bottom: 0.45rem;
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.brand-icon.brand-icon-image {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 6px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon.brand-icon-image img {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

.brand-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.brand-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  z-index: 1;
  opacity: 0.6;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--sidebar-title);
}

.brand-sub {
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  color: var(--sidebar-subtitle);
  text-transform: uppercase;
}

.sidebar-brand-logo-only {
  display: block;
  padding: 0.9rem 0.9rem 0.8rem;
}

.brand-logo-hero {
  width: 100%;
  height: auto;
  max-height: 96px;
  display: block;
  object-fit: contain;
}

.sidebar-brand-logo-with-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 0.72rem 0.8rem;
}

.sidebar-brand-logo-with-text .brand-logo-hero {
  width: 39px;
  height: 39px;
  max-height: none;
  object-fit: contain;
  flex: 0 0 39px;
}

.sidebar-brand-logo-with-text .brand-text {
  min-width: 0;
  flex: 1;
}

.sidebar-brand-logo-with-text .brand-title {
  font-size: 0.92rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: visible;
  letter-spacing: -0.035em;
}

.sidebar-brand-logo-with-text .brand-sub {
  font-size: 0.54rem;
  line-height: 1.2;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.sidebar-nav {
  padding: 0.65rem 0.6rem 0.8rem;
}

.nav-section {
  display: block;
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gh-muted-soft);
  padding: 0.85rem 0.7rem 0.45rem;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  padding: 0.55rem 0.72rem;
  border-radius: 10px;
  margin-bottom: 0.18rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sidebar-nav-text);
  border: 1px solid transparent;
  background: var(--sidebar-nav-bg);
}

.sidebar .nav-link:hover {
  color: var(--sidebar-nav-hover-text);
  background: var(--sidebar-nav-hover-bg);
  border-color: var(--sidebar-nav-hover-border);
}

.sidebar .nav-link.active {
  color: var(--primary);
  border-color: var(--sidebar-nav-active-border);
  background: var(--sidebar-nav-active-bg);
  box-shadow: var(--sidebar-nav-active-shadow);
}

.sidebar .nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: var(--sidebar-icon-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar .nav-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar .nav-link.active .nav-icon {
  background: var(--sidebar-icon-active-bg);
}

.sidebar-footer {
  border-top: 1px solid var(--sidebar-brand-border);
  margin-top: 0.55rem;
  padding-top: 0.75rem;
}

.api-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.69rem;
  color: var(--gh-muted);
  border-radius: 8px;
  border: 1px solid var(--gh-border);
  background: var(--gh-surface-2);
  padding: 0.44rem 0.64rem;
  margin-bottom: 0.45rem;
}

.api-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.main-area {
  margin-left: 220px;
}

.topbar {
  height: 60px;
  border-bottom: 1px solid var(--topbar-border);
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  padding: 0 1.4rem;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gh-text);
}

.status-pill {
  border-radius: 999px;
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 0.3rem 0.56rem;
}

.status-on {
  background: rgba(0, 229, 160, 0.15);
  color: var(--primary);
  border: 1px solid rgba(0, 229, 160, 0.3);
}

.status-off {
  background: rgba(255, 77, 106, 0.14);
  color: var(--danger);
  border: 1px solid rgba(255, 77, 106, 0.25);
}

.status-wait {
  background: rgba(148, 163, 184, 0.14);
  color: var(--gh-muted);
  border: 1px solid var(--gh-border);
}

.btn-theme-toggle {
  border-radius: 9px;
  border-color: var(--gh-border);
  color: var(--gh-muted);
  background: transparent;
  font-size: 0.74rem;
  padding: 0.4rem 0.66rem;
}

.btn-theme-toggle:hover {
  color: var(--gh-text);
  border-color: var(--gh-border-strong);
  background: transparent;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #04110b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.theme-dark .user-avatar {
  color: #03110a;
}

.user-name {
  color: var(--gh-muted);
  font-weight: 600;
}

.content {
  max-width: 100%;
  margin: 0;
  padding: 1.5rem;
}

.page-header {
  margin-bottom: 1.35rem;
}

.page-title {
  color: var(--gh-text);
  font-size: 1.65rem;
}

.page-subtitle {
  color: var(--gh-muted);
  font-size: 0.84rem;
}

.card,
.stat-card,
.filter-card,
.table-card {
  background: var(--gh-surface);
  border: 1px solid var(--gh-border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.stat-card {
  padding: 1rem;
}

.stat-label {
  color: var(--gh-muted-soft);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-value {
  color: var(--gh-text);
  font-family: 'Syne', 'DM Sans', sans-serif;
}

.btn {
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.8rem;
  min-height: 36px;
  padding: 0.45rem 0.82rem;
}

.btn-primary,
.btn-success {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border-color: transparent;
  color: #05120d;
}

.btn-primary:hover,
.btn-success:hover {
  color: #05120d;
  transform: translateY(-1px);
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger,
.btn-outline-info {
  background: transparent;
  border-color: var(--gh-border);
}

.btn-outline-secondary {
  color: var(--gh-muted);
}

.btn-outline-secondary:hover {
  color: var(--gh-text);
  border-color: var(--gh-border-strong);
}

.btn-danger,
.btn-outline-danger:hover {
  color: var(--danger);
}

.form-control,
.form-select,
textarea {
  border-radius: 10px;
  background: var(--gh-surface-2);
  border: 1px solid var(--gh-border);
  color: var(--gh-text);
}

.form-control:focus,
.form-select:focus,
textarea:focus {
  border-color: rgba(0, 229, 160, 0.4);
  box-shadow: 0 0 0 0.18rem rgba(0, 229, 160, 0.12);
  background: var(--gh-surface-2);
  color: var(--gh-text);
}

.form-label {
  color: var(--gh-muted);
  font-size: 0.75rem;
}

.table,
.table thead,
.table tbody,
.table tr,
.table td,
.table th {
  color: var(--gh-text);
}

.table thead th {
  background: transparent;
  color: var(--gh-muted-soft);
  border-bottom: 1px solid var(--gh-border);
  font-size: 0.63rem;
  letter-spacing: 0.11em;
}

.table tbody td {
  border-bottom: 1px solid var(--gh-border);
  font-size: 0.84rem;
}

.table-clean tbody tr:hover {
  background: rgba(0, 229, 160, 0.06);
}

.badge-status {
  border-radius: 999px;
  font-size: 0.67rem;
  padding: 0.22rem 0.54rem;
  min-width: max-content;
  flex: 0 0 auto;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  line-height: 1.25;
}

.badge-on {
  background: rgba(0, 229, 160, 0.16);
  color: var(--primary);
  border: 1px solid rgba(0, 229, 160, 0.25);
}

.badge-off {
  background: rgba(255, 77, 106, 0.16);
  color: var(--danger);
  border: 1px solid rgba(255, 77, 106, 0.25);
}

.badge-wait {
  background: rgba(255, 209, 102, 0.16);
  color: var(--warning);
  border: 1px solid rgba(255, 209, 102, 0.25);
}

.badge-muted {
  background: rgba(148, 163, 184, 0.14);
  color: var(--gh-muted);
  border: 1px solid var(--gh-border);
}

.admin-monitor {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(780px 300px at 0% 0%, rgba(73, 232, 212, 0.12), transparent 56%),
    radial-gradient(640px 300px at 100% 0%, rgba(14, 165, 233, 0.12), transparent 54%),
    var(--gh-surface);
  border: 1px solid rgba(73, 232, 212, 0.16);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.admin-monitor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
}

.admin-health-card {
  min-height: 108px;
  padding: 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(73, 232, 212, 0.14);
  background: rgba(255, 255, 255, 0.035);
}

.admin-health-card span,
.admin-health-card small,
.admin-plan-list span {
  color: var(--gh-muted);
}

.admin-health-card span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.admin-health-card strong {
  display: block;
  margin: 0.35rem 0 0.18rem;
  color: var(--gh-text);
  font-size: 1.28rem;
  line-height: 1.15;
}

.admin-health-card small {
  font-size: 0.78rem;
}

.admin-plan-list {
  display: grid;
  gap: 0.65rem;
}

.admin-plan-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--gh-border);
  background: rgba(255, 255, 255, 0.03);
}

.admin-plan-list strong {
  color: var(--primary);
  font-size: 1.1rem;
}

.alert {
  border-radius: 10px;
  border: 1px solid var(--gh-border);
  background: var(--gh-surface);
  color: var(--gh-text);
}

.pagination .page-link,
.page-link {
  border-radius: 8px;
  border-color: var(--gh-border);
  background: var(--gh-surface-2);
  color: var(--gh-muted);
}

.pagination .page-link:hover,
.page-link:hover {
  color: var(--primary);
  border-color: rgba(0, 229, 160, 0.32);
  background: var(--gh-surface-2);
}

/* History page follows global light/dark variables */
.history-page {
  --history-bg: var(--gh-body);
  --history-surface: var(--gh-surface);
  --history-surface-2: var(--gh-surface-2);
  --history-border: var(--gh-border);
  --history-text: var(--gh-text);
  --history-muted: var(--gh-muted);
  --history-muted-2: var(--gh-muted-soft);
  --history-green: var(--primary);
  --history-red: var(--danger);
  --history-accent: var(--secondary);
}

@media (max-width: 1024px) {
  .sidebar {
    width: 78px;
  }

  .sidebar .brand-text,
  .sidebar .nav-link span:not(.nav-icon),
  .sidebar .nav-section,
  .sidebar .api-badge {
    display: none;
  }

  .main-area {
    margin-left: 78px;
  }

  .sidebar-open .sidebar {
    width: 220px;
  }

  .sidebar-open .sidebar .brand-text,
  .sidebar-open .sidebar .nav-link span:not(.nav-icon),
  .sidebar-open .sidebar .nav-section,
  .sidebar-open .sidebar .api-badge {
    display: block;
  }

  .sidebar-open .main-area {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 220px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .main-area {
    margin-left: 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .topbar {
    height: auto;
    padding: 0.75rem 0.95rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .user-name,
  #api-status {
    display: none;
  }

  .content {
    padding: 1rem;
  }
}

@media (max-width: 560px) {
  .ghx-auth-shell.auth-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 84px 0 32px !important;
  }

  .ghx-auth-card {
    width: calc(100vw - 32px) !important;
    max-width: 358px !important;
    justify-self: start;
    margin-left: 16px;
    margin-right: 16px;
    box-sizing: border-box;
  }

  .ghx-auth-submit,
  .ghx-auth-input {
    width: 100%;
  }

  .ghx-auth-footer {
    padding-inline: 8px;
    line-height: 1.6;
  }
}

/* Responsive hardening */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  min-width: 0;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

.content,
.main-area,
.page-header,
.page-actions,
.topbar,
.topbar-left,
.topbar-right,
.card,
.table-card,
.history-page,
.analysis-page,
.admin-monitor {
  min-width: 0;
}

.page-actions,
.topbar-left,
.topbar-right {
  flex-wrap: wrap;
}

.page-title,
.page-subtitle,
.topbar-title,
.history-match-name,
.history-rule-chip,
.history-user-chip,
.analysis-hero h1,
.analysis-card-head h2,
.admin-health-card strong,
.admin-plan-list span,
.admin-plan-list strong,
.table td,
.table th {
  overflow-wrap: anywhere;
}

.btn,
.history-btn,
.dropdown-item,
.badge,
.status-pill {
  white-space: normal;
}

.table-responsive {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.history-page .table-responsive {
  overflow: visible;
}

.theme-dark .history-action-dropdown {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    var(--history-surface);
  border-color: var(--history-border);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
}

@media (max-width: 768px) {
  .content {
    width: 100%;
    padding: 0.9rem;
  }

  .page-header {
    align-items: stretch;
    gap: 0.8rem;
    margin-bottom: 1rem;
  }

  .page-actions {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }

  .page-actions > * {
    flex: 1 1 150px;
  }

  .topbar {
    width: 100%;
  }

  .topbar-left,
  .topbar-right {
    gap: 0.5rem !important;
  }

  .topbar-title-wrap {
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar-title {
    max-width: 100%;
    line-height: 1.25;
  }

  .btn-theme-toggle {
    flex: 0 1 auto;
  }

  .card-body,
  .analysis-group-card,
  .analysis-panel,
  .analysis-upgrade,
  .admin-monitor {
    padding: 1rem;
  }

  .admin-monitor-head,
  .admin-plan-list div {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-health-grid {
    grid-template-columns: 1fr;
  }

  .history-page {
    width: 100%;
    padding: 0.85rem;
  }

  .history-table-card {
    overflow: visible;
  }

  .history-table tbody tr {
    width: auto;
  }

  .history-rule-chip {
    max-width: 100%;
    white-space: normal;
  }

  .history-action-dropdown {
    min-width: min(210px, calc(100vw - 32px));
  }

  .analysis-hero,
  .analysis-card-head,
  .analysis-mini-table > div {
    align-items: flex-start;
  }

  .analysis-mini-table > div {
    flex-direction: column;
    gap: 0.35rem;
  }

  .analysis-mini-table strong {
    text-align: left;
  }
}

@media (max-width: 992px) {
  .history-table thead {
    display: none;
  }

  .history-table tbody tr {
    display: block;
    margin: 0.6rem;
    border: 1px solid var(--history-border);
    border-radius: 10px;
  }

  .history-table tbody td {
    display: block;
    width: 100%;
    border-bottom: 0;
    padding: 0.5rem 0.6rem;
  }

  .history-actions-cell {
    text-align: left !important;
    white-space: nowrap;
  }

  .history-action-menu {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .content {
    padding: 0.75rem;
  }

  .page-title {
    font-size: 1.32rem;
    line-height: 1.15;
  }

  .page-subtitle {
    font-size: 0.86rem;
  }

  .topbar {
    padding: 0.7rem 0.75rem;
  }

  .user-chip {
    gap: 0 !important;
  }

  .btn,
  .history-btn,
  .form-control,
  .form-select {
    max-width: 100%;
  }

  .history-table tbody tr {
    margin: 0.5rem 0;
  }

  .history-table tbody td {
    padding-inline: 0.45rem;
  }

  .analysis-live-band > div,
  .analysis-metrics > div,
  .analysis-phase-row > div,
  .analysis-mini-table > div {
    padding: 0.85rem;
  }
}

/* Project-wide responsive polish */
html {
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
}

.app-shell,
.ghx-landing,
.auth-shell {
  width: 100%;
  max-width: 100%;
}

.row {
  min-width: 0;
}

.row > * {
  min-width: 0;
}

.card-title,
.modal-title,
.fw-semibold,
.fw-bold,
.rule-name,
.top-rule-name,
.live-card-league,
.live-card-teams,
.history-date,
.analysis-match-row,
.list-group-item,
.form-text,
.text-muted,
code {
  overflow-wrap: anywhere;
}

.form-control,
.form-select,
textarea,
.input-group,
.input-group-text {
  max-width: 100%;
}

textarea {
  resize: vertical;
}

.modal-dialog {
  max-width: min(var(--bs-modal-width, 500px), calc(100vw - 1rem));
}

.modal-content {
  max-height: calc(100dvh - 1rem);
  overflow: hidden;
}

.modal-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-header,
.modal-footer {
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* O construtor por IA pode gerar conteúdo longo. O rodapé separado mantém as
   ações acessíveis enquanto somente o resultado central rola no celular. */
.rule-ai-hint-actions {
  flex-shrink: 0;
  background: var(--bg-card, #fff);
  border-top: 1px solid var(--border-color, #dfe7e2);
}

@media (max-width: 575.98px) {
  #aiHintModal .modal-dialog,
  #aiHintModal .modal-content {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  #aiHintModal .modal-body {
    min-height: 0;
    overflow-y: auto;
    padding: 0.9rem;
  }

  #aiHintModal .rule-ai-hint-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0.65rem;
    padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
  }

  #aiHintModal .rule-ai-hint-actions .btn {
    width: 100%;
    min-height: 44px;
    margin: 0;
  }

  #aiHintModal #ai-hint-apply {
    grid-column: 1 / -1;
  }
}

.table td,
.table th {
  vertical-align: middle;
}

.table-responsive .table {
  margin-bottom: 0;
}

.stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.stat-card-kpi,
.stat-card,
.admin-health-card,
.rule-card,
.live-game-card {
  min-width: 0;
}

.builder-shell,
.rule-editor,
.rule-form,
.condition-group,
.condition-row,
.league-wrap {
  max-width: 100%;
  min-width: 0;
}

.condition-group > .d-flex,
.condition-row > .row,
.card-header.d-flex,
.top-rule-head,
.rule-card-top,
.rule-main,
.rule-card-actions,
.live-score-row {
  min-width: 0;
}

.league-options,
.league-wrap .d-flex,
.condition-group > .d-flex,
.card-header.d-flex,
.rule-card-actions,
.modal-body .d-flex,
.settings-step,
.top-rule-head {
  flex-wrap: wrap;
}

.live-filter-bar,
.history-filters-form {
  width: 100%;
}

.live-league-modal-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}

.live-league-chip,
.live-league-picker-btn,
.live-fav-toggle {
  max-width: 100%;
}

.live-game-card .table-responsive {
  overflow-x: auto;
}

.pagination {
  flex-wrap: wrap;
}

@media (max-width: 1040px) {
  .ghx-hero-grid,
  .ghx-dashboard-wrap,
  .ghx-split,
  .ghx-telegram {
    gap: 24px;
  }

  .rules-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .ghx-landing {
    overflow-x: clip;
  }

  .ghx-nav {
    min-height: 58px;
  }

  .ghx-brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .ghx-hero {
    padding-top: 104px;
  }

  .ghx-hero-copy {
    padding-top: 188px;
  }

  .ghx-hero h1 {
    font-size: clamp(2rem, 9vw, 2.55rem);
    line-height: 1.08;
  }

  .ghx-hero-copy > p,
  .ghx-section-head p,
  .ghx-dashboard-copy p,
  .ghx-tech-copy p,
  .ghx-telegram-copy p,
  .ghx-final-cta p {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .ghx-section-head h2,
  .ghx-dashboard-copy h2,
  .ghx-tech-copy h2,
  .ghx-telegram-copy h2,
  .ghx-final-cta h2 {
    font-size: clamp(1.72rem, 8vw, 2.45rem);
    line-height: 1.08;
  }

  .ghx-primary-btn,
  .ghx-secondary-btn,
  .ghx-price-card a {
    width: 100%;
    min-height: 46px;
  }

  .ghx-hero-actions {
    width: 100%;
  }

  .ghx-hero-actions > * {
    max-width: 100%;
  }

  .ghx-trust-row span,
  .ghx-logo-strip span {
    white-space: nowrap;
  }

  .page-actions .btn-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
    margin-right: 0 !important;
  }

  .page-actions .btn-group .btn,
  .page-actions > .btn,
  .page-actions > form,
  .page-actions > form .btn {
    width: 100%;
  }

  .live-filter-bar {
    grid-template-columns: 1fr;
  }

  .live-filter-bar > * {
    width: 100%;
  }

  .live-fav-toggle,
  .live-league-picker-btn {
    justify-content: center;
  }

  .rule-card-top,
  .rule-main,
  .rule-card-actions {
    width: 100%;
  }

  .rule-card-top {
    flex-direction: column;
  }

  .rule-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .rule-card-actions .btn,
  .rule-card-actions form {
    width: 100%;
  }

  .rule-card-actions form .btn {
    width: 100%;
  }

  .weekly-chart {
    min-width: 0;
    gap: 0.45rem;
    height: 180px;
  }

  .card-body > .d-flex.justify-content-between,
  .admin-monitor-head {
    flex-wrap: wrap;
    align-items: flex-start !important;
  }

  .admin-monitor-head > *,
  .card-body > .d-flex.justify-content-between > * {
    min-width: 0;
  }

  .condition-group > .d-flex,
  .card-header.d-flex {
    align-items: flex-start !important;
    gap: 0.65rem;
  }

  .condition-group > .d-flex > .btn,
  .card-header.d-flex > .btn {
    width: 100%;
  }

  .condition-row .row > [class*="col-"] {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
    text-align: left !important;
  }

  .condition-row .remove-condition {
    width: 100%;
  }

  .league-wrap .d-flex > .btn,
  .modal-body .d-flex > .btn {
    flex: 1 1 160px;
  }

  .table:not(.history-table) thead {
    display: none;
  }

  .table:not(.history-table) tbody tr {
    display: block;
    border: 1px solid var(--gh-border, var(--border-color));
    border-radius: 10px;
    margin-bottom: 0.65rem;
    padding: 0.45rem;
    background: var(--gh-surface, var(--bg-card));
  }

  .table:not(.history-table) tbody td {
    display: block;
    width: 100%;
    border-bottom: 0;
    padding: 0.42rem 0.55rem;
    text-align: left !important;
  }

  .table:not(.history-table) tbody td .d-flex {
    flex-wrap: wrap;
  }

  .modal-dialog {
    margin: 0.5rem auto;
  }

  .modal-footer > * {
    flex: 1 1 160px;
  }
}

@media (max-width: 560px) {
  .content {
    padding-inline: 0.7rem;
  }

  .topbar-right {
    align-items: stretch !important;
  }

  .btn-theme-toggle {
    min-width: 0;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
  }

  .ghx-nav {
    width: calc(100vw - 14px);
    padding: 9px 10px;
  }

  .ghx-landing,
  .ghx-hero {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .ghx-hero-grid,
  .ghx-section,
  .ghx-final-cta {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .ghx-hero .ghx-hero-grid {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
    padding-inline: 16px !important;
  }

  .ghx-hero-copy {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
  }

  .ghx-hero-actions {
    width: min(calc(100vw - 32px), 330px) !important;
    max-width: min(calc(100vw - 32px), 330px) !important;
  }

  .ghx-hero-copy > p {
    width: min(100%, 330px) !important;
    max-width: min(100%, 330px) !important;
  }

  .ghx-brand {
    max-width: calc(100% - 78px);
  }

  .ghx-brand strong {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ghx-nav .ghx-link-btn {
    min-height: 34px;
    padding-inline: 10px;
    font-size: 0.84rem;
  }

  .ghx-hero {
    background:
      linear-gradient(180deg, rgba(18, 20, 20, 0.45), #121414 70%),
      var(--ghx-hero-image) center 68px / 620px auto no-repeat;
  }

  .ghx-hero-copy {
    padding-top: 170px;
  }

  .ghx-kicker,
  .ghx-eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }

  .ghx-hero h1 {
    font-size: clamp(1.9rem, 8.6vw, 2.25rem);
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .ghx-glass-card,
  .ghx-price-card,
  .ghx-faq-item,
  .ghx-dashboard,
  .ghx-neural-card,
  .ghx-phone,
  .ghx-final-cta {
    border-radius: 16px;
    padding: 18px;
  }

  .rule-card-actions {
    grid-template-columns: 1fr;
  }

  .weekly-chart {
    height: 160px;
  }

  .history-pagination-buttons,
  .history-pagination-wrap,
  .pagination {
    width: 100%;
    justify-content: center;
  }

  .modal-content {
    border-radius: 12px;
  }
}
.matchday-page {
  display: grid;
  gap: 1.25rem;
}

.matchday-hero,
.matchday-filters,
.matchday-meta,
.matchday-card-head,
.matchday-teams {
  display: flex;
  align-items: center;
}

.matchday-hero {
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: var(--radius);
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.matchday-hero h1 {
  margin: .2rem 0 .4rem;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
}

.matchday-hero-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.matchday-page-alert {
  display: grid;
  width: min(360px, 30vw);
  min-width: 250px;
  grid-template-columns: 30px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: .6rem;
  padding: .65rem .7rem;
  border-radius: 999px;
  color: #fff;
  backdrop-filter: blur(12px);
  animation: matchday-popup-in .2s ease-out;
}

@keyframes matchday-popup-in {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.matchday-page-alert.is-error {
  border: 1px solid rgba(255, 79, 92, .68);
  background: rgba(91, 20, 29, .92);
  box-shadow: 0 8px 24px rgba(70, 8, 16, .22);
}

.matchday-page-alert.is-loading {
  position: fixed;
  z-index: 1085;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  width: min(620px, calc(100vw - 28px));
  min-width: 0;
  max-width: calc(100vw - 28px);
  border: 1px solid rgba(71, 155, 255, .72);
  border-radius: 18px;
  background: rgba(19, 62, 112, .94);
  box-shadow: 0 8px 24px rgba(8, 42, 83, .24);
  transform: translateX(-50%);
  animation: matchday-loading-toast-in .22s ease-out;
}

.matchday-page-alert.is-centered {
  position: fixed;
  z-index: 1085;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  width: min(620px, calc(100vw - 28px));
  min-width: 0;
  max-width: calc(100vw - 28px);
  border-radius: 18px;
  transform: translateX(-50%);
  animation: matchday-loading-toast-in .22s ease-out;
}

.matchday-page-alert.is-centered > div { display: grid; gap: .1rem; }
.matchday-page-alert.is-centered small::before { display: none; content: ""; }

@keyframes matchday-loading-toast-in {
  from { opacity: 0; transform: translate(-50%, -10px) scale(.98); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.matchday-page-alert.is-success {
  width: min(480px, 42vw);
  min-width: 360px;
  border: 1px solid rgba(43, 216, 135, .75);
  background: rgba(10, 91, 59, .95);
  box-shadow: 0 10px 30px rgba(4, 61, 38, .3);
}

.matchday-page-alert.is-success > div {
  display: flex;
  align-items: baseline;
  gap: .35rem;
}

.matchday-page-alert.is-loading > div {
  display: grid;
  gap: .1rem;
}

.matchday-page-alert.is-success small::before {
  margin-right: .35rem;
  content: "—";
}

.matchday-page-alert[hidden] { display: none !important; }

.matchday-page-alert-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-family: "DM Mono", monospace;
  font-size: .8rem;
  font-weight: 900;
}

.matchday-page-alert.is-error .matchday-page-alert-icon { border: 1px solid rgba(255, 105, 115, .8); background: rgba(220, 53, 69, .72); }
.matchday-page-alert.is-success .matchday-page-alert-icon { border: 1px solid rgba(106, 238, 173, .88); background: rgba(23, 170, 97, .82); }
.matchday-page-alert.is-loading .matchday-page-alert-icon { border: 1px solid rgba(116, 184, 255, .85); background: rgba(33, 123, 224, .78); }
.matchday-page-alert.is-loading .matchday-page-alert-icon .spinner-border { width: 14px; height: 14px; border-width: 2px; }

.matchday-page-alert > div { display: grid; min-width: 0; gap: .08rem; }
.matchday-page-alert strong { overflow-wrap: anywhere; font-size: .78rem; line-height: 1.25; }
.matchday-page-alert small { color: rgba(255, 255, 255, .82); font-size: .67rem; line-height: 1.3; }
.matchday-page-alert > button {
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: rgba(255, 255, 255, .82);
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.matchday-page-alert > button:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.matchday-page-alert > .matchday-generator-cancel {
  width: auto;
  min-width: 62px;
  padding: .32rem .58rem;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 999px;
  font-size: .67rem;
  font-weight: 850;
}
.matchday-page-alert > .matchday-generator-cancel[hidden] { display: none; }

.matchday-help {
  position: relative;
}

.matchday-help-trigger {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  cursor: help;
  font-family: Georgia, serif;
  font-size: 1rem;
  font-weight: 800;
}

.matchday-help-trigger:hover,
.matchday-help-trigger:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.matchday-help-popover {
  position: absolute;
  z-index: 50;
  top: calc(100% + .55rem);
  right: 0;
  width: min(390px, calc(100vw - 36px));
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
  pointer-events: none;
}

.matchday-help:hover .matchday-help-popover,
.matchday-help:focus-within .matchday-help-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.matchday-help-popover > strong {
  display: block;
  margin-bottom: .65rem;
  color: var(--text-main);
}

.matchday-help-popover dl {
  display: grid;
  gap: .42rem;
  margin: 0 0 .7rem;
}

.matchday-help-popover dl > div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: .55rem;
}

.matchday-help-popover dt {
  color: var(--primary);
  font-size: .76rem;
  font-weight: 800;
}

.matchday-help-popover dd,
.matchday-help-popover small {
  margin: 0;
  color: var(--text-muted);
  font-size: .75rem;
  line-height: 1.35;
}

.matchday-hero p,
.matchday-meta,
.matchday-card small,
.matchday-caution {
  color: var(--text-muted, #66736c);
}

.matchday-market-title {
  margin: 1rem 0 .45rem;
  color: var(--text-muted, #66736c);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.matchday-unavailable {
  padding: .65rem .75rem;
  border: 1px dashed var(--border-color, #dfe7e2);
  border-radius: 9px;
  color: var(--text-muted, #66736c);
  font-size: .8rem;
}

.matchday-filters {
  gap: .75rem;
  flex-wrap: wrap;
}

.matchday-filters input[type="date"] {
  max-width: 190px;
}

.matchday-trend-filter {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(170px, 1fr) minmax(145px, .8fr) minmax(118px, .65fr) 96px 96px auto auto;
  align-items: end;
  column-gap: 1rem;
  row-gap: .8rem;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid rgba(31, 166, 98, .25);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(31, 166, 98, .1), rgba(31, 166, 98, .025) 38%, var(--bg-card) 75%);
  box-shadow: var(--shadow-sm);
}

.matchday-trend-filter::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--primary, #1fa662);
  content: "";
}

.matchday-trend-filter.is-active {
  border-color: rgba(31, 166, 98, .48);
  box-shadow: 0 8px 24px rgba(19, 112, 67, .09);
}

.matchday-trend-filter-title {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.matchday-trend-filter-title > div {
  display: grid;
  gap: .12rem;
}

.matchday-trend-filter-title strong {
  color: var(--text-main);
  font-family: "Syne", sans-serif;
  font-size: .9rem;
}

.matchday-trend-icon {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--primary, #1fa662);
  font-family: "DM Mono", monospace;
  font-size: .9rem;
  font-weight: 800;
}

.matchday-trend-filter-title small,
.matchday-trend-result {
  color: var(--text-muted, #66736c);
  font-size: .7rem;
}
.matchday-trend-progress { display: flex; margin: .15rem 0 1rem; padding: .8rem 1rem; align-items: center; gap: .7rem; border: 1px solid rgba(31,166,98,.22); border-radius: 11px; color: var(--primary); background: rgba(31,166,98,.065); }
.matchday-trend-progress[hidden] { display: none; }
.matchday-trend-progress > div { display: grid; gap: .08rem; }
.matchday-trend-progress strong { color: var(--text-main); font-size: .78rem; }
.matchday-trend-progress small { color: var(--text-muted); font-size: .68rem; }
.matchday-trend-progress .spinner-border { flex: 0 0 auto; }
.theme-dark .matchday-trend-progress { border-color: rgba(0,229,160,.22); background: rgba(0,229,160,.07); }

.matchday-loading-button .matchday-button-loading {
  align-items: center;
  justify-content: center;
  gap: .45rem;
}

.matchday-loading-button .matchday-button-loading:not([hidden]) {
  display: inline-flex;
}

.matchday-loading-button[data-loading="true"],
.matchday-loading-button:disabled {
  pointer-events: none;
  cursor: wait;
  opacity: .82;
}

.matchday-loading-button .spinner-border {
  width: .85rem;
  height: .85rem;
  border-width: .13em;
}

.matchday-mini-table tr.is-ticket-option {
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}

.matchday-mini-table tr.is-ticket-option:hover td {
  background: rgba(31, 166, 98, .11);
}

.matchday-mini-table tr.is-ticket-option td:first-child::after {
  margin-left: .35rem;
  color: var(--primary, #168451);
  content: "+";
  font-weight: 900;
}

.matchday-mini-table td.is-ticket-cell {
  position: relative;
  color: var(--primary, #168451);
  font-weight: 800;
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}

.matchday-mini-table td.is-ticket-cell:hover {
  background: rgba(31, 166, 98, .14);
  box-shadow: inset 0 0 0 1px rgba(31, 166, 98, .25);
}

.matchday-mini-table td.is-ticket-cell::after {
  margin-left: .2rem;
  content: "+";
  font-size: .65rem;
  font-weight: 900;
}

.matchday-bet-ticket {
  position: fixed;
  z-index: 1090;
  right: 18px;
  bottom: 18px;
  width: min(340px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 24px));
  overflow: hidden;
  border: 1px solid rgba(31, 166, 98, .35);
  border-radius: 16px;
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow: 0 18px 48px rgba(14, 55, 36, .22);
}

.matchday-bet-ticket[hidden],
.matchday-bet-ticket-launcher[hidden] { display: none; }

.matchday-ticket-head {
  display: flex;
  padding: .85rem 1rem;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(135deg, #168451, #24ad69);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.matchday-ticket-head:active { cursor: grabbing; }

.matchday-ticket-head > div {
  display: grid;
  gap: .08rem;
}

.matchday-ticket-head span {
  font-family: "Syne", sans-serif;
  font-size: .95rem;
  font-weight: 800;
}

.matchday-ticket-head small { color: rgba(255, 255, 255, .8); font-size: .67rem; }

.matchday-ticket-head button,
.matchday-ticket-selection > button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: rgba(255, 255, 255, .14);
  font-size: 1.1rem;
  cursor: pointer;
}

.matchday-ticket-body {
  display: grid;
  max-height: 365px;
  padding: .7rem;
  overflow-y: auto;
  gap: .55rem;
}

.matchday-ticket-item {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(31, 166, 98, .32);
  border-left: 4px solid var(--primary, #168451);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(31, 166, 98, .07), rgba(31, 166, 98, .018));
  box-shadow: 0 2px 8px rgba(14, 52, 32, .07);
}

.matchday-ticket-item:nth-child(4n + 2) { border-color: rgba(38, 112, 214, .3); border-left-color: #2670d6; background: linear-gradient(135deg, rgba(38, 112, 214, .065), rgba(38, 112, 214, .015)); }
.matchday-ticket-item:nth-child(4n + 3) { border-color: rgba(216, 139, 24, .34); border-left-color: #d88b18; background: linear-gradient(135deg, rgba(216, 139, 24, .07), rgba(216, 139, 24, .015)); }
.matchday-ticket-item:nth-child(4n + 4) { border-color: rgba(126, 78, 190, .3); border-left-color: #7e4ebe; background: linear-gradient(135deg, rgba(126, 78, 190, .065), rgba(126, 78, 190, .015)); }

.matchday-ticket-item > header {
  display: flex;
  padding: .7rem .75rem;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  border-bottom: 1px solid var(--border-color, #dfe7e2);
}
.matchday-ticket-item > header > div { display: grid; min-width: 0; gap: .25rem; }
.matchday-ticket-item > header > button { flex: 0 0 auto; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 7px; color: #b42318; background: rgba(239,68,68,.08); font-size: 1rem; cursor: pointer; }
.matchday-ticket-game-actions { display: flex; flex: 0 0 auto; align-items: center; gap: .3rem; }
.matchday-ticket-game-actions button { display: grid; width: 25px; height: 25px; padding: 0; place-items: center; border: 0; border-radius: 7px; cursor: pointer; }
.matchday-ticket-game-actions [data-ticket-go-game] { color: #1976d2; background: rgba(25,118,210,.1); font-size: 1rem; font-weight: 850; }
.matchday-ticket-game-actions [data-ticket-replace-game] { color: var(--primary); background: rgba(31,166,98,.1); font-size: 1rem; font-weight: 850; }
.matchday-ticket-game-actions [data-ticket-remove-game] { color: #b42318; background: rgba(239,68,68,.08); font-size: 1rem; }

.matchday-ticket-selections {
  display: grid;
}

.matchday-ticket-selection {
  position: relative;
  display: grid;
  padding: .55rem 2.35rem .55rem .75rem;
  gap: .12rem;
}

.matchday-ticket-selection + .matchday-ticket-selection {
  border-top: 1px dashed var(--border-color, #dfe7e2);
}

.matchday-ticket-selection > button {
  position: absolute;
  top: 50%;
  right: .5rem;
  width: 23px;
  height: 23px;
  transform: translateY(-50%);
  color: var(--text-muted, #66736c);
  background: transparent;
  font-size: .95rem;
}

.matchday-ticket-selection > button:hover { color: #b42318; background: rgba(239, 68, 68, .1); }
.matchday-ticket-item small { color: var(--text-muted, #66736c); font-size: .63rem; }
.matchday-ticket-item strong { font-size: .78rem; }
.matchday-ticket-item strong em { color: var(--text-muted, #66736c); font-size: .62rem; font-style: normal; text-transform: uppercase; }
.matchday-ticket-selection > div { display: flex; align-items: center; justify-content: space-between; color: var(--primary, #168451); font-size: .75rem; font-weight: 800; }
.matchday-ticket-selection > div b { font-family: "DM Mono", monospace; font-size: .9rem; }
.matchday-ticket-selection .matchday-ticket-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: .08rem 0;
  color: var(--text-muted, #66736c);
  font-size: .64rem;
}
.matchday-ticket-selection .matchday-ticket-secondary b {
  color: var(--text-color, #23342b);
  font-family: "DM Mono", monospace;
  font-size: .68rem;
}
.matchday-ticket-line { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .12rem 0; color: var(--text-muted, #66736c); font-size: .62rem; }
.matchday-ticket-line select { width: 112px; max-width: 54%; min-height: 27px; padding: .15rem 1.45rem .15rem .45rem; border: 1px solid var(--border-color, #dfe7e2); border-radius: 6px; color: var(--text-main, #17231d); background-color: var(--bg-card, #fff); font-size: .66rem; font-weight: 800; line-height: 1.25; text-overflow: clip; }
.matchday-compare-table td.is-ticket-cell { cursor: pointer; transition: background-color .16s ease, box-shadow .16s ease, color .16s ease; }
.matchday-compare-table [data-history] {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.matchday-compare-table td.is-ticket-cell:hover { background: rgba(31, 166, 98, .09); }
.matchday-compare-table td.is-ticket-cell.is-line-only { color: var(--primary, #168451); text-decoration: underline dotted; text-underline-offset: 3px; }
.matchday-compare-table td.is-ticket-cell.is-ticket-selected {
  color: var(--primary, #168451);
  background: rgba(31, 166, 98, .14);
  box-shadow: inset 0 0 0 1px rgba(31, 166, 98, .42);
  font-weight: 900;
}
.matchday-history-popover {
  position: fixed;
  z-index: 1090;
  width: min(230px, calc(100vw - 16px));
  padding: .65rem;
  border: 1px solid rgba(31, 166, 98, .3);
  border-radius: 11px;
  color: var(--text-main, #17231d);
  background: var(--bg-card, #fff);
  box-shadow: 0 12px 32px rgba(20, 48, 34, .18);
  pointer-events: none;
}
.matchday-history-popover > strong { display: block; color: var(--primary, #168451); font-size: .76rem; }
.matchday-history-popover > small { display: block; margin: .12rem 0 .45rem; color: var(--text-muted, #66736c); font-size: .61rem; }
.matchday-history-popover > div { display: grid; gap: .25rem; }
.matchday-history-popover span { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem; padding: .3rem .4rem; border-radius: 6px; background: rgba(31, 166, 98, .07); }
.matchday-history-popover i { overflow: hidden; color: var(--text-muted, #66736c); font-size: .58rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.matchday-history-popover i small { display: block; overflow: hidden; margin-top: .08rem; color: var(--text-main, #17231d); font-size: .55rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.matchday-history-popover b { font-family: "DM Mono", monospace; font-size: .69rem; }
.matchday-history-popover em { grid-column: 1 / -1; color: var(--text-muted, #66736c); font-size: .65rem; font-style: normal; }
.theme-dark .matchday-history-popover {
  border-color: rgba(0, 229, 160, .32);
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .48);
}
.theme-dark .matchday-history-popover span { background: rgba(0, 229, 160, .09); }

.matchday-ticket-empty {
  padding: 1.25rem .8rem;
  color: var(--text-muted, #66736c);
  font-size: .75rem;
  text-align: center;
}

.matchday-ticket-undo {
  position: fixed;
  z-index: 1450;
  right: 1rem;
  bottom: 1rem;
  width: min(370px, calc(100vw - 2rem));
  display: flex;
  min-height: 58px;
  padding: .7rem .75rem;
  align-items: center;
  gap: .65rem;
  border: 1px solid rgba(31, 166, 98, .34);
  border-radius: 16px;
  color: var(--text-main, #17231d);
  background: color-mix(in srgb, var(--bg-card, #fff) 94%, var(--primary, #168451) 6%);
  box-shadow: 0 10px 28px rgba(8, 35, 23, .2);
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .18s ease, transform .18s ease;
}

.matchday-ticket-undo[hidden] { display: none; }
.matchday-ticket-undo.is-visible { opacity: 1; transform: translateY(0); }
.matchday-ticket-undo.is-fading { opacity: 0; transition-duration: .6s; }
.matchday-ticket-undo > i { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #fff; background: var(--primary, #168451); font-size: .75rem; font-style: normal; font-weight: 900; }
.matchday-ticket-undo > span { display: grid; flex: 1; min-width: 0; gap: .08rem; }
.matchday-ticket-undo span b { font-size: .75rem; font-weight: 900; line-height: 1.2; }
.matchday-ticket-undo span small { color: var(--text-muted, #66736c); font-size: .66rem; font-weight: 650; line-height: 1.25; }
.matchday-ticket-undo button { flex: 0 0 auto; padding: .38rem .58rem; border: 1px solid rgba(31,166,98,.24); border-radius: 9px; color: var(--primary, #168451); background: rgba(31, 166, 98, .12); font-size: .7rem; font-weight: 900; cursor: pointer; }
.matchday-ticket-undo button:hover { background: rgba(31, 166, 98, .2); }
.theme-dark .matchday-ticket-undo { border-color: rgba(0, 229, 160, .3); background: rgba(13, 29, 24, .96); box-shadow: 0 12px 30px rgba(0, 0, 0, .4); }
.theme-dark .matchday-ticket-undo span small { color: rgba(226,242,234,.7); }

@media (max-width: 575.98px) {
  .matchday-ticket-undo { right: .65rem; bottom: .65rem; width: calc(100vw - 1.3rem); border-radius: 14px; }
}

.matchday-bet-ticket footer { display: grid; grid-template-columns: 1.35fr 1fr; padding: .65rem .75rem; gap: .45rem; border-top: 1px solid var(--border-color, #dfe7e2); }
.matchday-ticket-save { padding: .48rem; border: 0; border-radius: 8px; color: #fff; background: var(--primary, #168451); font-size: .72rem; font-weight: 850; cursor: pointer; }
.matchday-ticket-clear { width: 100%; padding: .45rem; border: 1px solid rgba(180, 35, 24, .22); border-radius: 8px; color: #b42318; background: transparent; font-size: .72rem; font-weight: 800; cursor: pointer; }
.matchday-ticket-clear:hover { background: rgba(239, 68, 68, .07); }
.ticket-save-backdrop { position: fixed; z-index: 1200; inset: 0; display: grid; padding: 1rem; place-items: center; background: rgba(7,18,13,.58); backdrop-filter: blur(3px); }
.ticket-save-backdrop[hidden] { display: none; }
.ticket-save-modal { display: grid; width: min(390px, 100%); padding: 1rem; gap: .8rem; border: 1px solid var(--border-color); border-radius: 16px; color: var(--text-main); background: var(--bg-card); box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.ticket-save-modal header { display: flex; align-items: flex-start; justify-content: space-between; }
.ticket-save-modal header > div { display: grid; gap: .12rem; }
.ticket-save-modal header strong { font-family: "Syne", sans-serif; }
.ticket-save-modal header small { color: var(--text-muted); font-size: .72rem; }
.ticket-save-modal header button { width: 28px; height: 28px; border: 0; border-radius: 8px; color: var(--text-muted); background: rgba(127,127,127,.1); font-size: 1.1rem; }
.ticket-save-modal label { display: grid; gap: .3rem; color: var(--text-muted); font-size: .72rem; font-weight: 750; }
.ticket-save-modal input { width: 100%; padding: .65rem .7rem; border: 1px solid var(--border-color); border-radius: 9px; color: var(--text-main); background: var(--bg-card); }
.ticket-save-modal p { margin: 0; color: #b42318; font-size: .72rem; }
.saved-ticket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); align-items: start; gap: 1rem; }
.saved-ticket-card { display: flex; min-width: 0; min-height: 310px; overflow: hidden; flex-direction: column; border: 1px solid var(--border-color); border-radius: 14px; background: var(--bg-card); box-shadow: var(--card-shadow); }
.saved-ticket-card > header { display: flex; min-height: 68px; padding: .9rem 1rem; align-items: center; justify-content: space-between; gap: .75rem; border-bottom: 1px solid var(--border-color); }
.saved-ticket-card > header > div:first-child { display: grid; min-width: 0; gap: .16rem; }
.saved-ticket-card > header strong { color: var(--text-main); font-family: "Syne", sans-serif; font-size: .92rem; font-weight: 800; line-height: 1.15; letter-spacing: -.015em; }
.saved-ticket-card > header small { color: var(--text-muted); font-family: "DM Mono", monospace; font-size: .63rem; line-height: 1.25; }
.saved-ticket-actions { display: flex; align-items: center; gap: .5rem; }
.saved-ticket-actions > a { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--border-color); border-radius: 8px; color: var(--primary); background: var(--bg-card); }
.saved-ticket-actions svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.saved-ticket-card .status-badge { display: inline-flex; min-width: 58px; padding: .28rem .48rem; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 999px; font-size: .58rem; font-weight: 900; line-height: 1; letter-spacing: .045em; }
.saved-ticket-card .status-green { border-color: rgba(22,163,74,.25); color: #15803d; background: rgba(22,163,74,.11); }
.saved-ticket-card .status-red { border-color: rgba(220,38,38,.25); color: #dc2626; background: rgba(220,38,38,.1); }
.saved-ticket-card .status-pending { border-color: rgba(217,155,0,.3); color: #a66f00; background: rgba(245,180,0,.14); }
.saved-ticket-card .ticket-result.status-green { color: #15803d; }
.saved-ticket-card .ticket-result.status-red { color: #dc2626; }
.saved-ticket-card .ticket-result.status-pending { color: #b77900; }
.saved-ticket-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: .75rem; gap: .42rem; background: rgba(31,166,98,.04); }
.saved-ticket-money span { display: grid; min-width: 0; padding: .52rem .55rem; gap: .12rem; border: 1px solid rgba(31,166,98,.1); border-radius: 8px; color: var(--text-muted); background: var(--bg-card); font-size: .58rem; font-weight: 800; line-height: 1.2; letter-spacing: .055em; text-transform: uppercase; }
.saved-ticket-money b { overflow: hidden; color: var(--text-main); font-family: "DM Mono", monospace; font-size: .78rem; font-weight: 700; line-height: 1.35; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.saved-ticket-legs { display: grid; padding: .65rem; align-content: start; flex: 1; gap: .55rem; }
.saved-ticket-game { overflow: hidden; border: 1px solid var(--border-color); border-radius: 10px; background: rgba(31,166,98,.025); }
.saved-ticket-game > header { display: grid; padding: .62rem .7rem; gap: .1rem; border-bottom: 1px solid var(--border-color); }
.saved-ticket-game > header small { color: var(--text-muted); font-size: .58rem; font-weight: 650; }
.saved-ticket-game > header b { overflow: hidden; color: var(--text-main); font-size: .75rem; font-weight: 850; line-height: 1.3; text-overflow: ellipsis; }
.saved-ticket-game > header b em { color: var(--text-muted); font-size: .58rem; font-style: normal; text-transform: uppercase; }
.saved-ticket-game-markets { display: grid; }
.saved-ticket-game-markets > div { display: flex; padding: .58rem .7rem; align-items: flex-start; justify-content: space-between; gap: .65rem; }
.saved-ticket-game-markets > div + div { border-top: 1px dashed var(--border-color); }
.saved-ticket-legs small { display: block; color: var(--primary); font-size: .69rem; font-weight: 750; line-height: 1.3; }
.saved-ticket-legs small em { display: block; margin-top: .12rem; color: var(--text-muted); font-size: .59rem; font-style: normal; font-weight: 650; }
.saved-ticket-legs .status-badge { flex: 0 0 auto; margin-top: .05rem; font-size: .56rem; letter-spacing: .045em; }
.theme-dark .saved-ticket-money span { border-color: rgba(0,229,160,.13); background: rgba(255,255,255,.025); }
.theme-dark .saved-ticket-game { background: rgba(0,229,160,.035); }
.theme-dark .saved-ticket-card .status-green, .theme-dark .saved-ticket-card .ticket-result.status-green { color: #4ade80; }
.theme-dark .saved-ticket-card .status-red, .theme-dark .saved-ticket-card .ticket-result.status-red { color: #fb7185; }
.theme-dark .saved-ticket-card .status-pending, .theme-dark .saved-ticket-card .ticket-result.status-pending { color: #facc15; }
.ticket-edit-heading a { display: inline-block; margin-bottom: .35rem; color: var(--primary); font-size: .76rem; font-weight: 800; text-decoration: none; }
.ticket-edit-form { display: grid; max-width: 820px; gap: .85rem; }
.ticket-edit-money { display: grid; grid-template-columns: 1fr 1fr; padding: 1rem; gap: .75rem; border: 1px solid var(--border-color); border-radius: 14px; background: var(--bg-card); }
.ticket-edit-form label { display: grid; gap: .3rem; color: var(--text-muted); font-size: .72rem; font-weight: 800; }
.ticket-edit-form input[type="text"], .ticket-edit-form input:not([type]), .ticket-edit-form select { min-width: 0; width: 100%; padding: .6rem 2rem .6rem .7rem; border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-main); background-color: var(--bg-card); }
.ticket-edit-legs { display: grid; gap: .55rem; }
.ticket-edit-legs article { display: grid; grid-template-columns: minmax(0,1fr) 130px auto; padding: .85rem 1rem; align-items: center; gap: .8rem; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-card); }
.ticket-edit-legs article > div { display: grid; min-width: 0; gap: .08rem; }
.ticket-edit-legs small { color: var(--text-muted); font-size: .65rem; }
.ticket-edit-legs strong { font-size: .82rem; }
.ticket-edit-legs strong em { color: var(--text-muted); font-size: .64rem; font-style: normal; }
.ticket-edit-legs article > div > span { color: var(--primary); font-size: .76rem; font-weight: 800; }
.ticket-edit-remove { display: flex !important; align-items: center; gap: .4rem !important; color: #b42318 !important; cursor: pointer; }
.ticket-edit-remove input { width: 17px; height: 17px; accent-color: #b42318; }
.ticket-edit-footer { display: flex; justify-content: flex-end; gap: .55rem; }
@media (max-width: 575.98px) { .saved-ticket-grid { grid-template-columns: 1fr; gap: .75rem; } .saved-ticket-card { min-height: 0; } .saved-ticket-money { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-inline: .65rem; gap: .32rem; } .saved-ticket-money span { padding-inline: .42rem; } .saved-ticket-money b { font-size: .72rem; } .saved-ticket-card > header { padding-inline: .75rem; } .saved-ticket-game > header b { white-space: normal; } .ticket-save-modal { align-self: end; border-radius: 18px 18px 0 0; } }
@media (max-width: 575.98px) { .ticket-edit-money { grid-template-columns: 1fr; } .ticket-edit-legs article { grid-template-columns: 1fr; } .ticket-edit-footer { position: sticky; bottom: .5rem; padding: .6rem; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-card); } .ticket-edit-footer .btn { flex: 1; } }

.matchday-bet-ticket-launcher {
  position: fixed;
  z-index: 1089;
  right: 18px;
  bottom: 18px;
  padding: .65rem .85rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--primary, #168451);
  box-shadow: 0 10px 28px rgba(14, 55, 36, .22);
  font-size: .75rem;
  font-weight: 800;
  cursor: pointer;
}

.matchday-bet-ticket-launcher span {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: .3rem;
  padding: 0 .3rem;
  place-items: center;
  border-radius: 999px;
  color: var(--primary, #168451);
  background: #fff;
}

.matchday-trend-filter > label {
  display: grid;
  min-width: 0;
  min-width: 145px;
  gap: .25rem;
  color: var(--text-muted, #66736c);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.matchday-trend-filter .form-select,
.matchday-trend-filter .form-control {
  border-color: rgba(31, 166, 98, .2);
  color: var(--text-main);
  background-color: var(--bg-card);
}

.matchday-trend-filter .form-select:focus,
.matchday-trend-filter .form-control:focus {
  border-color: var(--primary, #1fa662);
  box-shadow: 0 0 0 3px rgba(31, 166, 98, .1);
}

.matchday-trend-filter .matchday-percent-field {
  position: relative;
  min-width: 96px;
  max-width: none;
}

.matchday-trend-samples {
  padding-right: .25rem;
}

.matchday-percent-field input {
  padding-right: 1.5rem;
}

.matchday-percent-field b {
  position: absolute;
  right: .55rem;
  bottom: .55rem;
  color: var(--text-muted, #66736c);
  font-size: .75rem;
}

.matchday-trend-result {
  grid-column: 1 / -1;
  min-height: 18px;
  padding-left: 46px;
  color: var(--primary, #168451);
  font-weight: 700;
}

@media (max-width: 1180px) {
  .matchday-trend-filter { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .matchday-trend-filter-title { grid-column: 1 / -1; }
}

.matchday-select-field {
  display: grid;
  min-width: 220px;
  max-width: 310px;
  flex: 1 1 240px;
  gap: .25rem;
}

.matchday-select-field > span {
  padding-left: .15rem;
  color: var(--text-muted, #66736c);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.matchday-select-field .form-select,
.matchday-search-select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matchday-search-select {
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, #738079 50%), linear-gradient(135deg, #738079 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.matchday-date-field {
  min-width: 180px;
  max-width: 190px;
  flex: 0 0 190px;
}

.matchday-live-toggle {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: .5rem;
  align-self: end;
  padding: .5rem .75rem;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  color: var(--text-main);
  background: var(--bg-card);
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
}

.matchday-generator-modal {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
}

.matchday-generator-modal > form {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
}

.matchday-generator-modal > form > .modal-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.matchday-generator-modal > form > .modal-footer {
  flex: 0 0 auto;
  background: var(--bg-card);
}

.matchday-generator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}

.matchday-generator-grid label > span,
.matchday-generator-markets legend {
  display: block;
  margin-bottom: .35rem;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.matchday-generator-markets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin-top: 1rem;
  padding: 0;
  border: 0;
}

.matchday-generator-markets legend { grid-column: 1 / -1; }
.matchday-generator-markets label { display: flex; align-items: center; gap: .5rem; }
.matchday-generator-early { display: flex; margin-top: .8rem; padding: .7rem .75rem; align-items: center; justify-content: space-between; gap: .8rem; border: 1px solid var(--border-color); border-radius: 11px; background: rgba(31,166,98,.045); }
.matchday-generator-early > div { display: grid; gap: .12rem; }
.matchday-generator-early strong { font-size: .78rem; }
.matchday-generator-early small { color: var(--text-muted); font-size: .66rem; line-height: 1.35; }
.matchday-generator-early label { display: flex; flex: 0 0 auto; align-items: center; gap: .42rem; cursor: pointer; }
.matchday-generator-early input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.matchday-generator-early label > span { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #8b9790; transition: .18s ease; }
.matchday-generator-early label > span::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.22); content: ""; transition: .18s ease; }
.matchday-generator-early input:checked + span { background: var(--primary, #168451); }
.matchday-generator-early input:checked + span::after { transform: translateX(16px); }
.matchday-generator-early input:focus-visible + span { outline: 3px solid rgba(31,166,98,.22); outline-offset: 2px; }
.matchday-generator-early b { min-width: 62px; color: var(--text-muted); font-size: .63rem; }
.matchday-generator-note { margin: 1rem 0 0; color: var(--text-muted); font-size: .78rem; line-height: 1.5; }

.matchday-generator-status {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 1rem;
  padding: .8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.matchday-generator-status > div { display: grid; gap: .12rem; }
.matchday-generator-status strong { font-size: .86rem; }
.matchday-generator-status small { color: var(--text-muted); font-size: .75rem; line-height: 1.4; }
.matchday-generator-status.is-loading { border-color: rgba(31, 166, 98, .35); }
.matchday-generator-status.is-success { border-color: rgba(31, 166, 98, .5); background: rgba(31, 166, 98, .08); }
.matchday-generator-status.is-error { border-color: rgba(220, 53, 69, .45); background: rgba(220, 53, 69, .08); }
.matchday-generator-status.is-info { border-color: rgba(235, 157, 18, .45); background: rgba(235, 157, 18, .08); }
.matchday-generator-status.is-success strong { color: var(--primary); }
.matchday-generator-status.is-error strong { color: #dc3545; }
.matchday-generator-status.is-info strong { color: #d68a00; }

@media (max-width: 560px) {
  #ticketGeneratorModal .modal-dialog,
  #ticketGeneratorModal .matchday-generator-modal {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .matchday-generator-grid { grid-template-columns: 1fr; }
  .matchday-generator-markets { grid-template-columns: 1fr; }
  #ticketGeneratorModal .matchday-generator-modal { position: relative; overflow: hidden; }
  #ticketGeneratorModal .matchday-generator-modal > form > .modal-body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }
  #ticketGeneratorModal .matchday-generator-modal .modal-footer {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(82px, .65fr) minmax(0, 1.35fr);
    padding: .65rem;
    padding-bottom: max(.65rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -8px 24px rgba(9, 31, 20, .12);
  }
  .matchday-generator-modal .modal-footer .btn { width: 100%; }
  .matchday-generator-early { align-items: flex-start; }
  .matchday-generator-early label { padding-top: .1rem; flex-direction: column; }
}

.matchday-filter-picker {
  position: relative;
}

.matchday-combo-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-width: 150px;
  padding: .55rem .8rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 9px;
  color: var(--text-main);
  background: var(--bg-card);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 700;
  text-align: left;
}

.matchday-multi-picker .matchday-combo-trigger {
  width: 100%;
  min-height: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matchday-combo-trigger > [data-picker-summary] {
  display: inline-block;
  max-width: calc(100% - 26px);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.matchday-combo-arrow {
  flex: 0 0 auto;
  color: var(--text-muted, #66736c);
  transition: transform .15s ease;
}

.matchday-combo-trigger[aria-expanded="true"] .matchday-combo-arrow { transform: rotate(180deg); }

.matchday-picker-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + .35rem);
  left: 0;
  width: min(360px, 88vw);
  padding: .7rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 9px;
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}

.matchday-picker-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: .5rem;
}

.matchday-picker-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 8px;
  color: var(--text-main);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.matchday-picker-close:hover,
.matchday-picker-close:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}

.matchday-option-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 0;
  max-height: 290px;
  margin-top: .55rem;
  border: 1px solid var(--border-color, #e5ebe7);
  border-radius: 7px;
  overflow-y: auto;
}

.matchday-no-options {
  padding: .8rem .35rem;
  color: var(--text-muted, #66736c);
  font-size: .78rem;
  text-align: center;
}

.matchday-option-list label {
  display: flex;
  width: 100%;
  flex: 0 0 auto;
  align-items: center;
  gap: .55rem;
  min-height: 40px;
  margin: 0;
  padding: .5rem .65rem;
  border: 0;
  border-bottom: 1px solid var(--border-color, #e5ebe7);
  border-radius: 0;
  color: var(--text-main);
  background: var(--bg-card);
  cursor: pointer;
  font-size: .8rem;
}

.matchday-option-list > label {
  display: flex !important;
  float: none !important;
  clear: both;
}

.matchday-option-list > label[hidden] {
  display: none !important;
}

.matchday-option-list > label + label {
  margin-top: 0;
}

.matchday-option-list label:last-child { border-bottom: 0; }

.matchday-option-list label:hover { background: rgba(31, 166, 98, .08); }

.matchday-option-list label:has(input:checked) {
  background: rgba(31, 166, 98, .09);
}

.matchday-option-list label > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matchday-league-star {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: color-mix(in srgb, var(--text-muted, #66736c) 70%, transparent);
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
.matchday-league-star:hover { color: #d49a00; background: rgba(245, 183, 0, .1); transform: scale(1.06); }
.matchday-league-star.is-relevant { border-color: rgba(245, 183, 0, .28); color: #f5b700; background: rgba(245, 183, 0, .12); }
.matchday-league-star:focus-visible { outline: 2px solid #f5b700; outline-offset: 1px; }
.matchday-league-star:disabled { cursor: wait; opacity: .55; }

.gh-loading-toast {
  position: fixed;
  z-index: 2200;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  width: min(430px, calc(100vw - 28px));
  min-height: 64px;
  padding: .72rem .9rem;
  align-items: center;
  gap: .72rem;
  border: 1px solid rgba(54, 145, 255, .42);
  border-radius: 18px;
  color: var(--text-main, #17231d);
  background: color-mix(in srgb, var(--bg-card, #fff) 94%, #2788ff 6%);
  box-shadow: 0 16px 42px rgba(13, 73, 145, .24);
  opacity: 0;
  transform: translate(-50%, -12px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.gh-loading-toast[hidden] { display: none; }
.gh-loading-toast.is-visible { opacity: 1; transform: translate(-50%, 0) scale(1); }
.gh-loading-toast > span:last-child { display: grid; min-width: 0; gap: .12rem; }
.gh-loading-toast strong { font-size: .82rem; font-weight: 900; line-height: 1.2; }
.gh-loading-toast small { color: var(--text-muted, #66736c); font-size: .69rem; font-weight: 650; line-height: 1.3; }
.gh-loading-toast-spinner {
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  border: 3px solid rgba(39, 136, 255, .2);
  border-top-color: #2788ff;
  border-radius: 50%;
  animation: gh-loading-toast-spin .72s linear infinite;
}

.matchday-settings-trigger {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 10px;
  color: var(--primary, #168451);
  background: var(--bg-card, #fff);
  box-shadow: 0 5px 16px rgba(15, 57, 37, .08);
  cursor: pointer;
  font-size: 1rem;
}
.matchday-settings-trigger:hover { border-color: var(--primary, #168451); background: rgba(31,166,98,.08); }
.matchday-settings-modal { overflow: hidden; border: 1px solid rgba(31,166,98,.26); border-radius: 18px; }
.matchday-modal-close {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 9px;
  color: var(--text-main, #17211c);
  background: var(--bg-card, #fff);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.matchday-modal-close:hover { border-color: var(--primary, #168451); color: var(--primary, #168451); }
.matchday-settings-modal .modal-body { display: grid; max-height: min(72dvh, 720px); padding: 1rem; overflow-y: auto; gap: .85rem; }
.matchday-settings-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: .25rem; gap: .25rem; border-radius: 11px; background: rgba(31,166,98,.08); }
.matchday-settings-tabs button { padding: .58rem .7rem; border: 0; border-radius: 8px; color: var(--text-muted, #66736c); background: transparent; font-size: .76rem; font-weight: 850; cursor: pointer; }
.matchday-settings-tabs button.is-active { color: #fff; background: var(--primary, #168451); box-shadow: 0 5px 14px rgba(22,132,81,.2); }
.matchday-settings-modal [data-settings-panel] { display: grid; gap: .75rem; }
.matchday-settings-modal [data-settings-panel][hidden] { display: none; }
.matchday-settings-copy { display: grid; gap: .15rem; }
.matchday-settings-copy strong { font-size: .85rem; }
.matchday-settings-copy small { color: var(--text-muted, #66736c); font-size: .7rem; line-height: 1.4; }
.matchday-settings-default { display: flex; align-items: center; gap: .5rem; padding: .62rem .7rem; border: 1px solid rgba(31,166,98,.2); border-radius: 10px; background: rgba(31,166,98,.06); font-size: .76rem; font-weight: 800; }
.matchday-settings-search { min-height: 42px; font-size: .8rem; }
.matchday-settings-leagues { display: grid; max-height: 310px; overflow-y: auto; border: 1px solid var(--border-color, #dfe7e2); border-radius: 11px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.matchday-settings-leagues label { display: flex; min-width: 0; min-height: 40px; padding: .48rem .6rem; align-items: center; gap: .48rem; border-bottom: 1px solid var(--border-color, #dfe7e2); cursor: pointer; font-size: .72rem; }
.matchday-settings-leagues label:nth-child(odd) { border-right: 1px solid var(--border-color, #dfe7e2); }
.matchday-settings-leagues label[hidden] { display: none; }
.matchday-settings-leagues label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matchday-settings-general { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.matchday-settings-general label { display: grid; gap: .3rem; }
.matchday-settings-general label > span { color: var(--text-muted, #66736c); font-size: .68rem; font-weight: 800; }
.matchday-settings-general .form-select { font-size: .76rem; }
.matchday-settings-goals { display: flex; padding: .58rem .65rem; align-items: center; flex-wrap: wrap; gap: .45rem .8rem; border: 1px solid var(--border-color, #dfe7e2); border-radius: 10px; }
.matchday-settings-goals strong { flex: 1 0 100%; font-size: .72rem; }
.matchday-settings-goals label { display: flex; align-items: center; gap: .35rem; font-size: .69rem; font-weight: 750; }
.matchday-settings-market-table { display: grid; overflow: hidden; border: 1px solid var(--border-color, #dfe7e2); border-radius: 11px; }
.matchday-settings-market-head, .matchday-settings-market-row { display: grid; grid-template-columns: minmax(150px, 1.4fr) repeat(3, minmax(90px, .7fr)); align-items: center; }
.matchday-settings-market-head { padding: .48rem .6rem; color: var(--text-muted, #66736c); background: rgba(31,166,98,.07); font-size: .65rem; font-weight: 900; text-align: center; text-transform: uppercase; }
.matchday-settings-market-head span:first-child { text-align: left; }
.matchday-settings-market-row { min-height: 52px; padding: .4rem .55rem; gap: .45rem; border-top: 1px solid var(--border-color, #dfe7e2); }
.matchday-settings-market-row > label:not(.matchday-settings-market-toggle) > span { display: none; }
.matchday-settings-market-row .form-select { min-height: 35px; padding-top: .25rem; padding-bottom: .25rem; font-size: .72rem; }
.matchday-settings-scope { display: flex !important; min-width: 0; align-items: center; gap: .28rem; }
.matchday-settings-scope .form-check-input { flex: 0 0 auto; margin: 0; }
.matchday-settings-scope .form-select { min-width: 0; }
.matchday-settings-market-toggle { display: flex; min-width: 0; align-items: center; gap: .45rem; font-size: .72rem; font-weight: 800; }
.matchday-settings-feedback { margin: 0; padding: .58rem .7rem; border: 1px solid rgba(180,35,24,.25); border-radius: 9px; color: #b42318; background: rgba(239,68,68,.07); font-size: .72rem; font-weight: 750; }
.matchday-settings-feedback.is-success { border-color: rgba(31,166,98,.25); color: var(--primary, #168451); background: rgba(31,166,98,.07); }
.theme-dark .matchday-settings-trigger, .theme-dark .matchday-settings-modal { background: var(--bg-card); }

@media (max-width: 575.98px) {
  .matchday-settings-trigger { width: 36px; height: 36px; }
  .matchday-settings-modal .modal-body { max-height: 74dvh; padding: .75rem; }
  .matchday-settings-leagues { grid-template-columns: 1fr; }
  .matchday-settings-leagues label:nth-child(odd) { border-right: 0; }
  .matchday-settings-market-head { display: none; }
  .matchday-settings-market-row { grid-template-columns: repeat(3, 1fr); padding: .65rem; gap: .45rem; }
  .matchday-settings-market-toggle { grid-column: 1 / -1; padding-bottom: .25rem; }
  .matchday-settings-market-row > label:not(.matchday-settings-market-toggle) { display: grid; min-width: 0; gap: .2rem; }
  .matchday-settings-market-row > label:not(.matchday-settings-market-toggle) > span { display: block; color: var(--text-muted); font-size: .6rem; font-weight: 800; }
  .matchday-settings-general { grid-template-columns: 1fr 1fr; }
}
.theme-dark .gh-loading-toast { border-color: rgba(70, 157, 255, .48); background: rgba(13, 27, 43, .97); box-shadow: 0 18px 46px rgba(0, 0, 0, .46); }
.theme-dark .gh-loading-toast small { color: rgba(224, 236, 248, .72); }
@keyframes gh-loading-toast-spin { to { transform: rotate(360deg); } }

@media (max-width: 575.98px) {
  .gh-loading-toast { top: max(9px, env(safe-area-inset-top)); min-height: 58px; padding: .62rem .72rem; border-radius: 15px; }
  .gh-loading-toast strong { font-size: .76rem; }
  .gh-loading-toast small { font-size: .65rem; }
}

.matchday-option-list .form-check-input {
  flex: 0 0 auto;
  margin: 0;
}

.matchday-all-option {
  position: static;
  border-bottom: 1px solid var(--border-color, #dce5df) !important;
  font-weight: 800;
}

.matchday-relevant-option {
  border-bottom: 1px solid var(--border-color, #dce5df) !important;
  color: var(--primary, #1fa662) !important;
  font-weight: 750;
}

.matchday-relevant-option:has(input:disabled) {
  color: var(--text-muted, #66736c) !important;
  cursor: not-allowed;
  opacity: .65;
}

.matchday-option-search,
.matchday-date-field .form-control {
  color: var(--text-main);
  background-color: var(--bg-card);
  border-color: var(--border-color);
}

.matchday-option-search::placeholder { color: var(--text-muted); }

.theme-dark .matchday-combo-trigger,
.theme-dark .matchday-picker-panel { background: var(--bg-card); }

.theme-dark .matchday-option-list label { background: var(--bg-card); }

.theme-dark .matchday-option-list label:has(input:checked) { background: rgba(0, 229, 160, .1); }

.matchday-meta,
.matchday-card-head {
  justify-content: space-between;
  gap: 1rem;
}

.matchday-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.matchday-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: var(--radius);
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.matchday-card:hover {
  border-color: var(--gh-border-strong, var(--border-color));
  box-shadow: var(--shadow-md);
}

.matchday-card.is-ticket-focus {
  border-color: var(--primary);
  animation: matchday-ticket-focus 2.2s ease-out;
}

@keyframes matchday-ticket-focus {
  0%, 25% { box-shadow: 0 0 0 5px rgba(31,166,98,.24), var(--shadow-md); transform: translateY(-2px); }
  100% { box-shadow: var(--shadow-sm); transform: none; }
}

.matchday-card-summary {
  min-height: 174px;
}

.matchday-summary-loading,
.matchday-summary-error {
  display: flex;
  min-height: 174px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #66736c);
  font-size: .8rem;
  text-align: center;
}

.matchday-summary-state {
  display: flex;
  min-height: 174px;
  padding: 1rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .35rem;
  border: 1px dashed var(--border-color, #dfe7e2);
  border-radius: 10px;
  color: var(--text-muted, #66736c);
  background: rgba(31, 166, 98, .035);
  font-size: .76rem;
  text-align: center;
}

.matchday-summary-state strong {
  color: var(--text-main);
  font-size: .82rem;
}

.matchday-summary-state.is-error {
  background: rgba(196, 126, 34, .05);
}

.matchday-summary-retry {
  margin-top: .35rem;
  padding: .28rem .6rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 7px;
  color: var(--primary, #168653);
  background: var(--bg-card);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.matchday-page-sample {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .3rem .4rem .3rem .65rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 9px;
  color: var(--text-muted, #66736c);
  background: var(--bg-card);
  font-size: .76rem;
  font-weight: 700;
}

.matchday-page-sample select {
  min-width: 82px;
  padding: .3rem 1.6rem .3rem .45rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 7px;
  color: var(--text-main);
  background: var(--bg-card);
  font: inherit;
  cursor: pointer;
}

.matchday-mini-table {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border-color, #dfe7e2);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 10px;
  color: var(--text-main);
  background: var(--bg-card);
  font-size: .75rem;
}

.matchday-period-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: min(100%, 270px);
  margin: 0 auto .55rem;
  padding: 4px;
  border: 1px solid rgba(31, 166, 98, .28);
  border-radius: 10px;
  background: var(--bg-card, #fff);
}

.matchday-period-switch button {
  min-height: 29px;
  padding: .25rem .35rem;
  border: 1px solid rgba(31, 166, 98, .28);
  border-radius: 7px;
  color: var(--primary, #168451);
  background: rgba(31, 166, 98, .08);
  font-size: .68rem;
  font-weight: 800;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.matchday-period-switch button:hover {
  border-color: rgba(31, 166, 98, .55);
  background: rgba(31, 166, 98, .14);
}

.matchday-period-switch button.is-active {
  color: #fff;
  background: var(--primary, #168451);
  border-color: var(--primary, #168451);
  box-shadow: 0 2px 7px rgba(22, 132, 81, .2);
}

.matchday-period-value[data-history] {
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}

.matchday-period-value[data-history]:hover {
  background: rgba(31, 166, 98, .14);
  box-shadow: inset 0 0 0 1px rgba(31, 166, 98, .25);
}

.matchday-mini-table th,
.matchday-mini-table td {
  padding: .4rem .5rem;
  border-bottom: 1px solid var(--border-color, #e8eeea);
  vertical-align: middle;
}

.matchday-mini-table th {
  background: rgba(31, 166, 98, .09);
  color: var(--text-muted, #66736c);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.matchday-mini-table th:nth-child(2),
.matchday-mini-table td:nth-child(2) {
  width: 62px;
  color: #168451;
  font-weight: 800;
  text-align: center;
}

.matchday-mini-table th:last-child,
.matchday-mini-table td:last-child {
  width: 72px;
  color: var(--text-muted, #66736c);
  text-align: right;
}

.matchday-mini-table tr:last-child td {
  border-bottom: 0;
}

.matchday-compare-table th:not(:first-child),
.matchday-compare-table td:not(:first-child) {
  width: 58px;
  padding-left: .65rem;
  padding-right: .65rem;
  color: #168451;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.matchday-compare-table th:first-child,
.matchday-compare-table td:first-child {
  padding-right: .75rem;
}

.matchday-compare-table th:last-child,
.matchday-compare-table td:last-child {
  color: #168451;
  text-align: center;
}

.matchday-compare-table .matchday-sample-row td {
  background: rgba(105, 120, 112, .06);
  color: var(--text-muted, #66736c);
  font-size: .66rem;
  font-weight: 700;
}

.matchday-sample-control {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  margin: 0;
  cursor: text;
}

.matchday-sample-control select {
  width: 40px;
  height: 24px;
  padding: 0 .15rem;
  border: 0;
  border-bottom: 1px dotted var(--text-muted);
  border-radius: 0;
  color: var(--text-main);
  background: transparent;
  font-size: .68rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.matchday-sample-control select:focus {
  border-bottom-color: var(--primary);
  outline: none;
}


.theme-dark .matchday-mini-table th {
  background: rgba(63, 201, 126, .1);
}

.matchday-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.matchday-card-head > span {
  padding: .3rem .55rem;
  border-radius: 8px;
  background: rgba(31, 166, 98, .12);
  color: #168451;
  font-weight: 800;
}

.matchday-card-head > span.is-live {
  color: #b42318;
  background: rgba(239, 68, 68, .12);
}

.matchday-live-score {
  margin-top: .35rem;
  color: var(--primary);
  font-family: "DM Mono", monospace;
  font-size: 1rem;
  font-weight: 800;
}

.matchday-card-head small {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matchday-teams {
  min-height: 74px;
  flex-direction: column;
  justify-content: center;
  gap: .2rem;
  text-align: center;
}

.matchday-teams span {
  color: var(--text-muted, #66736c);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.matchday-teams strong { color: var(--text-main); }

.matchday-caution {
  margin-top: .75rem;
  padding: .6rem .75rem;
  border-radius: 9px;
  background: rgba(224, 164, 36, .12);
  font-size: .78rem;
}

.matchday-reading {
  margin-top: 1rem;
}

.matchday-final-scores {
  display: grid;
  gap: .45rem;
}

.matchday-analysis-loading {
  display: flex;
  width: min(560px, 100%);
  min-height: min(520px, calc(100dvh - 150px));
  margin: 0 auto;
  padding: 2rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .7rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 20px;
  color: var(--text-main);
  background: radial-gradient(circle at 50% 20%, rgba(31, 166, 98, .12), transparent 42%), var(--bg-card);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.matchday-loading-only {
  width: 100%;
  min-width: 0;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--text-main);
  background: var(--shell-bg);
}

.matchday-loading-only-main {
  display: grid;
  width: 100%;
  min-height: 100dvh;
  padding: clamp(12px, 3vw, 32px);
  place-items: center;
}

.matchday-loading-only .matchday-analysis-loading {
  min-height: min(520px, calc(100dvh - 48px));
  border-color: var(--border-color);
  color: var(--text-main);
  background: radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 45%), var(--bg-card);
  box-shadow: var(--shadow-lg);
}

.matchday-loading-only .matchday-analysis-loading small { color: var(--text-muted); }
.matchday-loading-only .analysis-kicker { color: var(--primary); }

.matchday-analysis-loader-logo {
  position: relative;
  display: grid;
  width: 116px;
  height: 116px;
  margin-bottom: .5rem;
  place-items: center;
}

.matchday-analysis-loader-logo span {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(31, 166, 98, .12);
  border-top-color: var(--primary, #1fa662);
  border-right-color: rgba(31, 166, 98, .48);
  border-radius: 50%;
  animation: matchdayLogoSpin 1.05s linear infinite;
}

.matchday-analysis-loader-logo img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(31, 166, 98, .18));
  animation: matchdayLogoPulse 1.4s ease-in-out infinite;
}

.matchday-analysis-loading h1 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.45rem, 5vw, 2rem);
}

.matchday-analysis-loading p { margin: 0; }
.matchday-analysis-loading small { max-width: 390px; color: var(--text-muted, #66736c); }

.matchday-analysis-progress {
  width: min(320px, 90%);
  height: 6px;
  margin: .45rem 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 166, 98, .12);
}

.matchday-analysis-progress i {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--primary, #1fa662), transparent);
  animation: matchdayProgress 1.2s ease-in-out infinite;
}

@keyframes matchdayLogoSpin { to { transform: rotate(360deg); } }
@keyframes matchdayLogoPulse { 50% { transform: scale(.94); opacity: .82; } }
@keyframes matchdayProgress { from { transform: translateX(-110%); } to { transform: translateX(340%); } }

@media (max-width: 680px) {
  .matchday-analysis-loading {
    min-height: calc(100dvh - 125px);
    padding: 1.25rem;
    border-radius: 14px;
  }
  .matchday-analysis-loader-logo { width: 96px; height: 96px; }
  .matchday-analysis-loader-logo img { width: 68px; height: 68px; }
}

.matchday-score-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: .4rem;
}

.matchday-score-list > span {
  display: flex;
  min-height: 42px;
  padding: .38rem .45rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .05rem;
  border: 1px solid var(--border-color, #dfe7e2);
  border-radius: 8px;
  background: rgba(31, 166, 98, .055);
}

.matchday-score-list small {
  color: var(--text-muted, #66736c);
  font-size: .56rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.matchday-score-list strong {
  color: var(--text-main);
  font-family: "DM Mono", monospace;
  font-size: .8rem;
}

@media (max-width: 680px) {
  .matchday-score-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.theme-dark .matchday-hero,
.theme-dark .matchday-card {
  background: var(--bg-card);
}

@media (max-width: 1100px) {
  .matchday-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) and (min-width: 681px) {
  .matchday-hero { align-items: stretch; flex-direction: column; }
  .matchday-hero-actions { width: 100%; flex-wrap: wrap; }
  .matchday-page-alert { width: auto; min-width: 280px; flex: 1 1 360px; }
}

@media (max-width: 680px) {
  .matchday-hero,
  .matchday-filters { align-items: stretch; flex-direction: column; }
  .matchday-trend-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .matchday-trend-filter-title,
  .matchday-trend-filter > label:not(.matchday-percent-field) { grid-column: 1 / -1; min-width: 100%; max-width: none; }
  .matchday-trend-filter .matchday-percent-field { min-width: calc(50% - .4rem); }
  .matchday-trend-filter .btn { width: 100%; }
  .matchday-trend-result { padding-left: 0; }
  .matchday-filters input[type="date"] { max-width: none; }
  .matchday-select-field { width: 100%; max-width: none; }
  .matchday-date-field { flex-basis: auto; }
  .matchday-grid { grid-template-columns: 1fr; }
  .matchday-hero-actions { flex-wrap: wrap; justify-content: space-between; }
  .matchday-page-alert { width: 100%; min-width: 0; flex: 1 0 100%; }
  .matchday-page-alert.is-success,
  .matchday-page-alert.is-loading { min-width: 0; border-radius: 16px; }
  .matchday-page-alert.is-loading { width: calc(100vw - 20px); max-width: calc(100vw - 20px); }
  .matchday-page-alert.is-centered { width: calc(100vw - 20px); max-width: calc(100vw - 20px); }
  .matchday-page-alert.is-success > div,
  .matchday-page-alert.is-loading > div { display: grid; gap: .08rem; }
  .matchday-page-alert.is-success small::before,
  .matchday-page-alert.is-loading small::before { display: none; content: ""; }
  .matchday-help-popover { right: auto; left: 0; }
  .matchday-compare-table th:not(:first-child),
  .matchday-compare-table td:not(:first-child) {
    width: 52px;
    padding-left: .45rem;
    padding-right: .45rem;
  }
}

/* Matchday and authentication: fluid phone layout */
@media (max-width: 680px) {
  .matchday-page,
  .matchday-hero,
  .matchday-filters,
  .matchday-trend-filter,
  .matchday-meta,
  .matchday-grid,
  .matchday-card,
  .matchday-card-summary {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .matchday-page { gap: .8rem; }

  .matchday-hero {
    padding: 1rem;
    gap: .85rem;
  }

  .matchday-hero h1 {
    font-size: clamp(1.25rem, 7vw, 1.65rem);
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
  }

  .matchday-hero p { font-size: .82rem; }
  .matchday-hero-actions { width: 100%; gap: .45rem; }
  .matchday-hero-actions .btn { flex: 1 1 auto; }

  .matchday-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
    padding: .75rem;
    border: 1px solid var(--border-color, #dfe7e2);
    border-radius: 12px;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
  }

  .matchday-filters > *,
  .matchday-select-field,
  .matchday-date-field,
  .matchday-filter-picker,
  .matchday-combo-trigger {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .matchday-select-field,
  .matchday-date-field {
    grid-column: 1 / -1;
    flex: 0 0 auto;
    min-height: 0;
    align-self: auto;
    gap: .2rem;
  }

  .matchday-select-field > span {
    padding-left: .1rem;
    font-size: .64rem;
  }

  .matchday-date-field input,
  .matchday-combo-trigger {
    min-height: 42px;
  }

  .matchday-live-toggle {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 42px;
    margin: 0;
    align-self: auto;
    justify-content: flex-start;
    border-color: rgba(31, 166, 98, .22);
    background: rgba(31, 166, 98, .055);
  }

  .matchday-filters > .btn {
    width: 100%;
    min-height: 40px;
    margin: 0;
  }

  .matchday-filters:not(:has(> a.btn)) > .matchday-filter-submit {
    grid-column: 1 / -1;
  }

  .matchday-picker-panel {
    right: 0;
    left: 0;
    width: 100%;
    max-width: calc(100vw - 1.5rem);
  }

  .matchday-trend-filter {
    padding: .85rem;
    column-gap: .65rem;
    row-gap: .65rem;
  }

  .matchday-trend-filter-title { width: 100%; }
  .matchday-trend-filter-title small { line-height: 1.35; }

  .matchday-grid { gap: .75rem; }

  .matchday-card {
    padding: .75rem;
    gap: .75rem;
    overflow: hidden;
  }

  .matchday-card-head { align-items: flex-start; gap: .5rem; }
  .matchday-card-head > span { flex: 0 0 auto; font-size: .72rem; }
  .matchday-card-head small { min-width: 0; font-size: .66rem; white-space: normal; }
  .matchday-teams { min-height: 62px; }

  .matchday-mini-table {
    width: 100%;
    table-layout: fixed;
    font-size: .68rem;
  }

  .matchday-compare-table th:first-child,
  .matchday-compare-table td:first-child { width: 38%; }

  .matchday-compare-table th:not(:first-child),
  .matchday-compare-table td:not(:first-child) {
    width: 20.66%;
    padding: .38rem .18rem;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .matchday-compare-table th:first-child,
  .matchday-compare-table td:first-child { padding: .38rem .35rem; }
  .matchday-sample-control { gap: .15rem; }
  .matchday-sample-control select { max-width: 38px; }

  .matchday-bet-ticket {
    right: 10px;
    bottom: 10px;
    left: auto;
    top: auto;
    width: min(300px, calc(100vw - 20px));
    max-height: min(430px, 62dvh);
    border-radius: 13px;
  }

  .matchday-ticket-head { padding: .65rem .75rem; }
  .matchday-ticket-body { max-height: calc(min(430px, 62dvh) - 112px); padding: .5rem; gap: .4rem; }
  .matchday-ticket-item > header { padding: .55rem .6rem; }
  .matchday-ticket-selection { padding: .45rem 2rem .45rem .6rem; }
  .matchday-bet-ticket footer { padding: .5rem .6rem; }
  .matchday-bet-ticket-launcher { right: 10px; bottom: 10px; }
}

@media (max-width: 560px) {
  body:has(.ghx-auth-shell) {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .ghx-auth-shell.auth-shell {
    display: grid !important;
    width: 100% !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 16px !important;
    place-items: center !important;
    overflow-x: hidden;
  }

  .ghx-auth-card {
    width: min(100%, 390px) !important;
    max-width: 390px !important;
    margin: 0 auto !important;
    justify-self: center !important;
    border-radius: 22px;
  }

  .ghx-auth-header { padding: 14px 16px; }
  .ghx-auth-body { padding: 22px 16px 20px; }
  .ghx-auth-logo { width: 78px; height: 78px; border-radius: 22px; }
  .ghx-auth-body h2 { font-size: 1.45rem; }
  .ghx-auth-body p { max-width: 100%; margin-inline: auto; text-align: center; }
  .ghx-auth-body form,
  .ghx-auth-input,
  .ghx-auth-submit { width: 100%; max-width: 100%; }
}

@media (max-width: 360px) {
  .content { padding: .55rem; }
  .matchday-card { padding: .6rem; }
  .matchday-mini-table { font-size: .62rem; }
  .matchday-bet-ticket { width: calc(100vw - 16px); right: 8px; bottom: 8px; }
  .ghx-auth-shell.auth-shell { padding: 10px !important; }
  .matchday-filters { grid-template-columns: 1fr; padding: .65rem; }
  .matchday-filters > .btn,
  .matchday-live-toggle { grid-column: 1; }
}

.admin-mobile-tabs {
  display: flex;
  width: min(100%, 760px);
  gap: .45rem;
  margin: 0 auto 1rem;
  padding: .42rem;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.admin-mobile-tabs::-webkit-scrollbar { display: none; }
.admin-mobile-tabs button {
  flex: 1 0 auto;
  min-height: 38px;
  padding: .5rem .8rem;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text-muted);
  background: transparent;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}
.admin-mobile-tabs button:hover { color: var(--text-main); background: color-mix(in srgb, var(--primary) 5%, transparent); }
.admin-mobile-tabs button[aria-selected="true"] {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border-color));
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 11%, var(--bg-card));
}
.admin-dashboard-page [data-admin-tab-panel][hidden],
.admin-dashboard-page [data-admin-tab-row][hidden] { display: none !important; }

.admin-dashboard-page [data-admin-tab-row] {
  justify-content: center;
}

.admin-dashboard-page [data-admin-tab-row] > [data-admin-tab-panel]:not([hidden]) {
  width: 100%;
  max-width: 100%;
  flex: 0 0 100%;
}

.admin-dashboard-page [data-admin-tab-panel]:not([hidden]) > .col-lg-12,
.admin-dashboard-page [data-admin-tab-row] > [data-admin-tab-panel]:not([hidden]) > .card {
  width: 100%;
  max-width: 100%;
}

.admin-dashboard-page [data-admin-tab-panel]:not([hidden]) .card:last-child {
  margin-bottom: 0;
}

.admin-dashboard-page .table .btn-sm,
.admin-users-page .table .btn-sm {
  min-width: max-content;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

@media (max-width: 768px) {
  .admin-mobile-tabs {
    display: flex;
    width: 100%;
    gap: .35rem;
    margin: 0 0 .75rem;
    padding: .38rem;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .admin-mobile-tabs::-webkit-scrollbar { display: none; }
  .admin-mobile-tabs button {
    flex: 1 0 auto;
    min-height: 36px;
    padding: .45rem .68rem;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--text-muted);
    background: transparent;
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
  }
  .admin-mobile-tabs button[aria-selected="true"] {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--border-color));
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 11%, var(--bg-card));
  }
  .admin-dashboard-page [data-admin-tab-panel][hidden],
  .admin-dashboard-page [data-admin-tab-row][hidden] { display: none !important; }
}

/* Admin e filtros: leitura compacta e previsível em smartphones. */
@media (max-width: 768px) {
  .admin-dashboard-page .page-header,
  .admin-users-page .page-header { margin-bottom: .7rem; }

  .admin-dashboard-page > .d-flex:first-of-type {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: .5rem !important;
  }

  .admin-dashboard-page > .d-flex:first-of-type .btn { width: 100%; padding: .55rem .45rem; }

  .admin-dashboard-page .admin-monitor { padding: .75rem; }
  .admin-dashboard-page .admin-monitor-head {
    flex-direction: row;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: .7rem;
  }
  .admin-dashboard-page .admin-monitor-head h5 { font-size: .95rem; }
  .admin-dashboard-page .admin-monitor-head .small { font-size: .7rem; }
  .admin-dashboard-page .admin-monitor-head .badge-status { flex: 0 0 auto; font-size: .62rem; }

  .admin-dashboard-page .admin-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
  }
  .admin-dashboard-page .admin-health-card {
    min-height: 82px;
    padding: .65rem;
  }
  .admin-dashboard-page .admin-health-card span { font-size: .6rem; letter-spacing: .05em; }
  .admin-dashboard-page .admin-health-card strong { margin: .22rem 0 .12rem; font-size: 1rem; }
  .admin-dashboard-page .admin-health-card small { font-size: .66rem; line-height: 1.25; }

  .admin-dashboard-page .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    margin-bottom: .75rem !important;
  }
  .admin-dashboard-page .stat-card {
    min-height: 72px;
    margin: 0;
    padding: .7rem;
    justify-content: center;
  }
  .admin-dashboard-page .stat-label { font-size: .66rem; line-height: 1.2; }
  .admin-dashboard-page .stat-value { font-size: 1.35rem; line-height: 1.15; }
  .admin-dashboard-page .row.g-3 { --bs-gutter-x: .65rem; --bs-gutter-y: .65rem; }
  .admin-dashboard-page .card { margin-bottom: .65rem; }
  .admin-dashboard-page .card-body { padding: .8rem; }
  .admin-dashboard-page .card-body h5 { font-size: .92rem; }
  .admin-dashboard-page .admin-plan-list { gap: .4rem; }
  .admin-dashboard-page .admin-plan-list div {
    flex-direction: row;
    align-items: center;
    padding: .55rem .65rem;
  }

  .admin-users-page .card { margin-bottom: .65rem; }
  .admin-users-page .card-body { padding: .75rem; }
  .admin-users-page form { margin-bottom: .7rem !important; }

  .admin-users-table tbody tr,
  .admin-dashboard-users-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: .55rem;
    border-radius: 12px;
  }
  .admin-users-table tbody td,
  .admin-dashboard-users-table tbody td {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: .4rem;
    padding: .38rem .42rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 65%, transparent);
    font-size: .74rem;
    overflow-wrap: anywhere;
  }
  .admin-users-table tbody td[data-label]::before,
  .admin-dashboard-users-table tbody td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: .59rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
  }
  .admin-users-table .admin-user-identity,
  .admin-users-table .admin-user-action,
  .admin-dashboard-users-table td:first-child,
  .admin-dashboard-users-table .admin-user-action {
    grid-column: 1 / -1;
  }
  .admin-users-table .admin-user-identity,
  .admin-dashboard-users-table td:first-child {
    color: var(--text-main);
    font-size: .85rem;
    font-weight: 800;
  }
  .admin-users-table .admin-user-action,
  .admin-dashboard-users-table .admin-user-action {
    justify-content: stretch;
    padding-top: .5rem;
    border-bottom: 0;
  }
  .admin-users-table .admin-user-action::before,
  .admin-dashboard-users-table .admin-user-action::before { display: none; }
  .admin-users-table .admin-user-action .btn,
  .admin-dashboard-users-table .admin-user-action .btn { width: 100%; }

  .matchday-filters { gap: .85rem; }
  .matchday-picker-panel {
    position: fixed;
    z-index: 1090;
    inset: auto .75rem .75rem .75rem;
    width: auto;
    max-width: none;
    max-height: min(72vh, 560px);
    padding: .8rem;
    border-radius: 14px;
    box-shadow: 0 -12px 42px rgba(0, 0, 0, .3);
  }
  .matchday-picker-tools { position: sticky; top: 0; z-index: 2; }
  .matchday-picker-tools .matchday-option-search {
    /* iOS amplia automaticamente inputs com texto menor que 16px. */
    font-size: 16px !important;
  }
  .matchday-picker-panel .matchday-option-list {
    max-height: calc(min(72vh, 560px) - 68px);
    overscroll-behavior: contain;
  }
}

@media (max-width: 390px) {
  .admin-dashboard-page .admin-health-grid,
  .admin-dashboard-page .stat-grid { gap: .4rem; }
  .admin-dashboard-page .admin-health-card { padding: .55rem; }
  .admin-users-table tbody td,
  .admin-dashboard-users-table tbody td { padding-inline: .3rem; }
}

@media (max-width: 768px) {
  .admin-users-table tbody,
  .admin-dashboard-users-table tbody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
  }

  .admin-users-table tbody tr,
  .admin-dashboard-users-table tbody tr {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: .5rem;
  }

  .admin-users-table tbody td,
  .admin-dashboard-users-table tbody td,
  .admin-users-table .admin-user-identity,
  .admin-dashboard-users-table td:first-child {
    display: block;
    width: 100%;
    padding: .34rem .28rem;
    font-size: .7rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: left !important;
  }

  .admin-users-table tbody td[data-label]::before,
  .admin-dashboard-users-table tbody td[data-label]::before {
    display: inline;
    margin-right: .28rem;
    content: attr(data-label) ":";
    font-size: .58rem;
    white-space: nowrap;
  }

  .admin-users-table .admin-user-identity,
  .admin-dashboard-users-table td:first-child {
    min-height: 34px;
    color: var(--text-main);
    font-size: .76rem;
    font-weight: 800;
  }

  .admin-users-table .admin-user-action,
  .admin-dashboard-users-table .admin-user-action {
    display: block;
    margin-top: auto;
    padding-top: .48rem;
  }

  .admin-users-table .admin-user-action::before,
  .admin-dashboard-users-table .admin-user-action::before { display: none; }

  .admin-users-table tbody tr:only-child,
  .admin-dashboard-users-table tbody tr:only-child { grid-column: 1 / -1; }
}

@media (max-width: 360px) {
  .admin-users-table tbody,
  .admin-dashboard-users-table tbody { gap: .4rem; }
  .admin-users-table tbody tr,
  .admin-dashboard-users-table tbody tr { padding: .4rem; }
  .admin-users-table tbody td,
  .admin-dashboard-users-table tbody td { padding-inline: .2rem; font-size: .66rem; }
}
