/* Matchday Editorial. Main board layout, layered over the existing dialog styles. */
:root{--bg:#151718;--surface:#1b1e20;--surface-raised:#25282a;--field:#202325;--line:#3b3e40;--text:#f6f3ef;--muted:#b1b4b5;--red:#c9213b;--accent-text:#ff94a4;--accent-wash:#38242b;--focus:#ff9dad;--pitch-bg:#192c27;--pitch-ink:#f0f5ef;--pitch-muted:#b5c9bd;--pitch-line:#8baa97;--pitch-slot-bg:#233e33;--pitch-slot-border:#6b8b78;--inverse:#fffaf8}
:root[data-theme=light]{--bg:#f8f6f2;--surface:#faf8f5;--surface-raised:#f0ece8;--field:#f7f4f0;--line:#d7d4cf;--text:#1c2025;--muted:#62666d;--red:#b91c34;--accent-text:#ae1830;--accent-wash:#f6e6e7;--focus:#b91c34;--pitch-bg:#edf2ec;--pitch-ink:#20392e;--pitch-muted:#536e5d;--pitch-line:#8fa896;--pitch-slot-bg:#f8fbf6;--pitch-slot-border:#8ca492;--success:#347245}
.editorial{font-size:14px;background:var(--bg)}
.editorial [hidden]{display:none!important}
.editorial .ui-icon{width:20px;height:20px;flex:0 0 20px;vertical-align:middle;opacity:.85}
:root:not([data-theme=light]) .ui-icon{filter:invert(1)}
.editorial .button,.editorial .icon-button,.editorial .add-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;border-radius:5px;font-size:14px;font-weight:700;padding:10px 18px;letter-spacing:0}
.editorial .icon-button{width:44px;min-width:44px;padding:10px;background:transparent;border:1px solid var(--line)}
.editorial button{transition:background-color .16s ease,color .16s ease,border-color .16s ease,transform .16s ease}
.editorial button:focus-visible,.editorial a:focus-visible,.editorial summary:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.editorial .site-header{height:74px;padding:10px 28px;gap:20px;background:var(--surface);border-bottom:1px solid var(--line);position:relative;z-index:3}
.editorial .brand{font:800 19px/1.05 var(--display);gap:14px;letter-spacing:-.5px;white-space:nowrap}
.editorial .brand b{display:inline;font:inherit;letter-spacing:inherit;margin:0}
.editorial .crest{width:42px;height:50px;flex-shrink:0;font:800 22px/1 var(--display);background:var(--red);color:#fff}
.editorial .crest span{font:700 9px/1.5 var(--body);letter-spacing:1.5px}
.editorial .header-right{display:flex;align-items:center;gap:12px;margin-left:auto}
.editorial .theme-switch{border:0;background:none;padding:0;gap:0}
.editorial .theme-switch button{width:38px;min-height:40px;justify-content:center;border-radius:4px;padding:8px;color:var(--muted)}
.editorial .theme-switch button[aria-pressed=true]{background:var(--surface-raised);box-shadow:none}
.editorial .header-right>.button{min-width:104px;height:46px}
.editorial #help-button{border:0;width:36px;min-width:36px;padding:8px}
.editorial #save-status{font-size:12px;line-height:1.4;max-width:185px;color:var(--muted);display:flex;align-items:center;gap:7px}
.editorial #save-status:before{content:none}
.editorial #save-status[data-status=saved]:before{content:'';display:block;width:8px;height:8px;flex-shrink:0;border-radius:50%;background:#38a763}
.editorial main{max-width:none;margin:0;padding:0}
.editorial .team-bar{margin:0;padding:12px 28px;border-bottom:1px solid var(--line);background:var(--surface);display:flex;justify-content:space-between}
.editorial .team-bar:not(:has(.team-bar-actions>button:not([hidden]))){display:none}
.editorial .team-bar p{margin:0;max-width:65ch}
.editorial .preview-note,.editorial .sync-alert{margin:0;border-radius:0;padding:16px 28px}
.editorial .workspace{display:grid;grid-template-columns:minmax(240px,21%) minmax(0,1fr) minmax(315px,27%);gap:0;align-items:stretch;min-height:calc(100svh - 74px)}
.editorial .panel{border:0;border-radius:0;background:transparent;min-width:0}
.editorial .matchday-rail{background:#af1931 url('assets/matchday-rail.webp') center/cover;color:#fff9f3;position:relative;display:grid;grid-template-columns:39% minmax(0,1fr);gap:4px;padding:40px 20px 30px 18px;min-width:0;overflow:hidden}
.editorial .rail-wordmark{writing-mode:vertical-rl;transform:rotate(180deg);margin:0;align-self:start;justify-self:center;font:900 clamp(64px,7.5vw,112px)/.95 var(--display);letter-spacing:-5px;white-space:nowrap;text-transform:uppercase;padding:0}
.editorial .rail-content{min-width:0;display:flex;flex-direction:column;align-items:stretch;gap:0}
.editorial .rail-team h2{font:700 20px/1.2 var(--display);margin:4px 0 14px;overflow-wrap:anywhere;text-wrap:balance}
.editorial .team-mode{display:block;background:none;padding:0;border:0;color:#ffe8e8;font:600 10px/1.5 var(--body);letter-spacing:1px;white-space:normal}
.editorial .team-mode:before{display:none}
.editorial .starting-heading{margin:50px 0 42px;display:flex;flex-direction:column}
.editorial .starting-heading>span:first-child{font:700 24px/1.15 var(--display)}
.editorial .starting-heading>strong{font:800 clamp(90px,10vw,148px)/1.05 var(--display);letter-spacing:-5px}
.editorial .lineup-count{padding:0;margin:14px 0 0;color:#ffe6e7;font:500 11px/1.6 var(--body);background:transparent;border:0;border-radius:0;white-space:normal}
.editorial .board-toolbar{padding:28px 0 0;margin:0;border:0;border-top:1px solid #ffffff50;display:flex;flex-direction:column;align-items:stretch;gap:24px}
.editorial .control-label,.editorial .formation-control label{color:#fff;font-size:13px;font-weight:700;line-height:1.4;display:block!important;letter-spacing:0}
.editorial .match-setting{gap:10px}
.editorial .format-control{display:flex;border:1px solid #ffffff68;background:transparent;border-radius:4px;overflow:hidden;width:100%;padding:0}
.editorial .format-control button{min-width:0;min-height:46px;flex:1;padding:5px 3px;font:600 11px/1.3 var(--body);background:none;border:0;color:#fff;white-space:nowrap;border-radius:0}
.editorial .format-control button.active{background:#fff8f3;color:#a61b30;box-shadow:none}
.editorial .format-control button:hover:not(.active){background:#ffffff1c}
.editorial .formation-control{display:flex;flex-direction:column;align-items:stretch;gap:10px;margin:0}
.editorial .formation-control select{width:100%;min-width:0;min-height:48px;padding:10px;font:700 17px var(--body);background:#8e142a;color:#fff;border:1px solid #ffffff70;border-radius:4px;appearance:auto;color-scheme:dark}
.editorial .formation-explanation{font-size:11px;line-height:1.7;color:#ffe6e7;padding:0;margin:18px 0 0;border:0}
.editorial .rail-footer{margin-top:auto;display:flex;align-items:center;gap:12px;padding-top:48px;margin-left:-85%;min-height:100px}
.editorial .rail-footer .crest{width:84px;height:104px;font-size:39px;background:#1b1719;color:#e8334a}
.editorial .rail-footer .crest span{font-size:14px}
.editorial .rail-footer p{font-size:10px;line-height:2;letter-spacing:2.5px;color:#fff2f0}
.editorial .board-panel{order:0;display:flex;flex-direction:column;min-width:0;background:var(--pitch-bg)}
.editorial .pitch{--portrait:clamp(72px,6.2vw,96px);--empty-position:56px;width:100%;margin:0;min-height:0;height:auto;aspect-ratio:auto;flex:1;position:relative;border:0;border-radius:0;background:var(--pitch-bg);box-shadow:none;overflow:hidden}
.editorial .pitch-lines{inset:14px;width:calc(100% - 28px);height:calc(100% - 28px);opacity:.36;stroke:var(--pitch-line);stroke-width:1.25}
.editorial .pitch-lines .spot{fill:var(--pitch-line)}
.editorial #pitch-slots{position:absolute;inset:22px 3.5% 48px}
.editorial .pitch-wordmark,.editorial .attack-direction{display:none}
.editorial .pitch-slot{width:26%;max-width:172px;min-width:0;text-align:center;display:flex;flex-direction:column;align-items:center;gap:0;transform:translate(-50%,-50%);z-index:1}
.editorial .slot-player,.editorial .pitch-slot.keeper .slot-player{width:var(--portrait);height:var(--portrait);border-radius:50%;border:2px solid var(--pitch-bg);box-shadow:0 2px 8px #071b1426;background:#263d32;color:#fff;display:grid;place-items:center;overflow:visible;position:relative;margin:0 auto;cursor:grab;touch-action:none}
.editorial .slot-player:hover:not(:disabled){transform:translateY(-3px);box-shadow:0 5px 12px #14201b26;background:#2d4539}
.editorial .slot-player img{position:absolute;width:100%;height:100%;inset:0;border-radius:50%;object-fit:cover;object-position:center;opacity:1}
.editorial .slot-player:has(img){background:var(--red)}
.editorial .slot-player .slot-monogram{position:static;font:700 calc(var(--portrait) * .38)/1 var(--display);color:#f8f5f0;letter-spacing:-2px;font-style:normal}
.editorial .slot-player .slot-number{position:absolute;right:-6px;top:0;width:calc(var(--portrait) * .32);height:calc(var(--portrait) * .32);min-width:30px;min-height:30px;display:grid;place-items:center;border:2px solid var(--pitch-bg);border-radius:50%;background:var(--red);color:#fff;font:700 calc(var(--portrait) * .21)/1 var(--display);z-index:2}
.editorial .slot-name{max-width:100%;font:700 14px/1.3 var(--body);white-space:normal;overflow:visible;text-overflow:clip;color:var(--pitch-ink);text-shadow:none;margin:9px 0 0;overflow-wrap:anywhere;text-wrap:balance}
.editorial .position-label{font:400 12px/1.3 var(--body);color:var(--pitch-muted);margin:5px 0 0;letter-spacing:0;text-transform:none;max-width:100%}
.editorial .slot-button{width:var(--empty-position);height:var(--empty-position);min-width:44px;min-height:44px;border:1px solid var(--pitch-slot-border);border-radius:50%;background:var(--pitch-slot-bg);display:grid;place-items:center;margin:0 auto;box-shadow:0 2px 5px #071b140a;color:var(--pitch-ink);opacity:1}
.editorial .slot-button:hover:not(:disabled){transform:translateY(-2px)}
.editorial .slot-button .ui-icon{width:22px;height:22px;opacity:1}
.editorial .slot-open-label{display:none}
.editorial .pitch-slot:not(:has(.slot-player)) .position-label{font-weight:600;margin-top:10px}
.editorial .pitch-lines *{vector-effect:non-scaling-stroke}
@media(min-width:901px){
 .editorial .workspace{height:clamp(660px,calc(100svh - 132px),880px);min-height:0}
 .editorial .workspace:has(.pitch[data-format='11']){min-height:720px}
 .editorial .board-panel,.editorial .matchday-rail{min-height:0}
 .editorial .squad-panel{height:100%;max-height:none;min-height:0;overscroll-behavior:contain}
 .editorial .starting-heading{margin:28px 0 24px}
 .editorial .starting-heading>strong{font-size:108px}
 .editorial .board-toolbar{padding-top:20px;gap:18px}
 .editorial .formation-explanation{margin-top:20px}
}
.editorial .pitch[data-format='11']{--portrait:clamp(52px,5.2vw,76px);--empty-position:48px}
.editorial .pitch[data-format='11'] .slot-player{width:var(--portrait);height:var(--portrait);min-width:44px;min-height:44px}
.editorial .pitch[data-format='11'] .pitch-slot{width:18.5%;max-width:130px}
.editorial .pitch[data-format='11'] .slot-name{font-size:13px;line-height:1.25;margin-top:6px}
.editorial .pitch[data-format='11'] .slot-number{font-size:22px}
.editorial .pitch[data-format='11'] .position-label{font-size:11px;margin-top:3px}
.editorial .pitch[data-format='11'] .slot-button{width:var(--empty-position);height:var(--empty-position)}
.editorial .pitch-hint{display:flex;align-items:center;padding:7px 16px;gap:8px;min-height:54px;margin:0;color:var(--pitch-muted);border-top:1px solid color-mix(in srgb,var(--pitch-line),transparent 65%);background:var(--pitch-bg);font-size:11px;line-height:1.5}
.editorial .pitch-hint>span{max-width:47ch}
.editorial .board-tools{margin-left:auto;display:flex;flex:0 0 auto;gap:4px}
.editorial .board-tools .icon-button{border:0;color:var(--pitch-ink);margin:0}
.editorial #clear-button{display:none!important}
.editorial .squad-panel{order:1;border-left:1px solid var(--line);background:var(--surface);display:flex;flex-direction:column;min-width:0;padding:30px 24px 18px;max-height:calc(100svh - 74px);min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.editorial .panel-top{padding:0;border:0;display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:20px}
.editorial .panel-top h2{font:800 28px/1.2 var(--display);text-transform:none;letter-spacing:-1px;margin:0}
.editorial .panel-top .count{font:500 13px var(--body);color:var(--muted);padding:0;background:none;vertical-align:middle;margin-left:5px}
.editorial .panel-top .add-button{padding:10px 13px;min-height:44px;border:0;white-space:nowrap;font-size:12px}
.editorial .add-button .ui-icon{filter:invert(1);width:17px;height:17px;flex-basis:17px}
.editorial .squad-search{padding:0;position:relative;margin:0 0 16px;display:flex;align-items:center;background:var(--field);border:1px solid var(--line);border-radius:5px}
.editorial .squad-search .ui-icon{position:absolute;left:12px;width:20px;height:20px}
.editorial .squad-search input{padding:11px 12px 11px 40px;width:100%;min-height:44px;font-size:14px;border:0;background:transparent;border-radius:5px;color:var(--text)}
.editorial .squad-search>span{display:none}
.editorial .sidebar-tabs{display:flex;gap:0;background:var(--surface-raised);border-radius:4px;margin:0 0 22px;padding:0}
.editorial .sidebar-tabs button{flex:1;min-height:44px;padding:10px;font-size:13px;font-weight:700;border-radius:4px;color:var(--muted)}
.editorial .sidebar-tabs button[aria-selected=true]{background:var(--red);color:#fff}
.editorial .bench{padding:0;border:0;display:block;background:none}
.editorial .bench-heading{margin:0 0 20px;padding:0;display:block}
.editorial .bench-context{font-size:11px;line-height:1.5;color:var(--muted);margin:0}
.editorial .bench-players{display:flex;flex-direction:column;gap:24px}
.editorial .bench-position-group{margin:0;padding:0}
.editorial .bench-group-heading{display:flex;justify-content:space-between;align-items:center;padding:0 0 10px;border-bottom:1px solid var(--line);margin:0;gap:10px}
.editorial .bench-group-heading h3{font:600 11px/1.5 var(--body);letter-spacing:.8px;text-transform:uppercase;color:var(--muted);margin:0}
.editorial .bench-group-count{font-size:11px;background:none;padding:0;color:var(--muted)}
.editorial .bench-group-players{display:flex;flex-direction:column;gap:0}
.editorial .bench-person-card{background:none;border:0;border-bottom:1px solid var(--line);border-radius:0;display:flex;align-items:center;gap:0;padding:8px 0;min-width:0}
.editorial .bench-person-card .bench-chip{display:flex;gap:12px;align-items:center;flex:1;min-width:0;padding:5px 0;background:none;border:0;min-height:64px;border-radius:4px;color:var(--text);text-align:left}
.editorial .bench-chip:hover{background:var(--accent-wash)}
.editorial .person-avatar,.editorial .bench-chip>.person-avatar{position:relative;display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;border-radius:50%;background:#282b2c;color:#fff;font:600 18px var(--display);overflow:visible}
.editorial .person-avatar img{width:100%;height:100%;border-radius:50%;object-fit:cover}
.editorial .person-avatar b{position:absolute;right:-4px;bottom:-1px;display:grid;place-items:center;width:22px;height:22px;border:1px solid var(--surface);border-radius:50%;background:var(--red);color:#fff;font:700 11px var(--body)}
.editorial .bench-chip>.bench-person{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0;background:none;height:auto;width:auto;align-items:flex-start;color:var(--text)}
.editorial .bench-player-name{font:700 13px/1.4 var(--body);overflow-wrap:anywhere;white-space:normal}
.editorial .bench-action{font-size:11px;color:var(--muted);margin:0;line-height:1.5}
.editorial .bench-role-badges{display:none}
.editorial .guest-tag{display:inline;font:500 10px var(--body);padding:2px 5px;border-radius:3px;background:var(--accent-wash);color:var(--accent-text);margin-left:4px;white-space:nowrap}
.editorial .bench-edit,.editorial .card-edit{min-width:40px;width:40px;min-height:44px;padding:10px;border:0;background:none;color:var(--muted);border-radius:4px;flex:0 0 40px}
.editorial .row-place-icon{width:22px;height:22px;flex:0 0 22px;margin-left:auto}
.editorial .bench-unset-help{font-size:12px;line-height:1.6;color:var(--muted);margin:12px 0 0}
.editorial .bench-group-note{font-size:11px;line-height:1.6;margin:16px 0;color:var(--muted)}
.editorial #add-guest{display:inline-flex;align-items:center;gap:7px;font-size:12px;min-height:44px;margin:16px 0 0;padding:6px 0;color:var(--accent-text)}
.editorial .squad-footer{display:flex;align-items:center;gap:10px;border:0;padding:22px 0 0;margin-top:auto;font-size:11px;line-height:1.65;color:var(--muted)}
.editorial .squad-tabs{margin:0 0 14px;padding:0;display:flex;border-bottom:1px solid var(--line);gap:5px;justify-content:space-between}
.editorial .squad-tabs button{font-size:11px;padding:10px 4px;min-height:44px}
.editorial .squad-tabs span{font-size:10px}
.editorial .roster{padding:0;display:flex;flex-direction:column;gap:0;max-height:none;overflow:visible}
.editorial .player-card{display:flex;flex-direction:row;align-items:center;border:0;border-bottom:1px solid var(--line);box-shadow:none;background:none;border-radius:0;padding:10px 0;transform:none;overflow:visible}
.editorial .player-card:hover{transform:none;box-shadow:none;border-color:var(--line)}
.editorial .card-select{display:flex;flex-direction:row;align-items:center;gap:12px;min-width:0;width:auto;background:none;padding:5px 0;border:0;text-align:left;flex:1}
.editorial .person-copy{flex:1;min-width:0}
.editorial .card-name{padding:0;margin:0;min-height:0;display:block;text-transform:none;font:700 13px/1.4 var(--body);color:var(--text);overflow-wrap:anywhere}
.editorial .card-name strong{font:inherit;text-wrap:initial}
.editorial .card-positions{justify-content:flex-start;padding:0;min-height:0;gap:3px;margin:5px 0 0}
.editorial .card-positions>span{font:500 10px var(--body);padding:2px 4px;border:0;background:var(--surface-raised);color:var(--muted)}
.editorial .card-positions small{font-size:11px;line-height:1.5;color:var(--muted)}
.editorial .card-status{display:block;font:400 10px/1.5 var(--body);margin:5px 0 0;color:var(--muted)}
.editorial .card-status:before{display:none}
.editorial .card-status.on{color:var(--success)}
.editorial .position-browser{padding:0;margin:0 0 14px}
.editorial .position-filter{font-size:11px;padding:8px;min-height:44px}
.editorial .position-filters{grid-template-columns:1fr 1fr;gap:6px}
.editorial .page-footer{margin:0;padding:20px 28px;background:var(--surface);border-top:1px solid var(--line);font-size:10px;align-items:flex-start}
.editorial .backup-tools{max-width:340px}
.editorial .mobile-workspace-nav{display:none}
.editorial .empty-message{font-size:13px;line-height:1.7;margin:20px 0;padding:16px 0;color:var(--muted)}
.editorial .drag-ghost{border-radius:50%;background:var(--red);color:white}
.editorial .pitch-slot.drag-target .slot-player,.editorial .pitch-slot.drag-target .slot-button{outline:3px solid var(--red);outline-offset:5px}
.editorial #main-dialog{border-radius:12px;box-shadow:0 24px 100px #0004}
.editorial #dialog-content{padding:28px}
.editorial .dialog-close{border-radius:50%}
.editorial .board-option{border-radius:5px}
@media(min-width:1700px){.editorial .workspace{grid-template-columns:320px minmax(0,1fr) 410px}.editorial .pitch{--portrait:104px}.editorial .pitch-slot{max-width:230px}.editorial .slot-name{font-size:17px}.editorial .rail-wordmark{font-size:112px}}
@media(max-width:1250px) and (min-width:901px){.editorial .workspace{grid-template-columns:220px minmax(0,1fr) 300px}.editorial .matchday-rail{padding:30px 14px 24px 10px;grid-template-columns:31% 1fr}.editorial .rail-wordmark{font-size:62px;letter-spacing:-3px}.editorial .rail-team h2{font-size:17px}.editorial .starting-heading>strong{font-size:106px}.editorial .rail-footer{margin-left:-43%}.editorial .squad-panel{padding:24px 16px 16px}.editorial .panel-top h2{font-size:24px}.editorial .panel-top .add-button{padding:8px 10px;font-size:11px;gap:3px}.editorial .site-header{padding:10px 20px}.editorial .brand{font-size:16px}.editorial .header-right{gap:8px}.editorial #save-status{max-width:128px;font-size:11px}.editorial .pitch{--portrait:76px}.editorial .slot-name{font-size:12px}.editorial .position-label{font-size:11px}.editorial .pitch[data-format='11']{--portrait:56px}.editorial .pitch[data-format='11'] .slot-name{font-size:11px}.editorial .pitch[data-format='11'] .position-label{font-size:10px}}
@media(max-width:900px){
 .editorial .site-header{height:auto;min-height:74px;flex-wrap:wrap;padding:14px 18px;gap:12px}
 .editorial .brand{font-size:17px}.editorial .header-right{gap:8px}.editorial #save-status{max-width:none;order:4;width:100%;justify-content:flex-end;font-size:11px}
 .editorial .workspace{display:grid;grid-template-columns:1fr;min-height:0}
 .editorial .matchday-rail{grid-template-columns:1fr;padding:22px 24px;gap:0;min-height:0;background-position:center 30%}
 .editorial .rail-wordmark{writing-mode:horizontal-tb;transform:none;font-size:40px;line-height:1;margin:0 0 12px;letter-spacing:-1.8px;justify-self:start}
 .editorial .rail-content{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:18px 24px}
 .editorial .rail-team h2{font-size:17px;margin:0 0 7px;text-wrap:initial}.editorial .team-mode{font-size:9px}
 .editorial .starting-heading{margin:0;grid-column:2;grid-row:1;flex-direction:row;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;max-width:140px}
 .editorial .starting-heading>span:first-child{font-size:15px}.editorial .starting-heading>strong{font-size:40px;letter-spacing:-2px}.editorial .lineup-count{margin:0;width:100%;text-align:right;font-size:10px}
 .editorial .board-toolbar{padding:0;border:0;flex-direction:row;grid-column:1/-1;gap:20px;align-items:flex-end}.editorial .match-setting{flex:1}.editorial .formation-control{flex:1;max-width:190px}.editorial .format-control button{font-size:13px}.editorial .control-label,.editorial .formation-control label{font-size:12px}
 .editorial .formation-explanation{margin:0;grid-column:1/-1;font-size:11px}.editorial .rail-footer{display:none}
 .editorial .board-panel{order:0}.editorial .pitch{height:auto;min-height:0;aspect-ratio:1;--portrait:clamp(72px,12vw,96px);--empty-position:52px}
 .editorial #pitch-slots{inset:22px 4% 50px}.editorial .slot-name{font-size:14px}.editorial .position-label{font-size:11px}
 .editorial .pitch[data-format='11']{--portrait:clamp(52px,9vw,72px);--empty-position:48px;aspect-ratio:.88}.editorial .pitch[data-format='11'] .slot-name{font-size:12px}
 .editorial .squad-panel{max-height:none;min-height:0;border-left:0;border-top:1px solid var(--line);padding:26px 24px}.editorial .bench-players{gap:22px}.editorial .bench-group-players{display:grid;grid-template-columns:1fr 1fr;column-gap:24px}.editorial .squad-footer{margin-top:20px}
 .editorial .roster{display:grid;grid-template-columns:1fr 1fr;gap:0 24px}.editorial .mobile-workspace-nav{display:flex;gap:0;padding:0;background:var(--surface);border-bottom:1px solid var(--line)}.editorial .mobile-workspace-nav button{flex:1;border:0;border-radius:0;min-height:44px;padding:10px;background:none;font:600 12px var(--body)}.editorial .mobile-workspace-nav button:first-child{color:var(--accent-text)}
 .editorial .page-footer{flex-direction:row;padding:20px 24px;font-size:10px}
}
@media(max-width:600px){
 .editorial .site-header{padding:12px 16px;display:grid;grid-template-columns:1fr;gap:10px}
 .editorial .brand{font-size:15px;width:calc(100% - 96px);white-space:normal;gap:10px}.editorial .brand b{display:block;font-size:11px;letter-spacing:2px;margin-top:4px}.editorial .crest{width:32px;height:39px;font-size:17px}
 .editorial .header-right{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;width:100%;margin:0}
 .editorial #save-status{grid-column:1;grid-row:1;order:0;font-size:10px;line-height:1.4;justify-content:flex-start;width:auto;max-width:135px}
 .editorial .theme-switch{position:absolute;right:52px;top:12px}.editorial .theme-switch button{width:32px;min-height:38px;padding:7px}
 .editorial #help-button{position:absolute;right:12px;top:12px;width:36px;min-height:38px}
 .editorial .header-right>.button{min-width:0;height:44px;padding:10px 13px;font-size:12px}
 .editorial .matchday-rail{padding:20px 18px}.editorial .rail-wordmark{font-size:36px;margin-bottom:14px}.editorial .rail-content{gap:18px 16px}.editorial .rail-team h2{font-size:16px}.editorial .board-toolbar{gap:16px}.editorial .formation-control{max-width:130px}.editorial .format-control button{font-size:11px;min-height:44px}.editorial .formation-control select{min-height:46px;font-size:15px}.editorial .starting-heading{max-width:98px;gap:5px}.editorial .starting-heading>span:first-child{font-size:13px}.editorial .starting-heading>strong{font-size:36px}.editorial .formation-explanation{font-size:10px}
 .editorial .pitch{aspect-ratio:.8;min-height:480px;--portrait:clamp(56px,16vw,76px);--empty-position:48px}.editorial #pitch-slots{inset:20px 2% 42px}.editorial .pitch-lines{inset:8px;width:calc(100% - 16px);height:calc(100% - 16px)}
 .editorial .pitch-slot{width:28%;max-width:none}.editorial .slot-name{font-size:11px;line-height:1.3;margin-top:7px;max-width:100%}.editorial .position-label{font-size:10px;margin-top:4px}.editorial .slot-open-label{font-size:10px;margin-top:7px}.editorial .slot-player .slot-number{width:28px;height:28px;min-width:28px;min-height:28px;font-size:16px;right:-6px;border-width:1.5px}.editorial .slot-player .slot-monogram{letter-spacing:-1px}
 .editorial .pitch[data-format='11']{--portrait:clamp(44px,11vw,56px);--empty-position:44px;aspect-ratio:.62;min-height:600px}.editorial .pitch[data-format='11'] .pitch-slot{width:18.5%;max-width:none}.editorial .pitch[data-format='11'] .slot-name{font-size:10px;line-height:1.25;word-spacing:0}.editorial .pitch[data-format='11'] .position-label{font-size:9px;margin-top:4px}.editorial .pitch[data-format='11'] .slot-number{width:22px;height:22px;min-width:22px;min-height:22px;font-size:12px;right:-5px}.editorial .pitch[data-format='11'] .slot-button{min-width:44px;min-height:44px}
 .editorial .pitch-hint{padding:8px 12px;font-size:10px}.editorial .board-tools .icon-button{min-width:40px;width:40px;min-height:44px}
 .editorial .squad-panel{padding:24px 18px}.editorial .panel-top h2{font-size:28px}.editorial .bench-group-players,.editorial .roster{display:flex;flex-direction:column;gap:0}.editorial .bench-chip>.person-avatar,.editorial .person-avatar{flex-basis:50px;width:50px;height:50px}.editorial .bench-player-name,.editorial .card-name{font-size:14px}.editorial .bench-edit,.editorial .card-edit{width:44px;min-width:44px;flex-basis:44px}.editorial .bench-person-card .bench-chip{min-height:72px}.editorial .bench-action{font-size:11px}.editorial .squad-tabs button{font-size:12px}.editorial .squad-tabs span{font-size:10px}.editorial .squad-search input{font-size:16px}.editorial .squad-footer{font-size:11px}
 .editorial .page-footer{display:flex;flex-direction:column;gap:16px;padding:22px 18px}.editorial .page-footer>span{font-size:9px}.editorial .team-bar{padding:12px 16px;flex-direction:column;align-items:stretch}.editorial .preview-note,.editorial .sync-alert{padding:16px}.editorial #dialog-content{padding:24px}
}
@media(max-width:360px){.editorial .pitch:not([data-format='11']){min-height:560px}}
@media(prefers-reduced-motion:reduce){.editorial *{transition:none!important;animation:none!important;scroll-behavior:auto!important}}
/* Neutralize legacy wrapping-card layout in the new single-column bench. */
.editorial .bench-players{align-items:stretch;grid-template-columns:none}
.editorial .bench-position-group{width:100%}
.editorial .bench-person-card{flex:0 0 auto;width:100%}
.editorial .bench-chip>.row-place-icon{background:none;border-radius:0;color:inherit;display:block}
.editorial .rail-footer{margin-left:-70%;gap:14px}
.editorial #save-status{display:flex!important}
@media(min-width:901px){.editorial .rail-footer{position:absolute;left:28px;right:20px;bottom:24px;padding:0;margin:0;min-height:0;align-items:flex-end}.editorial .rail-footer .crest{width:48px;height:58px;font-size:24px}.editorial .rail-footer .crest span{font-size:9px}.editorial .rail-footer p{font-size:9px;letter-spacing:1.5px;margin:0 0 4px}.editorial .rail-wordmark{font-size:clamp(64px,7.2vw,108px)}}
.editorial .photo-input{margin:8px 0 24px;align-items:center}
.editorial .photo-preview{border-radius:50%;width:78px;height:78px;background:var(--surface-raised);object-fit:cover}
.editorial .photo-controls{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.editorial .photo-controls #remove-photo{min-height:32px;font-size:11px;color:var(--muted)}
.editorial .photo-preview{color:var(--text);font:700 26px var(--display)}
.editorial .photo-controls button:disabled{opacity:.45;cursor:default}
@media(min-width:1251px){.editorial .slot-name{font-size:17px}.editorial .position-label{font-size:13px}.editorial .bench-player-name,.editorial .card-name{font-size:14px}.editorial .slot-player .slot-number{font-size:calc(var(--portrait) * .18)}}
@media(min-width:1251px){.editorial .pitch:not([data-format='11']){--portrait:clamp(76px,6.2vw,96px)}.editorial .pitch:not([data-format='11']) .slot-name{font-size:15px}.editorial .pitch:not([data-format='11']) .position-label{font-size:12px}}
.editorial .slot-player img,.editorial .person-avatar img,.editorial .ui-icon{-webkit-user-drag:none;user-select:none}

/* A consistent form rhythm and short, purposeful interaction feedback. */
.editorial{
 --space-xs:4px;--space-sm:8px;--space-md:12px;--space-lg:16px;--space-xl:24px;--space-2xl:32px;
 --motion-fast:140ms;--motion-normal:220ms;--motion-ease:cubic-bezier(.22,1,.36,1);
}
html:has(.editorial){scrollbar-gutter:stable}
.editorial.dialog-open{overflow:hidden}
.editorial button{transition:transform var(--motion-fast) var(--motion-ease),opacity var(--motion-fast) var(--motion-ease)}
.editorial :is(.button,.icon-button,.add-button):active:not(:disabled){transform:scale(.975)}
.editorial button:disabled{cursor:default}
.editorial :is(input,select):focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.editorial .sidebar-tabs{position:relative;isolation:isolate}
.editorial .sidebar-tabs:before{content:'';position:absolute;inset:0 auto 0 0;width:50%;border-radius:4px;background:var(--red);transition:transform var(--motion-normal) var(--motion-ease);z-index:-1}
.editorial .sidebar-tabs[data-view=squad]:before{transform:translateX(100%)}
.editorial .sidebar-tabs button[aria-selected=true]{background:transparent}
.editorial .sidebar-tabs button{position:relative}
.editorial #main-dialog{width:min(620px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:hidden;border-radius:12px;overscroll-behavior:contain}
.editorial #dialog-content{display:flex;flex-direction:column;max-height:calc(100dvh - 34px);padding:0;min-height:0}
.editorial .dialog-header{padding:var(--space-xl) var(--space-xl) var(--space-lg);margin:0;gap:var(--space-lg);flex-shrink:0;align-items:center}
.editorial .dialog-header h2{font-size:24px;line-height:1.25;letter-spacing:-.5px;outline:none}
.editorial .dialog-header .icon-button{background:var(--surface-raised);border-color:transparent;flex-shrink:0}
.editorial .dialog-body{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:0 var(--space-xl) var(--space-xl);scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.editorial .dialog-description{font-size:14px;line-height:1.6;margin:0 0 var(--space-xl)}
/* Separate player choices within each group and leave room for focus outlines. */
.editorial .picker-list{display:flex;flex-direction:column;gap:var(--space-xl);padding:var(--space-sm);scroll-padding:var(--space-sm);scrollbar-gutter:stable}
.editorial .picker-group{display:flex;flex-direction:column;gap:var(--space-md);flex-shrink:0;min-width:0}
.editorial .picker-group h3{margin:0}
.editorial .picker-player{padding:var(--space-md) var(--space-lg);flex-shrink:0}
.editorial .picker-number,.editorial .picker-player .guest-tag{flex-shrink:0}
.editorial .picker-player>span:nth-child(2){min-width:0;overflow-wrap:anywhere}
.editorial #dialog-content:has(#player-form) .dialog-body{display:flex;padding:0;overflow:hidden}
.editorial #player-form{display:flex;flex-direction:column;min-height:0;width:100%;margin:0}
.editorial .player-form-fields{padding:0 var(--space-xl) var(--space-xl);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.editorial #player-form .dialog-description{margin-bottom:var(--space-lg)}
.editorial .photo-input{gap:var(--space-lg);margin:0 0 var(--space-xl);align-items:center;min-height:72px}
.editorial .photo-preview{width:72px;height:72px;flex:0 0 72px;border:1px solid var(--line);overflow:hidden}
.editorial .photo-preview img{width:100%;height:100%;border:0;display:block}
.editorial .photo-controls{gap:var(--space-sm);min-width:0}
.editorial .photo-buttons{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-md)}
.editorial .photo-controls button{margin:0}
.editorial .photo-controls .button{padding:10px 16px;font-size:13px}
.editorial .photo-controls #remove-photo{min-height:44px;font-size:12px;padding:0}
.editorial .photo-help{font-size:12px;line-height:1.5;color:var(--muted);margin:0}
.editorial .player-basics{grid-template-columns:minmax(0,1fr) 116px;gap:var(--space-lg)}
.editorial .form-field{gap:var(--space-sm)}
.editorial .form-field label{font-size:13px;font-weight:600;line-height:1.4;display:flex;align-items:center;justify-content:space-between;gap:var(--space-sm)}
.editorial .field-requirement{font-size:11px;font-weight:400;color:var(--muted)}
.editorial .form-field input{min-height:48px;padding:12px;font-size:16px;border-radius:6px}
.editorial .player-positions{margin:var(--space-xl) 0 0;padding:0}
.editorial .player-positions legend{font-size:15px;line-height:1.5;font-weight:700;margin-bottom:0}
.editorial .player-positions>p{margin:var(--space-sm) 0 var(--space-lg);font-size:13px;line-height:1.6}
.editorial .position-options,.editorial .position-options.compact-positions{grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-sm)}
.editorial .position-option{display:flex;align-items:center;min-width:0}
.editorial .position-option>span,.editorial .compact-positions .position-option>span{padding:12px 12px 12px 38px;min-height:48px;width:100%;font-size:13px;line-height:1.4;gap:6px;border-radius:6px}
.editorial .position-option input,.editorial .compact-positions .position-option input{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:16px;height:16px;margin:0;flex-shrink:0}
.editorial .player-positions .position-option b{font:600 11px/1.3 var(--body);min-width:22px}
.editorial .compact-positions .position-option b{display:none}
.editorial .position-option-group{margin-bottom:var(--space-lg)}
.editorial .position-group-label{margin-bottom:var(--space-sm);font-size:11px;line-height:1.5}
.editorial #clear-positions{min-height:36px;margin-top:var(--space-xs);font-size:12px}
.editorial #clear-positions:disabled{color:var(--muted);opacity:.65}
.editorial .player-flags{display:flex;gap:var(--space-sm) var(--space-xl);margin:var(--space-lg) 0 0;padding-top:var(--space-lg);border-top:1px solid var(--line)}
.editorial .player-flags .form-check{min-height:44px;font-size:13px;line-height:1.4;gap:var(--space-sm);margin:0}
.editorial .form-check input{margin:0;flex-shrink:0}
.editorial #player-form .form-note{margin:var(--space-xs) 0 0;font-size:12px;line-height:1.6}
.editorial .profile-extras{margin-top:var(--space-lg)}
.editorial .form-error:empty{display:none}
.editorial .form-error:not(:empty){margin-top:var(--space-lg);padding:var(--space-md);background:var(--accent-wash);border-radius:6px;line-height:1.5;min-height:0}
.editorial .dialog-actions{gap:var(--space-md);margin-top:var(--space-xl)}
.editorial #player-form .form-actions{position:static;bottom:auto;flex-shrink:0;flex-wrap:nowrap;gap:var(--space-md);margin:0;padding:var(--space-lg) var(--space-xl);border-top:1px solid var(--line);background:var(--surface)}
.editorial #player-form .form-actions .button{flex:1;min-height:48px}
.editorial .current-assignment{margin:var(--space-xl) 0 0;padding-block:var(--space-md)}
.editorial #toast{transition:opacity var(--motion-normal) var(--motion-ease),transform var(--motion-normal) var(--motion-ease);max-width:min(440px,calc(100vw - 32px));line-height:1.5}
.editorial #save-status[data-status=saving]:before{content:'';width:8px;height:8px;border-radius:50%;background:var(--red);animation:save-breathe 900ms ease-in-out infinite}
.editorial .drag-source{opacity:.35}
.editorial .drag-ghost{pointer-events:none;border-radius:12px;box-shadow:0 16px 40px #0003;animation:drag-lift 140ms var(--motion-ease)}
.editorial #main-dialog.is-opening::backdrop{animation:backdrop-in 200ms var(--motion-ease) both}
.editorial #main-dialog.is-closing::backdrop{animation:backdrop-out 140ms var(--motion-ease) both}
@keyframes backdrop-in{from{opacity:0}to{opacity:1}}
@keyframes backdrop-out{from{opacity:1}to{opacity:0}}
@keyframes save-breathe{0%,100%{opacity:.35}50%{opacity:1}}
@keyframes drag-lift{from{opacity:.4;transform:scale(.97)}to{opacity:1;transform:scale(1)}}
@media(hover:hover){
 .editorial :is(.bench-person-card,.player-card):hover{background:var(--surface-raised)}
 .editorial .photo-controls #remove-photo:hover{color:var(--accent-text)}
 .editorial .dialog-header .icon-button:hover{background:var(--accent-wash)}
}
@media(max-width:600px){
 .editorial #main-dialog{width:calc(100vw - 24px);max-height:calc(100dvh - 24px);border-radius:12px}
 .editorial #dialog-content{max-height:calc(100dvh - 26px)}
 .editorial .dialog-header{padding:20px 20px 16px}
 .editorial .dialog-header h2{font-size:21px}
 .editorial .dialog-body{padding:0 20px 20px}
 .editorial .player-form-fields{padding:0 20px 20px}
 .editorial .player-basics{grid-template-columns:1fr;gap:var(--space-lg)}
 .editorial .player-basics .form-field:last-child{max-width:132px}
 .editorial .photo-preview{width:64px;height:64px;flex-basis:64px}
 .editorial .photo-input{min-height:64px;margin-bottom:var(--space-xl)}
 .editorial .photo-buttons{gap:var(--space-sm)}
 .editorial .photo-controls #remove-photo{font-size:12px}
 .editorial .position-options,.editorial .position-options.compact-positions{grid-template-columns:1fr}
 .editorial .position-option>span,.editorial .compact-positions .position-option>span{font-size:14px;min-height:48px}
 .editorial .player-flags{column-gap:var(--space-lg)}
 .editorial #player-form .form-actions{padding:16px 20px;padding-bottom:max(16px,env(safe-area-inset-bottom))}
 .editorial .dialog-description{font-size:14px}
}
@media(prefers-reduced-motion:reduce){
 .editorial *,.editorial *:before,.editorial *:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}

/* Placeholder examples need the same readable contrast as supporting copy. */
.editorial .form-field input::placeholder,.editorial .picker-search input::placeholder{color:var(--muted);opacity:1}

/* Pair every hover surface with its foreground; never inherit legacy dark fills. */
:root{--primary-hover:#b51630}
:root[data-theme=light]{--primary-hover:#9d142c}
.editorial :is(.button.primary,.add-button):is(:hover,:focus-visible):not(:disabled){background:var(--primary-hover);color:var(--inverse);border-color:var(--primary-hover)}
.editorial :is(.button.secondary,.icon-button,.board-option,.picker-player,.placement-option,.position-filter,.bench-edit,.card-edit):is(:hover,:focus-visible):not(:disabled){background:var(--accent-wash);color:var(--text);border-color:var(--red)}
.editorial .position-filter:is(:hover,:focus-visible) .position-count{color:var(--muted)}
.editorial .position-filter.active:is(:hover,:focus-visible):not(:disabled),.editorial .position-filter.active:is(:hover,:focus-visible):not(:disabled) .position-count{color:var(--accent-text)}
.editorial :is(.board-option,.picker-player,.placement-option):is(:hover,:focus-visible) small{color:var(--muted)}
.editorial :is(.bench-person-card,.player-card):focus-within{background:var(--surface-raised)}
.editorial .bench-person-card .bench-chip:is(:hover,:focus-visible):not(:disabled){background:var(--accent-wash);color:var(--text)}
.editorial .sidebar-tabs button[aria-selected=false]:is(:hover,:focus-visible){background:var(--accent-wash);color:var(--text)}
.editorial .sidebar-tabs button[aria-selected=true]:is(:hover,:focus-visible){background:transparent;color:var(--inverse)}
.editorial .squad-tabs button:is(:hover,:focus-visible),.editorial .theme-switch button:is(:hover,:focus-visible){background:var(--accent-wash);color:var(--text)}
.editorial .squad-tabs span{opacity:1}
.editorial :is(button,a):is(:hover,:focus-visible) .ui-icon{opacity:1}
.editorial :is(.button.primary,.add-button) .ui-icon{filter:invert(1);opacity:1}
.editorial .slot-button:is(:hover,:focus-visible):not(:disabled){background:color-mix(in srgb,var(--pitch-bg),var(--pitch-ink) 10%);color:var(--pitch-ink);border-color:var(--pitch-ink);opacity:1}
.editorial .slot-button:is(:hover,:focus-visible) .ui-icon{opacity:1}
.editorial .matchday-rail :is(button,select):focus-visible{outline-color:var(--inverse);outline-offset:3px}
.editorial .format-control:has(button:focus-visible){overflow:visible}
.editorial .slot-player:disabled:is(:hover,:focus-visible){transform:none;background:#263d32;box-shadow:0 2px 8px #071b1426;cursor:default}
.editorial .slot-player:disabled:has(img){background:var(--red)}

/* A readable club introduction with a short hold before revealing the ready board. */
:root{--layer-preloader:2000;--preloader-accent:#ef4861}
:root[data-theme=light]{--preloader-accent:#b91c34}
.matchday-preloader{display:none}
html:is(.is-booting,.is-revealing){overflow:hidden}
html.is-booting .editorial>header,html.is-booting .editorial>main{visibility:hidden}
html:is(.is-booting,.is-revealing) .matchday-preloader{display:flex}
.editorial .matchday-preloader{position:fixed;inset:0;z-index:var(--layer-preloader);flex-direction:column;justify-content:space-between;gap:24px;padding:clamp(24px,5vw,72px);background:var(--bg);color:var(--text);overflow:hidden;pointer-events:none;transition:opacity 360ms var(--motion-ease),transform 360ms var(--motion-ease)}
.editorial .preloader-top{display:flex;align-items:center;justify-content:space-between;gap:24px;font:600 12px/1.5 var(--body);letter-spacing:.18em;text-transform:uppercase}
.editorial .preloader-top .crest{width:46px;height:56px;background:var(--red);color:var(--inverse);font:800 23px/1 var(--display);letter-spacing:-1px;flex-shrink:0}
.editorial .preloader-top .crest span{font:600 10px/1.6 var(--body);letter-spacing:2px}
.editorial .preloader-wordmark{margin-block:auto;font:700 clamp(32px,8vw,120px)/1.05 var(--display);letter-spacing:-.045em;text-transform:uppercase}
.editorial .preloader-wordmark>span,.editorial .preloader-wordmark>strong{display:block;font-weight:inherit;animation:preloader-title-in 600ms var(--motion-ease) both}
.editorial .preloader-wordmark>strong{color:var(--preloader-accent);animation-delay:60ms}
.editorial .preloader-period{color:var(--text)}
.editorial .preloader-bottom{display:flex;align-items:flex-end;justify-content:space-between;gap:24px}
.editorial .preloader-status{font:500 14px/1.5 var(--body);color:var(--muted);padding-bottom:8px}
.editorial .preloader-count{font:600 clamp(80px,14vw,176px)/.85 var(--display);font-variant-numeric:tabular-nums;letter-spacing:-.065em;color:var(--preloader-accent);min-width:3ch;text-align:right}
.editorial .preloader-track{height:2px;background:var(--line);flex-shrink:0;overflow:hidden}
.editorial .preloader-bar{display:block;height:100%;background:var(--preloader-accent);transform:scaleX(0);transform-origin:left}
.editorial .matchday-preloader.is-leaving{opacity:0;transform:translateY(-12px)}
html.is-revealing .editorial>header,html.is-revealing .editorial>main{animation:preloader-board-in 360ms var(--motion-ease) both}
@keyframes preloader-title-in{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:translateY(0)}}
@keyframes preloader-board-in{from{opacity:0}to{opacity:1}}
@media(max-width:600px){.editorial .preloader-wordmark{font-size:clamp(32px,11vw,56px)}.editorial .preloader-bottom{gap:16px}.editorial .preloader-status{max-width:140px;font-size:13px}.editorial .preloader-count{font-size:80px}.editorial .preloader-top{font-size:10px}}
@media(prefers-reduced-motion:reduce){.editorial .preloader-count,.editorial .preloader-track{display:none}.editorial .preloader-wordmark>span,.editorial .preloader-wordmark>strong,html.is-revealing .editorial>header,html.is-revealing .editorial>main{animation:none}.editorial .matchday-preloader{transition:none}}
