/* Shared Oddsmatcha theme. Keep app-specific layouts in each app's stylesheet. */
:root {
  color-scheme: light;
  --om-theme-primary: #1f8d37;
  --om-theme-primary-hover: #176b2a;
  --om-theme-text: #061a2b;
  --om-theme-text-soft: #10283d;
  --om-theme-muted: #58606c;
  --om-theme-page: #f4f8f1;
  --om-theme-surface: #ffffff;
  --om-theme-surface-tint: #f1f7ef;
  --om-theme-border: #d7e3d2;
  --om-theme-control-border: #ccd2c5;
  --om-theme-control-bg: #fbfcf8;
  --om-theme-table-head: #ecefe6;
  --om-theme-table-hover: #f7faf5;
  --om-theme-focus: #70b87b;
  --om-theme-radius: 8px;
  --om-theme-control-radius: 6px;
  --om-theme-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-om-theme="ocean"] {
  --om-theme-primary: #2458a6;
  --om-theme-primary-hover: #193e78;
  --om-theme-text: #10233b;
  --om-theme-text-soft: #243c5c;
  --om-theme-muted: #526477;
  --om-theme-page: #f1f5fa;
  --om-theme-surface: #fff;
  --om-theme-surface-tint: #eaf1fa;
  --om-theme-border: #cedbeb;
  --om-theme-control-border: #b9cadd;
  --om-theme-control-bg: #f8fbff;
  --om-theme-table-head: #e4ecf5;
  --om-theme-table-hover: #f1f6fc;
  --om-theme-focus: #7ba4d9;
}

:root[data-om-theme="sand"] {
  --om-theme-primary: #92552d;
  --om-theme-primary-hover: #6c3b1e;
  --om-theme-text: #30241c;
  --om-theme-text-soft: #49372a;
  --om-theme-muted: #6d5d50;
  --om-theme-page: #f8f4ec;
  --om-theme-surface: #fffefa;
  --om-theme-surface-tint: #f5ebdc;
  --om-theme-border: #e3d6c6;
  --om-theme-control-border: #d5c5b2;
  --om-theme-control-bg: #fffaf3;
  --om-theme-table-head: #eee5d8;
  --om-theme-table-hover: #fbf5ec;
  --om-theme-focus: #c18c60;
}

/* OddsMonkey-inspired palette, available to all supported tools. */
:root[data-om-theme="monkey"] {
  color-scheme: light;
  --om-theme-primary: #1479c9;
  --om-theme-primary-hover: #0d5f9f;
  --om-theme-text: #1f2340;
  --om-theme-text-soft: #313c5c;
  --om-theme-muted: #5b6785;
  --om-theme-page: #f2faff;
  --om-theme-surface: #fff;
  --om-theme-surface-tint: #e8f5ff;
  --om-theme-border: #d8e9f6;
  --om-theme-control-border: #bfd6e8;
  --om-theme-control-bg: #fff;
  --om-theme-table-head: #e8f5ff;
  --om-theme-table-hover: #f6fbff;
  --om-theme-focus: #36a4f7;
  --om-theme-radius: 12px;
  --om-theme-control-radius: 8px;
}

:root[data-om-theme="dark"] {
  color-scheme: dark;
  --om-theme-primary: #176f3c;
  --om-theme-primary-hover: #20854b;
  --om-theme-text: #e6f2e9;
  --om-theme-text-soft: #d4e7d9;
  --om-theme-muted: #aec1b3;
  --om-theme-page: #080d0a;
  --om-theme-surface: #121b15;
  --om-theme-surface-tint: #1a2a1f;
  --om-theme-border: #304b38;
  --om-theme-control-border: #496550;
  --om-theme-control-bg: #101a13;
  --om-theme-table-head: #1c3022;
  --om-theme-table-hover: #192a1e;
  --om-theme-focus: #75d895;
  --om-positive: #8fe1a7;
  --om-negative: #ff9999;
  --om-outcome-card-bg: #1a3020;
  --om-summary-card-bg: #1a3020;
  --success: #8fe1a7;
  --danger: #ff9999;
}

