:root {
  color-scheme: dark;
  --color-background: #101014;
  --color-surface: #19181f;
  --color-surface-raised: #211f29;
  --color-text: #f4f1f7;
  --color-text-muted: #aaa5b3;
  --color-accent: #7d3ca8;
  --color-accent-soft: rgb(125 60 168 / 16%);
  --color-border: #34313b;
  --color-success: #74d6a0;
  --color-danger: #ff9a9a;
  --font-body: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--color-background);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 0, rgb(75 23 111 / 18%), transparent 48%),
    var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
}

a {
  color: #d3a9ed;
}

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: rgb(16 16 20 / 88%);
}

.header-top {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: 1rem 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--color-text);
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--color-accent);
  border-radius: 12px;
  background: var(--color-accent-soft);
  color: #e7c7fc;
  font-size: 0.75rem;
  font-weight: 800;
}

.local-badge,
.refresh-state {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.local-badge {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
}

.auth-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.auth-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  background: var(--color-accent-soft);
  color: var(--color-text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.auth-identity {
  color: var(--color-text);
  font-weight: 650;
}

.auth-setup-link {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.local-badge span,
.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--color-success);
}

.main-navigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem 0.75rem;
  border-top: 1px solid rgb(52 49 59 / 60%);
}

.main-navigation a,
.view-tab {
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.main-navigation a[aria-current="page"],
.view-tab[aria-selected="true"] {
  background: var(--color-accent-soft);
}

.view-tab {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.auth-card {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2rem);
}

.auth-card form {
  display: grid;
  gap: 1rem;
}

.auth-card .primary-button {
  justify-self: start;
}

.admin-page {
  display: grid;
  gap: 1.25rem;
}

.admin-section {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.permissions-form,
.permissions-modules {
  display: grid;
  gap: 1rem;
}

.admin-view-panel {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.permission-module {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  background: var(--color-surface-raised);
}

.permission-module h3 {
  margin: 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 1.2rem;
}

.admin-create-form,
.admin-user-actions,
.admin-reset-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.admin-create-form .form-field,
.admin-user-actions .form-field,
.admin-reset-form .form-field {
  flex: 1 1 180px;
}

.admin-create-form input,
.admin-create-form select,
.admin-user-actions input,
.admin-user-actions select,
.admin-reset-form input,
.admin-table select {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background);
  color: var(--color-text);
  font: inherit;
}

.admin-users-list {
  display: grid;
  gap: 0.9rem;
}

.admin-user-row {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-raised);
}

.admin-user-details {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem 1rem;
}

.admin-user-details span,
.admin-active-toggle {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.admin-active-toggle {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 0.4rem;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1rem 0;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  min-width: 130px;
  padding: 0.65rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}

.admin-table th:first-child,
.admin-table td:first-child {
  min-width: 230px;
}

.admin-table select {
  min-width: 120px;
}

.admin-table tbody tr:hover {
  background: var(--color-accent-soft);
}

main {
  width: min(1120px, calc(100% - 3rem));
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) 0 4rem;
}

.page-heading {
  margin-bottom: 2rem;
}

.recipe-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.etf-module {
  display: grid;
  gap: 1rem;
}

.etf-module-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
}

.etf-period-control {
  display: grid;
  gap: 0.3rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.etf-period-control select {
  min-width: 170px;
  padding: 0.55rem 2rem 0.55rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background);
  color: var(--color-text);
  font: inherit;
}

.etf-period-control select:disabled {
  opacity: 0.65;
}

.etf-source-note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.etf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.etf-card {
  padding-bottom: 0.5rem;
}

.etf-card-heading {
  display: flex;
  min-height: 112px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.3rem 0.5rem;
}

.etf-card-heading .eyebrow {
  margin-bottom: 0.3rem;
}

.etf-card-heading h2 {
  max-width: 30ch;
  font-size: 1.1rem;
}

