/* Bridleway app chrome: top tab bar, hero carousel, chat composer, browse tree. */

/* ---------- Top bar ---------- */

/*
  The bar floats above the page so the hero carousel can run edge to edge and
  start behind it. Views that have no hero pay for that with a top inset.
*/
.app-topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: var(--z-tabbar);
  padding: var(--space-3) 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background var(--motion-slow) var(--spring-soft),
    border-color var(--motion-slow) var(--spring-soft);
}

/*
  Over the photograph the bar carries its own light palette; the tokens are
  re-pointed rather than each child restyled.
*/
.app-topbar:not(.is-lifted) {
  --color-text: #ffffff;
  --color-text-muted: rgba(255, 255, 255, 0.76);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-tint-soft: rgba(255, 255, 255, 0.14);
  --glass-tint-strong: rgba(255, 255, 255, 0.24);
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.32);
}

.app-topbar:not(.is-lifted) .brand-mark,
.app-topbar:not(.is-lifted) .nav-link,
.app-topbar:not(.is-lifted) .icon-button {
  color: #fff;
}

/* Once the page scrolls past the hero the bar earns its full glass surface. */
.app-topbar.is-lifted {
  border-bottom-color: var(--glass-border);
  background:
    linear-gradient(145deg, var(--glass-highlight), transparent 36%),
    var(--glass-tint);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.24);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.24);
}

.app-topbar::before {
  box-shadow: none;
}

.brand-mark {
  display: inline-flex;
  gap: var(--space-2);
  align-items: baseline;
  font-weight: 650;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark .brand-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  align-self: center;
  fill: var(--color-accent);
}

/* Over the hero the mark reads as one piece with the wordmark. */
.app-topbar:not(.is-lifted) .brand-mark .brand-icon {
  fill: currentColor;
}

/* The two primary tabs, as a segmented control on glass. */
.tab-switch {
  /* Bootstrap's .nav wraps by default, which broke the control in two on phones. */
  flex-wrap: nowrap;
  gap: var(--space-1);
  padding: var(--space-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  background: var(--glass-tint-soft);
}

.tab-switch .nav-link {
  padding: 0.4rem 1.1rem;
  white-space: nowrap;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 560;
  border-radius: var(--radius-pill);
  transition: color var(--motion-fast) var(--spring-soft),
    background var(--motion-normal) var(--spring-soft);
}

.tab-switch .nav-link:hover {
  color: var(--color-text);
}

.tab-switch .nav-link.active {
  color: var(--color-text);
  background: var(--glass-tint-strong);
  box-shadow: var(--glass-shadow-soft);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  color: var(--color-text-muted);
  background: var(--glass-tint-soft);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  transition: color var(--motion-fast) var(--spring-soft),
    transform var(--motion-fast) var(--spring-soft);
}

.icon-button:hover {
  color: var(--color-text);
  transform: translateY(-1px);
}

/* Narrow phones: tighten the bar so brand, tabs and toggle stay on one row. */
@media (max-width: 30rem) {
  .app-topbar .container-xl {
    gap: var(--space-2) !important;
  }

  .brand-mark {
    min-width: 0;
    font-size: var(--text-md);
  }

  .brand-mark span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tab-switch .nav-link {
    padding: 0.35rem 0.7rem;
    font-size: var(--text-xs);
  }

  .icon-button {
    width: 2rem;
    height: 2rem;
  }
}

/* Below ~360px only the mark fits beside the tabs; the wordmark steps aside. */
@media (max-width: 22.5rem) {
  .brand-mark span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* ---------- Hero carousel ---------- */

/* Edge to edge: full viewport width, starting underneath the floating top bar. */
.hero-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 0;
}

.hero-carousel .carousel-item {
  height: var(--hero-height);
}

.hero-carousel .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Scrim keeps caption text legible over any photograph. */
.hero-carousel .carousel-item::after {
  position: absolute;
  inset: 0;
  content: '';
  background: linear-gradient(
    180deg,
    rgba(6, 12, 22, 0.34) 0%,
    rgba(6, 12, 22, 0.04) 34%,
    rgba(6, 12, 22, 0.78) 100%
  );
}

.hero-carousel .carousel-caption {
  right: 8%;
  bottom: 2rem;
  left: 8%;
  z-index: 2;
  text-align: left;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

.hero-carousel .carousel-caption {
  color: #fff;
}

.hero-carousel .carousel-caption h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.35rem, 3.2vw, 2.35rem);
  font-weight: 640;
  letter-spacing: -0.02em;
}

