:root {
  --bg: #07100d;
  --panel: #0d1915;
  --panel-raised: #12221c;
  --line: rgba(211, 255, 226, 0.12);
  --text: #f4f8f5;
  --muted: #91a69d;
  --lime: #c9ff59;
  --mint: #57e7a0;
  --amber: #ffc862;
  --red: #ff7474;
  --ink: #0b1711;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 82% -10%, rgba(87, 231, 160, 0.15), transparent 30rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button { font: inherit; }
a { color: inherit; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 70px;
  padding: 12px max(16px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 13, 0.9);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; background: var(--lime); color: var(--ink); font-weight: 950; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 13px; letter-spacing: 0.13em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 8px; letter-spacing: 0.18em; }
.health { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.health i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.health.error i { background: var(--red); box-shadow: none; }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 110px; }
.page-intro { margin-bottom: 30px; }
.eyebrow { margin: 0 0 10px; color: var(--lime); font-size: 9px; font-weight: 850; letter-spacing: 0.2em; }
h1 { margin: 0; font-size: clamp(39px, 8vw, 68px); line-height: 0.99; letter-spacing: -0.055em; }
h1 span { color: var(--muted); }
.page-intro > p:last-child { max-width: 660px; margin: 18px 0 0; color: #a9bbb3; font-size: 13px; }

.summary-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--line); box-shadow: var(--shadow); }
.summary-strip div { min-height: 90px; padding: 17px; display: flex; flex-direction: column; justify-content: space-between; background: var(--panel); }
.summary-strip div:first-child { background: var(--lime); color: var(--ink); }
.summary-strip div:last-child { grid-column: 1 / -1; }
.summary-strip span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.summary-strip div:first-child span { color: rgba(11, 23, 17, 0.65); }
.summary-strip strong { font-size: 22px; letter-spacing: -0.03em; }

.filters { display: flex; gap: 8px; overflow-x: auto; margin: 24px -16px 4px; padding: 0 16px 10px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; background: transparent; color: var(--muted); cursor: pointer; }
.filter-chip span { margin-left: 5px; font-size: 10px; }
.filter-chip.active { border-color: var(--lime); background: rgba(201, 255, 89, 0.12); color: var(--text); }
.filter-chip:focus-visible, a:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

.catalog-filters { display: grid; gap: 9px; margin: 9px 0 20px; }
.catalog-filters label { display: grid; gap: 5px; }
.catalog-filters label > span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.catalog-filters input, .catalog-filters select { width: 100%; min-height: 45px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: var(--panel); font: inherit; font-size: 12px; }
.catalog-filters input:focus, .catalog-filters select:focus { outline: 2px solid var(--lime); outline-offset: 2px; }
.catalog-filters option { color: var(--text); background: var(--panel); }

.list-head { margin: 14px 0 10px; display: flex; align-items: end; justify-content: space-between; gap: 15px; }
.list-head span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em; }
.list-head strong { font-size: 13px; }
.list-head p { margin: 0; color: var(--muted); font-size: 10px; }
.recommendations { display: grid; gap: 11px; }

