.live-market-page {
  padding: 18px;
  border-top: 1px solid var(--line);
}

.live-market-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 14px;
}

.live-market-head div {
  display: grid;
  gap: 4px;
}

.live-market-head strong {
  font-size: 16px;
}

.live-market-head span {
  color: var(--muted);
  font-size: 13px;
}

.live-market-head select {
  width: 150px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.live-market-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.live-market-summary div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.live-market-summary strong,
.live-market-summary span {
  display: block;
}

.live-market-summary strong {
  font-size: 16px;
}

.live-market-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.live-market-categories {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.live-market-categories::-webkit-scrollbar {
  display: none;
}

.live-market-categories button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.live-market-categories button.active {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--soft);
  box-shadow: none;
}

.live-market-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(148px, 176px);
  gap: 10px;
  margin-bottom: 12px;
}

.live-market-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.live-market-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
}

.live-market-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 13px;
}

.live-market-segments {
  display: grid;
  grid-template-columns: minmax(42px, max-content) minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
  width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--soft);
}

.live-market-segments button {
  height: 30px;
  min-width: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.live-market-segments button.active {
  color: var(--text);
  background: var(--panel);
  box-shadow: none;
}

.live-markets-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.live-market-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.live-market-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: color-mix(in srgb, var(--soft) 72%, var(--panel));
  text-align: left;
  font-weight: 800;
}

.live-market-title small {
  color: var(--muted);
  font-weight: 700;
}

.live-outcomes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
  gap: 6px;
  padding: 8px;
}

.live-outcomes[data-outcome-count="2"],
.live-outcomes[data-outcome-count="3"] {
  grid-template-columns: repeat(var(--outcome-columns, 3), minmax(0, 1fr));
}

.live-outcomes[data-outcome-count="2"] {
  --outcome-columns: 2;
}

.live-outcomes[data-outcome-count="3"] {
  --outcome-columns: 3;
}

.live-outcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--soft);
  text-align: left;
  cursor: pointer;
}

body.dark-theme .live-outcome {
  background: var(--soft);
}

.live-outcome.active {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--soft) 82%, var(--panel));
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

body.dark-theme .live-outcome.active {
  background: color-mix(in srgb, var(--soft) 82%, var(--panel));
}

.live-outcome span,
.live-outcome strong,
.live-outcome small {
  min-width: 0;
}

.live-outcome strong,
.live-outcome small {
  display: block;
  overflow: hidden;
}

.live-outcome strong {
  display: -webkit-box;
  line-height: 1.15;
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-overflow: ellipsis;
  white-space: normal;
}

.live-outcome small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-outcome .answer-badge {
  display: inline-grid;
  place-items: center;
  width: fit-content;
  min-width: 34px;
  min-height: 16px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--text);
  background: var(--panel);
  font-size: 10px;
  font-weight: 900;
}

.live-outcome b {
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 54px;
  min-height: 28px;
  padding: 0 6px;
  border-radius: 7px;
  color: var(--text);
  background: var(--panel);
  font-size: 13px;
}

body.dark-theme .live-outcome b {
  color: var(--text);
  background: var(--panel);
}

.live-outcome em {
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}

.live-outcome em.positive {
  color: var(--green);
}

.live-outcome em.negative {
  color: var(--red);
}

.live-outcome em.neutral {
  color: var(--muted);
}

.live-outcome-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
}

.live-outcome-panel[hidden] {
  display: none;
}

.live-outcome-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 32px;
  align-items: center;
  gap: 12px;
}

.live-outcome-panel-head div {
  min-width: 0;
}

.live-outcome-panel-head span,
.live-outcome-panel-head strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-outcome-panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.live-outcome-panel-head strong {
  margin-top: 4px;
  font-size: 16px;
}

.live-outcome-panel-head > b {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 9px;
  color: var(--text);
  background: var(--soft);
  font-size: 17px;
}

.live-outcome-panel-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
  cursor: pointer;
}

.live-outcome-panel-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.live-outcome-panel-close:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.live-outcome-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.live-outcome-stats div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.live-outcome-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.live-outcome-stats b {
  display: grid;
  place-items: center;
  min-height: 28px;
  border-radius: 7px;
  background: var(--panel);
  font-size: 13px;
}

.live-outcome-stats .positive {
  color: var(--green);
}

.live-outcome-stats .negative {
  color: var(--red);
}

.live-history-sparkline {
  width: 100%;
  height: 54px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.live-history-sparkline polyline {
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.live-history-table {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.live-history-table div {
  display: grid;
  grid-template-columns: 1fr 58px 72px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.live-history-table span {
  color: var(--muted);
}

.live-history-table b {
  display: grid;
  place-items: center;
  min-height: 28px;
  border-radius: 7px;
  background: var(--soft);
}

.live-history-table .positive {
  color: var(--green);
}

.live-history-table .negative {
  color: var(--red);
}
