/* R27.79 – targeted UI corrections on top of canonical R27.35 dark context. */
body.fm27-midnight .fm27-home-dashboard .fmh-primary{width:calc(100% - 24px)!important;max-width:none!important;align-self:stretch!important;min-height:41px!important;margin:8px 12px 10px!important;}
body.fm27-midnight .fm27-home-dashboard .fmh-result-row{grid-template-columns:63px 31px minmax(0,1fr) minmax(66px,auto) 27px;gap:8px;}
body.fm27-midnight .fm27-home-dashboard .fmh-result-row>img{width:30px;height:30px;object-fit:contain;}
body.fm27-midnight .fm27-home-dashboard .fmh-result-score{display:inline-flex;align-items:center;justify-content:flex-end;gap:5px;}
body.fm27-midnight .fm27-home-dashboard .fmh-result-venue{color:#b1c1da;font-size:.66rem;font-weight:700;}
body.fm27-midnight .fm27-home-dashboard .fmh-financial-health.is-critical{background:#35202e;border-color:#a24d68;}
body.fm27-midnight .fm27-home-dashboard .fmh-financial-health.is-critical>.bi,body.fm27-midnight .fm27-home-dashboard .fmh-financial-health.is-critical strong{color:#ff6d83;}
body.fm27-unified-ui .fm27-r272529-secondary .fm27-r272529-controls:only-child{margin-left:0!important;margin-right:auto!important;}
body.fm27-unified-ui .fm27-cp-youth .fm27-cp-tools-left{flex:1 1 auto!important;}
body.fm27-unified-ui .fm27-cp-youth .fm27-cp-tools-right{margin-left:auto!important;flex:0 0 auto!important;justify-content:flex-end!important;}
body.fm27-unified-ui .fm27-cp-youth .fm27-cp-tools-right>.btn,body.fm27-unified-ui .fm27-cp-youth .fm27-cp-tools-right>.dropdown{flex:0 0 auto!important;}
body.fm27-unified-ui .fm27-r2779-league-picker{flex:1 1 220px!important;margin:0 16px 0 0!important;max-width:350px!important;}
body.fm27-unified-ui .fm27-r2779-league-picker select{background:#182a42!important;color:#eff4fd!important;border:1px solid #526881!important;min-height:34px;border-radius:7px;width:100%;}
body.fm27-unified-ui .fm27-r272529-primary:has(.fm27-r2779-league-picker){justify-content:flex-start!important;}
body.fm27-unified-ui .fm27-r272529-primary:has(.fm27-r2779-league-picker) .fm27-roster-metric:not(.fm27-r272529-title){margin-left:auto;}
.fm27-r2779-transfer-person{display:inline-flex;align-items:center;gap:8px;min-width:0;}
.fm27-r2779-transfer-avatar{width:32px;height:32px;flex:0 0 32px;border-radius:7px;overflow:hidden;display:grid;place-items:center;color:#b8c9e6;background:#23354e;}
.fm27-r2779-transfer-avatar img{width:100%;height:100%;object-fit:cover;}
.fm27-r2779-sort{border:0;background:transparent;color:inherit;font:inherit;font-weight:700;text-align:left;cursor:pointer;display:inline-flex;align-items:center;gap:5px;white-space:nowrap;padding:0;}
.fm27-r2779-sort:hover,.fm27-r2779-sort:focus-visible{color:#6ce6b9;}
.fm27-r2779-sort i{font-size:.7em;opacity:.55;}
.fm27-r2779-th[aria-sort=ascending] .fm27-r2779-sort i,.fm27-r2779-th[aria-sort=descending] .fm27-r2779-sort i{opacity:1;color:#4adea6;}
body.fm27-midnight .fm27-account-drawer .offcanvas-body{display:flex;flex-direction:column;gap:12px;}
body.fm27-midnight .fm27-account-drawer .fm27-logout{margin-top:auto;min-height:38px;display:flex;align-items:center;gap:8px;}
@media(max-width:650px){body.fm27-midnight .fm27-home-dashboard .fmh-result-row{grid-template-columns:57px 26px minmax(0,1fr) auto 24px;gap:5px;}body.fm27-midnight .fm27-home-dashboard .fmh-result-row>img{width:25px;height:25px;}body.fm27-unified-ui .fm27-cp-youth .fm27-cp-tools-right{flex-wrap:wrap!important;}}

/* R27.79b: homepage: date | crest | opponent/competition | (H)/(A) | result | form. */
body.fm27-midnight .fm27-home-dashboard .fmh-result-row{grid-template-columns:63px 32px minmax(0,1fr) 24px 54px 27px!important;gap:7px!important}
body.fm27-midnight .fm27-home-dashboard .fmh-result-row>img{width:31px!important;height:31px!important}
body.fm27-midnight .fm27-home-dashboard .fmh-result-row .fmh-result-venue{display:block!important;text-align:center;color:#9ab4da!important;font-size:.71rem!important;font-weight:650!important;white-space:nowrap}
body.fm27-midnight .fm27-home-dashboard .fmh-result-row .fmh-result-score{display:block!important;text-align:center!important;font-size:.75rem!important;white-space:nowrap!important}
body.fm27-midnight .fm27-home-dashboard .fmh-result-row .fmh-result-club small{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
/* No automatic hidden/recolored headings on re-enabled columns. */
body.fm27-midnight.fm27-squad-page #playerTable.fm27-roster-table thead th:not([hidden]){display:table-cell!important;visibility:visible!important;opacity:1!important;color:#c5d7ee!important;font-size:.69rem!important;line-height:1.3!important;white-space:nowrap!important}
body.fm27-midnight.fm27-squad-page #playerTable.fm27-roster-table thead th:not([hidden]) .fm27-r272-sort{display:inline-flex!important;align-items:center!important;visibility:visible!important;opacity:1!important;color:#c5d7ee!important;font-size:.69rem!important;line-height:1.3!important;white-space:nowrap!important}
body.fm27-midnight.fm27-squad-page #playerTable.fm27-roster-table thead th:not([hidden]) .fm27-r2779b-header-label{display:inline!important;color:inherit!important;font-size:inherit!important}
/* Canonical dark youth toolbar: search and position in ONE row, actions to the far right. */
body.fm27-unified-ui #contentArea .fm27-cp-youth .fm27-cp-tools-left{flex:1 1 360px!important;min-width:0!important;width:auto!important;margin:0!important}
body.fm27-unified-ui #contentArea .fm27-cp-youth .fm27-cp-roster-filters{display:flex!important;flex-flow:row nowrap!important;align-items:center!important;gap:8px!important;width:auto!important;max-width:100%!important;min-width:0!important}
body.fm27-unified-ui #contentArea .fm27-cp-youth .fm27-roster-search{display:block!important;flex:1 1 215px!important;min-width:115px!important;max-width:280px!important}
body.fm27-unified-ui #contentArea .fm27-cp-youth .fm27-roster-search input{display:block!important;width:100%!important;min-width:0!important}
body.fm27-unified-ui #contentArea .fm27-cp-youth #fm27RosterPosition{display:block!important;flex:0 1 170px!important;width:170px!important;min-width:115px!important;max-width:170px!important;margin:0!important}
body.fm27-unified-ui #contentArea .fm27-cp-youth .fm27-cp-tools-right{display:flex!important;flex-flow:row nowrap!important;align-items:center!important;flex:0 0 auto!important;margin-left:auto!important;gap:7px!important;min-width:max-content!important}
/* Quiet note AFTER both context bars. */
body.fm27-midnight .fm27-r2779b-youth-note{display:flex;align-items:flex-start;gap:9px;margin:0 0 11px;padding:9px 12px;border:1px solid #354963;border-left:2px solid #7598ba;background:#17263b;color:#aebed3;border-radius:7px;font-size:.73rem;line-height:1.52}
body.fm27-midnight .fm27-r2779b-youth-note i{color:#88accf;margin-top:1px;flex:none}
body.fm27-midnight .fm27-r2779b-youth-note p{margin:0}
body.fm27-midnight .fm27-r2779b-youth-note strong{color:#cfdcec;font-weight:680}
/* The R27.35 global selector forces margin-left:auto on Kaufoptionen; override it only on Angebote. */
body.fm27-unified-ui #contentArea [data-fm27-context-bar="secondary"].fm27-r272511-offersbar{justify-content:flex-start!important}
body.fm27-unified-ui #contentArea [data-fm27-context-bar="secondary"].fm27-r272511-offersbar .fm27-r2711-options-link{margin-left:0!important;margin-right:auto!important}
@media(max-width:740px){
 body.fm27-unified-ui #contentArea .fm27-cp-youth .fm27-cp-tools-left{flex:1 1 100%!important}
 body.fm27-unified-ui #contentArea .fm27-cp-youth .fm27-cp-tools-right{flex:1 1 100%!important;justify-content:flex-start!important;flex-wrap:wrap!important;min-width:0!important;margin-left:0!important}
 body.fm27-midnight .fm27-home-dashboard .fmh-result-row{grid-template-columns:54px 26px minmax(0,1fr) 20px 45px 24px!important;gap:4px!important}
 body.fm27-midnight .fm27-home-dashboard .fmh-result-row>img{width:26px!important;height:26px!important}
}

/* R27.79c: Kader heading, modeled after Jugend: plain TH label + icon sort button.
   Keep the label visible even when a previously hidden column is revealed. */
body.fm27-midnight.fm27-myteam-page #playerTable.fm27-roster-table thead th[data-fm27-label]:not([hidden]){
 color:#c5d7ee!important;white-space:nowrap!important;cursor:pointer;
}
body.fm27-midnight.fm27-myteam-page #playerTable.fm27-roster-table thead th[data-fm27-label]>.fm27-r272-sort{
 display:inline-flex!important;vertical-align:middle;align-items:center;justify-content:center;
 border:0;background:transparent;color:#a5bada!important;
 margin-left:5px;padding:2px 3px;min-width:15px;
}
body.fm27-midnight.fm27-myteam-page #playerTable.fm27-roster-table thead th[data-fm27-label]>.fm27-r272-sort:hover,
body.fm27-midnight.fm27-myteam-page #playerTable.fm27-roster-table thead th[data-fm27-label]:hover>.fm27-r272-sort{color:#74e4b6!important}
body.fm27-midnight.fm27-myteam-page #playerTable.fm27-roster-table thead th[data-fm27-label]>.fm27-r272-sort i{display:inline-block!important;opacity:.65!important}