.hero-carousel .carousel-caption p {
  margin: var(--space-2) 0 0;
  max-width: 46ch;
  font-size: var(--text-sm);
  opacity: 0.88;
}

.hero-carousel .carousel-indicators [data-bs-target] {
  width: 2rem;
  height: 3px;
  border: 0;
  border-radius: var(--radius-pill);
}

/* ---------- Chat ---------- */

/*
  First screen is exactly hero + composer: the stage takes whatever the carousel
  leaves of the viewport, so everything else (footer, older messages) is scrolled to.
*/
.chat-stage {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100dvh - var(--hero-height));
  padding-top: var(--space-6);
}

.chat-shell {
  width: 100%;
  max-width: 52rem;
  margin-inline: auto;
}

/* The transcript scrolls inside the stage so the composer never leaves the screen. */
.chat-log {
  max-height: calc(100dvh - var(--hero-height) - 14rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.chat-composer {
  padding: var(--space-3);
  border-radius: var(--radius-lg);
}

/*
  The field stays a single line and scrolls sideways. A long placeholder used to
  wrap and then be clipped by the fixed height, which read as broken text.
*/
.chat-composer textarea.form-control {
  height: 3.25rem;
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  font-size: var(--text-md);
  white-space: pre;
  overflow-x: auto;
  overflow-y: hidden;
  background: transparent;
  border: 0;
  resize: none;
  box-shadow: none;
  scrollbar-width: none;
}

.chat-composer textarea.form-control::-webkit-scrollbar,
.composer-placeholder::-webkit-scrollbar {
  display: none;
}

.composer-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

/* Sits exactly on the textarea's text box and follows the typewriter's tail. */
.composer-placeholder {
  position: absolute;
  inset: 0;
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-soft);
  font-size: var(--text-md);
  line-height: 1.5;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
  scrollbar-width: none;
}

.chat-composer textarea.form-control::placeholder {
  color: var(--color-text-soft);
  opacity: 1;
}

/* ---------- Account bar under the composer ---------- */

.account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-3);
  padding-inline: var(--space-2);
}

.account-bar[hidden] {
  display: none;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.account-avatar {
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  object-fit: cover;
}

.account-name {
  padding: 0;
  max-width: 14rem;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: none;
  border: 0;
}

.account-name:hover {
  color: var(--color-text);
}

.account-meter {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 1 auto;
  min-width: 0;
}

.account-meter[hidden] {
  display: none;
}

.account-meter-track {
  width: 5.5rem;
  height: 0.35rem;
  overflow: hidden;
  background: var(--glass-tint-soft);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
}

.account-meter-fill {
  width: 0;
  height: 100%;
  background: var(--color-accent);
  border-radius: inherit;
  transition: width var(--motion-slow) var(--spring-soft);
}

/* A spent allowance is a state to notice, not a failure to apologise for. */
.account-meter.is-spent .account-meter-fill {
  background: var(--color-warning);
}

.account-meter-label {
  color: var(--color-text-soft);
  font-size: var(--text-xs);
  white-space: nowrap;
}

/* ---------- Dialogs ---------- */

.app-dialog {
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 0;
  color: var(--color-text);
  background: transparent;
  border: 0;
}

.app-dialog::backdrop {
  background: rgba(6, 12, 22, 0.5);
  backdrop-filter: blur(4px);
}

.app-dialog-sheet {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
}

.app-dialog-sheet h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xl);
  font-weight: 620;
}

.app-dialog-sheet p {
  font-size: var(--text-sm);
  line-height: 1.6;
}

.sign-in-button {
  display: flex;
  justify-content: center;
  min-height: 2.75rem;
  margin: var(--space-5) 0 var(--space-2);
}

.sign-in-error:empty {
  display: none;
}

.sign-in-error {
  margin: 0;
  color: var(--color-danger);
  font-size: var(--text-sm);
}

.app-dialog-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-5);
}

.dialog-button {
  padding: 0.45rem 1.1rem;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 560;
  background: var(--glass-tint-soft);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
}

.dialog-button:hover {
  background: var(--glass-tint-strong);
}

.dialog-button.is-danger {
  color: var(--color-danger);
  border-color: currentColor;
}

/* ---------- View offsets for the floating top bar ---------- */

