/* Styles for the three dashboard panels (dash-panels.js): My teams, AP poll movers, Playoff odds.
   Every selector starts with .dp-. Colors come from the theme tokens in theme.css, so dark mode follows on its own.
   Layout reacts to the panel's own width (container queries on .dp-in), not the window's, because readers can resize panels. */

.dp-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  min-width: 0;
  color: var(--text-1);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13.5px;
  line-height: 1.4;
}
.dp-card *, .dp-card *::before, .dp-card *::after { box-sizing: border-box; }
.dp-in { container: dp / inline-size; min-width: 0; }

/* ---------- shared bits ---------- */
.dp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.dp-head-l { min-width: 0; }
.dp-head-r { flex: 0 1 220px; min-width: 0; margin-left: auto; display: flex; align-items: center; }
.dp-head-r .dp-link { margin-left: auto; }
.dp-title {
  margin: 0;
  font: 600 15px "Oswald", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-1);
}
.dp-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.dp-h3 {
  margin: 0 0 6px;
  font: 600 12.5px "Oswald", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}
.dp-num { font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; }
.dp-empty { margin: 4px 0 0; color: var(--text-2); }
.dp-small { font-size: 12.5px; color: var(--muted); }
.dp-note { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }
.dp-msg { margin: 0 0 6px; font-size: 12.5px; color: var(--text-2); }
.dp-msg:empty { display: none; }
.dp-dash { color: var(--muted); }

.dp-card a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.dp-card a:hover { color: var(--rain-700); text-decoration-color: currentColor; }
.dp-card .dp-link { color: var(--rain-700); font-weight: 500; font-size: 13px; text-decoration: none; white-space: nowrap; }
.dp-card .dp-link:hover { text-decoration: underline; }

