/* Ekalix - a SQL Server's health checks (sqlhealth.js, CONTRACT-V18 W5). Built from the theme's
   tokens only, so every theme - Control room, Clarity, Daylight, Maroon, Aurora, Galaxy - draws it. */

.sqh > .banner { margin-bottom: 12px; }
.sqh > .tiles { margin-bottom: 14px; }

/* A finding or a row opened: why it matters, then what to do. */
.sqh-detail { padding: 10px 14px 12px; display: grid; gap: 6px; font-size: var(--fs-body); line-height: 1.55; color: var(--text-2); }
.sqh-detail p { margin: 0; max-width: 92ch; }
.sqh-detail b { color: var(--text); }
.sqh-detail .dc { margin-top: 4px; }

/* Surface area: one line per setting, the ones away from the usual value marked. */
.sqh-set { display: grid; gap: 2px; }
.sqh-setrow { display: grid; grid-template-columns: minmax(0, 1fr) 48px minmax(80px, auto); align-items: center; gap: 10px;
  padding: 4px 6px; border-radius: var(--r-s); font-size: var(--fs-body); }
.sqh-setrow.off { background: var(--warning-bg); }
.sqh-setn { min-width: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sqh-setv { font-family: var(--mono); color: var(--text-2); text-align: right; }
.sqh-setv.t-warning { color: var(--warning); font-weight: 700; }
.sqh-setx { color: var(--text-3); font-size: var(--fs-small); white-space: nowrap; }

/* How far back the size history goes. */
.sqh-range { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.sqh-range .chip { cursor: pointer; }

/* What fills tempdb: one stacked bar and its legend. */
.sqh-stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.sqh-seg { display: block; height: 100%; min-width: 0; background: var(--tone); }
.sqh-seg.t-muted { background: var(--surface-3); }
.sqh-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 9px; font-size: var(--fs-small); color: var(--text-2); }
.sqh-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--tone); }
.sqh-legend i.t-muted { background: var(--surface-3); border: 1px solid var(--border-2); }
.sqh-legend b { color: var(--text); font-family: var(--mono); font-weight: 600; }

/* Virtual log files: a bar past 1,000 turns amber, past 10,000 red. */
.mgp-bar.sqh-warning .mgp-bt > span { background: var(--warning); }
.mgp-bar.sqh-serious .mgp-bt > span { background: var(--serious); }

.sqh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

/* Index health: names and column lists on one line, cut with an ellipsis, the whole text in the tooltip. */
.sqh-ix-txt { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.sqh-ix-txt.wide { max-width: 280px; }
.sqh-ix-txt.strong { font-weight: 650; color: var(--text); }
/* The first column of each list: a dot in the row's colour. */
.sqh-ix-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--tone); vertical-align: middle; }
/* Under the databases: the ones with nothing to flag folded into a line, and the ones not read. */
.sqh-ix-fold { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: 8px 14px;
  border-top: 1px solid var(--border); font-size: var(--fs-small); color: var(--text-3); }
.sqh-ix-names { flex: 1 1 100%; min-width: 0; color: var(--text-2); line-height: 1.6; word-break: break-word; }
/* Every list narrowed to one database. */
.sqh-ix-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; padding: 8px 12px;
  border-radius: var(--r-s); background: var(--accent-bg); font-size: var(--fs-body); color: var(--text-2); }
.sqh-ix-pick b { color: var(--text); }
/* A sentence of explanation above a list. */
.sqh-ix-why { margin: 0; padding: 10px 14px 8px; max-width: 120ch; font-size: var(--fs-small); line-height: 1.5; color: var(--text-3); }
/* The CREATE INDEX text wraps instead of scrolling sideways, clear of the Copy button. */
.sqh-ix-sugg pre.code { white-space: pre-wrap; word-break: break-word; padding-right: 64px; }
/* SSRS: the web service and portal of each report server, answering or not. */
.sqh-eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.sqh-ep { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-s); background: var(--surface-2); }
.sqh-ep.down { border-color: var(--serious); }
.sqh-eph { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; min-width: 0; }
.sqh-eph b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sqh-ep ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: var(--fs-small); }
.sqh-ep li { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.sqh-epu { color: var(--text-2); word-break: break-all; }
.sqh-epok { color: var(--ok); }
.sqh-epbad { color: var(--serious); font-weight: 600; }

@media (max-width: 760px) {
  .sqh-setrow { grid-template-columns: minmax(0, 1fr) 44px; }
  .sqh-setx { display: none; }
  .sqh-ix-txt, .sqh-ix-txt.wide { max-width: 180px; }
}