/* The hero runs under the bar; every other view starts below it. */
/*
  The inset lives on the stage, not on the container: the container carries
  Bootstrap's `py-4`, whose !important padding silently won this rule and left
  the breadcrumb sitting behind the floating bar.
*/
.browse-stage {
  min-height: 100dvh;
  padding-top: var(--topbar-height);
}

.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  color: var(--color-text-inverse);
  background: var(--color-accent);
  border: 0;
  border-radius: var(--radius-pill);
  transition: background var(--motion-fast) var(--spring-soft),
    transform var(--motion-fast) var(--spring-soft);
}

.send-button:hover:not(:disabled) {
  background: var(--color-accent-strong);
  transform: translateY(-1px);
}

.send-button:disabled {
  opacity: 0.42;
}

.suggestion-chip {
  padding: 0.45rem 0.95rem;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  text-align: left;
  background: var(--glass-tint-soft);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  transition: color var(--motion-fast) var(--spring-soft),
    transform var(--motion-fast) var(--spring-soft);
}

.suggestion-chip:hover {
  color: var(--color-text);
  transform: translateY(-1px);
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.chat-bubble {
  max-width: min(90%, 40rem);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-md);
  line-height: 1.55;
}

.chat-bubble.from-user {
  align-self: flex-end;
  color: var(--color-text-inverse);
  background: var(--color-accent);
  border-bottom-right-radius: var(--radius-xs);
}

.chat-bubble.from-assistant {
  align-self: flex-start;
  border-bottom-left-radius: var(--radius-xs);
}

.workflow-status {
  display: flex;
  align-items: center;
}

.workflow-trace {
  display: grid;
  gap: 0.2rem;
  margin: var(--space-3) 0 0;
  padding: var(--space-3) 0 0 1.2rem;
  border-top: 1px solid var(--glass-border);
  color: var(--color-text-soft);
  font-size: var(--text-xs);
}

.workflow-trace li.is-active {
  color: var(--color-accent);
}

.workflow-complete {
  margin-top: var(--space-3) !important;
  padding-top: var(--space-3);
  border-top: 1px solid var(--glass-border);
}

/* Every answer carries its source links, per the project's provenance rule. */
.evidence-list {
  margin: var(--space-3) 0 0;
  padding: var(--space-3) 0 0;
  border-top: 1px solid var(--glass-border);
  list-style: none;
  font-size: var(--text-xs);
}

.evidence-list li + li {
  margin-top: var(--space-1);
}

.typing-dots span {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-right: 0.25rem;
  border-radius: var(--radius-pill);
  background: var(--color-text-soft);
  animation: typing-bounce 1.1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-0.22rem); }
}

/* ---------- Browse ---------- */

.browse-crumbs {
  --bs-breadcrumb-divider: '›';
  margin: 0;
  font-size: var(--text-sm);
}

.browse-crumbs .breadcrumb-item a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.browse-crumbs .breadcrumb-item a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.browse-crumbs .breadcrumb-item.active {
  color: var(--color-text);
  font-weight: 560;
}

/* ---------- Keyword search ---------- */

.browse-search {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
}

.browse-search .browse-icon {
  flex: none;
  width: 1rem;
  height: 1rem;
  fill: var(--color-text-muted);
}

.browse-search input.form-control {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--space-3) 0;
  color: var(--color-text);
  font-size: var(--text-md);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.browse-search input.form-control::placeholder {
  color: var(--color-text-soft);
  opacity: 1;
}

/* The browser's own search-field clear button is unstyled and theme-blind. */
.browse-search input[type='search']::-webkit-search-cancel-button {
  display: none;
}

.browse-search-clear {
  flex: none;
  padding: 0 var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  line-height: 1;
  background: none;
  border: 0;
}

.browse-search-clear:hover {
  color: var(--color-text);
}

.search-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Echoes how each term was read, so the filter is never a mystery. */
.search-chip {
  padding: 0.15rem 0.55rem;
  color: var(--color-text);
  font-size: var(--text-xs);
  background: var(--color-accent-soft);
  border-radius: var(--radius-sm);
}

.search-year + .search-year {
  margin-top: var(--space-6);
}

.search-year-heading {
  margin-bottom: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 560;
  letter-spacing: 0.06em;
}

/* ---------- "Aktuell" rail ---------- */

/* The breadcrumb line carries the rail's arrows at its free right end. */
.browse-crumb-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.browse-crumb-row > nav {
  flex: 1 1 auto;
  min-width: 0;
}

