/*
 * Base stylesheet — layout, typography and the component library described in
 * DESIGN.md's `components:` block.
 *
 * Rules this file follows, from DESIGN.md / CLAUDE.md:
 *   - token-first: every colour, size and radius comes from tokens.css;
 *     there is no literal hex, rgb() or magic px here where a token exists.
 *   - three surface tones only — canvas, card, dark. No fourth tone.
 *   - display type at weight 500 (Inter, la stessa famiglia del corpo) with
 *     negative tracking, never bold.
 *   - default and active/pressed states only. No hover styling beyond the
 *     primary button darkening on press.
 *
 * The one deliberate addition: :focus-visible rings. DESIGN.md does not model
 * focus, but keyboard operability is not a style choice.
 */

/* ====================================================================== */
/* Reset                                                                   */
/* ====================================================================== */

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

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
  margin: 0;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

img,
svg {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ====================================================================== */
/* Document                                                                */
/* ====================================================================== */

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

body {
  background-color: var(--color-canvas);
  color: var(--color-body);
  font-family: var(--font-sans);
  font-size: var(--body-md-size);
  line-height: var(--body-line);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--rounded-xs);
}

.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-md);
  top: calc(var(--space-md) * -4);
  z-index: 100;
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--rounded-md);
  font-size: var(--button-size);
  font-weight: var(--button-weight);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-md);
}

/* ====================================================================== */
/* Typography                                                              */
/* ====================================================================== */

.display-xl,
.display-lg,
.display-md,
.display-sm,
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-display);
  color: var(--color-ink);
}

.display-xl,
h1 {
  font-size: var(--display-xl-size);
  line-height: var(--display-xl-line);
  letter-spacing: var(--display-xl-tracking);
}

.display-lg,
h2 {
  font-size: var(--display-lg-size);
  line-height: var(--display-lg-line);
  letter-spacing: var(--display-lg-tracking);
}

.display-md,
h3 {
  font-size: var(--display-md-size);
  line-height: var(--display-md-line);
  letter-spacing: var(--display-md-tracking);
}

.display-sm {
  font-size: var(--display-sm-size);
  line-height: var(--display-sm-line);
  letter-spacing: var(--display-sm-tracking);
}

.title-lg,
.title-md,
.title-sm,
h4,
h5 {
  font-family: var(--font-sans);
  font-weight: var(--title-weight);
  color: var(--color-ink);
  letter-spacing: 0;
}

.title-lg {
  font-size: var(--title-lg-size);
  line-height: var(--title-lg-line);
}

.title-md,
h4 {
  font-size: var(--title-md-size);
  line-height: var(--title-line);
}

.title-sm,
h5 {
  font-size: var(--title-sm-size);
  line-height: var(--title-line);
}

.body-md {
  font-size: var(--body-md-size);
  line-height: var(--body-line);
}

.body-sm {
  font-size: var(--body-sm-size);
  line-height: var(--body-line);
}

.lead {
  font-size: var(--title-md-size);
  line-height: var(--title-line);
  color: var(--color-body-strong);
}

.caption {
  font-size: var(--caption-size);
  line-height: var(--caption-line);
  font-weight: var(--caption-weight);
}

.caption-uppercase {
  font-size: var(--caption-uppercase-size);
  line-height: var(--caption-line);
  font-weight: var(--caption-weight);
  letter-spacing: var(--caption-uppercase-tracking);
  text-transform: uppercase;
}

.mono,
code,
pre {
  font-family: var(--font-mono);
  font-size: var(--code-size);
  line-height: var(--code-line);
}

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

/* Fine print only — below AA for body text. See DESIGN.md "Known Gaps". */
.u-muted-soft {
  color: var(--color-muted-soft);
}

.u-ink {
  color: var(--color-ink);
}

p + p {
  margin-top: var(--space-md);
}

.u-mt-xs {
  margin-top: var(--space-xs);
}

.u-mt-sm {
  margin-top: var(--space-sm);
}

.u-mt-md {
  margin-top: var(--space-md);
}

.u-mt-lg {
  margin-top: var(--space-lg);
}

/* ---- text-link ------------------------------------------------------- */

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

.text-link {
  color: var(--color-primary);
  text-decoration: none;
}

.text-link:active {
  color: var(--color-primary-active);
  text-decoration: underline;
}

/* Sul gesso più scuro il verde primario scende a 4,4:1 — sotto AA per il testo
   piccolo. Lì il link prende il tono premuto: stesso verde, un gradino più giù,
   e nessun colore nuovo nel sistema. */
.band--card .text-link,
.team-card .text-link,
.forum-post-opening .text-link {
  color: var(--color-primary-active);
}

/* ====================================================================== */
/* Layout: container and bands                                             */
/* ====================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

/*
 * A band is one full-width horizontal section. Bands carry the page's pacing:
 * consecutive bands must not repeat the same surface mode.
 */
.band {
  padding-block: var(--space-section);
}

.band--tight {
  padding-block: var(--space-xxl);
}

.band--canvas {
  background-color: var(--color-canvas);
  color: var(--color-body);
}

.band--soft {
  background-color: var(--color-surface-soft);
  color: var(--color-body);
}