.etf-performance {
  flex: 0 0 auto;
  margin: 0.25rem 0 0;
  color: var(--color-text-muted);
  font-size: 1.15rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.etf-performance[data-direction="up"] {
  color: var(--color-success);
}

.etf-performance[data-direction="down"] {
  color: var(--color-danger);
}

.etf-chart-status {
  display: grid;
  min-height: 250px;
  align-content: center;
  justify-items: center;
  padding: 1.2rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.etf-chart-error {
  color: var(--color-danger);
}

.etf-chart {
  padding: 0.5rem 0.8rem 0.8rem;
}

.etf-chart svg {
  display: block;
  width: 100%;
  min-height: 220px;
  overflow: visible;
}

.etf-chart-gridline {
  stroke: rgb(170 165 179 / 16%);
  stroke-width: 1;
}

.etf-chart-zero {
  stroke: rgb(170 165 179 / 55%);
  stroke-dasharray: 4 5;
  stroke-width: 1;
}

.etf-chart-axis-label {
  fill: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 11px;
}

.etf-chart-line {
  fill: none;
  stroke: #bd83dc;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.etf-card[data-fund="global-aggregate-bond"] .etf-chart-line {
  stroke: #80c4b0;
}

.etf-chart-marker {
  fill: var(--color-surface-raised);
  stroke: #bd83dc;
  stroke-width: 2;
}

.etf-card[data-fund="global-aggregate-bond"] .etf-chart-marker {
  stroke: #80c4b0;
}

.eyebrow,
.panel-label {
  margin: 0 0 0.4rem;
  color: #c390e0;
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.65rem;
  font-size: clamp(2.2rem, 5vw, 3.7rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.1;
}

.intro {
  margin-bottom: 0;
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

.source-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
}

.panel-label {
  margin-bottom: 0.2rem;
  color: var(--color-text-muted);
  font-size: 0.68rem;
}

.source-panel a {
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.refresh-state {
  max-width: 48%;
  text-align: right;
}

.refresh-state[data-state="loading"] .status-dot {
  width: 12px;
  height: 12px;
  border: 2px solid #e1b45c;
  border-right-color: transparent;
  background: transparent;
  animation: spin 0.8s linear infinite;
}

.refresh-state[data-state="error"] {
  color: var(--color-danger);
}

.refresh-state[data-state="error"] .status-dot {
  background: var(--color-danger);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1.65fr);
  gap: 1.2rem;
}

.view-navigation {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  align-self: start;
  padding: 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
}

.view-content {
  display: grid;
}

.view-tab {
  min-height: 48px;
}

.view-tab:hover,
.main-navigation a:hover {
  background: var(--color-accent-soft);
}

.poker-rankings {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: poker-ranking;
}

.poker-player-section,
.poker-new-game,
.poker-active-game {
  padding: 1.3rem 1.4rem;
}

.poker-player-section {
  border-bottom: 1px solid var(--color-border);
}

.poker-section-heading,
.poker-active-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.poker-section-heading h3,
.poker-new-game h3,
.poker-active-heading h3 {
  margin: 0;
  font-size: 1.05rem;
}

.poker-player-form,
.poker-deposit-form {
  display: flex;
  align-items: flex-end;
  gap: 0.8rem;
  max-width: 620px;
  margin-top: 1rem;
}

.poker-player-form .form-field,
.poker-deposit-form .form-field {
  flex: 1;
}

.poker-player-picker {
  display: grid;
  gap: 0.65rem;
  margin: 1.2rem 0 0;
  padding: 0;
  border: 0;
}

.poker-player-picker legend {
  margin-bottom: 0.55rem;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 650;
}

#poker-player-list {
  display: grid;
  gap: 0.5rem;
}

.poker-player-option,
.poker-game-players li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 48px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: rgb(16 16 20 / 40%);
}

.poker-player-option {
  cursor: pointer;
}

.poker-player-option:has(input:checked) {
  border-color: #76508b;
  background: var(--color-accent-soft);
}

.poker-player-option:has(input:disabled) {
  cursor: default;
}

.poker-player-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--color-accent);
}

.poker-player-option-name,
.poker-game-player-name {
  overflow-wrap: anywhere;
  font-weight: 650;
}

