/* These rails use the existing columns and never participate in their width calculation. */
.fml-left-slot {
  grid-area: filters;
  align-self: stretch;
  contain: size;
  min-width: 0;
  pointer-events: none;
}
#fml-left-rail,
#rail > .fml-context-rail {
  --fml-panel-edge: #394a5e;
  --fml-art-color: var(--palette-background, #24354e);
  color: #f4f0e8;
  background: linear-gradient(150deg, #172638, #101a27 65%);
  border: 1px solid var(--fml-panel-edge);
  border-radius: 9px;
  padding: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
#fml-left-rail {
  margin-block-start: calc(var(--fml-filter-height, 0px) + 12px);
  max-height: max(0px, calc(100% - var(--fml-filter-height, 0px) - 12px));
  overflow: auto;
  pointer-events: auto;
}
.layout > aside.sidebar-fits + .fml-left-slot > #fml-left-rail {
  position: sticky;
  inset-block-start: calc(var(--fml-filter-top) + var(--fml-filter-height) + 12px);
  max-height: min(
    calc(100% - var(--fml-filter-height) - 12px),
    max(0px, calc(100dvh - var(--fml-filter-top) - var(--fml-filter-height) - 24px))
  );
}
#fml-left-rail[inert] { visibility: hidden; }
.layout > aside { z-index: 1; }
.fml-rail-heading {
  min-height: 112px;
  display: grid;
  align-items: end;
  isolation: isolate;
  position: relative;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(102deg, var(--fml-art-color), var(--fml-opponent, var(--fml-art-color)));
  border-bottom: 2px solid var(--palette-text, #e2b982);
}
.fml-rail-heading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, #08111cf5 0%, #08111c48 72%);
}
.fml-rail-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: luminosity;
  opacity: .77;
}
.fml-context-rail[data-art="pain"] { --fml-art-color: #722130; --palette-text: #ff8c98; }
.fml-context-rail[data-art="joy"] { --fml-art-color: #235740; --palette-text: #87e0ae; }
.fml-rail-heading h2 {
  color: #fff;
  padding: 11px 12px;
  margin: 0;
  font-size: clamp(1.125rem, 1.5vw, 1.65rem);
  line-height: 1.05;
  text-wrap: balance;
}
.fml-rail-copy { padding: 11px 12px 12px; }
.fml-rail-copy small, .fml-rail-stat > span:last-child { color: #cbd5e2; font-size: .8125rem; }
.fml-rail-copy h3 { margin: 10px 0 3px; font-size: 1rem; }
.fml-rail-left-score { margin: 2px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; }
.fml-rail-left-score strong, .fml-rail-stat > strong { color: #fff; font-size: 1.45rem; line-height: 1.2; }
.fml-rail-humor { color: #cbd5e2; font-size: .8125rem; margin: 10px 0 0; }
.fml-rail-copy button[data-fml-next-highlight] { margin-top: 7px; padding: 5px 8px; font-size: .875rem; }
.fml-rail-event {
  border-inline-start: 2px solid var(--fml-event-accent);
  padding: 5px 0 5px 8px;
  margin: 8px 0;
}
.fml-rail-joy { --fml-event-accent: #6ddbad; }
.fml-rail-pain { --fml-event-accent: #ff8592; }
.fml-rail-event small { color: var(--fml-event-accent); }
.fml-rail-event strong { display: block; line-height: 1.3; }
.fml-rail-event p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .875rem;
  color: #cbd5e2;
  margin: 4px 0;
}
.fml-rail-event a { color: #fff; text-decoration: underline; }
.fml-rail-stat { display: grid; justify-items: start; gap: 4px; margin-bottom: 11px; }
.fml-mini-team {
  background: var(--palette-background);
  color: var(--palette-text);
  border: 1px solid #aabbd340;
  border-radius: 5px;
  font-weight: 700;
  font-size: .9rem;
  padding: 3px 7px;
}
.fml-mini-team img { display: inline-block; object-fit: contain; vertical-align: middle; margin-inline-end: 5px; }
.fml-matchup-teams { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 11px; }
.fml-disclaimer {
  width: 96%;
  margin: 0 auto 24px;
  padding: 14px 0 0;
  border-top: 1px solid #465165;
  color: #cbd5e2;
  font-size: .875rem;
}
.fml-disclaimer p { max-width: 85ch; margin: 0 0 6px; }
@media (max-width: 1199px) {
  .fml-left-slot, #rail > .fml-context-rail { display: none; }
  .layout > aside { z-index: auto; }
  .layout > aside:has(#team-picker[open]) { z-index: 8; }
}

/* Keep the context in view below the pinned banner on wide screens. */
@media (min-width: 1200px) {
  #rail {
    position: sticky;
    inset-block-start: var(--sidebar-top);
    max-block-size: max(0px, calc(100dvh - var(--sidebar-top) - 12px));
    overflow-y: auto;
  }
}
