/* Tabellone chiaro — previsto vs reale */

.illogico-board {
  padding: 0.85rem 1rem 1rem;
  font-family: var(--font);
}

.iboard-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.iboard-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.01em;
}
.iboard-head p {
  margin: 0.2rem 0 0;
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--muted);
  max-width: 36rem;
}
.iboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.iboard-btn {
  font-family: var(--font);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--glass-bg-soft);
  color: var(--heading);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}
.iboard-btn:hover { border-color: var(--border-strong); }
.iboard-btn:disabled { opacity: 0.55; cursor: wait; }
.iboard-btn--primary {
  background: color-mix(in srgb, var(--emerald) 18%, transparent);
  border-color: color-mix(in srgb, var(--emerald) 28%, var(--border));
  color: var(--heading);
}
.iboard-status {
  font-size: 0.62rem;
  color: var(--muted);
  min-height: 1.1em;
}

.iboard-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin: 0 0 0.75rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--glass-bg-soft) 80%, transparent);
  border: 1px solid var(--border);
  font-size: 0.6rem;
  color: var(--muted);
}
.iboard-legend b { color: var(--heading); font-weight: 700; }
.iboard-legend .up { color: #34d399; }
.iboard-legend .dn { color: #f87171; }
.iboard-legend .ok { color: #34d399; }
.iboard-legend .ko { color: #f87171; }
.iboard-legend .wait { color: #fbbf24; }

.iboard-section {
  margin-bottom: 0.9rem;
}
.iboard-section:last-child { margin-bottom: 0; }
.iboard-section-title {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.iboard-section-title span {
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  opacity: 0.85;
}

.iboard-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--glass-bg) 70%, transparent);
}

.iboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  min-width: 36rem;
}
.iboard-table th {
  text-align: left;
  padding: 0.45rem 0.55rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: color-mix(in srgb, var(--surface) 40%, transparent);
}
.iboard-table td {
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  vertical-align: middle;
  color: var(--heading);
}
.iboard-table tr:last-child td { border-bottom: none; }
.iboard-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}
.iboard-table tbody tr:hover {
  background: color-mix(in srgb, var(--emerald) 6%, transparent);
}

.iboard-sym {
  font-weight: 800;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}
.iboard-badge {
  display: inline-block;
  margin-top: 0.15rem;
  margin-right: 0.25rem;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.iboard-badge.vol-hot {
  color: #7f1d1d;
  background: rgba(248, 113, 113, 0.25);
  border: 1px solid rgba(248, 113, 113, 0.35);
}
[data-theme="dark"] .iboard-badge.vol-hot,
[data-theme="rest"] .iboard-badge.vol-hot {
  color: #fecaca;
}
.iboard-badge.vol-ok {
  color: var(--muted);
  background: color-mix(in srgb, var(--border) 40%, transparent);
}
.iboard-badge.vol-na {
  color: var(--muted);
  opacity: 0.7;
  background: transparent;
  border: 1px dashed var(--border);
}

/* Sentiment news multi-orizzonte */
.iboard-sentiment { min-width: 8.5rem; }
.sent-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.2rem 0.4rem;
  border-radius: 7px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
  max-width: 100%;
}
.sent-icon { font-size: 0.75rem; line-height: 1; }
.sent-label { white-space: nowrap; }
.sent-exact {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 800;
  opacity: 0.95;
}
.sent-pill.sent-strong-pos {
  color: #064e3b;
  background: rgba(16, 185, 129, 0.28);
  border-color: rgba(16, 185, 129, 0.4);
}
.sent-pill.sent-weak-pos {
  color: #065f46;
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.3);
}
.sent-pill.sent-neutral {
  color: var(--muted);
  background: color-mix(in srgb, var(--border) 45%, transparent);
  border-color: var(--border);
}
.sent-pill.sent-weak-neg {
  color: #7f1d1d;
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.3);
}
.sent-pill.sent-strong-neg {
  color: #7f1d1d;
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.4);
}
.sent-pill.sent-na {
  color: var(--muted);
  opacity: 0.75;
}