.poker-player-balance {
  color: #d5acee;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.poker-empty-state {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px dashed var(--color-border);
  border-radius: 9px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.poker-new-game {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.poker-new-game .eyebrow,
.poker-active-heading .eyebrow {
  margin-bottom: 0.2rem;
}

.poker-new-game .form-hint {
  margin-top: 0.2rem;
}

.poker-new-game .primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.poker-active-game {
  display: grid;
  gap: 1rem;
}

.poker-active-heading {
  flex-wrap: wrap;
}

.poker-game-players {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.poker-game-players li {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 56px;
  padding: 0.7rem 0.9rem;
}

.poker-deposit-form {
  justify-self: center;
  width: min(100%, 480px);
  margin: 0.5rem auto;
}

.poker-deposit-form .primary-button {
  min-width: 140px;
}

.poker-status {
  margin: 0.65rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.poker-error {
  color: var(--color-danger);
}

.poker-success {
  color: var(--color-success);
}

.poker-statistics {
  display: grid;
  gap: 1rem;
  min-width: 0;
  padding: 1.2rem 1.4rem 1.4rem;
}

.poker-history {
  display: grid;
  gap: 1rem;
  min-width: 0;
  padding: 1.2rem 1.4rem 1.4rem;
}

.poker-history-list {
  display: grid;
  gap: 1rem;
}

.poker-history-game {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: rgb(16 16 20 / 30%);
}

.poker-history-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.poker-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.poker-history-delete {
  min-height: 36px;
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
}

.poker-history-section-title {
  margin: 0.35rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.poker-history-balances,
.poker-history-transfers {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.poker-history-balances li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgb(52 49 59 / 50%);
}

.poker-history-balances li:last-child {
  border-bottom: 0;
}

.poker-history-balances strong,
.poker-profit-positive,
.poker-profit-negative {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.poker-profit-positive {
  color: var(--color-success);
}

.poker-profit-negative {
  color: var(--color-danger);
}

.poker-history-transfers {
  counter-reset: poker-transfer;
}

.poker-history-transfers li {
  counter-increment: poker-transfer;
  line-height: 1.5;
}

.poker-history-transfer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.poker-history-transfer-description {
  min-width: 0;
}

.poker-history-paid-label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  cursor: pointer;
}

.poker-history-paid-status {
  flex: 0 0 auto;
  color: var(--color-danger);
  font-size: 0.82rem;
  font-weight: 650;
}

.poker-history-paid-status[data-paid="true"] {
  color: var(--color-success);
}

.poker-history-paid-label input {
  accent-color: var(--color-accent);
}

.poker-history-transfers li::before {
  content: counter(poker-transfer) ".";
  display: inline-block;
  min-width: 1.5rem;
  color: var(--color-text-muted);
}

@media (max-width: 520px) {
  .poker-history-transfer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
    padding-block: 0.25rem;
  }
}

.poker-history-no-transfers {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.poker-table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.poker-statistics-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  text-align: left;
}

.poker-statistics-table th,
.poker-statistics-table td {
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid rgb(52 49 59 / 70%);
  white-space: nowrap;
}

.poker-statistics-table thead th {
  background: var(--color-surface-raised);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 650;
}

.poker-statistics-table tbody th {
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 650;
  text-align: left;
}

.poker-statistics-table tbody td {
  color: var(--color-text);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.poker-statistics-table tbody tr:last-child th,
.poker-statistics-table tbody tr:last-child td {
  border-bottom: 0;
}

.poker-statistics-table td:nth-child(2),
.poker-statistics-table td:nth-child(4) {
  color: #d5acee;
}

.poker-statistics-table .secondary-button {
  min-height: 34px;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
}

.poker-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
}

.poker-sort-button:hover,
.poker-sort-button:focus-visible {
  color: var(--color-text);
}

.poker-sort-button span {
  color: #d5acee;
  font-size: 0.9rem;
}

.poker-dialog {
  width: min(520px, calc(100% - 2rem));
  max-height: min(85vh, 760px);
  overflow: auto;
  padding: 1.4rem;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface-raised);
  color: var(--color-text);
  box-shadow: 0 24px 80px rgb(0 0 0 / 55%);
}

.poker-dialog::backdrop {
  background: rgb(0 0 0 / 72%);
  backdrop-filter: blur(3px);
}

.poker-dialog h3 {
  margin: 0;
  font-size: 1.2rem;
}

.poker-dialog .form-hint {
  margin: 0.5rem 0 1rem;
}

.poker-payout-fields,
#poker-statistics-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.poker-dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.poker-rank {
  display: grid;
  grid-template-columns: 2.4rem minmax(140px, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  min-height: 92px;
  padding: 0.8rem 1.25rem;
  border-bottom: 1px solid rgb(52 49 59 / 70%);
  counter-increment: poker-ranking;
}

.poker-rank-number {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid rgb(213 172 238 / 30%);
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: #d5acee;
  font-size: 0.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.poker-rank-details h3 {
  margin: 0;
  font-size: 0.95rem;
}

.poker-rank-details p {
  margin: 0.2rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.poker-cards {
  display: flex;
  gap: 0.25rem;
}

.poker-card {
  display: flex;
  width: 36px;
  height: 50px;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9d4df;
  border-radius: 5px;
  background: linear-gradient(145deg, #fff, #e8e4ed);
  color: #211f29;
  font-size: 0.77rem;
  font-weight: 800;
  line-height: 1.1;
  box-shadow: 0 2px 6px rgb(0 0 0 / 25%);
}

.poker-card-red {
  color: #bd3651;
}

.poker-ranking-note {
  margin: 0;
  padding: 1rem 1.4rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.poker-coming-soon {
  display: grid;
  min-height: 300px;
  align-content: center;
  justify-items: center;
  padding: 2rem;
  text-align: center;
}

.poker-coming-icon {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  border: 1px solid rgb(213 172 238 / 30%);
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: #d5acee;
  font-size: 1.5rem;
}

.poker-coming-soon h3 {
  margin: 1rem 0 0.25rem;
}

.poker-coming-soon p {
  max-width: 38ch;
  margin: 0;
  color: var(--color-text-muted);
}

.view-content,
.view-panel {
  min-width: 0;
}

.card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: linear-gradient(145deg, rgb(33 31 41 / 96%), rgb(25 24 31 / 98%));
  box-shadow: 0 16px 42px rgb(0 0 0 / 15%);
}

.card-heading {
  display: flex;
  min-height: 94px;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid var(--color-border);
}

.card-heading .eyebrow {
  margin-bottom: 0.15rem;
  font-size: 0.65rem;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.data-count {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: #d5acee;
  font-size: 0.75rem;
  white-space: nowrap;
}

.recipe-create {
  display: grid;
  justify-items: end;
  gap: 0.4rem;
}

.primary-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 1rem;
  border: 1px solid #9255b5;
  border-radius: 9px;
  background: var(--color-accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.primary-button span {
  font-size: 1.2rem;
  line-height: 1;
}

.primary-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.secondary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background);
  color: var(--color-text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.secondary-button:hover {
  border-color: #76508b;
  background: var(--color-accent-soft);
}

.secondary-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.recipe-form {
  display: grid;
  gap: 1.2rem;
}

.recipe-form-section {
  overflow: hidden;
}

.documents-panel {
  overflow: hidden;
}

.documents-area-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--color-border);
}

.documents-area-button {
  min-height: 42px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-background);
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
}

.documents-area-button[aria-pressed="true"] {
  border-color: #76508b;
  background: var(--color-accent-soft);
  color: #e7c7fc;
}

.documents-area-button:hover {
  border-color: #76508b;
}

.documents-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--color-border);
}

.documents-breadcrumbs,
.documents-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.documents-breadcrumbs {
  min-width: 0;
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

.documents-breadcrumbs button {
  padding: 0;
  border: 0;
  background: none;
  color: #d3a9ed;
  font: inherit;
  cursor: pointer;
}

.documents-breadcrumbs button:hover {
  text-decoration: underline;
}

.documents-breadcrumbs [aria-current="page"] {
  overflow-wrap: anywhere;
  color: var(--color-text);
}

.documents-breadcrumb-separator {
  color: var(--color-text-muted);
}

.documents-actions .secondary-button,
.documents-upload-button {
  min-height: 42px;
  cursor: pointer;
}

.documents-upload-button {
  font-size: 0.85rem;
}

.documents-upload-button.is-disabled {
  opacity: 0.6;
  cursor: wait;
  pointer-events: none;
}

.documents-hint {
  margin: 0;
  padding: 0.75rem 1.4rem 0;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.documents-feedback {
  margin-inline: 1.4rem;
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
  gap: 1rem;
  padding: 1.3rem 1.4rem 1.5rem;
}

.documents-item {
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: rgb(16 16 20 / 50%);
}

.documents-folder-link,
.documents-file-link {
  display: grid;
  width: 100%;
  min-height: 100%;
  align-content: start;
  justify-items: start;
  gap: 0.5rem;
  padding: 0.85rem;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
}

.documents-folder-link {
  cursor: pointer;
}

.documents-delete-button {
  justify-self: start;
  margin: 0 0.85rem 0.85rem;
  padding: 0.35rem 0;
  border: 0;
  background: transparent;
  color: var(--color-danger);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}

.documents-delete-button:hover:not(:disabled) {
  text-decoration: underline;
}

.documents-delete-button:disabled {
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.65;
}

.documents-folder-link:hover,
.documents-file-link:hover {
  background: var(--color-accent-soft);
}

.documents-item-icon {
  display: grid;
  min-height: 90px;
  width: 100%;
  place-items: center;
  color: #d5acee;
  font-size: 2rem;
}

.documents-folder-link > span:last-child {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.documents-file-link img,
.documents-file-link video {
  display: block;
  width: 100%;
  height: 130px;
  border-radius: 6px;
  background: var(--color-background);
  object-fit: cover;
}

.documents-file-name {
  width: 100%;
  overflow-wrap: anywhere;
  font-size: 0.85rem;
}

.documents-file-details {
  color: var(--color-text-muted);
  font-size: 0.73rem;
}

.documents-empty {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 2rem 1.5rem;
}

.documents-empty h2 {
  margin: 0;
  font-size: 1rem;
}

.documents-empty p {
  margin: 0.25rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.documents-dialog {
  width: min(460px, calc(100% - 2rem));
  padding: 1.4rem;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface-raised);
  color: var(--color-text);
  box-shadow: 0 24px 70px rgb(0 0 0 / 50%);
}

.documents-dialog::backdrop {
  background: rgb(0 0 0 / 72%);
  backdrop-filter: blur(3px);
}

.documents-dialog h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
}

.documents-dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.recipe-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.3rem 1.4rem 1.5rem;
}

.form-field {
  display: grid;
  min-width: 0;
  gap: 0.4rem;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.form-field > span > span {
  color: #d5acee;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background);
  color: var(--color-text);
  font: inherit;
  font-size: 0.9rem;
}

.form-field textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.6;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.servings-control input:focus {
  border-color: #9255b5;
  outline: 2px solid rgb(213 172 238 / 30%);
  outline-offset: 1px;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.category-picker {
  display: grid;
  gap: 1rem;
  padding: 1.3rem 1.4rem 1.5rem;
}

.category-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.category-option {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-background);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.category-option:has(input:checked) {
  border-color: #76508b;
  background: var(--color-accent-soft);
  color: #e7c7fc;
}

.category-option input {
  margin: 0;
  accent-color: var(--color-accent);
}

.new-category-row {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
  max-width: 620px;
}

.new-category-row .form-field {
  flex: 1;
}

.form-hint {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.form-error-text,
.recipe-form-feedback {
  color: var(--color-danger);
}

.ingredient-editor {
  display: grid;
  gap: 0.75rem;
  padding: 1.2rem 1.4rem 1.5rem;
}

.ingredient-editor-row {
  display: grid;
  grid-template-columns: auto minmax(100px, 0.25fr) minmax(130px, 0.3fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 0.7rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgb(52 49 59 / 70%);
}

.ingredient-order-controls {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding-bottom: 0.35rem;
}

.ingredient-drag-handle,
.ingredient-order-button {
  display: grid;
  width: 32px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 1rem;
}

.ingredient-drag-handle {
  cursor: grab;
  touch-action: none;
}

.ingredient-drag-handle:active {
  cursor: grabbing;
}

.ingredient-order-button {
  cursor: pointer;
}

.ingredient-order-button:hover:not(:disabled),
.ingredient-drag-handle:hover {
  border-color: var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
}

.ingredient-order-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ingredient-editor-row.is-dragging {
  opacity: 0.45;
}

.ingredient-reorder-hint {
  padding: 0 1.4rem 1rem;
}

.remove-ingredient-button {
  min-height: 44px;
  padding: 0.5rem;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.remove-ingredient-button:hover:not(:disabled) {
  color: var(--color-danger);
}

.remove-ingredient-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.preparation-field {
  padding: 1.3rem 1.4rem 1.5rem;
}

.recipe-form-feedback {
  padding: 0.8rem 1rem;
  border: 1px solid rgb(255 154 154 / 30%);
  border-radius: 9px;
  background: rgb(255 154 154 / 7%);
}

.recipe-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
}

.recipe-overview {
  overflow: visible;
}

.recipe-overview-heading {
  flex-wrap: wrap;
}

.recipe-controls {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--color-border);
}

.recipe-control {
  display: grid;
  gap: 0.3rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.recipe-control select {
  min-width: 175px;
  padding: 0.55rem 2rem 0.55rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background);
  color: var(--color-text);
  font: inherit;
  font-size: 0.82rem;
}

.recipe-control select:disabled {
  opacity: 0.65;
}

.recipe-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 0.9rem;
  padding: 1.2rem 1.4rem;
}

.recipe-card {
  min-height: 155px;
  padding: 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: rgb(16 16 20 / 46%);
}

.recipe-card-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.recipe-card:has(.recipe-card-link:hover) {
  border-color: #76508b;
}

.recipe-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.recipe-category {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: #d5acee;
  font-size: 0.7rem;
  font-weight: 700;
}

.recipe-card h3 {
  margin: 0.9rem 0 0.45rem;
  font-size: 1.1rem;
}

.recipe-time {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.recipe-empty {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 250px;
}

.recipe-empty h2 {
  margin-bottom: 0.55rem;
  font-size: 1.1rem;
}

.recipe-error {
  color: var(--color-danger);
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: #d5acee;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.recipe-detail {
  display: grid;
  gap: 1.2rem;
}

.recipe-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: linear-gradient(145deg, rgb(33 31 41 / 96%), rgb(25 24 31 / 98%));
}

.recipe-image-placeholder {
  display: grid;
  min-height: 280px;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgb(125 60 168 / 22%), transparent 58%),
    var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.recipe-image-placeholder img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.recipe-detail-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 3rem);
}

.recipe-detail-intro h1 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.recipe-detail-time {
  margin: 1.1rem 0 0;
  color: var(--color-text-muted);
}

.recipe-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgb(255 154 154 / 45%);
  border-radius: 8px;
  background: rgb(255 154 154 / 7%);
  color: var(--color-danger);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
}

.danger-button:hover:not(:disabled) {
  border-color: var(--color-danger);
  background: rgb(255 154 154 / 14%);
}

.danger-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.recipe-action-feedback {
  margin: 0;
  padding: 0.8rem 1rem;
  border: 1px solid rgb(255 154 154 / 30%);
  border-radius: 9px;
  background: rgb(255 154 154 / 7%);
  color: var(--color-danger);
}

.recipe-detail-card {
  overflow: hidden;
}

.recipe-detail-card-heading {
  min-height: 84px;
}

.servings-control {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.servings-control input {
  width: 76px;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background);
  color: var(--color-text);
  font: inherit;
  text-align: center;
}

.ingredient-list {
  display: grid;
  margin: 0;
  padding: 0.5rem 1.4rem;
  list-style: none;
}

.ingredient-list li {
  display: grid;
  grid-template-columns: minmax(7rem, 0.35fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgb(52 49 59 / 70%);
}

.ingredient-list li:last-child {
  border-bottom: 0;
}

.ingredient-amount {
  color: #d5acee;
  font-weight: 700;
}

.preparation-text {
  max-width: 80ch;
  margin: 0;
  padding: 1.3rem 1.4rem 1.5rem;
  color: var(--color-text-muted);
  line-height: 1.8;
  white-space: pre-line;
}

.recipe-detail-error {
  color: var(--color-danger);
}

.empty-state {
  display: grid;
  min-height: 230px;
  align-content: center;
  justify-items: start;
  gap: 0.8rem;
  padding: 1.5rem;
}

.empty-state p {
  max-width: 32ch;
  margin: 0;
  color: var(--color-text-muted);
}

.empty-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  color: #d5acee;
  font-size: 0.8rem;
  font-weight: 750;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

th,
td {
  padding: 0.8rem 0.65rem;
  border-bottom: 1px solid rgb(52 49 59 / 70%);
  white-space: nowrap;
}

th {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 650;
}

th:first-child,
td:first-child {
  padding-left: 1.2rem;
}

th:last-child,
td:last-child {
  padding-right: 1.2rem;
  text-align: right;
}

.position-cell {
  color: #d5acee;
  font-weight: 750;
}

.selected-team-row {
  background: var(--color-accent-soft);
}

.selected-team-row .position-cell {
  color: #f0d7ff;
}

.team-filter {
  position: relative;
}

#matches-panel:has(.team-filter[open]) {
  overflow: visible;
}

.team-filter summary {
  max-width: 240px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background);
  color: var(--color-text);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  list-style: none;
}

.team-filter summary::-webkit-details-marker {
  display: none;
}

.team-filter summary::after {
  margin-left: 0.7rem;
  content: "▾";
}

.team-filter[open] summary {
  border-color: #76508b;
}

.team-filter.opens-up .team-filter-menu {
  top: auto;
  bottom: calc(100% + 0.35rem);
}

.team-filter-menu {
  position: absolute;
  z-index: 2;
  top: calc(100% + 0.35rem);
  right: 0;
  display: grid;
  width: min(300px, calc(100vw - 3rem));
  max-height: min(65vh, 420px, var(--team-filter-max-height, 65vh));
  gap: 0.5rem;
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-raised);
  box-shadow: 0 12px 30px rgb(0 0 0 / 35%);
}

.team-filter-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--color-text);
  font-size: 0.8rem;
  cursor: pointer;
}

