:root{
  --bg:#0c0f12; --card:#11161c; --text:#d7e0ea; --muted:#93a2b8;
  --accent:#8CBC57; --border:#1e2833;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif}
a{color:var(--accent);text-decoration:none}
.site{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;border-bottom:1px solid var(--border);position:sticky;top:0;background:rgba(12,15,18,.9);backdrop-filter:saturate(1.2) blur(6px)}
.site .brand a{font-weight:800;color:#fff}
.site nav a{margin-left:14px;color:var(--muted)}
.hero{padding:22px 18px 8px}
.row{display:flex;gap:8px;align-items:center}
input{background:#121821;border:1px solid var(--border);color:var(--text);padding:10px 12px;border-radius:10px;min-width:220px}
button{background:#1b2330;border:1px solid var(--border);color:var(--text);padding:10px 14px;border-radius:10px;cursor:pointer}
button:hover{border-color:#2b3b50}
.error{background:#2a1515;border:1px solid #592424;color:#f2dada;padding:10px 12px;border-radius:10px;margin-top:10px}
.diag{display:none}

.grid{display:grid;grid-template-columns:1.3fr .9fr;gap:18px;padding:0 18px 28px}
.card{background:var(--card);border:1px solid var(--border);border-radius:16px;padding:16px}
.sectionTitle{margin:14px 0 8px;font-weight:700}
.kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.kpi{background:#0b1117;border:1px solid var(--border);border-radius:12px;padding:10px 12px}
.kpi b{display:block;color:#b9c8d6}
.kpi span{font-size:14px}

.scoreWrap{display:flex;align-items:center;gap:16px;margin-bottom:10px}
.dial{width:78px;height:78px;border-radius:50%;border:6px solid #1d2833;display:flex;align-items:center;justify-content:center;background:#0b1117}
#scoreVal{font-size:20px;font-weight:800}
.dialText{display:flex;flex-direction:column}
.small{font-size:12px;color:var(--muted)}

.bars{display:flex;flex-direction:column;gap:8px}
.barRow{display:grid;grid-template-columns:88px 1fr;gap:10px;align-items:center}
.bar{background:#0b1117;border:1px solid var(--border);border-radius:999px;overflow:hidden;height:10px}
.bar>div{height:100%;width:0%;background:#2d5;transition:width .5s ease}

.badge{border:1px solid var(--border);background:#0b1117;border-radius:999px;padding:6px 10px;color:#b9c8d6}

/* Simple text color cues */
.txt-good{ color:#8fe29f !important; }
.txt-warn{ color:#f0d080 !important; }
.txt-bad{  color:#f29b9b !important; }

table{width:100%;border-collapse:collapse}
th,td{border-top:1px solid var(--border);padding:8px 6px;text-align:left}
thead th{border-top:none;color:#9fb0c4}

.muted{color:var(--muted)}

/* Tooltip */
.tt{position:fixed;z-index:9999;max-width:360px;background:#0b1117;border:1px solid var(--border);box-shadow:0 8px 24px rgba(0,0,0,.45);border-radius:10px;padding:10px 12px;color:var(--text);font-size:12px;line-height:1.35;display:none}
.tt b{color:#b9c8d6}

/* News */
#newsList{display:flex;flex-direction:column;gap:8px}
.news-item{border-bottom:1px solid var(--border);padding:6px 0}
.news-item a{font-weight:700}
.news-item time{color:var(--muted);font-size:12px;display:block;margin-top:2px}

@media(max-width:980px){.grid{grid-template-columns:1fr} .kpis{grid-template-columns:repeat(2,1fr)}}


/* Tooltip base */
[data-tip] { position: relative; cursor: help; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 10;
  left: 0;
  top: 110%;
  min-width: 220px;
  max-width: 440px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(20,20,20,.95);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  pointer-events: none;
  white-space: normal;
}
[data-tip]:hover::before {
  content: "";
  position: absolute;
  left: 10px;
  top: calc(110% - 6px);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid rgba(20,20,20,.95);
}


/* Tooltip de-dup tweaks */
#detailsTbl tbody tr[data-tip] { pointer-events: auto; } /* legacy safety */
#detailsTbl tbody tr[data-tip]::after,
#detailsTbl tbody tr[data-tip]::before { display: none !important; } /* never show tooltips on the row */

#detailsTbl td[data-tip] { position: relative; }
#detailsTbl td[data-tip]::after,
#detailsTbl td[data-tip]::before { pointer-events: none; }

/* Prevent any layout shift when the bubble appears */
[data-tip] { will-change: transform; }
