:root {
  color-scheme: light;
  --bg: #e7eaf2; --panel: #fff; --soft: #f6f7fb; --line: #dce1eb;
  --text: #172033; --muted: #73809a; --blue: #315ee9; --violet: #7453d7;
  --green: #16885d; --gold: #a66a00; --red: #cc3d55;
  --shadow: 0 16px 45px rgba(31,48,87,.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: 300px; z-index: -1; background: linear-gradient(135deg,#e1e7f5,#ece7f6 55%,#e7eaf2); }
button, select, input { font: inherit; }
button { color: inherit; }
.topbar { position: sticky; top: 0; z-index: 30; min-height: 72px; padding: 10px max(24px,env(safe-area-inset-left)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; background: rgba(255,255,255,.88); border-bottom: 1px solid rgba(220,225,237,.85); backdrop-filter: blur(18px); }
.brand { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 11px; }
.brand-logo { width: 42px; height: 42px; border-radius: 11px; box-shadow: 0 9px 25px rgba(30,112,192,.2); }
.brand strong { display: block; font-size: 20px; letter-spacing: -.4px; }
.brand small { display: block; margin-top: 2px; color: #66738c; font-size: 11px; letter-spacing: 1.35px; }
.clock-strip { display: flex; align-items: center; gap: 12px; padding: 9px 14px; color: #4d5970; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.clock-strip span { display: flex; align-items: center; gap: 6px; }
.flag-icon { width: 24px; height: 14px; object-fit: cover; border-radius: 2px; }
.clock-strip strong { color: var(--text); font-weight: 750; }
.clock-strip i { width: 1px; height: 16px; background: var(--line); }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.sound-toggle { display: flex; align-items: center; gap: 6px; padding: 8px 10px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.sound-toggle span { font-size: 16px; }
.sound-toggle b { font-size: 12px; }
.sound-toggle em { padding: 2px 5px; border-radius: 5px; background: #edf0f5; font-size: 11px; font-style: normal; }
.sound-toggle[aria-pressed="true"] { color: var(--blue); border-color: #becbf5; background: #edf2ff; }
.sound-toggle[aria-pressed="true"] em { color: #fff; background: var(--blue); }
.system-state { display: flex; align-items: center; gap: 7px; color: #65718a; font-size: 12px; }
.status-dot { width: 8px; height: 8px; background: #e4a63d; border-radius: 50%; box-shadow: 0 0 0 4px rgba(228,166,61,.12); }
.system-state.online .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(22,136,93,.1); }
.shell { width: min(1240px,calc(100% - 40px)); margin: 0 auto; padding: 34px 0 100px; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 23px; }
.hero-actions { display: flex; align-items: center; gap: 10px; }
.history-top-link { padding: 11px 14px; color: var(--blue); text-decoration: none; background: rgba(255,255,255,.86); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 7px 20px rgba(31,48,87,.07); font-size: 13px; font-weight: 800; }
.history-top-link:hover { border-color: #b9c7f3; background: #fff; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 12px; font-weight: 850; letter-spacing: 1.7px; }
h1,h2,p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(31px,5vw,46px); line-height: 1; letter-spacing: -1.8px; }
h2 { margin-bottom: 0; font-size: 22px; letter-spacing: -.3px; }
.muted,.caption { color: var(--muted); }
.muted { margin-bottom: 0; font-size: 14px; }
.caption { font-size: 13px; }
.hero-title { display: flex; align-items: center; gap: 12px; }
.hero-title img { width: 48px; height: 48px; }
.hero-title h1 { margin-bottom: 7px; }
.icon-button,.close-button { border: 1px solid var(--line); background: #fff; cursor: pointer; box-shadow: 0 7px 20px rgba(31,48,87,.07); }
.icon-button { width: 44px; height: 44px; border-radius: 13px; color: var(--blue); font-size: 22px; }
.icon-button:active { transform: rotate(25deg); }
.system-grid,.metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 13px; }
.system-card,.metric-card { min-height: 124px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.system-card { position: relative; overflow: hidden; }
.system-card::after { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: #dbe2f0; }
.system-card.accent-blue::after { background: linear-gradient(90deg,var(--blue),var(--violet)); }
.system-card.quality-ok::after { background: var(--green); }
.system-card.quality-warn::after { background: #e5a22d; }
.system-card.quality-block::after { background: var(--red); }
.system-card.credit-warning::after { background: var(--gold); }
.system-card.credit-warning #metric-api { color: var(--gold); }
.system-card span,.system-card small,.metric-card span,.metric-card small { display: block; }
.system-card span,.metric-card span { color: #65718a; font-size: 13px; font-weight: 700; letter-spacing: .25px; }
.system-card strong,.metric-card strong { display: block; margin: 9px 0 4px; font-size: 24px; letter-spacing: -.5px; }
.system-card small,.metric-card small { color: #65718a; font-size: 12px; line-height: 1.45; }
#metric-quality { color: var(--gold); }
.quality-ok #metric-quality { color: var(--green); }
.quality-block #metric-quality { color: var(--red); }
.performance-strip { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; margin: 14px 0 28px; padding: 15px 18px; color: #fff; background: linear-gradient(90deg,#273d85,#485aab 58%,#6751a7); border-radius: 16px; box-shadow: 0 13px 34px rgba(47,65,134,.18); }
.performance-strip div { display: grid; gap: 2px; }
.performance-strip span,.performance-strip small { color: rgba(255,255,255,.8); font-size: 12px; }
.performance-strip strong { font-size: 14px; }
.performance-strip p { margin: 0; font-size: 16px; font-weight: 800; text-align: center; }
.performance-strip small { white-space: nowrap; }
.metric-card { min-height: 112px; box-shadow: 0 10px 30px rgba(31,48,87,.055); }
.metric-card strong { font-size: 25px; }
.toolbar { margin: 30px 0 21px; display: flex; gap: 11px; justify-content: space-between; }
.segmented { display: flex; gap: 4px; padding: 4px; overflow-x: auto; background: #e9edf5; border: 1px solid #dfe4ed; border-radius: 13px; }
.segment { white-space: nowrap; padding: 10px 15px; border: 0; border-radius: 9px; background: transparent; color: #65718a; cursor: pointer; font-size: 13px; font-weight: 750; }
.segment.active { color: var(--blue); background: #fff; box-shadow: 0 4px 12px rgba(31,48,87,.08); }
.select-wrap select { height: 42px; min-width: 115px; padding: 0 31px 0 12px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.league-select { margin-left: auto; }
.section-block { margin-top: 29px; scroll-margin-top: 94px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.pill { min-width: 25px; padding: 4px 9px; border-radius: 99px; color: var(--blue); background: #edf2ff; text-align: center; font-size: 12px; }
.signal-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.signal-card { position: relative; overflow: hidden; padding: 19px; background: #fff; border: 1px solid var(--line); border-radius: 19px; cursor: pointer; transition: transform .18s ease,border-color .18s ease; box-shadow: var(--shadow); }
.signal-card:hover { transform: translateY(-2px); border-color: #b9c7f3; }
.signal-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--blue); }
.signal-card.cross::before { background: var(--violet); }
.signal-card.research { border-color: #eadcba; background: linear-gradient(180deg,#fffdf7,#fff); }
.signal-card.research::before { background: #d99922; }
.signal-card.research .model-tag { color: #94600a; background: #fff3d6; }
.signal-card.line-value { border-color: #b8dfe0; background: linear-gradient(180deg,#f7ffff,#fff); }
.signal-card.line-value::before { background: #168f96; }
.signal-card.line-value .model-tag { color: #087077; background: #ddf7f6; }
.signal-card.line-value .research-reason { color: #09676d; background: #eafafa; }
.signal-card.early { border-color: #cfd7e8; background: linear-gradient(180deg,#fafbff,#fff); }
.signal-card.early::before { background: #72809b; }
.signal-card.early .model-tag { color: #50607b; background: #edf1f7; }
.research-grade { color: #94600a; background: #fff3d6; }
.research-pill { color: #94600a; background: #fff3d6; }
.research-reason { margin-top: 10px; padding: 9px 11px; color: #805817; background: #fff8e8; border-radius: 9px; font-size: 12px; font-weight: 700; }
.research-meta { margin-top: 7px; padding-top: 7px; border-top: 1px dashed #eadcba; }
.secondary-button { padding: 11px 16px; color: var(--blue); background: #fff; border: 1px solid #cdd7ef; border-radius: 11px; font-size: 13px; font-weight: 800; cursor: pointer; }
.early-expand { display: block; margin: 15px auto 0; }
.early-expand[hidden] { display: none; }
.card-top,.match-row,.pick-row,.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.model-tag,.grade-tag,.market-tag,.score-tag { padding: 5px 8px; border-radius: 7px; font-size: 11px; font-weight: 850; letter-spacing: .3px; }
.model-tag { color: var(--blue); background: #edf2ff; }
.signal-card.cross .model-tag { color: var(--violet); background: #f2edff; }
.grade-tag { color: var(--blue); background: #eef2fb; }
.grade-tag.a { color: var(--gold); background: #fff5dc; }
.score-tag { margin-left: 5px; color: #4b5873; background: #f0f2f7; }
.kickoff { color: #65718a; font-size: 12px; }
.match-row { margin: 15px 0 12px; align-items: flex-start; }
.match-row strong { font-size: 17px; line-height: 1.35; }
.league { margin-top: 5px; color: #65718a; font-size: 12px; }
.market-tag { flex: 0 0 auto; color: var(--green); background: #eaf8f2; }
.pick-row { padding: 13px; background: var(--soft); border: 1px solid #edf0f6; border-radius: 13px; }
.pick-label { display: block; color: #65718a; font-size: 12px; }
.pick-name { display: block; margin-top: 3px; font-size: 16px; font-weight: 850; }
.odds { text-align: right; }
.odds strong { display: block; color: var(--blue); font-size: 19px; }
.odds small { color: #65718a; font-size: 11px; }
.card-meta { margin-top: 13px; color: #65718a; font-size: 12px; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.history-toolbar { display: flex; gap: 10px; margin-bottom: 13px; }
.history-entry { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 30px; padding: 18px 20px; color: var(--text); text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.history-entry:hover { border-color: #b9c7f3; transform: translateY(-1px); }
.history-entry strong,.history-entry small { display: block; }
.history-entry strong { font-size: 17px; }
.history-entry small { margin-top: 4px; color: #65718a; font-size: 13px; }
.history-entry b { flex: 0 0 auto; color: var(--blue); font-size: 14px; }
.history-shell { max-width: 1240px; }
.history-hero { align-items: center; }
.ledger-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; margin-bottom: 13px; }
.ledger-grid article { min-height: 118px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); }
.ledger-grid article.ledger-primary { border-top: 3px solid var(--blue); }
.ledger-grid span,.ledger-grid small { display: block; color: #65718a; font-size: 12px; }
.ledger-grid strong { display: block; margin: 10px 0 5px; font-size: 25px; letter-spacing: -.5px; }
.outcome-strip { display: grid; grid-template-columns: repeat(5,1fr); gap: 1px; margin-bottom: 13px; overflow: hidden; background: #dfe4ee; border: 1px solid #dfe4ee; border-radius: 14px; box-shadow: 0 9px 28px rgba(31,48,87,.05); }
.outcome-strip div { padding: 12px 14px; background: #fff; text-align: center; }
.outcome-strip span { display: block; color: #65718a; font-size: 11px; }
.outcome-strip strong { display: block; margin-top: 4px; font-size: 18px; }
.history-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; color: #fff; background: linear-gradient(90deg,#273d85,#485aab 58%,#6751a7); border-radius: 16px; }
.history-summary div { display: flex; align-items: baseline; gap: 9px; }
.history-summary span,.history-summary small { color: rgba(255,255,255,.78); font-size: 12px; }
.history-summary strong { font-size: 26px; }
.history-summary p { margin: 0; font-size: 14px; }
.header-link { padding: 9px 13px; color: var(--blue); text-decoration: none; background: #edf2ff; border: 1px solid #dce5ff; border-radius: 10px; font-size: 13px; font-weight: 750; }
.history-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.history-card { padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.history-card.win { border-left: 4px solid var(--green); }
.history-card.loss { border-left: 4px solid var(--red); }
.history-card.neutral { border-left: 4px solid #9aa5b9; }
.history-head,.history-match,.history-pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.history-head>div { display: flex; align-items: center; gap: 6px; }
.history-match { margin: 16px 0; align-items: flex-start; }
.history-match strong { display: block; font-size: 16px; line-height: 1.35; }
.history-match span { display: block; margin-top: 4px; color: #65718a; font-size: 12px; }
.history-match b { flex: 0 0 auto; font-size: 20px; }
.history-pick { padding: 12px; background: var(--soft); border-radius: 12px; }
.history-pick div { min-width: 0; }
.history-pick span { display: block; color: #65718a; font-size: 11px; }
.history-pick strong { display: block; margin-top: 4px; font-size: 13px; overflow-wrap: anywhere; }
.result-tag { padding: 5px 9px; border-radius: 99px; color: #667085; background: #eef1f6; font-size: 11px; font-weight: 850; }
.result-tag.win { color: var(--green); background: #e7f8f0; }
.result-tag.loss { color: var(--red); background: #ffedf1; }
.bankroll-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 13px; }
.bankroll-card { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.bankroll-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bankroll-head strong { font-size: 15px; }
.bankroll-head span { display: block; color: #65718a; font-size: 12px; }
.balance { margin: 16px 0 12px; font-size: 26px; font-weight: 850; letter-spacing: -.8px; }
.stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.stat-row span { color: #65718a; font-size: 11px; }
.stat-row strong { display: block; margin-top: 3px; font-size: 13px; }
.alert-list { display: grid; gap: 9px; }
.alert-item { display: flex; gap: 12px; padding: 15px 16px; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 8px 24px rgba(31,48,87,.045); }
.alert-icon { flex: 0 0 auto; display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; color: var(--gold); background: #fff5dc; }
.alert-item strong { display: block; font-size: 14px; }
.alert-item p { margin: 4px 0 0; color: #65718a; font-size: 12px; }
.empty-state { grid-column: 1/-1; padding: 46px 20px; text-align: center; color: var(--muted); background: rgba(255,255,255,.62); border: 1px dashed #d6dce8; border-radius: 18px; }
.loader { width: 22px; height: 22px; margin: 0 auto 12px; border: 2px solid #e3e7ef; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bottom-nav { display: none; }
dialog { color: var(--text); }
.login-dialog,.detail-dialog { padding: 0; border: 0; background: transparent; }
.login-dialog::backdrop,.detail-dialog::backdrop { background: rgba(21,29,48,.48); backdrop-filter: blur(10px); }
.login-card { width: min(420px,calc(100vw - 30px)); padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 28px 80px rgba(31,48,87,.2); }
.login-logo { width: 58px; height: 58px; margin-bottom: 24px; border-radius: 13px; box-shadow: 0 10px 28px rgba(30,112,192,.22); }
.login-card h2 { margin-bottom: 10px; font-size: 25px; }
.login-card>label:not(.remember-row) { display: grid; gap: 7px; margin-top: 22px; color: #56627a; font-size: 13px; }
.login-card input[type="password"] { width: 100%; padding: 13px 14px; color: var(--text); background: #f8f9fc; border: 1px solid #dce2ee; border-radius: 11px; outline: 0; }
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49,94,233,.1); }
.remember-row { display: flex; align-items: center; gap: 8px; margin: 13px 0 3px; color: #65718a; font-size: 13px; }
.remember-row input { accent-color: var(--blue); }
.primary-button { width: 100%; margin-top: 10px; padding: 13px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(135deg,var(--blue),var(--violet)); font-weight: 850; cursor: pointer; }
.error-text { min-height: 17px; margin: 7px 0 0; color: var(--red); font-size: 12px; }
.detail-dialog { width: min(760px,100vw); max-width: none; height: 100%; max-height: none; margin: 0 0 0 auto; }
.detail-sheet { min-height: 100%; padding: 34px; background: #f7f8fc; border-left: 1px solid var(--line); box-shadow: -20px 0 55px rgba(31,48,87,.13); }
.close-button { float: right; width: 39px; height: 39px; border-radius: 11px; font-size: 22px; }
.detail-header { padding: 29px 0 23px; }
.detail-header h2 { margin: 6px 0 7px; font-size: 27px; }
.detail-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 16px 0; }
.detail-box { padding: 13px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.detail-box span { color: var(--muted); font-size: 11px; }
.detail-box strong { display: block; margin-top: 5px; font-size: 12px; }
.timeline { margin-top: 23px; padding: 17px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.timeline svg { width: 100%; height: 180px; margin-top: 12px; overflow: visible; }
.chart-line { fill: none; stroke: var(--blue); stroke-width: 2.5; }
.chart-grid { stroke: #e7eaf1; stroke-width: 1; }
.chart-empty { padding: 34px; color: var(--muted); text-align: center; font-size: 11px; }
.evidence-box { margin-top: 12px; padding: 14px; color: #526079; background: #f5f7fb; border-radius: 12px; font: 9px/1.65 ui-monospace,SFMono-Regular,Menlo,monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 28px; transform: translate(-50%,20px); padding: 11px 16px; opacity: 0; pointer-events: none; color: #fff; background: #25335c; border-radius: 11px; font-size: 11px; font-weight: 750; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width:900px) { .topbar { grid-template-columns: 1fr auto; } .clock-strip { grid-column: 1/-1; grid-row: 2; justify-self: center; } }
@media (max-width:760px) {
  .topbar { min-height: 62px; padding: 9px 14px; gap: 7px; }
  .brand-logo { width: 38px; height: 38px; } .brand strong { font-size: 17px; } .brand small,.system-state { display: none; }
  .clock-strip { width: 100%; justify-content: center; padding: 7px 8px; font-size: 11px; }
  .sound-toggle b { display: none; }
  .shell { width: min(100% - 26px,620px); padding-top: 27px; padding-bottom: 105px; }
  .system-grid,.metrics { grid-template-columns: repeat(2,1fr); }
  .system-card,.metric-card { min-height: 108px; padding: 15px; }
  .system-card strong,.metric-card strong { font-size: 21px; }
  .performance-strip { grid-template-columns: 1fr auto; gap: 7px 14px; }
  .performance-strip p { grid-column: 1/-1; grid-row: 2; text-align: left; font-size: 14px; }
  .performance-strip small { grid-column: 2; grid-row: 1; }
  .toolbar { align-items: stretch; flex-wrap: wrap; } .segmented { flex: 1 1 100%; }
  .select-wrap { flex: 1; } .select-wrap select { width: 100%; } .league-select { margin-left: 0; }
  .signal-list,.bankroll-grid,.history-list { grid-template-columns: 1fr; }
  .ledger-grid { grid-template-columns: repeat(2,1fr); }
  .outcome-strip { grid-template-columns: repeat(5,minmax(62px,1fr)); overflow-x: auto; }
  .history-toolbar { display: grid; grid-template-columns: 1fr; }
  .bottom-nav { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: max(12px,env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5,1fr); padding: 8px; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 19px; box-shadow: 0 18px 50px rgba(31,48,87,.16); backdrop-filter: blur(18px); }
  .nav-item { display: grid; gap: 2px; place-items: center; padding: 5px 0; color: #65718a; background: transparent; border: 0; text-decoration: none; font-size: 11px; }
  .nav-item span { font-size: 16px; } .nav-item.active { color: var(--blue); }
  .detail-dialog { width: 100%; height: 92%; margin-top: auto; }
  .detail-sheet { padding: 22px 18px 39px; border-top: 1px solid var(--line); border-left: 0; border-radius: 24px 24px 0 0; }
  .detail-header h2 { font-size: 22px; } .detail-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width:760px) { .hero-title img { width: 40px; height: 40px; } .history-summary { align-items: flex-start; flex-direction: column; } .history-entry { align-items: flex-start; flex-direction: column; } .hero-actions { align-items: flex-end; flex-direction: column-reverse; } .history-top-link { padding: 9px 11px; font-size: 12px; } }
@media (max-width:390px) { .clock-strip { gap: 7px; } .clock-strip span { font-size: 11px; } .flag-icon { width: 20px; height: 11px; } }
@media (prefers-reduced-motion:reduce) { * { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