.band--card {
  background-color: var(--color-surface-card);
  color: var(--color-body);
}

.band--dark {
  background-color: var(--color-surface-dark);
  color: var(--color-on-dark-soft);
}

/*
 * Every dark surface inverts its headings, not just the full-width band:
 * a dark-panel or a dark CTA sitting inside a chalk band needs the same
 * treatment, otherwise its titles keep the ink colour and disappear.
 */
.band--dark h1,
.band--dark h2,
.band--dark h3,
.band--dark h4,
.band--dark h5,
.band--dark .display-xl,
.band--dark .display-lg,
.band--dark .display-md,
.band--dark .display-sm,
.band--dark .title-lg,
.band--dark .title-md,
.band--dark .title-sm,
.dark-panel h1,
.dark-panel h2,
.dark-panel h3,
.dark-panel h4,
.dark-panel h5,
.dark-panel .display-xl,
.dark-panel .display-lg,
.dark-panel .display-md,
.dark-panel .display-sm,
.dark-panel .title-lg,
.dark-panel .title-md,
.dark-panel .title-sm,
.cta-band-dark h1,
.cta-band-dark h2,
.cta-band-dark h3,
.cta-band-dark .display-sm,
.cta-band-dark .display-md,
.cta-band-dark .title-lg,
.cta-band-dark .title-md,
.hero-illustration-card--dark h1,
.hero-illustration-card--dark h2,
.hero-illustration-card--dark h3,
.hero-illustration-card--dark .display-sm,
.hero-illustration-card--dark .title-lg,
.hero-illustration-card--dark .title-md,
.hero-illustration-card--dark .title-sm {
  color: var(--color-on-dark);
}

/*
 * Chalk lines — the system's single texture. A pitch-stripe wash at very low
 * alpha. Used at most once per page and never behind running text.
 */
.band--chalk-lines {
  background-image: repeating-linear-gradient(
    90deg,
    var(--color-chalk-line) 0 2px,
    transparent 2px 96px
  );
}

.band__header {
  margin-bottom: var(--space-xl);
  max-width: 60ch;
}

.band__header > * + * {
  margin-top: var(--space-md);
}

.stack > * + * {
  margin-top: var(--space-md);
}

.stack-lg > * + * {
  margin-top: var(--space-lg);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

/* ---- Grids ------------------------------------------------------------ */

/* Una fila di comandi dentro una cella di tabella: gli stessi spazi del
   `cluster`, stretti quanto basta a non far crescere la riga. */
.cluster--tight {
  gap: var(--space-xs);
  flex-wrap: nowrap;
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

/*
 * Grid items default to min-width:auto, so a wide child (a button row, a long
 * name) pushes the whole column past the viewport instead of wrapping. This is
 * what keeps the page from ever scrolling horizontally.
 */
.grid > *,
.team-grid > * {
  min-width: 0;
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

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

.hero-band {
  padding-block: var(--space-section);
}

.hero-band__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xxl);
  align-items: center;
}

.hero-band__copy > * + * {
  margin-top: var(--space-lg);
}

.hero-illustration-card {
  background-color: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-xl);
  padding: var(--space-xl);
}

.hero-illustration-card--dark {
  background-color: var(--color-surface-dark);
  border-color: var(--color-surface-dark);
  color: var(--color-on-dark-soft);
}

/* ====================================================================== */
/* Brand mark                                                              */
/* ====================================================================== */

/* Il marchio è un logo, non un titolo: grassetto, non il peso del display.
   È la sola eccezione alla regola "il display non va mai in bold", e vale
   perché "F.I.G.A." qui è una sigla accanto a un simbolo, non una frase. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  text-decoration: none;
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-weight: var(--wordmark-weight);
  font-size: var(--wordmark-size);
  letter-spacing: var(--wordmark-tracking);
}

/* The mark is the logo's two footballs, painted with `currentColor` through a
   CSS mask: one asset serves the chalk nav and the night footer alike. Without
   mask support the element must stay invisible — a bare `currentColor` block
   would render as a solid rectangle next to the wordmark. */
.brand__mark {
  width: 44px;
  height: 26px;
  flex: none;
}

@supports (mask-image: url("../img/figa-mark.994f1f041ddf.png")) or
          (-webkit-mask-image: url("../img/figa-mark.994f1f041ddf.png")) {
  .brand__mark {
    background-color: currentColor;
    -webkit-mask: url("../img/figa-mark.994f1f041ddf.png") center / contain no-repeat;
    mask: url("../img/figa-mark.994f1f041ddf.png") center / contain no-repeat;
  }
}

.brand__mark--lg {
  width: 88px;
  height: 52px;
}

/* The full lockup (footballs + wordmark + tagline). Used where the brand
   introduces itself — hero, auth card — never as a repeated ornament. */
.brand-lockup {
  display: block;
  width: auto;
  height: 200px;
  max-width: 100%;
}

.brand-lockup--sm {
  height: 132px;
  margin-inline: auto;
}

.band--dark .brand,
.footer .brand {
  color: var(--color-on-dark);
}

/* ====================================================================== */
/* Top navigation                                                          */
/* ====================================================================== */