.team-filter-option input {
  margin: 0;
  accent-color: var(--color-accent);
}

.team-filter-group {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0.55rem 0.4rem 0.4rem;
  border: 0;
  border-top: 1px solid var(--color-border);
}

.team-filter-group > .team-filter-option:not(:first-child) {
  padding-left: 1.35rem;
}

.team-filter[aria-disabled="true"] summary {
  opacity: 0.55;
  pointer-events: none;
}

.match-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

.weekend-filter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.weekend-filter input {
  max-width: 150px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background);
  color: var(--color-text);
  font: inherit;
  color-scheme: dark;
}

.weekend-filter button {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background);
  color: var(--color-text-muted);
  font: inherit;
  cursor: pointer;
}

.weekend-filter button:hover {
  border-color: #76508b;
  color: var(--color-text);
}

.past-matches-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  cursor: pointer;
}

.past-matches-filter input {
  margin: 0;
  accent-color: var(--color-accent);
}

.matches-loading {
  display: flex;
  min-height: 230px;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  color: var(--color-text-muted);
}

.matches-loading p {
  margin: 0;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 3px solid var(--color-border);
  border-right-color: #d5acee;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.match-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.match-day + .match-day {
  border-top: 1px solid var(--color-border);
}

.match-day-heading {
  display: block;
  margin: 0;
  padding: 0.8rem 1.4rem;
  background: rgb(125 60 168 / 8%);
  color: #d5acee;
  font-size: 0.82rem;
  font-weight: 750;
}

