.ad-header-tools>.ad-program-trigger{display:grid;place-items:center;flex:none;width:36px;height:36px;min-width:36px;min-height:0;margin:0;padding:0;border:1px solid var(--line,#80929b);border-radius:7px;background:transparent;color:inherit;cursor:pointer;box-shadow:none}
.ad-program-trigger:hover,.ad-program-trigger[aria-expanded=true]{background:color-mix(in srgb,currentColor 10%,transparent)}
.ad-program-panel{position:fixed;z-index:10000;right:calc(14px / var(--ad-program-zoom,1));top:calc(78px / var(--ad-program-zoom,1));width:min(560px,calc((100vw - 28px) / var(--ad-program-zoom,1)));max-height:calc((100dvh - 92px) / var(--ad-program-zoom,1));overflow:auto;overscroll-behavior:contain;box-sizing:border-box;padding:12px;border:1px solid var(--line,#dce6ee);border-radius:10px;background:var(--paper,var(--panel,#fff));color:var(--ink,var(--text,#152630));box-shadow:0 10px 35px #0004;font-family:inherit;font-size:.8rem;text-align:left;line-height:1.3}
.ad-program-panel[hidden]{display:none!important}
.ad-program-upload{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.ad-program-load{position:relative;display:inline-block;padding:7px 12px;border:1px solid var(--line,#80929b);border-radius:6px;cursor:pointer;font-weight:750}
.ad-program-load input{position:absolute;inset:0;width:100%;opacity:0;cursor:pointer}
.ad-program-close{display:grid;place-items:center;width:30px;height:30px;min-width:30px;margin:0;padding:0;border:0;background:transparent;color:inherit;font-size:1.3rem;cursor:pointer}
.ad-program-upload .ad-program-close{margin-left:auto}
.ad-program-file{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.ad-program-file strong{min-width:0;overflow-wrap:anywhere;font-size:.7rem}
.ad-program-date{flex:none;width:130px;min-width:0;padding:4px;border:1px solid var(--line,#80929b);border-radius:5px;background:transparent;color:inherit;font:inherit;font-size:.7rem;color-scheme:normal}
html[data-theme=dark] .ad-program-date{color-scheme:dark}
.ad-program-info{margin-bottom:10px;padding:8px;border:1px solid var(--line,#dce6ee);border-radius:6px}
.ad-program-info summary{cursor:pointer;font-weight:750;font-size:.72rem}
.ad-program-info p{margin:3px 0;font-size:.69rem;line-height:1.3;white-space:pre-wrap}
.ad-program-events{list-style:none;padding:0;margin:0;display:grid;gap:2px}
.ad-program-events li{display:grid;grid-template-columns:145px minmax(0,1fr);align-items:baseline;gap:8px;padding:4px 8px;border:1px solid var(--line,#dce6ee);border-radius:6px;font-size:.74rem;line-height:1.15}
.ad-program-events time{font-weight:750;font-variant-numeric:tabular-nums;white-space:nowrap;font-size:.68rem}
.ad-program-events li.is-current{border-color:#16966b;background:color-mix(in srgb,#16966b 13%,var(--paper,var(--panel,#fff)))}
.ad-program-events li.is-next{border-color:#e8ad42;background:color-mix(in srgb,#e8ad42 12%,var(--paper,var(--panel,#fff)))}
.ad-program-error{color:#c33;font-size:.75rem}.ad-program-empty{font-size:.75rem;color:var(--muted,#65777c)}
@media(max-width:600px){.ad-header-tools>.ad-program-trigger{width:30px;height:32px;min-width:30px}.ad-program-panel{top:calc(70px / var(--ad-program-zoom,1));max-height:calc((100dvh - 84px) / var(--ad-program-zoom,1));padding:9px}.ad-program-events li{grid-template-columns:1fr;gap:2px}.ad-program-file{align-items:flex-start}}
@media print{.ad-program-trigger,.ad-program-panel{display:none!important}}

@media(max-width:600px){.topbar:has(#menuTrigger){height:auto;min-height:82px;flex-wrap:wrap;gap:8px}.topbar:has(#menuTrigger)>.ad-header-tools{margin-left:auto}}
.ad-program-match{margin:0 0 7px;font-size:.72rem;font-weight:750;overflow-wrap:anywhere}
.ad-program-options{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px;font-size:.68rem}
.ad-program-options label{display:flex;align-items:center;gap:5px}
.ad-program-options input{margin:0;width:14px;height:14px;flex:none}
.ad-program-save-status{margin-left:auto;color:var(--muted,#65777c);font-size:.65rem}
.ad-program-events li{grid-template-columns:12px 145px minmax(0,1fr);column-gap:5px;row-gap:3px}
.ad-program-next{font-size:.82rem;color:#b67a09;line-height:1}
.ad-program-events li.is-past{opacity:.65}
.ad-program-event-controls{grid-column:2/-1;display:flex;align-items:center;gap:6px;min-width:0}
.ad-program-event-controls input{flex:1;min-width:0;padding:3px 5px;border:1px solid var(--line,#dce6ee);border-radius:4px;background:transparent;color:inherit;font:inherit;font-size:.68rem;line-height:1.1}
.ad-program-event-outcome{display:flex;gap:3px;flex:none}
.ad-program-event-outcome button{display:grid;place-items:center;flex:none;width:23px;height:23px;min-width:23px;min-height:0;padding:0;margin:0;border:1px solid var(--line,#dce6ee);border-radius:4px;background:transparent;color:inherit;font-size:.82rem;font-weight:800;cursor:pointer}
.ad-program-event-outcome [data-program-outcome=occurred]{color:#16875f}
.ad-program-event-outcome [data-program-outcome=missed]{color:#b94242}
.ad-program-event-outcome [data-program-outcome=occurred][aria-pressed=true]{background:#16875f;border-color:#16875f;color:#fff}
.ad-program-event-outcome [data-program-outcome=missed][aria-pressed=true]{background:#b94242;border-color:#b94242;color:#fff}
.ad-program-panel button:disabled,.ad-program-load:has(input:disabled){opacity:.5;cursor:default}
@media(max-width:600px){.ad-program-events li{grid-template-columns:12px minmax(0,1fr)}.ad-program-event-label{grid-column:2}.ad-program-event-controls{grid-column:2}}

.ad-program-panel [hidden],.ad-highlight-editor[hidden]{display:none!important}
.ad-program-tabs{position:sticky;top:-12px;z-index:2;display:flex;gap:5px;padding:8px 0;margin:-4px 0 8px;background:var(--paper,var(--panel,#fff));border-bottom:1px solid var(--line,#dce6ee)}
.ad-program-tabs button{flex:1;margin:0;padding:7px 10px;border:1px solid var(--line,#dce6ee);border-radius:6px;background:transparent;color:inherit;font:inherit;font-weight:750;cursor:pointer}
.ad-program-tabs [aria-selected=true]{background:var(--accent,#0c807d);border-color:var(--accent,#0c807d);color:#fff}
.ad-highlight-event-shell{position:relative;display:inline-flex;flex:none;align-items:stretch}
/* A reserved vertical column keeps remove, edit and highlight apart from the text. */
html body .ad-highlight-event-shell:has(>:is(.timeline-marker,.test-ticker-event)){height:78px;min-height:78px;max-height:78px;align-self:flex-start}
html body .ad-highlight-event-shell>.timeline-marker,html body .timeline-track>.timeline-marker{box-sizing:border-box;padding-right:33px;min-width:150px;max-width:216px;height:78px;min-height:78px;max-height:78px}
html body .ad-highlight-event-shell>.test-ticker-event{box-sizing:border-box;height:78px;min-height:78px;max-height:78px}
html body .ad-highlight-event-shell>:is(.timeline-marker,.test-ticker-event)>.timeline-marker-remove{position:absolute;top:4px;bottom:auto;right:5px;transform:none;display:grid;place-items:center;box-sizing:border-box;width:22px;height:22px;min-width:22px;min-height:22px;padding:1px;margin:0;font-size:15px;line-height:1;z-index:2}
html body .ad-highlight-event-shell>:is(.timeline-marker,.test-ticker-event)>.timeline-marker-edit{top:28px}
html body .ad-highlight-event-shell:has(>:is(.timeline-marker,.test-ticker-event))>.ad-highlight-star{top:52px;bottom:auto;right:5px;transform:none;width:22px;height:22px;min-width:22px;min-height:22px;box-sizing:border-box}
html body .ad-highlight-event-shell>.timeline-marker>strong,html body .ad-highlight-event-shell>.timeline-marker>em{grid-column:2;white-space:normal;line-height:1.2;overflow-wrap:anywhere}
html body .timeline-marker>.timeline-marker-meta,html body .test-ticker-event>.test-ticker-meta{position:absolute;left:5px;top:7px;display:grid;grid-template-columns:28px;grid-template-rows:18px 22px 18px;row-gap:3px;width:28px;height:64px;align-content:start;align-items:center;justify-items:center}
html body .timeline-marker-meta>.timeline-marker-minute,html body .test-ticker-meta>time{grid-row:1}
html body .timeline-marker-meta>:nth-child(2),html body .test-ticker-meta>.test-ticker-symbol{grid-row:2}
html body .timeline-marker-meta>.ad-manual-event-badge,html body .test-ticker-meta>.ad-manual-event-badge{grid-row:3}
html body .test-ticker-event{padding-left:38px}
html body .timeline-event-team{display:flex;align-items:center;gap:5px;min-width:0;font-style:normal}
html body .timeline-event-team>span{min-width:0;overflow-wrap:anywhere}
html body .timeline-event-team-logo{display:block;width:17px;height:17px;min-width:17px;max-width:17px;object-fit:contain;flex:0 0 17px}
.ad-highlight-star{position:absolute;right:4px;top:4px;display:grid;place-items:center;width:21px;height:21px;min-width:21px;min-height:0;padding:2px;margin:0;border:0;border-radius:4px;background:transparent;color:var(--muted,#65777c);cursor:pointer;z-index:1}
.ad-highlight-star svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8}
.ad-highlight-star:hover,.ad-highlight-star:focus-visible{background:color-mix(in srgb,#e8ad42 18%,transparent);color:#9b6a05}
.ad-highlight-star.is-marked{color:#bc850a}.ad-highlight-star.is-marked svg{fill:#f2c557}
.ad-highlight-note{position:absolute;right:5px;top:28px;display:grid;place-items:center;box-sizing:border-box;width:22px;height:22px;min-width:22px;min-height:22px;padding:2px;margin:0;border:0;border-radius:4px;background:transparent;color:var(--muted,#65777c);cursor:pointer;z-index:2}
.ad-highlight-note svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ad-highlight-note:hover,.ad-highlight-note:focus-visible,.ad-highlight-note.has-note{color:var(--accent,#0c807d);background:color-mix(in srgb,var(--accent,#0c807d) 12%,transparent)}
/* The crest has its own bottom row; the right edge belongs to the controls. */
html body .timeline-marker:has(>.timeline-marker-team){padding-bottom:26px}
html body .timeline-marker>.timeline-marker-team{left:50%;right:auto;bottom:4px;transform:translateX(-50%)}
html body .timeline-marker:has(>.timeline-marker-team)>strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;max-height:100%;overflow:hidden}
.bbl-action:has(>.ad-highlight-star){position:relative;padding-right:27px}
.ad-highlight-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;font-size:.7rem}
.ad-highlight-toolbar button,.ad-highlight-pane>button{margin:0;padding:6px 10px;border:1px solid var(--line,#cbd6d8);border-radius:6px;background:transparent;color:inherit;font:inherit;font-weight:700;cursor:pointer}
.ad-highlight-list{display:grid;gap:7px;list-style:none;margin:0;padding:0}
.ad-highlight-list li{padding:9px;border:1px solid var(--line,#cbd6d8);border-radius:7px;background:color-mix(in srgb,var(--accent,#0c807d) 9%,var(--paper,var(--panel,#fff)));font-size:.73rem}
.ad-highlight-list li>div{display:flex;gap:7px;align-items:baseline}.ad-highlight-list time{font-weight:750;font-variant-numeric:tabular-nums;white-space:nowrap}.ad-highlight-list strong{flex:1;overflow-wrap:anywhere}
.ad-highlight-list small{display:block;margin-top:4px;color:var(--muted,#65777c);font-size:.66rem}.ad-highlight-list p{margin:6px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
.ad-highlight-list button{flex:none;width:25px;height:25px;min-width:25px;min-height:0;margin:0;padding:0;border:1px solid var(--line,#cbd6d8);border-radius:5px;background:transparent;color:inherit;cursor:pointer}
.ad-highlight-editor{position:fixed;z-index:11000;width:min(320px,calc(100vw - 16px));max-height:calc((100dvh - 16px) / var(--ad-highlight-zoom,1));overflow:auto;box-sizing:border-box;padding:10px;border:1px solid var(--line,#cbd6d8);border-radius:8px;background:var(--paper,var(--panel,#fff));color:var(--ink,var(--text,#152630));box-shadow:0 8px 26px #0003;font:inherit;font-size:.78rem}
.ad-highlight-editor-head{display:flex;align-items:center;gap:8px}.ad-highlight-editor-head strong{flex:1;overflow-wrap:anywhere}.ad-highlight-editor-head button{border:0;background:transparent;color:inherit;font-size:1.2rem;cursor:pointer}
.ad-highlight-editor-time{display:block;margin:4px 0 7px;font-size:.67rem;color:var(--muted,#65777c)}
.ad-highlight-editor textarea{display:block;box-sizing:border-box;width:100%;min-height:65px;padding:6px;border:1px solid var(--line,#cbd6d8);border-radius:5px;background:transparent;color:inherit;font:inherit;resize:vertical}
.ad-highlight-editor-status{margin:5px 0;font-size:.65rem;color:var(--muted,#65777c)}.ad-highlight-editor-actions{display:flex;justify-content:space-between;gap:8px}
.ad-highlight-editor-actions button{margin:0;padding:5px 8px;border:1px solid var(--line,#cbd6d8);border-radius:5px;background:transparent;color:inherit;font:inherit;font-size:.68rem;cursor:pointer}
.ad-highlight-editor-actions [data-highlight-save]{background:var(--accent,#0c807d);border-color:var(--accent,#0c807d);color:#fff}.ad-highlight-editor button:disabled,.ad-highlight-editor textarea:disabled{opacity:.55;cursor:default}
.ad-highlight-print-frame{position:fixed;left:-10000px;top:0;width:800px;height:1000px;border:0}
@media print{.ad-highlight-editor,.ad-highlight-star{display:none!important}}

.ad-manual-event-add{flex:0 0 auto!important;margin-left:auto!important;padding:7px 10px!important;border:2px solid var(--accent,#087d79)!important;border-radius:6px!important;background:var(--accent,#087d79)!important;color:#fff!important;font:inherit!important;font-size:12px!important;font-weight:750!important;white-space:nowrap;cursor:pointer}.ad-manual-event-add>span{font-size:14px}.ad-manual-event-dialog{width:360px;z-index:12000}.ad-manual-event-dialog[hidden]{display:none!important}.ad-manual-event-dialog label{display:flex;flex-direction:column;gap:4px;margin:8px 0;font-size:12px}.ad-manual-event-dialog select,.ad-manual-event-dialog input{box-sizing:border-box;min-width:0;width:100%;padding:7px;border:1px solid var(--line,#cbd6d8);border-radius:5px;background:var(--paper,#fff);color:var(--ink,#152630);font:inherit}.ad-manual-event-dialog .ad-manual-event-fields{display:grid;grid-template-columns:minmax(0,1fr) 100px;gap:8px}.ad-manual-event-context{font-size:11px;color:var(--muted,#65777c);margin:5px 0 8px}.ad-manual-event-teams{display:grid;grid-template-columns:1fr 1fr;gap:7px}.ad-manual-event-teams button{display:flex;align-items:center;gap:7px;min-width:0;padding:7px;border:2px solid var(--line,#cbd6d8);border-radius:6px;background:var(--paper,#fff);color:inherit;font:inherit;font-size:11px;text-align:left;cursor:pointer}.ad-manual-event-teams button[aria-pressed=true]{border-color:var(--accent,#087d79);background:color-mix(in srgb,var(--accent,#087d79) 15%,var(--paper,#fff));box-shadow:0 0 0 1px var(--accent,#087d79)}.ad-manual-event-teams img{width:32px;height:32px;object-fit:contain;flex:0 0 32px}.ad-manual-event-teams span{overflow-wrap:anywhere}.ad-manual-event-dialog [type=submit]{background:var(--accent,#087d79);border-color:var(--accent,#087d79);color:white}.ad-manual-event-dialog :disabled{opacity:.6;cursor:wait}.league-match-timeline-summary:has(.ad-manual-event-add){flex-wrap:wrap}.ad-manual-event-dialog optgroup{font-weight:750}

html body .ad-manual-event-badge{display:inline-grid;place-items:center;box-sizing:border-box;width:16px;height:16px;min-width:16px;padding:1px;border-radius:50%;background:color-mix(in srgb,var(--accent,#087d79) 13%,transparent);color:var(--accent,#087d79);line-height:1;vertical-align:middle}
html body .ad-manual-event-badge svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}

/* Keep timeline action glyphs legible against the accent button. */
.ad-manual-event-add>span,.league-match-timeline-summary button.ad-manual-event-add>span{color:#fff!important;opacity:1!important}

/* Keep the full 78px event row and its scrollbar outside the lineup board. */
html body .match-timeline:has(.timeline-marker){height:auto;max-height:none;min-height:max-content;grid-template-rows:max-content max-content;flex:0 0 auto}
html body .match-timeline>.timeline-head:has(.ad-manual-event-add){grid-template-columns:auto minmax(0,1fr) auto auto}
html body :is(.match-timeline,.league-source-timeline) .timeline-track:has(.timeline-marker){box-sizing:border-box;height:96px;min-height:96px;max-height:none;flex:none;padding:2px 0 10px;overflow-x:auto;overflow-y:hidden}
.ad-highlight-list .ad-highlight-team-logos{display:inline-flex;align-items:center;align-self:center;gap:4px;flex:none}
.ad-highlight-list .ad-highlight-team-logos img{display:block;width:28px;height:28px;object-fit:contain}
@media(max-width:680px){html body .match-timeline>.timeline-head:has(.ad-manual-event-add){grid-template-columns:minmax(0,1fr) auto}html body .match-timeline>.timeline-head:has(.ad-manual-event-add)>.timeline-switches{grid-column:1/-1;grid-row:2}}