.top-nav {
  background-color: var(--color-canvas);
  border-bottom: 1px solid var(--color-hairline-soft);
}

.top-nav__inner {
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.top-nav__menu {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1;
}

.top-nav__link {
  font-size: var(--nav-link-size);
  font-weight: var(--nav-link-weight);
  line-height: var(--nav-link-line);
  color: var(--color-ink);
  text-decoration: none;
}

.top-nav__link[aria-current="page"] {
  color: var(--color-primary);
}

.top-nav__link:active {
  color: var(--color-primary-active);
}

.top-nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.top-nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-md);
  width: var(--icon-button-size);
  height: var(--icon-button-size);
  align-items: center;
  justify-content: center;
  color: var(--color-ink);
  cursor: pointer;
}

/* ---- Account badge + dropdown ---------------------------------------
 * DESIGN.md reserves {rounded.xs} for "tiny dropdowns" and {rounded.sm} for
 * dropdown items; the badge itself is a pill, so that the name reads as a
 * control and not as one more nav link. Only the pressed state is styled,
 * per the system's "default and active/pressed only" rule.
 */

.account-menu {
  position: relative;
}

.account-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  height: var(--control-height);
  padding: 0 var(--space-sm) 0 var(--space-xxs);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-pill);
  background-color: var(--color-surface-soft);
  font-family: var(--font-sans);
  font-size: var(--nav-link-size);
  font-weight: var(--nav-link-weight);
  line-height: var(--nav-link-line);
  color: var(--color-ink);
  cursor: pointer;
  max-width: 220px;
}

.account-badge:active,
.account-menu.is-open .account-badge {
  background-color: var(--color-surface-card);
  border-color: var(--color-primary);
}

.account-badge__initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--rounded-full);
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  font-size: var(--caption-size);
  font-weight: var(--wordmark-weight);
  flex-shrink: 0;
}

.account-badge__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-badge__chevron {
  flex-shrink: 0;
  color: var(--color-muted);
}

.account-menu.is-open .account-badge__chevron {
  transform: rotate(180deg);
}

.account-menu__panel {
  position: absolute;
  top: calc(100% + var(--space-xs));
  right: 0;
  z-index: 20;
  min-width: 260px;
  padding: var(--space-sm);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-xs);
  background-color: var(--color-canvas);
  box-shadow: 0 12px 32px var(--color-shadow-soft);
}

.account-menu__identity {
  display: flex;
  flex-direction: column;
  gap: var(--space-xxs);
  margin: 0;
  padding: var(--space-xs) var(--space-sm) var(--space-sm);
  border-bottom: 1px solid var(--color-hairline-soft);
}

.account-menu__identity-name {
  font-size: var(--title-sm-size);
  font-weight: var(--title-weight);
  color: var(--color-ink);
}

.account-menu__identity-email {
  font-size: var(--caption-size);
  color: var(--color-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-menu__label {
  margin: var(--space-sm) 0 var(--space-xxs);
  padding: 0 var(--space-sm);
  font-size: var(--caption-uppercase-size);
  font-weight: var(--caption-weight);
  letter-spacing: var(--caption-uppercase-tracking);
  text-transform: uppercase;
  color: var(--color-muted);
}

.account-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.account-menu__item {
  display: block;
  width: 100%;
  padding: var(--space-xs) var(--space-sm);
  border: 0;
  border-radius: var(--rounded-sm);
  background: none;
  font-family: var(--font-sans);
  font-size: var(--body-sm-size);
  line-height: var(--body-line);
  text-align: left;
  text-decoration: none;
  color: var(--color-body-strong);
  cursor: pointer;
}

.account-menu__item:active,
.account-menu__item[aria-current="page"] {
  background-color: var(--color-surface-card);
  color: var(--color-primary-active);
}

.account-menu__item--danger {
  color: var(--color-error);
}

.account-menu__item--danger:active {
  color: var(--color-error-active);
}

.account-menu__logout {
  margin-top: var(--space-xs);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--color-hairline-soft);
}

/* ====================================================================== */
/* Buttons                                                                 */
/* ====================================================================== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  height: var(--control-height);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--rounded-md);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: var(--button-size);
  font-weight: var(--button-weight);
  line-height: var(--button-line);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.button--primary {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
}

.button--primary:active {
  background-color: var(--color-primary-active);
}

.button--primary:disabled,
.button--primary[aria-disabled="true"] {
  background-color: var(--color-primary-disabled);
  color: var(--color-muted);
  cursor: not-allowed;
}

.button--secondary {
  background-color: var(--color-canvas);
  color: var(--color-ink);
  border-color: var(--color-hairline);
}

.button--secondary-on-dark {
  background-color: var(--color-surface-dark-elevated);
  color: var(--color-on-dark);
  border-color: var(--color-surface-dark-elevated);
}

/* The destructive action. Red is the only place in this system where a button
   colour carries meaning rather than hierarchy, so it is spent sparingly: reset
   and delete, nothing else. */
.button--danger {
  background-color: var(--color-error);
  color: var(--color-on-primary);
  border-color: var(--color-error);
}

.button--danger:active {
  background-color: var(--color-error-active);
  border-color: var(--color-error-active);
}

/* The one command that opens the auction. Bigger because it is the only thing
   on the page that matters before it is pressed. */
.button--lg {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--body-md-size);
}

