/* analysis.meshconnector.com. base.css is the shared look (same file as security.meshconnector.com);
   this file adds the analysis page: tiles, cards, charts, tables. */

/* Chart series: the validated eight, light then dark steps. Other = neutral. */
:root {
  --s1: #257de0; --s2: #f47230; --s3: #00b894; --s4: #f2a600; --s5: #ee7fac; --s6: #008a17; --s7: #6a4ce2; --s8: #ec4647;
  --s-other: #9aa5b8; --grid: #e7ebf2; --axis: #c4cdda;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --s1: #338ced; --s2: #e76624; --s3: #00a888; --s4: #d28e05; --s5: #e24d8b; --s6: #0aac23; --s7: #9887ef; --s8: #eb6263;
    --s-other: #6f7d96; --grid: #1d2d4d; --axis: #2a3d63;
  }
}
:root[data-theme="dark"] {
  --s1: #338ced; --s2: #e76624; --s3: #00a888; --s4: #d28e05; --s5: #e24d8b; --s6: #0aac23; --s7: #9887ef; --s8: #eb6263;
  --s-other: #6f7d96; --grid: #1d2d4d; --axis: #2a3d63;
}
.f-s1 { fill: var(--s1); background-color: var(--s1); } .f-s2 { fill: var(--s2); background-color: var(--s2); }
.f-s3 { fill: var(--s3); background-color: var(--s3); } .f-s4 { fill: var(--s4); background-color: var(--s4); }
.f-s5 { fill: var(--s5); background-color: var(--s5); } .f-s6 { fill: var(--s6); background-color: var(--s6); }
.f-s7 { fill: var(--s7); background-color: var(--s7); } .f-s8 { fill: var(--s8); background-color: var(--s8); }
.f-other { fill: var(--s-other); background-color: var(--s-other); }

a { color: var(--thread); }
.gate-back a { color: var(--band-ink-2); font-size: 13px; }
.sites { display: flex; gap: 14px; margin-left: 18px; flex-wrap: wrap; }
.sites a { color: var(--band-ink-2); font-size: 13px; text-decoration: none; border-bottom: 1px solid var(--band-rule); }
.sites a:hover { color: var(--band-ink); }
.headline { display: block; margin-top: 22px; padding-bottom: 34px; }
.headline h1 { max-width: 46ch; }
.headline p { margin: 8px 0 0; color: var(--band-ink-2); }

.sheet { gap: 40px; }
.sheet > section { display: grid; gap: 14px; scroll-margin-top: 14px; grid-template-columns: minmax(0, 1fr); }
.sheet > * { min-width: 0; }
.section-head { margin-bottom: 0; flex-wrap: wrap; }
.note { color: var(--ink-2); font-size: 13px; }
.more { margin-left: auto; font-size: 13px; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: -48px; }
.tile { background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; display: grid; gap: 2px; align-content: start;
  transition: border-color .2s var(--ease), transform .2s var(--ease); }
.tile:hover { transform: translateY(-1px); border-color: var(--rule-strong); }
.tile .k { font-size: 12px; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.tile .v { font: 700 28px/1.15 var(--font-display); }
.tile .d { font-size: 12.5px; color: var(--ink-2); }
.tile .d.bad { color: var(--high); font-weight: 600; }
.tile .d.good { color: var(--ok); font-weight: 600; }

.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: -22px 0 -18px; }
.jump a { font-size: 13px; font-weight: 600; text-decoration: none; padding: 5px 12px; border-radius: 99px; background: var(--paper);
  border: 1px solid var(--rule); color: var(--ink-2); }
.jump a:hover { border-color: var(--thread); color: var(--thread); }

.grid { display: grid; gap: 14px; align-items: start; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two-one { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: 16px 18px; margin: 0; min-width: 0; }
.card h3 { font-size: 15px; margin-bottom: 10px; }
.card figcaption { display: grid; gap: 2px; margin-bottom: 8px; }
.card figcaption b { font: 700 15px var(--font-display); }
.card figcaption span { color: var(--ink-2); font-size: 12.5px; }
details.card summary { cursor: pointer; list-style: none; }
details.card summary h3 { display: inline; margin: 0; }
details.card summary::before { content: "▸ "; color: var(--ink-3); }
details.card[open] summary::before { content: "▾ "; }
details.card[open] summary { margin-bottom: 10px; }

.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--ink-2); font: 11px var(--font-body); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: var(--thread); opacity: 0; }
.chart .hit:hover, .chart .hit:focus { opacity: .1; outline: none; }
.chart .billed { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.chart .line { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--s1); stroke: var(--paper); stroke-width: 2; }
.chart text.endlabel { fill: var(--ink); font-weight: 600; }
.chart .seg { stroke: var(--paper); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 6px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.dash { height: 2px; border-radius: 1px; background: var(--ink); width: 12px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 8px; }

.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--band); color: var(--band-ink); border-radius: 10px;
  padding: 9px 12px; font-size: 12.5px; box-shadow: var(--shadow); max-width: 280px; border: 1px solid var(--band-rule); }
