/* The Overview: a strict grid of same-size widgets (home.html, _overview_widgets.html, _charts.html). White page,
   white cards with a 1px border and a header divider; colour only where it carries meaning (severity dots, donut
   segments, the score tone). Same tokens and dark mode as the rest of the app. Animation: the page fades in once,
   the rings sweep in clockwise from 12 o'clock and the centre numbers count up (overview.js); reduced motion
   shows the final state at once. Timing matches the topology intro (.4s / .8s ease-out). */
.ov-page { display: flex; flex-direction: column; gap: 18px; }
.ov-page [hidden] { display: none !important; }
.ov-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ov-top h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.ov-lead { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.ov-lead a { color: inherit; }
.ov-hint { margin: 10px 0 0; font-size: 13.5px; color: var(--text); max-width: 72ch; }      /* an empty estate: what to do next */
.ov-hint i { color: var(--accent); margin-right: 4px; }
.ov-lead .is-bad, .ov-lead a.is-bad { color: var(--danger-text, var(--danger)); font-weight: 600; }
.ov-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ov-actions .soft { min-height: 36px; }
/* Toggle widgets: a secondary button that opens a compact menu (one checkbox row per widget, Reset layout at the foot) */
.ov-toggle { position: relative; }
.ov-toggle-btn { list-style: none; display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 13px; border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--surface); color: var(--accent); font-size: 13.5px; font-weight: 500; cursor: pointer; user-select: none; }
.ov-toggle-btn::-webkit-details-marker { display: none; }
.ov-toggle-btn:hover, .ov-toggle[open] > .ov-toggle-btn { background: var(--accent-soft); }
.ov-toggle-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ov-toggle-caret { font-size: 10px; transition: transform .15s ease; }
.ov-toggle[open] .ov-toggle-caret { transform: rotate(180deg); }
.ov-toggle-list { min-width: 260px; right: 0; }
.ov-toggle-list .ov-toggle-row { white-space: nowrap; }   /* the shared menu rules (cinqstack.css) give the row its padding, hover and font */
.ov-toggle-row input { margin: 0; accent-color: var(--accent); }
.ov-toggle-row i { width: 14px; color: var(--muted); font-size: 12px; text-align: center; }
.wg-menu-sep { height: 1px; margin: 6px 0; background: var(--border); }
/* the page always has its scrollbar, so an open menu that reaches below the fold never shifts the grid; a reserved but
   empty gutter left the banner and the top bar 8 px short of the right edge (ee's re-walk of dc0eda7, 2026-11-12) */
:root:has(.ov-page) { overflow-y: scroll; }