/* The inverted CTA used inside a full-bleed green callout. */
.button--on-accent {
  background-color: var(--color-canvas);
  color: var(--color-ink);
  border-color: var(--color-canvas);
}

.button--text {
  background: none;
  border-color: transparent;
  color: var(--color-ink);
  padding-inline: 0;
}

.button--icon {
  width: var(--icon-button-size);
  height: var(--icon-button-size);
  padding: 0;
  border-radius: var(--rounded-full);
  background-color: var(--color-canvas);
  border-color: var(--color-hairline);
  color: var(--color-ink);
}

/* ====================================================================== */
/* Cards                                                                   */
/* ====================================================================== */

.feature-card {
  background-color: var(--color-surface-card);
  color: var(--color-body);
  border-radius: var(--rounded-lg);
  padding: var(--space-xl);
}

.feature-card > * + * {
  margin-top: var(--space-sm);
}

.outlined-card {
  background-color: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-lg);
  padding: var(--space-xl);
}

.outlined-card > * + * {
  margin-top: var(--space-sm);
}

.dark-panel {
  background-color: var(--color-surface-dark);
  color: var(--color-on-dark-soft);
  border-radius: var(--rounded-lg);
  padding: var(--space-xl);
}

.dark-panel--featured {
  color: var(--color-on-dark);
}

.tile {
  background-color: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-lg);
  padding: var(--space-lg);
}

.callout-card-accent {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: var(--rounded-lg);
  padding: var(--space-xxl);
}

.callout-card-accent h2,
.callout-card-accent h3,
.callout-card-accent .display-sm,
.callout-card-accent .display-md {
  color: var(--color-on-primary);
}

.callout-card-accent > * + * {
  margin-top: var(--space-md);
}

.cta-band-accent,
.cta-band-dark {
  border-radius: var(--rounded-lg);
  padding: var(--space-section) var(--space-xxl);
  text-align: center;
}

.cta-band-accent {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
}

.cta-band-accent .display-sm,
.cta-band-accent h2 {
  color: var(--color-on-primary);
}

.cta-band-dark {
  background-color: var(--color-surface-dark);
  color: var(--color-on-dark-soft);
}

.cta-band-accent > * + *,
.cta-band-dark > * + * {
  margin-top: var(--space-md);
}

/* ====================================================================== */
/* Badges, chips                                                           */
/* ====================================================================== */

.badge-pill {
  display: inline-flex;
  align-items: center;
  background-color: var(--color-surface-card);
  color: var(--color-ink);
  font-size: var(--caption-size);
  font-weight: var(--caption-weight);
  line-height: var(--caption-line);
  border-radius: var(--rounded-pill);
  padding: var(--space-xxs) var(--space-sm);
}

.badge-accent {
  display: inline-flex;
  align-items: center;
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  font-size: var(--caption-uppercase-size);
  font-weight: var(--caption-weight);
  line-height: var(--caption-line);
  letter-spacing: var(--caption-uppercase-tracking);
  text-transform: uppercase;
  border-radius: var(--rounded-pill);
  padding: var(--space-xxs) var(--space-sm);
}

/* muted on amber is 2.2:1 — the years use body-strong (6.9:1) instead. */
.trophy-badge__years {
  color: var(--color-body-strong);
}

.trophy-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xxs);
  background-color: var(--color-accent-amber);
  color: var(--color-ink);
  font-size: var(--caption-size);
  font-weight: var(--caption-weight);
  line-height: var(--caption-line);
  border-radius: var(--rounded-pill);
  padding: var(--space-xxs) var(--space-sm);
}

/* Role is carried by the letter, never by colour — see DESIGN.md Don'ts. */
.role-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  background-color: var(--color-surface-chalk-strong);
  color: var(--color-ink);
  font-size: var(--caption-uppercase-size);
  font-weight: var(--caption-weight);
  line-height: var(--caption-line);
  letter-spacing: var(--caption-uppercase-tracking);
  text-transform: uppercase;
  border-radius: var(--rounded-xs);
  padding: 2px var(--space-xxs);
}

.band--dark .role-chip {
  background-color: var(--color-surface-dark-elevated);
  color: var(--color-on-dark);
}

/* Form dots: W / D / L markers borrowed from the referee's pocket. */
.form-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--rounded-full);
  font-size: var(--caption-uppercase-size);
  font-weight: var(--caption-weight);
  color: var(--color-ink);
}

.form-dot--win {
  background-color: var(--color-success-surface);
}

.form-dot--draw {
  background-color: var(--color-warning-surface);
}

.form-dot--loss {
  background-color: var(--color-error-surface);
}

/* ====================================================================== */
/* Category tabs                                                           */
/* ====================================================================== */

.category-tab {
  display: inline-flex;
  align-items: center;
  background-color: transparent;
  color: var(--color-muted);
  border: 0;
  border-radius: var(--rounded-md);
  padding: var(--space-xs) 14px;
  font-size: var(--nav-link-size);
  font-weight: var(--nav-link-weight);
  text-decoration: none;
  cursor: pointer;
}