.tip b { display: block; margin-bottom: 4px; font-family: var(--font-display); }
.tip .r { display: flex; justify-content: space-between; gap: 18px; }
.tip .r span:last-child { font-family: var(--font-mono); }
.tip .r i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }

.hbars { display: grid; gap: 7px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 10px; border-radius: 4px; background: var(--low-soft); overflow: hidden; }
.hbar .fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--s1); min-width: 2px; }
.hbar .fill.muted { background: var(--s-other); }
.hbar .fill.hot { background: var(--high); }
.hbar .fill.ok { background: var(--ok); }
.hbar .n { font: 500 12.5px var(--font-mono); color: var(--ink); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; text-align: right; font-family: var(--font-mono); font-size: 13px; }
.hbars + .facts, .meters + .facts { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); }

.table-wrap.flat, .items.flat, .plain.flat { border: 0; border-radius: 0; background: none; }
.table-wrap.flat th:first-child, .table-wrap.flat td:first-child { padding-left: 0; }
.table-wrap.flat th:last-child, .table-wrap.flat td:last-child { padding-right: 0; }
td.wrap { white-space: normal; min-width: 220px; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { font-family: var(--font-mono); font-size: 13px; }
.late { color: var(--high); font-weight: 600; }
.plain.flat li { padding: 9px 0; }
.plain.cols { columns: 3 220px; }
.plain.cols li { break-inside: avoid; border-top: 0; padding: 4px 0; font-size: 13px; }
.items .item .row { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; }
.items.flat .item .row { padding: 10px 0; }
.sev-bad { background: var(--crit-soft); color: var(--high); }
.sev-warn { background: var(--med-soft); color: var(--med); }
.sev-good { background: var(--ok-soft); color: var(--ok); }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 12.5px; padding: 3px 10px; border-radius: 99px; background: var(--low-soft); color: var(--ink-2);
  display: inline-flex; gap: 6px; align-items: center; }
.chips li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.chips li.down { background: var(--crit-soft); color: var(--high); font-weight: 600; }
.chips li.down::before { background: var(--high); }
.chips li.soon { background: var(--med-soft); color: var(--med); font-weight: 600; }
.chips li.soon::before { background: var(--med); }
.chips li b { font-family: var(--font-mono); font-weight: 500; color: var(--ink); }

.meters { display: grid; gap: 10px; }
.meter { display: grid; grid-template-columns: 70px 1fr 54px; gap: 10px; align-items: center; font-size: 13px; }
.meter .track { height: 10px; border-radius: 5px; background: var(--low-soft); overflow: hidden; }
.meter .fill { display: block; height: 100%; background: var(--s1); border-radius: 0 5px 5px 0; }
.meter .fill.warn { background: var(--med); }
.meter .fill.hot { background: var(--high); }
.meter .n { font: 500 12.5px var(--font-mono); text-align: right; }
.mailbox .nums { display: flex; gap: 22px; margin-bottom: 8px; flex-wrap: wrap; }
.mailbox .nums div { display: grid; }
.mailbox .nums b { font: 700 22px var(--font-display); }
.mailbox .nums span { font-size: 12px; color: var(--ink-2); }
.mailbox h4 { margin: 12px 0 6px; font: 600 12px var(--font-body); color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.errs { color: var(--med); }
.dim { color: var(--ink-3); }

@media (max-width: 900px) {
  .grid.two, .grid.three, .grid.two-one { grid-template-columns: minmax(0, 1fr); }
  .sites { order: 5; width: 100%; margin-left: 0; }
  .band-top { flex-wrap: wrap; }
  .tiles { grid-template-columns: repeat(2, 1fr); margin-top: -36px; }
  .items .item .row { grid-template-columns: 70px 1fr; }
  .items .item .row .tag { display: none; }
}
.table-wrap.flat th, .table-wrap.flat td { padding-left: 8px; padding-right: 8px; }
.table-wrap.flat th:first-child, .table-wrap.flat td:first-child { padding-left: 0; }
.table-wrap.flat th:last-child, .table-wrap.flat td:last-child { padding-right: 0; }
.plain li > span:first-child { min-width: 0; }
.plain .sub { display: block; color: var(--ink-3); font-size: 12.5px; }
