:root {
  color-scheme: light;
  --ink: #162025;
  --muted: #657179;
  --line: #d9e0e2;
  --paper: #f6f8f7;
  --panel: #ffffff;
  --green: #1f6f4a;
  --blue: #235c9f;
  --gold: #c9962f;
  --red: #b54a3a;
  --shadow: 0 14px 40px rgba(29, 41, 47, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px 1fr;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sidebar {
  min-height: 100vh;
  padding: 22px 18px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.1;
}

.brand p,
.source,
.eyebrow,
.panel-head span,
.meta,
.notes,
td span {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
  margin: 22px 0;
}

button,
input,
select {
  font: inherit;
}

.nav-button {
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.nav-button.active,
.nav-button:hover {
  background: #e8f1ec;
  color: var(--green);
  font-weight: 700;
}

.filters {
  display: grid;
  gap: 14px;
}

.mobile-filter-toggle {
  display: none;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 800;
}

h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  margin-top: 6px;
}

.source {
  display: grid;
  gap: 8px;
  justify-items: end;
  font-size: 13px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.utility-button,
.save-button,
.edit-button,
.icon-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.utility-button:hover,
.edit-button:hover,
.icon-button:hover {
  border-color: var(--green);
  color: var(--green);
}

.utility-note {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.utility-button.ghost {
  color: var(--muted);
}

.save-button {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metrics-grid.expanded {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.metric,
.panel,
.table-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 112px;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.metric span,
.metric small {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 34px;
  line-height: 1;
}

.metric.good {
  border-color: rgba(31, 111, 74, 0.35);
}

.metric.warn {
  border-color: rgba(181, 74, 58, 0.35);
}

.metric.warn strong {
  color: var(--red);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 18px;
}

.dashboard-grid.rich {
  grid-template-columns: 1.35fr 0.9fr 0.9fr;
}

.wide {
  grid-row: span 2;
}

.ranking-panel {
  grid-column: span 2;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h3 {
  font-size: 18px;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 48px 1fr 34px;
  gap: 10px;
  align-items: center;
  min-height: 28px;
}

.bar-row span {
  font-weight: 700;
}

.track {
  height: 12px;
  background: #edf1f2;
  border-radius: 999px;
  overflow: hidden;
}

.track i {
  display: block;
  height: 100%;
  background: var(--green);
}

.compact .track i {
  background: var(--blue);
}

.mini-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.mini-list div {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.mini-list span {
  color: var(--muted);
  font-size: 13px;
}

.age-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}

.age-column {
  min-height: 260px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.age-column header {
  min-height: 74px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: #eef5f1;
  border-bottom: 1px solid var(--line);
}

.age-column header h3 {
  font-size: 24px;
}

.age-column header span {
  color: var(--muted);
  font-size: 12px;
}

.age-column header strong {
  min-width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
}

.column-list {
  display: grid;
  gap: 0;
}

.player-card {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.player-card.edited,
tr.edited {
  outline: 2px solid rgba(201, 150, 47, 0.42);
  outline-offset: -2px;
}

.avatar-wrap,
.avatar,
.avatar-fallback {
  width: 52px;
  height: 52px;
  border-radius: 8px;
}

.avatar {
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: #dce8ee;
  color: #28566a;
  font-weight: 800;
}

.player-info {
  min-width: 0;
}

.player-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.player-head h3 {
  min-width: 0;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff4d8;
  color: #7c530c;
  font-size: 12px;
  font-weight: 800;
}

.score-pill.empty {
  background: #eef1f2;
  color: var(--muted);
}

.edit-button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.edit-button.inline {
  justify-self: start;
  margin-top: 4px;
}

.meta,
.team,
.notes {
  margin-top: 4px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.team {
  font-weight: 700;
}

.team-tag,
.cell-chip,
.ranking-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  margin-top: 5px;
  max-width: 100%;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ranking-chip {
  min-width: 34px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.team-tag {
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.status-badge {
  display: inline-grid;
  place-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 2px 7px;
  margin-left: 5px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(20, 30, 34, 0.14);
  color: #172027;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  vertical-align: middle;
}

.status-badge.inactive {
  background: #6f7780;
  color: #fff;
}

.status-badge.college {
  background: #f7f1e3;
  color: #514421;
}

.status-badge.outside {
  background: #e8e1f5;
  color: #3f2f68;
}

.team-rank-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  min-width: 0;
}

.team-rank-line .team-tag {
  min-width: 0;
  margin-top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-rank-line .ranking-chip {
  flex: 0 0 auto;
  margin-top: 0;
}

.table-panel {
  overflow: auto;
}

.roster-toolbar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.roster-toolbar label {
  width: min(320px, 100%);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  background: #fff;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  background: #eef5f1;
  color: #274135;
}

td:first-child {
  min-width: 210px;
}

td span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}

td .cell-chip {
  margin-top: 0;
  display: inline-block;
  font-size: 12px;
}

td .ranking-chip {
  margin-top: 0;
}

.ranking-table-wrap {
  max-height: 420px;
  overflow: auto;
}

.ranking-table {
  min-width: 620px;
}

.ranking-table th,
.ranking-table td {
  padding: 10px 12px;
}

.ranking-table td {
  vertical-align: middle;
}

.ranking-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.avg-pill {
  min-width: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef1f2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.avg-pill.excellent {
  background: #1f6f4a;
  color: #fff;
}

.avg-pill.good {
  background: #9dcf8a;
  color: #172027;
}

.avg-pill.watch {
  background: #f2c66d;
  color: #172027;
}

.avg-pill.risk {
  background: #b54a3a;
  color: #fff;
}

.roster-age-row td {
  background: #274135;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  padding: 10px 14px;
}

.roster-section-row td {
  background: #162025;
  color: #fff;
  font-size: 17px;
  font-weight: 950;
  padding: 12px 14px;
}

.roster-section-row span {
  display: inline-block;
  margin-left: 10px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 800;
}

.roster-age-row span {
  display: inline-block;
  margin-left: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.roster-gender-row td {
  background: #f1f5f2;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  padding: 8px 14px;
  text-transform: uppercase;
}

.roster-gender-row span {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted);
}

.alerts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
}

.structure-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 6px 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.segmented button.active {
  background: var(--green);
  color: #fff;
}

.card-groups {
  display: grid;
  gap: 18px;
}

.empty-panel,
.outside-structure {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.empty-panel {
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
}

.outside-structure {
  margin-top: 18px;
  overflow: hidden;
}

.outside-structure > header {
  min-height: 72px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #162025;
  color: #fff;
}

.outside-structure h3,
.outside-structure p,
.outside-group h4 {
  margin: 0;
}

.outside-structure p {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.outside-structure > header strong {
  min-width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #162025;
}

.outside-groups {
  display: grid;
  gap: 0;
}

.outside-group + .outside-group {
  border-top: 1px solid var(--line);
}

.outside-group h4 {
  padding: 10px 14px;
  background: #f1f4f5;
  color: #38464e;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.card-group {
  display: grid;
  gap: 12px;
}

.card-group header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-group header h3 {
  font-size: 26px;
}

.card-group header span {
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.gender-card-section {
  display: grid;
  gap: 10px;
  padding-top: 6px;
}

.gender-card-section + .gender-card-section {
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(22, 32, 37, 0.12);
}

.gender-card-section h4 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.panini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.panini-card {
  position: relative;
  min-height: 306px;
  border: 4px solid var(--team-color, rgba(20, 30, 34, 0.16));
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(29, 41, 47, 0.14);
  background: var(--gender-color, #fff);
}

.panini-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  pointer-events: none;
}

.panini-photo {
  height: 178px;
  margin: 10px 10px 0;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.5);
}

.panini-photo img,
.panini-fallback {
  width: 100%;
  height: 100%;
}

.panini-photo img {
  display: block;
  object-fit: cover;
}

.panini-fallback {
  display: grid;
  place-items: center;
  color: #28566a;
  font-size: 42px;
  font-weight: 900;
}

.panini-body {
  position: relative;
  padding: 12px 14px 14px;
}

.panini-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.panini-topline > span,
.panini-topline .ranking-chip {
  min-width: 38px;
  min-height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 4px 8px;
  font-weight: 900;
}

.panini-card h3 {
  font-size: 18px;
  line-height: 1.12;
}

.panini-card small {
  display: block;
  margin-top: 8px;
  color: rgba(22, 32, 37, 0.72);
  font-weight: 700;
}

.panini-edit {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.timeline-board {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 8px 0 24px;
}

.timeline-board::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #274135;
}

.timeline-age {
  position: relative;
  display: grid;
  gap: 12px;
  align-items: start;
  padding: 14px 0 18px;
  border-top: 1px solid rgba(22, 32, 37, 0.12);
}

.timeline-age::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 0;
  top: 0;
  height: 1px;
  transform: translateX(-50%);
  background: rgba(22, 32, 37, 0.08);
}

.timeline-age-head {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 92px;
  min-height: 64px;
  border: 4px solid var(--paper);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.timeline-age-head span {
  font-size: 22px;
  font-weight: 900;
}

.timeline-age-head small {
  font-size: 11px;
  font-weight: 800;
}

.timeline-lanes {
  display: grid;
  gap: 8px;
}

.timeline-lane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 74px;
}

.timeline-rank {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.timeline-rank span {
  min-width: 112px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.timeline-side {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.timeline-left {
  justify-content: flex-end;
}

.timeline-right {
  justify-content: flex-start;
}

.timeline-player {
  width: min(240px, 48%);
  min-height: 76px;
  border: 1px solid rgba(20, 30, 34, 0.18);
  border-radius: 8px;
  padding: 6px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(29, 41, 47, 0.11);
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  overflow: hidden;
}

.timeline-avatar,
.timeline-avatar img,
.timeline-avatar i {
  width: 46px;
  height: 58px;
  border-radius: 6px;
}

.timeline-avatar {
  display: block;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.56);
}

.timeline-avatar img {
  display: block;
  object-fit: cover;
}

.timeline-avatar i {
  display: grid;
  place-items: center;
  font-style: normal;
  font-weight: 900;
}

.timeline-copy {
  min-width: 0;
}

.timeline-ranking {
  display: grid;
  place-items: center;
  min-width: 40px;
  padding-right: 2px;
}

.timeline-ranking .ranking-chip {
  margin: 0;
}

.timeline-player strong,
.timeline-player em,
.timeline-player small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-player strong {
  font-size: 13px;
}

.timeline-player em,
.timeline-player small {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.82;
  font-style: normal;
}

.timeline-level {
  opacity: 0.95 !important;
  text-transform: uppercase;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 16px;
  align-items: center;
}

.donut {
  width: 118px;
  height: 118px;
  transform: rotate(-90deg);
  border-radius: 50%;
}

.legend {
  display: grid;
  gap: 8px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.legend i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.edit-dialog {
  width: min(820px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.edit-dialog::backdrop {
  background: rgba(22, 32, 37, 0.42);
}

.edit-dialog form {
  padding: 20px;
}

.edit-dialog header,
.edit-dialog footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.edit-dialog header {
  margin-bottom: 18px;
}

.edit-dialog footer {
  margin-top: 18px;
}

.edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.edit-grid .full {
  grid-column: 1 / -1;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  resize: vertical;
  font: inherit;
}

.view-only .edit-button,
.view-only .panini-edit,
.view-only .utility-button,
.view-only .top-actions a,
.view-only .edit-dialog {
  display: none !important;
}

@media (max-width: 980px) {
  body {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: auto;
    padding: 10px 12px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(29, 41, 47, 0.08);
  }

  .brand {
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 0;
  }

  .mark {
    width: 38px;
    height: 38px;
  }

  h1 {
    font-size: 16px;
  }

  .brand p {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-button {
    min-height: 38px;
    padding: 8px 6px;
    text-align: center;
    white-space: nowrap;
    font-size: 13px;
  }

  .mobile-filter-toggle {
    width: 100%;
    min-height: 38px;
    display: block;
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--green);
    cursor: pointer;
    font-weight: 900;
  }

  .filters {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
  }

  .mobile-filters-open .filters {
    display: grid;
  }

  label {
    gap: 4px;
    font-size: 12px;
  }

  input,
  select {
    min-height: 38px;
    padding: 7px 9px;
  }

  .main {
    padding: 14px 12px 22px;
  }

  .metrics-grid,
  .dashboard-grid,
  .alerts-grid {
    grid-template-columns: 1fr;
  }

  .ranking-panel {
    grid-column: auto;
  }

  .metrics-grid.expanded {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric {
    min-height: 92px;
    padding: 12px;
  }

  .metric strong {
    font-size: 28px;
  }

  .topbar {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
  }

  h2 {
    font-size: 30px;
  }

  .source {
    justify-items: start;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .edit-grid {
    grid-template-columns: 1fr;
  }

  .structure-toolbar {
    justify-content: flex-start;
    overflow-x: auto;
    margin-bottom: 12px;
  }

  .segmented {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .segmented button {
    padding: 6px 7px;
    font-size: 12px;
  }

  .age-board {
    grid-template-columns: 1fr;
  }

  .age-column header h3,
  .card-group header h3 {
    font-size: 22px;
  }

  .panini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .panini-card {
    min-height: 250px;
    border-width: 3px;
  }

  .panini-photo {
    height: 132px;
    margin: 8px 8px 0;
  }

  .panini-body {
    padding: 10px;
  }

  .panini-card h3 {
    font-size: 15px;
  }

  .panini-card small {
    font-size: 11px;
  }

  .roster-toolbar {
    justify-content: stretch;
    gap: 8px;
  }

  .roster-toolbar label {
    width: 100%;
  }

  .table-panel {
    margin-inline: -12px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .timeline-board::before {
    left: 46px;
  }

  .timeline-age {
    padding-left: 72px;
  }

  .timeline-age::after {
    left: 46px;
    transform: none;
  }

  .timeline-lane {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(22, 32, 37, 0.08);
  }

  .timeline-rank {
    justify-content: start;
    place-items: start;
  }

  .timeline-age-head {
    position: absolute;
    left: 0;
    width: 76px;
  }

  .timeline-left,
  .timeline-right {
    justify-content: flex-start;
  }

  .timeline-player {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .filters {
    grid-template-columns: 1fr;
  }

  .metrics-grid.expanded {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid.rich {
    gap: 12px;
  }

  .panel,
  .metric {
    box-shadow: 0 8px 22px rgba(29, 41, 47, 0.08);
  }

  .panel {
    padding: 14px;
  }

  .panel-head {
    align-items: flex-start;
  }

  .bar-row {
    grid-template-columns: 42px 1fr 30px;
    gap: 8px;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
  }

  .panini-grid {
    grid-template-columns: 1fr;
  }

  .timeline-age {
    padding-left: 58px;
  }

  .timeline-age-head {
    width: 64px;
    min-height: 56px;
  }

  .timeline-age-head span {
    font-size: 17px;
  }

  .timeline-lane {
    gap: 6px;
  }

  .timeline-player {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .timeline-avatar,
  .timeline-avatar img,
  .timeline-avatar i {
    width: 42px;
    height: 50px;
  }
}
