/* ============================================================
   CSS Custom Properties (defaults; overridden per-league via base.html <style>)
   ============================================================ */
:root {
  --upl-dark:       #14213d;
  --upl-teal:       #0d7377;
  --upl-accent:     #fca311;
  --upl-transition: 0.18s ease;
}

/* ============================================================
   Typography — Oswald (headings) + Inter (body)
   ============================================================ */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

h1, h2, h3,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.01em;
}

/* ============================================================
   Brand utilities
   ============================================================ */
.bg-upl   { background-color: var(--upl-dark) !important; }
.text-upl { color: var(--upl-teal) !important; }

.btn-upl {
  background-color: var(--upl-teal);
  color: #fff;
  border-color: var(--upl-teal);
  transition: background-color var(--upl-transition), box-shadow var(--upl-transition);
}
.btn-upl:hover, .btn-upl:focus-visible {
  background-color: #0a5c5f;
  border-color: #0a5c5f;
  color: #fff;
  box-shadow: 0 4px 12px rgba(13, 115, 119, 0.35);
}

.btn-outline-upl {
  color: var(--upl-teal);
  border-color: var(--upl-teal);
  transition: all var(--upl-transition);
}
.btn-outline-upl:hover, .btn-outline-upl:focus-visible {
  background-color: var(--upl-teal);
  color: #fff;
}

/* ============================================================
   Navbar
   ============================================================ */
.navbar-brand { letter-spacing: 0.02em; }

/* Active nav link — accent underline */
.navbar-nav .nav-link.active {
  color: #fff !important;
  font-weight: 600;
  position: relative;
}
.navbar-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0.5rem;
  right: 0.5rem;
  height: 2px;
  background: var(--upl-accent);
  border-radius: 1px;
}

/* ============================================================
   Focus accessibility
   ============================================================ */
:focus-visible {
  outline: 3px solid var(--upl-accent);
  outline-offset: 2px;
  border-radius: 3px;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(252, 163, 17, 0.45);
}

/* ============================================================
   Cards — hover lift
   ============================================================ */
.card {
  transition: transform var(--upl-transition), box-shadow var(--upl-transition);
}
.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.09) !important;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13) !important;
}

/* ============================================================
   Hero section (full-width, outside .container)
   ============================================================ */
.hero-section {
  position: relative;
  overflow: hidden;
}

/* Text colours on a dark hero background */
.hero-dark-bg,
.hero-dark-bg h1,
.hero-dark-bg h2,
.hero-dark-bg h3,
.hero-dark-bg .lead { color: #fff !important; }
.hero-dark-bg .text-muted { color: rgba(255, 255, 255, 0.72) !important; }

/* Frosted-glass logo container */
.hero-logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1.25rem;
  padding: 2rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin: 0 auto;
  overflow: hidden;
}
.hero-logo-img {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.35));
}

/* Hero image focus picker (templates/forms/hero_focus.html) */
.hero-focus-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  cursor: crosshair;
  line-height: 0;
}
.hero-focus-img { max-width: 100%; max-height: 260px; border-radius: .375rem; user-select: none; }
.hero-focus-marker {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
  pointer-events: none;
}
.hero-focus-preview {
  width: 100%;
  border-radius: .375rem;
  background-color: var(--upl-dark);
  background-size: cover;
  border: 1px solid rgba(0, 0, 0, .1);
}

/* Tournament event page hero: the banner image (set inline) or a navy-to-teal gradient */
.event-hero {
  background: linear-gradient(120deg, var(--upl-dark) 0%, #1d3557 45%, var(--upl-teal) 100%);
  background-size: cover;
  background-position: center;
}
.event-hero-inner { padding-top: 2.5rem; padding-bottom: 2rem; }
.event-hero-inner .min-w-0 { min-width: 0; }
.event-hero-logo {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .45));
}
.event-hero-title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; line-height: 1.1; }
.event-hero-tagline { font-size: 1.05rem; opacity: .9; }
.event-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0 .4rem .4rem 0;
  padding: .2rem .7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
  font-size: .85rem;
}
.event-side-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6c757d;
  margin-bottom: .35rem;
}
.event-side-card p:last-child { margin-bottom: 0; }
@media (max-width: 575.98px) {
  .event-hero-logo { width: 52px; height: 52px; }
  .event-hero-inner { padding-top: 1.5rem; padding-bottom: 1.25rem; }
}

