/* Signal Scope - page base and primitives. */
body.sg-page { margin: 0; background: var(--bg-primary); color: var(--text-primary); font-family: "Inter", "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; min-height: 100vh; overflow-x: clip; }
body.sg-page *, body.sg-page *::before, body.sg-page *::after { box-sizing: border-box; }
body.sg-page [hidden] { display: none !important; }
html.sg-lock { overflow: hidden; }
/* V6-02: --sg-scroll-pb is the height of a sticky bottom bar (the phone composer's action bar, set by composer.js) so focus() and
   scrollIntoView() keep a focused control above it; 0 when nothing is stuck to the bottom. */
html { scroll-padding-top: calc(var(--sg-nav-h, 64px) + 24px); scroll-padding-bottom: var(--sg-scroll-pb, 0px); }

.sg *, .sg *::before, .sg *::after { box-sizing: border-box; }
.sg [hidden] { display: none !important; }
.sg h1, .sg h2, .sg h3, .sg h4, .sg p, .sg ul, .sg ol, .sg dl, .sg dd, .sg figure, .sg blockquote { margin: 0; }
.sg ul, .sg ol { padding: 0; list-style: none; }
.sg h1, .sg h2, .sg h3, .sg h4 { font-family: var(--sg-display); font-weight: 600; letter-spacing: -.01em; color: var(--sg-text); text-wrap: balance; }
/* V8-01: break-word (not anywhere) so table cells size to whole words and plan names never split mid-word. */
.sg p, .sg li, .sg dd, .sg dt, .sg td, .sg th { overflow-wrap: break-word; }
.sg button { font: inherit; color: inherit; }
.sg a { color: var(--sg-accent-text); text-underline-offset: 3px; }
.sg a:hover { color: #D2CBFF; }
.sg img, .sg svg { max-width: 100%; }
.sg .sg-muted, .sg-muted { color: var(--sg-muted); }
.sg-num { font-variant-numeric: tabular-nums; }
.sg td, .sg th, .sg-gauge__num, .sg-stat__v, .sg-meter, .sg-prog__clock { font-variant-numeric: tabular-nums; }

/* Visually hidden */
.sg-vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Focus: one ring everywhere, never removed without a replacement. */
.sg :focus-visible, .sg-skip:focus-visible { outline: 3px solid var(--sg-focus, #C4B5FD); outline-offset: 2px; border-radius: 6px; }
.sg input:focus-visible, .sg textarea:focus-visible, .sg select:focus-visible { outline-offset: 0; }
.sg :focus:not(:focus-visible) { outline: none; }
.sg [tabindex="-1"]:focus { outline: none; }
/* V7-09: a heading focused BY THE APP (after Undo, a report opening, a dialog closing) gets a visible marker even when the browser decides
   :focus-visible does not apply (the last input was a pointer); util/a11y.js focusEl() sets .is-progfocus and removes it on blur. */
.sg .is-progfocus:focus { outline: 2px solid var(--sg-focus, #C4B5FD); outline-offset: 4px; border-radius: 6px; }
.sg-fail__title:focus-visible, .sg-rhead__title:focus-visible, .sg-sec__title:focus-visible, .sg-prog__title:focus-visible, .sg-compcard__title:focus-visible { outline: 3px solid var(--sg-focus); outline-offset: 4px; }

.sg-skip { position: fixed; left: 16px; top: -80px; z-index: 100000; box-shadow: 0 8px 30px rgba(0,0,0,.5); background: #fff; color: #0D0C1D; padding: 10px 16px; border-radius: 8px; font: 600 .9375rem/1.2 "Inter", sans-serif; text-decoration: none; }
.sg-skip:focus, .sg-skip:focus-visible { top: 12px; }

.sg-icon { flex: none; vertical-align: -.2em; }

/* V5-07: `.sg` itself is listed as well as its descendants: the popover, menu, toast host, drawer layer and dialog are appended to <body> and carry .sg as their own root. */
@media (prefers-reduced-motion: reduce) {
  .sg, .sg *, .sg *::before, .sg *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
