/* SigmoNet shared engineering-window design system.
   Feature styles keep their own charts/tables/forms; this layer standardizes
   the modal shell, header, backdrop, scrolling and footer actions. */

:root{
  --tt-ew-ink:#20283d;
  --tt-ew-title:#1e2a78;
  --tt-ew-muted:#747f92;
  --tt-ew-line:#e4e8f1;
  --tt-ew-soft:#f6f8fc;
  --tt-ew-icon-bg:#eef2ff;
  --tt-ew-icon:#3149a5;
  --tt-ew-shadow:0 24px 70px rgba(13,24,55,.28);
  --tt-ew-radius:18px;
  --tt-ew-head-pad:15px 17px;
  --tt-ew-body-pad:16px;
  --tt-ew-footer-pad:11px 14px;
}

/* Shared modal viewport behaviour. */
.network-health-dialog,
.channel-opt-dialog,
.ap-placement-dialog,
.requirements-dialog,
.site-survey-dialog,
.rfv-dialog,
.rr-dialog,
.wired-dialog,
.scenario-planner-dialog,
.prof-report-dialog,
.live-wifi-test-dialog{
  border:0;
  padding:0;
  background:transparent;
  color:var(--tt-ew-ink);
}

.network-health-dialog::backdrop,
.channel-opt-dialog::backdrop,
.ap-placement-dialog::backdrop,
.requirements-dialog::backdrop,
.site-survey-dialog::backdrop,
.rfv-dialog::backdrop,
.rr-dialog::backdrop,
.wired-dialog::backdrop,
.scenario-planner-dialog::backdrop,
.prof-report-dialog::backdrop,
.live-wifi-test-dialog::backdrop{
  background:rgba(12,18,38,.52);
  backdrop-filter:blur(3px);
}

/* Shared card/shell. Width remains feature-specific. */
.network-health-card,
.channel-opt-card,
.ap-placement-card,
.requirements-card,
.site-survey-shell,
.rfv-shell,
.rr-card,
.wired-card,
.scenario-planner-card,
.prof-report-shell,
.live-wifi-test-card{
  background:#fff;
  border:1px solid var(--tt-ew-line);
  border-radius:var(--tt-ew-radius);
  box-shadow:var(--tt-ew-shadow);
  overflow:hidden;
}