.category-tab[aria-selected="true"],
.category-tab--active {
  background-color: var(--color-surface-card);
  color: var(--color-ink);
}

/* ====================================================================== */
/* Team card & crest                                                       */
/* ====================================================================== */

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.team-card {
  background-color: var(--color-surface-card);
  border-radius: var(--rounded-lg);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--color-body);
}

.team-card__name {
  font-family: var(--font-sans);
  font-size: var(--title-md-size);
  font-weight: var(--title-weight);
  line-height: var(--title-line);
  color: var(--color-ink);
}

.team-card__president {
  font-size: var(--body-sm-size);
  color: var(--color-muted);
}

.team-crest {
  width: var(--crest-size);
  height: var(--crest-size);
  border-radius: var(--rounded-full);
  background-color: var(--color-canvas);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  overflow: hidden;
}

.team-crest--inline {
  width: var(--crest-size-inline);
  height: var(--crest-size-inline);
}

/* Fallback when a team has no logo: its initials on strong chalk. */
.team-crest--initials {
  background-color: var(--color-surface-chalk-strong);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--title-lg-size);
  font-weight: var(--title-weight);
  letter-spacing: 0;
}

.team-crest--inline.team-crest--initials {
  font-size: var(--body-sm-size);
}

/* ====================================================================== */
/* Standings table                                                         */
/* ====================================================================== */

.table-scroll {
  overflow-x: auto;
  border-radius: var(--rounded-lg);
}

.standings-table {
  background-color: var(--color-canvas);
  border-radius: var(--rounded-lg);
  font-size: var(--body-sm-size);
  min-width: 640px;
}

.standings-table th,
.standings-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-hairline-soft);
  text-align: right;
}

.standings-table thead th {
  font-size: var(--caption-uppercase-size);
  font-weight: var(--caption-weight);
  letter-spacing: var(--caption-uppercase-tracking);
  text-transform: uppercase;
  color: var(--color-muted);
  border-bottom-color: var(--color-hairline);
}

.standings-table tbody tr:last-child td {
  border-bottom: 0;
}

.standings-table .col-rank {
  width: 48px;
  text-align: right;
  font-family: var(--font-mono);
  color: var(--color-muted);
}

.standings-table .col-team {
  text-align: left;
  font-size: var(--body-md-size);
  color: var(--color-ink);
}

.standings-table .col-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.standings-table .col-points {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--color-ink);
  font-weight: var(--title-weight);
}

.standings-table__team {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: inherit;
}

.standings-table tr.is-highlighted {
  background-color: var(--color-surface-soft);
}

.standings-table tr.is-highlighted .col-team {
  color: var(--color-ink);
}

/* The same table on a night band. */
.band--dark .standings-table,
.dark-panel .standings-table {
  background-color: var(--color-surface-dark-soft);
  color: var(--color-on-dark-soft);
}

.band--dark .standings-table th,
.band--dark .standings-table td,
.dark-panel .standings-table th,
.dark-panel .standings-table td {
  border-bottom-color: var(--color-on-dark-hairline);
}

.band--dark .standings-table .col-team,
.band--dark .standings-table .col-points,
.dark-panel .standings-table .col-team,
.dark-panel .standings-table .col-points {
  color: var(--color-on-dark);
}

.band--dark .standings-table tr.is-highlighted,
.dark-panel .standings-table tr.is-highlighted {
  background-color: var(--color-surface-dark-elevated);
}

/* The light-band highlight rule sets the team name to ink; on a night band
   that would be invisible, so it is restored to on-dark here. */
.band--dark .standings-table tr.is-highlighted .col-team,
.dark-panel .standings-table tr.is-highlighted .col-team {
  color: var(--color-on-dark);
}

/* ====================================================================== */
/* Roster                                                                  */
/* ====================================================================== */

.roster {
  list-style: none;
  margin: 0;
  padding: 0;
}

.roster__group + .roster__group {
  margin-top: var(--space-lg);
}

.roster__group-title {
  font-size: var(--caption-uppercase-size);
  font-weight: var(--caption-weight);
  letter-spacing: var(--caption-uppercase-tracking);
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-xs);
}

.roster-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-hairline-soft);
  font-size: var(--body-sm-size);
}

.roster-row:last-child {
  border-bottom: 0;
}

.roster-row__name {
  color: var(--color-ink);
  flex: 1;
  min-width: 0;
}

.roster-row__club {
  color: var(--color-muted);
}

.roster-row__price {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--color-body);
}

/* ====================================================================== */
/* Forms                                                                   */
/* ====================================================================== */

.form-field + .form-field {
  margin-top: var(--space-lg);
}

.form-field__label {
  display: block;
  font-size: var(--caption-size);
  font-weight: var(--caption-weight);
  line-height: var(--caption-line);
  color: var(--color-muted);
  margin-bottom: var(--space-xs);
}

.form-field__help {
  font-size: var(--body-sm-size);
  color: var(--color-muted);
  margin-top: var(--space-xs);
}

.form-field__error {
  font-size: var(--body-sm-size);
  color: var(--color-error);
  margin-top: var(--space-xs);
}

