/* Authentic SSI iBoard Live Electronic Price Board */
#x10-iboard-panel {
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  margin-bottom: 18px;
}

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

.ib-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ib-title-wrap h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.ib-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--positive) 14%, var(--panel2));
  color: var(--positive);
  border: 1px solid color-mix(in srgb, var(--positive) 30%, transparent);
  font-variant-numeric: tabular-nums;
}

.ib-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--positive) 26%, transparent);
}

.ib-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.ib-count-pill {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--panel2);
  border: 1px solid var(--line);
  font-weight: 600;
}

.ib-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ib-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--panel2);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.ib-tabs button {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
}

.ib-tabs button.selected {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.ib-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ib-tools input[type="search"] {
  min-height: 30px;
  width: 145px;
  font-size: 11px;
  padding: 4px 9px;
}

.ib-tools button.subtle {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 11px;
}

.ib-table-scroll {
  overflow-x: auto;
  max-height: 540px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ib-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ib-table thead th {
  position: sticky;
  z-index: 3;
  background: var(--panel2);
  color: var(--muted);
  font-weight: 700;
  font-size: 10px;
  text-align: center;
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

.ib-table thead tr:first-child th {
  top: 0;
  height: 26px;
}

.ib-table thead tr:nth-child(2) th {
  top: 26px;
  height: 24px;
  font-weight: 600;
}

.ib-table thead th.ib-grp-match,
.ib-table tbody td.ib-col-match {
  background: color-mix(in srgb, var(--panel2) 55%, var(--panel));
}

.ib-table thead th.ib-sort {
  cursor: pointer;
}

.ib-table thead th.ib-sort:hover {
  color: var(--text);
}

.ib-table tbody td {
  padding: 5px 6px;
  text-align: right;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--line) 35%, transparent);
  transition: background-color 0.25s ease;
}

.ib-table tbody tr:hover td {
  background: color-mix(in srgb, var(--accent) 6%, var(--panel));
}

.ib-col-sym {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--panel);
  text-align: left !important;
  font-weight: 750;
  cursor: pointer;
  min-width: 72px;
  border-right: 1px solid var(--line) !important;
}

.ib-table thead th.ib-col-sym {
  z-index: 5;
  background: var(--panel2);
}

.ib-table tbody tr:hover td.ib-col-sym {
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}

.ib-col-click {
  cursor: pointer;
}

/* SSI iBoard standard exchange color rules */
.ib-ceil { color: #e879f9 !important; font-weight: 700; }
.ib-floor { color: #38bdf8 !important; font-weight: 700; }
.ib-ref { color: #facc15 !important; font-weight: 650; }
.ib-up { color: #4ade80 !important; font-weight: 650; }
.ib-down { color: #f87171 !important; font-weight: 650; }
.ib-muted { color: var(--muted); }

body.light .ib-ceil { color: #a21caf !important; }
body.light .ib-floor { color: #0284c7 !important; }
body.light .ib-ref { color: #b45309 !important; }
body.light .ib-up { color: #15803d !important; }
body.light .ib-down { color: #dc2626 !important; }

/* Per-cell live tick flash */
@keyframes ibFlashUp {
  0% { background-color: rgba(34, 201, 151, 0.36); }
  100% { background-color: transparent; }
}
@keyframes ibFlashDown {
  0% { background-color: rgba(243, 107, 122, 0.36); }
  100% { background-color: transparent; }
}
@keyframes ibFlashCeil {
  0% { background-color: rgba(232, 121, 249, 0.36); }
  100% { background-color: transparent; }
}
@keyframes ibFlashFloor {
  0% { background-color: rgba(56, 189, 248, 0.36); }
  100% { background-color: transparent; }
}
@keyframes ibFlashRef {
  0% { background-color: rgba(250, 204, 21, 0.30); }
  100% { background-color: transparent; }
}

.ib-flash-up { animation: ibFlashUp 0.65s ease-out; }
.ib-flash-down { animation: ibFlashDown 0.65s ease-out; }
.ib-flash-ceil { animation: ibFlashCeil 0.65s ease-out; }
.ib-flash-floor { animation: ibFlashFloor 0.65s ease-out; }
.ib-flash-ref { animation: ibFlashRef 0.65s ease-out; }

body.x10-motion-off .ib-flash-up,
body.x10-motion-off .ib-flash-down,
body.x10-motion-off .ib-flash-ceil,
body.x10-motion-off .ib-flash-floor,
body.x10-motion-off .ib-flash-ref {
  animation: none !important;
}

.ib-foot {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.ib-jump-chip {
  font-size: 11px;
  min-height: 30px;
  padding: 4px 10px;
  margin-left: 8px;
}

@media (max-width: 760px) {
  .ib-tools { margin-left: 0; width: 100%; }
  .ib-tools input[type="search"] { flex: 1; min-width: 110px; }
}