/* the grid: every widget the same size */
/* four columns on a wide screen, each widget spanning 1 to 4 (its saved width); rows share a height; full content width */
.ov-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(300px, auto); gap: 16px; }
.wg.w2 { grid-column: span 2; } .wg.w3 { grid-column: span 3; } .wg.w4 { grid-column: span 4; }
@media (max-width: 1100px) { .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wg.w3, .wg.w4 { grid-column: span 2; } }
@media (max-width: 720px) { .ov-grid { grid-template-columns: 1fr; } .wg.w2, .wg.w3, .wg.w4 { grid-column: span 1; } }
.wg { position: relative; display: flex; flex-direction: column; min-height: 300px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; transition: border-color .15s ease; }
.wg:hover { border-color: var(--border-strong); }                 /* a calm lift: the border one step darker */
.wg.is-dragging { opacity: .45; outline: 2px dashed var(--border-strong); outline-offset: -2px; background: var(--surface-2); }   /* the dragged card is the placeholder */
.wg.is-selected { outline: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px; }
.wg:focus { outline: none; }
.wg-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 16px; background: var(--band); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; cursor: grab; }
.wg-head:active { cursor: grabbing; }
.wg-title { margin: 0; flex: 1; min-width: 0; font-size: 13px; font-weight: 700; letter-spacing: .01em; color: var(--title); line-height: 1.3; overflow-wrap: anywhere; }   /* wraps, never cut: "Findings by se…" at 1280 (fc's walk, 2026-11-15) */
.wg-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: var(--radius); background: none; color: var(--muted); font-size: 13px; cursor: pointer; list-style: none; }
.wg-btn::-webkit-details-marker { display: none; }
.wg-menu > summary::before, .wg-menu > summary::after { content: none; display: none; }
.wg-btn { transition: background-color .14s ease, color .14s ease; }
.wg-btn:hover { background: var(--surface-3); color: var(--title); }
.wg-btn:active { background: var(--border-strong); transform: scale(.97); }
.ov-actions .soft:active { transform: scale(.97); }
.wg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wg-btn.is-spinning i { animation: wg-spin .8s linear infinite; }
@keyframes wg-spin { to { transform: rotate(360deg); } }
.wg-menu { position: relative; }
.wg:has(.wg-menu[open]) { z-index: 7; }                   /* an open menu floats above the neighbouring widgets */
.wg-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 160px; display: flex; flex-direction: column; }   /* panel look and items: the shared menu rules (cinqstack.css) */
.wg-menu[open] .wg-menu-list { animation: wg-menu-in .12s ease-out both; transform-origin: top right; }
@keyframes wg-menu-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.wg-menu-label { display: flex; align-items: center; gap: 8px; padding: 8px 10px 2px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wg-menu-label i { width: 14px; font-size: 11px; }
.wg-size { display: flex; gap: 4px; padding: 4px 10px 8px; }
.wg-size button { flex: 1; height: 26px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; transition: background-color .12s ease, color .12s ease, border-color .12s ease; }
.wg-size button:hover { background: var(--surface-3); color: var(--title); }
.wg-size button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.wg-body { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 12px 18px 14px; min-height: 0; position: relative; }
/* the skeleton while a widget loads: shimmer by transform only */
.wg-body.is-loading > :not(.wg-skel) { visibility: hidden; }
.wg-skel { position: absolute; inset: 12px 18px 14px; display: grid; align-content: start; gap: 12px; }
.wg-skel span { display: block; height: 14px; border-radius: var(--radius); background: var(--surface-2); position: relative; overflow: hidden; }
.wg-skel span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--surface-3), transparent); transform: translateX(-100%); animation: wg-shimmer 1.2s ease-in-out infinite; }
@keyframes wg-shimmer { to { transform: translateX(100%); } }
.wg-link { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-left: -8px; padding: 6px 8px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; text-decoration: none; transition: background-color .15s ease; }
.wg-link::after { content: "\2192"; display: inline-block; opacity: 0; transform: translateX(-4px); transition: opacity .15s ease, transform .15s ease; }
.wg-link:hover, .wg-link:focus-visible { background: var(--surface-2); text-decoration: none; }
.wg-link:hover::after, .wg-link:focus-visible::after { opacity: 1; transform: none; }
.wg-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wg-note { font-size: 12.5px; color: var(--muted); text-align: center; }
.wg-more { font-size: 12px; color: var(--muted); padding: 6px 0; }
.wg-rest { display: none; }
.wg.is-full .wg-rest { display: block; }
.wg.is-full .wg-more { display: none; }

/* rows: a dot that means something, two lines of text, a value on the right. Hover fills the whole row (the
   FortiManager way): a soft tint with rounded corners and inner padding, the text stays as it is, and on a row that
   leads somewhere the action text takes the accent and an arrow slides in. Keyboard focus looks the same. */