.text-input,
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="number"],
.form-field input[type="url"],
.form-field select,
.form-field textarea {
  width: 100%;
  background-color: var(--color-canvas);
  color: var(--color-ink);
  font-size: var(--body-md-size);
  line-height: var(--body-line);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-md);
  padding: 10px 14px;
}

.text-input,
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="number"],
.form-field input[type="url"],
.form-field select {
  height: var(--control-height);
}

.form-field textarea {
  min-height: calc(var(--control-height) * 3);
  resize: vertical;
}

.text-input:focus,
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}

.form-field.has-error .text-input,
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
  border-color: var(--color-error);
}

/* ====================================================================== */
/* Auth card & forms                                                       */
/* ====================================================================== */

/*
 * A form that *is* the page — login, password reset, accepting an invitation.
 * Narrower than a content card on purpose: a login form the width of an
 * article is harder to read, not easier.
 */
.auth-card {
  background-color: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-lg);
  padding: var(--space-xl);
  max-width: var(--auth-card-max);
  margin-inline: auto;
}

.auth-card > * + * {
  margin-top: var(--space-md);
}

/* A form inside a page that has other content: wider, not centred. */
.form-block {
  max-width: var(--form-max);
}

.form-block > * + * {
  margin-top: var(--space-md);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* Errors that belong to the form as a whole rather than to one field. */
.form-errors {
  border-radius: var(--rounded-md);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-error-surface);
  color: var(--color-ink);
  font-size: var(--body-sm-size);
}

/* A checkbox reads as one line: control, then label. */
.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  font-size: var(--body-sm-size);
}

.checkbox-field input {
  width: auto;
  margin-top: 3px;
}

/* Un elenco di caselle che sono alternative fra loro: colonne strette, così
   venti nomi di squadra stanno in una schermata invece che in una colonna
   lunga il doppio del form. */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-xxs) var(--space-md);
}

/* ====================================================================== */
/* Data table                                                              */
/* ====================================================================== */

/*
 * The management-screen table. Same bones as the standings table, but
 * left-aligned: these columns are names and addresses, not figures.
 */
.data-table {
  background-color: var(--color-canvas);
  border-radius: var(--rounded-lg);
  font-size: var(--body-sm-size);
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-hairline-soft);
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  font-size: var(--caption-uppercase-size);
  font-weight: var(--caption-weight);
  letter-spacing: var(--caption-uppercase-tracking);
  text-transform: uppercase;
  color: var(--color-muted);
  border-bottom-color: var(--color-hairline);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .col-primary {
  color: var(--color-ink);
  font-size: var(--body-md-size);
}

.data-table .col-actions {
  text-align: right;
  white-space: nowrap;
}

/*
 * Le azioni di una riga stanno sulla stessa riga e vanno separate: due link
 * adiacenti nel markup si toccherebbero, e un form è di suo un blocco che
 * andrebbe a capo. Inline + margine invece di flex, perché `display: flex`
 * su una cella la fa uscire dal box della tabella.
 */
.data-table .col-actions form {
  display: inline;
}

.data-table .col-actions > * + * {
  margin-left: var(--space-sm);
}

/*
 * Un controllo dentro una tabella — il selettore di ruolo della gestione
 * partecipanti. Stessa pelle degli input del sistema, ma compatta: la riga
 * non deve crescere in altezza per contenerlo.
 */
.data-table select {
  background-color: var(--color-canvas);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--body-sm-size);
  line-height: var(--body-line);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-sm);
  padding: var(--space-xxs) var(--space-xs);
}

.data-table select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}

/*
 * La variante compatta: un calendario è una lista lunga di righe corte, e il
 * padding pensato per una tabella di dieci righe la trasforma in tre schermate.
 * Cambia solo la densità — colori, bordi e tipografia restano quelli.
 */
.data-table--compact th,
.data-table--compact td {
  padding: var(--space-xxs) var(--space-sm);
  vertical-align: middle;
}

.data-table--compact {
  min-width: 640px;
}

/*
 * Le colonne numeriche di una tabella dati: stessa regola della classifica,
 * cifre incolonnate e allineate a destra.
 */
.data-table .col-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.data-table .col-score {
  color: var(--color-ink);
  font-weight: var(--title-weight);
}

.data-table--compact .col-primary {
  font-size: var(--body-sm-size);
}

/*
 * La classifica può avere una colonna azioni quando è quella importata e la
 * sta guardando chi può correggerla. Stesse regole della tabella dati: il
 * form resta in linea, i controlli non si toccano.
 */
.standings-table .col-actions {
  text-align: right;
  white-space: nowrap;
}

.standings-table .col-actions form {
  display: inline;
}

.standings-table .col-actions > * + * {
  margin-left: var(--space-sm);
}

/* ====================================================================== */
/* Honours row                                                             */
/* ====================================================================== */

/*
 * One line of the albo d'oro. The year sits in its own fixed column so a list
 * of seasons reads down the page as a column rather than as ragged prose.
 */
.honours-list > * + * {
  border-top: 1px solid var(--color-hairline-soft);
}

.honours-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-sm);
  padding-block: var(--space-xs);
  font-size: var(--body-sm-size);
  color: var(--color-body);
}