/* Realismo Kalman */
.iboard-dir.regime-extreme,
.regime-extreme-badge {
  color: #9a3412 !important;
  background: rgba(249, 115, 22, 0.22) !important;
  border-color: rgba(249, 115, 22, 0.4) !important;
}
.regime-extreme-badge {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(249, 115, 22, 0.4);
}
.iboard-dir.regime-incomplete {
  color: #64748b !important;
  background: rgba(148, 163, 184, 0.2) !important;
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.iboard-badge.vol-caution {
  display: block;
  margin-top: 0.2rem;
  color: #64748b;
  background: rgba(148, 163, 184, 0.15);
  border: 1px dashed rgba(148, 163, 184, 0.4);
  font-size: 0.48rem;
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 600;
  max-width: 12rem;
  white-space: normal;
  line-height: 1.25;
}
.iboard-warn {
  display: block;
  margin-top: 0.15rem;
  color: #fb923c !important;
  font-size: 0.52rem !important;
  line-height: 1.3;
  max-width: 14rem;
  white-space: normal;
}
[data-theme="dark"] .iboard-dir.regime-extreme,
[data-theme="rest"] .iboard-dir.regime-extreme,
[data-theme="dark"] .regime-extreme-badge,
[data-theme="rest"] .regime-extreme-badge {
  color: #fdba74 !important;
}
[data-theme="dark"] .iboard-dir.regime-incomplete,
[data-theme="rest"] .iboard-dir.regime-incomplete {
  color: #94a3b8 !important;
}
tr.row-vol-missing {
  opacity: 0.92;
}

/* Kalman tools · volume confirm · broker · news popup */
.ikal-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin-bottom: 0.55rem;
}
.ikal-ticker-search {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.ikal-ticker-input {
  width: 9.5rem;
  min-width: 7rem;
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card, #111) 88%, transparent);
  color: var(--heading, inherit);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ikal-ticker-input::placeholder {
  text-transform: none;
  font-weight: 500;
  letter-spacing: 0;
  opacity: 0.65;
}
.ikal-ticker-input:focus {
  outline: 2px solid color-mix(in srgb, #38bdf8 55%, transparent);
  outline-offset: 1px;
}
.iboard-btn-primary {
  font-weight: 700;
  border-color: color-mix(in srgb, #38bdf8 45%, var(--border));
  background: color-mix(in srgb, #38bdf8 14%, transparent);
}
.iboard-badge.vol-confirm {
  color: #065f46;
  background: rgba(52, 211, 153, 0.22);
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.iboard-badge.vol-contradict {
  color: #9a3412;
  background: rgba(249, 115, 22, 0.2);
  border: 1px solid rgba(249, 115, 22, 0.35);
}
.iboard-badge.vol-low {
  color: #64748b;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.3);
}
[data-theme="dark"] .iboard-badge.vol-confirm,
[data-theme="rest"] .iboard-badge.vol-confirm { color: #6ee7b7; }
[data-theme="dark"] .iboard-badge.vol-contradict,
[data-theme="rest"] .iboard-badge.vol-contradict { color: #fdba74; }

tr.ikal-broker-row td {
  padding: 0 0.55rem 0.55rem 0.55rem !important;
  border-top: none !important;
  background: color-mix(in srgb, var(--border) 12%, transparent);
}
tr.ikal-main-row td {
  border-bottom: none !important;
  padding-bottom: 0.25rem !important;
}
.ikal-broker-comment {
  margin: 0;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border-left: 3px solid color-mix(in srgb, #94a3b8 70%, transparent);
  background: color-mix(in srgb, var(--border) 22%, transparent);
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--heading, inherit);
  font-weight: 500;
  max-width: 100%;
}
.ikal-broker-label {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: color-mix(in srgb, var(--border) 50%, transparent);
  vertical-align: middle;
}

.ikal-news-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  margin-top: 0.28rem;
  max-width: 11rem;
  padding: 0.2rem 0.3rem;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, #38bdf8 35%, var(--border));
  background: color-mix(in srgb, #38bdf8 8%, transparent);
  color: inherit;
  font: inherit;
  font-size: 0.58rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}
.ikal-news-btn:hover {
  background: color-mix(in srgb, #38bdf8 16%, transparent);
}
.ikal-news-ico { flex-shrink: 0; }
.ikal-news-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 600;
  color: var(--heading, inherit);
}

.ikal-news-pop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}
.ikal-news-pop[hidden] { display: none !important; }
.ikal-news-pop-card {
  position: relative;
  width: min(22rem, 100%);
  padding: 1rem 1.1rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card, #0f172a);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  color: var(--heading, #e2e8f0);
}
.ikal-news-pop-card h4 {
  margin: 0 1.5rem 0.55rem 0;
  font-size: 0.9rem;
  line-height: 1.35;
  font-weight: 700;
}
.ikal-news-pop-sum {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted, #94a3b8);
}
.ikal-news-pop-src {
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ikal-news-pop-close {
  position: absolute;
  top: 0.4rem;
  right: 0.45rem;
  width: 1.6rem;
  height: 1.6rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.ikal-news-pop-close:hover {
  background: color-mix(in srgb, var(--border) 60%, transparent);
  color: var(--heading);
}
.ikal-tools .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.iboard-prices {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  margin: 0.12rem 0 0.15rem;
  font-size: 0.55rem;
  color: var(--muted);
  line-height: 1.3;
}
.iboard-prices b {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--heading);
}
.iboard-prices b.up { color: #34d399; }
.iboard-prices b.dn { color: #f87171; }
.iboard-prices b.px-live { color: #38bdf8; }
.iboard-prices b.px-last { color: var(--heading); }
.iboard-prices b.px-ext { color: #a78bfa; }
.iboard-prices b.px-stale { color: #f87171; opacity: 0.85; }
.ikal-px-kind.px-stale {
  color: #9a3412;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.35);
}
.ikal-price-stale {
  display: block;
  margin: 0.12rem 0;
  font-size: 0.55rem;
  font-weight: 700;
  color: #f87171;
}

.ikal-px-kind {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.28rem;
  border-radius: 4px;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  vertical-align: middle;
}
.ikal-px-kind.px-live {
  color: #0369a1;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.ikal-px-kind.px-last {
  color: #64748b;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.ikal-px-kind.px-ext {
  color: #6d28d9;
  background: rgba(167, 139, 250, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.35);
}
[data-theme="dark"] .ikal-px-kind.px-live,
[data-theme="rest"] .ikal-px-kind.px-live { color: #7dd3fc; }
[data-theme="dark"] .ikal-px-kind.px-ext,
[data-theme="rest"] .ikal-px-kind.px-ext { color: #c4b5fd; }

.ikal-mkt {
  display: inline-block;
  margin-top: 0.12rem;
  margin-right: 0.25rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.25;
  max-width: 14rem;
  white-space: normal;
}
.ikal-mkt.mkt-open {
  color: #065f46;
  background: rgba(52, 211, 153, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.ikal-mkt.mkt-closed {
  color: #64748b;
  background: rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.ikal-mkt.mkt-ext {
  color: #6d28d9;
  background: rgba(167, 139, 250, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.3);
}
[data-theme="dark"] .ikal-mkt.mkt-open,
[data-theme="rest"] .ikal-mkt.mkt-open { color: #6ee7b7; }
[data-theme="dark"] .ikal-mkt.mkt-ext,
[data-theme="rest"] .ikal-mkt.mkt-ext { color: #c4b5fd; }

.ikal-open-it {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.52rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
  max-width: 14rem;
}
.ikal-sess-open {
  display: block;
  font-size: 0.5rem;
  font-weight: 500;
  color: var(--muted);
  opacity: 0.85;
  line-height: 1.25;
}

.ikal-sort-hint {
  margin: 0 0 0.4rem;
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 500;
}
.ikal-vol-detail {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.5rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
  max-width: 14rem;
  font-variant-numeric: tabular-nums;
}
.iboard-badge.vol-partial {
  color: #92400e;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.4);
}
.iboard-badge.vol-complete {
  color: #065f46;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.3);
}
[data-theme="dark"] .iboard-badge.vol-partial,
[data-theme="rest"] .iboard-badge.vol-partial { color: #fcd34d; }
[data-theme="dark"] .iboard-badge.vol-complete,
[data-theme="rest"] .iboard-badge.vol-complete { color: #6ee7b7; }

.iboard-badge.upside-strong {
  color: #064e3b;
  background: rgba(16, 185, 129, 0.28);
  border: 1px solid rgba(16, 185, 129, 0.45);
  font-weight: 800;
}
.iboard-badge.upside-solid {
  color: #065f46;
  background: rgba(52, 211, 153, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.iboard-badge.upside-watch {
  color: #92400e;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.35);
}
.iboard-badge.upside-weak,
.iboard-badge.upside-none {
  color: var(--muted);
  background: color-mix(in srgb, var(--border) 40%, transparent);
  border: 1px solid var(--border);
}
[data-theme="dark"] .iboard-badge.upside-strong,
[data-theme="rest"] .iboard-badge.upside-strong { color: #6ee7b7; }
[data-theme="dark"] .iboard-badge.upside-solid,
[data-theme="rest"] .iboard-badge.upside-solid { color: #a7f3d0; }

tr.row-rise-candidate td {
  box-shadow: inset 3px 0 0 #34d399;
}
.ikal-top-rise {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, #34d399 35%, var(--border));
  background: color-mix(in srgb, #34d399 8%, transparent);
}
.ikal-top-rise-title {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #059669;
  margin-right: 0.25rem;
}
[data-theme="dark"] .ikal-top-rise-title,
[data-theme="rest"] .ikal-top-rise-title { color: #6ee7b7; }
.ikal-top-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.45rem;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, #34d399 30%, var(--border));
  background: color-mix(in srgb, var(--card, #111) 90%, transparent);
  color: inherit;
  font: inherit;
  font-size: 0.68rem;
  cursor: pointer;
}
.ikal-top-chip:hover {
  border-color: #34d399;
  background: color-mix(in srgb, #34d399 12%, transparent);
}
.ikal-top-chip b {
  font-family: var(--mono);
  font-weight: 800;
}
.ikal-top-chip .up {
  color: #34d399;
  font-family: var(--mono);
  font-weight: 700;
}
.ikal-top-chip .sc {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--muted);
}
.ikal-co-name {
  display: block;
  font-size: 0.58rem !important;
  max-width: 14rem;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
.ikal-price-verify {
  display: block;
  margin: 0.12rem 0 0.15rem;
  font-size: 0.55rem;
  font-weight: 600;
  color: #0369a1;
  line-height: 1.3;
}
.ikal-price-verify b {
  font-family: var(--mono);
  font-weight: 800;
  color: #0ea5e9;
}
[data-theme="dark"] .ikal-price-verify,
[data-theme="rest"] .ikal-price-verify { color: #7dd3fc; }
[data-theme="dark"] .ikal-price-verify b,
[data-theme="rest"] .ikal-price-verify b { color: #38bdf8; }
.ikal-table th.ikal-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  padding: 0.35rem 0.3rem !important;
}
.ikal-table th.ikal-th.is-active {
  color: var(--heading, inherit);
}
.ikal-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0.1rem 0.15rem;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
}
.ikal-sort-btn:hover {
  color: #38bdf8;
}
.ikal-sort-arrow {
  font-size: 0.7rem;
  opacity: 0.75;
  font-weight: 800;
}
.ikal-th.is-active .ikal-sort-arrow {
  opacity: 1;
  color: #38bdf8;
}
[data-theme="dark"] .sent-pill.sent-strong-pos,
[data-theme="rest"] .sent-pill.sent-strong-pos { color: #a7f3d0; }
[data-theme="dark"] .sent-pill.sent-weak-pos,
[data-theme="rest"] .sent-pill.sent-weak-pos { color: #6ee7b7; }
[data-theme="dark"] .sent-pill.sent-weak-neg,
[data-theme="dark"] .sent-pill.sent-strong-neg,
[data-theme="rest"] .sent-pill.sent-weak-neg,
[data-theme="rest"] .sent-pill.sent-strong-neg { color: #fecaca; }
.iboard-name {
  display: block;
  font-size: 0.58rem;
  font-weight: 500;
  color: var(--muted);
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iboard-dir {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 800;
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  white-space: nowrap;
}
.iboard-dir.up {
  color: #064e3b;
  background: rgba(52, 211, 153, 0.22);
}
.iboard-dir.dn {
  color: #7f1d1d;
  background: rgba(248, 113, 113, 0.22);
}
.iboard-dir.flat {
  color: var(--muted);
  background: color-mix(in srgb, var(--border) 50%, transparent);
}
[data-theme="dark"] .iboard-dir.up,
[data-theme="rest"] .iboard-dir.up { color: #a7f3d0; }
[data-theme="dark"] .iboard-dir.dn,
[data-theme="rest"] .iboard-dir.dn { color: #fecaca; }

.iboard-pct {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.7rem;
  white-space: nowrap;
}
.iboard-pct.up { color: #34d399; }
.iboard-pct.dn { color: #f87171; }
.iboard-pct.flat { color: var(--muted); }

.iboard-now {
  font-size: 0.62rem;
  color: var(--muted);
  line-height: 1.35;
}
.iboard-now b {
  display: block;
  font-size: 0.68rem;
  color: var(--heading);
}

.iboard-esito {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-weight: 800;
  font-size: 0.68rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  white-space: nowrap;
}
.iboard-esito.ok {
  color: #064e3b;
  background: rgba(52, 211, 153, 0.2);
}
.iboard-esito.ko {
  color: #7f1d1d;
  background: rgba(248, 113, 113, 0.2);
}
.iboard-esito.wait {
  color: #78350f;
  background: rgba(251, 191, 36, 0.22);
}
.iboard-esito.partial {
  color: #1e3a5f;
  background: rgba(96, 165, 250, 0.2);
}
[data-theme="dark"] .iboard-esito.ok,
[data-theme="rest"] .iboard-esito.ok { color: #a7f3d0; }
[data-theme="dark"] .iboard-esito.ko,
[data-theme="rest"] .iboard-esito.ko { color: #fecaca; }
[data-theme="dark"] .iboard-esito.wait,
[data-theme="rest"] .iboard-esito.wait { color: #fde68a; }
[data-theme="dark"] .iboard-esito.partial,
[data-theme="rest"] .iboard-esito.partial { color: #bfdbfe; }

.iboard-empty {
  margin: 0;
  padding: 1rem 0.75rem;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
}

.iboard-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.iboard-series {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  min-height: 4rem;
  padding: 0.55rem 0.6rem 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--glass-bg) 70%, transparent);
  overflow-x: auto;
}
.iboard-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  flex: 0 0 auto;
}
.iboard-bar-fill {
  display: block;
  border-radius: 4px 4px 2px 2px;
  background: color-mix(in srgb, var(--muted) 35%, transparent);
  min-width: 10px;
}
.iboard-bar.good .iboard-bar-fill {
  background: linear-gradient(180deg, #6ee7b7, #34d399);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.35);
}
.iboard-bar.bad .iboard-bar-fill {
  background: linear-gradient(180deg, #fca5a5, #f87171);
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.3);
}
.iboard-bar-lab {
  font-size: 0.48rem;
  font-family: var(--mono);
  color: var(--muted);
  letter-spacing: 0.02em;
}
.iboard-kpi {
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--glass-bg-soft) 70%, transparent);
  text-align: center;
}
.iboard-kpi b {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--heading);
  line-height: 1.15;
}
.iboard-kpi span {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.iboard-kpi.good b { color: #34d399; }
.iboard-kpi.bad b { color: #f87171; }

.iboard-note {
  margin: 0.55rem 0 0;
  font-size: 0.58rem;
  line-height: 1.4;
  color: var(--muted);
}

/* Backtest periodale */
.ibt-panel {
  padding: 0.15rem 0 0.25rem;
}
.ibt-intro {
  margin: 0 0 0.65rem;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--muted);
}
.ibt-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 0.45rem 0.5rem;
  align-items: end;
  margin-bottom: 0.65rem;
}
.ibt-form--chain {
  grid-template-columns: repeat(3, minmax(0, 1fr)) repeat(2, minmax(0, 7rem)) minmax(0, 1fr) auto;
}
.ich-time-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 0.65rem;
}
.ich-time-presets .iboard-btn {
  font-size: 0.58rem !important;
  padding: 0.3rem 0.5rem !important;
}
@media (max-width: 1100px) {
  .ibt-form--chain {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.ich-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
}
.ich-preset {
  font-size: 0.62rem !important;
  padding: 0.35rem 0.55rem !important;
}
.ich-step-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.7rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--glass-bg-soft) 70%, transparent);
}
.ich-step-lab {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  width: 100%;
}
.ich-mins-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.ich-min-btn {
  font-size: 0.62rem !important;
  padding: 0.32rem 0.5rem !important;
  min-width: 3.2rem;
}
.ich-min-btn.is-on {
  border-color: color-mix(in srgb, #38bdf8 45%, var(--border));
  color: #38bdf8;
  background: color-mix(in srgb, #38bdf8 12%, transparent);
}
.ich-mins-free {
  min-width: 5.5rem;
}
.ich-mins-free input {
  width: 5rem;
}
.ibt-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.ibt-field input,
.ibt-field select {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  padding: 0.4rem 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--glass-bg-soft) 80%, transparent);
  color: var(--heading);
}
.ibt-actions { display: flex; align-items: end; }

.ibt-progress {
  margin: 0.35rem 0 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--glass-bg) 75%, transparent);
}
.ibt-progress-track {
  height: 6px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}
.ibt-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.4);
  transition: width 0.25s ease;
}
.ibt-progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.4rem;
  font-size: 0.62rem;
  color: var(--muted);
  font-family: var(--mono);
}
.ibt-progress-meta span:first-child {
  font-weight: 800;
  color: var(--heading);
}

.ibt-report { margin-top: 0.55rem; }
.ibt-kpis { margin-bottom: 0.45rem; }
.ibt-subh {
  margin: 0.65rem 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--heading);
}
.ibt-error { color: #f87171 !important; }
.ibt-spark-cell { min-width: 11rem; vertical-align: middle; }
.ibt-spark {
  display: block;
  opacity: 0.95;
  vertical-align: middle;
}
.ibt-dual {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  align-items: flex-start;
}
.ibt-dual-leg {
  display: flex;
  gap: 0.55rem;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ibt-leg-real { color: #e2e8f0; }
.ibt-leg-inv { color: #38bdf8; }
.ibt-line-real { filter: drop-shadow(0 0 2px rgba(226, 232, 240, 0.35)); }
.ibt-line-inv { filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.45)); }

@media (max-width: 1100px) {
  .ibt-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .iboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .iboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .iboard-table { min-width: 30rem; font-size: 0.68rem; }
  .iboard-head { flex-direction: column; }
  .ibt-form { grid-template-columns: 1fr 1fr; }
  .ibt-actions { grid-column: 1 / -1; }
}