:root {
  --habs-blue: #001e62;
  --habs-red: #af1e2d;
  --habs-pale-blue: #eef3fa;
  --habs-border: #c8d0dc;
  --habs-warning: #8a5700;
  --habs-danger: #8f1724;
  --habs-success: #17633a;
  --focus: #ffbf47;
  --sticky-game-width: 12rem;
}
html, body { max-width: 100%; }
body, main, main > * { min-width: 0; }
.bg-habs { background: linear-gradient(110deg, var(--habs-blue), #003b7a); }
.app-nav { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.app-nav-links { display: flex; flex-direction: row; flex-wrap: wrap; gap: .25rem; }
.season-switcher { display: flex; align-items: center; gap: .3rem; }
.season-switcher label { color: #fff; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.season-switcher select { width: auto; min-width: 8.5rem; }
a { color: #0057a8; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus) !important;
  outline-offset: 2px;
}
.game-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.game-grid .card { transition: transform .15s ease, box-shadow .15s ease; }
.game-grid .card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.1); }
form p label { display: block; font-weight: 600; margin-bottom: .25rem; }
form p input:not([type=checkbox]), form p select, form p textarea {
  display: block; width: 100%; padding: .5rem .75rem; border: 1px solid #adb5bd; border-radius: .375rem;
}
.errorlist { color: #b02a37; font-weight: 600; }
.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-bottom: .6rem;
}
.page-heading h1 { margin: 0; color: var(--habs-blue); font-size: 1.45rem; font-weight: 750; }
.page-heading p { margin: 0; color: #5d6673; font-size: .85rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .25rem; }
.season-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--habs-border);
  border-top: 3px solid var(--habs-red);
  background: #fff;
  margin-bottom: .45rem;
}
.season-summary > div {
  display: flex;
  flex-direction: column;
  padding: .4rem .55rem;
  border-right: 1px solid var(--habs-border);
  border-bottom: 1px solid var(--habs-border);
}
.season-summary span { color: #5d6673; font-size: .72rem; text-transform: uppercase; letter-spacing: .025em; }
.season-summary strong { color: var(--habs-blue); font-size: 1rem; line-height: 1.25; }
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .35rem .75rem;
  padding: .3rem .5rem;
  background: var(--habs-pale-blue);
  border: 1px solid var(--habs-border);
}
.target-meter { color: var(--habs-blue); font-size: .86rem; }
.target-meter-row, .allocation-block { min-width: 0; }
.allocation-block { display: contents; }
.allocation-heading { display: none; }
.allocation-inline { display: flex; flex-wrap: wrap; gap: .25rem .7rem; font-size: .75rem; }
.dense-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .35rem;
  padding: .4rem .5rem;
  margin-bottom: .25rem;
  border: 1px solid var(--habs-border);
  border-top: 0;
  background: #f8f9fb;
}
.dense-filters > div:not(.filter-check) { min-width: 8.5rem; }
.dense-filters label { display: block; margin-bottom: .08rem; font-size: .7rem; font-weight: 700; color: #3e4650; }
.dense-filters .filter-check { min-height: 2rem; padding-top: 1rem; margin-left: .25rem; }
.dense-filters .filter-check label { display: inline; font-size: .8rem; }
.season-table-scroll {
  position: relative;
  width: 100%;
  overflow: visible;
  border: 1px solid var(--habs-border);
  background: #fff;
}
.season-table-scroll:focus-visible { outline-offset: 2px; }
.season-table {
  width: 100%;
  min-width: 0;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: .76rem;
  line-height: 1.2;
}
.season-table .game-column { width: 20%; }
.season-table .seat-column { width: 13%; }
.season-table .details-column { width: 20%; }
.season-table .actions-column { width: 34%; }
.season-table th,
.season-table td {
  min-width: 0;
  max-width: none;
  padding: .28rem .35rem;
  vertical-align: middle;
  border-right: 1px solid var(--habs-border);
  border-bottom: 1px solid var(--habs-border);
  overflow-wrap: anywhere;
}
.season-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  color: #fff;
  background: var(--habs-blue);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .025em;
  white-space: nowrap;
}
.season-table tbody tr:nth-child(even) td { background: #f6f8fb; }
.season-table tbody tr:hover td { background: #fff8e6; }
.season-table .sticky-game-col {
  position: sticky;
  left: 0;
  z-index: 3;
  width: var(--sticky-game-width);
  min-width: var(--sticky-game-width);
  max-width: var(--sticky-game-width);
  background: #fff;
  box-shadow: 2px 0 0 var(--habs-border);
}
.season-table thead .sticky-game-col { z-index: 6; background: var(--habs-blue); }
.season-table tbody tr:nth-child(even) .sticky-game-col { background: #f6f8fb; }
.season-table tbody tr:hover .sticky-game-col { background: #fff8e6; }
.season-table tr:target td { background: #fff1bf; }
.season-table tr:target .sticky-game-col { background: #fff1bf; }
.season-table tr { scroll-margin-top: 2.2rem; }
.season-table input:not([type="checkbox"]),
.season-table select,
.season-table textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 1.8rem;
  padding: .16rem .28rem;
  border-color: #98a3b1;
  border-radius: .2rem;
  font-size: .75rem;
}
.season-table input[type="checkbox"] { width: 1.05rem; height: 1.05rem; }
.season-table label { font-weight: 650; margin-top: .2rem; margin-bottom: .05rem; }
.game-date-display {
  display: block;
  margin-bottom: .2rem;
  color: var(--bs-secondary-color);
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
.game-opponent { display: block; color: var(--habs-blue); font-size: .82rem; }
.game-type-label { display: block; margin-top: .2rem; color: #4d5662; font-weight: 750; }
.mobile-cell-label { display: none; }
.compact-list { display: flex; flex-wrap: wrap; gap: .15rem; padding: 0; margin: 0; list-style: none; }
.status-badge {
  display: inline-block;
  width: fit-content;
  padding: .12rem .3rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 750;
  line-height: 1.15;
}
.status-good { color: var(--habs-success); background: #e7f5ed; border-color: #9fcab1; }
.status-warning { color: var(--habs-warning); background: #fff3cd; border-color: #e8cc73; }
.status-danger { color: var(--habs-danger); background: #f8d7da; border-color: #dc9299; }
.status-neutral { color: #45505d; background: #edf0f3; border-color: #bdc5ce; }
.muted-dash { color: #6b7280; }
.details-cell { min-width: 0; color: #4d5662; }
.details-list { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; min-width: 0; }
.sale-line { display: flex; flex-wrap: wrap; align-items: center; gap: .12rem .3rem; }
.compact-link { display: block; margin-top: .25rem; font-weight: 650; }
.neighbor-summary, .unavailable-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .3rem; }
.notes-summary { min-width: 0; overflow-wrap: anywhere; }
.action-cell { min-width: 0; padding: .2rem !important; text-align: center; }
.row-actions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; gap: .2rem; white-space: normal; }
.row-actions .btn { display: flex; align-items: center; justify-content: center; width: 100%; min-width: 0; min-height: 2rem; padding: .25rem .15rem; font-size: .7rem; white-space: nowrap; }
.row-actions small { display: block; flex-basis: 100%; max-width: none; white-space: normal; color: #5d6673; }
.row-error td { border-top: 2px solid var(--habs-danger); border-bottom-color: var(--habs-danger); }
.row-message { padding: .3rem; margin-bottom: .25rem; color: #721c24; background: #f8d7da; border: 1px solid #dc9299; }
.row-message .errorlist { padding-left: 1rem; margin: 0; }
.season-table .errorlist { margin: .08rem 0; padding-left: 1rem; font-size: .68rem; }
.detail-sections {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .85rem;
}
.detail-sections .card { border-color: var(--habs-border); }
.detail-sections .card-body { padding: 1rem; }
.detail-metadata {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .45rem .8rem;
  margin: 0;
}
.detail-metadata div { min-width: 0; }
.detail-metadata dt { color: #5d6673; font-size: .72rem; text-transform: uppercase; }
.detail-metadata dd { margin: 0; overflow-wrap: anywhere; }
.detail-subform { padding: .65rem; border: 1px solid var(--habs-border); border-radius: .35rem; background: #f8f9fb; }
.availability-summary { display: flex; flex-wrap: wrap; gap: .35rem 1rem; padding: 0; list-style: none; }
.detail-status-card { height: 100%; padding: .65rem; border: 1px solid var(--habs-border); border-radius: .35rem; background: #f8f9fb; }
.detail-status-card p { margin-bottom: .35rem; }
.detail-entry-form, .compact-detail-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .35rem .75rem;
}
.detail-entry-form p, .compact-detail-form p { margin: 0; }
.detail-entry-form button, .compact-detail-form button { align-self: end; justify-self: start; }
@media (max-width: 991.98px) {
  .app-nav { width: 100%; flex-direction: column; align-items: stretch; margin-left: 0; }
  .app-nav-links { width: 100%; }
  .app-nav form button { width: 100%; }
  .app-nav .season-switcher { flex-wrap: wrap; }
  .app-nav .season-switcher select { flex: 1 1 9rem; width: auto; }
  .app-nav .season-switcher button { width: auto; }
}
@media (min-width: 768px) {
  .season-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .season-summary > div { border-bottom: 0; }
  .detail-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-wide { grid-column: 1 / -1; }
}
@media (max-width: 767.98px) {
  .page-heading { align-items: stretch; }
  .page-heading > div, .page-actions { min-width: 0; width: 100%; }
  .page-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-actions .btn { min-width: 0; min-height: 2.75rem; display: flex; align-items: center; justify-content: center; }
  .season-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    margin-bottom: .65rem;
    border-radius: .5rem;
  }
  .season-summary > div {
    min-width: 0;
    min-height: 4.25rem;
    justify-content: center;
    padding: .65rem .7rem;
    border: 0;
    overflow-wrap: anywhere;
  }
  .season-summary > div:nth-child(odd) { border-right: 1px solid var(--habs-border); }
  .season-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--habs-border); }
  .season-summary span { line-height: 1.25; }
  .season-summary strong { margin-top: .18rem; line-height: 1.25; }
  .table-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border-radius: .5rem .5rem 0 0;
  }
  .target-meter-row { padding: .65rem .7rem; }
  .target-meter { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
  .allocation-block {
    display: block;
    min-width: 0;
    border-top: 1px solid var(--habs-border);
    background: #fff;
  }
  .allocation-heading {
    display: block;
    padding: .42rem .7rem;
    color: #526071;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.2;
    text-transform: uppercase;
  }
  .allocation-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid #e2e7ee;
  }
  .allocation-owner {
    min-width: 0;
    padding: .5rem .7rem;
    overflow-wrap: anywhere;
  }
  .allocation-owner:nth-child(odd) { border-right: 1px solid #e2e7ee; }
  .allocation-owner:nth-child(n+3) { border-top: 1px solid #e2e7ee; }
  .dense-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: .5rem;
    padding: .65rem;
    margin-bottom: .4rem;
    border-top: 0;
    border-radius: 0 0 .5rem .5rem;
  }
  .dense-filters .filter-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: .4rem .5rem .5rem;
    border: 1px solid #d5dbe3;
    border-radius: .4rem;
    background: #fff;
  }
  .dense-filters label,
  .dense-filters .filter-field-label {
    display: block;
    min-height: 1rem;
    margin: 0 0 .3rem;
    color: #3e4650;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1.3;
  }
  .dense-filters .filter-check { min-width: 0; min-height: 0; padding: .4rem .5rem .5rem; margin-left: 0; }
  .dense-filters .filter-check .form-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.75rem;
    padding-left: 0;
    margin: 0;
  }
  .dense-filters .filter-check .form-check-input {
    position: static;
    float: none;
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
  }
  .dense-filters .filter-check .form-check-label {
    min-height: 0;
    margin: 0;
    font-size: .9rem;
    line-height: 1.25;
  }
  .dense-filters select, .dense-filters .btn {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 2.75rem;
  }
  .season-table-scroll {
    width: 100%;
    min-width: 0;
    overflow: visible;
    border: 0;
    background: transparent;
  }
  .season-table {
    display: block;
    width: 100%;
    min-width: 0;
    table-layout: auto;
    font-size: .82rem;
  }
  .season-table colgroup { display: none; }
  .season-table thead {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .season-table thead tr {
    display: block;
    width: 1px;
    height: 1px;
  }
  .season-table thead th,
  .season-table thead .sticky-game-col {
    position: absolute;
    width: 1px;
    min-width: 1px;
    max-width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .season-table tbody { display: grid; gap: .75rem; width: 100%; min-width: 0; }
  .season-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    border: 1px solid var(--habs-border);
    border-top: 3px solid var(--habs-blue);
    border-radius: .6rem;
    background: #fff;
    box-shadow: 0 .18rem .45rem rgba(0, 30, 98, .09);
  }
  .season-table th,
  .season-table td,
  .season-table .sticky-game-col {
    position: static;
    inset: auto;
    width: auto;
    min-width: 0;
    max-width: none;
    box-shadow: none;
  }
  .season-table tbody tr:nth-child(even) td,
  .season-table tbody tr:hover td,
  .season-table tbody tr:target td,
  .season-table tbody tr:nth-child(even) .sticky-game-col,
  .season-table tbody tr:hover .sticky-game-col,
  .season-table tbody tr:target .sticky-game-col {
    background: transparent;
  }
  .season-table td {
    padding: .65rem .7rem;
    border-right: 0;
    border-bottom: 0;
    vertical-align: top;
    overflow-wrap: anywhere;
  }
  .season-table .game-cell {
    grid-column: 1 / -1;
  }
  .season-table .seat-cell,
  .season-table .details-cell,
  .season-table .action-cell { border-top: 1px solid #e2e7ee; }
  .season-table .seat-cell,
  .season-table .action-cell { background: #f8fafc; }
  .season-table .row-error {
    border-color: var(--habs-danger);
    border-top-color: var(--habs-danger);
  }
  .season-table .row-error td {
    border-top: 0;
    border-bottom: 0;
  }
  .season-table .row-error .seat-cell,
  .season-table .row-error .details-cell,
  .season-table .row-error .action-cell { border-top: 1px solid #e2e7ee; }
  .season-table .details-cell,
  .season-table .action-cell {
    grid-column: 1 / -1;
  }
  .season-table .details-empty { display: none; }
  .mobile-cell-label {
    display: block;
    min-height: .85rem;
    margin-bottom: .45rem;
    color: #526071;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.2;
    text-transform: uppercase;
  }
  .game-date-display { white-space: normal; }
  .game-opponent { font-size: 1rem; overflow-wrap: anywhere; }
  .season-table input:not([type="checkbox"]),
  .season-table select,
  .season-table textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 2.75rem;
    padding: .45rem .55rem;
    font-size: 1rem;
  }
  .season-table input[type="checkbox"] { width: 1.35rem; height: 1.35rem; }
  .season-table .details-list { line-height: 1.35; gap: .45rem; }
  .status-badge, .sale-line, .neighbor-summary, .row-message, .season-table .errorlist {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .compact-link {
    display: flex;
    align-items: center;
    width: fit-content;
    min-height: 2.75rem;
    padding: .4rem 0;
  }
  .row-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    gap: .45rem;
  }
  .row-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    padding: .5rem .3rem;
    font-size: .8rem;
    white-space: normal;
  }
  .row-actions small { grid-column: 1 / -1; max-width: 100%; }
  .season-table .empty-table-row td { grid-column: 1 / -1; }
}
@media (max-width: 575.98px) {
  .page-actions .btn { flex: 1 1 auto; }
  .detail-entry-form, .compact-detail-form { grid-template-columns: 1fr; }
  .detail-metadata { grid-template-columns: 1fr; }
}
@media (max-width: 374.98px) {
  .dense-filters { gap: .4rem; padding: .5rem; }
  .dense-filters .filter-field { padding-inline: .4rem; }
  .season-table td { padding-inline: .6rem; }
}
@media (min-width: 768px) { .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