.wg-row { display: flex; gap: 10px; align-items: flex-start; margin: 0 -16px; padding: 8px 16px; border-radius: 0; border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none; min-width: 0; transition: background-color .15s ease; }
.wg-row:last-of-type { border-bottom: 0; }
a.wg-row { cursor: pointer; }
a.wg-row:hover, a.wg-row:focus-visible { background: var(--surface-2); text-decoration: none; outline: none; }
a.wg-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
a.wg-row .wg-row-c:not(.is-time)::after { content: "\2192"; display: inline-block; margin-left: 6px; opacity: 0; transform: translateX(-4px); transition: opacity .15s ease, transform .15s ease; }
a.wg-row:hover .wg-row-c:not(.is-time), a.wg-row:focus-visible .wg-row-c:not(.is-time) { color: var(--accent-hover); }
a.wg-row:hover .wg-row-c:not(.is-time)::after, a.wg-row:focus-visible .wg-row-c:not(.is-time)::after { opacity: 1; transform: none; }
.wg-dot { flex: none; width: 8px; height: 8px; border-radius: 0; margin-top: 7px; background: var(--border-strong); }
.wg-dot.tone-bad, .wg-dot.sev-high { background: var(--danger); }
.wg-dot.tone-warn, .wg-dot.sev-medium { background: var(--warn); }
.wg-dot.sev-low { background: var(--info); }
.wg-dot.sev-info, .wg-dot.tone-na, .wg-dot.tone-info { background: var(--border-strong); }
.wg-dot.tone-good, .wg-dot.good { background: var(--success); }
.wg-dot.fair { background: var(--warn); }
.wg-dot.poor { background: var(--danger); }
.wg-thumb { flex: none; width: 64px; min-height: 30px; padding: 2px; border-radius: var(--radius); margin-top: 1px; }
/* a row with a thumbnail (the Sites widget) is tight: the chip sits under the facts instead of beside the name, and the
   site's name may take two lines, so "CM-AUS Austin SMT Line" reads whole instead of "CM-A…" */
.wg-row:has(.wg-thumb) { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main c" "thumb thumb"; column-gap: 10px; row-gap: 6px; align-items: start; }
.wg-row:has(.wg-thumb) .wg-thumb { grid-area: thumb; width: 100%; padding: 3px 4px; }      /* the sketch under the text at the row's width, readable */
.wg-row:has(.wg-thumb) .wg-thumb .topo-thumb-svg { max-height: 44px; }
.wg-row:has(.wg-thumb) .wg-thumb .tt-band { fill-opacity: .8; }
.wg-row:has(.wg-thumb) .wg-thumb .tt-node { stroke-width: 1.4; }
.wg-row:has(.wg-thumb) .wg-row-main { grid-area: main; }
.wg-row:has(.wg-thumb) .wg-row-c { grid-area: c; padding-top: 0; }
.wg-row:has(.wg-thumb) .wg-row-a { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.wg-thumb .topo-thumb-svg { max-height: 40px; }
.wg-row-main { flex: 1 1 170px; min-width: 0; }
/* a narrow widget (four across at 1440): the row's action drops under the text instead of squeezing it (ee, 2026-11-12) */
.wg-row:not(:has(.wg-thumb)) { flex-wrap: wrap; row-gap: 2px; }
.wg-row:not(:has(.wg-thumb)) > .wg-row-c { margin-left: auto; }
/* two lines before an ellipsis (ee's visitor walk, 2026-11-12: "Penang vSphe…" at 1440 beside the row's action) */
.wg-row-a { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--title); font-size: 13.5px; line-height: 1.35; overflow: hidden; overflow-wrap: anywhere; }
/* Needs you says what to do: its titles wrap whole, never "… 53 changes t…" (ee-sweep-14-5, 390 px) */
.wg[data-widget="todo"] .wg-row-a { display: block; -webkit-line-clamp: unset; overflow: visible; }
.wg-row-b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 12px; line-height: 1.35; color: var(--muted); overflow: hidden; overflow-wrap: anywhere; }
/* the right column: an action reads as a tertiary button (blue, Inter, arrow on hover); a time is mono, dimmed, on a fixed column */
.wg-row-c { flex: none; font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: var(--accent); padding-top: 1px; transition: color .15s ease; }
.wg-row-c.is-time { font-family: var(--font-mono); font-weight: 400; color: #5f6e7e; min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
/* ee-10: --faint was 2.6:1 on white; #5f6e7e is 5.2:1, and dark mode's --muted is about 6:1 on the navy */
:root[data-theme="dark"] .wg-row-c.is-time { color: var(--muted); }
.wg-row-c .score { font-size: 11.5px; font-weight: 600; padding: 1px 7px; }
.wg-empty { display: flex; align-items: center; gap: 10px; padding: 18px 4px; color: var(--muted); font-size: 13px; }
.wg-empty i { color: var(--faint); font-size: 16px; }
.ov-none { grid-column: 1 / -1; justify-content: center; border: 1px dashed var(--border); border-radius: var(--radius); }

/* the four small stats (Automation) */
.wg-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wg-stats a { display: block; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); color: var(--text); text-decoration: none; }
.wg-stats a:hover { background: var(--surface-3); text-decoration: none; }
.wg-stats b { display: block; font-size: 22px; font-weight: 500; color: var(--title); font-variant-numeric: tabular-nums; line-height: 1.1; }
.wg-stats b.is-bad { color: var(--danger-text, var(--danger)); }
.wg-stats span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* charts: the categorical series (Devices by site) is one hue at clearly separate lightness steps, chosen per theme
   so each step reads against the card (dark steps on the light card, light steps on the dark card); a thin gap
   between segments comes from the geometry (overview.GAP). Severity keeps its meaning colours. */
