:root {
  --bg0: #e8f1ef;
  --bg1: #d7e8e3;
  --ink: #10231f;
  --muted: #4d635c;
  --line: rgba(20, 32, 24, 0.12);
  --turf: #0b6e4f;
  --turf-deep: #074433;
  --gold: #f4a259;
  --sand: #5fa8a3;
  --danger: #a33b2c;
  --panel: rgba(255, 252, 246, 0.86);
  --shadow: 0 18px 50px rgba(15, 40, 24, 0.12);
  --radius: 18px;
  --font-display: "Bebas Neue", sans-serif;
  --font-body: "Manrope", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; max-width: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #dcefdc 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #f0e2c4 0%, transparent 50%),
    linear-gradient(160deg, var(--bg0), var(--bg1));
}
img, canvas, table { max-width: 100%; }
main {
  width: min(1180px, calc(100% - 1.5rem));
  margin: 1rem auto 2.5rem;
  display: grid;
  gap: 1rem;
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
}

.hidden { display: none !important; }

.brand {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--turf-deep);
  margin: 0;
}
.brand.mini { font-size: 1.6rem; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--turf), var(--turf-deep));
  color: #f7fff8;
  box-shadow: 0 10px 24px rgba(20, 90, 45, 0.28);
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn.xl { padding: 1rem 1.8rem; font-size: 1.05rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* Auth */
.auth-body { min-height: 100vh; }
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}
.auth-hero {
  background:
    linear-gradient(120deg, rgba(15, 61, 34, 0.55), rgba(20, 32, 24, 0.25)),
    url("https://images.unsplash.com/photo-1574629810360-7efbbe195018?auto=format&fit=crop&w=1600&q=80") center/cover;
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  from { background-position: 50% 40%; }
  to { background-position: 54% 48%; }
}
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4.5rem);
  background: rgba(255, 252, 246, 0.78);
  backdrop-filter: blur(10px);
}
.auth-panel h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  margin: 0.4rem 0 0.6rem;
  letter-spacing: 0.02em;
}
.lead { color: var(--muted); max-width: 34ch; margin-bottom: 1.8rem; }
.auth-panel form { display: grid; gap: 1rem; max-width: 380px; }
label { display: grid; gap: 0.4rem; font-weight: 600; font-size: 0.92rem; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font: inherit;
  background: #fffdf8;
}
input:focus { outline: 2px solid rgba(31, 107, 58, 0.35); }

