/* FM27 R27.38 – single audited design layer; scoped to dashboard, cup world and match presentation. */
/* Dashboard: equal-height lower tiles, exact reference is the recent-five-matches tile. */
@media (min-width:1341px) {
 body.fm27-midnight .fm27-home-dashboard .fmh-bottom{align-items:stretch!important;grid-auto-rows:377px;}
 body.fm27-midnight .fm27-home-dashboard .fmh-bottom > .fmh-panel{
  height:377px!important;min-height:377px!important;max-height:377px!important;align-self:stretch!important;
 }
}
@media (min-width:681px) and (max-width:1340px) {
 body.fm27-midnight .fm27-home-dashboard .fmh-bottom{align-items:stretch!important;grid-auto-rows:385px;}
 body.fm27-midnight .fm27-home-dashboard .fmh-bottom > .fmh-panel{
  height:385px!important;min-height:385px!important;max-height:385px!important;align-self:stretch!important;
 }
}
body.fm27-midnight .fm27-home-dashboard .fmh-bottom .fmh-panel{min-width:0;overflow:hidden;}
body.fm27-midnight .fm27-home-dashboard .fmh-bottom .fmh-editorial-list{overflow-y:auto;min-height:0;flex:1;padding-bottom:6px;scrollbar-width:thin;scrollbar-color:#465e7d transparent;}
body.fm27-midnight .fm27-home-dashboard .fmh-bottom .fmh-editorial-card{padding:8px 0;}
body.fm27-midnight .fm27-home-dashboard .fmh-bottom .fmh-editorial-card img{height:64px;}
body.fm27-midnight .fm27-home-dashboard .fmh-bottom .fmh-calendar{overflow:hidden;}
body.fm27-midnight .fm27-home-dashboard .fmh-bottom .fmh-calendar .fmh-inline-empty{flex:0 0 auto;}
body.fm27-midnight .fm27-home-dashboard .fmh-squad-incidents{min-height:0;flex:1;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#42597b transparent;}
body.fm27-midnight .fm27-home-dashboard .fmh-squad-incidents>h3{
 margin:0 12px;padding:10px 0 8px;display:flex;align-items:center;gap:7px;
 border-bottom:1px solid rgba(119,149,198,.19);font-size:.72rem;font-weight:800;color:#e7eefc;
}
body.fm27-midnight .fm27-home-dashboard .fmh-squad-incidents>h3 .bi{color:#b5a8f7;}
body.fm27-midnight .fm27-home-dashboard .fmh-squad-incidents .fmh-incident{
 margin:0 10px;padding:7px 3px;min-height:47px;
}
body.fm27-midnight .fm27-home-dashboard .fmh-squad-incidents .fmh-inline-empty{font-size:.72rem;padding:13px;}
@media (max-width:680px) {
 body.fm27-midnight .fm27-home-dashboard .fmh-bottom{align-items:stretch!important;grid-auto-rows:auto;}
 body.fm27-midnight .fm27-home-dashboard .fmh-bottom > .fmh-panel{
  height:auto!important;min-height:245px!important;max-height:none!important;
 }
 body.fm27-midnight .fm27-home-dashboard .fmh-bottom > .fmh-news{max-height:460px!important;}
 body.fm27-midnight .fm27-home-dashboard .fmh-bottom > .fmh-calendar{min-height:260px!important;}
}
/* Four cup landing cards share existing midnight palette and competition artwork. */
body.fm27-midnight .fm27-r2738-cups{max-width:none;width:100%;min-width:0;color:#e9effc;}
body.fm27-midnight .fm27-r2738-cup-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 15px;}
body.fm27-midnight .fm27-r2738-cup-choice{
 display:flex;align-items:center;justify-content:flex-start;gap:13px;min-height:86px;padding:13px 16px;
 background:linear-gradient(145deg,#182940,#131e33);border:1px solid #354c70;border-radius:12px;
 color:#e2eafb;font-size:.82rem;font-weight:800;text-decoration:none;transition:border-color .15s,background .15s;min-width:0;
}
body.fm27-midnight .fm27-r2738-cup-choice:hover,body.fm27-midnight .fm27-r2738-cup-choice.is-active{background:#243451;border-color:#a68fe9;color:#fff;}
body.fm27-midnight .fm27-r2738-cup-choice.is-active{box-shadow:inset 0 3px #9d7bee;}
body.fm27-midnight .fm27-r2738-cup-choice img{width:50px!important;height:50px!important;object-fit:contain;flex:none;}
body.fm27-midnight .fm27-r2738-cup-choice span{overflow-wrap:anywhere;min-width:0;}
body.fm27-midnight .fm27-r2738-cup-summary{border:1px solid #364969;background:#1a2740;border-radius:11px;padding:16px;display:flex;justify-content:space-between;align-items:flex-start;gap:18px;flex-wrap:wrap;margin-bottom:14px;}
body.fm27-midnight .fm27-r2738-cup-summary>div:first-child{display:flex;flex-direction:column;gap:4px;}
body.fm27-midnight .fm27-r2738-cup-summary>div:first-child small{font-size:.72rem;color:#a8bad8;}
body.fm27-midnight .fm27-r2738-cup-summary>div:first-child strong{font-size:1.15rem;font-weight:850;color:#fff;}
body.fm27-midnight .fm27-r2738-cup-summary-nav{display:flex;flex-wrap:wrap;gap:6px;}
body.fm27-midnight .fm27-r2738-cup-summary-nav a{color:#ccdaef;border:1px solid #455979;background:#24344f;border-radius:7px;padding:7px 10px;font-size:.73rem;text-decoration:none;display:flex;gap:6px;align-items:center;}
body.fm27-midnight .fm27-r2738-cup-summary-nav a.is-active{color:#fff;background:#51458d;border-color:#9e8eea;}
body.fm27-midnight .fm27-r2738-cup-summary-nav a small{opacity:.8;font-size:.61rem;}
body.fm27-midnight .fm27-r2738-cup-standings,body.fm27-midnight .fm27-r2738-bracket-wrap{background:linear-gradient(140deg,#15243c,#101b30);border:1px solid #364a6a;border-radius:12px;overflow:hidden;}
body.fm27-midnight .fm27-r2738-cup-section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 18px;border-bottom:1px solid #354866;flex-wrap:wrap;}
body.fm27-midnight .fm27-r2738-cup-section-title h2{color:#fff;font-size:1rem;font-weight:830;margin:0;}
body.fm27-midnight .fm27-r2738-cup-section-title span{font-size:.72rem;color:#a9bad4;}
body.fm27-midnight .fm27-r2738-scroll{overflow-x:auto;width:100%;}
body.fm27-midnight .fm27-r2738-cup-table{width:100%;border-collapse:collapse;min-width:640px;font-size:.79rem;color:#eaf1ff;}
body.fm27-midnight .fm27-r2738-cup-table th{background:#202e49;color:#b2c4e0;font-size:.7rem;font-weight:760;padding:12px 9px;text-align:center;white-space:nowrap;}
body.fm27-midnight .fm27-r2738-cup-table td{padding:9px;border-bottom:1px solid #2a3d5b;text-align:center;}
body.fm27-midnight .fm27-r2738-cup-table td:nth-child(2){text-align:left;min-width:175px;}
body.fm27-midnight .fm27-r2738-cup-table tbody tr:nth-child(even){background:rgba(118,140,186,.06);}
body.fm27-midnight .fm27-r2738-cup-table tr.is-qualified td:first-child{border-left:3px solid #48c7a2;}
body.fm27-midnight .fm27-r2738-cup-table tr.is-playoff td:first-child{border-left:3px solid #a48aef;}
body.fm27-midnight .fm27-r2738-cup-table td a{color:#e8f0ff;font-weight:740;text-decoration:none;}
body.fm27-midnight .fm27-r2738-cup-table td a:hover{text-decoration:underline;}
body.fm27-midnight .fm27-r2738-cup-legend{display:flex;gap:15px;flex-wrap:wrap;align-items:center;padding:13px 18px;color:#b0c0db;font-size:.71rem;}
body.fm27-midnight .fm27-r2738-cup-legend>span{display:inline-flex;gap:7px;align-items:center;}
body.fm27-midnight .fm27-r2738-cup-legend i{display:inline-block;width:5px;height:14px;border-radius:4px;background:#647995;}
body.fm27-midnight .fm27-r2738-cup-legend i.is-qualified{background:#48c7a2;}
body.fm27-midnight .fm27-r2738-cup-legend i.is-playoff{background:#a48aef;}
body.fm27-midnight .fm27-r2738-bracket{display:flex;gap:12px;align-items:flex-start;overflow-x:auto;scrollbar-width:thin;scrollbar-color:#576c91 transparent;padding:17px;}
body.fm27-midnight .fm27-r2738-bracket-round{min-width:248px;max-width:248px;display:grid;gap:10px;align-content:start;}
body.fm27-midnight .fm27-r2738-bracket-round h3{margin:0 0 4px;color:#d9def8;text-align:center;font-size:.82rem;font-weight:840;padding:9px;background:#243653;border:1px solid #3c5174;border-radius:8px;}
body.fm27-midnight .fm27-r2738-bracket-round.is-selected h3{background:#473e79;border-color:#8e82cc;color:#fff;}
body.fm27-midnight .fm27-r2738-tie{background:#1c2a44;border:1px solid #3b4f70;border-radius:10px;overflow:hidden;}
body.fm27-midnight .fm27-r2738-tie-team{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px;border-bottom:1px solid rgba(106,130,179,.21);min-height:43px;}
body.fm27-midnight .fm27-r2738-tie-team a{font-size:.75rem;font-weight:740;color:#e7effe;text-decoration:none;flex:1;min-width:0;overflow-wrap:anywhere;}
body.fm27-midnight .fm27-r2738-tie-team strong{font-size:.81rem;color:#fff;}
body.fm27-midnight .fm27-r2738-tie-meta{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap;padding:7px 10px;font-size:.64rem;color:#b3c4e0;}
body.fm27-midnight .fm27-r2738-tie-meta a{color:#c0acff;text-decoration:none;}
body.fm27-midnight .fm27-r2738-cup-empty{min-height:165px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:7px;padding:24px;color:#a8bdd8;border:1px solid #344967;border-radius:11px;background:#18263c;font-size:.8rem;}
body.fm27-midnight .fm27-r2738-cup-empty>i{font-size:2rem;color:#af9df2;}
body.fm27-midnight .fm27-r2738-cup-empty strong{font-size:.93rem;color:#fff;}
/* Matchday: strong hierarchy without a second outer page title or artificial side columns. */
body.fm27-midnight .fm27-r2714-matchcenter .fm27-p2-panel{background:linear-gradient(155deg,#172740,#101c31);border:1px solid #395071;border-radius:12px;overflow:hidden;box-shadow:none;}
body.fm27-midnight .fm27-r2714-matchcenter .fm27-p2-panel-heading{background:#1b2a45;border-bottom:1px solid #3a506f;padding:15px 18px;}
body.fm27-midnight .fm27-r2714-matchcenter .fm27-p2-panel-heading h3{font-size:1rem;margin:0;font-weight:840;color:#f1f5fc;}
body.fm27-midnight .fm27-r2714-matchcenter .fm27-p2-panel-heading span{color:#a9bfdf;font-size:.72rem;}
body.fm27-midnight .fm27-r2714-matchcenter .fm27-p2-fixtures{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px;align-items:stretch;}
body.fm27-midnight .fm27-r2714-matchcenter .fm27-p2-fixtures>.fm27-p2-fixture{border:1px solid #364b69;background:#1c2c46;border-radius:11px;margin:0;min-width:0;}
body.fm27-midnight .fm27-r2714-matchcenter .fm27-p2-fixtures>.fm27-p2-fixture:hover{border-color:#947fd5;background:#223451;}
/* Prematch comparison: balanced club cards, legible form and results, responsive. */
body.fm27-midnight .fm27-r83-prematch{background:transparent;border:0;border-radius:0;margin:10px 0 18px;padding:0;}
body.fm27-midnight .fm27-r83-prematch-intro{background:#1b2b45;border:1px solid #39506d;border-radius:11px;padding:16px 18px;margin-bottom:12px;}
body.fm27-midnight .fm27-r83-prematch-intro>span{color:#bea8ff;letter-spacing:.085em;font-size:.67rem;}
body.fm27-midnight .fm27-r83-prematch-intro h2{margin:6px 0;color:#fff;font-size:1.08rem;}
body.fm27-midnight .fm27-r83-prematch-intro p{margin:0;color:#b7c7e2;font-size:.74rem;}
body.fm27-midnight .fm27-r83-prematch-grid{gap:12px;grid-template-columns:repeat(2,minmax(0,1fr));}
body.fm27-midnight .fm27-r83-prematch-club{border-radius:11px;background:linear-gradient(140deg,#1d2d49,#16263f);border:1px solid #3c5371;padding:17px;min-width:0;}
body.fm27-midnight .fm27-r83-prematch-club header{padding-bottom:12px;margin-bottom:13px;}
body.fm27-midnight .fm27-r83-prematch-club header a{font-size:1.05rem;color:#eff3ff;}
body.fm27-midnight .fm27-r83-prematch-club header span{font-size:.72rem;color:#adbed7;}
body.fm27-midnight .fm27-r83-form-strip a{height:36px;width:36px;border-radius:9px;font-size:.79rem;}
body.fm27-midnight .fm27-r83-prematch-results{margin-top:13px;}
body.fm27-midnight .fm27-r83-prematch-results a{min-height:40px;padding:9px 5px;font-size:.76rem;}
body.fm27-midnight .fm27-r83-prematch-results strong{font-size:.78rem;}
/* Live pitch names: use existing pseudonym/surname, allow two lines instead of 40px clipping. */
body.fm27-midnight .fm27-r833-roster .fm27-r833-player-body>.fm27-r833-plainname{
 display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;
 overflow:hidden;text-overflow:clip;white-space:normal!important;overflow-wrap:anywhere;
 line-height:1.14!important;font-size:clamp(.57rem,.72vw,.73rem)!important;
 text-align:center;max-width:100%;min-height:1.1em;
}
@media (min-width:800px){body.fm27-midnight .fm27-r833-roster .fm27-r833-player-body{width:82px;max-width:82px;}}
@media (max-width:1130px){body.fm27-midnight .fm27-r2714-matchcenter .fm27-p2-fixtures{grid-template-columns:1fr;}}
@media (max-width:760px){body.fm27-midnight .fm27-r2738-cup-options{grid-template-columns:repeat(2,minmax(0,1fr));}body.fm27-midnight .fm27-r83-prematch-grid{grid-template-columns:1fr;}}
@media (max-width:480px){body.fm27-midnight .fm27-r2738-cup-choice{min-height:75px;padding:10px;gap:7px;font-size:.73rem;}body.fm27-midnight .fm27-r2738-cup-choice img{width:32px!important;height:32px!important;}body.fm27-midnight .fm27-r2738-cup-summary{padding:12px;}body.fm27-midnight .fm27-r2738-cup-section-title{padding:12px;}body.fm27-midnight .fm27-r833-roster .fm27-r833-player-body>.fm27-r833-plainname{font-size:.55rem!important;}}