.browse-crumb-row .browse-crumbs {
  margin-bottom: 0;
}

.rail-nav {
  display: flex;
  gap: var(--space-2);
  flex: 0 0 auto;
}

.rail-nav[hidden] {
  display: none;
}

.rail-nav .icon-button {
  width: 2rem;
  height: 2rem;
  font-size: var(--text-lg);
  line-height: 1;
}

.rail-nav .icon-button:disabled {
  opacity: 0.35;
  transform: none;
}

.current-rail {
  margin-bottom: var(--space-6);
}

.current-rail-heading {
  margin: 0 0 var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 620;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* One row, scrolled sideways — it is a shortcut, never a second grid. */
.current-rail-track {
  display: flex;
  gap: var(--space-4);
  /*
    Scrolling sideways makes the vertical axis scroll too, which would clip the
    hover lift and the focus ring. The padding is the room they need; the pulled
    margins keep the row sitting where it did without it.
  */
  padding-block: var(--space-2);
  margin-block: calc(var(--space-2) * -1);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.current-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 0 0 auto;
  width: 16rem;
  padding: var(--space-4) var(--space-5);
  scroll-snap-align: start;
  text-align: left;
  border-radius: var(--radius-md);
  /* Flat by design: a drop shadow on a scrolling row reads as smearing. */
  box-shadow: none;
  transition: transform var(--motion-normal) var(--spring-soft);
}

.current-card:hover {
  transform: translateY(-2px);
}

.current-card .tile-label {
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.current-card .tile-meta {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.current-when {
  color: var(--color-text-soft);
  font-size: var(--text-xs);
  font-weight: 620;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Only the tournaments actually running today carry the accent. */
.current-card.is-today {
  border-color: var(--color-accent);
}

.current-card.is-today .current-when {
  color: var(--color-accent);
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--space-4);
}

.browse-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  width: 100%;
  padding: var(--space-4) var(--space-5);
  text-align: left;
  border-radius: var(--radius-md);
  transition: transform var(--motion-normal) var(--spring-soft),
    box-shadow var(--motion-normal) var(--spring-soft);
}

.browse-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow);
}

.browse-tile .tile-label {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.browse-tile .tile-meta {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.provider-badge {
  padding: 0.2rem 0.6rem;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 560;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--color-accent-soft);
  border-radius: var(--radius-pill);
}

/* Tournament announcements are intentionally omitted: they are noisy provider copy. */
.tournament-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
  grid-template-areas:
    'overview documents'
    'days documents';
  gap: var(--space-4);
  align-items: start;
}

.tournament-overview {
  grid-area: overview;
  min-height: 11.5rem;
  padding: var(--space-6);
}

.tournament-days {
  grid-area: days;
}

.tournament-overview h2 {
  margin: var(--space-3) 0 var(--space-4);
  font-size: clamp(1.8rem, 3vw, var(--text-3xl));
  font-weight: 650;
  letter-spacing: -0.025em;
}

.tournament-kicker,
.tournament-facts,
.tournament-facts span,
.tournament-documents-heading,
.tournament-document {
  display: flex;
  align-items: center;
}

.tournament-kicker {
  gap: var(--space-2);
  color: var(--color-accent);
  font-size: var(--text-sm);
  font-weight: 620;
}

.browse-icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: currentColor;
}

.tournament-kicker .browse-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.tournament-facts {
  flex-wrap: wrap;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.tournament-facts span {
  gap: 0.4rem;
}

.tournament-facts span + span::before {
  color: var(--color-text-soft);
  content: '·';
}

.tournament-documents {
  grid-area: documents;
  overflow: hidden;
  padding: var(--space-3);
}

.tournament-documents-heading {
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-3);
  color: var(--color-text-muted);
}

.tournament-documents-heading h3 {
  margin: 0;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 640;
}

.tournament-document-list {
  display: grid;
  gap: 0.2rem;
}

.tournament-document {
  gap: var(--space-3);
  min-width: 0;
  padding: 0.68rem var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.25;
  text-decoration: none;
  border-radius: var(--radius-sm);
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  transition: color var(--motion-fast) var(--spring-soft), background var(--motion-fast) var(--spring-soft), transform var(--motion-fast) var(--spring-soft);
}

.tournament-document:hover {
  color: var(--color-text);
  background: var(--color-accent-soft);
  transform: translateX(2px);
}

.tournament-document.is-primary {
  color: var(--color-text);
  background: var(--glass-tint-soft);
  border-radius: var(--radius-pill);
}