/* App shell */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0.75rem clamp(0.75rem, 2vw, 1.4rem);
  padding-top: max(0.75rem, env(safe-area-inset-top));
  background: rgba(255, 252, 246, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  max-width: 100%;
}
.brand-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  min-width: 0;
}
.brand-wrap .tag {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.conn-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: min(240px, 70vw);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  min-width: 0;
}
.conn-badge #connName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conn-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: #9aa79f;
}
.conn-badge.online { border-color: rgba(11, 110, 79, 0.35); color: var(--turf-deep); }
.conn-badge.online .conn-dot { background: var(--turf); box-shadow: 0 0 0 3px rgba(11, 110, 79, 0.15); }
.conn-badge.offline { color: var(--muted); }
.brand-lockup { display: flex; align-items: baseline; gap: 0.7rem; }
.brand-sub { color: var(--muted); font-size: 0.9rem; }
.steps {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  max-width: 100%;
  padding-bottom: 0.15rem;
}
.step {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.step.active {
  background: var(--turf);
  border-color: var(--turf);
  color: #fff;
  animation: pop .35s ease;
}
@keyframes pop {
  from { transform: scale(0.92); opacity: .5; }
  to { transform: scale(1); opacity: 1; }
}

.workspace {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.4rem auto 3rem;
  display: grid;
  gap: 1.2rem;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem clamp(0.9rem, 2.5vw, 1.4rem) 1.35rem;
  animation: rise .45s ease;
  max-width: 100%;
  overflow: hidden;
}
.panel h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  margin: 0 0 0.25rem;
  letter-spacing: 0.03em;
}
.date-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.date-row input[type="date"] { max-width: 100%; }
.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 0.75rem;
}
.city-card {
  text-align: left;
  border: 1px solid var(--line);
  background: #fffef9;
  border-radius: 16px;
  padding: 1rem;
  cursor: pointer;
  display: grid;
  gap: 0.25rem;
  transition: border-color .2s ease, transform .2s ease;
  min-width: 0;
}
.city-card:hover { border-color: var(--turf); transform: translateY(-2px); }
.city-card strong { font-size: 1.05rem; overflow-wrap: anywhere; }
.city-card span, .city-card em { color: var(--muted); font-size: 0.86rem; font-style: normal; }
.chart-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0.8rem 0;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.panel-head h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0;
  letter-spacing: 0.03em;
}
.panel-head p { margin: 0.25rem 0 1rem; color: var(--muted); }
.row { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }
.grow { flex: 1; min-width: 220px; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.85rem;
}
.tile {
  text-align: left;
  border: 1px solid var(--line);
  background: #fffef9;
  border-radius: 16px;
  padding: 1rem;
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease;
}
.tile:hover { border-color: var(--turf); transform: translateY(-2px); }
.tile strong { display: block; font-size: 1.05rem; }
.tile span { color: var(--muted); font-size: 0.86rem; }
.tile .tag {
  display: inline-block;
  margin-top: 0.55rem;
  background: rgba(31, 107, 58, 0.1);
  color: var(--turf-deep);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.race-list { display: grid; gap: 0.65rem; margin-bottom: 1rem; }
.race-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: #fffef9;
  cursor: pointer;
}
.race-item:hover { border-color: var(--gold); }
.race-no {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--turf-deep);
}
.race-item small { color: var(--muted); }

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.chip {
  background: rgba(199, 146, 43, 0.14);
  border: 1px solid rgba(199, 146, 43, 0.28);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.table-wrap { overflow: auto; border-radius: 14px; border: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; background: #fffef9; }
.data-table th, .data-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 0.9rem;
}
.data-table th { background: rgba(31, 107, 58, 0.08); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.data-table tr:hover td { background: rgba(231, 240, 228, 0.55); }

.chart-grid {
  margin-top: 1rem;
}
.chart-grid.twin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}
.chart-box {
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 0.85rem 0.5rem;
  height: 260px;
  max-height: 260px;
  position: relative;
  overflow: hidden;
}
.chart-box.tall {
  height: 320px;
  max-height: 320px;
}
.chart-box canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  display: block;
}

.actions { display: flex; justify-content: center; margin-top: 1.2rem; }

.rank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.rank-card {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #fffef9, #f3f7ef);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}
.rank-card.top {
  border-color: rgba(199, 146, 43, 0.55);
  box-shadow: 0 12px 30px rgba(199, 146, 43, 0.18);
}
.rank-card .place {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--gold);
}
.rank-card h3 { margin: 0.1rem 0; font-size: 1.05rem; }
.rank-card .muted { color: var(--muted); font-size: 0.86rem; }
.score-line {
  margin-top: 0.7rem;
  height: 8px;
  border-radius: 999px;
  background: rgba(20, 32, 24, 0.08);
  overflow: hidden;
}
.score-line > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--turf), var(--gold));
  width: 0;
  animation: fillBar 1s ease forwards;
}
@keyframes fillBar { to { width: var(--w); } }

.insight-box {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(31, 107, 58, 0.08);
  border: 1px solid rgba(31, 107, 58, 0.18);
}
.insight-box li { margin: 0.35rem 0; }
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .7rem;
  margin: 1rem 0 1.1rem;
}
.overview-grid .stat {
  background: linear-gradient(165deg, #fffef9, #f3f7f2);
}
.methodology-box {
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  background: #f7faf6;
  border: 1px solid var(--line);
}
.methodology-box h3 {
  margin: 0 0 .75rem;
  font-size: 1.05rem;
}
.method-step {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: .55rem .75rem;
  padding: .65rem 0;
  border-top: 1px dashed rgba(0,0,0,.08);
}
.method-step:first-of-type { border-top: 0; }
.method-step .ord {
  width: 2rem; height: 2rem;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--turf);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
}
.method-step .stage {
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.method-step .title { font-weight: 700; margin: .1rem 0; }
.method-step .detail { color: #3d4a40; font-size: .9rem; line-height: 1.45; }
.compare-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.compare-table th, .compare-table td {
  text-align: left; padding: .45rem .35rem; border-bottom: 1px solid rgba(0,0,0,.07);
}
.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.stat {
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .85rem 1rem;
  display: grid;
  gap: .35rem;
}
.stat span { color: var(--muted); font-size: .8rem; }
.stat strong { font-size: 1.05rem; }
.disclaimer {
  margin-top: 1rem;
  color: var(--muted);
  font-size: .85rem;
  border-left: 3px solid var(--gold);
  padding-left: .75rem;
}
.code-box {
  background: #142018;
  color: #dcefdc;
  border-radius: 12px;
  padding: 1rem;
  overflow: auto;
  max-height: 420px;
  font-size: .8rem;
}
.empty { color: var(--muted); padding: 1rem 0; }
.top-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 24, 16, 0.45);
  display: grid;
  place-items: center;
  z-index: 50;
  backdrop-filter: blur(4px);
}
.progress-card {
  width: min(420px, calc(100% - 2rem));
  background: #fffdf8;
  border-radius: 18px;
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(20, 32, 24, 0.08);
  overflow: hidden;
  margin: 1rem 0 0.5rem;
}
#progressBar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--turf), var(--gold));
  transition: width .35s ease;
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { min-height: 28vh; }
  .chart-grid.twin, .chart-row { grid-template-columns: 1fr; }
  .chart-box, .chart-box.tall { height: 220px; max-height: 220px; }
  .topbar { flex-wrap: wrap; }
  .race-item { grid-template-columns: 48px 1fr; }
  .brand { font-size: 1.7rem; }
  .top-actions .btn { padding: 0.55rem 0.9rem; }
  .steps { width: 100%; order: 3; }
  .top-actions { margin-left: auto; }
}


