/* FPL league site. One stylesheet, no framework. Tokens, then the page frame, then each part in page order. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --paper: #f5f7fa;
  --surface: #fff;
  --ink: #0f2342;
  --muted: #55627a;
  --rule: #d5dbe5;
  --hover: #eaeff8;
  --cobalt: #2447d6;
  --link: #2447d6;
  --focus: #2447d6;
  /* Meaning colours are the Excel trio the WhatsApp images already use */
  --good: #006100;
  --bad: #9c0006;
  --booked: #9c5700;
  --booked-fill: #ffeb9c;
  --best: #006100; /* strong fills carry white text */
  --worst: #9c0006;
  /* league race lines, categorical slots 1-4 validated on #fff */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --race-context: #dfe4ec;
  --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230f2342' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --gutter: 1rem;
  --measure: 70rem;
  color-scheme: light;
}

/* Dark follows the device until the toggle sets data-theme. The two blocks hold the same values. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b1630;
    --surface: #12224a;
    --ink: #e8eefb;
    --muted: #9aa9c4;
    --rule: #25365e;
    --hover: #14264f;
    --link: #8fa8ff;
    --focus: #9db4ff;
    --good: #6edc8a;
    --bad: #ff8a93;
    --booked: #ffd15c;
    --booked-fill: rgb(255 193 7 / 0.2);
    --best: #17763a;
    --worst: #b3202b;
    --series-1: #3987e5; /* validated on #12224a */
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --race-context: #1f3160;
    --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23e8eefb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0b1630;
  --surface: #12224a;
  --ink: #e8eefb;
  --muted: #9aa9c4;
  --rule: #25365e;
  --hover: #14264f;
  --link: #8fa8ff;
  --focus: #9db4ff;
  --good: #6edc8a;
  --bad: #ff8a93;
  --booked: #ffd15c;
  --booked-fill: rgb(255 193 7 / 0.2);
  --best: #17763a;
  --worst: #b3202b;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --race-context: #1f3160;
  --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23e8eefb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); /* the tab bar, 3.5rem, plus a 2rem gap */
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p,
ul,
hgroup {
  margin: 0;
}

h2 {
  font: 800 1.5rem/1.1 var(--font);
  font-stretch: 75%;
}

h3 {
  font: 700 1.0625rem/1.25 var(--font);
}

hgroup p {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

a {
  color: var(--link);
}

s {
  opacity: 0.7;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[aria-busy="true"]::after {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.5em;
  border: 2px solid currentcolor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.1em;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ frame */

.wrap,
#app > :not(.band) {
  width: min(100% - 2 * var(--gutter), var(--measure) - 2 * var(--gutter));
  margin-inline: auto;
}

#app > :not(.band) {
  margin-top: 1.5rem;
}

#app > section:not(.band),
#app > hgroup {
  margin-top: 2.5rem;
}

#app > p {
  color: var(--muted);
  font-size: 0.9375rem;
}

#app > section > h3 {
  margin-bottom: 0.5rem;
}

.top {
  border-bottom: 1px solid var(--rule);
}

.top .wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
}

.brand {
  color: var(--ink);
  font: 800 1.375rem/1 var(--font);
  font-stretch: 75%;
  text-decoration: none;
}

.season {
  color: var(--muted);
  font-size: 0.875rem;
}

#theme {
  width: 2.5rem;
  min-height: 2.5rem;
  margin-left: auto;
  padding: 0;
  border-color: var(--rule);
  background: transparent;
  color: var(--ink);
  font-size: 1.125rem;
}

/* Phone: tabs sit at the bottom, where a thumb reaches */
.top nav {
  position: fixed;
  inset: auto 0 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--rule);
}

.top nav a {
  display: grid;
  place-items: center;
  min-height: 3.5rem;
  margin-top: -1px;
  border-top: 3px solid transparent;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.top nav a[aria-current="page"] {
  border-top-color: var(--cobalt);
  color: var(--ink);
}

@media (min-width: 48rem) {
  body {
    padding-bottom: 3rem;
  }

  .top nav {
    position: static;
    display: flex;
    gap: 1.75rem;
    margin-left: auto;
    padding: 0;
    background: none;
    border: 0;
  }

  .top nav a {
    margin: 0;
    border-top: 0;
    border-bottom: 3px solid transparent;
  }

  .top nav a[aria-current="page"] {
    border-bottom-color: var(--cobalt);
  }

  #theme {
    margin-left: 0.5rem;
  }
}

/* ------------------------------------------------------------------ band */

/* The one bold element: gameweek controls and the week's headlines on cobalt */
.band {
  --focus: #fff;
  padding-block: 0.75rem 1.75rem;
  background: var(--cobalt);
  color: #fff;
}

.band > * {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}

.step {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 6px;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  text-decoration: none;
}

.step:hover {
  background: rgb(255 255 255 / 0.16);
}

.step.off {
  opacity: 0.3;
}

.band .gw {
  min-height: 0;
  padding: 0.25rem 1.5rem 0.25rem 0.25rem;
  border: 0;
  background: transparent var(--caret) no-repeat right 0.25rem center / 0.75rem;
  color: #fff;
  font: 800 1.5rem/1.2 var(--font);
  font-stretch: 75%;
  filter: none;
}

