:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef2f4;
  --line: #d7dee2;
  --line-strong: #b9c4ca;
  --text: #172126;
  --muted: #65757d;
  --accent: #c7332f;
  --accent-dark: #a52524;
  --green: #1f8a56;
  --blue: #2367a2;
  --amber: #a76b00;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.topbar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.mark {
  display: grid;
  width: 48px;
  height: 36px;
  place-items: center;
  background: #171b1e;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  clip-path: polygon(12% 0, 88% 0, 100% 50%, 88% 100%, 12% 100%, 0 50%);
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pill.ok {
  border-color: rgba(31, 138, 86, 0.25);
  background: rgba(31, 138, 86, 0.1);
  color: var(--green);
}

.pill.warn {
  border-color: rgba(167, 107, 0, 0.25);
  background: rgba(167, 107, 0, 0.1);
  color: var(--amber);
}

.primary-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--accent-dark);
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.primary-button:disabled {
  border-color: var(--line-strong);
  background: #d1d7db;
  color: #66757d;
  cursor: not-allowed;
}

.summary-strip {
  display: grid;
  flex-shrink: 0;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.metric {
  min-width: 0;
  padding: 14px 24px;
  background: var(--surface);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric strong {
  display: block;
  margin-top: 2px;
  font-size: 22px;
  line-height: 1.1;
}

.toolbar {
  display: grid;
  flex-shrink: 0;
  grid-template-columns: minmax(170px, 1fr) minmax(190px, 1fr) minmax(220px, 1.3fr) auto auto auto;
  gap: 12px;
  align-items: end;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.toolbar label {
  min-width: 0;
}

.toolbar label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

select,
input[type="search"] {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

select:focus,
input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(199, 51, 47, 0.12);
}

.toggle {
  display: flex;
  align-items: center;
  height: 38px;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}

.toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.toggle span {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}

.table-status {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
  color: var(--muted);
  font-size: 13px;
}

.error-text {
  color: var(--accent-dark);
  font-weight: 700;
}

.table-wrap {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: top;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #e9eef1;
  color: #314047;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td:first-child,
th:first-child {
  border-left: 1px solid var(--line);
}

.fight-col {
  width: 210px;
}

.prop-col {
  width: 180px;
}

.market-col {
  width: 220px;
}

.line-col {
  width: 72px;
}

.book-col {
  width: 128px;
}

.fight-name,
.market-label,
.prop-name {
  font-weight: 800;
}

.subtext {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.line-value {
  font-weight: 800;
}

.book-cell {
  display: grid;
  gap: 5px;
}

.selection {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  padding: 3px 6px;
  border-left: 3px solid var(--line-strong);
  background: #f8fafb;
}

.selection.over,
.selection.yes,
.selection.away {
  border-left-color: var(--green);
}

.selection.under,
.selection.no,
.selection.home {
  border-left-color: var(--blue);
}

.selection.otb {
  opacity: 0.48;
}

.selection-side {
  overflow-wrap: anywhere;
  color: #2f3d44;
  font-size: 12px;
  font-weight: 800;
}

.selection-price {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.alt-tag {
  margin-left: 4px;
  color: var(--amber);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.empty-cell {
  color: #9aa7ad;
}

tr.is-hidden {
  display: none;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .primary-button {
    flex: 1;
  }

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

  .metric {
    padding: 12px 16px;
  }

  .toolbar {
    grid-template-columns: 1fr;
    padding: 14px 16px;
  }

  .table-status {
    padding: 10px 16px;
  }
}