:root { --ch-1: color-mix(in srgb, var(--accent) 70%, #0b1a3a); --ch-2: var(--accent); --ch-3: color-mix(in srgb, var(--accent) 58%, white);
        --ch-4: color-mix(in srgb, var(--accent) 36%, white); --ch-5: color-mix(in srgb, var(--accent) 20%, white); --ch-6: var(--border-strong); }
:root[data-theme="dark"] { --ch-1: color-mix(in srgb, var(--accent) 32%, white); --ch-2: color-mix(in srgb, var(--accent) 68%, white); --ch-3: var(--accent);
        --ch-4: color-mix(in srgb, var(--accent) 62%, #0b1220); --ch-5: color-mix(in srgb, var(--accent) 40%, #0b1220); --ch-6: var(--border-strong); }
/* charts */
.wg-chart { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 6px 0 4px; }
.wg-chart-centre { flex-direction: column; justify-content: flex-start; gap: 12px; flex: 1; padding-top: 10px; }   /* at the top: a tall row (the Sites widget) left the gauge far down a blank card (Jon, 2026-11-27) */
.ch-donut, .ch-ring { position: relative; width: var(--size, 148px); height: var(--size, 148px); flex: none; }
.ch-donut svg, .ch-ring svg { width: 100%; height: 100%; display: block; }
.ch-track { fill: none; stroke: var(--surface-3); stroke-width: 22; }
.ch-seg { fill: none; stroke-width: 22; stroke-linecap: butt; stroke: var(--border-strong); transition: stroke-dasharray .8s ease-out, stroke-opacity .15s ease, stroke-width .15s ease; cursor: default; }
.ch-seg.sev-high { stroke: var(--danger); } .ch-seg.sev-medium { stroke: var(--warn); } .ch-seg.sev-low { stroke: var(--info); } .ch-seg.sev-info { stroke: var(--border-strong); }
.ch-seg.c1 { stroke: var(--ch-1); } .ch-seg.c2 { stroke: var(--ch-2); } .ch-seg.c3 { stroke: var(--ch-3); } .ch-seg.c4 { stroke: var(--ch-4); } .ch-seg.c5 { stroke: var(--ch-5); } .ch-seg.c6 { stroke: var(--ch-6); }
.ch-ring.provisional .ch-seg { stroke: var(--muted); } .ch-ring.good .ch-seg { stroke: var(--success); } .ch-ring.fair .ch-seg { stroke: var(--warn); } .ch-ring.poor .ch-seg { stroke: var(--danger); } .ch-ring.none .ch-seg { stroke: var(--surface-3); }
.ch-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.ch-num { font-size: calc(var(--size, 148px) * .21); font-weight: 600; color: var(--title); line-height: 1.05; font-variant-numeric: tabular-nums; }
.ch-tip { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; padding: 6px 9px; border-radius: var(--radius); background: var(--tip-bg); color: var(--tip-fg); font-size: 12px; white-space: nowrap; opacity: 0; transition: opacity .12s ease; will-change: transform; }
.ch-tip.is-on { opacity: 1; }
.ch-ring .ch-num { font-weight: 700; font-size: calc(var(--size, 54px) * .27); }
.ch-ring[style*="--size: 148px"] .ch-num { font-weight: 500; font-size: 26px; }
.ch-sub { font-size: 12px; color: var(--muted); }
.ch-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; min-width: 130px; flex: 1; }
.ch-legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); min-width: 0; margin: 0 -8px; padding: 6px 8px; border-radius: 0; border-bottom: 1px solid var(--border); transition: background-color .15s ease; }
.ch-legend li:last-child { border-bottom: 0; }
.ch-legend li:hover, .ch-legend li:focus-within { background: var(--surface-2); }
.ch-legend a:hover { text-decoration: none; color: inherit; }
.ch-seg.is-dim { stroke-opacity: .35; }
.ch-seg.is-hot { stroke-width: 26; }
.ch-legend li > a, .ch-legend li > span:not(.ch-dot) { flex: 1; min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; color: inherit; }   /* site names wrap (ee-6) */
.ch-legend b { font-weight: 500; color: var(--title); font-variant-numeric: tabular-nums; }
.ch-dot { flex: none; width: 10px; height: 10px; border-radius: 0; background: var(--border-strong); }
.ch-dot.sev-high { background: var(--danger); } .ch-dot.sev-medium { background: var(--warn); } .ch-dot.sev-low { background: var(--info); } .ch-dot.sev-info { background: var(--border-strong); }
.ch-dot.c1 { background: var(--ch-1); } .ch-dot.c2 { background: var(--ch-2); } .ch-dot.c3 { background: var(--ch-3); } .ch-dot.c4 { background: var(--ch-4); } .ch-dot.c5 { background: var(--ch-5); } .ch-dot.c6 { background: var(--ch-6); }