.band .gw {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.band .gw option {
  background: var(--surface);
  color: var(--ink);
  font: 400 1rem var(--font);
}

/* Beside the gameweek: a green flashing Live pill while it is played, a red Done pill once it is over */
.state {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

.state.on {
  background: #14833b;
}

.state.off {
  background: #b3202b;
}

.state-dot {
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: #fff;
}

.state.on .state-dot {
  background: #5dff8f;
  box-shadow: 0 0 0 0 rgb(93 255 143 / 0.7);
  animation: live 1.4s ease-out infinite;
}

@keyframes live {
  0% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgb(93 255 143 / 0.7);
  }
  70% {
    opacity: 0.35;
    box-shadow: 0 0 0 0.45em rgb(93 255 143 / 0);
  }
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgb(93 255 143 / 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .state.on .state-dot {
    animation: none;
  }
}

/* Time to the next deadline, beside the gameweek stepper. Amber inside a day, red inside an hour. */
.countdown {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.4rem;
  padding: 0.25rem 0.5rem 0.25rem 0.8rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.16);
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.countdown .lbl {
  margin-right: 0.15rem;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.countdown .seg {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
  padding: 0.1rem 0.45rem;
  border-radius: 8px;
  background: rgb(0 0 0 / 0.24);
  white-space: nowrap;
}

.countdown .seg b {
  min-width: 1.35ch;
  font-size: 1.0625rem;
  font-weight: 800;
  text-align: center;
}

.countdown .seg small {
  font-size: 0.6875rem;
  opacity: 0.8;
}

.countdown.soon {
  background: rgb(255 209 92 / 0.25);
  color: #ffe08a;
}

.countdown.urgent {
  background: rgb(255 107 107 / 0.3);
  color: #ffd6d6;
}

.tools-end {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
}

.note {
  margin-top: 0.25rem;
  color: rgb(255 255 255 / 0.85);
  font-size: 0.875rem;
}

.title {
  margin-top: 0.75rem;
  font: 800 clamp(2.5rem, 1.5rem + 4.5vw, 4rem) / 1 var(--font);
  font-stretch: 75%;
}

.lede {
  display: grid;
  gap: 0.375rem;
  margin-top: 1rem;
}

.lede p {
  font: 800 clamp(1.75rem, 1rem + 3.6vw, 3.25rem) / 1.04 var(--font);
  font-stretch: 75%;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

/* Headlines slide in when you change page or gameweek, never on the minute refresh */
#app.enter .lede p,
#app.enter .title {
  animation: rise 0.35s ease-out both;
}

#app.enter .lede p:nth-child(2) {
  animation-delay: 0.06s;
}

#app.enter .lede p:nth-child(3) {
  animation-delay: 0.12s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.4em);
  }
}

/* ------------------------------------------------------------------ controls */

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.tools select {
  flex: 1 1 14rem;
  max-width: 24rem;
}

select {
  min-height: 2.5rem;
  max-width: 100%;
  padding: 0.5rem 2.25rem 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface) var(--caret) no-repeat right 0.85rem center / 0.75rem;
  color: var(--ink);
  font: inherit;
  appearance: none;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  font-weight: 500;
}

input[role="switch"] {
  position: relative;
  flex: none;
  width: 2.5rem;
  height: 1.5rem;
  margin: 0;
  border-radius: 999px;
  background: var(--muted);
  cursor: pointer;
  appearance: none;
  transition: background 0.15s;
}

input[role="switch"]::after {
  content: "";
  position: absolute;
  top: 0.1875rem;
  left: 0.1875rem;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

input[role="switch"]:checked {
  background: var(--cobalt);
}

input[role="switch"]:checked::after {
  transform: translateX(1rem);
}

button,
[role="button"],
.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--cobalt);
  border-radius: 6px;
  background: var(--cobalt);
  color: #fff;
  cursor: pointer;
  font: 600 0.9375rem/1.2 var(--font);
  text-decoration: none;
}

button.outline,
[role="button"].outline {
  background: transparent;
  color: var(--link);
  border-color: var(--link);
}

button.secondary,
[role="button"].secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}

.band .tool {
  background: transparent;
  border-color: rgb(255 255 255 / 0.6);
}

.band .tool:hover {
  background: rgb(255 255 255 / 0.16);
}

h2 + .found {
  margin-top: 0.25rem;
}

