*{box-sizing:border-box}body{margin:0;background:#f7f8fa;color:#202a34;font-family:Inter,Segoe UI,Arial,sans-serif;font-size:14px}header{height:78px;border-bottom:1px solid #e3e7ec;display:flex;align-items:center;justify-content:space-between;padding:0 4.5%;background:white}.brand{display:flex;align-items:center;gap:12px;font-size:20px;font-weight:700;letter-spacing:-.5px}.logo{background:#173d32;color:white;border-radius:10px;padding:3px 10px;font-size:30px}.tag{background:#f0f3f5;color:#677380;border:1px solid #e1e5e9;border-radius:5px;letter-spacing:1px;font-size:9px;padding:4px 6px}.readonly{font-size:12px;color:#627166}.readonly:before{content:'●';font-size:8px;margin-right:8px;color:#4a9075}main{max-width:1580px;margin:auto;padding:42px 4.5% 20px}.intro{display:flex;align-items:center;justify-content:space-between;gap:20px}.intro-actions{display:flex;flex-direction:column;align-items:flex-end;gap:7px}.intro-actions>div{display:flex;gap:8px}.intro-actions #run-now-status{min-height:15px;max-width:430px;color:#657269;font-size:10px;text-align:right}.primary-action{background:#173d32;color:#fff;border-color:#173d32}.primary-action:hover{background:#235446}.eyebrow{color:#75818b;letter-spacing:1.6px;font-size:10px;font-weight:700;margin:0 0 12px}h1{font-size:32px;letter-spacing:-1px;margin:0 0 12px;font-weight:650}h2{font-size:17px;margin:0}h3{font-size:16px}.muted{color:#7b8590;font-size:12px;line-height:1.6;margin:7px 0 0}button,select{font:inherit;background:white;border:1px solid #dce2e6;border-radius:7px;padding:10px 13px;color:#35414c}button{cursor:pointer}button:hover{background:#f1f5f3}button:disabled{cursor:wait;opacity:.65}button:focus-visible,select:focus-visible{outline:3px solid #7fbba7;outline-offset:2px}.meta{display:flex;justify-content:space-between;margin:32px 0 16px;color:#7b8590;font-size:12px}.cards{display:grid;grid-template-columns:repeat(6,1fr);gap:12px;margin-bottom:26px}.card{background:white;border:1px solid #e2e6ea;border-radius:10px;padding:19px 17px;min-height:110px}.card-label{font-size:11px;color:#75818c;line-height:1.5}.card-value{font-size:28px;letter-spacing:-.8px;margin-top:13px;font-weight:600}.card:last-child .card-value{font-size:15px;letter-spacing:0;margin-top:16px}.card-meta{margin-top:8px;color:#75818c;font-size:10px;line-height:1.4}.card.accent{background:#eff8f3;border-color:#d6e9de}.card.accent .card-value{color:#26734e}.panel{background:white;border:1px solid #e1e6e9;border-radius:11px;box-shadow:0 3px 8px #22334403;margin-bottom:24px;overflow:hidden}.panel-heading{padding:22px;display:flex;justify-content:space-between;align-items:center;gap:20px}.filters{display:flex;gap:10px}label{display:flex;flex-direction:column;gap:5px;color:#75818c;font-size:10px}select{min-width:154px;font-size:12px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;text-align:left;white-space:nowrap}th{font-size:10px;color:#77828c;letter-spacing:.3px;background:#fafbfc;padding:15px 16px;border-top:1px solid #edf0f2;border-bottom:1px solid #edf0f2;font-weight:600}td{padding:18px 16px;font-size:12px;border-bottom:1px solid #edf0f2}.number{text-align:right;font-variant-numeric:tabular-nums}.price{font-size:15px;font-weight:600}.exact-row{background:#f2faf5}.match-button{border:0;background:transparent;text-align:left;padding:0;font-weight:600;color:#263e33}.match-button:hover{text-decoration:underline;background:none}.badge{display:inline-block;border-radius:5px;background:#f1f3f5;color:#67747e;padding:6px 8px;font-size:10px;white-space:normal;line-height:1.4;max-width:210px}.badge.green{color:#21714b;background:#e7f4ed}.badge.amber{color:#92621d;background:#fcf3e4}.table-footer{padding:15px 22px;display:flex;justify-content:space-between;font-size:10px;color:#89939c;gap:16px}.empty{text-align:center;padding:48px 20px 55px;color:#8b949d}.empty h3{color:#46515b;margin-bottom:8px}.empty p{max-width:510px;margin:auto;font-size:12px;line-height:1.8}.empty-icon{font-size:32px;color:#a5b9b0}.health-grid{display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid #edf0f2}.health-item{padding:19px 22px;border-bottom:1px solid #edf0f2;min-width:0}.health-label{font-size:11px;color:#7f8a93;margin-bottom:10px}.health-value{font-size:11px;line-height:1.6;overflow-wrap:anywhere}footer{display:flex;justify-content:space-between;font-size:10px;color:#8d979f;padding:5px 0 18px}#error{margin-top:20px;background:#fff1ee;color:#a44531;padding:14px;border-radius:8px}dialog{max-width:1100px;width:90%;max-height:85vh;overflow:auto;border:1px solid #dce3e7;border-radius:13px;padding:25px}dialog::backdrop{background:#172b3e55}.dialog-heading{display:flex;justify-content:space-between;gap:15px;margin-bottom:12px}dialog .table-wrap{margin-top:20px}[hidden]{display:none!important}@media(max-width:1150px){.cards{grid-template-columns:repeat(3,1fr)}.health-grid{grid-template-columns:repeat(2,1fr)}.panel-heading{align-items:flex-start}}@media(max-width:650px){header{height:65px}.readonly{display:none}main{padding-top:28px}.intro{align-items:flex-start;flex-direction:column}.intro-actions{align-items:flex-start;width:100%}.intro-actions #run-now-status{text-align:left}.intro-actions>div{width:100%}.intro-actions button{flex:1}h1{font-size:27px}.cards{grid-template-columns:repeat(2,1fr)}.card{padding:15px}.panel-heading{flex-direction:column}.filters{width:100%}.filters label{width:50%}select{min-width:0;width:100%}.health-grid{grid-template-columns:1fr}.meta,.table-footer,footer{flex-direction:column;gap:10px}.table-footer span:last-child{line-height:1.6}}


.filters{flex-wrap:wrap}.selection-price{white-space:nowrap;line-height:1.8}.qualifying-price{color:#187047;font-weight:700}

/* Consistent alignment and readable rows for quick comparison. */
th{font-size:12px;color:#53616e}td{font-size:14px;padding:16px}.kickoff{font-variant-numeric:tabular-nums}
#matches tr:hover{background:#f5f8f6}.selection-price{line-height:1.4}
.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:650px){.filters label{width:auto;flex:1 1 130px}}

.health-panel>summary{cursor:pointer;list-style:none}.health-panel>summary::-webkit-details-marker{display:none}
.health-panel>summary:after{content:'▸';font-size:18px;color:#53616e}.health-panel[open]>summary:after{content:'▾'}
.health-panel>summary:focus-visible{outline:3px solid #7fbba7;outline-offset:-3px}
.health-alert{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 20px;border-bottom:1px solid #edf0f2}.health-alert-copy{display:flex;align-items:baseline;gap:12px;min-width:0}.health-alert-copy strong{font-size:12px;white-space:nowrap}.health-alert-copy span{font-size:12px;line-height:1.45}.health-alert-warning{background:#fff8e9;color:#744f16;border-left:4px solid #d49a40}.health-alert-ok{background:#eff8f3;color:#285f47;border-left:4px solid #39a875}.health-alert button{flex:none;padding:7px 10px;font-size:10px}.health-item-issue{background:#fffaf0;box-shadow:inset 3px 0 #d49a40}.health-item-issue .health-value{color:#744f16;font-weight:650}
html[data-theme="dark"] .health-alert{border-color:#344251}html[data-theme="dark"] .health-alert-warning{background:#352c1d;color:#f4ce86;border-left-color:#d49a40}html[data-theme="dark"] .health-alert-ok{background:#19382e;color:#92e6b9;border-left-color:#39a875}html[data-theme="dark"] .health-item-issue{background:#2b271e;box-shadow:inset 3px 0 #d49a40}html[data-theme="dark"] .health-item-issue .health-value{color:#f4ce86}
@media(max-width:650px){.health-alert,.health-alert-copy{align-items:flex-start;flex-direction:column}.health-alert{gap:10px}.health-alert-copy{gap:4px}.health-alert button{width:100%}}
button.selection-price{display:block;margin-left:auto;padding:3px 0;border:0;background:transparent;font:inherit;color:#187047}
.odds-movement{position:fixed;z-index:1000;width:285px;max-width:calc(100vw - 16px);overflow:visible;
 background:#f0f3f2;color:#303936;border:1px solid #d4ddd8;border-radius:8px;padding:12px 14px;box-shadow:0 8px 30px #182d3529}
.movement-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.movement-heading h3{font-size:13px;letter-spacing:.6px;margin:0}
.movement-close{padding:0 5px;font-size:20px;background:transparent;border:0}.movement-team{font-size:11px;color:#58645e;margin:3px 0 10px}
.movement-content{font-variant-numeric:tabular-nums}.movement-content td{padding:5px 3px;font-size:11px;border:0}
.movement-date{color:#53605a}.movement-odd{font-weight:700;text-align:right}.movement-up{color:#087f58;text-align:right;font-weight:600}
.movement-down{color:#c33434;text-align:right;font-weight:600}.movement-flat{color:#69756f;text-align:right}
.movement-opening{text-align:center;border-top:1px solid #d4ddd8;padding-top:12px;margin-top:10px;font-size:11px;line-height:1.7}
.movement-note{font-size:10px;color:#657269;text-align:center;margin:10px 0 0}
.movement-more{display:block;width:100%;margin-top:8px;padding:7px}.stop-column{text-align:center;width:86px}.stop-action{min-width:66px;padding:7px 10px;font-size:11px}.stop-action.resume-action{color:#176543;border-color:#77a892;background:#eef8f3}.stop-action.resume-action:hover{background:#e1f2e9}
.collection-closed{font-size:11px;color:#7b838a}
.stopped-row,.stopped-row.exact-row{background:#eef0f2;color:#7b838a}.stopped-row td{opacity:.65}.stopped-row .stop-column{opacity:1}.stopped-row button.selection-price{color:#7b838a}

button.selection-price{color:#35414c}button.qualifying-price{color:#187047}

.header-actions{display:flex;align-items:center;gap:18px}#theme-toggle{min-width:70px}
.betfair-price{text-align:left;font-variant-numeric:tabular-nums}.selection-side{line-height:21px;padding:3px 0}
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="dark"] body{background:#10161e;color:#e4eaf1}
html[data-theme="dark"] header,html[data-theme="dark"] .panel,html[data-theme="dark"] .card,
html[data-theme="dark"] dialog{background:#19222d;border-color:#344251;color:#e4eaf1}
html[data-theme="dark"] th{background:#202c39;color:#b7c6d6;border-color:#344251}
html[data-theme="dark"] td,html[data-theme="dark"] .health-grid,html[data-theme="dark"] .health-item{border-color:#344251}
html[data-theme="dark"] button,html[data-theme="dark"] select{background:#253343;color:#e4eaf1;border-color:#45576b}
html[data-theme="dark"] button:hover{background:#304357}
html[data-theme="dark"] .muted,html[data-theme="dark"] .meta,html[data-theme="dark"] label,
html[data-theme="dark"] .card-label,html[data-theme="dark"] .health-label,html[data-theme="dark"] footer,
html[data-theme="dark"] .table-footer,html[data-theme="dark"] .eyebrow,html[data-theme="dark"] .readonly{color:#a9b9ca}
html[data-theme="dark"] .card.accent,html[data-theme="dark"] .exact-row{background:#19382e;border-color:#345c4a}
html[data-theme="dark"] .card.accent .card-value{color:#7bdfac}
html[data-theme="dark"] .badge,html[data-theme="dark"] .tag{background:#2b394a;color:#bfcede;border-color:#45576b}
html[data-theme="dark"] .badge.green{background:#1f4437;color:#92e6b9}
html[data-theme="dark"] .badge.amber{background:#493a23;color:#f4ce86}
html[data-theme="dark"] #matches tr:hover{background:#243647}
html[data-theme="dark"] .match-button,html[data-theme="dark"] button.selection-price{background:transparent;color:#e4eaf1}
html[data-theme="dark"] .qualifying-price,html[data-theme="dark"] button.qualifying-price{color:#7bdfac}
html[data-theme="dark"] .odds-movement{background:#202d39;border-color:#45576b;color:#e4eaf1;box-shadow:0 8px 30px #0008}
html[data-theme="dark"] .movement-team,html[data-theme="dark"] .movement-date,
html[data-theme="dark"] .movement-note,html[data-theme="dark"] .movement-flat{color:#b3c3d2}
html[data-theme="dark"] .movement-up{color:#7bdfac}html[data-theme="dark"] .movement-down{color:#ff9696}
html[data-theme="dark"] .movement-opening{border-color:#45576b}
html[data-theme="dark"] .empty,html[data-theme="dark"] .empty h3{color:#b3c3d2}
html[data-theme="dark"] #error{background:#482a2b;color:#ffb6ac}
html[data-theme="dark"] .health-panel>summary:after{color:#b3c3d2}

.cards{grid-template-columns:repeat(3,minmax(0,1fr))}
.settings-panel{margin-bottom:24px}.settings-panel>summary{cursor:pointer;list-style:none}.settings-panel>summary::-webkit-details-marker{display:none}.settings-panel>summary:after{content:'▸';font-size:18px;color:#53616e}.settings-panel[open]>summary:after{content:'▾'}.settings-body{border-top:1px solid #edf0f2;padding:20px 22px}.settings-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:34px}.settings-tabs h3{font-size:13px;margin:0}.settings-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:16px 0}.settings-fields label{display:flex;flex-direction:column;gap:6px;font-size:12px}.settings-fields input{font:inherit;padding:10px;border:1px solid #cbd5e1;border-radius:6px;background:transparent;color:inherit}.settings-fields p,.check-label{grid-column:1/-1}.settings-fields .check-label{flex-direction:row;align-items:center}.settings-save{display:flex;align-items:center;justify-content:flex-end;gap:16px;font-size:12px}.match-name{font-weight:500}.betfair-price .selection-price{text-align:left;margin-left:0}
[data-theme="dark"] .settings-fields input{border-color:#40536b;color:#e2e8f0;color-scheme:dark}
html[data-theme="dark"] .settings-body{border-color:#344251}html[data-theme="dark"] .settings-panel>summary:after{color:#b3c3d2}html[data-theme="dark"] .stopped-row,html[data-theme="dark"] .stopped-row.exact-row{background:#252b32;color:#9aa5af}html[data-theme="dark"] .stopped-row button.selection-price{color:#9aa5af}
html[data-theme="dark"] .stop-action.resume-action{color:#9de0be;border-color:#477b65;background:#203c31}html[data-theme="dark"] .stop-action.resume-action:hover{background:#294b3d}
html[data-theme="dark"] .collection-closed{color:#9aa5af}
@media(max-width:700px){.settings-tabs{grid-template-columns:1fr}.cards{grid-template-columns:1fr}.settings-fields{grid-template-columns:1fr}}

.bookmaker-settings{border-bottom:1px solid #edf0f2;margin-bottom:22px;padding-bottom:22px}.settings-section-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:14px}.bookmaker-list{display:grid;gap:10px}.bookmaker-card{display:grid;grid-template-columns:minmax(220px,1fr) minmax(260px,auto) auto;align-items:center;gap:18px;border:1px solid #dfe5e9;border-radius:9px;padding:14px 16px}.bookmaker-card-details{display:flex;flex-direction:column;gap:5px;min-width:0}.bookmaker-url{color:#587067;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bookmaker-card-state,.bookmaker-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.credential-state{font-size:11px;color:#728079}.bookmaker-actions{justify-content:flex-end}.bookmaker-actions button{padding:7px 10px;font-size:11px}.bookmaker-disabled{background:#f4f5f6;color:#78818a}.bookmaker-form{border:1px solid #dfe5e9;border-radius:9px;padding:16px;margin-top:12px;background:#fafbfc}.bookmaker-fields{grid-template-columns:repeat(2,minmax(0,1fr));padding-top:0}.credential-note{margin:0 0 14px}.bookmaker-name{font-weight:600}
html[data-theme="dark"] .bookmaker-settings{border-color:#344251}html[data-theme="dark"] .bookmaker-card,html[data-theme="dark"] .bookmaker-form{border-color:#40536b;background:#202c39}html[data-theme="dark"] .bookmaker-disabled{background:#242b33;color:#9aa5af}html[data-theme="dark"] .bookmaker-url{color:#9fc6b7}html[data-theme="dark"] .credential-state{color:#a9b9ca}
@media(max-width:850px){.bookmaker-card{grid-template-columns:1fr}.bookmaker-card-state,.bookmaker-actions{justify-content:flex-start}.bookmaker-fields{grid-template-columns:1fr}}
.simulation-banner{margin-top:22px;padding:13px 16px;border-radius:8px;border:1px solid #e1bf72;background:#fff6dc;color:#765313;font-weight:600}.simulation-banner+ .meta{margin-top:18px}html[data-theme="dark"] .simulation-banner{background:#483b20;border-color:#806a35;color:#ffe19a}

/* One fixture per row; bookmakers stack vertically inside a single comparison column. */
.odds-matrix{table-layout:fixed;min-width:1100px}.odds-matrix th,.odds-matrix td{vertical-align:middle}.odds-matrix th:nth-child(1){width:13%}.odds-matrix th:nth-child(2){width:9%}.odds-matrix th:nth-child(3){width:15%}.odds-matrix th:nth-child(4){width:8%}.odds-matrix th:nth-child(5){width:13%}.odds-matrix th:nth-child(6){width:7%}.odds-matrix th:nth-child(7){width:7%}.odds-matrix th:nth-child(8){width:7%}.odds-matrix th:nth-child(9){width:21%}.odds-matrix .bookmaker-column{color:#33473e;text-align:right}.odds-matrix td.bookmaker-column .bookmaker-line{justify-content:flex-end}.odds-matrix .odds-column,.odds-matrix .betfair-price{padding-left:8px;padding-right:8px}
.matrix-lines{display:grid;gap:8px}.matrix-line{min-height:38px;display:flex;flex-direction:column;justify-content:center}
.side-label{font-size:11px;font-weight:700;color:#59665f;text-transform:uppercase;letter-spacing:.35px}
.bookmaker-quote{font-variant-numeric:tabular-nums}.bookmaker-lines{display:grid;gap:0}.bookmaker-line{display:flex;align-items:center;min-height:36px;padding:4px 0}.bookmaker-line+.bookmaker-line{border-top:1px solid #edf0f2}
.bookmaker-label{font-size:12px;font-weight:600;white-space:nowrap;overflow:visible}.bookmaker-quote .selection-price{margin:0;font-size:15px;line-height:1.25;text-align:left}
.current-price{display:inline-flex;align-items:center;gap:4px}.current-price .selection-price{flex:0 0 auto}.price-trend{font-size:13px;font-weight:800;line-height:1}.price-trend.up{color:#087f58}.price-trend.down{color:#c33434}
.missing-price{color:#a4ada8;text-align:center}.odds-matrix td.betfair-price{vertical-align:top}.odds-matrix .betfair-price .matrix-line{align-items:flex-start}.odds-matrix .stop-column{vertical-align:middle}
html[data-theme="dark"] .odds-matrix .bookmaker-column{color:#d9e5df}html[data-theme="dark"] .bookmaker-line+.bookmaker-line{border-color:#344251}
html[data-theme="dark"] .side-label{color:#b8c7c0}
html[data-theme="dark"] .price-trend.up{color:#7bdfac}html[data-theme="dark"] .price-trend.down{color:#ff9696}
.card-meta+.card-meta{margin-top:4px}.card-warning{color:#a96b16}html[data-theme="dark"] .card-warning{color:#f0b85e}

/* Secondary collection information stays in a narrow, collapsed row. */
.collection-summary{margin:24px 0 12px;border:1px solid #e1e6e9;border-radius:8px;background:#fff;color:#53616e;overflow:hidden}
.collection-summary>summary{display:flex;align-items:center;gap:14px;min-height:44px;padding:9px 14px;cursor:pointer;list-style:none;font-size:11px}
.collection-summary>summary::-webkit-details-marker{display:none}.collection-summary>summary:after{content:'▸';color:#839089;font-size:14px}.collection-summary[open]>summary:after{content:'▾'}
.collection-summary-title{display:flex;align-items:center;gap:8px;color:#35414c;white-space:nowrap}.summary-indicator{width:7px;height:7px;border-radius:50%;background:#8f9994}.summary-indicator.green{background:#39a875}.summary-indicator.amber{background:#d49a40}
.collection-summary-brief{margin-left:auto;color:#7d8983;font-variant-numeric:tabular-nums;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.collection-summary-body{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;border-top:1px solid #edf0f2}
.collection-summary-item{display:flex;flex-direction:column;gap:5px;padding:12px 14px;min-width:0;border-right:1px solid #edf0f2;border-bottom:1px solid #edf0f2}
.collection-summary-item:nth-child(4n){border-right:0}.collection-summary-label{font-size:9px;text-transform:uppercase;letter-spacing:.45px;color:#8a959f}.collection-summary-value{font-size:11px;line-height:1.35;color:#53616e;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
html[data-theme="dark"] .collection-summary{background:#151e28;border-color:#2e3b49;color:#a9b9ca}html[data-theme="dark"] .collection-summary-title{color:#cbd6e1}html[data-theme="dark"] .collection-summary-brief{color:#8fa0b0}
html[data-theme="dark"] .collection-summary-body,html[data-theme="dark"] .collection-summary-item{border-color:#2e3b49}html[data-theme="dark"] .collection-summary-label{color:#8294a6}html[data-theme="dark"] .collection-summary-value{color:#c2cfdb}
@media(max-width:850px){.collection-summary-body{grid-template-columns:repeat(2,minmax(0,1fr))}.collection-summary-item:nth-child(4n){border-right:1px solid #edf0f2}.collection-summary-item:nth-child(2n){border-right:0}html[data-theme="dark"] .collection-summary-item:nth-child(4n){border-color:#2e3b49}.collection-summary-brief{max-width:65%}}
@media(max-width:650px){.collection-summary{margin-top:18px}.collection-summary>summary{align-items:flex-start;flex-wrap:wrap}.collection-summary-brief{order:3;width:100%;max-width:none;margin-left:15px;text-align:left}.collection-summary-body{grid-template-columns:1fr 1fr}}

/* Match-specific counts sit with the match controls. */
.match-heading-main{display:flex;align-items:flex-end;gap:26px;min-width:0;flex:1}
.match-metrics{display:flex;gap:9px;flex-wrap:nowrap}
.match-metric{display:flex;flex-direction:column;justify-content:center;gap:5px;flex:1 1 0;min-width:0;height:55px;padding:8px 11px;border:1px solid #dce2e6;border-radius:7px;background:#fafbfc;white-space:nowrap;overflow:hidden}
.match-metric span{font-size:9px;color:#75818c}.match-metric strong{font-size:15px;line-height:1;color:#35414c;font-variant-numeric:tabular-nums}
.collection-summary-brief{font-size:12px;font-weight:500;color:#66756e}
html[data-theme="dark"] .match-metric{background:#202c39;border-color:#45576b}html[data-theme="dark"] .match-metric span{color:#a9b9ca}html[data-theme="dark"] .match-metric strong{color:#e4eaf1}html[data-theme="dark"] .collection-summary-brief{color:#b4c3d1}

/* All secondary disclosure rows share the same compact collapsed height. */
.settings-panel,.health-panel{border-radius:8px;margin-bottom:12px;box-shadow:none}
.settings-panel>summary.panel-heading,.health-panel>summary.panel-heading{min-height:44px;padding:9px 14px;flex-direction:row;align-items:center;justify-content:flex-start;gap:12px}
.settings-panel>summary>div,.health-panel>summary>div{display:flex;align-items:center;gap:12px;min-width:0}.settings-panel>summary h2,.health-panel>summary h2{font-size:11px;white-space:nowrap}.settings-panel>summary p,.health-panel>summary p{margin:0;font-size:10px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.settings-panel>summary:after{margin-left:auto;font-size:14px}.health-panel>summary:after{margin-left:0;font-size:14px}.health-panel>summary #health-badge{margin-left:auto;padding:4px 7px;font-size:9px}
@media(max-width:1000px){.match-heading-main{align-items:flex-start;flex-direction:column;gap:14px}}
@media(max-width:650px){.match-metrics{width:100%}.match-metric{flex:1 1 0;min-width:0;padding:8px}.match-metric span{font-size:10px}.settings-panel>summary p,.health-panel>summary p{display:none}}

/* Accounts stay out of the match workflow and only appear inside expanded Settings. */
.account-chip{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:#617069;padding:7px 10px;border:1px solid #dce2e6;border-radius:999px;background:#fafbfc}.header-actions #logout{padding:7px 10px;font-size:11px}
.auth-screen{min-height:calc(100vh - 72px);display:grid;place-items:center;padding:30px}.auth-card{width:min(410px,100%);background:#fff;border:1px solid #dfe5e9;border-radius:12px;padding:30px;box-shadow:0 16px 50px #23352d12}.auth-card h1{font-size:25px;margin:4px 0 8px}.auth-card form{display:grid;gap:14px;margin-top:24px}.auth-card label{font-size:12px}.auth-card input,.telegram-form input{font:inherit;padding:10px;border:1px solid #cbd5e1;border-radius:6px;background:transparent;color:inherit}.auth-card label span,.field-hint{font-size:9px;color:#849089;font-weight:400}.auth-card button{margin-top:4px}.form-status{min-height:18px;color:#a44531;font-size:11px;margin:0}
.account-settings{border-bottom:1px solid #edf0f2;margin-bottom:22px;padding-bottom:22px}.user-list{display:grid;gap:8px}.user-card{display:grid;grid-template-columns:minmax(180px,1fr) minmax(290px,auto) auto;align-items:center;gap:16px;border:1px solid #dfe5e9;border-radius:8px;padding:12px 14px}.user-identity{display:flex;align-items:baseline;gap:9px;min-width:0}.user-details{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.role-pill{font-size:10px;font-weight:650;padding:4px 7px;border-radius:5px;background:#edf4f1;color:#376653}.user-disabled{background:#f4f5f6;color:#78818a}.telegram-form{display:grid;grid-template-columns:minmax(240px,1fr) minmax(260px,1fr) auto auto;align-items:end;gap:16px;margin-top:14px;padding:14px;border:1px solid #dfe5e9;border-radius:8px;background:#fafbfc}.telegram-form>div:first-child{align-self:center}.telegram-form h3{margin:0}.telegram-form .settings-save{align-self:end}.viewer-mode .odds-matrix th:nth-child(3){width:18%}.viewer-mode .odds-matrix th:nth-child(9){width:auto}
html[data-theme="dark"] .account-chip{background:#202c39;border-color:#45576b;color:#cbd6e1}html[data-theme="dark"] .auth-card,html[data-theme="dark"] .user-card,html[data-theme="dark"] .telegram-form{background:#19222d;border-color:#40536b}html[data-theme="dark"] .auth-card input,html[data-theme="dark"] .telegram-form input{border-color:#40536b;color:#e2e8f0;color-scheme:dark}html[data-theme="dark"] .account-settings{border-color:#344251}html[data-theme="dark"] .role-pill{background:#284438;color:#a6dfc2}html[data-theme="dark"] .user-disabled{background:#242b33;color:#9aa5af}
@media(max-width:900px){.user-card,.telegram-form{grid-template-columns:1fr}.user-details,.user-card .bookmaker-actions{justify-content:flex-start}.telegram-form .settings-save{justify-content:flex-start}}
@media(max-width:650px){.auth-screen{padding:18px}.auth-card{padding:22px}.account-chip{display:none}.header-actions{gap:5px}.header-actions #logout,#theme-toggle{padding:7px 9px;min-width:0}}

/* Compact settings index: opening Settings shows three scannable rows, not every form. */
.settings-panel>.settings-body{padding:0;border-top:1px solid #edf0f2}.settings-group{border-bottom:1px solid #edf0f2}.settings-group:last-child{border-bottom:0}.settings-group>summary{display:flex;align-items:center;gap:16px;min-height:54px;padding:9px 16px;list-style:none;cursor:pointer}.settings-group>summary::-webkit-details-marker{display:none}.settings-group>summary:after{content:'▸';font-size:14px;color:#7d8983}.settings-group[open]>summary:after{content:'▾'}.settings-group>summary:hover{background:#f7f9f8}.settings-group>summary:focus-visible{outline:3px solid #7fbba7;outline-offset:-3px}.settings-group>summary>span:first-child{display:flex;flex-direction:column;gap:3px;min-width:180px}.settings-group>summary strong{font-size:12px;color:#35414c}.settings-group>summary small{font-size:10px;color:#849089}.settings-group-brief{margin-left:auto;font-size:11px;color:#66756e;white-space:nowrap}.settings-group-body{padding:14px 16px 18px;border-top:1px solid #edf0f2}.settings-group .account-settings,.settings-group .bookmaker-settings{border:0;margin:0;padding:0}.settings-group .settings-section-heading{margin-bottom:10px}.settings-group .settings-section-heading>.muted{margin:0}.telegram-form{grid-template-columns:minmax(250px,420px) auto minmax(170px,1fr) auto;align-items:end;gap:12px;margin-top:12px;padding:12px 0 0;border:0;border-top:1px solid #edf0f2;border-radius:0;background:transparent}.telegram-form>label:first-child{min-width:0}.telegram-form .check-label{align-self:center;flex-direction:row;align-items:center;white-space:nowrap}.telegram-form>span{align-self:center;font-size:11px;color:#718078}.telegram-form>button{padding:9px 12px}.user-card{padding:10px 12px}.settings-group .settings-tabs{gap:24px}
html[data-theme="dark"] .settings-panel>.settings-body,html[data-theme="dark"] .settings-group,html[data-theme="dark"] .settings-group-body,html[data-theme="dark"] .telegram-form{border-color:#344251}html[data-theme="dark"] .settings-group>summary:hover{background:#202c39}html[data-theme="dark"] .settings-group>summary strong{color:#dce6ef}html[data-theme="dark"] .settings-group>summary small{color:#8fa0b0}html[data-theme="dark"] .settings-group-brief,html[data-theme="dark"] .telegram-form>span{color:#b4c3d1}html[data-theme="dark"] .telegram-form{background:transparent}
@media(max-width:800px){.telegram-form{grid-template-columns:1fr}.telegram-form .check-label{justify-self:start}.settings-group-brief{white-space:normal;text-align:right}.settings-group>summary>span:first-child{min-width:0}}
.telegram-form .check-label{grid-column:auto}
.telegram-form-actions{display:flex;gap:8px;justify-content:flex-end}.telegram-form-actions button{padding:9px 12px;white-space:nowrap}
.telegram-config{margin-top:12px;border-top:1px solid #edf0f2}.telegram-config>summary{display:flex;align-items:center;gap:12px;min-height:43px;padding:8px 0;cursor:pointer;list-style:none;font-size:11px}.telegram-config>summary::-webkit-details-marker{display:none}.telegram-config>summary:after{content:'▸';font-size:13px;color:#7d8983}.telegram-config[open]>summary:after{content:'▾'}.telegram-config>summary>span:first-child{font-weight:650;color:#53616e}.telegram-config>summary>span:nth-child(2){margin-left:auto;color:#718078}.telegram-config .telegram-form{margin-top:0;padding-top:12px}html[data-theme="dark"] .telegram-config{border-color:#344251}html[data-theme="dark"] .telegram-config>summary>span:first-child{color:#c8d4df}html[data-theme="dark"] .telegram-config>summary>span:nth-child(2){color:#9fb0bf}

/* Collection controls use the full panel width in two compact rows. */
.collection-controls-grid{display:grid;grid-template-columns:repeat(4,max-content);justify-content:start;gap:12px 20px}.collection-controls-grid>label{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:0;font-size:12px}.collection-controls-grid input{box-sizing:border-box;width:9rem;max-width:100%;font:inherit;padding:9px 10px;border:1px solid #cbd5e1;border-radius:6px;background:transparent;color:inherit}.collection-controls-grid input[name="matchTolerancePoints"],.collection-controls-grid input[name="closeGap"],.collection-controls-grid input[name="fastMinutes"],.collection-controls-grid input[name="mediumGap"],.collection-controls-grid input[name="mediumMinutes"]{width:7.5rem}.collection-controls-grid label small{min-height:13px;font-size:9px;color:#849089}.controls-heading{grid-column:1/-1;display:flex;align-items:center;justify-content:flex-start;gap:14px;padding-bottom:7px;border-bottom:1px solid #edf0f2}.controls-heading h3{margin:0;font-size:12px}.controls-heading p{margin:0;font-size:10px;text-align:left}.adaptive-heading{margin-top:3px}.adaptive-heading>div{display:flex;align-items:baseline;gap:12px}.adaptive-heading .check-label{display:flex;align-items:center;gap:7px;white-space:nowrap;font-size:11px}.adaptive-heading .check-label input{width:auto}.collection-controls-save{margin-top:14px;padding-top:12px;border-top:1px solid #edf0f2}.collection-controls-save>.muted{margin-right:auto;max-width:620px;line-height:1.35}
html[data-theme="dark"] .collection-controls-grid input{border-color:#40536b;color:#e2e8f0;color-scheme:dark}html[data-theme="dark"] .controls-heading,html[data-theme="dark"] .collection-controls-save{border-color:#344251}
@media(max-width:1000px){.collection-controls-grid{grid-template-columns:repeat(2,max-content)}}
@media(max-width:650px){.collection-controls-grid{grid-template-columns:1fr;justify-content:stretch}.controls-heading{align-items:flex-start;flex-direction:column;gap:5px}.controls-heading p{text-align:left}.adaptive-heading>div{display:block}.collection-controls-save{align-items:flex-start;flex-wrap:wrap}.collection-controls-save>.muted{width:100%}}

/* Persistent app bar: global actions remain available while matches stay first. */
header{position:sticky;top:0;z-index:900;height:70px;padding:0 4.5%;box-shadow:0 2px 12px #172b3e0a}.header-actions{gap:8px}.header-control{height:36px;padding:7px 11px;font-size:11px}.header-control.primary-action,html[data-theme="dark"] .header-control.primary-action{background:#1f5a47;border-color:#2f765f;color:#fff}.header-control.primary-action:hover,html[data-theme="dark"] .header-control.primary-action:hover{background:#276c56}.theme-control,#theme-toggle.theme-control{display:grid;place-items:center;width:36px;min-width:36px;height:36px;padding:0;border:0;border-radius:50%;background:transparent;font-size:18px;color:#5f6d66}.theme-control:hover,#theme-toggle.theme-control:hover{background:#edf2f0}.monitor-title{font-size:17px;letter-spacing:0;margin:0;font-weight:650}main{padding-top:24px}.run-status{position:fixed;right:24px;bottom:20px;z-index:950;max-width:min(440px,calc(100vw - 32px));padding:9px 12px;border:1px solid #dce2e6;border-radius:7px;background:#fff;color:#53616e;box-shadow:0 8px 24px #172b3e1c;font-size:11px}.run-status:empty{display:none}html[data-theme="dark"] .theme-control,html[data-theme="dark"] #theme-toggle.theme-control{background:transparent;border:0;color:#c6d4df}html[data-theme="dark"] .theme-control:hover,html[data-theme="dark"] #theme-toggle.theme-control:hover{background:#283747}html[data-theme="dark"] .run-status{background:#202c39;border-color:#45576b;color:#d2dce6}
@media(max-width:650px){header{height:62px;padding:0 4.5%}.brand{gap:7px;font-size:15px}.logo{font-size:22px;padding:3px 8px;border-radius:8px}.tag{display:none}.refresh-label{display:none}.header-control{width:36px;padding:0}.header-control.primary-action{width:auto;padding:0 9px}.header-actions #logout{font-size:10px;padding:7px}.run-status{right:12px;bottom:12px}}
.account-menu{position:relative}.account-chip{display:flex;align-items:center;gap:6px;cursor:pointer}.account-chip:after{content:'▾';font-size:9px;color:#819087}.account-dropdown{position:absolute;right:0;top:calc(100% + 8px);z-index:980;min-width:130px;padding:5px;border:1px solid #dce2e6;border-radius:8px;background:#fff;box-shadow:0 10px 30px #172b3e24}.account-dropdown #logout{width:100%;padding:8px 10px;text-align:left;border:0;background:transparent}.account-dropdown #logout:hover{background:#f1f5f3}html[data-theme="dark"] .account-dropdown{background:#202c39;border-color:#45576b}html[data-theme="dark"] .account-dropdown #logout{background:transparent}html[data-theme="dark"] .account-dropdown #logout:hover{background:#304357}
@media(max-width:650px){.account-menu .account-chip{display:flex;max-width:82px;padding:7px 9px}.account-chip{font-size:10px}.account-chip:after{display:none}}

/* Match archive stays on a separate page so the live monitor remains the primary workspace. */
.header-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;color:#53616e;background:#fff;border:1px solid #dce2e6;border-radius:7px;white-space:nowrap}.header-link:hover{background:#f1f5f3}.history-panel{margin-top:0}.history-heading{align-items:flex-end;flex-wrap:wrap}.history-heading .match-heading-main{flex:0 0 470px}.history-heading .match-heading-main>div:first-child{flex:0 0 245px}.history-heading .match-metrics{flex-wrap:nowrap}.history-heading .match-metric{min-width:96px}.history-filters{align-items:flex-end;margin-left:auto}.history-filters select{min-width:132px}.history-search input{width:150px;height:37px;padding:8px 10px;border:1px solid #dce2e6;border-radius:7px;background:transparent;color:inherit;font:inherit;font-size:12px}.history-matrix th:nth-child(1){width:13%}.history-matrix th:nth-child(2){width:9%}.history-matrix th:nth-child(3){width:16%}.history-matrix th:nth-child(4){width:7%}.history-matrix th:nth-child(5){width:13%}.history-matrix th:nth-child(6){width:7%}.history-matrix th:nth-child(7){width:7%}.history-matrix th:nth-child(8){width:8%}.history-matrix th:nth-child(9){width:20%}.history-matrix .side-cell,.history-matrix .bookmaker-column,.history-matrix .odds-column,.history-matrix .betfair-price,.history-matrix .signal-column{vertical-align:top}.history-matrix .bookmaker-column{text-align:right}.history-matrix td.bookmaker-column .bookmaker-line{justify-content:flex-end}.history-matrix .bookmaker-line{min-height:38px}.history-signal{display:inline-flex;align-items:center;min-height:24px;padding:4px 8px;border-radius:999px;background:#e7f4ed;color:#21714b;font-size:10px;font-weight:700}.history-page #history-error{margin-bottom:16px;background:#fff1ee;color:#a44531;padding:14px;border-radius:8px}
html[data-theme="dark"] .header-link{background:#253343;color:#e4eaf1;border-color:#45576b}html[data-theme="dark"] .header-link:hover{background:#304357}html[data-theme="dark"] .history-search input{border-color:#45576b;color:#e4eaf1;color-scheme:dark}html[data-theme="dark"] .history-signal{background:#1f4437;color:#92e6b9}html[data-theme="dark"] .history-page #history-error{background:#482a2b;color:#ffb6ac}
@media(max-width:1100px){.history-heading{align-items:flex-start;flex-direction:column}.history-heading .match-heading-main{flex-basis:auto;width:100%}.history-filters{width:100%;margin-left:0}.history-filters label{flex:1 1 140px}.history-search input{width:100%}}
@media(max-width:650px){.history-page main{padding-left:3%;padding-right:3%}.history-heading{gap:14px}.history-filters{display:grid;grid-template-columns:1fr 1fr}.history-filters label{width:100%}.history-page .header-link{height:34px;padding:0 8px;font-size:10px}.history-page .table-footer span:last-child{display:none}}

/* Official Scan Line icon with a stable interface-text name. */
.brand{color:inherit;text-decoration:none;gap:10px}.brand-icon{position:relative;display:block;width:38px;height:38px;overflow:hidden;flex:0 0 38px}.brand-icon img{position:absolute;inset:0;width:100%;height:100%;display:block;object-fit:cover}.brand-icon .brand-logo-dark{display:none}.brand-name{font-size:20px;font-weight:700;letter-spacing:-.45px;white-space:nowrap}.auth-brand{display:flex;align-items:center;gap:13px;margin-bottom:24px}.auth-brand .brand-icon{width:52px;height:52px;flex-basis:52px}.auth-brand .brand-name{font-size:25px}.auth-card .auth-brand+h1{margin-top:0}
html[data-theme="dark"] .brand-logo-light{display:none}html[data-theme="dark"] .brand-icon .brand-logo-dark{display:block}
@media(max-width:650px){.brand{gap:7px}.brand-icon{width:30px;height:30px;flex-basis:30px}.brand-name{font-size:14px;letter-spacing:-.2px}.auth-brand .brand-icon{width:46px;height:46px;flex-basis:46px}.auth-brand .brand-name{font-size:22px}}
@media(max-width:460px){.account-menu .account-chip{display:flex;width:32px;max-width:32px;height:34px;padding:0;justify-content:center;font-size:0}.account-menu .account-chip:after{content:'⋮';display:block;font-size:16px}.header-actions{gap:4px}}


/* ---- Settings page ---- */
.settings-page main{max-width:1000px}
.tabs{display:flex;gap:8px;margin-bottom:22px;flex-wrap:wrap}
.tab{background:white;border:1px solid #dce2e6;border-radius:9px;padding:11px 16px;font-size:13px;color:#53616e}
.tab.active{background:#173d32;border-color:#173d32;color:#fff;font-weight:600}
.tab:hover:not(.active){background:#f1f5f3}
.tab-panel{padding:24px}
.tab-panel>h2{margin-bottom:4px}
.schedule-status{display:flex;flex-wrap:wrap;gap:10px 26px;margin:18px 0 10px;padding:14px 16px;background:#f7f9f8;border:1px solid #e6ebe8;border-radius:9px;font-size:12px;color:#63707a}
.schedule-status b{color:#202a34;font-variant-numeric:tabular-nums}
.schedule-section{border-top:1px solid #edf0f2;padding:22px 0 4px}
.schedule-section h3{margin:0 0 4px}
.hint{color:#7b8590;font-size:12px;line-height:1.6;margin:0 0 14px;max-width:70ch}
.schedule-row{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;flex-wrap:wrap}
.schedule-row.end{justify-content:flex-end;margin-top:16px}
.fld{display:flex;flex-direction:column;gap:6px;color:#75818c;font-size:11px}
.fld.inline{flex-direction:row;align-items:center;gap:8px;white-space:nowrap}
.fld input,.fld select{font:inherit;background:white;border:1px solid #dce2e6;border-radius:7px;padding:9px 11px;color:#35414c;font-size:13px}
.seg{display:inline-flex;flex-wrap:wrap;gap:6px;background:#f1f4f3;border:1px solid #e3e8e6;border-radius:9px;padding:5px}
.seg button{background:transparent;border:0;border-radius:6px;padding:9px 14px;font-size:13px;color:#53616e}
.seg button[aria-pressed="true"]{background:#173d32;color:#fff;font-weight:600}
.seg button:hover[aria-pressed="false"]{background:#e4eae7}
.example{margin:12px 0 0;font-size:12px;color:#4b5866;line-height:1.6;background:#f7f9f8;border-left:3px solid #9cc4b4;padding:10px 12px;border-radius:0 7px 7px 0;max-width:70ch}
.switch{display:flex;flex-direction:row;align-items:center;gap:9px;font-size:13px;color:#35414c}
.switch input{width:18px;height:18px}
#extra-section.switched-off .tier-sentences,#extra-section.switched-off .tiers{opacity:.45}
.tier-sentences{list-style:none;margin:6px 0 0;padding:0;display:flex;flex-direction:column;gap:7px}
.tier-sentences li{background:#f1f4f3;border-left:4px solid #b7c2ba;border-radius:8px;padding:11px 14px;font-size:13px;line-height:1.5;color:#35414c}
.tier-sentences li:first-child{border-left-color:#2f6f55}
.tier-sentences li:nth-child(2){border-left-color:#3b5470}
.tiers{display:flex;flex-direction:column;gap:8px;margin-top:14px}
.tier{display:flex;align-items:center;gap:12px;flex-wrap:wrap;border:1px solid #e6ebe8;border-radius:9px;padding:12px 14px;font-size:13px;color:#35414c}
.tier .grow{flex:1;min-width:230px}
.tier input[type=number]{width:62px;font:inherit;border:1px solid #dce2e6;border-radius:6px;padding:5px 7px}
.dot{width:11px;height:11px;border-radius:50%;flex:none}
.dot-close{background:#2f6f55}.dot-medium{background:#3b5470}.dot-far{background:#eef1f3;border:1px solid #dbe1e5}
.err{color:#a44531;background:#fff1ee;border-radius:7px;padding:10px 12px;font-size:12px;margin:14px 0 0}
.savebar{position:sticky;bottom:0;background:#ffffffee;backdrop-filter:blur(6px);border-top:1px solid #e1e6e9;padding:14px 4.5%;z-index:20}
.savebar-inner{max-width:1000px;margin:auto;display:flex;align-items:center;gap:14px;justify-content:flex-end}
.savebar .msg{margin-right:auto;font-size:12px;color:#7b8590}
.toast{position:fixed;left:50%;bottom:86px;transform:translateX(-50%);background:#173d32;color:#fff;padding:13px 18px;border-radius:9px;font-size:13px;box-shadow:0 8px 30px #182d3533;z-index:40;max-width:90vw;text-align:center}
#confirm-reset{max-width:460px}
#settings-denied{max-width:620px;margin:42px auto;padding:26px}
.account-dropdown a{display:block;padding:10px 13px;color:#35414c;text-decoration:none;font-size:13px}
.account-dropdown a:hover{background:#f1f5f3}

html[data-theme="dark"] .tab{background:#212c38;border-color:#344251;color:#c2ccd6}
html[data-theme="dark"] .tab.active{background:#2f7d5f;border-color:#2f7d5f;color:#0d141b}
html[data-theme="dark"] .tab:hover:not(.active){background:#2a3744}
html[data-theme="dark"] .schedule-status{background:#1c2632;border-color:#344251;color:#9aa7b3}
html[data-theme="dark"] .schedule-status b{color:#e7edf3}
html[data-theme="dark"] .schedule-section{border-color:#2b3743}
html[data-theme="dark"] .fld input,html[data-theme="dark"] .fld select,html[data-theme="dark"] .tier input[type=number]{background:#212c38;border-color:#3a4857;color:#e7edf3}
html[data-theme="dark"] .seg{background:#1c2632;border-color:#344251}
html[data-theme="dark"] .seg button{color:#c2ccd6}
html[data-theme="dark"] .seg button[aria-pressed="true"]{background:#2f7d5f;color:#0d141b}
html[data-theme="dark"] .seg button:hover[aria-pressed="false"]{background:#2a3744}
html[data-theme="dark"] .example{background:#1c2632;color:#c2ccd6;border-left-color:#3f7a63}
html[data-theme="dark"] .tier{background:#1c2632;border-color:#344251;color:#e7edf3}
html[data-theme="dark"] .dot-far{background:#2a3744;border-color:#3a4857}
html[data-theme="dark"] .tier-sentences li{background:#1c2632;color:#c2ccd6;border-left-color:#3a4857}
html[data-theme="dark"] .tier-sentences li:first-child{border-left-color:#2f6f55}
html[data-theme="dark"] .tier-sentences li:nth-child(2){border-left-color:#3b5470}
html[data-theme="dark"] .err{background:#3a2420;color:#f0a793}
html[data-theme="dark"] .savebar{background:#151d26ee;border-color:#2b3743}
html[data-theme="dark"] .savebar .msg{color:#9aa7b3}
html[data-theme="dark"] .toast{background:#2f7d5f;color:#0d141b}
html[data-theme="dark"] .account-dropdown a{color:#c2ccd6}
html[data-theme="dark"] .account-dropdown a:hover{background:#2a3744}
html[data-theme="dark"] .hint{color:#8d99a5}

@media(max-width:650px){
 .tabs{gap:6px}.tab{flex:1 1 auto;padding:10px 12px;font-size:12px}
 .tab-panel{padding:18px 14px}
 .schedule-status{flex-direction:column;gap:6px}
 .seg{width:100%}.seg button{flex:1 1 auto}
 .tier{align-items:flex-start;flex-direction:column;gap:8px}
 .tier .grow{min-width:0}
 .savebar-inner{flex-wrap:wrap}
 .savebar .msg{width:100%;margin-bottom:4px}
 .savebar .header-control{flex:1}
}


/* The Side column keeps its own width and spacing, so HOME/AWAY never runs into the
   match name. Long match names wrap inside the Match column instead of pushing across. */
.match-cell{white-space:normal;min-width:190px;max-width:330px}
.match-cell .match-name{display:inline-block;line-height:1.45;overflow-wrap:anywhere}
th.side-column,td.side-cell{width:86px;min-width:86px;padding-left:20px;padding-right:20px;white-space:nowrap}
.history-matrix .match-cell{max-width:300px}
@media(max-width:900px){.match-cell{min-width:150px;max-width:220px}th.side-column,td.side-cell{width:74px;min-width:74px;padding-left:14px;padding-right:14px}}


/* ---- Phones: one card per match, and no sideways scrolling ---- */
.match-cards{display:none}
.match-card{border:1px solid #e2e6ea;border-radius:11px;padding:14px;margin:0 0 12px;background:#fff}
.match-card-exact{background:#f2faf5;border-color:#cfe6da}
.match-card-stopped{opacity:.72}
.match-card-top{display:flex;justify-content:space-between;gap:10px;font-size:11px;color:#75818c}
.match-card-kickoff{font-variant-numeric:tabular-nums;font-weight:600;color:#53616e}
.match-card-name{font-size:15px;margin:6px 0 10px;line-height:1.35;overflow-wrap:anywhere}
.match-card-side{border-top:1px solid #edf0f2;padding-top:9px;margin-top:9px}
/* The side sits at the right end of the match-name row, directly under the league. */
.match-card-name-row{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.match-card-name-row .match-card-name{flex:1 1 auto;min-width:0}
.match-card-name-row .side-label{flex:0 0 auto;font-size:11px}
.match-card-line{display:flex;align-items:center;gap:10px;padding:5px 0;flex-wrap:wrap}
.match-card-line-exact{background:#e7f4ed;border-radius:7px;padding:5px 8px;margin:2px -8px}
.match-card-book{flex:1 1 90px;min-width:0;font-size:12px;overflow-wrap:anywhere}
.match-card-odd-wrap{display:inline-flex;align-items:center;gap:4px;min-width:64px;justify-content:flex-end}
.match-card-odd{font-size:15px;font-weight:600;font-variant-numeric:tabular-nums}
.match-card-lay{display:inline-flex;align-items:center;gap:5px;min-width:96px;justify-content:flex-end;font-variant-numeric:tabular-nums}
.match-card-lay-label{font-size:10px;color:#75818c;text-transform:uppercase;letter-spacing:.3px}
.match-card-lay-price{font-size:14px;font-weight:600}
.match-card-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #edf0f2;margin-top:11px;padding-top:11px;flex-wrap:wrap}
.match-card-checked{font-size:11px;color:#8b949d}
.match-card-state{font-size:12px;color:#67747e}
html[data-theme="dark"] .match-card{background:#1c2632;border-color:#344251}
html[data-theme="dark"] .match-card-exact{background:#19382e;border-color:#2f6f55}
html[data-theme="dark"] .match-card-line-exact{background:#19382e}
html[data-theme="dark"] .match-card-side,html[data-theme="dark"] .match-card-foot{border-color:#2b3743}
html[data-theme="dark"] .match-card-top,html[data-theme="dark"] .match-card-checked,html[data-theme="dark"] .match-card-lay-label{color:#8d99a5}
html[data-theme="dark"] .match-card-kickoff{color:#c2ccd6}

@media(max-width:780px){
 .match-cards{display:block}
 .table-wrap{display:none}
 body{overflow-x:hidden;overflow-x:clip}
 main{padding-left:14px;padding-right:14px}
 /* The header collapses so its buttons cannot overlap. */
 header{height:auto;min-height:60px;padding:8px 14px;flex-wrap:wrap;gap:8px;row-gap:8px}
 .brand-name{font-size:17px}
 .header-actions{gap:6px;flex-wrap:wrap;justify-content:flex-end}
 .header-control{padding:8px 10px;font-size:12px}
 .refresh-label{display:none}
 .account-chip{max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .match-heading-main,.history-heading .match-heading-main{flex:1 1 100%}
 .filters,.history-filters{width:100%;flex-wrap:wrap;margin-left:0}
 .filters label,.history-filters label{flex:1 1 140px}
 .history-search input{width:100%}
}
@media(max-width:420px){
 .match-card-line{gap:7px}
 .match-card-lay{min-width:88px}
 .header-control{padding:7px 9px}
}

/* The small page shown when the app is opened with no connection. */
.offline-page{min-height:100vh;display:flex;align-items:center;justify-content:center;background:#10161e;color:#e4eaf1;padding:24px}
.offline-card{text-align:center;max-width:360px}
.offline-icon{border-radius:16px;margin-bottom:18px}
.offline-card h1{font-size:22px;margin:0 0 6px}
.offline-card .muted{color:#9aa7b3;margin:0 0 20px}
.offline-card button{padding:11px 22px;font-size:14px}

/* A bookmaker that could not be read in the latest check: the whole line is greyed, with a small
   note saying when its price was last read. Tap or hover the note for the reason. */
.not-updated{opacity:.5}
.not-updated .selection-price,.not-updated .match-card-odd{font-weight:500}
.not-updated .qualifying-price{background:none;color:inherit;box-shadow:none}
.not-updated .price-trend{color:inherit}
.not-updated-note{display:inline-block;margin-left:6px;padding:0;border:0;background:none;color:inherit;font:inherit;font-size:9px;font-weight:500;letter-spacing:.2px;text-transform:uppercase;text-align:left;white-space:nowrap;cursor:pointer;text-decoration:underline dotted;text-underline-offset:2px}
.not-updated-note-open{white-space:normal;text-transform:none;letter-spacing:0;font-size:10px}
.odds-matrix td.bookmaker-column .bookmaker-line.not-updated{flex-wrap:wrap;justify-content:flex-end}
.match-card-book .not-updated-note{display:block;margin-left:0;margin-top:1px}

/* ---- "Finished today" card, from the approved mockup ---- */
.fin-card{margin-top:16px}
.fin-head{display:flex;align-items:center;gap:14px;padding:16px 22px;cursor:pointer;user-select:none}
.fin-head h2{margin:0;font-size:15px}
.fin-sum{color:#75818c;font-size:12px}
.fin-chev{margin-left:auto;color:#75818c;transition:transform .2s}
.fin-card.collapsed .fin-chev{transform:rotate(-90deg)}
.fin-card.collapsed .fin-body{display:none}
.fin-filters{display:flex;gap:6px;padding:0 22px 12px;flex-wrap:wrap}
.fin-filters button{background:#f4f7f5;color:#35414c;border:1px solid #dce2e6;border-radius:18px;padding:5px 14px;font:inherit;font-size:12px;cursor:pointer}
.fin-filters button[aria-pressed="true"]{background:#e7f4ed;border-color:#39a875;color:#1c6344;font-weight:650}
.fin-table-wrap{overflow-x:auto}
.fin-table{width:100%;border-collapse:collapse}
.fin-table th{background:#f4f7f5;color:#63707c;font-weight:600;text-align:left;padding:9px 14px;font-size:11px;white-space:nowrap}
.fin-table td{padding:8px 14px;border-top:1px solid #edf0f2;vertical-align:middle;font-size:13px}
.fin-row{cursor:pointer}
.fin-row:hover td{background:#f7faf8}
.fin-row.fired td{background:rgba(63,191,134,.09)}
.fin-row.fired:hover td{background:rgba(63,191,134,.14)}
.fin-caret{color:#9aa7b3;display:inline-block;width:14px;transition:transform .2s}
.fin-row.open .fin-caret{transform:rotate(90deg)}
.fin-date{margin-right:5px}
.fin-time{font-variant-numeric:tabular-nums}
.fin-match{font-weight:650}
.fin-side{font-size:10px;font-weight:700;color:#75818c;letter-spacing:.04em;white-space:nowrap}
.fin-book{color:#53616e;margin-right:7px}
.fin-price{display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums}
.fin-odd{font-weight:700}
/* A price that opens the movement panel is still a button, for hover, tap and keyboard, but it must
   read as a plain price: no border, no background, no padding, and the green/grey colour of its
   line. The font shorthand is deliberately avoided so the weight above survives. */
button.fin-odd{border:0;background:none;padding:0;margin:0;border-radius:0;color:inherit;cursor:pointer;
  font-family:inherit;font-size:inherit;line-height:inherit;letter-spacing:inherit;text-align:inherit}
button.fin-odd:hover{background:none;text-decoration:underline;text-underline-offset:2px}
button.fin-odd:focus-visible{outline:3px solid #7fbba7;outline-offset:2px}
.fin-matched .fin-odd{color:#1f7a52}
.fin-unmatched{color:#7d8896;font-weight:700}
.fin-trend.up{color:#1f7a52}.fin-trend.down{color:#c4543f}
.fin-result{font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.fin-when{white-space:nowrap}
.fin-badge{display:inline-block;font-size:11px;padding:3px 10px;border-radius:12px;border:1px solid #dce2e6;background:none;color:#63707c;font-family:inherit;white-space:nowrap;cursor:pointer}
.fin-badge.fired{background:#e7f4ed;color:#1c6344;border-color:#a9dcc3;font-weight:650}
.fin-detail td{background:#f7faf8;padding:0}
.fin-detail-table{width:100%;border-collapse:collapse}
.fin-detail-table th{background:transparent;font-size:10px;padding:8px 14px 4px 44px}
.fin-detail-table td{border-top:1px solid #e7ecee;padding:7px 14px 7px 44px;font-size:12px}
.fin-detail-table tr.fin-matched-line td{background:rgba(63,191,134,.10)}
.fin-hidden{display:none}
.fin-empty{padding:16px 22px;color:#75818c}
.fin-hint{color:#75818c;font-size:11px;padding:10px 22px 16px;margin:0}
html[data-theme="dark"] .fin-table th{background:#212a36;color:#93a1af}
html[data-theme="dark"] .fin-table td{border-color:#2b3542}
html[data-theme="dark"] .fin-row:hover td{background:#222b37}
html[data-theme="dark"] .fin-filters button{background:#1f2733;color:#e7edf3;border-color:#344251}
html[data-theme="dark"] .fin-filters button[aria-pressed="true"]{background:#173a2b;border-color:#3fbf86;color:#8fe3b8}
html[data-theme="dark"] button.fin-odd{background:none;color:inherit}
html[data-theme="dark"] .fin-matched .fin-odd{color:#6fd6a4}
html[data-theme="dark"] .fin-unmatched{color:#8d9aab}
html[data-theme="dark"] .fin-trend.up{color:#6fd6a4}
html[data-theme="dark"] .fin-trend.down{color:#e5695b}
html[data-theme="dark"] .fin-badge{border-color:#344251;color:#93a1af}
html[data-theme="dark"] .fin-badge.fired{background:#173a2b;color:#8fe3b8;border-color:#2c6b50}
html[data-theme="dark"] .fin-detail td{background:#161c25}
html[data-theme="dark"] .fin-detail-table td{border-color:#232c38}
html[data-theme="dark"] .fin-book,html[data-theme="dark"] .fin-side,html[data-theme="dark"] .fin-sum,
html[data-theme="dark"] .fin-empty,html[data-theme="dark"] .fin-hint,html[data-theme="dark"] .fin-chev{color:#93a1af}
/* Phone: the league column and the date go; the rest still fits without sideways scrolling. */
@media(max-width:700px){
  .fin-table .fin-league{display:none}
  .fin-date{display:none}
  .fin-head{padding:14px 16px}
  .fin-filters{padding:0 16px 10px}
  .fin-hint{padding:10px 16px 14px}
  .fin-table th,.fin-table td{padding:7px 5px;font-size:10px}
  .fin-table th:first-child,.fin-table td:first-child{padding-left:12px}
  .fin-table th:last-child,.fin-table td:last-child{padding-right:12px}
  .fin-caret{width:10px}
  .fin-book{display:block;margin:0;font-size:9px}
  .fin-badge{font-size:9px;padding:2px 6px}
  .fin-detail-table th,.fin-detail-table td{padding-left:16px;padding-right:6px}
}
.fin-date-head{margin:18px 22px 8px;font-size:13px;color:#35414c}
.fin-date-head:first-child{margin-top:4px}
html[data-theme="dark"] .fin-date-head{color:#c2ccd6}
@media(max-width:700px){.fin-date-head{margin:14px 16px 6px;font-size:12px}}

/* ---- Phone header: brand, Run now, and one menu button ---- */
.phone-menu-toggle{display:none}
@media(max-width:650px){
  /* The header is already sticky, which makes it a containing block for the menu below it. */
  header{gap:10px}
  .brand{min-width:0;flex:1 1 auto}
  .brand-name{font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .header-actions{gap:8px;flex:0 0 auto}
  /* Everything except Run now and the menu button moves into the menu. The ids are listed
     because those controls set their own display with an id selector. */
  .header-actions>*{display:none}
  .header-actions>#theme-toggle,.header-actions>#refresh,.header-actions>#refresh-history{display:none}
  .header-actions>#run-now{display:inline-flex;align-items:center;white-space:nowrap;padding:8px 12px;font-size:12px}
  .header-actions>.phone-menu-toggle{display:inline-flex;align-items:center;justify-content:center;
    min-width:42px;height:38px;padding:0;font-size:17px;line-height:1;white-space:nowrap}
  .header-actions>.phone-menu-toggle[hidden]{display:none}
  .header-actions>.phone-menu{display:block}
  .header-actions>.phone-menu[hidden]{display:none}
  .phone-menu{position:absolute;top:100%;right:0;left:0;z-index:40;background:#fff;
    border-top:1px solid #e3e7ec;border-bottom:1px solid #e3e7ec;box-shadow:0 10px 20px #22334418}
  .phone-menu-item{display:block;width:100%;text-align:left;padding:14px 5%;font-size:14px;
    border:0;border-radius:0;background:none;color:#202a34;text-decoration:none;cursor:pointer}
  .phone-menu-item+.phone-menu-item{border-top:1px solid #edf0f2}
  .phone-menu-item:hover{background:#f1f5f3}
  .phone-menu-item[aria-current="page"]{font-weight:700;color:#187047;background:#f2faf5}
}
@media(max-width:400px){
  header{padding:0 3.5%}
  .brand-name{font-size:14px}
  .header-actions>#run-now{padding:8px 10px;font-size:11px}
}
html[data-theme="dark"] .phone-menu{background:#19222d;border-color:#344251}
html[data-theme="dark"] .phone-menu-item{color:#e4eaf1}
html[data-theme="dark"] .phone-menu-item:hover{background:#243040}
html[data-theme="dark"] .phone-menu-item[aria-current="page"]{color:#7bdfac;background:#1c2c26}

/* ---- History heading: no tall empty gap on narrow screens ---- */
/* The first block of the heading is given a fixed 245px basis so the subtitle and the boxes sit
   side by side on a computer. Below 1000px the heading turns into a column, where that same basis
   becomes a 245px tall block - the empty space under the subtitle. */
@media(max-width:1000px){
  .history-heading .match-heading-main>div:first-child{flex:0 0 auto}
}

/* ---- Finished rows on a phone: two compact lines instead of a wide table ---- */
/* The same rows the computer shows, reflowed with grid so nothing is cut off and the page never
   scrolls sideways. One DOM, one renderer: only the layout changes. */
@media(max-width:700px){
  .fin-table-wrap{overflow-x:visible}
  .fin-table,.fin-table tbody{display:block;width:100%}
  .fin-table thead{display:none}
  .fin-table tr.fin-row{
    display:grid;width:100%;align-items:baseline;column-gap:8px;row-gap:2px;padding:9px 12px;
    grid-template-columns:auto minmax(0,1fr) auto auto;
    grid-template-areas:"kickoff match match when" "side book betfair result";
    border-top:1px solid #edf0f2}
  .fin-table tr.fin-row>td{display:block;padding:0;border:0;font-size:11px;min-width:0}
  .fin-table tr.fin-row>td:nth-child(1){grid-area:kickoff;white-space:nowrap}
  .fin-table tr.fin-row>td:nth-child(3){grid-area:match;white-space:normal;overflow-wrap:anywhere}
  .fin-table tr.fin-row>td.fin-side{grid-area:side}
  .fin-table tr.fin-row>td.fin-book-cell{grid-area:book;min-width:0;overflow-wrap:anywhere}
  .fin-table tr.fin-row>td.fin-betfair-cell{grid-area:betfair;white-space:nowrap}
  .fin-table tr.fin-row>td.fin-result{grid-area:result;text-align:right}
  .fin-table tr.fin-row>td.fin-when{grid-area:when;text-align:right}
  .fin-table tr.fin-row>td.fin-league{display:none}
  .fin-table .fin-match{font-size:12px}
  .fin-table .fin-book{display:inline;margin-right:5px;font-size:10px}
  /* The expanded bookmaker lines get the same treatment. */
  .fin-table tr.fin-detail{display:block;width:100%}
  .fin-table tr.fin-detail>td{display:block;padding:0}
  .fin-detail-table,.fin-detail-table tbody{display:block;width:100%}
  .fin-detail-table thead{display:none}
  .fin-detail-table tbody tr{
    display:grid;width:100%;align-items:baseline;column-gap:8px;padding:7px 12px 7px 26px;
    grid-template-columns:minmax(0,1fr) auto auto auto auto}
  .fin-detail-table tbody tr>td{display:block;padding:0;border:0;font-size:10px;white-space:nowrap;min-width:0}
  .fin-detail-table tbody tr>td:first-child{overflow:hidden;text-overflow:ellipsis}
  .fin-detail-table tbody tr>td:nth-child(4),.fin-detail-table tbody tr>td:nth-child(5){text-align:right}
  .fin-detail-table .fin-badge{font-size:9px;padding:1px 6px}
}
html[data-theme="dark"] .fin-table tr.fin-row{border-color:#2b3542}

/* ---- Sticky header: clear of the phone's status bar, and never covering an anchor ---- */
header{padding-top:env(safe-area-inset-top,0px);height:calc(70px + env(safe-area-inset-top,0px))}
html{scroll-padding-top:calc(86px + env(safe-area-inset-top,0px))}
@media(max-width:650px){
  header{height:calc(62px + env(safe-area-inset-top,0px))}
  html{scroll-padding-top:calc(74px + env(safe-area-inset-top,0px))}
}
.tab-panel,.settings-tabs,#panel-bookmakers,#panel-accounts,#panel-schedule{scroll-margin-top:0}
@media(max-width:700px){.odds-movement{max-width:calc(100vw - 16px)}}

/* ---- Phone taps and backgrounds on the finished rows ---- */
/* A second tap on the same row arrives inside the browser's double-tap-to-zoom window, and is
   swallowed as part of that gesture instead of reaching the row - so the row expanded but would
   not collapse again. `manipulation` tells the browser these are controls, not text to zoom into.
   Pinch zoom is unaffected. */
.fin-row,.fin-badge,.fin-odd,.fin-filters button,.phone-menu-item{touch-action:manipulation}
.fin-row{-webkit-tap-highlight-color:transparent}
@media(max-width:700px){
  /* The row is a grid with gaps and padding, so a background on each cell showed up as separate
     patches. One background on the row itself covers the whole two lines, as on a computer. */
  .fin-row{user-select:none}
  .fin-table tr.fin-row.fired{background:rgba(63,191,134,.09)}
  .fin-table tr.fin-row.fired>td,.fin-table tr.fin-row:hover>td{background:none}
  .fin-table tr.fin-row:hover{background:#f7faf8}
  .fin-table tr.fin-row.fired:hover{background:rgba(63,191,134,.14)}
}
html[data-theme="dark"] .fin-table tr.fin-row:hover{background:#222b37}

/* ---- Help page ---- */
.help-panel .panel-heading{padding-bottom:10px}
.help-search{padding:0 22px 14px}
.help-search input{width:min(420px,100%);height:38px;padding:8px 11px;border:1px solid #dce2e6;border-radius:7px;background:transparent;color:inherit;font:inherit;font-size:13px}
.help-empty{padding:0 22px 20px;color:#75818c;font-size:13px}
.help-section{border-top:1px solid #edf0f2}
.help-summary{display:flex;align-items:center;gap:10px;padding:14px 22px;cursor:pointer;list-style:none;touch-action:manipulation}
.help-summary::-webkit-details-marker{display:none}
.help-summary::before{content:"▸";color:#75818c;font-size:11px}
.help-section[open] .help-summary::before{content:"▾"}
.help-summary h2{margin:0;font-size:14px}
.help-summary:hover{background:#f7faf8}
.help-body{padding:0 22px 18px;max-width:70ch}
.help-body p{margin:0 0 11px;font-size:13px;line-height:1.7;color:#35414c}
.help-terms{margin:0}
.help-terms dt{font-weight:650;font-size:13px;margin-top:12px;color:#202a34}
.help-terms dd{margin:3px 0 0;font-size:13px;line-height:1.7;color:#35414c}
html[data-theme="dark"] .help-section{border-color:#2b3542}
html[data-theme="dark"] .help-summary:hover{background:#222b37}
html[data-theme="dark"] .help-body p,html[data-theme="dark"] .help-terms dd{color:#c2ccd6}
html[data-theme="dark"] .help-terms dt{color:#e7edf3}
html[data-theme="dark"] .help-search input{border-color:#45576b;color:#e4eaf1;color-scheme:dark}
@media(max-width:700px){
  .help-search{padding:0 16px 12px}
  .help-summary{padding:13px 16px}
  .help-body{padding:0 16px 16px}
  .help-empty{padding:0 16px 16px}
}

/* ---- The ⓘ icons and their bubble ---- */
.hint-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;min-width:18px;
  margin-left:5px;padding:0;border:0;border-radius:50%;background:none;color:#8b959d;font-size:13px;line-height:1;
  cursor:pointer;vertical-align:middle;touch-action:manipulation}
.hint-icon:hover{background:none;color:#1f7a52}
/* Inside the small header boxes the icon sits on the label's line and stays out of its way. */
.match-metric>span{display:flex;align-items:center;gap:1px}
.match-metric .hint-icon{width:14px;height:14px;min-width:14px;margin-left:2px;font-size:11px}
.hint-bubble{position:fixed;z-index:960;max-width:min(320px,calc(100vw - 16px));padding:12px 14px;border:1px solid #dce2e6;
  border-radius:9px;background:#fff;box-shadow:0 10px 26px #172b3e1f;font-size:12px;line-height:1.6;color:#35414c}
.hint-bubble p{margin:0 0 8px}
.hint-more{font-size:11px;font-weight:650;color:#1f7a52;text-decoration:none}
.hint-more:hover{text-decoration:underline}
html[data-theme="dark"] .hint-bubble{background:#1c2632;border-color:#344251;color:#c2ccd6}
html[data-theme="dark"] .hint-icon{color:#93a1af}
html[data-theme="dark"] .hint-icon:hover{color:#6fd6a4}
html[data-theme="dark"] .hint-more{color:#6fd6a4}