/* Header baseline: Network Health visual language. */
.network-health-head,
.channel-opt-head,
.ap-placement-head,
.requirements-head,
.site-survey-head,
.rfv-head,
.rr-head,
.wired-head,
.scenario-planner-head,
.prof-report-head,
.live-wifi-test-head{
  display:flex;
  align-items:center;
  gap:12px;
  padding:var(--tt-ew-head-pad);
  border-bottom:1px solid #edf0f5;
  background:linear-gradient(180deg,#fff,#fbfcff);
  color:var(--tt-ew-ink);
  flex:0 0 auto;
}

/* Keep draggable engineering windows draggable while removing the old heavy header. */
.requirements-head,
.site-survey-head,
.rfv-head,
.rr-head,
.wired-head,
.scenario-planner-head,
.prof-report-head{cursor:move;touch-action:none;user-select:none;}

.network-health-head-icon,
.channel-opt-head-icon,
.ap-placement-head-icon,
.requirements-head-icon,
.site-survey-head-icon,
.rfv-head-icon,
.scenario-planner-head-icon,
.prof-report-head-icon,
.live-wifi-test-head-icon{
  width:38px;
  height:38px;
  border-radius:11px;
  background:var(--tt-ew-icon-bg);
  color:var(--tt-ew-icon);
  display:grid;
  place-items:center;
  font-size:1rem;
  flex:0 0 auto;
}

/* Feature-specific header copies normalized to the same typography. */
.network-health-title,
.channel-opt-title,
.ap-placement-title,
.requirements-title,
.site-survey-head-copy h2,
.rfv-head h2,
.rr-head h2,
.wired-title h2,
.scenario-planner-title,
.prof-report-title,
.live-wifi-test-title{
  color:var(--tt-ew-title);
  font-size:1.03rem;
  line-height:1.2;
  font-weight:800;
  margin:0;
}

.network-health-subtitle,
.channel-opt-subtitle,
.ap-placement-subtitle,
.requirements-subtitle,
.site-survey-head-copy p,
.rfv-head p,
.rr-head p,
.wired-title p,
.scenario-planner-subtitle,
.prof-report-subtitle,
.live-wifi-test-subtitle{
  color:var(--tt-ew-muted);
  font-size:.76rem;
  line-height:1.35;
  margin:2px 0 0;
}

/* Kicker labels remain useful but now use the common neutral palette. */
.rr-kicker,
.wired-title>span{
  color:#64748b;
  font-size:.61rem;
  font-weight:850;
  letter-spacing:.09em;
  text-transform:uppercase;
}

/* Wired header icon is embedded in its title rather than a separate node. */
.wired-title h2 i{
  width:34px;
  height:34px;
  border-radius:10px;
  background:var(--tt-ew-icon-bg);
  color:var(--tt-ew-icon);
  display:inline-grid;
  place-items:center;
  margin-right:3px;
  flex:0 0 auto;
}

.network-health-close,
.channel-opt-close,
.ap-placement-close,
.requirements-close,
.site-survey-close,
.rfv-close,
.rr-close,
.wired-head>button,
.scenario-planner-close,
.prof-report-close,
.live-wifi-test-close{
  width:36px;
  height:36px;
  border:0;
  border-radius:10px;
  background:#f2f4f8;
  color:#657086;
  cursor:pointer;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  font-size:1rem;
}

.network-health-close:hover,
.channel-opt-close:hover,
.ap-placement-close:hover,
.requirements-close:hover,
.site-survey-close:hover,
.rfv-close:hover,
.rr-close:hover,
.wired-head>button:hover,
.scenario-planner-close:hover,
.prof-report-close:hover,
.live-wifi-test-close:hover{
  background:#e8ebf2;
  color:#26366f;
}

/* Shared content background/scrolling. */
.network-health-scroll,
.channel-opt-scroll,
.ap-placement-scroll,
.requirements-body,
.site-survey-body,
.rfv-body,
.rr-body,
#wiredBody,
.scenario-planner-body,
.prof-report-body{
  background:var(--tt-ew-soft);
  scrollbar-gutter:stable;
  overscroll-behavior:contain;
}

.network-health-scroll::-webkit-scrollbar,
.channel-opt-scroll::-webkit-scrollbar,
.ap-placement-scroll::-webkit-scrollbar,
.requirements-body::-webkit-scrollbar,
.site-survey-body::-webkit-scrollbar,
.rfv-body::-webkit-scrollbar,
.rr-body::-webkit-scrollbar,
#wiredBody::-webkit-scrollbar,
.scenario-planner-body::-webkit-scrollbar,
.prof-report-body::-webkit-scrollbar{width:10px;height:10px;}

.network-health-scroll::-webkit-scrollbar-thumb,
.channel-opt-scroll::-webkit-scrollbar-thumb,
.ap-placement-scroll::-webkit-scrollbar-thumb,
.requirements-body::-webkit-scrollbar-thumb,
.site-survey-body::-webkit-scrollbar-thumb,
.rfv-body::-webkit-scrollbar-thumb,
.rr-body::-webkit-scrollbar-thumb,
#wiredBody::-webkit-scrollbar-thumb,
.scenario-planner-body::-webkit-scrollbar-thumb,
.prof-report-body::-webkit-scrollbar-thumb{
  background:#bac3d3;
  border:2px solid var(--tt-ew-soft);
  border-radius:999px;
}

/* Shared action/footer treatment. */
.network-health-actions,
.channel-opt-actions,
.ap-placement-actions,
.requirements-actions,
.wired-foot,
.scenario-planner-foot,
.prof-report-footer{
  padding:var(--tt-ew-footer-pad);
  background:#fff;
  border-top:1px solid var(--tt-ew-line);
}

/* Normalize tabs where a feature uses them. */
.wired-tabs{
  background:#fff;
  border-bottom:1px solid var(--tt-ew-line);
  padding:9px 14px;
}
.wired-tabs button{
  min-height:36px;
  border-radius:10px;
  border:1px solid #dde3ef;
  background:#fff;
  color:#556178;
  font-weight:800;
}
.wired-tabs button.is-active{
  background:#eef2ff;
  border-color:#aebbf0;
  color:var(--tt-ew-title);
}

/* Feature content may still use semantic green/amber/red; only the shell is unified. */
.rfv-card,
.req-config-card,
.req-result-card,
.site-survey-card,
.wired-closet,
.wired-switch,
.scenario-capture-card,
.scenario-saved-card,
.scenario-compare-card,
.prof-report-config{
  box-shadow:none;
}

@media(max-width:760px){
  .network-health-card,
  .channel-opt-card,
  .ap-placement-card,
  .requirements-card,
  .site-survey-shell,
  .rfv-shell,
  .rr-card,
  .wired-card,
  .scenario-planner-card,
  .prof-report-shell,
  .live-wifi-test-card{
    border-radius:0;
    border-left:0;
    border-right:0;
  }
  .requirements-head,
  .site-survey-head,
  .rfv-head,
  .rr-head,
  .wired-head,
  .scenario-planner-head,
  .prof-report-head{cursor:default;touch-action:auto;}
}

/* Shared Network-Health-style action hierarchy. */
.network-health-recheck,
.channel-opt-apply,
.ap-placement-apply,
.requirements-run,
.rfv-btn.primary,
.rr-primary,
.wired-primary,
.scenario-primary,
.prof-report-primary,
.live-wifi-test-start{
  border:0;
  border-radius:10px;
  background:#1e2a78;
  color:#fff;
  font-weight:800;
  box-shadow:none;
}
.network-health-recheck:hover,
.channel-opt-apply:hover,
.ap-placement-apply:hover,
.requirements-run:hover,
.rfv-btn.primary:hover,
.rr-primary:hover,
.wired-primary:hover,
.scenario-primary:hover,
.prof-report-primary:hover,
.live-wifi-test-start:hover{background:#16205e;}

.network-health-done,
.channel-opt-done,
.ap-placement-done,
.requirements-actions>button:not(.requirements-run),
.rfv-btn:not(.primary),
.rr-secondary,
.rr-ghost,
.wired-secondary,
.scenario-secondary,
.scenario-planner-done,
.prof-report-secondary{
  border:1px solid #dde3ec;
  border-radius:10px;
  background:#edf0f5;
  color:#566176;
  font-weight:800;
  box-shadow:none;
}

/* The compact point-analysis popup uses the same surface language while
   remaining a lightweight anchored popover rather than a full dialog. */
.wifi-analysis-popup{
  background:rgba(255,255,255,.98)!important;
  border:1px solid #e4e8f1!important;
  border-radius:16px!important;
  box-shadow:0 18px 50px rgba(13,24,55,.24)!important;
  color:var(--tt-ew-ink)!important;
}
.wifi-analysis-popup .popup-close{
  width:30px;height:30px;border-radius:9px!important;background:#f2f4f8!important;color:#657086!important;
  display:grid!important;place-items:center!important;
}

/* ========================================================================== */
/* SigmoNet global floating-window UX standard (Aug 2026)                   */
/* Every engineering/tool window enhanced by TeleToolsFloatingWindow shares   */
/* the same drag / resize / scrolling behaviour and visual language.          */
/* ========================================================================== */
.tt-window-managed{
  --tt-window-min-w:320px;
  --tt-window-min-h:220px;
  box-sizing:border-box!important;
  max-width:calc(100vw - 16px)!important;
  max-height:calc(100dvh - 16px)!important;
  overflow:visible!important;
}
.tt-window-managed.tt-window-managed[open]{box-sizing:border-box!important;}
.tt-window-managed .tt-window-surface,
.tt-window-managed.tt-window-surface{
  position:relative;
  min-width:0;
  min-height:0;
  background:#fff;
  border:1px solid var(--tt-ew-line,#e4e8f1);
  border-radius:var(--tt-ew-radius,18px);
  box-shadow:var(--tt-ew-shadow,0 24px 70px rgba(13,24,55,.28));
  color:var(--tt-ew-ink,#20283d);
  overflow:hidden;
}
.tt-window-managed:not(dialog).tt-window-surface{background:rgba(255,255,255,.985);}
.tt-window-managed .tt-window-surface,
.tt-window-managed.tt-window-surface{
  container-type:inline-size;
  container-name:tt-engineering-window;
}
.tt-window-managed.is-dragging .tt-window-surface,
.tt-window-managed.is-tt-resizing .tt-window-surface,
.tt-window-managed.is-dragging.tt-window-surface,
.tt-window-managed.is-tt-resizing.tt-window-surface{
  box-shadow:0 30px 86px rgba(13,24,55,.34)!important;
}
/* Shared header treatment, including context editors and older dialogs. */
.tt-window-managed .tt-window-handle,
.tt-window-managed.tt-window-surface>.tt-window-handle{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:52px;
  padding:11px 13px!important;
  margin:0!important;
  border-bottom:1px solid #edf0f5!important;
  background:linear-gradient(180deg,#fff,#fbfcff)!important;
  color:var(--tt-ew-ink,#20283d)!important;
  cursor:move;
  touch-action:none;
  user-select:none;
  flex:0 0 auto;
}
.tt-window-managed .tt-window-handle :is(h1,h2,h3,h4,.pop-title,.analysis-title,.router-name){
  color:var(--tt-ew-title,#1e2a78)!important;
}
.tt-window-managed .tt-window-handle :is(p,small,.subtitle,[class*="subtitle"]){color:var(--tt-ew-muted,#747f92)!important;}

/* Shared rule for decision/confirmation dialogs that are not draggable tool
   windows. They must always open in the browser viewport centre. */
.tt-centered-decision-dialog{
  position:fixed!important;
  inset:0!important;
  left:0!important;
  right:0!important;
  top:0!important;
  bottom:0!important;
  margin:auto!important;
  transform:none!important;
  max-height:calc(100dvh - 28px)!important;
  overflow:auto!important;
}

/* Pointer resize grip. The content shell remains flex-based and scrollable. */
.tt-window-resize-grip{
  position:absolute!important;
  right:4px!important;
  bottom:4px!important;
  z-index:40!important;
  width:28px!important;
  height:28px!important;
  min-width:28px!important;
  min-height:28px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-radius:6px!important;
  background:linear-gradient(135deg,rgba(255,255,255,.72),rgba(238,242,255,.96))!important;
  color:#66748d!important;
  cursor:nwse-resize!important;
  box-shadow:none!important;
  touch-action:none!important;
}
.tt-window-resize-grip span::before,
.tt-window-resize-grip span::after{
  content:'';
  position:absolute;
  right:5px;
  bottom:5px;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  border-radius:1px;
}
.tt-window-resize-grip span::before{width:13px;height:13px;opacity:.8;}
.tt-window-resize-grip span::after{width:7px;height:7px;opacity:.52;}
.tt-window-resize-grip:hover,.tt-window-resize-grip:focus-visible{background:#eef2ff!important;color:#1e2a78!important;outline:2px solid rgba(30,42,120,.16)!important;outline-offset:1px!important;}

/* The primary content region always owns overflow. This prevents a long      */
/* result queue/table/list from pushing a floating window beyond the viewport. */
.tt-window-scroll-region{
  min-width:0!important;
  min-height:0!important;
  overflow:auto!important;
  overscroll-behavior:contain;
  scrollbar-gutter:stable both-edges;
  scrollbar-width:thin;
  scrollbar-color:#aeb9cc #eef1f5;
}
.tt-window-scroll-region::-webkit-scrollbar,
.tt-window-managed :is([class*="table-wrap"],[class*="table-container"],[class*="history"],[class*="queue"],[class*="result-list"],[class*="results-list"],[class*="item-list"],[class*="saved-list"],[class*="service-list"]):not(button)::-webkit-scrollbar{
  width:10px;height:10px;
}
.tt-window-scroll-region::-webkit-scrollbar-track,
.tt-window-managed :is([class*="table-wrap"],[class*="table-container"],[class*="history"],[class*="queue"],[class*="result-list"],[class*="results-list"],[class*="item-list"],[class*="saved-list"],[class*="service-list"]):not(button)::-webkit-scrollbar-track{
  background:#eef1f5;border-radius:999px;
}
.tt-window-scroll-region::-webkit-scrollbar-thumb,
.tt-window-managed :is([class*="table-wrap"],[class*="table-container"],[class*="history"],[class*="queue"],[class*="result-list"],[class*="results-list"],[class*="item-list"],[class*="saved-list"],[class*="service-list"]):not(button)::-webkit-scrollbar-thumb{
  background:#aeb9cc;border:2px solid #eef1f5;border-radius:999px;
}
.tt-window-managed :is([class*="table-wrap"],[class*="table-container"],[class*="history"],[class*="queue"],[class*="result-list"],[class*="results-list"],[class*="item-list"],[class*="saved-list"],[class*="service-list"]):not(button){
  max-width:100%;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
.tt-window-managed table{max-width:100%;}

/* Resized dialog/card shells fill the outer user-selected size. */
.tt-window-managed[style*="width"]>.tt-window-surface,
.tt-window-managed[style*="height"]>.tt-window-surface{
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
}
.tt-window-managed[style*="height"]>.tt-window-surface{
  display:flex!important;
  flex-direction:column!important;
}
.tt-window-managed[style*="height"]>.tt-window-surface>.tt-window-scroll-region{flex:1 1 auto!important;}

/* Bring older simulator windows into the same Network-Health shell style. */
.local-library-dialog,
.antenna-pattern-dialog,
.cad-import-dialog{border:0!important;padding:0!important;background:transparent!important;color:var(--tt-ew-ink)!important;}
.local-library-dialog::backdrop,
.antenna-pattern-dialog::backdrop,
.cad-import-dialog::backdrop{background:rgba(12,18,38,.52)!important;backdrop-filter:blur(3px);}
.local-library-shell,
.antenna-pattern-card,
.cad-import-card{border-radius:var(--tt-ew-radius)!important;border-color:var(--tt-ew-line)!important;box-shadow:var(--tt-ew-shadow)!important;}
.local-library-head,
.antenna-pattern-head,
.cad-import-head{
  border-bottom:1px solid #edf0f5!important;
  background:linear-gradient(180deg,#fff,#fbfcff)!important;
}

/* Compact point analysis and context editors use the same design language,   */
/* but keep compact spacing and do not become full-size modal cards. */
.wifi-analysis-popup.tt-window-managed,
.scene-edit-popover.tt-window-managed,
.ap-quick-popover.tt-window-managed{
  border:1px solid var(--tt-ew-line)!important;
  border-radius:16px!important;
  background:rgba(255,255,255,.985)!important;
  box-shadow:0 18px 50px rgba(13,24,55,.24)!important;
  overflow:hidden!important;
}
.scene-edit-popover.tt-window-managed{padding:0!important;}
.scene-edit-popover.tt-window-managed>.tt-window-handle{margin:0!important;}
.scene-edit-popover.tt-window-managed>:not(.tt-window-handle):not(.tt-window-resize-grip){margin-left:12px;margin-right:12px;}
.scene-edit-popover.tt-window-managed>.router-edit-actions{margin-left:0;margin-right:0;}
.wifi-analysis-popup.tt-window-managed .popup-content{max-height:calc(100% - 12px);}

@media(max-width:560px){
  .tt-window-managed{
    width:auto!important;
    height:auto!important;
    max-width:100vw!important;
    max-height:100dvh!important;
  }
  .tt-window-managed .tt-window-handle,
  .tt-window-managed.tt-window-surface>.tt-window-handle{cursor:default;touch-action:auto;}
  .tt-window-resize-grip{display:none!important;}
}
/* Compact editors do not have a separate body wrapper, so their own surface
   becomes the scroll container when resized smaller than their content. */
.scene-edit-popover.tt-window-managed,
.ap-quick-popover.tt-window-managed{
  overflow:auto!important;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  scrollbar-width:thin;
  scrollbar-color:#aeb9cc #eef1f5;
}
.scene-edit-popover.tt-window-managed::-webkit-scrollbar,
.ap-quick-popover.tt-window-managed::-webkit-scrollbar{width:10px;height:10px;}
.scene-edit-popover.tt-window-managed::-webkit-scrollbar-thumb,
.ap-quick-popover.tt-window-managed::-webkit-scrollbar-thumb{background:#aeb9cc;border:2px solid #eef1f5;border-radius:999px;}

/* ========================================================================== */
/* Tool-page popup layout normalization (Aug 2026)                            */
/* Layout only: existing feature colors/semantic palettes are intentionally   */
/* preserved. New <dialog> windows are tagged by floating-window.js so future */
/* services inherit the same shell, close-button and viewport behaviour.      */
/* ========================================================================== */
.tt-tool-dialog{
  box-sizing:border-box!important;
  border:0!important;
  padding:0!important;
  max-width:calc(100vw - 28px)!important;
  max-height:calc(100dvh - 28px)!important;
  overflow:visible!important;
}
.tt-tool-dialog>.tt-tool-dialog-surface{
  box-sizing:border-box!important;
  max-width:100%!important;
  max-height:min(88dvh,860px)!important;
  border-radius:var(--tt-ew-radius,18px)!important;
  overflow:auto!important;
}
.tt-tool-dialog>.tt-tool-dialog-surface.tt-tool-dialog-flex{
  display:flex!important;
  flex-direction:column!important;
  min-width:0!important;
  min-height:0!important;
  overflow:hidden!important;
}
.tt-tool-dialog-header{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  flex:0 0 auto!important;
  align-items:center!important;
}
.tt-tool-dialog-header>div:not([class*="icon"]),
.tt-window-handle>div:not([class*="icon"]){
  min-width:0;
}
.tt-tool-dialog-close,
.tt-window-close{
  position:relative!important;
  inset:auto!important;
  top:auto!important;
  right:auto!important;
  bottom:auto!important;
  left:auto!important;
  margin-left:auto!important;
  margin-right:0!important;
  align-self:center!important;
  flex:0 0 auto!important;
  transform:none!important;
}
.tt-tool-dialog-body{
  min-width:0!important;
  min-height:0!important;
  max-width:100%!important;
  overflow:auto!important;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}

/* Popup/card surfaces used by the simulator but not always represented by a
   native <dialog>. The shared controller adds tt-window-close at runtime. */
.tt-window-managed.tt-window-surface,
.tt-window-managed>.tt-window-surface,
.ap-quick-popover,
.scene-edit-popover,
.wifi-analysis-popup{
  border-radius:var(--tt-ew-radius,18px)!important;
  overflow:hidden!important;
}
.tt-window-managed.tt-window-surface>.tt-window-handle,
.tt-window-managed>.tt-window-surface>.tt-window-handle{
  width:100%!important;
  min-width:0!important;
  flex:0 0 auto!important;
}

/* Known decision/status dialogs have no draggable engineering controller.
   Keep them browser-centred and rounded rather than allowing feature CSS to
   anchor them at a viewport edge. */
.workspace-choice-dialog,
.site-survey-pass-dialog,
.wifi-plan-upgrade-dialog,
.wifi-service-availability-dialog,
.rr-close-choice-dialog{
  box-sizing:border-box!important;
  border:0!important;
  padding:0!important;
  max-width:calc(100vw - 28px)!important;
  max-height:calc(100dvh - 28px)!important;
}
.workspace-choice-card,
.site-survey-pass-card,
.wifi-plan-upgrade-card,
.wifi-service-availability-card,
.rr-close-choice-card{
  box-sizing:border-box!important;
  max-width:100%!important;
  max-height:calc(100dvh - 28px)!important;
  border-radius:var(--tt-ew-radius,18px)!important;
  overflow:auto!important;
}
.wifi-plan-upgrade-head,
.wifi-plans-dialog-head,
.wifi-notification-center-head,
.voc-support-head{
  min-width:0!important;
}
.wifi-plan-upgrade-head>button:last-child,
.wifi-plans-dialog-head>button:last-child,
.wifi-notification-center-head>button:last-child,
.voc-support-head>button:last-child{
  position:relative!important;
  inset:auto!important;
  margin-left:auto!important;
  flex:0 0 auto!important;
  transform:none!important;
}

/* Long content must scroll inside the popup, never push the popup outside the
   browser. This covers old and new feature naming patterns. */
.tt-tool-dialog :is(
  [class*="table-wrap"],[class*="table-container"],[class*="history"],
  [class*="queue"],[class*="result-list"],[class*="results-list"],
  [class*="item-list"],[class*="saved-list"],[class*="service-list"],
  [class*="layer-list"],[class*="notification-center-list"]
){
  max-width:100%;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}

@media(max-width:760px){
  .tt-tool-dialog{
    max-width:calc(100vw - 8px)!important;
    max-height:calc(100dvh - 8px)!important;
  }
  .tt-tool-dialog>.tt-tool-dialog-surface,
  .workspace-choice-card,
  .site-survey-pass-card,
  .wifi-plan-upgrade-card,
  .wifi-service-availability-card,
  .rr-close-choice-card{
    max-height:calc(100dvh - 8px)!important;
    border-radius:14px!important;
  }
}


/* -------------------------------------------------------------------------
   Compact AP/router alignment correction (Aug 2026)
   Keep the existing colors and controls. Balance the usable content area so
   the scrollbar/resize affordance cannot make the card look shifted.
   ------------------------------------------------------------------------- */
.ap-quick-popover.tt-window-managed{
  box-sizing:border-box!important;
  padding:12px!important;
  scrollbar-gutter:auto!important;
}
.ap-quick-popover.tt-window-managed>.ap-quick-head,
.ap-quick-popover.tt-window-managed>.ap-quick-actions,
.ap-quick-popover.tt-window-managed>.ap-orientation-panel{
  box-sizing:border-box!important;
  width:100%!important;
  margin-left:auto!important;
  margin-right:auto!important;
}

/* Router settings needs a permanent scrollbar for long forms. Reserve an
   equal gutter on both sides so its inner controls remain visually centred. */
#router3dPopover.scene-edit-popover.tt-window-managed{
  box-sizing:border-box!important;
  scrollbar-gutter:stable both-edges!important;
}
#router3dPopover.scene-edit-popover.tt-window-managed>.tt-window-handle{
  width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
}
#router3dPopover.scene-edit-popover.tt-window-managed>:not(.tt-window-handle):not(.tt-window-resize-grip):not(.router-edit-actions){
  box-sizing:border-box!important;
  width:auto!important;
  margin-left:12px!important;
  margin-right:12px!important;
}
#router3dPopover.scene-edit-popover.tt-window-managed>.router-edit-actions{
  box-sizing:border-box!important;
  width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
}

/* ========================================================================== */
/* Resize-grip clearance fix (Aug 2026)                                      */
/* Reserve bottom-right action space so the global resize grip never sits    */
/* on top of Done/Analyze/Save buttons in managed SigmoNet windows.        */
/* ========================================================================== */
.tt-window-managed .tt-window-resize-grip,
.tt-window-managed.tt-window-surface > .tt-window-resize-grip{
  right:6px!important;
  bottom:6px!important;
}

/* Shared bottom action rows / footers: keep a permanent clearance zone for  */
/* the resize grip. This is applied only to window-level footer areas, not   */
/* to arbitrary inner tool controls.                                         */
.tt-window-managed .tt-window-surface > :is(footer,[class$="-footer"],[class$="-foot"],[class*=" footer"],[class*="-footer "],[class*="-foot "]),
.tt-window-managed.tt-window-surface > :is(footer,[class$="-footer"],[class$="-foot"],[class*=" footer"],[class*="-footer "],[class*="-foot "]){
  padding-right:max(38px,env(safe-area-inset-right,0px))!important;
  padding-bottom:max(8px,env(safe-area-inset-bottom,0px))!important;
}

/* When the action cluster sits inside the footer rather than being the       */
/* footer element itself, make sure the right-most buttons cannot occupy the  */
/* grip corner.                                                               */
.tt-window-managed .tt-window-surface > :is(footer,[class$="-footer"],[class$="-foot"],[class*=" footer"],[class*="-footer "],[class*="-foot "]) > :is(div,[class*="action"],[class*="button"],[class*="controls"]):last-child,
.tt-window-managed.tt-window-surface > :is(footer,[class$="-footer"],[class$="-foot"],[class*=" footer"],[class*="-footer "],[class*="-foot "]) > :is(div,[class*="action"],[class*="button"],[class*="controls"]):last-child{
  margin-right:0!important;
}

/* Common inline footer buttons used without an inner wrapper. */
.tt-window-managed .tt-window-surface > :is(footer,[class$="-footer"],[class$="-foot"],[class*=" footer"],[class*="-footer "],[class*="-foot "]) > :is(button,.button,[class*="primary"],[class*="secondary"],[class*="ghost"]):last-child,
.tt-window-managed.tt-window-surface > :is(footer,[class$="-footer"],[class$="-foot"],[class*=" footer"],[class*="-footer "],[class*="-foot "]) > :is(button,.button,[class*="primary"],[class*="secondary"],[class*="ghost"]):last-child{
  margin-right:0!important;
}

/* Keep phone layout unchanged because the resize grip is disabled there. */
@media (max-width:560px){
  .tt-window-managed .tt-window-surface > :is(footer,[class$="-footer"],[class$="-foot"],[class*=" footer"],[class*="-footer "],[class*="-foot"]),
  .tt-window-managed.tt-window-surface > :is(footer,[class$="-footer"],[class$="-foot"],[class*=" footer"],[class*="-footer "],[class*="-foot"]){
    padding-right:inherit!important;
    padding-bottom:inherit!important;
  }
  .tt-window-managed .tt-window-surface > :is(footer,[class$="-footer"],[class$="-foot"],[class*=" footer"],[class*="-footer "],[class*="-foot"]) > :is(div,[class*="action"],[class*="button"],[class*="controls"]):last-child,
  .tt-window-managed.tt-window-surface > :is(footer,[class$="-footer"],[class$="-foot"],[class*=" footer"],[class*="-footer "],[class*="-foot"]) > :is(div,[class*="action"],[class*="button"],[class*="controls"]):last-child,
  .tt-window-managed .tt-window-surface > :is(footer,[class$="-footer"],[class$="-foot"],[class*=" footer"],[class*="-footer "],[class*="-foot"]) > :is(button,.button,[class*="primary"],[class*="secondary"],[class*="ghost"]):last-child,
  .tt-window-managed.tt-window-surface > :is(footer,[class$="-footer"],[class$="-foot"],[class*=" footer"],[class*="-footer "],[class*="-foot"]) > :is(button,.button,[class*="primary"],[class*="secondary"],[class*="ghost"]):last-child{
    margin-right:0!important;
  }
}

/* Older SigmoNet windows use a direct *-actions bar instead of footer/foot. */
/* The controller appends its grip after that bar, so do not require the bar   */
/* itself to remain the final child when reserving the bottom-right zone.      */
.tt-window-managed .tt-window-surface > [class$="-actions"]:not(.live-wifi-test-actions):nth-last-child(2),
.tt-window-managed.tt-window-surface > [class$="-actions"]:not(.live-wifi-test-actions):nth-last-child(2){
  padding-right:max(34px,env(safe-area-inset-right,0px))!important;
  padding-bottom:max(10px,env(safe-area-inset-bottom,0px))!important;
}

/* Explicit regression guard for Review Network Health. */
.tt-window-managed .network-health-actions:nth-last-child(2),
.network-health-card.tt-window-managed > .network-health-actions:nth-last-child(2){
  padding-right:max(34px,env(safe-area-inset-right,0px))!important;
}

@media (max-width:560px){
  .tt-window-managed .tt-window-surface > [class$="-actions"]:not(.live-wifi-test-actions):nth-last-child(2),
  .tt-window-managed.tt-window-surface > [class$="-actions"]:not(.live-wifi-test-actions):nth-last-child(2),
  .tt-window-managed .network-health-actions:nth-last-child(2),
  .network-health-card.tt-window-managed > .network-health-actions:nth-last-child(2){
    padding-right:16px!important;
  }
}

/* ========================================================================== */
/* SigmoNet window UX correction — Sep 2026                                   */
/* Keep each feature's native layout. Only normalize containment and the grip. */
/* ========================================================================== */
.tt-window-resize-grip{
  width:24px!important;
  height:24px!important;
  min-width:24px!important;
  min-height:24px!important;
}
.tt-window-resize-grip span::before{width:11px;height:11px;}
.tt-window-resize-grip span::after{width:6px;height:6px;}
.tt-tool-dialog-header,
.tt-window-managed .tt-window-handle{min-width:0!important;}
.tt-tool-dialog-header > :not(button),
.tt-window-managed .tt-window-handle > :not(button){min-width:0;overflow-wrap:anywhere;}
.tt-tool-dialog-close,
.tt-window-close{flex:0 0 auto!important;white-space:nowrap!important;}
/* Do NOT change display/grid-template/flex sizing on *-actions rows here. */
