/* Telegram is an account setting, with its own navigation and theme surfaces. */
#side-menu-content.has-telegram-page { width:420px !important; max-width:100vw !important; }
.tg-page { height:100%; min-height:0; display:flex; flex-direction:column; --tg-bg:#fff; --tg-surface:#f3f5f8; --tg-ink:#172338; --tg-muted:#526179; --tg-line:#dce2e9; --tg-accent:#2459c4; --tg-success:#087650; background:var(--tg-bg); color:var(--tg-ink); color-scheme:light; }
.tg-page[hidden] { display:none; }
body.dark-mode:not(.fun-mode) .tg-page,
body.is-lucky-mode:not(.fun-mode) .tg-page { --tg-bg:#151c29; --tg-surface:#202a39; --tg-ink:#f0f4fa; --tg-muted:#b0bdd0; --tg-line:#354155; --tg-accent:#a8c8ff; --tg-success:#8ce1b9; color-scheme:dark; }
.tg-page-header { display:flex; align-items:center; justify-content:space-between; padding:12px 20px; border-bottom:1px solid var(--tg-line); }
.tg-icon-button { display:inline-flex; gap:7px; align-items:center; min-height:44px; padding:6px; background:none; color:var(--tg-muted); border:0; cursor:pointer; font:inherit; }
.tg-icon-button:last-child { font-size:26px; min-width:44px; justify-content:center; }
.tg-page-body { overflow-y:auto; overscroll-behavior:contain; padding:26px 24px; scrollbar-color:var(--tg-line) transparent; }
.tg-page h2 { margin:0; font-size:24px; line-height:1.3; font-weight:700; letter-spacing:-.02em; color:var(--tg-ink); }
.tg-settings { font-family:var(--font-sans,system-ui); font-size:14px; line-height:1.6; text-align:start; }
.tg-settings * { box-sizing:border-box; }
.tg-page, .tg-page * { text-shadow:none; }
.tg-intro { color:var(--tg-muted); margin:8px 0 26px; }
.tg-feedback { margin:0; color:var(--tg-muted); overflow-wrap:anywhere; }
.tg-feedback:empty { display:none; }
.tg-feedback:not(:empty) { padding:12px 0; }
.tg-feedback[data-state=success] { color:var(--tg-success); }
.tg-feedback[data-state=error] { color:#b8323e; }
body.dark-mode .tg-feedback[data-state=error] { color:#ffb7be; }
.tg-connection { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.tg-section-title { display:block; font-size:14px; line-height:1.5; font-weight:650; margin:0; color:var(--tg-ink); }
.tg-connection-state { font-size:13px; color:var(--tg-muted); margin:3px 0 0; }
.tg-state { display:inline-flex; align-items:center; gap:6px; color:var(--tg-muted); font-size:12px; white-space:nowrap; }
.tg-state::before { content:''; width:6px; height:6px; background:currentColor; border-radius:50%; }
.tg-state[data-connected=true] { color:var(--tg-success); }
.tg-help { display:block; color:var(--tg-muted); font-size:12px; line-height:1.7; font-weight:400; margin:6px 0 0; }
.tg-actions { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0 24px; }
.tg-button { appearance:none; min-height:42px; padding:9px 14px; border:1px solid var(--tg-line); border-radius:8px; background:var(--tg-bg); color:var(--tg-ink); font:inherit; font-size:13px; font-weight:600; cursor:pointer; transition:background .15s; }
.tg-button:hover { background:var(--tg-surface); }
.tg-button-quiet { border-color:transparent; color:var(--tg-muted); }
.tg-button-primary { background:#2459c4; border-color:#2459c4; color:#fff; }
.tg-button-primary:hover { background:#194aa9; }
.tg-button-danger { border:0; background:none; padding-inline:0; color:var(--tg-muted); font-weight:500; }
.tg-button:disabled { opacity:.55; cursor:wait; }
.tg-link { display:block; color:var(--tg-accent); font-size:13px; margin-bottom:20px; text-decoration:underline; text-underline-offset:3px; }
.tg-toggle-row { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:22px 0 16px; border-top:1px solid var(--tg-line); cursor:pointer; }
.tg-toggle-copy { min-width:0; }
.tg-settings input.tg-switch { appearance:none !important; -webkit-appearance:none !important; position:relative; width:38px !important; height:23px !important; min-width:38px; margin:0 !important; padding:0 !important; border:1px solid var(--tg-muted) !important; border-radius:12px !important; background:var(--tg-surface) !important; box-shadow:none !important; cursor:pointer; }
.tg-switch::after { content:''; position:absolute; width:15px; height:15px; border-radius:50%; top:3px; left:3px; background:var(--tg-muted); transition:transform .15s; }
.tg-settings input.tg-switch:checked { background:#2459c4 !important; border-color:#2459c4 !important; }
.tg-switch:checked::after { transform:translateX(15px); background:#fff; }
.tg-switch:disabled { opacity:.45; cursor:not-allowed; }
.tg-field-label { display:block; font-size:12px; font-weight:600; color:var(--tg-muted); margin-bottom:8px; }
.tg-subscriptions { margin-bottom:24px; }
.tg-subscriptions[hidden],.tg-instruments[hidden] { display:none !important; }
.tg-segmented { display:flex; gap:4px; padding:4px; background:var(--tg-surface); border-radius:9px; }
.tg-mode-button { flex:1; min-width:0; min-height:40px; padding:8px; font:inherit; font-size:12px; font-weight:600; background:transparent; border:0; border-radius:6px; color:var(--tg-muted); cursor:pointer; }
.tg-mode-button[aria-pressed=true] { background:var(--tg-bg); color:var(--tg-ink); box-shadow:0 1px 3px rgba(0,0,0,.08); }
.tg-instruments { border:0; padding:0; margin:18px 0 0; display:grid; grid-template-columns:1fr 1fr; gap:0 12px; min-width:0; }
.tg-instrument { display:flex; align-items:center; gap:8px; min-height:44px; font-size:13px; color:var(--tg-ink); cursor:pointer; }
.tg-instrument input { width:17px; height:17px; margin:0; accent-color:#2459c4; flex-shrink:0; }
.tg-budget { margin:2px 0 20px; }
.tg-amount-wrap { display:flex; align-items:center; background:var(--tg-surface); border:1px solid var(--tg-line); border-radius:8px; padding-right:14px; }
.tg-settings input.tg-amount { width:100% !important; min-width:0; height:48px; border:0 !important; background:transparent !important; color:var(--tg-ink) !important; font:inherit; font-size:20px; font-weight:600; padding:10px 14px !important; box-shadow:none !important; border-radius:8px; font-variant-numeric:tabular-nums; }
.tg-unit { color:var(--tg-muted); font-size:12px; font-weight:600; }
.tg-rules { color:var(--tg-muted); padding:14px 0; border-top:1px solid var(--tg-line); }
.tg-rules summary { cursor:pointer; font-size:12px; min-height:24px; }
.tg-rules p { margin-top:10px; }
.tg-consent { margin:0 0 18px; }
.tg-save { width:100%; }
.tg-disconnect { margin-top:24px; border-top:1px solid var(--tg-line); padding-top:10px; }
.tg-page :is(button,input,a,summary):focus-visible { outline:2px solid var(--tg-accent) !important; outline-offset:3px; }
.tg-page ::selection { background:#2459c4; color:#fff; }
@media(max-width:440px) { #side-menu-content.has-telegram-page { width:100% !important; } .tg-page-body { padding:24px 22px calc(28px + env(safe-area-inset-bottom)); } }
@media(prefers-reduced-motion:reduce) { .tg-page * { transition:none !important; } }

/* Light-market surfaces: quiet frames, readable price hierarchy, no halos. */
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item.ev-card { padding:18px; gap:12px; height:auto; min-height:0; align-self:start; border-color:#e0e5ed !important; border-radius:14px; box-shadow:none !important; background:#fff !important; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item.ev-card:hover { border-color:#aebbd0 !important; background:#fff !important; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item.ev-card.active { background:#fff !important; border-color:#6789bd !important; box-shadow:none !important; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .ev-card-bg { display:none; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .ev-title { font-size:18px; line-height:1.45; min-height:0; font-weight:650; letter-spacing:-.01em; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .ev-time { background:#f3f5f8; border:0; padding:3px 6px; box-shadow:none !important; animation:none !important; color:#526179 !important; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .market-opt-row { border:1px solid #e3e8ef !important; background:#f7f9fc !important; padding:10px 12px; border-radius:8px; min-height:86px; gap:4px 8px; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .market-opt-row:hover { background:#edf2f8 !important; border-color:#bac7d9 !important; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .market-prob-btn { background:#f7f9fc !important; border-color:#e3e8ef !important; min-height:64px; border-radius:8px; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .market-prob-btn .prob { font:650 23px/1.3 var(--font-sans,system-ui) !important; font-variant-numeric:tabular-nums !important; color:#24364e !important; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .market-opt-row .prob { color:#24364e !important; font:650 23px/1.2 var(--font-sans,system-ui) !important; font-variant-numeric:tabular-nums !important; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .ev-opt-name { font-size:15px; font-weight:550; line-height:1.4; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .ev-opt-odds { font-size:12px; font-weight:500; color:#627087 !important; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .ev-opt-dot { width:5px; height:5px; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .ev-cta-grid { gap:8px; max-height:224px; scrollbar-width:thin; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .ev-probbar { height:4px; opacity:.8; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .ev-multibar { height:4px; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .ev-seg-pct { display:none; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .ev-legend { gap:5px 10px; font-size:12px; font-weight:450; line-height:1.5; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .ev-meta { font-size:13px; font-weight:500; margin-top:0; padding-top:10px; border-top-color:#edf0f5 !important; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .mono { font-family:var(--font-sans,system-ui); font-variant-numeric:tabular-nums; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .flash-up,
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .flash-down { animation:none !important; box-shadow:none !important; text-shadow:none !important; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .ev-badge--agent { background:#f3f5f8 !important; color:#526179 !important; border-color:#e0e5ed !important; font-size:10px; }

/* Labels span the full option width: tick deltas cannot squeeze Chinese text. */
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .market-opt-row .ev-opt-col { grid-column:1 / -1; display:contents; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .market-opt-row .ev-opt-name { grid-column:1 / -1; min-width:0; word-break:normal; overflow-wrap:anywhere; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .market-opt-row .ev-opt-odds { grid-column:1; grid-row:2; align-self:center; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .market-opt-row .prob { grid-column:2; grid-row:2; text-align:right; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .market-opt-row .odds-delta { grid-column:1 / -1; justify-self:end; font-size:11px !important; margin:0 !important; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item :is(.ev-cat,.ev-time) { font-size:13px; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .ev-group-box { margin-top:0; padding-top:10px; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .ev-group-bar { font-size:13px; }
html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .market-prob-btn { font-size:14px; }
@media(max-width:600px) {
    html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item.ev-card { padding:16px; gap:11px; }
    html body:not(.dark-mode):not(.fun-mode):not(.is-lucky-mode) .event-item .ev-title { font-size:18px; }
}
