:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #eef6f2;
  --text: #111827;
  --muted: #64748b;
  --line: #dbe4e8;
  --primary: #0f766e;
  --primary-2: #115e59;
  --accent: #f59e0b;
  --danger: #b91c1c;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --bottom-nav-height: 78px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.file-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  font-weight: 700;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.32);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.45;
}

button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.button-link {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: white;
  padding: 0 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.button-link:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.32);
  outline-offset: 2px;
}

button.danger {
  color: var(--danger);
  border-color: #fecaca;
}

button.ghost {
  background: transparent;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0 12px;
}

textarea {
  min-height: 74px;
  padding: 10px 12px;
  resize: vertical;
}

h1,
h2,
p {
  margin: 0;
}

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

h2 {
  font-size: 18px;
}

.app-shell {
  width: min(720px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(var(--bottom-nav-height) + 18px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 16px 12px;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(219, 228, 232, 0.8);
}

.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-lockup h1 {
  overflow-wrap: anywhere;
}

.brand-mark,
.hero-logo {
  display: block;
  object-fit: contain;
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 12px;
  padding: 4px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.screen {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.auth-shell {
  width: min(520px, 100%);
  min-height: 100vh;
  display: grid;
  align-items: center;
  margin: 0 auto;
  padding: 20px 14px calc(20px + env(safe-area-inset-bottom));
}

.auth-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  padding: 5px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  background: white;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.auth-create {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.invite-summary {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
}

.invite-summary strong {
  color: var(--text);
  font-size: 18px;
}

.invite-summary.attention {
  border-color: #fed7aa;
  background: #fffbeb;
}

.hero {
  min-height: 156px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.92), rgba(17, 94, 89, 0.72)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='220' viewBox='0 0 420 220'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.25'%3E%3Cpath d='M0 110h420M210 0v220'/%3E%3Ccircle cx='210' cy='110' r='54'/%3E%3Crect x='16' y='40' width='72' height='140'/%3E%3Crect x='332' y='40' width='72' height='140'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  color: white;
}

.hero-logo {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  border-radius: 18px;
  padding: 6px;
}

.hero h2 {
  font-size: 30px;
}

.hero p {
  opacity: 0.92;
  font-weight: 700;
}

.panel,
.row-card,
.metric-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.match-details-panel summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.compact-form {
  padding-top: 4px;
}

.subscription-row input {
  width: 92px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.compact-head {
  margin-bottom: 8px;
}

.compact-head h3 {
  margin: 0;
}

.context-switch-group + .context-switch-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.form {
  display: grid;
  gap: 10px;
}

.field-label,
.choice-field {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-label span,
.choice-field legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

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

.choice-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-pill span {
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  font-weight: 850;
  text-align: center;
}

.choice-pill input:checked + span {
  border-color: var(--primary);
  background: var(--surface-2);
  color: var(--primary-2);
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.18);
}

.form-help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.weekday-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.weekday-picker legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.weekday-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.weekday-choice {
  position: relative;
}

.weekday-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weekday-choice span {
  display: grid;
  min-width: 42px;
  min-height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.weekday-choice input:checked + span {
  border-color: var(--primary);
  background: var(--surface-2);
  color: var(--primary-2);
}

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

.list.compact {
  gap: 8px;
}

.row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 12px;
}

.row-card > div:first-child {
  min-width: 0;
}

.row-card strong {
  overflow-wrap: anywhere;
}

.row-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.attendance-card {
  align-items: stretch;
  flex-direction: column;
}

.attendance-toggle {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.attendance-toggle button {
  min-height: 42px;
  padding: 0 8px;
  background: #f8fafc;
  font-size: 13px;
}

.attendance-toggle button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.lineup-list {
  display: grid;
  gap: 8px;
}

.lineup-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lineup-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  min-height: 44px;
}

.segmented button {
  min-height: 42px;
  padding: 0 8px;
  background: #f8fafc;
}

.segmented button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.player-tile {
  width: 100%;
  min-height: 64px;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 4px;
  text-align: left;
  background: var(--surface);
}

.player-tile.selected {
  border-color: var(--primary);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 2px var(--primary);
}

.tile-name {
  font-weight: 850;
}

.type-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.4;
  white-space: nowrap;
}

.type-badge.regular {
  background: #e0f2fe;
  color: #075985;
}

.type-badge.guest {
  background: #fef3c7;
  color: #92400e;
}

.status-badge {
  display: inline-grid;
  width: fit-content;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-badge.planned {
  background: #e0f2fe;
  color: #075985;
}

.status-badge.cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.status-badge.attention {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.done {
  background: #dcfce7;
  color: #166534;
}

.tile-meta,
.hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.hint {
  text-align: right;
}

.score-pill {
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 8px;
  background: #102a2a;
  color: white;
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.formation-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.formation-tabs::-webkit-scrollbar {
  display: none;
}

.formation-tabs button {
  flex: 0 0 auto;
}

.pitch-board {
  position: relative;
  min-height: 520px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.28)) 50% 50% / 100% 2px no-repeat,
    radial-gradient(circle at 50% 50%, transparent 0 48px, rgba(255,255,255,.65) 49px 51px, transparent 52px),
    linear-gradient(90deg, rgba(255,255,255,.28) 0 2px, transparent 2px calc(100% - 2px), rgba(255,255,255,.28) calc(100% - 2px)),
    repeating-linear-gradient(90deg, #17823b 0 46px, #147738 46px 92px);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.26);
}

.pitch-board::before,
.pitch-board::after {
  content: "";
  position: absolute;
  left: 28%;
  width: 44%;
  height: 76px;
  border: 2px solid rgba(255,255,255,.62);
  pointer-events: none;
}

.pitch-board::before {
  top: -2px;
  border-top: 0;
}

.pitch-board::after {
  bottom: -2px;
  border-bottom: 0;
}

.pitch-slot {
  position: absolute;
  z-index: 1;
  width: clamp(70px, 22vw, 96px);
  min-height: 64px;
  transform: translate(-50%, -50%);
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 5px 6px;
  border-color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.9);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  touch-action: none;
  user-select: none;
}

.pitch-slot span {
  overflow-wrap: anywhere;
  font-size: clamp(10px, 3vw, 12px);
  font-weight: 900;
}

.pitch-slot small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.pitch-slot .bench-summary {
  font-size: clamp(8px, 2.4vw, 9px);
  line-height: 1.15;
}

.pitch-slot.filled {
  background: #fef3c7;
  border-color: #f59e0b;
}

.pitch-slot.selected {
  background: #ccfbf1;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .28), 0 8px 20px rgba(15, 23, 42, 0.18);
}

.pitch-slot.drop-target,
.bench-drop-zone.drop-target {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

.draft-banner {
  padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  font-weight: 850;
}

.lineup-management {
  display: grid;
  gap: 10px;
}

.lineup-management h3 {
  margin: 0;
  font-size: 15px;
}

.lineup-management .section-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.selection-chip {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  touch-action: none;
  user-select: none;
}

.selection-chip strong {
  overflow-wrap: anywhere;
}

.bench-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.drag-source {
  opacity: 0.42;
}

.drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.92;
  transform-origin: left top;
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.28);
}

.lineup-dragging {
  cursor: grabbing;
}

.score-action {
  min-height: 82px;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 3px;
  text-align: left;
}

.score-action strong {
  font-size: 22px;
}

.score-action span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.score-action.own {
  border-color: rgba(15, 118, 110, 0.35);
  background: var(--surface-2);
}

.score-action.opponent {
  border-color: rgba(185, 28, 28, 0.22);
  background: #fff7ed;
}

.score-action.card-yellow {
  border-color: rgba(245, 158, 11, 0.42);
  background: #fffbeb;
}

.score-action.card-red {
  border-color: rgba(185, 28, 28, 0.28);
  background: #fef2f2;
}

.score-log {
  display: grid;
  gap: 8px;
}

.score-log-item {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.score-log-item span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.quick-prompt {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 8px;
  background: #f0fdfa;
}

.quick-prompt.assist {
  border-color: rgba(245, 158, 11, 0.35);
  background: #fffbeb;
}

.quick-prompt h3,
.quick-prompt p {
  margin: 0;
}

.quick-prompt h3 {
  font-size: 15px;
}

.quick-prompt p {
  color: var(--muted);
  font-weight: 750;
}

.advice-summary {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.advice-summary strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.advice-summary .status-badge {
  justify-self: start;
}

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

.advice-metric-grid span {
  display: grid;
  gap: 2px;
  min-height: 66px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.advice-metric-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.advice-metric-grid strong {
  font-size: 16px;
}

.advice-metric-grid em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.advice-detail-list {
  display: grid;
  gap: 4px;
}

.advice-detail-list span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.quick-player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.muted-choice {
  justify-items: center;
  text-align: center;
}

.swap-list {
  display: grid;
  gap: 8px;
}

.swap-pick {
  width: 100%;
  min-height: 58px;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 3px;
  padding: 8px 10px;
  text-align: left;
  background: #f8fafc;
}

.swap-pick span {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-weight: 850;
}

.swap-pick small {
  color: var(--muted);
  font-weight: 750;
}

.swap-pick.selected {
  border-color: var(--primary);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 2px var(--primary);
}

.muted,
.empty {
  color: var(--muted);
  line-height: 1.45;
}

.empty {
  padding: 10px 0;
}

.muted-card {
  opacity: 0.62;
}

.active-season-card {
  border-color: rgba(15, 118, 110, 0.45);
  background: var(--surface-2);
}

.season-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.season-card {
  min-height: 76px;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 4px;
  text-align: left;
  background: #f8fafc;
}

.season-card strong {
  font-size: 18px;
}

.season-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.season-card.active {
  border-color: var(--primary);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 2px var(--primary);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric-grid article {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 12px;
}

.metric-grid strong {
  font-size: 26px;
}

.metric-grid span {
  color: var(--muted);
  font-size: 12px;
}

.action-row,
.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-row > button,
.action-row > .file-button {
  flex: 1 1 148px;
}

.action-row > .wide {
  flex-basis: 100%;
}

.mini-actions > button {
  flex: 1 1 auto;
}

.user-access-controls {
  display: grid;
  width: min(100%, 520px);
  gap: 8px;
}

.user-access-controls > .field-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.user-access-controls > .form-help {
  margin: 0;
}

.danger-zone {
  border-color: #fecaca;
}

.notice.warning {
  padding: 12px;
  border-left: 4px solid #d97706;
  background: #fffbeb;
  color: #78350f;
}

.wide {
  width: 100%;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  width: min(720px, 100%);
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.bottom-nav::-webkit-scrollbar {
  display: none;
}

.bottom-nav button {
  flex: 0 0 72px;
  min-height: 56px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px;
  font-size: 18px;
}

.bottom-nav button span {
  font-size: 10px;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.05;
}

.bottom-nav button.active {
  color: var(--primary);
  background: var(--surface-2);
  border-radius: 8px;
}

.live-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  background: #102a2a;
  color: white;
}

.live-head > div {
  min-width: 0;
}

.live-head h2 {
  overflow-wrap: anywhere;
}

.live-head .eyebrow {
  color: #99f6e4;
}

.timer {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.field-grid h2 {
  margin-bottom: 8px;
}

.report-card-list {
  display: grid;
  gap: 8px;
}

.report-card-list {
  gap: 10px;
}

.report-player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.report-player small {
  color: var(--muted);
  font-weight: 800;
}

.report-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

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

.report-card-head strong {
  overflow-wrap: anywhere;
}

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

.report-stat-grid span {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.report-stat-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.report-stat-grid strong {
  font-size: 16px;
}

.signal {
  padding: 10px;
  border-left: 4px solid var(--accent);
  background: #fffbeb;
  border-radius: 8px;
}

.file-button {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

@media (min-width: 620px) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: 21px;
  }

  .topbar {
    padding: 12px 12px 10px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .screen {
    gap: 10px;
    padding: 10px;
  }

  .panel {
    padding: 12px;
  }

  .hero {
    min-height: 142px;
    padding: 16px;
  }

  .hero-logo {
    width: 76px;
    height: 76px;
    border-radius: 14px;
  }

  .hero h2 {
    font-size: 24px;
  }

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

  .row-card {
    align-items: stretch;
    flex-direction: column;
  }

  .row-card .mini-actions {
    width: 100%;
  }

  .scoreboard {
    gap: 8px;
  }

  .score-action {
    min-height: 74px;
    padding: 8px 10px;
  }

  .score-action strong {
    font-size: 19px;
  }

  .pitch-board {
    min-height: 480px;
  }

  .pitch-slot {
    min-height: 58px;
    padding: 4px 5px;
  }

  .quick-player-grid,
  .report-player-grid {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }

  .bottom-nav {
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }

  .bottom-nav button {
    flex-basis: 68px;
    min-height: 58px;
    padding: 3px 2px;
    font-size: 17px;
  }

  .bottom-nav button span {
    font-size: 9px;
  }

  .live-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .timer {
    grid-column: 1 / -1;
    justify-self: end;
    font-size: 22px;
  }
}

@media (max-width: 370px) {
  .attendance-toggle {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .pitch-board {
    min-height: 455px;
  }

  .bottom-nav button span {
    display: none;
  }

  .bottom-nav button {
    flex-basis: 52px;
    min-height: 50px;
    font-size: 19px;
  }
}

@media print {
  .topbar,
  .bottom-nav {
    display: none;
  }
}