.found {
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ------------------------------------------------------------------ tables */

.scroll {
  overflow-x: auto;
}

.scroll + .scroll,
.scroll + article {
  margin-top: 1.5rem;
}

.tight th,
.tight td {
  padding-inline: 0.35rem;
}

.tight .who {
  max-width: 7rem;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  padding-left: 0;
}

th {
  border-bottom: 2px solid var(--ink);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  vertical-align: bottom;
}

th.num,
td.num {
  text-align: right;
}

td.key {
  font-weight: 700;
}

td.wrap,
.cards td.pin2 {
  white-space: normal; /* a long manager name wraps, so every award column fits a phone */
}

/* On a phone the first two columns stay put while the rest scrolls sideways */
.pin {
  position: sticky;
  z-index: 1;
}

.pin1 {
  left: 0;
  min-width: 3.5rem;
}

.pin2 {
  left: 3.5rem;
  border-right: 1px solid var(--rule);
}

@media (min-width: 48rem) {
  .pin2 {
    border-right: 0;
  }
}

@media (hover: hover) {
  tbody tr:hover td:not(.best, .worst) {
    background: var(--hover);
  }
}

td.up,
td.down,
td.win {
  font-weight: 600;
}

td.up {
  color: var(--good);
}

td.down {
  color: var(--bad);
}

td.best,
td.worst {
  color: #fff;
  font-weight: 700;
}

td.best {
  background: var(--best);
}

td.worst {
  background: var(--worst);
}

td.same {
  opacity: 0.4;
}

td.grey {
  color: var(--muted);
}

td.bold {
  font-weight: 700;
}

.who {
  display: block;
  max-width: 11rem;
}

.who > * {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* On the League page the name opens the manager's profile and the rest of the row opens his squad */
.who a.name {
  color: inherit;
  text-decoration: none;
}

.who a.name:hover,
.who a.name:focus-visible {
  color: var(--link);
  text-decoration: underline;
}

.who .name {
  font-weight: 600;
}

.who .team {
  color: var(--muted);
  font-size: 0.8125rem;
}

@media (min-width: 48rem) {
  .who {
    max-width: 20rem;
  }
}

.place {
  display: block;
}

.rank {
  display: block;
  font: 800 1.25rem/1 var(--font);
  font-stretch: 75%;
}

.move {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.move.up {
  color: var(--good);
}

.move.down {
  color: var(--bad);
}

.move.best,
.move.worst {
  display: inline-block;
  padding: 0 0.35em;
  border-radius: 3px;
  background: var(--best);
  color: #fff;
}

.move.worst {
  background: var(--worst);
}

.card,
.chip,
.tag {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
}

.card {
  border-radius: 3px;
  background: var(--booked-fill);
  color: var(--booked);
}

.chip,
.tag {
  border: 1px solid currentcolor;
  border-radius: 999px;
  color: var(--link);
  font-weight: 600;
}

tr:has(+ tr.detail) td {
  border-bottom: 0;
}

tr.clickable {
  cursor: pointer;
}

tr.match td:not(.best, .worst) {
  background: var(--booked-fill);
}

tr.detail .picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.5rem;
  padding-block: 0.5rem;
  color: var(--ink);
}

.card {
  text-align: center;
  font-weight: 600;
}

.card > div {
  overflow: hidden;
  padding: 0.2rem 0.15rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card .kit {
  position: relative;
  height: 4.75rem;
  padding: 0;
}

.card img {
  height: 100%;
}

.card .badge {
  position: absolute;
  top: 0;
  right: 0.5rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 0.6875rem;
  line-height: 1.25rem;
}

.card .nm {
  background: #1c1c21;
  color: #fff;
  overflow-wrap: anywhere;
  white-space: normal;
}

.card .eo {
  background: #00ff87;
  color: #0b1630;
}

.card .pt {
  background: var(--rule);
}

.card.bench .pt {
  background: #000;
  color: #fff;
}

tr.detail td {
  padding-top: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  white-space: normal;
}

/* The line stays in view while the table scrolls sideways under it */
tr.detail td > div {
  position: sticky;
  left: 0;
  width: calc(100vw - 2 * var(--gutter));
  max-width: 44rem;
}

/* Detailed rows: one coloured line under each manager. The old 44rem cap on a line of facts would wrap it, so it may run the table's width. */
tr.detail td > div:has(.strip) {
  max-width: 100%;
}

.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  align-items: center;
  padding: 0.35rem 0 0.6rem;
  color: var(--ink);
  font-size: 0.8125rem;
}

.dchip,
.dswap {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.dchip {
  background: var(--hover);
  color: var(--ink);
}

.dchip.ft {
  background: color-mix(in srgb, var(--link) 18%, transparent);
  color: var(--link);
}

.dchip.all,
.dchip.up {
  background: color-mix(in srgb, var(--good) 16%, transparent);
  color: var(--good);
}

.dchip.some {
  background: var(--booked-fill);
  color: var(--booked);
}

.dchip.down {
  background: color-mix(in srgb, var(--bad) 16%, transparent);
  color: var(--bad);
}

.dswap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--rule);
  background: var(--surface);
}

.dswap .out {
  color: var(--bad);
  font-weight: 500;
}

.dswap .in {
  color: var(--good);
}

.dswap .arrow {
  color: var(--muted);
}

.dswap .pill {
  min-width: 0;
  padding: 0 0.3rem;
  background: none;
}

/* The squad cards fill the width of the page */
tr.detail td > div:has(.picks) {
  width: min(100vw - 2 * var(--gutter), var(--measure) - 2 * var(--gutter));
  max-width: none;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.chips {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}

details {
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
}

summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "+";
  width: 1.25rem;
  font-weight: 700;
}

details[open] > summary::before {
  content: "\2212";
}

details > :not(summary) {
  margin-top: 1rem;
}

/* ------------------------------------------------------------------ awards */

.award {
  display: grid;
  gap: 0.5rem 2rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 48rem) {
  .award {
    grid-template-columns: 15rem 1fr;
  }
}

.award .rule,
.award .team,
.award .none {
  color: var(--muted);
  font-size: 0.875rem;
}

.award ul {
  display: grid;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.award li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.25rem 1rem;
  overflow-wrap: anywhere;
}

.award .team {
  display: block;
}

.award li.more {
  color: var(--muted);
  font-size: 0.875rem;
}

.award .result {
  max-width: 16rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.award.good .result {
  color: var(--good);
}

.award.bad .result {
  color: var(--bad);
}

/* ------------------------------------------------------------------ popup */

dialog {
  width: min(100% - 2rem, 44rem);
  max-height: 85vh;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}

dialog::backdrop {
  background: rgb(11 22 48 / 0.65);
}

dialog > header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

dialog .body {
  padding: 1rem;
}

html:has(dialog[open]) {
  overflow: hidden;
}

/* ------------------------------------------------------------------ messages and compare */

article {
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
}

article + article {
  margin-top: 1rem;
}

article > header {
  margin: -1rem -1rem 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rule);
  font-weight: 700;
}

article > br {
  display: none;
}

article > strong,
article > small {
  display: block;
}

article > :is(.shot, textarea, .actions, .scroll, .facts) {
  margin-top: 0.75rem;
}

article th,
article td {
  background: var(--surface);
}

.shot {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

textarea {
  display: block;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: 400 0.875rem/1.45 var(--font);
  resize: vertical;
  white-space: pre-wrap;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.vs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.vs > * {
  min-width: 0;
}

.vs select {
  width: 100%;
  max-width: none;
}

.vs article {
  padding: 0.75rem;
}

.vs article + article {
  margin-top: 0;
}

.vs td,
.vs th {
  padding-inline: 0.3rem;
}

.vs td {
  white-space: normal; /* a long player name wraps instead of scrolling the lineup sideways */
}

@media (max-width: 36rem) {
  .vs :is(td, th):nth-child(3) {
    display: none;
  }
}

/* ------------------------------------------------------------------ motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.tabs {
  display: flex;
  flex-wrap: wrap; /* four tabs wrap on a phone instead of pushing the page sideways */
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* The season awards, two to a row on a wide screen */
.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start; /* a short award keeps its own height beside a tall one */
}

@media (min-width: 48rem) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* A tick in a table: large, green, and in the middle of its column */
td.center,
th.center {
  text-align: center;
}

.tickcell {
  display: grid;
  justify-items: center;
}

.tick {
  color: var(--good);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.tickcell small {
  color: var(--muted);
  font-size: 0.75rem;
}

.cards > section {
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
}

.cards > section > h3 {
  margin-bottom: 0.5rem;
}

/* The awards of the week, two to a row once the popup is wide enough */
.week-awards {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 40rem) {
  .week-awards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.week-awards .award {
  grid-template-columns: minmax(0, 1fr);
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
}

.emoji {
  margin-right: 0.25rem;
  font-size: 1.6em;
  line-height: 1;
  vertical-align: -0.1em;
}

/* ------------------------------------------------------------------ scout */
.scout-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* a wide table scrolls inside its box, not the page */
  gap: 1.5rem;
}

/* The note Gemini wrote for the chosen manager */
.ai-note {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--cobalt);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}

.ai-note p {
  margin: 0;
  white-space: pre-line; /* one player a line */
}

.ai-note summary {
  font-weight: 700;
}

.ai-note .sources {
  color: var(--muted);
  font-size: 0.875rem;
}

.ai-note p + p {
  margin-top: 0.4rem;
}

.ai-note small {
  color: var(--muted);
}

.moves {
  display: grid;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.moves li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}


/* Scout transfer plan: the free moves as cards, the AI button, and the AI note drawn as rows */
.plan,
.ai-panel {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
}

.ai-panel[hidden] {
  display: none;
}

.plan-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
}

.plan h4,
.note-sec h4 {
  margin: 0 0 0.4rem;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pill {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--hover);
  font-size: 0.8125rem;
  font-weight: 600;
}

.ai-tag {
  padding: 0 0.4rem;
  border-radius: 4px;
  background: var(--cobalt);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ai-btn {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  width: auto;
  margin: 0;
  padding: 0.45rem 0.9rem;
  border: 2px solid var(--cobalt);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.ai-btn .ai-tag {
  font-size: 0.8125rem;
}

.ai-btn[aria-expanded="true"] {
  background: var(--cobalt);
  color: #fff;
}

.ai-btn[aria-expanded="true"] .ai-tag {
  background: #fff;
  color: var(--cobalt);
}

.ai-head {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.mvs {
  display: grid;
  gap: 0.6rem;
}

.mv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.35rem 0.6rem;
  align-items: center;
  padding: 0.6rem;
  border-radius: 10px;
  background: var(--paper);
}

.mv .step {
  grid-row: 1 / span 4;
  align-self: start;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.8125rem;
  font-weight: 800;
}

.mv .pl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 0.6rem;
  align-items: center;
  min-width: 0;
  padding: 0.3rem 0.6rem;
  border-left: 4px solid var(--bad);
  border-radius: 6px;
  background: var(--surface);
}

.mv .pl.in {
  border-left-color: var(--good);
}

.mv .pl > div {
  display: grid;
  min-width: 0;
}

.mv .pl small,
.note-row small {
  color: var(--muted);
}

.mv .arrow {
  grid-column: 2;
  color: var(--muted);
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.mv .pl.out {
  grid-column: 2;
}

.mv .pl.in {
  grid-column: 2;
}

.mv .gain {
  grid-column: 2;
  justify-self: start;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--best);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 800;
  text-align: center;
}

.brave summary {
  cursor: pointer;
  font-weight: 700;
}

.brave .mvs {
  margin-top: 0.6rem;
}

.brave .gain {
  background: var(--booked-fill);
  color: var(--booked);
}

.note-sec {
  display: grid;
  gap: 0.4rem;
}

.note-sec h4 {
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--rule);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.note-sec h5 {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.note-text {
  margin: 0;
}

.note-row {
  display: grid;
  grid-template-columns: 4.25rem 2.25rem minmax(0, 1fr);
  gap: 0.1rem 0.6rem;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border-left: 4px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
}

.note-row .badge {
  padding: 0.1rem 0;
  border-radius: 4px;
  background: var(--rule);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.note-row.keep {
  border-left-color: var(--best);
}

.note-row.keep .badge {
  background: var(--best);
  color: #fff;
}

.note-row.sell {
  border-left-color: var(--worst);
}

.note-row.sell .badge {
  background: var(--worst);
  color: #fff;
}

.note-row.buy {
  border-left-color: var(--cobalt);
}

.note-row.buy .badge {
  background: var(--cobalt);
  color: #fff;
}

.note-row.avoid {
  border-left-color: var(--booked);
}

.note-row.avoid .badge {
  background: var(--booked-fill);
  color: var(--booked);
}

.note-row .who {
  display: grid;
  min-width: 0;
}

.note-row .xpbar {
  grid-column: 2 / -1;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.note-row .bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--rule);
  overflow: hidden;
}

.note-row .bar i {
  display: block;
  height: 100%;
  background: var(--cobalt);
}

.note-row .xpbar b {
  font-size: 0.8125rem;
}

.note-row .why {
  grid-column: 2 / -1;
  margin: 0;
  font-size: 0.9375rem;
}

@media (min-width: 48rem) {
  .mv {
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto;
  }

  .mv .pl.out,
  .mv .arrow,
  .mv .pl.in,
  .mv .gain,
  .mv .step {
    grid-column: auto;
    grid-row: auto;
    align-self: center;
    justify-self: auto;
  }

  .note-row {
    grid-template-columns: 4.25rem 2.25rem minmax(0, 1.2fr) 9rem;
  }

  .note-row .xpbar {
    grid-column: 4;
    grid-row: 1;
  }

  .note-row .why {
    grid-column: 3 / -1;
  }
}

/* Player faces: FPL's cut-out photos on a soft disc, with the player's first letters until the photo loads */
.face {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  overflow: hidden;
  background: var(--hover);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.face.sm {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
}

.face.big {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

.face.ok {
  color: transparent;
}

/* Cropped to the head: zoom in from the top centre, so a kit from last season shows little or not at all */
.face img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  transform: scale(var(--zoom, 1.5));
  transform-origin: 50% 0;
}

.face.big img {
  --zoom: 1.8;
}

.face.old img {
  --zoom: 2.2;
}

.pcell {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.card .kit .face {
  position: absolute;
  bottom: 0;
  left: 0.15rem;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--surface);
}

.card .kit .face img {
  height: auto;
}

.mv .gain.poor {
  background: var(--worst);
  color: #fff;
}

/* The button that asks the AI for a manager's note */
.ai-body {
  display: grid;
  gap: 0.85rem;
}

.ai-ask {
  justify-self: start;
  width: auto;
  margin: 0;
  padding: 0.55rem 1.1rem;
  border: 2px solid var(--cobalt);
  border-radius: 999px;
  background: var(--cobalt);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.ai-ask:disabled {
  opacity: 0.6;
  cursor: progress;
}

.own-key {
  display: grid;
  gap: 0.5rem;
}

.own-key summary {
  cursor: pointer;
  font-weight: 700;
}

.own-key input {
  width: 100%;
  max-width: 28rem;
  margin: 0;
}

.own-key small {
  color: var(--muted);
}

.own-key-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.own-key-row input {
  flex: 1 1 14rem;
}

.own-key small {
  display: block;
}

/* The note's own words keep their line breaks, and a row's small print sits under the reason */
.note-text {
  white-space: pre-line;
}

.note-row .extra {
  grid-column: 2 / -1;
  color: var(--muted);
}

@media (min-width: 48rem) {
  .note-row .extra {
    grid-column: 3 / -1;
  }
}

/* The Awards page's two tabs: one panel at a time, its parts spaced as the page spaces them */
.awards-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

.awards-panel > section > h3 {
  margin-bottom: 0.5rem;
}

/* ------------------------------------------------------------------ league race */
.race {
  display: grid;
  gap: 1rem;
}

.race .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.race .legend select {
  width: auto;
  min-width: 12rem;
}

.chip-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.25rem 0.25rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.875rem;
}

.chip-pick .remove {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}

.swatch {
  display: inline-block;
  width: 0.9rem;
  height: 3px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 0.35rem;
}

.chip-pick .swatch {
  margin-right: 0;
}

.s1 {
  background: var(--series-1);
}

.s2 {
  background: var(--series-2);
}

.s3 {
  background: var(--series-3);
}

.s4 {
  background: var(--series-4);
}

.race .plot {
  position: relative;
}

.race svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: pan-y; /* a sideways drag reads the chart, an upward one still scrolls */
}

.race svg text {
  font-family: var(--font);
}

.race .hair {
  stroke: var(--muted);
  stroke-width: 1;
}

.race .tip {
  position: absolute;
  top: 0.25rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8125rem;
  line-height: 1.5;
  pointer-events: none;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.12);
}


/* ------------------------------------------------------------------ manager profile */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 48rem) {
  .tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tile {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
}

.tile .label,
.tile small {
  color: var(--muted);
  font-size: 0.8125rem;
}

.tile strong {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.until {
  color: var(--muted);
}

.chip-rows {
  display: grid;
  gap: 0.6rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  align-items: center;
}

.chip-row > strong {
  min-width: 3.25rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.chip-row .none {
  color: var(--muted);
}

/* The profile's tabs: one panel at a time, its sections spaced as the page spaces them */
.tab-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}

.tab-panel .tiles {
  margin-bottom: 0;
}

.tab-panel > section > h3 {
  margin-bottom: 0.5rem;
}

/* How far up the world a past season finished: a longer bar is a better finish */
.pct {
  display: grid;
  gap: 0.25rem;
  min-width: 6.5rem;
}

.pct i {
  position: relative;
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--rule);
}

.pct i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  border-radius: 3px;
  background: var(--link);
}

/* Pick which gameweeks of transfers to show: None, All, or any mix */
.gw-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.gw-filter button {
  min-height: 2.25rem;
  padding: 0.2rem 0.8rem;
  font-size: 0.8125rem;
}

/* A card per gameweek of transfers, packed in columns so a long week never leaves a gap beside short ones */
.transfer-groups {
  columns: 3 19rem;
  column-gap: 0.75rem;
}

.transfer-groups details {
  break-inside: avoid;
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
}

.transfer-groups summary {
  gap: 0.5rem;
  color: var(--ink);
}

.transfer-groups summary .gw {
  font-size: 1.0625rem;
  font-weight: 700;
}

.transfer-groups summary small {
  margin-right: auto;
  color: var(--muted);
  font-weight: 400;
}

.transfer-groups details > ul {
  margin-top: 0.6rem;
}

/* The gameweek just picked runs the full width of the page and lays its swaps out across it */
.transfer-groups details.wide {
  column-span: all;
}

.transfer-groups details.wide .swaps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  column-gap: 2rem;
}