.honours-row__year {
  flex: 0 0 auto;
  min-width: 76px;
  font-size: var(--caption-size);
  color: var(--color-muted);
}

.honours-row__team {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
  color: var(--color-ink);
}

.honours-row__note {
  flex: 1 1 100%;
  font-size: var(--caption-size);
}

/* ====================================================================== */
/* Match row                                                               */
/* ====================================================================== */

/*
 * A fixture: two teams either side of a centred score. The 1fr auto 1fr grid
 * is what keeps every score in a list on the same vertical line however long
 * the club names are, and `min-width: 0` on the sides is what lets a long name
 * ellipsize instead of pushing the score off-centre.
 */
.match-list > * + * {
  border-top: 1px solid var(--color-hairline-soft);
}

.match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-sm);
  padding-block: var(--space-sm);
  font-size: var(--body-sm-size);
  line-height: var(--body-line);
  color: var(--color-body);
}

.match-row__day {
  grid-column: 1 / -1;
  font-size: var(--caption-uppercase-size);
  color: var(--color-muted);
}

.match-row__side {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}

.match-row__side--away {
  justify-content: flex-end;
  text-align: right;
}

.match-row__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The team whose page this is, set apart by colour weight, never by a fill. */
.match-row__side.is-viewed .match-row__name {
  color: var(--color-ink);
}

.match-row__score {
  background-color: var(--color-surface-soft);
  color: var(--color-ink);
  font-family: var(--font-mono);
  font-size: var(--code-size);
  line-height: var(--code-line);
  border-radius: var(--rounded-sm);
  padding: 2px 10px;
  white-space: nowrap;
}

/* On night surfaces the row keeps its shape and swaps only its tones. */
.band--dark .match-list > * + *,
.dark-panel .match-list > * + * {
  border-top-color: var(--color-on-dark-hairline);
}

.band--dark .match-row,
.dark-panel .match-row {
  color: var(--color-on-dark-soft);
}

.band--dark .match-row__day,
.dark-panel .match-row__day {
  color: var(--color-on-dark-soft);
}

.band--dark .match-row__side.is-viewed .match-row__name,
.dark-panel .match-row__side.is-viewed .match-row__name {
  color: var(--color-on-dark);
}

.band--dark .match-row__score,
.dark-panel .match-row__score {
  background-color: var(--color-surface-dark-elevated);
  color: var(--color-on-dark);
}

/* ====================================================================== */
/* Forum: thread row, post, attachments                                    */
/* ====================================================================== */

/*
 * The thread list. A row is title + excerpt on the left and the reply count on
 * the right; the count sits in mono so a column of numbers reads as a column,
 * the same reasoning as the standings figures.
 */
.thread-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.thread-list > * + * {
  border-top: 1px solid var(--color-hairline);
}

.thread-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding-block: var(--space-md);
}

.thread-row__main {
  flex: 1 1 auto;
  min-width: 0;
}

.thread-row__title {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--font-weight-display);
  font-size: var(--title-md-size);
  line-height: var(--title-line);
  letter-spacing: -0.3px;
  color: var(--color-ink);
  text-decoration: none;
}

.thread-row__excerpt {
  margin: var(--space-xxs) 0 0;
  font-size: var(--body-sm-size);
  line-height: var(--body-line);
  color: var(--color-body);
}

.thread-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin: var(--space-xs) 0 0;
  font-size: var(--caption-size);
  color: var(--color-muted);
}

/*
 * A pinned thread is marked by a green rule on its leading edge, not by a
 * tinted background: a fill would be a fourth surface tone, and DESIGN.md
 * allows three.
 */
.thread-row--pinned {
  border-inline-start: 2px solid var(--color-primary);
  padding-inline-start: var(--space-md);
}

.thread-row__count {
  flex: 0 0 auto;
  min-width: 44px;
  text-align: right;
  font-size: var(--code-size);
  line-height: var(--code-line);
  color: var(--color-muted);
}

/*
 * One message. The opening post of a thread is the same component on a card
 * surface — a discussion has one message that started it, and the surface is
 * how that reads without a second layout.
 */
.forum-thread > * + * {
  margin-top: var(--space-md);
}

.forum-post {
  background-color: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-lg);
  padding: var(--space-lg);
  color: var(--color-body);
}

.forum-post--opening {
  background-color: var(--color-surface-card);
  border-color: transparent;
  padding: var(--space-xl);
}

.forum-post__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-xs);
  font-size: var(--caption-size);
  color: var(--color-muted);
}

.forum-post__author {
  color: var(--color-ink);
  font-size: var(--body-sm-size);
}

.forum-post__edited {
  font-style: italic;
}

.forum-post__body {
  margin-top: var(--space-sm);
  font-size: var(--body-md-size);
  line-height: var(--body-line);
  color: var(--color-body);
  /* A pasted URL must not push the card wider than the page. */
  overflow-wrap: anywhere;
}

.forum-post__body p + p {
  margin-top: var(--space-sm);
}

.forum-post__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--color-hairline-soft);
}

