.v2-tag { font-size: 11px; background: var(--bg-e6f1fb,#e6f1fb); color: var(--fg-0c447c,#0c447c); padding: 2px 6px; border-radius: 6px; margin-left: 6px; vertical-align: middle; }
/* Portal switcher injected into the top bar by portal-data.js */
.topbar .portal-switcher { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.topbar .portal-switcher a { color: rgba(255,255,255,.82); text-decoration: none; font-size: 13px; padding: 5px 10px; border-radius: 8px; }
.topbar .portal-switcher a:hover, .topbar .portal-switcher a:focus-visible { background: rgba(255,255,255,.14); color: #fff; outline: none; }
.topbar .portal-switcher a[aria-current="page"] { background: rgba(255,255,255,.2); color: #fff; }
.v2-main { width: 100%; box-sizing: border-box; margin: 0; padding: 16px clamp(16px, 2.2vw, 40px); }
.v2-search { position: relative; display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.v2-search .search { flex: 1; min-width: 240px; }
.v2-results { position: absolute; top: 44px; left: 0; right: 0; z-index: 5; background: var(--bg-ffffff,#fff); border: 1px solid var(--bd-d3d1c7,#d3d1c7); border-radius: 8px; max-height: 360px; overflow: auto; }
.v2-result { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--bd-f1efe8,#f1efe8); background: none; padding: 8px 12px; cursor: pointer; }
.v2-result:hover { background: var(--bg-f1efe8,#f1efe8); }
.v2-result strong { display: block; }
.v2-card { background: rgba(var(--panel-rgb,255,255,255),var(--cc-box-alpha,1)); backdrop-filter: blur(6px); border: 1px solid var(--bd-e1e0d9,#e1e0d9); border-radius: 12px; padding: 12px 16px; }
.v2-empty { color: var(--fg-5f5e5a,#5f5e5a); }
.v2-head { margin-bottom: 12px; }
.v2-head-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.v2-head h1 { margin: 0; font-size: 22px; font-weight: 500; }
.v2-sub { color: var(--fg-5f5e5a,#5f5e5a); font-size: 13px; }
.v2-flags { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.v2-badge { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--bg-e6f1fb,#e6f1fb); color: var(--fg-0c447c,#0c447c); }
.v2-badge.danger { background: var(--bg-fcebeb,#fcebeb); color: var(--fg-791f1f,#791f1f); }
.v2-badge.muted { background: var(--bg-f1efe8,#f1efe8); color: var(--fg-444441,#444441); }
.v2-hot { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--bg-faeeda,#faeeda); color: var(--fg-633806,#633806); }
.v2-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.v2-stat { background: var(--bg-f7f6f2,#f7f6f2); border-radius: 8px; padding: 8px 10px; }
.v2-stat-label { font-size: 12px; color: var(--fg-5f5e5a,#5f5e5a); }
.v2-stat-value { font-size: 20px; font-weight: 500; }
.v2-identity { margin-top: 8px; font-size: 11px; color: #888780; }
.v2-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 12px; }
.v2-grid > * { min-width: 0; }   /* wide tables scroll inside their card instead of widening the page on phones */
.v2-grid h2 { margin: 0 0 8px; font-size: 16px; font-weight: 500; }
.v2-grid h3 { margin: 10px 0 4px; font-size: 13px; font-weight: 500; color: var(--fg-444441,#444441); }
.v2-body { overflow-x: auto; }
.v2-table { width: 100%; font-size: 13px; }
.v2-none { color: #888780; font-size: 13px; margin: 4px 0; }
.v2-foot { color: #888780; font-size: 11px; margin: 6px 0 0; }
.v2-sites { font-size: 13px; margin: 0 0 6px; }
.v2-note { white-space: pre-wrap; font-size: 13px; margin: 0; }
.v2-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.v2-tile { display: block; text-decoration: none; color: inherit; }
.v2-tile h2 { margin: 0 0 4px; font-size: 16px; font-weight: 500; }
.v2-soon { opacity: 0.6; }
.v2-section { font-size: 17px; font-weight: 500; margin: 22px 0 10px; }
.v2-tile-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 600px) { .v2-grid { grid-template-columns: minmax(0, 1fr); } }

/* Shared sortable / filterable lists (list-tools.js) */
.cl-wrap { margin: 4px 0 8px; }
.cl-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.cl-search { flex: 1; min-width: 160px; max-width: 320px; font: inherit; font-size: 14px; padding: 6px 9px; border: 1px solid var(--bd-b4b2a9,#b4b2a9); border-radius: 8px; }
.cl-count { font-size: 12px; color: var(--fg-5f5e5a,#5f5e5a); }
.cl-clear { font-size: 12px; padding: 3px 8px; }
.cl-scroll { overflow-x: auto; }
@media (max-width: 600px) { .cl-scroll > table { min-width: 560px; } }   /* phones: swipe the table sideways instead of very tall squeezed rows */
.cl-table th { vertical-align: bottom; }
.cl-sort { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; color: inherit; cursor: pointer; text-align: left; white-space: nowrap; }
.cl-sort:hover, .cl-sort:focus-visible { color: var(--fg-185fa5,#185fa5); text-decoration: underline; outline: none; }
.cl-arrow { color: var(--fg-185fa5,#185fa5); }
.cl-filters th { padding-top: 0; }
.cl-filter { width: 100%; min-width: 60px; box-sizing: border-box; font: inherit; font-size: 12px; font-weight: 400; padding: 3px 6px; border: 1px solid var(--bd-d3d1c7,#d3d1c7); border-radius: 6px; }
.cl-click { cursor: pointer; }
.cl-click:hover td, .cl-click:focus-visible td { background: var(--bg-f5f9fd,#f5f9fd); }
.cl-click:focus-visible { outline: 2px solid #185fa5; outline-offset: -2px; }

/* Column gear on every list (column-gear.js, user 2026-10-04) */
.cg-btn { font-size: 12px; padding: 3px 9px; margin-left: auto; white-space: nowrap; }
.cg-veil { position: fixed; inset: 0; z-index: 1000; background: rgba(20, 24, 30, .45); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; box-sizing: border-box; overflow-y: auto; }
.cg-card { background: var(--bg-ffffff,#fff); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); width: 100%; max-width: 560px; padding: 14px 16px; box-sizing: border-box; }
.cg-card h2 { margin: 0 0 4px; font-size: 18px; font-weight: 500; }
.cg-card h3 { margin: 14px 0 6px; font-size: 13px; font-weight: 600; color: var(--fg-444441,#444441); }
.cg-help { font-size: 12px; color: var(--fg-5f5e5a,#5f5e5a); margin: 2px 0 6px; }
.cg-list, .cg-avail { list-style: none; margin: 0; padding: 0; }
.cg-list { border: 1px solid var(--bd-e1e0d9,#e1e0d9); border-radius: 8px; max-height: 38vh; overflow-y: auto; }
.cg-item { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-bottom: 1px solid var(--bd-f1efe8,#f1efe8); background: var(--bg-ffffff,#fff); }
.cg-item:last-child { border-bottom: 0; }
.cg-item.cg-drag { opacity: .45; }
.cg-item.cg-over { box-shadow: inset 0 2px 0 #185fa5; }
.cg-grip { cursor: grab; color: #888780; user-select: none; }
.cg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.cg-mini { min-width: 34px; min-height: 30px; padding: 0 6px; font-size: 14px; }
.cg-find { width: 100%; max-width: none; box-sizing: border-box; }
.cg-avail { margin-top: 6px; max-height: 30vh; overflow-y: auto; border: 1px solid var(--bd-e1e0d9,#e1e0d9); border-radius: 8px; }
.cg-avail:empty { display: none; }
.cg-avail li { border-bottom: 1px solid var(--bd-f1efe8,#f1efe8); }
.cg-avail li.cg-help { padding: 6px 10px; }
.cg-add { display: flex; width: 100%; justify-content: space-between; gap: 8px; border: 0; background: none; padding: 7px 10px; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.cg-add:hover, .cg-add:focus-visible { background: var(--bg-f5f9fd,#f5f9fd); outline: none; }
.cg-add small { color: #888780; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-sort { display: flex; gap: 8px; flex-wrap: wrap; }
.cg-sort select { flex: 1 1 200px; min-width: 0; font: inherit; font-size: 14px; padding: 5px 8px; border: 1px solid var(--bd-b4b2a9,#b4b2a9); border-radius: 8px; }
.cg-msg { min-height: 1em; font-size: 13px; color: var(--fg-791f1f,#791f1f); margin: 10px 0 0; }
.cg-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 10px; }
.cg-actions .btn:first-child { margin-right: auto; }
@media (max-width: 600px) { .cg-veil { padding: 8px; } .cg-card { padding: 12px; } .cg-list { max-height: 34vh; } .cg-avail { max-height: 26vh; } }

/* Phones: a compact top bar that scrolls away (user 2026-10-02) - same as the Fire Inspections page */
@media (max-width: 760px) {
  .topbar { position: static; height: auto; min-height: 50px; flex-wrap: wrap; gap: 6px 10px; padding: 8px 12px; }
  .topbar .portal-switcher { display: none !important; }
  .topbar .top-actions { flex-wrap: wrap; gap: 6px; margin-left: auto; }
  .topbar .top-actions .btn, .topbar .top-actions button { min-height: 32px; padding: 0 10px; font-size: 13px; }
  .topbar .top-actions a[href*="-preview.html"] { display: none; }      /* "Current page" (old pages) */
  .topbar .title { font-size: 16px; }
}

/* Phones: everything a size smaller (user 2026-10-02: "overall shrink things, do not have to be so big") */
@media (max-width: 600px) {
  body { font-size: 14px; }
  h1 { font-size: 20px; }
  h2 { font-size: 16px; }
  .btn, button.btn, a.btn { font-size: 13px; min-height: 30px; padding: 0 10px; }
  .v2-card { padding: 10px 12px; }
  .search, input[type=search] { font-size: 14px; padding: 6px 10px; }
  .topbar .brand { font-size: 17px; }
  .cr-btn { font-size: 12px !important; padding: 6px 11px !important; }
  .cc-ai-btn { font-size: 12px !important; padding: 6px 11px !important; }
}
@media (max-width: 600px) {
  /* one-row top bar on phones: no Background / v2 home buttons, short sign-in */
  .topbar .cc-look-btn, .topbar .top-actions a[href="index.html"] { display: none !important; }
  .topbar .lb-user { font-size: 11px; }
  .topbar { min-height: 44px; padding: 6px 10px; }
}
@media (max-width: 600px) {
  /* top bar on ONE line on phones (user 2026-10-02: "top of the page can be cleaned up"): logo + page name, buttons, Sign out */
  .topbar { flex-wrap: nowrap !important; height: 46px !important; min-height: 46px !important; padding: 0 8px !important; gap: 6px !important; }
  .topbar .brand { font-size: 15px !important; flex: 0 0 auto; }
  .topbar .title { font-size: 14px !important; min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .v2-tag { display: none !important; }
  .topbar .top-actions { flex-wrap: nowrap !important; gap: 4px !important; margin-left: 0 !important; flex: 0 0 auto; }
  .topbar .top-actions .btn, .topbar .top-actions button { min-height: 28px !important; padding: 0 8px !important; font-size: 12px !important; }
  .topbar .lb-user > span { display: none !important; }
}
/* Tablets (601-1000px): one-line top bar, nothing wraps (user 2026-10-02: "also needs to be formatted for a tablet") */
@media (min-width: 601px) and (max-width: 1000px) {
  .topbar { flex-wrap: nowrap !important; height: 52px !important; min-height: 52px !important; gap: 10px !important; padding: 0 12px !important; }
  .topbar .brand { white-space: nowrap; flex: 0 0 auto; }
  .topbar .title { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
  .topbar .portal-switcher { display: none !important; }
  .topbar .top-actions { flex-wrap: nowrap !important; gap: 6px !important; flex: 0 0 auto; }
  .topbar .top-actions .btn, .topbar .top-actions button { min-height: 32px; padding: 0 10px; font-size: 13px; white-space: nowrap; }
  .topbar .lb-user > span { display: none !important; }
}
@media (max-width: 600px) {
  .cr-btn { font-size: 11px !important; padding: 5px 9px !important; bottom: 14px !important; left: 10px !important; }
  .cc-ai-btn { font-size: 11px !important; padding: 5px 9px !important; bottom: 14px !important; right: 10px !important; }
}
/* tablets: less padding on every v2 page */
@media (min-width: 601px) and (max-width: 1000px) {
  .v2-main, .sb-main, .cal-main { padding: 10px 12px !important; }
  .v2-card { padding: 10px 14px; }
}
/* scrolling pages: the last row always clears the fixed Suggest / Status / Ask our AI buttons (user 2026-10-03) */
html body .of-main, html body main.of-main, html body .v2-main, html body .cal-main { padding-bottom: 76px !important; }
/* phones: the three bottom buttons side by side without touching (Integration Status is the longer name) */
@media (max-width: 600px) {
  .cr-btn { font-size: 10.5px !important; padding: 4px 7px !important; left: 6px !important; }
  .cc-ai-btn { font-size: 10.5px !important; padding: 4px 8px !important; right: 6px !important; }
  .cc-status { padding: 4px 8px !important; }
  .cc-status .sum { font-size: 10.5px !important; gap: 4px !important; }
}
@media (max-width: 600px) {
  /* three equal buttons, evenly spaced (user 2026-10-03 "adjust the bottom buttons") */
  .cr-btn, .cc-ai-btn, .cc-status:not(.open) {
    width: calc((100vw - 24px) / 3) !important; box-sizing: border-box !important; height: 28px !important; min-height: 0 !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    padding: 0 4px !important; bottom: 10px !important; white-space: nowrap !important; overflow: hidden !important;
  }
  .cr-btn { left: 6px !important; }
  .cc-ai-btn { right: 6px !important; left: auto !important; }
  .cc-status:not(.open) { left: 50% !important; transform: translateX(-50%) !important; right: auto !important; }
  .cc-status .sum { font-size: 10.5px !important; }
}
@media (min-width: 601px) {
  /* tablets + desktop: the three bottom buttons on one line, same height */
  .cr-btn, .cc-ai-btn { bottom: 14px !important; height: 34px !important; min-height: 0 !important; box-sizing: border-box !important;
    display: inline-flex !important; align-items: center !important; }
}
/* tablets + desktop, every page (user 2026-10-03): every integration status always on show, stretching / wrapping with the window
   (user 2026-10-03); phones keep the single Integration Status button */
@media (min-width: 601px) {
  body .cc-status, body .cc-status.open {
    display: flex !important; flex-wrap: wrap !important; justify-content: space-evenly !important; align-items: center !important;
    flex-direction: row !important; left: 192px !important; right: 156px !important; width: auto !important; max-width: none !important;
    transform: none !important; height: auto !important; min-height: 34px !important; max-height: none !important; overflow: visible !important;
    bottom: 14px !important; padding: 4px 12px !important; gap: 2px 12px !important; font-size: 11.5px !important; white-space: nowrap !important;
    border-radius: 14px !important; box-sizing: border-box !important; }
  body .cc-status > a { display: inline-flex !important; font-size: 11.5px !important; padding: 0 !important; }
  body .cc-status .sum { display: none !important; }
}
/* a solid band behind the bottom buttons (user 2026-10-03 "don't hide data behind the bottom buttons"): content scrolls up to a
   clean edge instead of showing between the buttons; pages already keep their last row above it */
body::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 62px; z-index: 38; pointer-events: none;
  background: var(--bg-f4f6f9-a96,rgba(244, 246, 249, .96)); border-top: 1px solid var(--bd-d5dbe3,#d5dbe3); box-shadow: 0 -2px 8px rgba(0, 0, 0, .06); }
@media (max-width: 600px) { body::after { height: 48px; } }
@media (min-width: 601px) and (max-width: 1000px) { body::after { height: 84px; }
  html body .of-main, html body main.of-main, html body .v2-main, html body .cal-main { padding-bottom: 88px !important; } }
@media print { body::after { display: none; } }
/* top bar on medium desktop windows (user 2026-10-03 dispatch check): every label on one line, smaller buttons, one row */
@media (min-width: 1001px) {
  .topbar .brand, .topbar .title, .topbar .portal-switcher a, .topbar .top-actions > *, .topbar .top-actions a, .topbar .top-actions button { white-space: nowrap !important; }
  .topbar { flex-wrap: nowrap !important; }
  .topbar .top-actions { flex-wrap: nowrap !important; flex-shrink: 1; min-width: 0; }
  /* gui9 2026-10-19: when the bar is still too full, the page title gives up its room first (ellipsis), so the action row never slides under the PWR / GPU meters */
  .topbar .title { min-width: 0; flex-shrink: 1000; overflow: hidden; text-overflow: ellipsis; }
}
@media (min-width: 1001px) and (max-width: 1400px) {
  .topbar { gap: 10px !important; }
  .topbar .top-actions { gap: 5px !important; }
  .topbar .top-actions .btn, .topbar .top-actions button, .topbar .top-actions a { padding: 4px 8px !important; font-size: 12px !important; min-height: 0 !important; }
  .topbar .top-actions > span, .topbar .top-actions .cc-login, .topbar .top-actions [class*=login] { font-size: 11.5px !important; }
  .topbar .portal-switcher a { padding: 4px 8px !important; font-size: 12.5px !important; }
}

/* compact tablets + phones (user 2026-10-05 "padding could be shrunk and more streamlined"); desktop unchanged.
   Bottom padding of the page bodies is left alone (it keeps the last row above the bottom band). */
@media (max-width: 1024px) {
  html body main[class$="-main"] { padding-top: 8px !important; padding-left: 8px !important; padding-right: 8px !important; }
  body > div.status { padding: 3px 10px 3px 84px; font-size: 12px; }   /* clear of the DEV/PROD pill */
  .v2-card, .int-card, .it-kpi, .it-break, .vm-card, .dt-card, .ls-card, .hh-card, .of-step { padding: 8px 10px !important; }
  .hh-card, .dt-card, .of-step { margin-bottom: 8px !important; }
  .int-grid, .it-kpis, .sb-grid, .in-types, .ls-grid, .ls-terms, .dt-head, .dt-nav, .v2-search { gap: 6px !important; }
  .it-kpis, .v2-search, .sl-top, .it-top, .rma-tabs, .of-links, .cal-bar, .sb-dial, .dt-steps, .in-types, .dt-head, .db-toolbar,
  p.of-help, .ls-sum { margin-bottom: 6px !important; }
  .ls-sum { gap: 12px !important; }
  button.in-type { padding: 7px 12px !important; }
  button.ls-term { padding: 8px !important; }
  .dt-main input, .of-step input.search { padding: 7px 10px !important; }
}
@media (max-width: 600px) {
  .it-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .v2-card, .int-card, .it-kpi, .it-break, .vm-card, .dt-card, .ls-card, .hh-card, .of-step { padding: 6px 8px !important; }
}