.swaps {
  padding: 0;
  list-style: none;
}

.swaps li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0;
  border-top: 1px solid var(--rule);
}

.swaps .nm {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.swaps .swap-out .nm {
  color: var(--muted);
  font-weight: 500;
}

.swaps small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.swaps .arrow {
  color: var(--muted);
}

.pill {
  min-width: 2.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--hover);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.pill.up {
  background: color-mix(in srgb, var(--good) 16%, transparent);
  color: var(--good);
}

.pill.down {
  background: color-mix(in srgb, var(--bad) 16%, transparent);
  color: var(--bad);
}

/* ------------------------------------------------------------------ League board */
/* On the light page the board is only its cards, drawn in the page's own colours. On the dark page the cards sit on a deeper navy panel. */
.board {
  --board: transparent;
  --board-ink: var(--ink);
  --board-dim: var(--muted);
  --card-edge: var(--rule);
  --card-shadow: 0 1px 2px rgb(15 35 66 / 0.06);
  --board-pad: 0rem;
  --board-radius: 0px;
  --teal: #0e8f7a;
  padding: var(--board-pad);
  border-radius: var(--board-radius);
  background: var(--board);
  color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .board {
    --board: #070f24;
    --board-ink: #fff;
    --board-dim: #cdd8f2;
    --card-edge: transparent;
    --card-shadow: none;
    --board-pad: 0.5rem;
    --board-radius: 20px;
    --teal: #3fd4bc;
  }
}

:root[data-theme="dark"] .board {
  --board: #070f24;
  --board-ink: #fff;
  --board-dim: #cdd8f2;
  --card-edge: transparent;
  --card-shadow: none;
  --board-pad: 0.5rem;
  --board-radius: 20px;
  --teal: #3fd4bc;
}

.board-title {
  margin: 0.5rem 0 0.75rem;
  color: var(--board-ink);
  font-size: 1.125rem;
  text-align: center;
}

.board-head,
.board .main {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 2.6fr) minmax(0, 1.5fr) 5.5rem 6rem 2.25rem;
  column-gap: 0.75rem;
  align-items: center;
  padding-inline: 1rem;
}

