/* Additions to the v3 design stylesheet (app.css) that the live portal needs. */
[hidden] { display: none !important; }
.app { min-height: 100vh; }
.content:focus { outline: none; }
.loading, .err-box { padding: 48px 24px; text-align: center; color: var(--muted); }
.err-box b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }
.field .err { color: var(--bad, #a8241c); font-size: 13px; }
.reason-row { display: flex; flex-direction: column; gap: 10px; }
.soon { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.mono.wrap { word-break: break-all; }
.code .grp { display: inline-flex; gap: 6px; font-style: normal; }

/* ---------- QA fixes (2026-11-22) ---------- */

/* Scale the whole portal with the screen: smaller on small screens, bigger on large ones.
   --z is the zoom factor; heights tied to the viewport divide by it so they still fill the screen. */
.app { --z: 1; zoom: var(--z); min-height: calc(100vh / var(--z)); flex-wrap: nowrap; }
@media (max-width: 1366px) { .app { --z: .94; } }
@media (max-width: 1100px) { .app { --z: .9; } }
@media (max-width: 600px)  { .app { --z: .86; } }
@media (min-width: 1680px) { .app { --z: 1.1; } }
@media (min-width: 1920px) { .app { --z: 1.2; } }
@media (min-width: 2400px) { .app { --z: 1.4; } }
@media (min-width: 3200px) { .app { --z: 1.75; } }

/* The menu stays in view while the page scrolls. */
.side { position: sticky; top: 0; height: calc(100vh / var(--z)); align-self: flex-start; overflow-y: auto; overflow-x: hidden; }
.app.rail .side { overflow: visible; }

/* Narrow screens: the menu is an icon rail (no labels) instead of a bar across the top. */
@media (max-width: 1100px) {
  .app .side, .app.rail .side { flex: 0 0 68px; flex-direction: column; align-items: stretch; padding: 14px 8px; gap: 14px; overflow: visible; }
  .side::after, .rail-btn, .brand-name, .side-foot .lbl, .cc-logo { display: none !important; }
  .brand { flex-direction: column !important; padding: 0 !important; align-items: center; }
  .nav { flex-direction: column; gap: 4px; }
  .nav a, .app.rail .nav a { min-height: 44px; padding: 0 !important; justify-content: center !important; position: relative; }
  .app .nav .lbl, .app.rail .nav .lbl, .app .nav .count, .app.rail .nav .count { display: none !important; }
  .app .nav-group, .app.rail .nav-group { display: block !important; height: 1px; padding: 0; margin: 6px 10px; border-top: 1px solid rgba(255,255,255,.18); font-size: 0; }
  .nav a .dotc { display: block !important; }
  .side-foot { align-items: center; padding: 10px 0; }
  .cc-sym { display: block !important; }
  .nav a[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 56px; top: 50%; transform: translateY(-50%); background: var(--ink); color: var(--surface);
    font-size: 13px; padding: 4px 10px; border-radius: 4px; white-space: nowrap; z-index: 50; pointer-events: none; }
  .main { flex: 1 1 0; }
}
@media (max-width: 600px) {
  .app .side, .app.rail .side { flex-basis: 56px; padding: 12px 6px; }
  .brand-mark { width: 36px; height: 36px; }
  .topbar { gap: 8px; }
  .top-actions { gap: 6px; }
  .banner { padding: 20px; }
  .banner h1 { font-size: 26px; line-height: 32px; }
}

/* Tab rows scroll sideways only; no stray vertical scrollbar. */
.tabs { overflow-y: hidden; scrollbar-width: thin; flex-shrink: 0; }
.drawer-head { flex-shrink: 0; }

/* Installations: list and details side by side on wide screens, stacked below 1180px. */
.inst-grid { grid-template-columns: minmax(280px, 1fr) minmax(0, 1.5fr); }
@media (max-width: 1180px) { .inst-grid { grid-template-columns: minmax(0, 1fr); } }
.lrow .mono { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Pins too close to label show only the dot. */
.pin .pin-gap { visibility: hidden; padding: 1px 0; }
.wrap-any { display: block; overflow-wrap: anywhere; font-size: 12px; }
.fact b.mono.wrap { overflow-wrap: anywhere; }
.lrow .num b { display: inline; font-size: inherit; }
/* Outline buttons on the dark banner need light text to stay readable. */

.banner .btn.ghost { color: #fff !important; border-color: rgba(255, 255, 255, .55); background: transparent; }
.banner .btn.ghost:hover { background: rgba(255, 255, 255, .12); }
.banner.sand .btn.ghost { color: #1c1c1c !important; border-color: rgba(28, 28, 28, .4); }
.hi .chg { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; font-family: var(--mono); font-size: 12px; color: var(--ink); overflow-wrap: anywhere; }

/* ---------- Side menu: fixed footer, no menu-wide scroll (feedback 2026-11-22) ---------- */
/* The menu is exactly one screen tall. Brand and footer keep their size; only the list of pages may shrink,
   and it scrolls on its own (without a visible bar) only on very short screens. */
.side, .app.rail .side { overflow: hidden; }
.side .brand, .side .side-foot { flex-shrink: 0; }
.side .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.side .nav::-webkit-scrollbar { display: none; }
.side .side-foot { margin-top: 0; }
/* Icon rail: the name tooltip pops out to the right, so nothing may clip it. */
.app.rail .side, .app.rail .side .nav { overflow: visible; }
@media (max-width: 1100px) { .app .side, .app .side .nav { overflow: visible; } }

/* Wide but short screens: scale by height too, so the menu fits without scrolling. */
@media (min-width: 1680px) and (max-height: 960px) { .app { --z: 1.05; } }
@media (min-width: 1101px) and (max-height: 800px) { .app { --z: .9; } }
@media (min-width: 1101px) and (max-height: 680px) { .app { --z: .8; } }
@media (max-width: 1100px) { .app .side .side-foot { display: flex !important; align-items: center; gap: 10px; } .app .side .side-foot .lbl { display: none !important; } }
/* Dark console menu (design v3, menu update): the status panel needs the full width, so the icon rail drops it. */
@media (max-width: 1100px) { .app .side .sys { display: none !important; } .app .side .side-foot { flex-direction: column; } .nav a.on::before { display: none; } }
/* The sticky menu is its own layer: keep it above the page so the collapsed menu's name tooltips are not cut off. */
.side { z-index: 30; }
.app.rail .nav a[data-tip]:hover::after, .nav a[data-tip]:hover::after { z-index: 100; }

/* Night drill-through and rejection details */
.drill-row { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; color: var(--ink) !important; text-decoration: none; box-shadow: none; border: 1px solid var(--line); }
.drill-row:hover { border-color: var(--orange); }
.drill-row + .drill-row { margin-top: 10px; }
.drill-why { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 6px; background: var(--surface-tint); font-size: 13px; overflow-wrap: anywhere; }
.drill-why .btn { align-self: flex-start; }
.readout { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* Offline refresh and sandbox permits */
.drop { cursor: pointer; width: 100%; }
.drop.over { border-color: var(--orange); background: var(--orange-tint); }
pre.mail { margin: 0; padding: 14px 16px; border-radius: 6px; background: var(--surface-tint); border: 1px solid var(--line); font-family: var(--font); font-size: 14px; line-height: 21px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.t td small { display: block; color: var(--ink-muted); font-size: 12px; }