.odds-board { margin: 1rem 0 1.5rem; }
.odds-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.odd-cell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 0.75rem;
  text-align: center;
  animation: pop .35s ease both;
}
.odd-cell span { display:block; color: var(--muted); font-size: .85rem; }
.odd-cell b { font-size: 1.35rem; color: var(--turf-deep); }
.pick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.pick {
  background: linear-gradient(160deg, rgba(11,110,79,.08), rgba(244,162,89,.12));
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid var(--line);
}
.pick span { color: var(--muted); font-size: .8rem; }
.pick b { display:block; font-family: var(--font-display); font-size: 2rem; line-height:1; margin: .2rem 0; }
.pick em { color: var(--turf); font-style: normal; font-weight: 700; }
.value-line { font-weight: 600; }
.insights ul { padding-left: 1.1rem; }
.insights .risks { color: var(--danger); }
.hist { width:100%; border-collapse: collapse; font-size: .9rem; }
.hist th, .hist td { border-bottom: 1px solid #ddd; padding: .4rem; text-align:left; }
@media (max-width: 800px) {
  .odds-grid, .pick-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
.bulk-bar {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  margin: 0 0 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line);
}
.match-row { display: grid; grid-template-columns: auto 1fr; gap: .5rem; align-items: stretch; }
.match-row .race-main {
  all: unset; cursor: pointer; display: grid; gap: .2rem; padding: .85rem 1rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
}
.match-row .race-main:hover { border-color: var(--turf); }
.row-check { margin: 0; align-self: center; }
.settings-block {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 1.1rem 1.2rem; margin-bottom: 1.2rem;
}
.settings-block h3 { margin: 0 0 .4rem; font-family: var(--font-display); font-size: 1.6rem; letter-spacing: .03em; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: .8rem 0; }
.settings-grid label, .otp-box label, .settings-block label { display: grid; gap: .35rem; font-weight: 600; color: var(--muted); }
.settings-grid input, .otp-box input {
  border: 1px solid var(--line); border-radius: 12px; padding: .7rem .85rem; font: inherit; color: var(--ink);
}
.otp-box { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: end; margin-top: .8rem; }
.settings-status { margin: .8rem 0 0; font-weight: 600; }
.settings-status.warn { color: var(--gold); }
.settings-status.ok { color: var(--turf); }
.bulk-table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.bulk-table td b { color: var(--turf-deep); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.track-actions { justify-content: flex-start; margin: 0.5rem 0 1rem; }
.track-filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; align-items: center;
}
.track-filter.active {
  background: var(--turf); color: #fff; border-color: var(--turf);
}
.track-list { display: grid; gap: 0.85rem; }
.track-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  background: #fffef9;
  min-width: 0;
}
.track-card header {
  display: flex; justify-content: space-between; gap: 0.75rem; align-items: start;
}
.track-card header strong { overflow-wrap: anywhere; }
.track-status {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  padding: 0.2rem 0.55rem; border-radius: 999px; background: rgba(20,32,24,.08); white-space: nowrap;
}
.track-card.settled .track-status { background: rgba(11,110,79,.12); color: var(--turf-deep); }
.track-meta { color: var(--muted); font-size: 0.86rem; margin: 0.35rem 0 0.75rem; }
.track-compare {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  font-size: 0.88rem;
}
.track-compare > div { display: grid; gap: 0.2rem; min-width: 0; }
.track-compare span { color: var(--muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.track-compare b { font-weight: 700; overflow-wrap: anywhere; }
.hit { display: inline-flex; width: 1.4rem; height: 1.4rem; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(20,32,24,.06); font-size: 0.85rem; }
.hit.ok { background: rgba(11,110,79,.15); color: var(--turf-deep); }
.hit.no { background: rgba(163,59,44,.12); color: var(--danger); }
.settle-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.85rem;
}
.settle-row input {
  width: 4.2rem; padding: 0.55rem 0.6rem; border: 1px solid var(--line);
  border-radius: 10px; font: inherit;
}
.settings-member { font-weight: 700; color: var(--turf-deep); margin: 0.4rem 0 0; }
.coupons-box { display: grid; gap: 0.65rem; margin-top: 0.6rem; }
.coupon-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 0.85rem 1rem; background: #fffef9;
}
.coupon-top { display: flex; justify-content: space-between; gap: 0.5rem; }
.coupon-status { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.coupon-meta {
  display: flex; flex-wrap: wrap; gap: 0.55rem 0.9rem; color: var(--muted); font-size: 0.82rem; margin-top: 0.35rem;
}
.progress-track {
  height: 12px; border-radius: 999px; background: rgba(20,32,24,.08); overflow: hidden; margin: 1rem 0 .5rem;
}
.progress-bar {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--turf), var(--gold)); transition: width .35s ease;
}
.swal-table-wrap { overflow: auto; max-width: 100%; }
.weights { width: 100%; max-width: 100%; font-family: ui-monospace, monospace; font-size: 0.85rem; }
.race-main .title { overflow-wrap: anywhere; }
.match-row { max-width: 100%; }
@media (max-width: 800px) {
  .settings-grid, .otp-box { grid-template-columns: 1fr; }
  .track-compare { grid-template-columns: 1fr; }
  .pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions { flex-wrap: wrap; gap: 0.5rem; }
  .actions .btn { width: 100%; text-align: center; }
  .track-actions .btn { width: auto; }
  main { width: calc(100% - 1rem); margin: 0.75rem auto 2rem; }
  .data-table th, .data-table td, .hist th, .hist td { white-space: normal; }
}
@media (max-width: 480px) {
  .brand { font-size: 1.45rem; }
  .conn-badge { max-width: 100%; }
  .odds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn { padding: 0.7rem 1rem; }
  .pred-metrics { grid-template-columns: 1fr; }
  .explain-grid { grid-template-columns: 1fr; }
}