/*
 * Attachments. `auto-fill` with a minimum keeps one image from stretching
 * across the whole card, and the fixed aspect ratio keeps a column of posts
 * from jumping as portrait and landscape photos alternate.
 */
.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-sm);
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: 0;
}

.attachment-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background-color: var(--color-surface-soft);
  border-radius: var(--rounded-md);
}

.attachment-thumb__caption {
  display: block;
  margin-top: var(--space-xxs);
  font-size: var(--caption-size);
  color: var(--color-muted);
}

/* ====================================================================== */
/* Messages, empty state, pagination                                       */
/* ====================================================================== */

.messages {
  list-style: none;
  margin: 0;
  padding: var(--space-md) 0 0;
}

.message {
  border-radius: var(--rounded-md);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--body-sm-size);
  color: var(--color-ink);
  background-color: var(--color-surface-card);
}

.message + .message {
  margin-top: var(--space-xs);
}

.message--success {
  background-color: var(--color-success-surface);
}

.message--warning {
  background-color: var(--color-warning-surface);
}

.message--error {
  background-color: var(--color-error-surface);
}

.empty-state {
  background-color: var(--color-surface-soft);
  color: var(--color-muted);
  border-radius: var(--rounded-lg);
  padding: var(--space-xl);
  font-size: var(--body-md-size);
}

.band--dark .empty-state {
  background-color: var(--color-surface-dark-elevated);
  color: var(--color-on-dark-soft);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--body-sm-size);
  list-style: none;
  margin: var(--space-xl) 0 0;
  padding: 0;
}

.pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--icon-button-size);
  height: var(--icon-button-size);
  padding-inline: var(--space-xs);
  border-radius: var(--rounded-md);
  text-decoration: none;
  color: var(--color-primary);
}

.pagination__page[aria-current="page"] {
  background-color: var(--color-surface-card);
  color: var(--color-ink);
}

/* ====================================================================== */
/* Footer                                                                  */
/* ====================================================================== */

.footer {
  background-color: var(--color-surface-dark);
  color: var(--color-on-dark-soft);
  padding-block: var(--space-section);
  font-size: var(--body-sm-size);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-xl);
}

.footer__heading {
  font-size: var(--caption-uppercase-size);
  font-weight: var(--caption-weight);
  letter-spacing: var(--caption-uppercase-tracking);
  text-transform: uppercase;
  color: var(--color-on-dark);
  margin-bottom: var(--space-sm);
}

.footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__list li + li {
  margin-top: var(--space-xs);
}

.footer__link {
  color: var(--color-on-dark-soft);
  text-decoration: none;
}

.footer__link:active {
  color: var(--color-on-dark);
}

.footer__bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-on-dark-hairline);
  color: var(--color-on-dark-soft);
}

/* ====================================================================== */
/* Responsive — breakpoints per DESIGN.md "Responsive Behavior"            */
/* ====================================================================== */

/* Tablet: 768–1024px */
@media (max-width: 1024px) {
  .grid--4 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid--3,
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .top-nav__menu {
    gap: var(--space-md);
  }

  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: < 768px */
@media (max-width: 767px) {
  .band,
  .hero-band,
  .footer {
    padding-block: var(--space-xxl);
  }

  .display-xl,
  h1 {
    font-size: var(--display-sm-size);
    letter-spacing: var(--display-sm-tracking);
  }

  .display-lg,
  h2 {
    font-size: var(--display-md-size);
    letter-spacing: var(--display-md-tracking);
  }

  .hero-band__inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .brand-lockup {
    height: 148px;
  }

  .grid--2,
  .grid--3,
  .grid--4,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .footer__grid {
    grid-template-columns: 1fr;
  }

  /*
   * Under 768px two club names plus two crests plus a score do not fit on one
   * line. The crests go, not the names: the name is the information.
   */
  .match-row .team-crest {
    display: none;
  }
  .cta-band-accent,
  .cta-band-dark {
    padding: var(--space-xxl) var(--space-lg);
  }

  .callout-card-accent {
    padding: var(--space-xl);
  }

  /* Nav collapses to a toggle; the menu opens as a full-width chalk sheet. */
  .top-nav__toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .top-nav__inner {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  /*
   * `flex: 1` from the desktop rule sets flex-basis to 0, which beats a plain
   * width:100% — the menu would keep sitting next to the wordmark instead of
   * dropping onto its own row. The basis has to be overridden explicitly.
   */
  .top-nav__menu,
  .top-nav__actions {
    display: none;
    flex: 1 0 100%;
  }

  .top-nav.is-open .top-nav__menu,
  .top-nav.is-open .top-nav__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .top-nav.is-open .top-nav__actions {
    padding-bottom: var(--space-lg);
  }

  .top-nav__actions {
    order: 3;
  }

  /*
   * Inside the chalk sheet the dropdown stops being a dropdown: it is already
   * a full-width panel on its own row, so it lays itself out in the flow and
   * stays open. `[hidden]` is overridden deliberately — the JS toggle governs
   * the desktop popover, not this.
   */
  .account-menu {
    width: 100%;
  }

  .account-badge {
    display: none;
  }

  .account-menu__panel[hidden],
  .account-menu__panel {
    display: block;
    position: static;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