.pick-card { display: block; border: 1px solid var(--line); border-radius: 18px; padding: 17px; background: linear-gradient(145deg, rgba(18, 34, 28, 0.98), rgba(11, 23, 18, 0.98)); text-decoration: none; box-shadow: var(--shadow); transition: transform 160ms ease, border-color 160ms ease; }
.pick-card:hover { transform: translateY(-2px); border-color: rgba(201, 255, 89, 0.35); }
.pick-top, .pick-market, .pick-metrics { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kickoff { color: var(--lime); font-size: 12px; font-weight: 800; }
.competition { max-width: 55%; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.09em; }
.teams { margin: 15px 0; }
.teams strong { display: block; font-size: 19px; line-height: 1.2; letter-spacing: -0.025em; }
.teams span { display: block; margin: 3px 0; color: #637a70; font-size: 9px; font-weight: 800; }
.pick-market { padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.selection { display: inline-flex; align-items: center; gap: 7px; color: var(--lime); font-weight: 900; }
.selection i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.price { text-align: right; }
.price strong, .price small { display: block; }
.price small { color: var(--muted); font-size: 9px; }
.pick-metrics { padding-top: 14px; }
.probability strong { display: block; color: var(--lime); font-size: 31px; line-height: 1; letter-spacing: -0.055em; }
.probability small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: 0.09em; }
.metric-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; text-align: right; }
.metric-pair span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: 0.08em; }
.metric-pair strong { font-size: 13px; }
.metric-pair .positive { color: var(--mint); }
.quality-meter { width: 72px; height: 8px; margin: 5px 0 0 auto; display: block; border: 0; background: #20332a; }
.quality-meter::-webkit-meter-bar { border: 0; border-radius: 9px; background: #20332a; }
.quality-meter::-webkit-meter-optimum-value { border-radius: 9px; background: var(--mint); }
.quality-meter::-moz-meter-bar { border-radius: 9px; background: var(--mint); }
.demo-badge { display: inline-flex; margin-top: 12px; border: 1px solid rgba(255, 200, 98, 0.35); border-radius: 7px; padding: 4px 7px; color: var(--amber); font-size: 8px; font-weight: 900; letter-spacing: 0.1em; }
.fixture-card { margin: 0; }
.fixture-meta, .fixture-result { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.state-badge { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; font-weight: 900; letter-spacing: 0.06em; }
.state-badge.bet { border-color: rgba(87, 231, 160, 0.35); color: var(--mint); }
.state-badge.analyzed { border-color: rgba(255, 200, 98, 0.35); color: var(--amber); }
.state-badge.pending { color: var(--muted); }
.state-badge.unavailable { border-color: rgba(255, 116, 116, 0.35); color: var(--red); }
.fixture-result { margin-top: 10px; }
.fixture-result strong { color: var(--lime); font-size: 22px; }
.pending-copy { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.analyze-button { width: 100%; min-height: 40px; margin-top: 11px; border: 1px solid rgba(201, 255, 89, 0.32); border-radius: 10px; color: var(--lime); background: rgba(201, 255, 89, 0.07); font-size: 10px; font-weight: 850; cursor: pointer; }
.analyze-button:disabled { cursor: wait; opacity: 0.55; }
.analyze-status { display: block; min-height: 16px; margin-top: 5px; color: var(--amber); font-size: 8px; overflow-wrap: anywhere; }

.empty-state { margin-top: 12px; padding: 45px 22px; border: 1px dashed rgba(201, 255, 89, 0.25); border-radius: 18px; text-align: center; background: rgba(13, 25, 21, 0.6); }
.empty-icon { width: 48px; height: 48px; margin: 0 auto 15px; border-radius: 50%; display: grid; place-items: center; background: rgba(201, 255, 89, 0.12); color: var(--lime); font-weight: 900; }
.empty-state h2 { margin: 0; font-size: 20px; }
.empty-state p { max-width: 520px; margin: 9px auto 0; color: var(--muted); font-size: 12px; }

.bottom-nav { position: fixed; inset: auto 0 0; z-index: 20; min-height: 72px; padding: 8px 16px max(8px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: rgba(7, 16, 13, 0.94); backdrop-filter: blur(18px); }
.bottom-nav a { min-height: 52px; display: grid; place-items: center; align-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 9px; }
.bottom-nav a span { font-size: 15px; }
.bottom-nav a.active { color: var(--lime); }
.logout-form { margin: 0; display: grid; }
.logout-form button { min-height: 52px; border: 0; display: grid; place-items: center; align-content: center; gap: 2px; color: var(--muted); background: transparent; font: inherit; font-size: 9px; cursor: pointer; }
.logout-form button span { font-size: 15px; }
.header-logout button { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; }

.login-page { min-height: 100vh; display: grid; place-items: center; }
.login-shell { width: min(100%, 430px); padding: 22px; }
.login-card { padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35); }
.login-card .brand { position: static; margin-bottom: 36px; display: inline-flex; }
.login-card h1 { margin: 5px 0 8px; font-size: 42px; }
.login-copy { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.login-error { padding: 10px; border: 1px solid rgba(255, 200, 98, 0.35); border-radius: 9px; color: var(--amber); background: rgba(255, 200, 98, 0.08); font-size: 11px; }
.login-form { display: grid; gap: 15px; }
.login-form label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.login-form input { min-height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--panel-raised); font: inherit; font-size: 15px; }
.login-form input:focus { outline: 2px solid var(--lime); outline-offset: 2px; }
.login-form button { min-height: 50px; border: 0; border-radius: 10px; color: #07100d; background: var(--lime); font: inherit; font-weight: 900; cursor: pointer; }

.detail-page { padding-top: 24px; }
.detail-actions { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; }
.back-link { display: inline-flex; min-height: 44px; align-items: center; color: var(--muted); text-decoration: none; font-size: 12px; }
.refresh-button { min-height: 44px; padding: 0 13px; border: 1px solid rgba(201, 255, 89, 0.35); border-radius: 10px; color: var(--lime); background: rgba(201, 255, 89, 0.06); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.refresh-button:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.refresh-button:disabled { cursor: wait; opacity: 0.55; }
.refresh-status { min-height: 18px; margin: 2px 0 0; color: var(--muted); font-size: 10px; text-align: right; }
.refresh-status.error { color: var(--amber); }
.detail-hero { margin: 8px 0 14px; padding: 22px; border: 1px solid rgba(201, 255, 89, 0.25); border-radius: 20px; background: linear-gradient(145deg, rgba(201, 255, 89, 0.1), var(--panel)); }
.detail-hero h1 { font-size: clamp(31px, 7vw, 53px); }
.detail-verdict { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 20px; }
.detail-verdict .probability strong { font-size: 42px; }
.detail-grid { display: grid; gap: 12px; }
.detail-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); }
.detail-panel header { padding: 17px; border-bottom: 1px solid var(--line); }
.detail-panel h2 { margin: 0; font-size: 17px; }
.detail-panel header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.detail-body { padding: 17px; }
.evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.evidence { padding: 12px; border-radius: 12px; background: var(--panel-raised); }
.evidence span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: 0.08em; }
.evidence strong { font-size: 17px; }
.sample-list { display: grid; gap: 7px; }
.sample { padding: 11px; border-radius: 11px; background: var(--panel-raised); font-size: 11px; }
.sample-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.sample strong { display: block; margin-top: 4px; }
.reason-list { margin: 0; padding-left: 18px; color: #b7c8c0; font-size: 11px; }
.reason-list li { margin: 6px 0; }
.reason-list.blockers { color: var(--amber); }
.loading { padding: 60px 0; color: var(--muted); text-align: center; }

.reload-button { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--lime); background: var(--panel); font-size: 11px; font-weight: 850; cursor: pointer; }
.reload-button:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.reload-button:disabled { cursor: wait; opacity: 0.55; }
.health-page { padding-top: 30px; }
.health-message { min-height: 20px; margin: -12px 0 18px; color: var(--muted); font-size: 10px; }
.health-message.error { color: var(--red); }
.health-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 13px; }
.health-kpis article { min-height: 113px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; display: flex; flex-direction: column; background: var(--panel); }
.health-kpis span, .health-kpis small { color: var(--muted); font-size: 9px; }
.health-kpis strong { margin: auto 0 2px; font-size: 23px; letter-spacing: -0.04em; }
.status-text.ok { color: var(--mint); }
.status-text.warn { color: var(--amber); }
.status-text.bad { color: var(--red); }
.health-grid { display: grid; gap: 12px; }
.health-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); }
.health-panel > header { padding: 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.health-panel h2 { margin: 0; font-size: 18px; }
.health-panel .eyebrow { margin-bottom: 4px; }
.ops-badge { display: inline-flex; min-height: 24px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; align-items: center; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: 0.06em; }
.ops-badge.ok { border-color: rgba(87, 231, 160, 0.3); color: var(--mint); }
.ops-badge.warn { border-color: rgba(255, 200, 98, 0.3); color: var(--amber); }
.ops-badge.bad { border-color: rgba(255, 116, 116, 0.3); color: var(--red); }
.metric-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.metric-list div { min-height: 67px; padding: 12px 16px; background: var(--panel); }
.metric-list span, .metric-list strong { display: block; }
.metric-list span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: 0.07em; }
.metric-list strong { margin-top: 5px; font-size: 16px; }
.health-note { padding: 13px 16px; color: var(--amber); background: rgba(255, 200, 98, 0.05); font-size: 9px; line-height: 1.55; }
.ops-list { display: grid; }
.ops-row { min-height: 64px; padding: 11px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.ops-row:last-child { border-bottom: 0; }
.ops-row strong, .ops-row small { display: block; }
.ops-row strong { font-size: 11px; }
.ops-row small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.ops-row > span { min-width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; color: var(--ink); background: var(--amber); font-size: 12px; font-weight: 950; }
.run-list { display: grid; }
.run-item { padding: 13px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 8px 13px; align-items: center; }
.run-item:last-child { border-bottom: 0; }
.run-item strong, .run-item small { display: block; }
.run-item strong { font-size: 11px; }
.run-item small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.run-item > p { grid-column: 1 / -1; margin: 0; padding: 7px 9px; border-radius: 7px; color: var(--red); background: rgba(255, 116, 116, 0.06); font-size: 8px; overflow-wrap: anywhere; }
.run-result { text-align: right; }
.ops-empty { padding: 30px 16px; color: var(--muted); text-align: center; font-size: 10px; }

@media (min-width: 720px) {
  .page-shell { padding-top: 64px; }
  .summary-strip { grid-template-columns: repeat(3, 1fr); }
  .summary-strip div:last-child { grid-column: auto; }
  .recommendations { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .detail-panel.wide { grid-column: 1 / -1; }
  .health-kpis { grid-template-columns: repeat(4, 1fr); }
  .health-grid { grid-template-columns: 1fr 1fr; }
  .catalog-filters { grid-template-columns: 1.5fr 1fr 1fr; align-items: end; }
  .health-panel.wide { grid-column: 1 / -1; }
}

@media (min-width: 1020px) {
  .app-header { min-height: 82px; }
  .page-shell { padding-bottom: 55px; }
  .bottom-nav { position: static; width: min(1180px, calc(100% - 32px)); min-height: 66px; margin: 0 auto; border: 1px solid var(--line); border-width: 1px 0 0; background: transparent; }
  .recommendations { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