/* Screen-reader text; in wide layouts the small column labels use it too. */
.dp-sr, .dp-lab {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Up and down: always an arrow and a number, with color as extra. */
.dp-chg { font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.dp-up { color: var(--forest-ink); }
.dp-down { color: var(--impact-700); }

.dp-input {
  width: 100%;
  min-width: 0;
  font: 13.5px "IBM Plex Sans", system-ui, sans-serif;
  color: var(--text-1);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
}
.dp-input::placeholder { color: var(--muted); opacity: 1; }
.dp-btn {
  margin-top: 10px;
  font: 500 13px "IBM Plex Sans", system-ui, sans-serif;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
}
.dp-btn:hover { border-color: var(--rain-500); }
.dp-input:focus-visible, .dp-btn:focus-visible, .dp-x:focus-visible, .dp-card a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.dp-input:focus-visible { outline-offset: 0; }

/* ---------- My teams ---------- */
.dp-rows, .dp-orows, .dp-mv { list-style: none; margin: 0; padding: 0; }
.dp-colhead { display: none; }

/* Narrow (default): two lines per team. */
.dp-row { padding: 9px 0; border-top: 1px solid var(--line); }
.dp-l1 { display: flex; align-items: baseline; gap: 10px; }
.dp-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; font-weight: 600; font-size: 14px; }
.dp-name a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: flex-start; max-width: 100%; }
.dp-conf { font-size: 12px; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-rk { flex: none; white-space: nowrap; }
.dp-rk b { font-weight: 600; }
.dp-rec { flex: none; min-width: 3.2em; text-align: right; font-size: 13px; }
.dp-x {
  flex: none;
  align-self: center;
  width: 30px; height: 30px;
  margin: -4px -6px -4px 0;
  display: inline-flex; align-items: center; justify-content: center;
  font: 400 20px/1 "IBM Plex Sans", system-ui, sans-serif;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}
.dp-x:hover { color: var(--text-1); background: var(--surface-2); }
.dp-l2 { display: flex; align-items: center; gap: 4px 14px; margin-top: 4px; font-size: 13px; }
.dp-spark { flex: none; line-height: 0; }
.dp-po { flex: none; white-space: nowrap; font-size: 13px; }
.dp-po .dp-lab {
  position: static; width: auto; height: auto; margin: 0; clip: auto; overflow: visible;
  font: 12px "IBM Plex Sans", system-ui, sans-serif; color: var(--muted);
}
.dp-next { flex: 1 1 140px; min-width: 0; color: var(--text-2); }

.dp-sp { display: block; overflow: visible; }
.dp-sp-base { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.dp-sp-line { fill: none; stroke: var(--rain-500); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.dp-sp-dot { fill: var(--rain-500); stroke: none; }

@container dp (max-width: 359px) {
  .dp-spark { display: none; }
}

/* Wide: one line per team with a column header. */
@container dp (min-width: 600px) {
  .dp-colhead, .dp-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) 92px 76px 58px 62px minmax(0, 1.5fr) 30px;
    align-items: center;
    column-gap: 12px;
  }
  .dp-colhead {
    padding: 0 0 6px;
    font: 600 11.5px "Oswald", sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .dp-colhead span:nth-child(4), .dp-colhead span:nth-child(5) { text-align: right; }
  .dp-l1, .dp-l2 { display: contents; }
  .dp-row > * > * { grid-row: 1; }
  .dp-name { grid-column: 1; }
  .dp-rk { grid-column: 2; }
  .dp-spark { grid-column: 3; display: block; }
  .dp-rec { grid-column: 4; }
  .dp-po { grid-column: 5; text-align: right; font-size: 13.5px; }
  .dp-next { grid-column: 6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
  .dp-x { grid-column: 7; margin: 0; }
  .dp-po .dp-lab {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .dp-rec { font-size: 13.5px; }
}

/* ---------- AP poll movers ---------- */
.dp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }
.dp-cols > div { min-width: 0; }
.dp-mv li { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); min-width: 0; }
.dp-mv li .dp-chg { flex: none; min-width: 3.1em; }
.dp-mvrk { flex: none; color: var(--muted); font-size: 12.5px; min-width: 2.6em; }
.dp-mv li a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-inout { margin: 10px 0 0; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.dp-inout b { font-weight: 600; color: var(--text-1); }
.dp-cols + .dp-inout { padding-top: 10px; border-top: 1px solid var(--line); }
.dp-inout + .dp-inout { margin-top: 4px; }
@container dp (max-width: 459px) {
  .dp-cols { grid-template-columns: 1fr; }
}

/* ---------- Playoff odds ---------- */
.dp-ocolhead { display: none; }
/* Narrow: name and percent on the first line, the bar and expected record under them. */
.dp-orow {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  grid-template-areas: "on name pct" ". bar exp";
  align-items: center;
  gap: 3px 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}
.dp-on { grid-area: on; color: var(--muted); font-size: 12.5px; text-align: right; }
.dp-oname { grid-area: name; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-opct { grid-area: pct; text-align: right; font-weight: 600; font-size: 13.5px; }
.dp-bar { grid-area: bar; display: block; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.dp-bar i { display: block; height: 100%; min-width: 2px; border-radius: 4px; background: var(--rain-500); }
.dp-oexp { grid-area: exp; text-align: right; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.dp-oexp .dp-lab {
  position: static; width: auto; height: auto; margin: 0; clip: auto; overflow: visible;
  font: 12px "IBM Plex Sans", system-ui, sans-serif;
}

/* Medium (a third-width panel on a big screen): name, bar and percent on one line; the expected record
   drops out (it's on the bracket page) so twelve rows stay about as tall as the panels beside them. */
@container dp (min-width: 380px) and (max-width: 519px) {
  .dp-orow { grid-template-columns: 22px minmax(0, 1fr) minmax(56px, 0.9fr) 50px; grid-template-areas: "on name bar pct"; padding: 6px 0; }
  .dp-oexp { display: none; }
}

/* Wide: everything on one line. */
@container dp (min-width: 520px) {
  .dp-ocolhead, .dp-orow {
    display: grid;
    grid-template-columns: 24px minmax(110px, 190px) minmax(60px, 1fr) 62px 96px;
    grid-template-areas: none;
    align-items: center;
    column-gap: 12px;
  }
  .dp-ocolhead {
    padding: 0 0 6px;
    font: 600 11.5px "Oswald", sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }
  /* The "Chance" header spans the bar and its percent. */
  .dp-ocolhead span:nth-child(3) { grid-column: 3 / 5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dp-ocolhead span:nth-child(4) { display: none; }
  .dp-ocolhead span:nth-child(5) { grid-column: 5; text-align: right; white-space: nowrap; }
  .dp-ocolhead span:first-child { text-align: right; }
  .dp-on { grid-area: auto; grid-column: 1; }
  .dp-oname { grid-area: auto; grid-column: 2; }
  .dp-bar { grid-area: auto; grid-column: 3; }
  .dp-opct { grid-area: auto; grid-column: 4; }
  .dp-oexp { grid-area: auto; grid-column: 5; font-size: 13px; }
  .dp-oexp .dp-lab { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  .dp-card * { transition: none !important; animation: none !important; }
}
