/* CraftBot visual skin. No DOM, data, routing or interaction changes.
   Text safeguards and semantic table row states are controlled by the original component styles. */
html:root {
  --cb-bg:#f5f5f7;
  --cb-surface:#fff;
  --cb-text:#1d1d1f;
  --cb-muted:#62666e;
  --cb-blue:#007aff;
  --cb-blue-deep:#0062cc;
  --cb-blue-soft:#edf5ff;
  --cb-border:#dce1e8;
  --cb-radius:14px;
  --cb-shadow:0 2px 8px rgba(26,34,47,.035),0 12px 32px rgba(26,34,47,.035);
  --cb-font:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  --blue:var(--cb-blue-deep); --dark:var(--cb-text); --ink:var(--cb-text);
  --page:var(--cb-bg); --canvas:var(--cb-bg); --paper:var(--cb-surface);
  --muted:var(--cb-muted); --line:var(--cb-border);
  --catalog-bg:var(--cb-bg); --catalog-text:var(--cb-text);
  --catalog-muted:var(--cb-muted); --catalog-border:var(--cb-border);
  --catalog-blue:var(--cb-blue-deep); --catalog-blue-dark:#0058b8;
  --catalog-shadow:var(--cb-shadow);
  --retro-blue:var(--cb-blue-deep); --retro-navy:var(--cb-text);
  --retro-text:#333740; --retro-muted:var(--cb-muted);
  --retro-line:var(--cb-border); --retro-panel:#f7f8fa;
  color-scheme:light;
}
html body {
  background:var(--cb-bg); color:var(--cb-text); font-family:var(--cb-font);
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
body :is(button,input,select,textarea) { font-family:var(--cb-font); }
/* Keep legacy header backgrounds and link colours paired in their original templates. */
body .hdr { font-family:var(--cb-font); }
body :is(h1,h2,h3) { font-weight:650; letter-spacing:-.022em; }
body :is(button,input,select,textarea,a,summary):focus-visible {
  outline:3px solid #80b9ff; outline-offset:3px;
}
body :is(input[type=checkbox],input[type=radio],input[type=range]) { accent-color:var(--cb-blue-deep); }
body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]):not([type=button]):not([type=submit]),
body select, body textarea {
  border-color:#cdd3dc; border-radius:9px; background-color:#fff; color:var(--cb-text);
  transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease;
}
body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]):focus,
body select:focus,body textarea:focus {
  border-color:var(--cb-blue); box-shadow:0 0 0 3px rgba(0,122,255,.12);
}
body input::placeholder,body textarea::placeholder { color:#767b84; opacity:1; }
body :is(input,select,textarea):disabled { background-color:#f0f1f4!important; color:#777c85!important; cursor:not-allowed; }
body :is(.btn,.topup-button,.catalog-add,.strategy-open,.constructor-examples-link,.excel-action) {
  box-sizing:border-box; border-radius:9px; font-weight:600; line-height:1.4;
  text-decoration:none; transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease;
}
body :is(.btn-blue,.catalog-add,.constructor-examples-link,.excel-action.retro-repeat-button) {
  background:var(--cb-blue-deep); color:#fff; border-color:var(--cb-blue-deep);
  box-shadow:0 2px 4px rgba(0,89,190,.10);
}
body :is(.btn-blue,.catalog-add,.constructor-examples-link,.excel-action.retro-repeat-button):hover:not(:disabled) {
  background:#0055b8; color:#fff; transform:none;
}
body .btn-green { background:#208146; color:#fff; }
body .btn-red { background:#c93538; color:#fff; }
body .btn-gray { background:#626a76; color:#fff; }
body :is(button,.btn):disabled { box-shadow:none; }

/* Shared working surfaces stay opaque: no blur on forms, tables or prices. */
body :is(.card,.panel,.scoreboard,.timeline,.archive-panel,.balance-panel,.strategy-card,
  .catalog-hero,.catalog-sort,.metric-card,.strategy-panel,.summary-card,
  .stars-payment-option,.star-admin-order,.empty,.page-description,.date-nav,
  .sd-page,.sd-metric,.sd-series-card,.saved-strategy-card,.maintenance,.login-card,
  .constructor-examples,.start-card,.lesson-viewer,.faq-list details,.glossary-button) {
  border-color:var(--cb-border); border-radius:var(--cb-radius);
  background:#fff; box-shadow:var(--cb-shadow);
}
body .page-description { border-left:1px solid var(--cb-border); }
body .page-description h1 { color:var(--cb-text); }
body .page-description p,body .catalog-lead { color:var(--cb-muted); }
body .catalog-hero::before,body .catalog-hero::after { opacity:.35; }
body .report-ribbon { background:#e9eef5; color:#4e5969; letter-spacing:.025em; }
body .strategy-panel { background:#f9fafc; box-shadow:none; }
body .metric-card { border-top-width:3px; box-shadow:none; }
body .stats .stat:has(.l > [title]) { padding-bottom:28px; }
body :is(.metric-value,.balance-value,.score-cell,.odds-grid strong,.clock,.res-odds,td) {
  font-variant-numeric:tabular-nums;
}
body :is(.hint,.balance-sub,.balance-note,.update-note,.catalog-sort-note) { color:var(--cb-muted); }
body :is(.msg,.error,.catalog-notice,.guest-constructor-note) { border-radius:10px; }

/* Keep the table markup and column order. Scroll stays on each existing wrapper. */
body table { border-color:var(--cb-border); }
body table th { background:#f2f4f7; color:#4f5967; font-weight:600; letter-spacing:normal; }
body table td { border-bottom-color:#e9ecf1; }
body :is(.table-wrap,.table-scroll,.league-scroll,.archive-table-wrap,.signals-table-wrap,
  .retro-table-wrap,.account-table-wrap,.table-responsive) {
  max-width:100%; min-width:0; overflow-x:auto; overscroll-behavior-x:contain;
}
body :is(.wrap,.catalog-shell,.history-wrap,.balance-page,.account-shell,.account-main,
  .panel,.card,.balance-panel) { min-width:0; box-sizing:border-box; }
body .table-wrap table,body .table-scroll table { margin-bottom:0; }
/* Legacy signal pages have no table wrapper; keep their cells and order intact. */
body:not(:has(.site-header)) .card > table { display:block; max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }

/* Existing navigation states and filter semantics, with one blue accent. */
body :is(.sport-btn,.sport-tab,.catalog-tab,.date-button,.today-button,.summary-chip,
  .catalog-sort-options,.catalog-sort-button,.strategy-pagination a,.strategy-pagination span) {
  border-radius:9px; font-weight:600;
}
body :is(.sport-btn,.sport-tab,.catalog-tab):not(.active):not(.is-active):not(.catalog-history-tab) {
  background:#fff; border-color:var(--cb-border); color:#4d5766; box-shadow:none;
}
body :is(.sport-btn.active,.sport-tab.active,.catalog-tab.is-active:not(.catalog-history-tab)) {
  background:var(--cb-blue-soft); color:#0056b8; border-color:#a7ccf7; box-shadow:none;
}
body .catalog-sort-options { background:#eef0f4; border-color:transparent; }
body .catalog-sort-button[aria-pressed=true] { background:#fff; color:#0056b8; box-shadow:0 1px 4px #18233a18; }
body .date-button,body .today-button { background:#f7f8fa; border-color:var(--cb-border); color:#394454; }
body .league { border-color:var(--cb-border); border-radius:12px; box-shadow:0 2px 7px #18233a05; }
body .league-head { background:#edf4f0; border-bottom-color:#dde8e1; }
body .league-name { font-weight:650; }
body .res-head { letter-spacing:normal; }
body .wrap > div:has(> a[href^="/scanner?sport="]) { flex-wrap:wrap; }
body .shot { width:calc(100% - 38px); max-width:min(520px,calc(100% - 38px)); height:auto; box-sizing:border-box; }

/* Match details: retain compact timeline, scores and all price columns. */
body .history-wrap :is(.scoreboard,.timeline,.panel,.archive-panel) { padding:12px; }
body .history-wrap .odds-grid>div { background:#f7f8fa; border-color:#e5e8ee; border-radius:8px; }
body .history-wrap .goal-averages-panel button { border-width:1px; border-radius:7px; }

/* Dialog layout/visibility is still controlled by the original scripts. */
body :is(.retro-dialog,.odds-history-dialog,.catalog-guide-dialog,.topup-dialog,.stars-confirm-dialog) {
  border-radius:18px; border-color:#dce1e8; background:#fff;
  box-shadow:0 20px 70px rgba(20,28,42,.20); font-family:var(--cb-font);
}
body #retro_modal { font-family:var(--cb-font); --rp-navy:var(--cb-text); --rp-text:#394454; --rp-muted:var(--cb-muted); --rp-line:var(--cb-border); }
body #retro_modal .retro-dialog { border-radius:18px; box-shadow:0 20px 70px rgba(20,28,42,.20); }
body :is(.retro-close,.odds-history-close,.catalog-guide-close) { border-radius:50%; background:#f0f2f5; }
body :is(.retro-header,.odds-history-header,.catalog-guide-head) { border-bottom-color:var(--cb-border); }
body .topup-dialog { font-family:var(--cb-font); }
body .modal-bg .modal {
  box-sizing:border-box; max-width:calc(100vw - 24px); border-radius:18px;
  background:#fff; box-shadow:0 20px 70px rgba(20,28,42,.20); font-family:var(--cb-font);
}
body #cb-stars-confirm {
  font-family:var(--cb-font); color:var(--cb-text); border-color:var(--cb-border);
  box-shadow:0 20px 70px rgba(20,28,42,.20);
}
body #cb-stars-confirm h2 { color:var(--cb-text); font-weight:650; }
body #cb-stars-confirm .cbsc-kicker { letter-spacing:.025em; color:var(--cb-muted); }
body #cb-stars-confirm :is(.cbsc-note,.cbsc-price-label) { color:var(--cb-muted); }
body #cb-stars-confirm .cbsc-price-row { background:var(--cb-blue-soft); border-color:#d7e7fa; }
body #cb-stars-confirm .cbsc-price { color:var(--cb-blue-deep); }
body #cb-stars-confirm .cbsc-accept { background:var(--cb-blue-deep); border-color:var(--cb-blue-deep); box-shadow:none; }
body #cb-stars-confirm .cbsc-cancel { border-color:var(--cb-border); color:#4d5766; }

/* Reading pages use the same surfaces without changing their contents. */
/* Telegram setup steps contain long inline examples, not ordinary prose. */
body[data-i18n-page="site"] .card:has(.step-num) code { overflow-wrap:anywhere; }
body.guide-page .intro-heading { padding-top:30px; }
body.guide-page .lesson-section { margin-top:42px; padding-top:30px; }
body.guide-page .start-card:hover { transform:none; box-shadow:0 4px 15px rgba(26,34,47,.08); }
body.guide-page :is(.eyebrow,.nav-label,.card-kicker) { letter-spacing:.025em; }

@media(max-width:700px) {
  body .wrap { max-width:100%; }
  body :is(.card,.balance-panel) { padding-left:14px; padding-right:14px; }
  body :is(.catalog-title,.report-heading h1,.balance-page h1) { font-size:25px; line-height:1.2; }
  body :is(.btn,.catalog-add,.strategy-open,.excel-action,.constructor-examples-link) {
    max-width:100%; white-space:normal; text-align:center;
  }
  body :is(.catalog-hero,.strategy-panel) { gap:14px; }
  body :is(.catalog-hero-copy,.catalog-hero-actions,.report-heading,.excel-panel,.range2) { min-width:0; }
  body .range2 > input,body .range2 > select { min-width:0; }
  body .history-top { flex-wrap:wrap; }
  body .history-top-actions { flex-wrap:wrap; }
  body .history-wrap :is(.panel,.timeline,.scoreboard,.archive-panel) { padding:10px; }
  body .history-wrap h1 { grid-template-columns:minmax(0,1fr) 70px minmax(0,1fr); }
  body.guide-page > .site-header { position:static; }
  body.guide-page .sidebar-inner { top:12px; }
  html:has(body.guide-page) { scroll-padding-top:12px; }
  body.guide-page .lesson-section { margin-top:32px; padding-top:24px; }
  body.guide-page .first-tip { flex-wrap:wrap; }
  body.guide-page .first-tip>a { display:inline-flex; }
}
@media(max-width:600px) {
  body .hdr { flex-wrap:wrap; gap:10px; padding:14px 16px; }
  body #scanner_filters_form .filters-grid { grid-template-columns:minmax(0,1fr); }
  body #scanner_filters_form .filters-grid > div { grid-column:1 / -1!important; }
  body :is(.wrap,.catalog-shell,.balance-page) { margin-top:16px; }
  body :is(.filters-grid,.metrics-grid,.balance-grid) > * { min-width:0; }
  body :is(input,select,textarea):not([type=hidden]):not([type=range]):not([type=checkbox]):not([type=radio]) { font-size:16px; }
  body :is(.date-button,.today-button,.sport-btn,.sport-tab,.catalog-tab,.btn,.topup-button,.strategy-open) { min-height:40px; }
  body .catalog-sort-options { flex-wrap:wrap; }
  body .catalog-hero-actions { align-items:flex-start; }
  body .report-ribbon { flex-wrap:wrap; }
}
@media(prefers-reduced-motion:reduce) {
  body *,body *::before,body *::after { transition-duration:.001ms!important; animation-duration:.001ms!important; animation-iteration-count:1!important; scroll-behavior:auto!important; }
}
