:root {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: #020817;
  background: #fff;
  font-synthesis: none;
  font-size: 16px;
  line-height: 1.5;
  --accent: #0f172a;
  --line: #e2e8f0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 1.5rem;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 1rem;
}
h2 {
  font-size: 1.25rem;
}
h3 {
  font-size: 1rem;
}
header {
  background: #fff;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.1rem 3vw;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 1.2rem;
  letter-spacing: 0.09em;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}
.identity {
  margin-left: auto;
  color: #62716a;
  font-size: 0.85rem;
}
.year {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tabs {
  padding: 0 3vw;
  display: flex;
  gap: 0.25rem;
  background: white;
  border-bottom: 1px solid var(--line);
  overflow: auto;
}
.tabs a {
  padding: 1rem 0.85rem;
  text-decoration: none;
  color: #55665b;
  font-size: 0.9rem;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.tabs a.active {
  border-bottom-color: var(--accent);
  font-weight: 700;
  color: var(--accent);
}
main {
  max-width: 1450px;
  margin: auto;
  padding: 2.4rem 3vw 4rem;
}
footer {
  text-align: center;
  color: #64748b;
  padding: 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 750;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1rem 0;
  box-shadow: 0 3px 14px #172e2804;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}
.cards ul {
  padding: 0;
  list-style: none;
}
.cards li {
  margin: 0.5rem 0;
}
.deleted {
  opacity: 0.6;
}
.muted,
small {
  color: #64748b;
}
small {
  display: block;
  font-size: 0.78rem;
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
input,
select,
textarea,
button,
.button {
  font: inherit;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 0.65rem 0.85rem;
  color: inherit;
  background: white;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #94a3b8;
  outline-offset: 2px;
}
button,
.button {
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  font-weight: 650;
  line-height: 1.35;
}
button:hover,
.button:hover {
  border-color: var(--accent);
  background: #f1f5f9;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.primary:hover {
  background: #1e293b;
  color: white;
}
.danger {
  color: #a32d26;
  border-color: #dbb8b5;
}
.danger-zone {
  border-color: #dbb8b5;
}
.selected,
button.selected {
  background: #e0f2e7;
  border-color: #288860;
  color: #144f37;
}
.toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1rem 0;
}
.toolbar label {
  margin: 0;
}
.toolbar > span {
  align-self: center;
}
.inline {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}
.inline input {
  width: auto;
}
.notice,
.status:not(:empty) {
  background: #e8f3ea;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}
.error {
  background: #fbe9e6;
  color: #8b2b25;
  padding: 1rem;
}
.loading,
.empty {
  padding: 2rem;
  color: #68776d;
}
.auth {
  max-width: 470px;
  padding-top: 9vh;
}
.auth .brand {
  display: block;
  margin-bottom: 3rem;
}
.auth form {
  margin-top: 2rem;
}
.auth input {
  width: 100%;
}
.auth button {
  width: 100%;
  margin-top: 0.5rem;
}
.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
}
.table-scroll {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 1rem 0;
}
table {
  border-collapse: collapse;
  min-width: 100%;
  text-align: left;
  white-space: nowrap;
}
th {
  background: #f8fafc;
  color: #64748b;
  font-size: 0.82rem;
}
td,
th {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}
td:not(:first-child) {
  font-variant-numeric: tabular-nums;
}
tr.mine td {
  background: #eff8ef;
}
table a {
  font-weight: 650;
}
.prose {
  max-width: 900px;
}
.prose h2 {
  margin-top: 2rem;
}
.prose p {
  max-width: 75ch;
}
.bracket-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.region {
  background: white;
  border: 1px solid var(--line);
  padding: 1rem;
  border-radius: 10px;
  overflow: auto;
}
.rounds {
  display: flex;
  gap: 0.7rem;
  min-width: 580px;
}
.round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 0.45rem;
  flex: 1;
  min-width: 130px;
}
.round h3 {
  font-size: 0.72rem;
  color: #718478;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.match {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  border-radius: 5px;
  min-height: 55px;
}
.match button {
  padding: 0.35rem 0.5rem;
  font-size: 0.7rem;
  border-radius: 3px;
  text-align: left;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.match button small {
  font-size: 0.65rem;
  min-width: 12px;
}
.match button:disabled {
  opacity: 1;
  cursor: default;
}
.match button.correct {
  background: #e0f2e7;
  color: #14613c;
}
.match button.incorrect {
  background: #fbe9e6;
  color: #a34b40;
  text-decoration: line-through;
}
.pending {
  font-size: 0.75rem;
  color: #849187;
  padding: 0.5rem;
}
.payment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
}
.payment-row > div {
  margin-right: auto;
}
.payment-row label {
  margin: 0;
}
.actual-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.actual-match {
  display: flex;
  gap: 0.3rem;
  align-items: end;
  margin-bottom: 1rem;
}
.actual-match label {
  margin: 0;
  min-width: 0;
  flex: 1;
}
.actual-match select {
  max-width: 100%;
  font-size: 0.8rem;
}
.actual-match button {
  font-size: 0.75rem;
}
details summary {
  cursor: pointer;
  font-weight: 650;
}
details[open] summary {
  margin-bottom: 1rem;
}
code {
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  header {
    gap: 0.8rem;
    flex-wrap: wrap;
  }
  .identity {
    display: none;
  }
  .bracket-grid {
    grid-template-columns: 1fr;
  }
  .actual-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 550px) {
  main {
    padding: 1.6rem 4vw;
  }
  .heading {
    display: block;
  }
  .heading .button {
    margin-bottom: 1rem;
  }
  .tabs a {
    padding: 0.85rem 0.6rem;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .actual-grid {
    grid-template-columns: 1fr;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar label {
    width: 100%;
  }
  .year {
    margin-bottom: 0;
  }
  .auth {
    padding-top: 5vh;
  }
}

/* Retained dashboard shell: 64px header, 224px sidebar and 1024px content. */
.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  padding: 0 16px;
  justify-content: space-between;
  flex-wrap: nowrap;
}
.dashboard-header .year {
  margin: 0;
}
.dashboard-header select {
  width: 180px;
  height: 36px;
  padding: 6px 12px;
  font-size: 14px;
}
.identity {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  color: #64748b;
  font-size: 14px;
  min-width: 0;
}
.identity > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.identity button {
  white-space: nowrap;
}
.dashboard-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}
.dashboard-sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  width: 224px;
  flex: 0 0 224px;
  border-right: 1px solid var(--line);
  background: #fff;
}
.dashboard-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
}
.dashboard-sidebar a,
.nav-disabled {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  text-decoration: none;
  color: #64748b;
}
.dashboard-sidebar a:hover {
  background: #f8fafc;
}
.dashboard-sidebar a.active {
  background: #f1f5f9;
  color: #020817;
  font-weight: 500;
}
.nav-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.dashboard-main {
  flex: 1;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 24px;
}
.page-content {
  max-width: 1024px;
  margin: 0 auto;
}
.heading h1 {
  margin-bottom: 4px;
}
.heading p {
  font-size: 14px;
}
.heading > span {
  font-size: 14px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.my-brackets th {
  font-size: 16px;
  font-weight: 500;
}
.my-brackets td {
  font-size: 16px;
}
.my-brackets a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}
.my-brackets a:hover {
  text-decoration: underline;
}
.region-e {
  background: #eff6ff;
  color: #1d4ed8;
}
.region-w {
  background: #f0fdf4;
  color: #15803d;
}
.region-s {
  background: #fff7ed;
  color: #c2410c;
}
.region-m {
  background: #faf5ff;
  color: #7e22ce;
}
td.correct {
  background: #dcfce7;
}
td.incorrect {
  background: #fee2e2;
}
.empty {
  text-align: center;
}
@media (max-width: 767px) {
  .dashboard-header {
    gap: 8px;
  }
  .identity {
    display: flex;
    gap: 8px;
  }
  .identity > span {
    max-width: 100px;
  }
  .dashboard-layout {
    flex-direction: column;
  }
  .dashboard-sidebar {
    position: static;
    height: auto;
    width: 100%;
    flex: 0 0 auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .dashboard-sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
  }
  .dashboard-sidebar a,
  .nav-disabled {
    padding: 8px 12px;
    gap: 8px;
  }
  .dashboard-main {
    padding: 24px 16px;
  }
}
@media print {
  .dashboard-header,
  .dashboard-sidebar,
  .toolbar,
  .no-print,
  footer {
    display: none !important;
  }
  .dashboard-main {
    padding: 0;
  }
  .dashboard-layout {
    display: block;
  }
  .table-scroll {
    overflow: visible;
  }
}
.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  margin: 16px 0;
  background: #f1f5f9;
  border-radius: 6px;
}
.section-tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  white-space: nowrap;
}
.section-tabs button.selected {
  background: white;
  color: #0f172a;
  box-shadow: 0 1px 3px #0002;
}
.prize-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: linear-gradient(90deg, #f5f3ff, #f0f9ff);
}
.prize-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  font-size: 14px;
}
.prize-panel a {
  font-size: 14px;
}
.table-search {
  max-width: 320px;
}
.sort {
  border: 0;
  background: transparent;
  padding: 4px;
  font-size: 14px;
  font-weight: 500;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}