/* Existing tools have local component styles; keep dark surfaces and text legible. */
:root[data-om-theme="dark"] body { color: var(--om-theme-text); background: var(--om-theme-page); }
:root[data-om-theme="dark"] :is(.workspace-header, .profile-menu, .home-panel, .auth-panel, .tool-frame, .filter-panel, .stake-panel, .table-container, .mobile-match-card, .feed-section, .admin-panel, .stat-card, .match-dialog, .blacklist-dialog, .modal-header, .modal-footer, .blacklist-body, .match-detail, .summary-section div, .outcome-section, .tableWrap, .resultRun, .userChip, .preseedPickerItem, .table-shell, .drawer, .stats > div, .empty-panel, .error-panel, .resultLinksDialog, .userSettingsDialog, .resultAlertDialog, .sharePreviewDialog, .changeMessagesDialog) {
  background: var(--om-theme-surface);
  color: var(--om-theme-text);
  border-color: var(--om-theme-border);
}
:root[data-om-theme="dark"] :is(.profile-button:hover, .profile-button[aria-expanded="true"], .modal-body, .mobile-match-header, .stakeToolbar, .detailModeBar, .cacheCalculatorOptions, .bookmakerLinkCard, .marketLinkRow, .fixturePicker, .search, .filters select) {
  background: var(--om-theme-surface-tint);
  color: var(--om-theme-text);
  border-color: var(--om-theme-border);
}
:root[data-om-theme="dark"] :is(.tool-tab[aria-current="page"], .mode-control button[aria-pressed="true"], .stakeToolbar button.active, .detailModeBar button.active) {
  background: var(--om-theme-primary);
  border-color: var(--om-theme-primary);
  color: #fff;
}
:root[data-om-theme="dark"] :is(.profile-avatar, .button.primary) { background: var(--om-theme-primary); color: #fff; }
:root[data-om-theme="dark"] .workspace-brand { background: #e8f5ea; }
:root[data-om-theme="dark"] :is(.button.secondary, .btn-secondary, .refresh-btn, .blacklist-btn, .close-btn, .log-btn, .admin-btn, .clear-btn, .sign-out-link, .assign-lay-btn, .stakeToolbar button, .detailModeBar button, .resultActionButton, .dialogHead button, .button.subtle, .filter-pill, .letters button) {
  background: var(--om-theme-surface-tint);
  color: var(--om-theme-text);
  border-color: var(--om-theme-control-border);
}
:root[data-om-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  background: var(--om-theme-control-bg);
  color: var(--om-theme-text);
  border-color: var(--om-theme-control-border);
}
:root[data-om-theme="dark"] :is(input, textarea)::placeholder { color: #9eb1a3; opacity: 1; }
:root[data-om-theme="dark"] input:disabled { background: var(--om-theme-surface-tint) !important; color: var(--om-theme-muted) !important; }
:root[data-om-theme="dark"] input.calculator-input[readonly] { background: var(--om-theme-surface-tint) !important; color: var(--om-theme-muted) !important; }
:root[data-om-theme="dark"] :is(label, .fixtureField, .status-message, .results-info, .filter-content span, .active-filters, .team-names span, .no-data, .match-detail span, .summary-section span, .admin-search label, .admin-stage label, .admin-stage h3, .money-input span, .blacklist-help, .blacklist-item, .odds-section h4, .summary, .cacheTable small, .detailRefreshStatus, .cacheCalculatorOptions span, .muted, .table-note) { color: var(--om-theme-muted); }
:root[data-om-theme="dark"] :is(th, .data-table th, .table-shell th) { background: var(--om-theme-table-head); color: var(--om-theme-text); border-color: var(--om-theme-border); }
:root[data-om-theme="dark"] :is(td, .table-shell td, .odds-table, .modal-footer, .modal-header) { border-color: var(--om-theme-border); }
:root[data-om-theme="dark"] .table-shell td { color: var(--om-theme-text-soft); }
:root[data-om-theme="dark"] :is(tbody tr:hover, .table-shell tr.clickable:hover td) { background: var(--om-theme-table-hover); }
:root[data-om-theme="dark"] :is(.lay-stake-cell, .mobile-lay-stake, .positive, [data-tone="positive"]) { color: #8fe1a7; }
:root[data-om-theme="dark"] :is(.negative, [data-tone="negative"]) { color: #ff9999; }
:root[data-om-theme="dark"] :is(a:not(.btn):not(.button):not(.tool-tab):not(.exchange-link), .link-button, .bet-section h3) { color: #8fe1a7; }
:root[data-om-theme="dark"] :is(.mode-control button, .tabButton) { background: var(--om-theme-surface-tint); color: var(--om-theme-text); }
:root[data-om-theme="dark"] .tabButton.active { background: var(--om-theme-primary); color: #fff; }
:root[data-om-theme="dark"] .sidebar { background: #080d0a; }
:root[data-om-theme="dark"] :is(.nav-item:hover, .nav-item.active) { background: var(--om-theme-surface-tint); color: var(--om-theme-text); }
:root[data-om-theme="dark"] :is(.nav-item small, .sidebar-foot a) { color: var(--om-theme-muted); }
:root[data-om-theme="dark"] :is(.stats .good, .status.on) { color: #8fe1a7; }
:root[data-om-theme="dark"] :is(.toggle, .setting-button) { background: var(--om-theme-surface-tint); border-color: var(--om-theme-control-border); color: var(--om-theme-text); }
:root[data-om-theme="dark"] :is(.toggle.selected, .setting-button.on) { background: #203f2b; color: #a9edbd; }
:root[data-om-theme="dark"] :is(.notice, .preseedScopeBox, .checkOption, .scanProgress, .howItWorks, .adminSettingsHeader, .preseedSiteCard, .alertBlacklistMatch, .userBookieOption, .userAlertItem, .chatBubble.assistant) { background: var(--om-theme-surface-tint); border-color: var(--om-theme-border); color: var(--om-theme-text); }
:root[data-om-theme="dark"] :is(.infoTooltip, .profitRangeInline, .linkId) { background: var(--om-theme-surface-tint); color: var(--om-theme-text); border: 1px solid var(--om-theme-border); }
:root[data-om-theme="dark"] .marketLinkButton { background: var(--om-theme-primary); color: #fff !important; }
:root[data-om-theme="dark"] :is(.howItWorks h3, .howItWorks ul, .notice p, .admin-actions-note, .empty, .empty-state, .drawer-help, .preseedSiteCard small, .userIdentity small, .resultBackValue span) { color: var(--om-theme-muted); }
:root[data-om-theme="dark"] :is(.shell p, .scanProgress small, .seededSummary, .moneyInput b) { color: var(--om-theme-muted); }
:root[data-om-theme="dark"] :is(.money-input input, .moneyInput input, .search input) { background: transparent; }
:root[data-om-theme="dark"] #root [bgcolor][bordercolor] { background: var(--om-theme-surface) !important; border-color: var(--om-theme-border) !important; color: var(--om-theme-text); }
:root[data-om-theme="dark"] #root [bgcolor][bordercolor] :is(.sc-kNOymR, [style*="background-color: rgb(245, 237, 204)"], [style*="background-color: rgb(214, 245, 214)"]) { background: var(--om-theme-surface-tint) !important; border-color: var(--om-theme-border) !important; color: var(--om-theme-text); }
:root[data-om-theme="dark"] #root [bgcolor][bordercolor] [style*="color: rgb(0, 0, 0)"] { color: var(--om-theme-text) !important; }
/* Colour classes in the current generated Bet365 calculator bundle. */
:root[data-om-theme="dark"] #root .gKOzmz { color: #8fe1a7; }
:root[data-om-theme="dark"] #root .hMOEyH { color: #ff9999; }

.om-appearance { position: fixed; left: 12px; bottom: 12px; z-index: 1000; font: 14px var(--om-theme-font); color: var(--om-theme-text); }
.om-appearance summary { cursor: pointer; list-style: none; padding: 8px 12px; background: var(--om-theme-surface); border: 1px solid var(--om-theme-border); border-radius: 6px; font-weight: 700; box-shadow: 0 2px 10px #0002; }
.om-appearance summary::-webkit-details-marker { display: none; }
.om-appearance-panel { position: absolute; bottom: calc(100% + 8px); left: 0; width: min(280px, calc(100vw - 24px)); padding: 14px; background: var(--om-theme-surface); border: 1px solid var(--om-theme-border); border-radius: 8px; box-shadow: 0 8px 28px #0003; }
.om-appearance-panel label { display: grid; gap: 5px; margin-bottom: 12px; color: var(--om-theme-text); font-weight: 700; font-size: 13px; }
.om-appearance-panel [hidden] { display: none; }
.om-appearance-panel select { width: 100%; min-height: 38px; padding: 7px; border: 1px solid var(--om-theme-control-border); border-radius: 6px; background: var(--om-theme-control-bg); color: var(--om-theme-text); font: inherit; }
.om-appearance-panel button { padding: 8px 10px; border: 1px solid var(--om-theme-border); border-radius: 6px; background: var(--om-theme-surface-tint); color: var(--om-theme-text); font: inherit; cursor: pointer; }
.om-appearance-panel small { display: block; margin-top: 10px; color: var(--om-theme-muted); font-size: 12px; line-height: 1.4; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--om-theme-focus);
  outline-offset: 2px;
}