.match-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: center;
  gap: 0.75rem;
  min-height: 70px;
  padding: 0.8rem 1.4rem;
  border-bottom: 1px solid rgb(52 49 59 / 70%);
}

.match-time {
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.match-fixture {
  font-weight: 650;
}

.match-time {
  text-align: right;
}

.match-result {
  color: #fff;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.025em;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.updated-at {
  margin: 1.2rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-align: right;
}

footer {
  padding: 1.5rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-align: center;
}

footer p {
  margin: 0;
}

.legal-content {
  display: grid;
  gap: 0.9rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  line-height: 1.7;
}

.legal-content h2 {
  margin: 0.8rem 0 0;
  font-size: 1.2rem;
}

.legal-content p,
.legal-content ul,
.legal-content address {
  margin: 0;
}

.legal-content ul {
  padding-left: 1.3rem;
}

.legal-content address {
  font-style: normal;
}

.legal-navigation {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.65rem;
}

.legal-navigation a {
  color: var(--color-text-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid #d5acee;
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .poker-rank {
    grid-template-columns: 2.4rem minmax(0, 1fr);
  }

  .poker-cards {
    grid-column: 2;
  }

  .etf-grid {
    grid-template-columns: 1fr;
  }

  .ingredient-editor-row {
    grid-template-columns: auto minmax(100px, 0.35fr) minmax(130px, 0.45fr) auto;
  }

  .ingredient-order-controls {
    grid-column: 1 / -1;
    justify-self: end;
    padding-bottom: 0;
  }

  .ingredient-editor-row > .form-field:first-of-type {
    grid-column: 1;
  }

  .ingredient-name-field {
    grid-column: 1 / -1;
  }

  .ingredient-editor-row .remove-ingredient-button {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  main {
    width: min(100% - 2rem, 600px);
  }
}

@media (max-width: 520px) {
  .header-top {
    min-height: 68px;
    padding: 0.8rem 1rem;
    gap: 0.5rem;
  }

  .brand {
    gap: 0.55rem;
    font-size: 0.9rem;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .local-badge {
    padding: 0.3rem 0.55rem;
    font-size: 0.75rem;
  }

  .auth-controls {
    gap: 0.35rem;
    font-size: 0.72rem;
  }

  .auth-identity {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .auth-button {
    min-height: 34px;
    padding: 0.3rem 0.55rem;
    font-size: 0.75rem;
  }

  .source-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .refresh-state {
    max-width: none;
    text-align: left;
  }

  .card-heading {
    padding: 1rem;
  }

  .poker-player-section,
  .poker-new-game,
  .poker-active-game {
    padding: 1rem;
  }

  .poker-player-form,
  .poker-deposit-form {
    align-items: stretch;
    flex-direction: column;
  }

  .poker-player-form .secondary-button,
  .poker-deposit-form .primary-button {
    width: 100%;
  }

  .poker-new-game {
    align-items: stretch;
    flex-direction: column;
  }

  .poker-active-heading {
    align-items: flex-start;
  }

  .poker-statistics {
    padding: 1rem;
  }

  .poker-dialog {
    padding: 1rem;
  }

  .poker-dialog-actions {
    flex-direction: column-reverse;
  }

  .poker-dialog-actions > * {
    width: 100%;
  }

  .poker-rank {
    gap: 0.55rem 0.7rem;
    padding: 0.8rem 0.9rem;
  }

  .poker-card {
    width: 32px;
    height: 44px;
  }

  .poker-ranking-note {
    padding: 1rem;
  }

  .recipe-page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .recipe-detail-header {
    grid-template-columns: 1fr;
  }

  .recipe-image-placeholder,
  .recipe-image-placeholder img {
    min-height: 200px;
    max-height: 260px;
  }

  .recipe-detail-intro {
    padding: 1.4rem;
  }

  .recipe-create {
    justify-items: start;
  }

  .recipe-controls {
    align-items: stretch;
    flex-direction: column;
    padding: 1rem;
  }

  .recipe-form-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .form-field-wide {
    grid-column: auto;
  }

  .category-picker,
  .ingredient-editor,
  .preparation-field {
    padding: 1rem;
  }

  .new-category-row {
    align-items: stretch;
    flex-direction: column;
  }

  .new-category-row .secondary-button {
    align-self: flex-start;
  }

  .recipe-form-section > .card-heading .secondary-button {
    font-size: 0.75rem;
  }

  .ingredient-editor-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.55rem;
  }

  .ingredient-order-controls {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .ingredient-name-field {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .ingredient-editor-row .remove-ingredient-button {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: end;
    min-height: 34px;
  }

  .recipe-form-actions {
    justify-content: stretch;
  }

  .recipe-form-actions > * {
    flex: 1;
  }

  .recipe-control select {
    width: 100%;
  }

  .recipe-list {
    padding: 1rem;
  }

  .recipe-detail-card-heading {
    align-items: flex-start;
    flex-direction: row;
    padding: 1rem;
  }

  .servings-control {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .ingredient-list {
    padding: 0.4rem 1rem;
  }

  .ingredient-list li {
    grid-template-columns: minmax(5.5rem, 0.4fr) minmax(0, 1fr);
    gap: 0.6rem;
  }

  .preparation-text {
    padding: 1rem;
  }

  .match-item {
    gap: 0.5rem;
    padding: 0.8rem 1rem;
  }

  .match-time {
    text-align: left;
  }

  .match-day-heading {
    padding: 0.8rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .loading-spinner,
  .refresh-state[data-state="loading"] .status-dot {
    animation: none;
  }
}