.board.live .board-head,
.board.live .main {
  grid-template-columns: 4.5rem minmax(0, 2.6fr) 3.5rem minmax(0, 1.5fr) 5.5rem 6rem 2.25rem;
}

.board-head {
  padding-block: 0.25rem 0.5rem;
  color: var(--board-dim);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

.board-head span:nth-child(2) {
  text-align: left;
}

.board-rows {
  display: grid;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.bcard {
  overflow: hidden;
  border: 1px solid var(--card-edge);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
  color: var(--ink);
}

.board .main {
  min-height: 5.5rem;
  padding-block: 0.75rem;
  cursor: pointer;
}

.board .meta {
  display: contents;
}

.board .meta > *,
.board .gw,
.board .total {
  display: grid;
  gap: 0.1rem;
  justify-items: center;
  text-align: center;
}

.board .lab {
  display: none;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
}

/* Position: a coloured dot for the places moved, then the rank in teal */
.pos {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 0.45rem;
}

.dot {
  display: grid;
  grid-column: 1;
  width: 1.6rem;
  height: 1.6rem;
  place-items: center;
  border-radius: 50%;
  background: #b4bac8;
  color: #fff;
  font-size: 0.625rem;
}

.dot.up {
  background: #2fc489;
}

.dot.down {
  background: #e5484d;
}

.rank {
  grid-column: 2;
  grid-row: 1;
  color: var(--teal);
  font-size: 1.375rem;
}

.moved {
  grid-column: 1;
  justify-self: center;
  color: var(--muted);
  font-size: 0.6875rem;
}

/* Names and the pills under them */
.who2 {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  justify-items: start;
  text-align: left;
}

.board .names {
  display: grid;
  justify-items: start;
  color: inherit;
  text-decoration: none;
}

.board .names:hover .team,
.board .names:focus-visible .team {
  color: var(--link);
  text-decoration: underline;
}

.board .team {
  font-size: 1.1875rem;
  font-weight: 800;
  line-height: 1.2;
}

.board .mgr {
  color: var(--ink);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pills .or {
  padding: 0.1rem 0.65rem;
  white-space: nowrap;
  border-radius: 999px;
  background: var(--hover);
  font-size: 0.8125rem;
}

.chipp {
  padding: 0 0.55rem;
  border: 1.5px solid var(--muted);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: line-through;
}

.chipp.now {
  border-color: var(--link);
  background: var(--link);
  color: var(--surface);
  text-decoration: none;
}

.board .cap small {
  color: var(--muted);
  font-size: 0.75rem;
}

.board .gw.best {
  color: var(--good);
}

.board .gw.worst {
  color: var(--bad);
}

.board .gw,
.board .cap b,
.board .yet {
  font-size: 1.0625rem;
  font-weight: 700;
}

.board .total b {
  font-size: 1.25rem;
}

.board .chev {
  min-height: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1.75rem;
  line-height: 1;
  transition: transform 0.15s;
}

.bcard.open .chev {
  transform: rotate(90deg);
}

/* Under the main line: the coloured Detailed rows line, and the squad when the card is open */
.board .sub {
  padding: 0.6rem 1rem 0.75rem;
  border-top: 1px solid var(--rule);
}

.board .sub .picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.5rem;
  margin-top: 0.6rem;
  color: var(--ink);
}

.board .strip {
  padding: 0;
}

.board .dchip,
.board .dswap {
  font-size: 0.8125rem;
}

.board .dchip {
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.board .dchip.ft,
.board .dchip.all {
  background: var(--hover);
  color: var(--ink);
}

.board .dswap .out {
  text-decoration: line-through;
}

.board .dswap .pill {
  color: var(--muted);
}

.board .dchip.eq {
  background: none;
  color: var(--teal);
  letter-spacing: 0;
  text-transform: none;
}

.board .dchip.eq.down {
  color: var(--bad);
}

/* A phone has no room for the header, so each card carries its own labels and the captain moves under the names */
@media (max-width: 47.99rem) {
  .board {
    padding: calc(var(--board-pad) * 0.7);
    border-radius: calc(var(--board-radius) * 0.8);
  }

  .board-head {
    display: none;
  }

  .board .main,
  .board.live .main {
    grid-template-areas:
      "pos who gw total chev"
      "pos pills pills pills pills"
      "pos meta meta meta meta";
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    row-gap: 0.4rem;
    column-gap: 0.6rem;
    padding-inline: 0.75rem;
  }

  .board .pos {
    grid-area: pos;
    align-self: start;
  }

  .board .who2 {
    display: contents;
  }

  .board .names {
    grid-area: who;
  }

  .board .pills {
    grid-area: pills;
  }

  .board .gw {
    grid-area: gw;
  }

  .board .total {
    grid-area: total;
  }

  .board .chev {
    grid-area: chev;
  }

  .board .meta {
    display: flex;
    grid-area: meta;
    gap: 1rem;
    align-items: baseline;
    color: var(--ink);
    font-size: 0.875rem;
  }

  .board .meta > * {
    display: flex;
    gap: 0.35rem;
    align-items: baseline;
  }

  .board .lab {
    display: inline;
  }

  .board .gw,
  .board .total {
    justify-items: end;
  }

  .board .gw .lab,
  .board .total .lab {
    display: block;
  }

  .board .team {
    font-size: 1.0625rem;
  }
}

/* Scout's live view: how the suggested moves are scoring while the gameweek is played */
.live-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}

.live-head h4 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  font-stretch: 75%;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.live-head .pill {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lchip {
  display: inline-block;
  margin-left: 0.15rem; /* clear of the table's left edge, which clips anything flush with it */
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  font-stretch: 85%;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  background: color-mix(in srgb, var(--muted) 14%, transparent);
  color: var(--muted);
}

.lchip.free,
.lchip.plan,
.lchip.site,
.lchip.both {
  background: color-mix(in srgb, var(--cobalt) 14%, transparent);
  color: var(--link);
}

.lchip.hit {
  background: var(--booked-fill);
  color: var(--booked);
}

.lchip.ai {
  background: color-mix(in srgb, var(--series-2) 16%, transparent);
  color: var(--series-2);
}

.lchip.both {
  box-shadow: inset 0 0 0 1px currentColor; /* inside the chip, so the table's scroll box cannot clip it */
}

.lchip.made {
  background: color-mix(in srgb, var(--good) 16%, transparent);
  color: var(--good);
}

td.dim {
  color: var(--muted);
}

td.key.up,
td.key.down {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Scout differentials as cards: a grid that is two across on a phone and fills the width on a desktop */
.dcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (max-width: 40rem) {
  .dcards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dcard {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 1rem 0.75rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cobalt) 10%, var(--surface)) 0 45%, var(--surface) 45%);
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--ink) 14%, transparent);
}