/* ============================================================
   Event date tiles
   ============================================================ */
.event-date-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  width: 52px;
  height: 60px;
  background: var(--upl-teal);
  color: #fff;
  border-radius: 0.5rem;
  text-align: center;
  flex-shrink: 0;
}
.event-date-month {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
  padding-top: 6px;
}
.event-date-day {
  font-family: 'Oswald', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  padding-bottom: 4px;
}

/* ============================================================
   HTMX top-of-page progress bar
   ============================================================ */
#htmx-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--upl-accent);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
  transition: opacity 0.15s ease, width 0.35s ease;
}
#htmx-progress.htmx-active {
  opacity: 1;
  width: 75%;
}
#htmx-progress.htmx-done {
  width: 100%;
  opacity: 0;
  transition: width 0.15s ease, opacity 0.3s ease 0.1s;
}

/* ============================================================
   Empty states
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
}
.empty-state .empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.45;
}
.empty-state h5 {
  font-family: 'Oswald', sans-serif;
  color: #495057;
  margin-bottom: 0.5rem;
}

/* Tournament bracket tree view */
.bracket-tree-scroll {
  overflow-x: auto;
}
.bracket-tree {
  display: grid;
  grid-auto-flow: column;
  gap: 0.5rem 2rem;
  align-items: start;
  position: relative;
}
.bracket-tree-lines {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}
.bracket-tree-line {
  fill: none;
  stroke: var(--upl-teal, #0d7377);
  stroke-width: 2px;
}
.bracket-tree-col {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: 1 / -1;
}
.bracket-tree-match {
  border: 1px solid var(--upl-teal, #0d7377);
  border-radius: 0.25rem;
  background: #fff;
  min-width: 180px;
  align-self: center;
}
.bracket-tree-entry {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}
.bracket-tree-entry:last-child {
  border-bottom: none;
}

/* Always present, so every box carries its match number; the table
   number joins it on the right once one is assigned. */
.bracket-tree-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  background: var(--upl-dark, #14213d);
  color: #fff;
}
/* "Winner of Match 12" is a pending slot, not a competitor — keep it
   visually subordinate to a real entrant's name. */
.bracket-tree-placeholder {
  font-style: italic;
  color: #6c757d;
}

/* ============================================================
   Table Assignments — matchup rows & venue grouping
   ============================================================ */
.ta-matchup-table {
  table-layout: fixed;
}
.ta-matchup-col {
  width: 360px;
}
.ta-matchup-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ta-game-slot {
  flex: 0 0 230px;
  min-width: 0;
}
.ta-game-info {
  min-width: 0;
}
.ta-scorekeeper {
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 767.98px) {
  /* Below md: the fixed-width column layout that keeps table
     assignments aligned across desktop venue cards just forces
     horizontal scrolling — collapse each row into a stacked block
     instead, letting matchup names and scorekeepers wrap normally. */
  .ta-matchup-table,
  .ta-matchup-table tbody,
  .ta-matchup-table tr,
  .ta-matchup-table td {
    display: block;
    width: auto !important;
  }
  .ta-matchup-table thead {
    display: none;
  }
  .ta-matchup-table tbody tr {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #eee;
  }
  .ta-matchup-table tbody tr:last-child {
    border-bottom: none;
  }
  .ta-matchup-table td {
    padding: 0.15rem 0;
    border: none;
  }
  .ta-matchup-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    margin-bottom: 0.4rem;
  }
  .ta-game-slot {
    flex: 1 1 140px;
  }
  .ta-scorekeeper {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* ============================================================
   Operator dashboard primitives
   ============================================================ */
.upl-zone-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #4d5769;
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
}
.upl-zone-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d7dce5;
}

.upl-num {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.upl-lbl { font-size: .72rem; color: #8c95a6; line-height: 1.3; }
.upl-tnum { font-variant-numeric: tabular-nums; }

.upl-meter {
  height: 6px;
  border-radius: 999px;
  background: #d7dce5;
  overflow: hidden;
  display: flex;
  width: 100%;
}
.upl-meter-thin { height: 5px; }
.upl-meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--upl-teal);
}
.upl-meter i.warn { background: #a8600a; }
.upl-meter i.crit { background: #b42318; }

.upl-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .7rem;
  font-weight: 600;
  border-radius: 999px;
  padding: .125rem .5rem .125rem .375rem;
  white-space: nowrap;
}
.upl-chip-ok      { background: #e3f4ea; color: #1a7f4b; }
.upl-chip-warn    { background: #fdf0dc; color: #a8600a; }
.upl-chip-crit    { background: #fdeceb; color: #b42318; }
.upl-chip-neutral { background: #f4f6f9; color: #5a6478; border: 1px solid #e4e7ec; }
.upl-chip-teal    { background: #e2f0f0; color: var(--upl-teal); }

/* Attention cards carry a severity stripe on their leading edge. */
.upl-attention-card { border-left: 3px solid #e4e7ec; }
.upl-attention-card.crit { border-left-color: #b42318; }
.upl-attention-card.warn { border-left-color: #a8600a; }
.upl-attention-card.info { border-left-color: var(--upl-teal); }

.upl-attention-icon {
  width: 2rem;
  height: 2rem;
  border-radius: .5rem;
  display: grid;
  place-items: center;
  flex: none;
}
.upl-attention-icon.crit { background: #fdeceb; color: #b42318; }
.upl-attention-icon.warn { background: #fdf0dc; color: #a8600a; }
.upl-attention-icon.info { background: #e2f0f0; color: var(--upl-teal); }

/* ============================================================
   Operator dashboard — surface & emphasis
   Scoped to .upl-operator-surface so public pages are untouched.
   ============================================================ */

/* A sunken ground so the white cards read as raised objects. Bleeds past
   the content column's padding so the tint reaches the viewport edges. */
body.upl-operator-page { background: #f1f3f7; }

/* .upl-operator-surface is now purely a scoping hook for the rules below --
   the ground itself is painted on the body so the gutters either side of
   the content column match rather than staying white. */
.upl-operator-surface { padding-bottom: 1.5rem; }

/* Cards sit on the tint, so they need a hairline as well as a shadow —
   shadow alone disappears against a mid-tone ground. */
.upl-operator-surface .card {
  border: 1px solid #e6e9ef;
}

/* Severity stripe. Bootstrap's .border-0 is `border: 0 !important`, which
   beats any plain border-left declaration — so these cards must NOT carry
   .border-0, and the stripe is set here with the base border zeroed. */
.upl-attention-card {
  border: 0;
  border-left: 3px solid #e4e7ec;
}
.upl-operator-surface .upl-attention-card {
  border: 1px solid #e6e9ef;
  border-left-width: 3px;
}
.upl-attention-card.crit { border-left-color: #b42318; }
.upl-attention-card.warn { border-left-color: #a8600a; }
.upl-attention-card.info { border-left-color: var(--upl-teal); }

/* A critical division reads as critical at row level, not just in its chip. */
.upl-row-crit { background: #fdf4f3; }
.upl-row-crit td { background: transparent; }
.upl-row-crit td:first-child { box-shadow: inset 3px 0 0 #b42318; }
/* The rail needs more contrast against the tinted row than against white. */
.upl-row-crit .upl-meter { background: #e8d6d4; }

/* Tonight's match column, tinted with the league's own accent. */
/* Fallback first: a browser without color-mix() gets the fixed teal wash,
   not `var(--upl-teal)` at full strength, which would paint a solid block. */
.upl-today { background: rgba(13, 115, 119, .07); }
@supports (background: color-mix(in srgb, red 50%, white)) {
  .upl-today { background: color-mix(in srgb, var(--upl-teal) 8%, #fff); }
}
.upl-today .upl-lbl { color: var(--upl-teal); font-weight: 600; }

/* Table chrome: quieter header, roomier rows than Bootstrap's default. */
.upl-operator-surface .table > thead th {
  border-bottom: 1px solid #e4e7ec;
  font-weight: 600;
  padding-top: .6rem;
  padding-bottom: .6rem;
}
.upl-operator-surface .table > tbody td { padding-top: .7rem; padding-bottom: .7rem; }
.upl-operator-surface .table > :not(:first-child) { border-top: 0; }

/* Card headers: quieter and tighter than Bootstrap's default, so the band
   labels stay the loudest text on the page. */
.upl-operator-surface .card-header {
  padding: .6rem .9rem;
  font-size: .82rem;
  border-bottom-color: #eef1f5;
}
.upl-operator-surface .card-body { padding: .9rem; }
.upl-operator-surface .upl-zone-label { margin-top: .25rem; }

/* ============================================================
   Contact support widget (operators only; templates/support/partials/widget.html)
   ============================================================ */
#support-widget {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .5rem;
}
.support-toggle {
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: var(--upl-teal);
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.support-toggle:hover { filter: brightness(1.1); }
.support-panel {
  order: -1;
  width: 340px;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
}
.support-panel[hidden] { display: none; }

/* Registration state on a tournament card and page: open, full, upcoming, closed. */
.status-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: 0.5rem;
  border-left: 4px solid currentColor;
  font-weight: 600;
  line-height: 1.3;
}
.status-band-open     { background: rgba(13, 115, 119, 0.12); color: var(--upl-teal); }
.status-band-full     { background: rgba(252, 163, 17, 0.2);  color: #8a5300; }
.status-band-upcoming { background: rgba(20, 33, 61, 0.08);   color: var(--upl-dark); }
.status-band-closed   { background: #e9ecef;                  color: #6c757d; border-left-style: dashed; }

/* ---- Room displays (event TV pages) ---- */
/* Only the board shows: no navbar, impersonation bar, nudge, flash messages, footer or progress bar. */
body.tv-display > nav.navbar,
body.tv-display > .alert,
body.tv-display > .hijack-banner,
body.tv-display > footer,
body.tv-display > #htmx-progress,
body.tv-display main .alert { display: none; }
body.tv-display { background: var(--upl-dark); color: #fff; }
body.tv-display main.container { max-width: none; }
.tv-title { font-family: 'Oswald', sans-serif; font-size: 2rem; margin-bottom: .75rem; }
.tv-venue { grid-column: 1 / -1; font-size: 1.25rem; opacity: .8; margin: .5rem 0 0; }
.tv-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .75rem; }
.tv-tile { background: rgba(255, 255, 255, .08); border-radius: .5rem; padding: .6rem .8rem; min-width: 0; overflow: hidden; }
.tv-tile-busy { border-left: 6px solid var(--upl-accent, #fca311); }
.tv-tile-open { border-left: 6px solid var(--upl-teal); }
.tv-tile-closed { opacity: .5; }
.tv-tile-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.tv-tile-label { font-family: 'Oswald', sans-serif; font-size: 1.5rem; }
.tv-tile-status { font-size: 1.1rem; opacity: .85; }
.tv-match { margin-top: .4rem; min-width: 0; }
.tv-match-meta { font-size: .85rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-name { font-size: 1.15rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-match-foot { display: flex; align-items: center; gap: .5rem; font-size: .95rem; }
.tv-elapsed { opacity: .8; }
.tv-updated { margin-top: .75rem; font-size: .85rem; opacity: .6; text-align: right; }
.tv-empty { font-size: 1.25rem; opacity: .8; }
.tv-board-dense { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .4rem; }
.tv-board-dense .tv-tile { padding: .35rem .5rem; }
.tv-board-dense .tv-tile-label { font-size: 1.05rem; }
.tv-board-dense .tv-tile-status { font-size: .85rem; }
.tv-board-dense .tv-name { font-size: .85rem; }
.tv-board-dense .tv-match-meta, .tv-board-dense .tv-match-foot { font-size: .7rem; }
.tv-single { text-align: center; padding: 2vh 2vw; }
.tv-single .tv-venue { font-size: 2.5rem; }
.tv-single-label { font-family: 'Oswald', sans-serif; font-size: 12vw; line-height: 1; margin-bottom: 2vh; }
.tv-single-match { margin-bottom: 3vh; }
.tv-single-match .tv-match-meta { font-size: 2rem; margin-bottom: 1vh; }
.tv-single-names { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.tv-single .tv-name { font-size: 5vw; max-width: 100%; }
.tv-vs { font-size: 2rem; opacity: .6; }
.tv-single-score { font-family: 'Oswald', sans-serif; font-size: 8vw; }
.tv-single .tv-match-foot { justify-content: center; font-size: 2rem; }
.tv-single-status { font-family: 'Oswald', sans-serif; font-size: 8vw; }
.tv-single .tv-empty { font-size: 3vw; }

/* Operator Home Page editor */
#home-widget-add .home-widget-on-page,
#home-widget-list .home-widget-off-page { display: none; }
.home-widget-row.dragging { opacity: .5; }
.home-widget-row .trix-button-group--file-tools { display: none; }
.home-widget-row trix-editor { min-height: 120px; background: #fff; }

/* Tonight's Tables widget */
.tonight-tables.is-cycling .tonight-pane:not(.is-active) { display: none; }
.tonight-list { max-height: 22rem; overflow-y: auto; }
.tonight-match { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .4rem 0; border-bottom: 1px solid rgba(0, 0, 0, .08); }
.tonight-match:last-child { border-bottom: 0; }
.tonight-table { flex-shrink: 0; font-weight: 600; white-space: nowrap; }

/* Your Night home widget */
.your-night { border-top: 4px solid var(--upl-teal); }
.your-night-quiet { border-top-color: #c9d6d6; }
.your-night-eyebrow { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #6c757d; }
.your-night-tile { border: 1px solid #e3e3e3; border-radius: .5rem; padding: .5rem .25rem; }
.your-night-format { font-size: .7rem; font-weight: 700; color: var(--upl-dark); }
.your-night-number { font-size: 1.9rem; font-weight: 800; line-height: 1; color: var(--upl-teal); }
.your-night-badge { display: inline-block; margin-top: .25rem; font-size: .65rem; background: #fff6e0; color: #7a4d00; border: 1px solid var(--upl-accent); border-radius: .5rem; padding: 0 .4rem; }
.your-night-next { padding: .4rem 0; border-bottom: 1px solid #eee; }
.your-night-next:last-child { border-bottom: 0; }
.your-night-date { font-weight: 700; color: var(--upl-teal); }
.your-night-foot { font-size: .8rem; color: #6c757d; border-top: 1px solid #eee; padding-top: .4rem; margin-top: .6rem; }

/* App start page (/app/) */
.app-start { max-width: 36rem; }
#app-offline-notice { display: none; }
#app-offline-notice[data-offline="1"] {
  display: block; margin-bottom: 1rem; padding: .5rem .75rem; border-radius: .375rem;
  background: #fff3cd; color: #664d03; font-size: .875rem;
}

/* allauth's own pages (templates/allauth/): a narrow column, and Bootstrap
   looks for fields allauth renders with form.as_p. */
.allauth-page main > :not(.alert) { max-width: 560px; margin-left: auto; margin-right: auto; }
.allauth-page main form p > input:not([type=checkbox]):not([type=radio]):not([type=hidden]) {
  display: block; width: 100%; padding: .375rem .75rem; border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}
.allauth-page main form p > label { display: block; margin-bottom: .25rem; }

/* ============================================================
   Partner visit: offerings rate card
   ============================================================ */
.po-list {
  background: #fff;
  border-radius: .75rem;
  box-shadow: 0 1px 3px rgba(20, 33, 61, .08);
  overflow: hidden;
}
.po-row {
  --po-kind: var(--upl-teal);
  --po-kind-bg: rgba(13, 115, 119, .1);
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 11rem;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1.25rem 1rem;
  border-left: 4px solid var(--po-kind);
}
.po-row + .po-row { border-top: 1px solid #e9ecef; }
.po-challenge_match { --po-kind: #b3261e; --po-kind-bg: rgba(179, 38, 30, .09); }
.po-group_lesson    { --po-kind: #b26a00; --po-kind-bg: rgba(252, 163, 17, .16); }

.po-icon {
  width: 3rem; height: 3rem;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--po-kind-bg);
  color: var(--po-kind);
  font-size: 1.35rem;
}
.po-title {
  font-size: 1.3rem;
  line-height: 1.15;
  margin: 0 0 .3rem;
  color: var(--upl-dark);
}
.po-kind {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--po-kind);
  background: var(--po-kind-bg);
  border-radius: 999px;
  padding: .1rem .6rem;
  margin-bottom: .6rem;
}
.po-desc {
  font-size: .9rem;
  line-height: 1.5;
  color: #495057;
  max-width: 62ch;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.po-desc.po-desc-open { display: block; -webkit-line-clamp: unset; line-clamp: unset; }
.po-more {
  background: none; border: 0; padding: 0;
  font-size: .85rem; font-weight: 600;
  color: var(--upl-teal);
}
.po-more:hover { text-decoration: underline; }
.po-days {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: .35rem;
  padding: 0; margin: .65rem 0 0;
}
.po-days li {
  font-size: .75rem; font-weight: 600;
  color: var(--upl-dark);
  border: 1px solid #ced4da;
  border-radius: .35rem;
  padding: .05rem .45rem;
}
.po-buy {
  display: flex; flex-direction: column; align-items: flex-end;
  text-align: right;
}
.po-price {
  font-family: 'Oswald', sans-serif;
  font-size: 2.1rem; font-weight: 600; line-height: 1;
  color: var(--upl-dark);
}
.po-terms {
  font-size: .8rem; color: #6c757d;
  margin: .3rem 0 .75rem;
  text-wrap: balance;
}
.po-buy .btn { margin-top: auto; }

@media (max-width: 575.98px) {
  .po-row {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    padding: 1rem .9rem 1rem .75rem;
    gap: .75rem;
  }
  .po-icon { width: 2.5rem; height: 2.5rem; font-size: 1.1rem; }
  .po-buy {
    grid-column: 2;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    text-align: left; gap: .25rem .75rem;
  }
  .po-terms { margin: 0; flex: 1; }
  .po-buy .btn { margin-top: 0; }
}

/* Home page Photo Carousel: the whole photo shows (contain), over a blurred copy that fills the frame. */
.home-carousel-frame { position: relative; height: 16rem; overflow: hidden; background: #111; }
@media (min-width: 768px) { .home-carousel-frame { height: 24rem; } }
.home-carousel-backdrop { position: absolute; inset: -1.5rem; background-size: cover; background-position: center;
  filter: blur(18px) brightness(.55); }
.home-carousel-img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; }

/* Settings tab bars: one row that scrolls sideways on phones instead of wrapping. */
.settings-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.settings-tabs .nav-link { white-space: nowrap; }

/* Tournaments calendar (public Tournaments page) */
.event-cal { max-width: 900px; }
.event-cal-toggle { display: inline-flex; border: 1px solid #cfd6df; border-radius: 999px; overflow: hidden; }
.event-cal-toggle a { padding: .3rem 1rem; color: var(--upl-dark); text-decoration: none; font-size: .9rem; }
.event-cal-toggle a.active { background: var(--upl-dark); color: #fff; }
.event-cal-month { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: #6b7585; font-weight: 600; margin: 1.5rem 0 .25rem; }
.event-cal-row { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 0; border-top: 1px solid #e1e5eb; }
.event-cal-date { width: 4rem; flex-shrink: 0; text-align: center; border-radius: .6rem; background: var(--upl-dark); color: #fff; padding: .45rem 0; line-height: 1.1; }
.event-cal-date small { display: block; font-size: .65rem; text-transform: uppercase; color: var(--upl-accent); font-weight: 700; }
.event-cal-date b { font-size: 1.45rem; }
.event-cal-date span { display: block; font-size: .65rem; opacity: .8; }
.event-cal-thumb { width: 6rem; height: 4.5rem; object-fit: cover; border-radius: .5rem; flex-shrink: 0; }
.event-cal-body { flex: 1; min-width: 0; }
.event-cal-name { font-weight: 700; font-size: 1.05rem; color: var(--upl-dark); text-decoration: none; margin-right: .35rem; }
.event-cal-name:hover { text-decoration: underline; }
.event-cal-pill { display: inline-block; font-size: .72rem; padding: .1rem .55rem; border-radius: 999px; font-weight: 600; vertical-align: middle; }
.event-cal-pill.open { background: #d8f3e3; color: #14633a; }
.event-cal-pill.soon { background: #fff1d6; color: #8a5a00; }
.event-cal-pill.draft { background: #e6e8ec; color: #4a5260; }
.event-cal-place { color: #6b7585; font-size: .875rem; margin-top: .1rem; }
.event-cal-tag { display: inline-block; font-size: .78rem; padding: .2rem .55rem; border-radius: .35rem; background: #eef1f5; margin: .35rem .35rem 0 0; }
.event-cal-tag.main { background: var(--upl-dark); color: #fff; }
.event-cal-manage { font-size: .8rem; color: #6b7585; margin-left: auto; flex-shrink: 0; }
@media (max-width: 575.98px) { .event-cal-thumb { display: none; } }