.rec-banner {
  display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center;
  padding: .75rem 1rem; border-radius: 14px; margin-bottom: 1rem;
  border: 1px solid var(--line); background: #fffef9; font-size: .92rem;
}
.rec-banner.status-strong_value { border-color: rgba(11,110,79,.4); background: rgba(11,110,79,.08); }
.rec-banner.status-value { border-color: rgba(95,168,163,.45); }
.rec-banner.status-no_edge, .rec-banner.status-insufficient_data { opacity: .9; color: var(--muted); }
.rec-banner.status-high_risk { border-color: rgba(163,59,44,.35); background: rgba(163,59,44,.06); }
.pred-metrics {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .55rem; margin: .8rem 0 1rem;
}
.pred-metrics .metric {
  border: 1px solid var(--line); border-radius: 12px; padding: .65rem .75rem; background: #fffef9;
  display: grid; gap: .2rem; min-width: 0;
}
.pred-metrics span { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.pred-metrics b { font-size: .92rem; overflow-wrap: anywhere; }
.top-scores { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 1rem; }
.top-scores span {
  background: rgba(11,110,79,.1); border-radius: 999px; padding: .25rem .65rem;
  font-size: .8rem; font-weight: 700;
}
.explain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
.explain-grid h4, .model-votes h4 { margin: 0 0 .4rem; font-size: .95rem; }
.model-votes { overflow: auto; margin: 1rem 0; }
.bulk-filters {
  display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: .75rem; align-items: end;
}
.bulk-filters label { display: grid; gap: .25rem; font-size: .8rem; color: var(--muted); font-weight: 700; }
.muted-cell { display: block; color: var(--muted); font-size: .72rem; font-weight: 600; }
.bulk-table th { white-space: nowrap; font-size: .72rem; }