/* the ring on site cards and the sites table (replaces the conic-gradient .score-ring) */
.site-top .ch-ring { margin-left: auto; }

/* expand: one widget fills the window */
.wg.is-full { position: fixed; inset: 16px; z-index: 60; min-height: 0; box-shadow: var(--shadow-lg); grid-column: auto; }
.wg.is-full .wg-head { cursor: default; }
.wg.is-full .wg-body { overflow: auto; }
.wg.is-full .ch-donut, .wg.is-full .ch-ring { --size: 220px; }
.ov-backdrop { position: fixed; inset: 0; z-index: 59; background: rgba(16, 24, 40, .35); }

/* first load: widgets fade in with a short stagger; rings sweep in clockwise, segments staggered */
@keyframes ov-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ch-sweep { from { stroke-dasharray: 0 364.4; } }
.ov-intro .wg { animation: ov-fade .4s ease-out both; animation-delay: calc(var(--i, 0) * 40ms); }
.ov-intro .ch-anim .ch-seg { animation: ch-sweep .8s ease-out both; animation-delay: calc(var(--i, 0) * 60ms + 150ms); }
.ch-anim.is-live .ch-seg { animation: none; }                  /* a refresh animates old -> new via the transition */
@media (prefers-reduced-motion: reduce) {
  .ov-intro .wg, .ov-intro .ch-anim .ch-seg, .wg-btn.is-spinning i, .wg-menu[open] .wg-menu-list, .wg-skel span::after { animation: none !important; }
  .ch-seg, .wg-btn, .wg-size button { transition: none; }
}

/* footer: system and licence in one line */
.ov-foot { font-size: 13px; color: var(--muted); padding: 4px 2px 12px; }
.ov-foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* dark mode: same tokens; only the drop marker and the backdrop need a nudge */
:root[data-theme="dark"] .ov-backdrop { background: rgba(0, 0, 0, .55); }
/* the advisory exposure widget's one-line headline (3c, 2026-11-14) */
.wg-headline { font-size: 15px; color: var(--title); margin: 2px 0 10px; } .wg-headline b { font-weight: 650; }

/* a phone (the demo walk, 2026-11-14): a widget is as tall as what it holds, so an empty one is not a large blank box */
@media (max-width: 640px) {
  .wg { min-height: 0; }
  .wg-body { flex: none; }
}