.tournament-document > span:nth-child(2) {
  min-width: 0;
  flex: 1 1 auto;
}

.document-external {
  color: var(--color-text-soft);
}

.competition-video-link {
  color: var(--color-accent);
  font: inherit;
  text-decoration: underline;
}

.video-sheet .modal-dialog {
  display: flex;
  align-items: end;
  height: 100%;
  max-width: 42rem;
  margin: 0 auto;
}

.video-sheet .modal-content {
  height: min(72vh, 42rem);
  max-height: calc(100dvh - 1rem);
  overflow: hidden;
  color: var(--color-text);
  background: #101a28;
  border: 1px solid rgb(166 190 220 / 0.34);
  border-radius: 1.5rem 1.5rem 0 0;
  box-shadow: 0 -1rem 3rem rgb(0 0 0 / 0.5);
}

.video-sheet .modal-header {
  justify-content: flex-start;
  gap: var(--space-3);
  padding: 1rem 1.25rem;
  flex: 0 0 auto;
  background: #142033;
  border-bottom: 1px solid rgb(166 190 220 / 0.24);
}

.video-sheet-close {
  margin: 0 !important;
  opacity: 0.85;
}

.video-sheet .modal-body {
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 1.25rem max(1.5rem, env(safe-area-inset-bottom));
}

.video-sheet-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: 0.9rem 0;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid rgb(166 190 220 / 0.18);
}

.video-sheet-link:last-child { border-bottom: 0; }
.video-sheet-link > span:nth-child(2) { min-width: 0; }
.modal-backdrop.show { opacity: 0.62; }

@media (max-width: 575.98px) {
  .video-sheet .modal-dialog { max-width: none; }
  .video-sheet .modal-content { height: min(78vh, 42rem); }
}

@media (max-width: 767.98px) {
  .tournament-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      'overview'
      'documents'
      'days';
  }

  .tournament-overview {
    min-height: 0;
  }
}

.results-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--color-text);
  --bs-table-border-color: var(--glass-border);
  --bs-table-hover-bg: var(--color-accent-soft);
  --bs-table-hover-color: var(--color-text);
  margin: 0;
}

.results-table thead th {
  color: var(--color-text-soft);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.results-table td,
.results-table th {
  padding: var(--space-3) var(--space-4);
  vertical-align: middle;
}

.results-table .rank-cell {
  width: 3.5rem;
  font-variant-numeric: tabular-nums;
  font-weight: 640;
}

.results-table .score-cell {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.results-table .horse-names {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.empty-state {
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--color-text-muted);
}

/* Fixture data must never read as real published results. */
.demo-banner {
  padding: var(--space-3) var(--space-4);
  color: var(--color-warning);
  font-size: var(--text-sm);
  border: 1px dashed currentColor;
  border-radius: var(--radius-sm);
}

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

/* ---------- Haftungsausschluss ---------- */

.legal-stage {
  min-height: 100dvh;
  padding-top: var(--topbar-height);
}

.legal-sheet {
  max-width: 46rem;
  margin-inline: auto;
  padding: var(--space-8);
  border-radius: var(--radius-lg);
}

.legal-sheet h1 {
  margin: 0 0 var(--space-6);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 640;
  letter-spacing: -0.025em;
}

.legal-sheet h2 {
  margin: var(--space-8) 0 var(--space-3);
  font-size: var(--text-lg);
  font-weight: 620;
}

.legal-sheet p {
  margin: 0 0 var(--space-4);
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: var(--space-8) 0 var(--space-10);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  text-align: center;
  border-top: 1px solid var(--glass-border);
}

.site-footer p {
  max-width: 52rem;
  margin-inline: auto;
}

.site-footer a {
  color: inherit;
  text-underline-offset: 0.2em;
}

.site-footer a:hover {
  color: var(--color-accent);
}

/* ---------- Discipline filter ---------- */

/* Sits at the free right end of the breadcrumb line, beside the rail arrows.
   Wider than a plain icon button because it carries its current state as a word:
   a filter that is on by default has to say so, or a missing tournament reads as
   missing data. */
.browse-discipline-filter {
  width: auto;
  flex: 0 0 auto;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.browse-discipline-filter[aria-pressed='true'] {
  color: var(--color-text);
  border-color: var(--color-accent, var(--glass-border));
}

.browse-discipline-filter[aria-pressed='false'] {
  color: var(--color-text-muted);
}