.account-bracket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.badge {
  border-radius: 12px;
  padding: 2px 8px;
  background: #f1f5f9;
  font-size: 12px;
}
.proposed-winners {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.winner-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
}
.winner-card strong {
  font-size: 11px;
  text-transform: uppercase;
}
.winner-card p {
  font-size: 14px;
  margin: 8px 0 0;
  color: #0f172a;
}
.bracket-grid {
  display: block;
}
.region-hidden {
  display: none;
}
.rounds {
  min-width: 900px;
}
.round {
  min-width: 190px;
}
.match button {
  font-size: 14px;
  min-height: 32px;
}
.bracket-grid.printable {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.bracket-grid.printable .rounds {
  min-width: 0;
  gap: 4px;
}
.bracket-grid.printable .round {
  min-width: 0;
}
.bracket-grid.printable .match button {
  font-size: 10px;
  padding: 3px;
  gap: 2px;
  overflow-wrap: anywhere;
}
[hidden] {
  display: none !important;
}
@media (max-width: 767px) {
  .proposed-winners {
    grid-template-columns: 1fr 1fr;
  }
  .prize-columns {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .bracket-grid.printable {
    display: block;
  }
}
@media print {
  .region-hidden {
    display: block;
  }
  .bracket-grid {
    display: block;
  }
  .region {
    break-inside: avoid;
    margin-bottom: 16px;
  }
  .rounds {
    min-width: 0;
  }
  .round {
    min-width: 0;
  }
  .match button {
    display: flex !important;
    font-size: 10px;
  }
}

.scoring-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 24px 0;
}
.scoring-overview > section {
  min-width: 0;
}
.scoring-overview td,
.scoring-overview th {
  padding: 4px 8px;
  font-size: 14px;
}
@media (max-width: 900px) {
  .scoring-overview {
    grid-template-columns: 1fr;
  }
}
.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.payment-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.payment-actions button {
  flex: 1;
  background: #059669;
}
@media (max-width: 767px) {
  .payment-options {
    grid-template-columns: 1fr;
  }
  .payment-actions {
    flex-direction: column;
  }
}
tr.payment-row {
  display: table-row;
}
.payment-row td {
  vertical-align: top;
}
.payment-row select {
  min-width: 110px;
}
.payment-row input {
  min-width: 160px;
}

@media print {
  .pool-dues {
    display: none;
  }
  .bracket-grid.printable .region {
    overflow: visible;
  }
}

.bracket-grid.printable .match button small {
  flex: 0 0 14px;
  white-space: nowrap;
}