.dcard .rank {
  position: absolute;
  top: 0.5rem;
  left: 0.6rem;
  font-size: 1.5rem;
  font-weight: 900;
  font-stretch: 75%;
  color: color-mix(in srgb, var(--ink) 35%, transparent);
}

.dcard .punt {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
}

.dcard .face.big {
  width: 5.5rem;
  height: 7rem;
}

.dcard h4 {
  margin: 0.25rem 0 0;
  font-size: 1.1rem;
  font-weight: 800;
  font-stretch: 80%;
  line-height: 1.1;
}

.dcard .meta,
.dcard .next {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.dcard .dxp {
  margin: 0.15rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.dcard .dxp strong {
  font-size: 1.9rem;
  font-weight: 900;
  font-stretch: 75%;
  color: var(--good);
  font-variant-numeric: tabular-nums;
}

.dbar {
  display: grid;
  grid-template-columns: 3.4rem 1fr 2.8rem;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: left;
}

.dbar b {
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dbar .track {
  height: 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  overflow: hidden;
}

.dbar .fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.dbar .fill.league {
  background: var(--series-1);
}

.dbar .fill.global {
  background: var(--series-2);
}

.dcard .next {
  margin-top: 0.35rem;
  font-weight: 600;
  color: var(--ink);
}

/* Scout template eleven on a pitch: keeper at the top, forwards at the bottom, mowed stripes and a halfway line */
.pitch {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1.25rem 0.5rem;
  border-radius: 0.75rem;
  background:
    linear-gradient(transparent calc(50% - 1px), rgb(255 255 255 / 0.35) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    repeating-linear-gradient(180deg, #1f7a3d 0 3.5rem, #23863f 3.5rem 7rem);
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.35);
  overflow: hidden;
}

.prow {
  display: flex;
  justify-content: space-evenly;
  gap: 0.35rem;
}

.tcard {
  display: flex;
  flex: 0 1 7.5rem;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
}

.tcard .face.big {
  width: 4rem;
  height: 5rem;
  background: transparent;
}

.tcard strong {
  max-width: 100%;
  padding: 0.1rem 0.45rem;
  border-radius: 0.3rem 0.3rem 0 0;
  background: #fff;
  color: #0f2342;
  font-size: 0.8rem;
  font-weight: 800;
  font-stretch: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tcard .tl {
  width: 100%;
  max-width: 6.5rem;
  padding: 0.05rem 0.3rem;
  background: #0f2342;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tcard .tg {
  width: 100%;
  max-width: 6.5rem;
  padding: 0.05rem 0.3rem;
  border-radius: 0 0 0.3rem 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tcard .tg.up {
  background: #c6efce;
  color: #006100;
}

.tcard .tg.down {
  background: #ffc7ce;
  color: #9c0006;
}

@media (max-width: 40rem) {
  .tcard .face.big {
    width: 3.2rem;
    height: 4rem;
  }

  .tcard strong,
  .tcard .tl {
    font-size: 0.7rem;
  }

  .tcard .tg {
    font-size: 0.6rem;
  }
}

.dcard .dxp.down strong {
  color: var(--bad);
}

/* Price cards: the league owners line reads large, since it says who in this league is moving */
.pcard .next {
  margin-top: 0.5rem;
  font-size: 1.15rem;
  font-weight: 800;
  font-stretch: 85%;
}

/* Scout squads by expected points: a ranked list with a bar against the top squad and the best captain */
.xrank {
  display: grid;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.xrank li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 14rem) 1fr 3rem minmax(0, 11rem);
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 0.6rem;
  background: var(--surface);
}

.xrank li.podium {
  border-color: color-mix(in srgb, var(--cobalt) 45%, var(--rule));
  background: color-mix(in srgb, var(--cobalt) 7%, var(--surface));
}

.xrank .rank {
  grid-column: auto; /* the League page's .rank places itself in column 2 */
  grid-row: auto;
  font-size: 1.4rem;
  font-weight: 900;
  font-stretch: 75%;
  color: color-mix(in srgb, var(--ink) 40%, transparent);
  text-align: center;
}

.xrank .podium .rank {
  color: var(--cobalt);
}

.xrank .track {
  height: 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  overflow: hidden;
}

.xrank .fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--series-3);
}

.xrank .xv {
  font-size: 1.25rem;
  font-weight: 900;
  font-stretch: 75%;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.xrank .xwho {
  min-width: 0;
}

.xrank .cap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.xrank .cap > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.xrank .cap b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xrank .cap small {
  color: var(--muted);
}

@media (max-width: 40rem) {
  .xrank li {
    grid-template-columns: 1.6rem minmax(0, 1fr) 2.6rem;
    row-gap: 0.35rem;
  }

  .xrank .track {
    grid-column: 2 / 4;
    grid-row: 3;
  }

  .xrank .cap {
    grid-column: 2 / 4;
    grid-row: 2;
  }
}

/* Scout live moves on a phone: one card a move instead of a table that scrolls sideways */
.lcards {
  display: none;
}

@media (max-width: 40rem) {
  .lwide {
    display: none;
  }

  .lcards {
    display: grid;
    gap: 0.5rem;
  }
}

.lcard {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 0.6rem;
  background: var(--surface);
}

.ltop {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.ltop .lchip {
  margin-left: 0;
}

.lgain {
  margin-left: auto;
  font-size: 1.3rem;
  font-weight: 900;
  font-stretch: 75%;
  font-variant-numeric: tabular-nums;
}

.lgain.up {
  color: var(--good);
}

.lgain.down {
  color: var(--bad);
}

.lswap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem;
}

.lswap .arrow {
  color: var(--muted);
}

.lside {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.lside > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.lside b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lside small {
  color: var(--muted);
}

.lside.out b {
  color: var(--muted);
  text-decoration: line-through;
}

/* League board sorting: header buttons that look like the header text, and a Sort list on a phone, where the header hides */
.board-head .hsort {
  width: auto;
  margin: 0;
  padding: 0.1rem 0.3rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  justify-self: center;
}

.board-head .hsort:hover,
.board-head .hsort.on {
  color: var(--board-ink, var(--ink));
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.board-sort {
  display: none;
}

@media (max-width: 47.99rem) {
  .board-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
  }

  .board-sort select {
    flex: 1;
    margin: 0;
  }
}

/* Share images: a tap zooms to real size in a box that scrolls sideways. The hint only shows on a phone, where images shrink most. */
.shotbox {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.shotbox .shot {
  cursor: zoom-in;
}

.shotbox.zoomed .shot {
  max-width: none;
  cursor: zoom-out;
}

.zoomhint {
  display: none;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 47.99rem) {
  .zoomhint {
    display: block;
  }

  /* Compare: one manager picker a row, so names are not cut off */
  .vs {
    grid-template-columns: 1fr;
  }

  /* Tap targets at least 44px high: the site name and the Detailed rows switch */
  .brand {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .switch {
    min-height: 44px;
  }

  /* Every button, link button and list at least 44px high, Apple's smallest comfortable tap */
  button,
  select,
  .tool,
  [role="button"] {
    min-height: 44px;
  }

  /* Controls that set their own smaller size elsewhere. The board's › is left alone: a tap anywhere on the card opens it. */
  #theme,
  .chip-pick .remove {
    min-width: 44px;
    min-height: 44px;
  }

  .band .gw,
  .gw-filter button {
    min-height: 44px;
  }
}

/* A profile's way back to the League, above its name */
.band .back {
  margin-bottom: 0.75rem;
}

@media (max-width: 47.99rem) {
  .wide-only {
    display: none;
  }
}

/* League player filter: Own, Started, Benched and Captained buttons with counts. Matches stay bright, the rest fade. */
.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-basis: 100%;
}

.modes button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.mcount {
  min-width: 1.6rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.25);
  font-variant-numeric: tabular-nums;
}

.modes button.secondary .mcount {
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}

/* League board GW: the points as scored, with any hit small and red beside them, such as 48 -4 */
.board .gw .hit {
  margin-left: 0.15rem;
  color: var(--bad);
  font-size: 0.75em;
  font-weight: 700;
}

/* Keep the Scout action available while reading the transfer plan. */
.scout-float {
  position: fixed;
  z-index: 9;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: grid;
  justify-items: end;
  gap: 0.4rem;
  max-width: min(22rem, calc(100vw - 2rem));
}

.scout-float .note-text:not(:empty) {
  margin: 0;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}

.scout-float .ai-ask {
  justify-self: end;
  box-shadow: 0 3px 12px #0003;
}

/* Scout verdicts use the same face cards as Differentials. */
.scout-picks { margin-top: 0.35rem; }
.scout-pick .badge {
  align-self: flex-start;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}
.scout-pick.keep .badge { background: var(--best); }
.scout-pick.sell .badge { background: var(--worst); }
.scout-pick.buy .badge { background: var(--cobalt); }
.scout-pick.avoid .badge { background: var(--booked-fill); color: var(--booked); }
.note-sec .scout-pick h4 {
  padding: 0;
  border: 0;
  font-size: 1.1rem;
  letter-spacing: normal;
  text-transform: none;
}
.scout-pick .pick-reason { margin: 0; font-size: 0.9rem; }
.scout-pick .pick-extra { color: var(--muted); font-size: 0.8rem; }

.scout-chat { display: grid; gap: 0.6rem; }
.scout-chat summary { cursor: pointer; font-weight: 700; }
.scout-chat textarea { display: block; width: 100%; margin: 0.75rem 0; font: inherit; }
.chat-messages { max-height: 22rem; overflow-y: auto; white-space: pre-wrap; }
.chat-messages p { margin: 0.75rem 0; }
.chat-usage { display: block; margin-top: 0.6rem; color: var(--muted); }

.scout-chat { position: relative; justify-self: end; display: block; }
.scout-chat summary { list-style: none; padding: 0.65rem 1rem; border-radius: 999px; background: var(--cobalt); color: white; box-shadow: 0 3px 12px #0003; }
.scout-chat summary::-webkit-details-marker { display: none; }
.chat-popup { position: absolute; right: 0; bottom: calc(100% + 0.5rem); width: min(23rem, calc(100vw - 2rem)); max-height: min(70vh, 36rem); overflow-y: auto; padding: 1rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: 0 6px 24px #0003; }
.chat-popup h4 { margin: 0; }
.chat-messages { max-height: 35vh; overflow-wrap: anywhere; }

/* Floating Scout conversation */
.scout-chat summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.1rem;
  background: linear-gradient(120deg, #2447d6, #6943d5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.scout-chat summary:hover { transform: translateY(-2px); box-shadow: 0 8px 22px #2447d655; }
.scout-chat summary span { font-size: 1.1rem; }
.chat-popup {
  display: flex;
  flex-direction: column;
  width: min(25rem, calc(100vw - 2rem));
  height: min(36rem, 70vh);
  max-height: 70vh;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 16px 50px #0004;
}
.chat-header { display: flex; align-items: center; gap: 0.75rem; padding: 1rem; background: linear-gradient(120deg, #182e90, #5e40bd); color: white; }
.chat-header strong, .chat-header small { display: block; }
.chat-header small { margin-top: 0.15rem; opacity: 0.8; }
.chat-avatar { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; flex: none; border-radius: 0.85rem; background: #ffffff26; font-size: 1.35rem; }
.chat-close { margin-left: auto; padding: 0.1rem 0.45rem; border: 0; border-radius: 0.4rem; background: transparent; color: white; font-size: 1.6rem; cursor: pointer; }
.chat-close:hover { background: #ffffff26; }
.chat-messages { flex: 1; min-height: 5rem; max-height: none; overflow-y: auto; padding: 1rem; background: var(--paper); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message { width: fit-content; max-width: 90%; margin-bottom: 0.85rem; padding: 0.65rem 0.8rem; border: 1px solid var(--rule); border-radius: 1rem 1rem 1rem 0.25rem; background: var(--surface); }
.chat-message.user { margin-left: auto; border-color: transparent; border-radius: 1rem 1rem 0.25rem 1rem; background: var(--cobalt); color: white; }
.chat-message-label { font-size: 0.7rem; font-weight: 800; opacity: 0.75; }
.chat-message p { margin: 0.2rem 0 0; line-height: 1.45; }
.chat-empty { display: grid; place-items: center; align-content: center; min-height: 100%; text-align: center; color: var(--muted); }
.chat-empty-icon { display: grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: 0.7rem; border-radius: 1rem; background: color-mix(in srgb, var(--cobalt) 12%, var(--surface)); color: var(--cobalt); font-size: 1.4rem; }
.chat-empty strong { color: var(--ink); }
.chat-empty p { margin: 0.4rem 0; max-width: 17rem; font-size: 0.875rem; }
.chat-composer { padding: 0.8rem 1rem 0.5rem; }
.scout-chat textarea { resize: vertical; min-height: 3rem; max-height: 8rem; margin: 0 0 0.5rem; padding: 0.65rem; border: 1px solid var(--rule); border-radius: 0.65rem; background: var(--paper); color: var(--ink); }
.chat-actions { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.chat-actions small, .chat-usage { color: var(--muted); font-size: 0.7rem; }
.chat-usage { margin: 0; padding: 0 1rem 0.8rem; }
.chat-popup > .note-text:not(:empty) { margin: 0 1rem; padding: 0; border: 0; background: none; font-size: 0.8rem; }
.chat-messages { overflow-anchor: none; white-space: normal; }
.chat-markdown { line-height: 1.45; }
.chat-markdown p { margin: 0.25rem 0; white-space: pre-wrap; }
.chat-markdown ul { margin: 0.35rem 0; padding-left: 1.2rem; }
.chat-markdown li + li { margin-top: 0.25rem; }
.chat-markdown .chat-heading { display: block; margin: 0.55rem 0 0.2rem; }
.chat-markdown code { padding: 0.05rem 0.2rem; border-radius: 0.2rem; background: color-mix(in srgb, currentColor 12%, transparent); }
.gemini-settings { margin: 0 0 1rem; padding: 0.75rem 1rem; border: 1px solid var(--rule); border-radius: 0.75rem; background: var(--surface); }
.gemini-settings summary { cursor: pointer; font-weight: 700; }
.gemini-settings p { margin: 0.6rem 0; color: var(--muted); font-size: 0.875rem; }
.gemini-settings input { flex: 1 1 14rem; min-width: 0; }
.gemini-settings small { display: block; margin-top: 0.5rem; color: var(--muted); }
