/* Portal surfaces: the signed-in workspace.
   Scoped to body.portal so the public site keeps its existing type and spacing. The aim is a calm,
   data-dense workspace: one clear headline, a small number of strong numbers, and hierarchy that can
   be read without opening every record. */

.portal {
  --p-bg: #f6f7fb;
  --p-card: #ffffff;
  --p-ink: #101828;
  --p-ink-soft: #344054;
  --p-muted: #667085;
  --p-line: #e7eaf0;
  --p-line-strong: #d6dbe5;
  --p-accent: #2f5bff;
  --p-accent-soft: #eef2ff;
  --p-teal: #0e9384;
  --p-teal-soft: #e6f7f4;
  --p-amber: #b25e09;
  --p-amber-soft: #fdf3e3;
  --p-red: #c4323c;
  --p-red-soft: #fdecef;
  --p-radius: 18px;
  --p-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .05);
  --p-shadow-lift: 0 2px 4px rgba(16, 24, 40, .05), 0 18px 40px rgba(16, 24, 40, .09);
  background:
    radial-gradient(1000px 520px at 78% -14%, rgba(47, 91, 255, .07), transparent 60%),
    radial-gradient(720px 420px at 4% 0%, rgba(14, 147, 132, .055), transparent 55%),
    var(--p-bg);
}

/* The workspace header is an application header, not the marketing navigation. The left rail is the
   navigation once signed in; keeping the marketing menu here made the portal read like a brochure. */
.portal .site-header nav.main { display: none; }
.portal .site-header .nav-toggle { display: none; }
.portal .site-header .nav-wrap { justify-content: flex-end; }
.portal .site-header .wrap { height: 68px; }

.portal .section { padding: 34px 0 70px; }
/* The workspace is the product, not a page inside the marketing site. The marketing container is
   1120px; a signed-in table with eight columns cannot live in it without either squeezing every
   value into a narrow column or scrolling inside a box. The portal therefore uses the available
   width, with the same 22px gutter the header uses, and only stops growing on an ultrawide monitor. */
.portal .wrap { max-width: min(1560px, 100%); }
.portal .account-layout { grid-template-columns: 236px minmax(0, 1fr); gap: 30px; }
.portal.nav-collapsed .account-layout { grid-template-columns: 64px minmax(0, 1fr); gap: 20px; }

/* The rail header holds the collapse control, so the option is where a reader looks for it rather
   than buried in the account menu. The collapsed rail keeps the glyphs, which is why each link now
   carries an icon and a separate label span. */
/* The first row of the rail carries the first section label and the collapse control, so the
   control belongs to the navigation rather than floating above it. There is no separate "Menu"
   heading: the rail is already the menu. */
.portal .nav-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 2px 4px 8px 10px;
}
.portal .nav-heading {
  font-size: 10.5px; font-weight: 750; letter-spacing: .9px; text-transform: uppercase; color: #98a2b3;
}
.portal .nav-collapse {
  display: grid; place-items: center; width: 26px; height: 26px; flex: none;
  padding: 0; box-sizing: border-box;
  border: 1px solid var(--p-line); border-radius: 8px; background: #fff;
  color: var(--p-muted); font: inherit; font-size: 15px; line-height: 1; cursor: pointer;
  outline: none; appearance: none;
}
.portal .nav-collapse:hover { border-color: var(--p-line-strong); color: var(--p-accent); background: #f8faff; }
/* A default browser focus ring around a 26px control reads as a heavy black box. Keyboard users
   still get a clear ring, just one drawn in the workspace accent instead. */
.portal .nav-collapse:focus-visible {
  outline: none; border-color: var(--p-accent);
  box-shadow: 0 0 0 3px rgba(47, 91, 255, .18);
}
.portal .nav-collapse-icon { display: block; width: 16px; height: 16px; }
.portal .nav-collapse-icon svg { display: block; width: 16px; height: 16px; }
.portal .nav-collapse-icon .nav-icon-expand { display: none; }
.portal.nav-collapsed .nav-collapse-icon .nav-icon-collapse { display: none; }
.portal.nav-collapsed .nav-collapse-icon .nav-icon-expand { display: block; }

/* The rail is short enough to fit the viewport on its own. A fixed max-height and an inner
   scrollbar made a twelve-row menu look like a long document and hid the last two rows on a
   laptop screen, so the menu no longer scrolls independently of the page. The rows are compact
   enough to stay whole down to a 600px-tall window; below that, the media query at 560px tall
   trims the section labels rather than reintroducing a scrollbar. */
.portal .account-nav {
  top: 88px;
  padding: 10px;
  gap: 1px;
  max-height: none;
  overflow: visible;
  border: 1px solid var(--p-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--p-shadow);
  backdrop-filter: blur(14px);
}
.portal .account-nav .nav-section { margin: 9px 10px 1px; font-size: 10.5px; color: #98a2b3; letter-spacing: .9px; }
.portal .account-nav .nav-section:first-of-type { margin-top: 9px; }
.portal .account-nav a {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 6px 10px; font-size: 13.5px; line-height: 1.35; color: #475467; border-radius: 9px;
}
.portal .account-nav a svg { width: 15px; height: 15px; flex: none; margin-top: 1.5px; opacity: .72; }
.portal .account-nav a .nav-label { min-width: 0; }
.portal .account-nav a:hover { background: #f2f5ff; color: var(--p-accent); }
.portal .account-nav a:hover svg { opacity: 1; }
.portal .account-nav a.current { background: var(--p-accent-soft); color: var(--p-accent); font-weight: 650; }
.portal .account-nav a.current svg { opacity: 1; }

.portal.nav-collapsed .account-nav { padding: 8px 7px; }
.portal.nav-collapsed .nav-head { justify-content: center; padding: 0 0 8px; }
.portal.nav-collapsed .nav-heading,
.portal.nav-collapsed .nav-label { display: none; }
.portal.nav-collapsed .account-nav .nav-section {
  height: 1px; margin: 8px 2px 6px; overflow: hidden; text-indent: -9999px;
  background: var(--p-line); color: transparent;
}
.portal.nav-collapsed .account-nav .nav-section:first-of-type { margin-top: 4px; }
.portal.nav-collapsed .account-nav a { justify-content: center; padding: 8px 0; }
.portal.nav-collapsed .account-nav a svg { width: 17px; height: 17px; margin-top: 0; }


/* On a genuinely short window the group labels are the first thing that can go: the links still
   read as a list, and nothing is pushed out of view or behind a scrollbar. */
@media (min-width: 1081px) and (max-height: 560px) {
  .portal .account-nav .nav-section { display: none; }
  .portal .account-nav a { padding: 5px 10px; }
}

.portal h1, .portal h2, .portal h3 { letter-spacing: -.02em; color: var(--p-ink); }
.portal h1 { font-size: clamp(32px, 4.2vw, 44px); line-height: 1.04; margin: 6px 0 10px; }
.portal h2 { font-size: 20px; margin: 0 0 4px; }
.portal h3 { font-size: 15px; }
.portal .lead { font-size: 16.5px; line-height: 1.6; color: var(--p-muted); max-width: 760px; }
.portal .workspace-note { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--p-muted); }
.portal .workspace-note a { color: var(--p-accent); font-weight: 600; }
.portal .eyebrow {
  font-size: 11.5px; letter-spacing: 1.4px; font-weight: 700; text-transform: uppercase;
  color: var(--p-accent); margin: 0;
}
.portal .muted, .portal .small.muted, .portal .tiny.muted { color: var(--p-muted); }
.portal code { font-size: 12.5px; color: #475467; }

.portal .panel {
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  background: var(--p-card);
  box-shadow: var(--p-shadow);
  padding: 24px;
  margin-bottom: 18px;
}
.portal .panel > h2 + p { margin-top: 4px; }

.portal .toolbar { gap: 10px; }
/* One button system. The old mix of blue pills, white boxes and borderless text made adjacent actions
   look like different weights of the same thing. Primary is the single next action; secondary is an
   alternative; ghost is a lower-emphasis button with a visible edge. Plain navigation uses .text-link. */
.portal .btn,
.portal button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 9px;
  font-size: 13px; line-height: 1; font-weight: 600; letter-spacing: 0;
  white-space: nowrap; box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}
.portal .btn:hover, .portal button.btn:hover { box-shadow: 0 2px 6px rgba(16, 24, 40, .10); }
.portal .btn.secondary { background: #fff; border-color: var(--p-line-strong); color: var(--p-ink); }
.portal .btn.secondary:hover { background: #f8faff; border-color: #b8c2d6; }
.portal .btn.ghost { background: #fff; border-color: var(--p-line); color: var(--p-ink-soft); box-shadow: none; }
.portal .btn.ghost:hover { background: #f8faff; border-color: var(--p-line-strong); }
.portal .btn.danger { background: #fff; border-color: #f0c8cd; color: var(--p-red); box-shadow: none; }
.portal .btn.danger:hover { background: #fff7f8; border-color: #e7aeb5; }
.portal .btn.small { min-height: 32px; padding: 0 11px; font-size: 12px; border-radius: 7px; }
.portal .text-link,
.portal button.text-link {
  display: inline-flex; align-items: center; gap: 5px; min-height: 40px;
  padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  color: var(--p-accent); font-size: 13px; font-weight: 600; text-decoration: none;
  text-underline-offset: 3px;
}
.portal button.text-link:hover { background: transparent; box-shadow: none; text-decoration: underline; }
.portal .text-link:hover { text-decoration: underline; }
.attention .t a { color: inherit; text-decoration: none; }
.attention .t a:hover { color: var(--p-accent); text-decoration: underline; }
.attention .t a.text-link { color: var(--p-accent); font-weight: 600; }
.portal .systems-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.portal .report-head, .portal .systems-head { margin-bottom: 18px; }
.portal .report-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: flex-start; }
.portal .report-head > * { min-width: 0; }

/* Tabs are navigation, not a row of pill buttons. */
.portal .systems-tabs {
  display: flex; flex-wrap: wrap; gap: 22px;
  margin: 20px 0 18px; padding: 0;
  border-bottom: 1px solid var(--p-line);
}
.portal .systems-tabs button {
  min-height: 0; padding: 10px 1px 12px;
  border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: transparent; box-shadow: none;
  color: var(--p-muted); font-size: 13px; font-weight: 600;
}
.portal .systems-tabs button:hover { background: transparent; color: var(--p-ink); box-shadow: none; }
.portal .systems-tabs button[aria-selected="true"] {
  border-bottom-color: var(--p-accent); background: transparent; color: var(--p-ink);
}
/* The workbench had a second tab pattern made of blue pills. Use the same navigation language. */
.portal .tabs {
  display: flex; flex-wrap: wrap; gap: 22px;
  margin: 16px 0 18px; padding: 0;
  border: 0; border-bottom: 1px solid var(--p-line); border-radius: 0; background: transparent;
}
.portal .tabs button {
  border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: transparent; box-shadow: none;
  padding: 10px 1px 12px; color: var(--p-muted); font-size: 13px; font-weight: 600;
}
.portal .tabs button:hover { background: transparent; color: var(--p-ink); }
.portal .tabs button.active { border-bottom-color: var(--p-accent); background: transparent; color: var(--p-ink); }

.portal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; flex-wrap: wrap; margin-bottom: 20px; }
.portal-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.portal-crumb { font-size: 12.5px; color: var(--p-muted); margin-bottom: 6px; }
.portal-crumb a { color: var(--p-muted); }
.portal-crumb span { color: var(--p-ink-soft); }

/* ---------------------------------------------------------------- hero */

.portal-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 30px;
  padding: 34px 34px 30px;
  border-radius: 24px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(900px 420px at 88% 0%, rgba(96, 165, 250, .28), transparent 62%),
    radial-gradient(600px 360px at 0% 120%, rgba(20, 184, 166, .20), transparent 60%),
    linear-gradient(128deg, #0b1736 0%, #10254f 48%, #183a77 100%);
  box-shadow: 0 24px 60px rgba(13, 29, 66, .26);
  margin-bottom: 18px;
}
.portal-hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 78%);
  pointer-events: none;
}
.portal-hero > * { position: relative; z-index: 1; }
.portal-hero .eyebrow { color: #9fc0ff; display: inline-flex; align-items: center; gap: 7px; }
.portal-hero .eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5eead4;
  box-shadow: 0 0 0 4px rgba(94, 234, 212, .14);
}
.portal-hero h1 { color: #fff; font-size: clamp(30px, 3.6vw, 42px); margin: 8px 0 10px; }
.portal-hero p { color: rgba(226, 236, 255, .78); max-width: 620px; line-height: 1.62; margin: 0 0 20px; }
.portal-hero .hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.portal-hero .btn { background: #fff; color: #10254f; border-color: #fff; }
.portal-hero .btn:hover { background: #eef3ff; }
.portal-hero .btn.ghost { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); color: #fff; }
.portal-hero .btn.ghost:hover { background: rgba(255,255,255,.16); }

.hero-ring-wrap { display: flex; align-items: center; justify-content: center; gap: 18px; }
.hero-ring {
  --pct: 0;
  width: 148px; height: 148px; border-radius: 50%;
  background: conic-gradient(#5eead4 calc(var(--pct) * 1%), rgba(255,255,255,.13) 0);
  display: grid; place-items: center; position: relative; flex: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.hero-ring::before { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: #0d1d3d; box-shadow: inset 0 0 34px rgba(0,0,0,.35); }
.hero-ring .ring-inner { position: relative; text-align: center; }
.hero-ring .ring-n { font-size: 32px; font-weight: 750; letter-spacing: -1.4px; color: #fff; line-height: 1; }
.hero-ring .ring-l { font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; color: rgba(226,236,255,.68); margin-top: 6px; }
.hero-side { display: grid; gap: 10px; min-width: 130px; }
.hero-side .stat { padding: 10px 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: rgba(255,255,255,.06); }
.hero-side .stat b { display: block; font-size: 20px; letter-spacing: -.5px; }
.hero-side .stat span { font-size: 11px; color: rgba(226,236,255,.68); text-transform: uppercase; letter-spacing: .8px; }

/* ---------------------------------------------------------------- KPI cards */

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi {
  padding: 16px 16px 14px;
  border: 1px solid var(--p-line);
  border-radius: 15px;
  background: var(--p-card);
  box-shadow: var(--p-shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--p-shadow-lift); border-color: var(--p-line-strong); }
.kpi .k { font-size: 11px; text-transform: uppercase; letter-spacing: .9px; color: var(--p-muted); font-weight: 700; }
.kpi .v { font-size: 28px; font-weight: 750; letter-spacing: -1.1px; margin: 7px 0 3px; color: var(--p-ink); line-height: 1; }
.kpi .v small { font-size: 13px; font-weight: 600; color: var(--p-muted); letter-spacing: 0; }
.kpi .n { font-size: 11.5px; color: var(--p-muted); line-height: 1.4; }
.kpi.accent { border-color: #cfd9ff; background: linear-gradient(180deg, #fbfcff, #f4f7ff); }
.kpi-definition {
  margin: -4px 0 18px;
  max-width: 920px;
  color: var(--p-muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.kpi-definition b { color: var(--p-ink-soft); font-weight: 650; }

/* ---------------------------------------------------------------- split panels */

.portal-split { display: grid; grid-template-columns: 1.5fr .9fr; gap: 18px; align-items: start; }
.portal-split > .panel { margin-bottom: 0; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 3px 0 0; }

/* ---------------------------------------------------------------- risk bar */

.riskbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #eef1f6; margin: 14px 0 12px; }
.riskbar span { display: block; height: 100%; }
.risk-q { background: #d64550; }
.risk-d { background: #e19a2b; }
.risk-a { background: #98a2b3; }
.risk-r { background: #35a76f; }
.risk-p { background: #0e9384; }
.risklegend { display: grid; gap: 8px; }
.risklegend .row { display: grid; grid-template-columns: 12px 1fr auto; gap: 9px; align-items: center; font-size: 12.5px; color: var(--p-ink-soft); }
.risklegend .dot { width: 9px; height: 9px; border-radius: 50%; }

/* ---------------------------------------------------------------- hierarchy tree */

.tree { display: grid; gap: 2px; }
.tree-org { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #f8faff; border: 1px solid #e8eeff; margin-bottom: 4px; }
.tree-org .org-mark { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--p-accent); color: #fff; font-size: 11px; font-weight: 750; }
.tree-org b { font-size: 13.5px; }
.tree-org span { font-size: 11.5px; color: var(--p-muted); margin-left: auto; }
.tree-suite { padding: 10px 12px 6px 12px; position: relative; }
.tree-suite > .suite-line { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #667085; }
.tree-suite > .suite-line .count { font-weight: 500; letter-spacing: 0; text-transform: none; color: #98a2b3; }
.tree-system {
  display: grid; grid-template-columns: minmax(0, 1.5fr) auto auto auto 18px;
  gap: 12px; align-items: center;
  padding: 9px 12px 9px 28px; border-radius: 10px;
  color: var(--p-ink); text-decoration: none;
  position: relative;
}
.tree-system::before { content: ""; position: absolute; left: 14px; top: 0; bottom: 0; width: 1px; background: #e3e8f2; }
.tree-system::after { content: ""; position: absolute; left: 14px; top: 50%; width: 9px; height: 1px; background: #e3e8f2; }
.tree-system:hover { background: #f8faff; text-decoration: none; }
.tree-system .name { font-weight: 650; font-size: 13.5px; letter-spacing: -.01em; }
.tree-system .sub { font-size: 11.5px; color: var(--p-muted); margin-top: 2px; }
.tree-system .metric { font-size: 11.5px; color: var(--p-muted); white-space: nowrap; }
.tree-system .metric b { color: var(--p-ink); font-size: 12.5px; }
.tree-system .arrow { color: #98a2b3; font-size: 14px; }
.tree-empty { padding: 14px 12px; color: var(--p-muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- env matrix */

.env-matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.env-matrix th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: #98a2b3; font-weight: 700; padding: 8px 8px; border-bottom: 1px solid var(--p-line); }
.env-matrix td { padding: 9px 8px; border-bottom: 1px solid #f0f2f7; vertical-align: middle; }
.env-matrix tr:last-child td { border-bottom: 0; }
.env-matrix .sys { font-weight: 650; color: var(--p-ink); }
.env-matrix .cell { display: inline-flex; align-items: baseline; gap: 4px; min-width: 30px; }
.env-matrix .cell b { font-size: 12.5px; color: var(--p-ink); }
.env-matrix .cell span { font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--p-muted); }
.env-matrix .num { color: var(--p-muted); }
.env-matrix .num.bad { display: block; margin-top: 2px; color: var(--p-red); font-weight: 650; font-size: 10.5px; }

/* ---------------------------------------------------------------- attention */

.attention { display: grid; gap: 2px; }
/* Rows come in two shapes: a whole-row link on the overview, and a div with a link in its title on an
   application. This rule is for the first shape only. Unscoped, it also turned the title link into a
   three-column grid, so "Assign 4 findings" broke into one word per column. */
.attention > a { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: start; padding: 10px 9px; border-radius: 10px; color: inherit; text-decoration: none; }
.attention > a:hover { background: #f8faff; text-decoration: none; }
.attention .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; }
.attention .t { display: block; font-size: 13px; font-weight: 650; line-height: 1.35; }
.attention .m { display: block; font-size: 11.5px; color: var(--p-muted); margin-top: 2px; line-height: 1.4; }
.attention .arrow { color: #98a2b3; font-size: 13px; margin-top: 3px; }
.attention-empty { padding: 14px 4px; color: var(--p-muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- runs / lists */

.run-list { display: grid; gap: 2px; }
.run-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 10px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.run-row:hover { background: #f8faff; text-decoration: none; }
.run-row .r-name { display: block; font-size: 13px; font-weight: 650; }
.run-row .r-sub { display: block; font-size: 11.5px; color: var(--p-muted); margin-top: 2px; }
.run-row .r-time { font-size: 11.5px; color: var(--p-muted); white-space: nowrap; }
.run-row .arrow { color: #98a2b3; }

/* ---------------------------------------------------------------- chips / pills */

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .35px; text-transform: uppercase; border: 1px solid transparent; white-space: nowrap; }
.pill.prod { background: var(--p-red-soft); color: var(--p-red); border-color: #f8ccd4; }
.pill.test { background: #eef2ff; color: #2f5bff; border-color: #d6e0ff; }
.pill.staging { background: var(--p-amber-soft); color: var(--p-amber); border-color: #f6dfbb; }
.pill.dev { background: var(--p-teal-soft); color: var(--p-teal); border-color: #c8ece6; }
.pill.unspecified { background: #f2f4f7; color: #667085; border-color: #e4e7ec; }
.pill.risk-q { background: var(--p-red-soft); color: var(--p-red); }
.pill.risk-d { background: var(--p-amber-soft); color: var(--p-amber); }
.pill.risk-ok { background: var(--p-teal-soft); color: var(--p-teal); }
.pill.neutral { background: #f2f4f7; color: #475467; }
.pill.shared { background: #eef2ff; color: #2f5bff; border-color: #d6e0ff; }

.coverage { display: inline-flex; align-items: center; gap: 8px; min-width: 110px; }
.coverage .bar { width: 62px; height: 6px; border-radius: 99px; background: #edf0f5; overflow: hidden; }
.coverage .bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2f5bff, #5eead4); }
.coverage .txt { font-size: 11.5px; color: var(--p-muted); white-space: nowrap; }

/* ---------------------------------------------------------------- empty state */

.portal-empty {
  padding: 30px;
  border: 1px solid var(--p-line);
  border-radius: 18px;
  background:
    radial-gradient(600px 240px at 90% 0%, rgba(47,91,255,.10), transparent 65%),
    linear-gradient(180deg, #ffffff, #fbfcff);
  box-shadow: var(--p-shadow);
}
.portal-empty h2 { margin-bottom: 6px; }
.portal-empty p { color: var(--p-muted); max-width: 620px; }
.portal-empty .portal-actions { margin-top: 16px; }

/* ---------------------------------------------------------------- tables */

.portal table.data, .portal table.systems-table, .portal table.report-table { font-size: 13px; }
.portal table.data th, .portal table.systems-table th, .portal table.report-table th {
  font-size: 10.5px; letter-spacing: .8px; color: #98a2b3; background: #fbfcfe;
}
.portal table.data td, .portal table.systems-table td, .portal table.report-table td { border-color: #f0f2f7; }
/* A blocked scan carries an archive URL with no break points. Left unbroken it spills out of the
   outcome column and over the target count beside it. */
.portal table.report-table td { overflow-wrap: anywhere; }
.portal table.data tr:hover td, .portal table.systems-table tr:hover td { background: #fbfcff; }
.portal .table-scroll { border-color: var(--p-line); border-radius: 12px; }

/* ---------------------------------------------------------------- legacy scans */

.legacy-scans {
  margin-top: 18px;
  padding: 0 18px;
  border: 1px solid var(--p-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--p-shadow);
}
.legacy-scans summary {
  cursor: pointer;
  padding: 14px 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--p-ink-soft);
}
.legacy-scans[open] summary { border-bottom: 1px solid #f0f2f7; margin-bottom: 8px; }
.legacy-scans .run-row { padding-left: 0; padding-right: 0; }

/* ---------------------------------------------------------------- motion */

@keyframes portal-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.portal .reveal { animation: portal-rise .45s ease both; }
.portal .reveal-2 { animation-delay: .05s; }
.portal .reveal-3 { animation-delay: .1s; }
.portal .reveal-4 { animation-delay: .15s; }

/* ---------------------------------------------------------------- system rows */

.system-list { display: grid; gap: 2px; }
.system-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .95fr) 104px 58px 98px;
  gap: 12px; padding: 0 10px 6px;
  color: #98a2b3; font-size: 10px; font-weight: 700;
  letter-spacing: .8px; text-transform: uppercase;
}
@media (max-width: 980px) { .system-list-head { display: none; } }
.suite-head {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 10px 5px; margin-top: 4px;
  border-top: 1px solid #edf1fa;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px; font-weight: 700; color: #667085;
}
.suite-head:first-child { border-top: 0; margin-top: 0; }
.suite-head span { font-weight: 500; letter-spacing: 0; text-transform: none; color: #98a2b3; }
.stack-links { display: grid; gap: 3px; }
.stack-links a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.system-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .95fr) 104px 58px 98px;
  gap: 12px;
  align-items: center;
  padding: 12px 10px;
  border-radius: 11px;
  border-bottom: 1px solid #f0f2f7;
}
.system-row:last-child { border-bottom: 0; }
.system-row:hover { background: #f8faff; }
.system-row .s-name { font-weight: 650; font-size: 13.5px; color: var(--p-ink); text-decoration: none; letter-spacing: -.01em; }
.system-row .s-name:hover { color: var(--p-accent); text-decoration: none; }
.system-row .s-sub { font-size: 11.5px; color: var(--p-muted); margin-top: 2px; line-height: 1.4; }
.system-row .s-sub button { border: 0; background: none; padding: 0; font: inherit; color: var(--p-accent); cursor: pointer; text-decoration: underline; }
.system-row .s-env { display: flex; gap: 4px; flex-wrap: wrap; }
.system-row .s-cov { display: grid; gap: 4px; }
.system-row .s-open { text-align: right; }
.system-row .s-open b { display: block; font-size: 16px; line-height: 1; color: var(--p-ink); }
.system-row .s-open span { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--p-muted); }
.system-row .s-actions { display: flex; gap: 5px; justify-content: flex-end; align-items: center; min-width: 0; }
.system-row .s-actions .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 980px) {
  .system-row { grid-template-columns: 1fr auto; }
  .system-row .s-env, .system-row .s-cov { grid-column: 1; }
  .system-row .s-open { grid-column: 2; grid-row: 1; }
  .system-row .s-actions { grid-column: 2; grid-row: 2; }
}

/* ---------------------------------------------------------------- workbench applications */

.wb-app-list { display: grid; gap: 10px; }
.wb-app-card { padding: 14px 16px; border: 1px solid var(--p-line); border-radius: 12px; background: #fff; }
.wb-app-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.wb-app-title strong { display: block; font-size: 14px; color: var(--p-ink); }
.wb-app-meta { margin-top: 2px; font-size: 11.5px; color: var(--p-muted); }
.wb-app-action { flex: 0 0 auto; }
.wb-app-action .link-btn { font-size: 12px; }
.wb-app-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px;
  margin-top: 12px; padding: 10px 12px; border-radius: 9px; background: #f8fafc;
}
.wb-k > span { display: block; margin-bottom: 3px; font-size: 9.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--p-muted); font-weight: 700; }
.wb-k > div { font-size: 12px; color: var(--p-ink-soft); }
.wb-k b { color: var(--p-ink); }
.wb-k small { display: block; margin-top: 2px; font-size: 10.5px; color: var(--p-muted); }
.wb-k .link-btn { display: block; margin-top: 3px; font-size: 11.5px; text-align: left; }
.wb-app-empty { padding: 18px; border: 1px dashed var(--p-line-strong); border-radius: 10px; color: var(--p-muted); font-size: 13px; }
@media (max-width: 900px) { .wb-app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .wb-app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wb-app-head { flex-direction: column; } }

/* ---------------------------------------------------------------- findings */

.finding-list { display: grid; gap: 0; }
.finding-card {
  display: grid; grid-template-columns: minmax(0, 1fr) 286px;
  gap: 24px; align-items: start;
  padding: 20px 4px;
  border-top: 1px solid #eef1f6;
}
.finding-card:first-child { border-top: 0; padding-top: 4px; }
.finding-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.finding-title { margin: 0; font-size: 15px; line-height: 1.4; letter-spacing: -.01em; }
.finding-where { margin: 6px 0 12px; font-size: 12px; color: var(--p-muted); }
.finding-where code { font-size: 12px; color: #475467; }
.finding-related { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 12px; color: var(--p-ink-soft); }
.finding-related .k {
  display: block; margin-bottom: 2px;
  color: var(--p-muted); font-size: 10.5px; font-weight: 700;
  letter-spacing: .7px; text-transform: uppercase;
}
.finding-apps { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; }
.finding-apps a { white-space: nowrap; }
.finding-remedy {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  align-items: end; padding-top: 2px;
}
.finding-remedy label { font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--p-muted); }
.finding-remedy select, .finding-remedy input {
  display: block; width: 100%; min-width: 0; margin-top: 4px;
  min-height: 32px; padding: 6px 8px;
  border: 1px solid var(--p-line-strong); border-radius: 7px;
  background: #fff; color: var(--p-ink); font: inherit; font-size: 12px;
}
.finding-remedy .btn { width: 100%; grid-column: 2; }

/* ---------------------------------------------------------------- run summary */

.report-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.report-actions .text-link { min-height: 30px; font-size: 12px; }
.report-summary .s { margin-top: 4px; font-size: 11px; line-height: 1.4; color: var(--p-muted); }
.run-list { display: grid; gap: 0; }
.run-target {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px;
  align-items: start; padding: 14px 2px; border-top: 1px solid #eef1f6;
}
.run-target:first-child { border-top: 0; padding-top: 0; }
.run-locator { display: block; font-size: 12.5px; color: #344054; overflow-wrap: anywhere; }
.run-target-meta { margin-top: 4px; font-size: 12px; color: var(--p-muted); }
.run-target-side { display: grid; justify-items: end; gap: 5px; text-align: right; min-width: 150px; }
.run-target-tags { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.run-target-side .text-link { min-height: 24px; font-size: 12px; }
.run-finding-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 370px)); gap: 12px; justify-content: start; }
.run-finding { padding: 16px; border: 1px solid var(--p-line); border-radius: 12px; background: #fff; }
.run-finding-head { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.run-finding h3 { margin: 0; font-size: 14.5px; line-height: 1.4; }
.run-finding-where { margin: 5px 0 12px; font-size: 11.5px; color: var(--p-muted); overflow-wrap: anywhere; }
.run-finding-meta { display: grid; gap: 7px; font-size: 12px; color: var(--p-ink-soft); }
.run-finding-meta .k {
  display: inline-block; min-width: 78px;
  color: var(--p-muted); font-size: 10.5px; font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase;
}
.run-finding .text-link { min-height: 26px; margin-top: 8px; font-size: 12px; }

.portal details.legacy-scans {
  margin-top: 14px; padding: 0;
  border: 1px solid var(--p-line); border-radius: 12px; background: #fff;
}
.portal details.legacy-scans summary {
  display: flex; align-items: center; gap: 8px; padding: 13px 16px;
  cursor: pointer; font-size: 13px; font-weight: 600; list-style: none;
}
.portal details.legacy-scans summary::-webkit-details-marker { display: none; }
.portal details.legacy-scans summary::before { content: "▸"; color: var(--p-muted); font-size: 11px; }
.portal details.legacy-scans[open] summary::before { content: "▾"; }
.portal details.legacy-scans > p, .portal details.legacy-scans > .run-list { padding: 0 16px; }
.portal details.legacy-scans > .run-list { padding-bottom: 12px; }

@media (max-width: 620px) {
  .run-target { grid-template-columns: 1fr; gap: 10px; }
  .run-target-side { justify-items: start; text-align: left; }
  .run-target-tags { justify-content: flex-start; }
}

/* Long stable keys are identifiers, not prose. Keep them on one line and reveal the full value on hover
   instead of wrapping every few characters in a narrow column. */
.asset-key {
  display: block; max-width: 100%; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11.5px; color: #667085;
}

/* File inputs are controls, not raw browser chrome. */
.file-field > .file-drop { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.file-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-drop > span {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px;
  border: 1px solid var(--p-line-strong); border-radius: 9px; background: #fff;
  color: var(--p-ink); font-size: 13px; font-weight: 600;
}
.file-drop:focus-within > span { outline: 2px solid var(--p-accent-soft); border-color: var(--p-accent); }

.portal .site-footer { margin-top: 20px; padding: 28px 0 34px; }
.portal .site-footer p { margin: 4px 0; }
.portal .site-footer a { color: var(--p-muted); }
.portal .site-footer .portal-hide { display: none; }

@media (max-width: 820px) {
  .finding-card { grid-template-columns: 1fr; gap: 16px; }
  .finding-remedy { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .finding-remedy { grid-template-columns: 1fr; }
  .finding-remedy .btn { grid-column: 1; }
}

/* ---------------------------------------------------------------- verification strip */

.verify-callout {
  padding: 13px 16px;
  border-radius: 13px;
  border: 1px solid #f0dfbb;
  background: linear-gradient(180deg, #fffaf0, #fff6e6);
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(16,24,40,.03);
}
.verify-callout .verify-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.verify-callout strong { font-size: 13px; color: #5c440f; }
.verify-callout .small { font-size: 12.5px; line-height: 1.5; }
.verify-callout .note { margin: 0; }

/* ---------------------------------------------------------------- workspace summary */

.coverage-panel {
  display: grid;
  grid-template-columns: 1.45fr .75fr;
  gap: 26px;
  align-items: center;
  padding: 22px 24px;
  margin-bottom: 16px;
  border: 1px solid var(--p-line);
  border-radius: 18px;
  background: var(--p-card);
  box-shadow: var(--p-shadow);
}
.coverage-panel h2 { margin: 4px 0 6px; font-size: 22px; }
.coverage-panel p { margin: 0; color: var(--p-muted); font-size: 13px; line-height: 1.55; }
.coverage-meter { display: grid; gap: 8px; }
.coverage-meter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.coverage-meter-head b { font-size: 30px; letter-spacing: -1.2px; color: var(--p-ink); line-height: 1; }
.coverage-meter-head span { font-size: 11.5px; color: var(--p-muted); }
.coverage-meter .bar { height: 10px; border-radius: 99px; background: #edf0f5; overflow: hidden; }
.coverage-meter .bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2f5bff, #5eead4); }
.coverage-meter a { font-size: 12px; font-weight: 600; color: var(--p-accent); }

.connect-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: center;
  padding: 18px 22px;
  margin-bottom: 16px;
  border: 1px solid #d6e0ff;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8faff, #eef3ff);
}
.connect-panel.connected { border-color: #c8ece6; background: linear-gradient(135deg, #f5fcfa, #e9f8f4); }
.connect-panel h2 { margin: 3px 0 5px; font-size: 18px; }
.connect-panel p { margin: 0; color: var(--p-muted); font-size: 13px; line-height: 1.55; }
.connect-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-start; }
@media (max-width: 980px) {
  .coverage-panel { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 1200;
  display: grid; place-items: center; padding: 20px;
  background: rgba(16, 24, 40, .46);
  backdrop-filter: blur(5px);
}
.modal-card {
  width: min(560px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--p-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(16, 24, 40, .28);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head h2 { margin: 0 0 4px; }
.modal-head p { margin: 0; }
.modal-close { border: 0; background: transparent; color: var(--p-muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 7px; }
.modal-close:hover { background: #f2f4f7; color: var(--p-ink); }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.modal-grid label { display: block; font-size: 12px; color: var(--p-muted); }
.modal-grid input, .modal-grid select {
  width: 100%; box-sizing: border-box; margin-top: 5px;
  padding: 10px 11px; border: 1px solid var(--p-line-strong); border-radius: 9px;
  background: #fff; color: var(--p-ink); font: inherit;
}
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 20px; }
.editor-env-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--p-line); }
.editor-env-head h3 { margin: 0 0 4px; font-size: 14px; }
.editor-env-head p { margin: 0 0 12px; font-size: 12px; line-height: 1.55; color: var(--p-muted); }
.editor-env-rows { display: grid; gap: 8px; }
.editor-env-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 12px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--p-line); border-radius: 10px; background: #fbfcff;
}
.editor-env-name { display: grid; gap: 2px; min-width: 0; }
.editor-env-name b { font-size: 13px; color: var(--p-ink); }
.editor-env-name small { font-size: 11.5px; color: var(--p-muted); }
.editor-env-row select { min-height: 36px; padding: 7px 9px; border: 1px solid var(--p-line-strong); border-radius: 8px; background: #fff; font: inherit; font-size: 12.5px; color: var(--p-ink); }
.editor-env-empty { display: grid; gap: 6px; }
.editor-env-empty > label { font-size: 12px; color: var(--p-muted); }
.editor-env-empty select { display: block; width: 100%; min-height: 36px; margin-top: 4px; padding: 7px 9px; border: 1px solid var(--p-line-strong); border-radius: 8px; background: #fff; font: inherit; font-size: 12.5px; }
@media (max-width: 620px) {
  .modal-grid { grid-template-columns: 1fr; }
  .editor-env-row { grid-template-columns: 1fr; gap: 7px; }
}

/* ---------------------------------------------------------------- suite rows */

.suite-row td {
  background: #f8faff;
  border-top: 1px solid #edf1fa;
  border-bottom: 1px solid #edf1fa;
  padding: 8px 10px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .9px;
  font-weight: 700;
  color: #667085;
}
.suite-row td span { margin-left: 6px; font-weight: 500; letter-spacing: 0; text-transform: none; color: #98a2b3; }
.suite-row:first-child td { border-top: 0; }

/* ---------------------------------------------------------------- deployment cards */

.deployment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px; }
.deployment-card { padding: 15px; border: 1px solid var(--p-line); border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.deployment-card .d-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.deployment-card .d-name { font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.deployment-card .d-region { font-size: 11.5px; color: var(--p-muted); margin-top: 2px; }
.deployment-card .d-stats { display: flex; gap: 14px; margin-top: 12px; padding-top: 11px; border-top: 1px solid #f0f2f7; }
.deployment-card .d-stat b { display: block; font-size: 17px; letter-spacing: -.4px; color: var(--p-ink); line-height: 1.1; }
.deployment-card .d-stat span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--p-muted); }
.deployment-card .d-stat.date b { font-size: 13px; font-weight: 650; letter-spacing: -.1px; line-height: 1.3; }
.deployment-card .d-scan { font-size: 11px; color: var(--p-muted); margin-top: 9px; }

/* ---------------------------------------------------------------- hierarchy strip */

.hierarchy-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--p-line); border-radius: 14px; background: #fff; margin-bottom: 16px; }
.hierarchy-strip .node { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--p-ink-soft); }
.hierarchy-strip .node b { color: var(--p-ink); font-weight: 650; }
.hierarchy-strip .node .glyph { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: #f2f5ff; color: var(--p-accent); font-size: 10px; font-weight: 800; }
.hierarchy-strip .sep { color: #cbd5e1; font-size: 12px; }
.hierarchy-strip .tail { margin-left: auto; font-size: 11.5px; color: var(--p-muted); }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .portal .report-head .systems-actions,
  .portal .systems-head .systems-actions { flex: 1 1 100%; justify-content: flex-start; }
}

@media (max-width: 1080px) {
  .portal .account-layout,
  .portal.nav-collapsed .account-layout { grid-template-columns: 1fr; gap: 14px; }
  /* Collapsing is a desktop-space control. Below this width the rail is already a horizontal strip,
     so the toggle would hide labels without saving any width. */
  .portal .nav-head { display: none; }
  .portal.nav-collapsed .nav-label { display: inline; }
  .portal.nav-collapsed .account-nav a { justify-content: flex-start; padding: 6px 12px; }
  /* The shell turns the rail into a horizontal strip here. The portal's sticky rail rule has higher
     specificity than styles.css, so it has to be reset explicitly or the strip is clipped to one line
     and overlaps the page heading. */
  .portal .account-nav {
    position: static;
    max-height: none;
    overflow: visible;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 8px;
  }
  .portal .account-nav .nav-section { display: none; }
  .portal .account-nav a { flex: 0 0 auto; border: 1px solid var(--p-line); border-radius: 999px; }
  .portal .account-nav a.nav-action { display: none; }
}

@media (max-width: 1180px) {
  .kpi-grid, .kpi-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .portal-split { grid-template-columns: 1fr; }
  .portal-hero { grid-template-columns: 1fr; }
  .hero-ring-wrap { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .portal .section { padding-top: 22px; }
  .portal-hero { padding: 24px 20px; border-radius: 18px; }
  .portal-hero h1 { font-size: 30px; }
  .kpi-grid, .kpi-grid.six, .kpi-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-ring { width: 132px; height: 132px; }
  .hero-ring .ring-n { font-size: 28px; }
  .portal-split, .portal-split > * { min-width: 0; }
  .section-head { flex-wrap: wrap; }
  .tree-org { flex-wrap: wrap; }
  .tree-org span { margin-left: 0; width: 100%; }
  .tree-suite { padding-left: 8px; padding-right: 8px; }
  .tree-system { grid-template-columns: minmax(0, 1fr) auto; padding-left: 24px; }
  .tree-system .metric.env, .tree-system .metric.cov, .tree-system .arrow { display: none; }
  .tree-system .metric.open { display: block; }
  .portal-head { flex-direction: column; }
  .env-matrix .sys { max-width: 150px; }
}

/* ---------------------------------------------------------------- overview: evidence paths, coverage, runs

   Added after a read-through of the workspace. Three problems drove these rules: a coverage sentence
   that named no deployment, a "risk mix" drawn as six 9px boxes that carried no message, and a scan
   list whose only signal was the word "partial". */

.evidence-paths { gap: 16px; align-items: stretch; }
.evidence-intro h2 { font-size: 19px; }
.evidence-options { display: grid; gap: 8px; }
.evidence-option {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid #dbe4ff;
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
  color: inherit;
  text-decoration: none;
}
.evidence-option:hover { border-color: var(--p-accent); background: #fff; text-decoration: none; }
.evidence-option .eo-step {
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center;
  background: var(--p-accent); color: #fff; font-size: 11.5px; font-weight: 750;
}
.evidence-option .eo-body { display: grid; gap: 2px; }
.evidence-option .eo-body b { font-size: 13.5px; color: var(--p-ink); }
.evidence-option .eo-body span { font-size: 12.5px; color: var(--p-muted); line-height: 1.5; }
.evidence-option .eo-go { font-size: 12px; font-weight: 650; color: var(--p-accent); white-space: nowrap; }
.evidence-option.unavailable { border-color: #e6e8ee; background: rgba(255, 255, 255, .5); }
.evidence-option.unavailable .eo-step { background: #98a2b3; }
.evidence-option.unavailable .eo-go { color: var(--p-muted); }
.evidence-foot { margin-top: 2px; }

.uncovered { margin-top: 14px; border-top: 1px dashed var(--p-line-strong); padding-top: 12px; }
.uncovered-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--p-amber);
  margin-bottom: 6px;
}
.uncovered ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.uncovered li { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; font-size: 12.5px; }
.uncovered li a { font-weight: 650; color: var(--p-ink); }
.uncovered li span { color: var(--p-muted); }
.coverage-ok { margin-top: 12px !important; color: var(--p-teal) !important; font-weight: 600; }

.risk-summary { margin: 2px 0 0; font-size: 14px; font-weight: 650; color: var(--p-ink); line-height: 1.45; }
.risklegend.big { gap: 2px; margin-top: 2px; }
.risklegend.big .row { font-size: 13px; padding: 7px 0; border-bottom: 1px solid #f2f4f8; }
.risklegend.big .row:last-child { border-bottom: 0; }
.risklegend.big .row b { font-size: 14px; color: var(--p-ink); }
.risklegend.big .dot { width: 10px; height: 10px; }
.riskbar { height: 14px; }

.run-legend { margin: 0 0 10px; font-size: 11.5px; color: var(--p-muted); line-height: 1.6; }
.run-legend b { color: var(--p-ink-soft); font-weight: 650; }
.r-why { display: block; margin-top: 3px; font-size: 11.5px; color: var(--p-amber); line-height: 1.45; }

.kpi .v .of { font-size: 14px; color: var(--p-muted); font-weight: 600; letter-spacing: 0; }

.verify-callout.quiet { border-color: var(--p-line-strong); background: #fbfcfe; }

/* Assets: application names were running together in one line. */
.stack-links { display: flex; flex-wrap: wrap; gap: 5px; }
.stack-links a {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  background: var(--p-accent-soft); color: #2440a8; font-size: 11.5px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.stack-links a:hover { background: #dfe7ff; text-decoration: none; }

@media (max-width: 760px) {
  .evidence-option { grid-template-columns: 24px minmax(0, 1fr); }
  .evidence-option .eo-go { grid-column: 2; }
}

/* A row-level scan failure is reported under the row that started it, not at the top of the page. */
.system-row { position: relative; flex-wrap: wrap; }
.system-row .row-error {
  flex: 1 0 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--p-red-soft);
  color: var(--p-red);
  font-size: 12px;
  line-height: 1.5;
}
.s-env-count {
  display: inline-block;
  margin-right: 6px;
  font-size: 11.5px;
  color: var(--p-muted);
}

/* Run lists and run reports: the reason a run did not finish belongs next to the outcome. */
.run-why { margin-top: 3px; font-size: 11.5px; color: var(--p-amber); line-height: 1.45; max-width: 280px; }
.run-places { list-style: none; margin: 6px 0 8px; padding: 0; display: grid; gap: 3px; }
.run-places li code { font-size: 11.5px; color: var(--p-ink-soft); }
.run-target.blocked { border-color: #f0dcc0; background: #fffcf6; }
.run-target-error {
  margin-top: 7px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #fff4e5;
  color: #8a4b06;
  font-size: 12px;
  line-height: 1.5;
}

/* Assets: an open finding is named on the row, not just counted. */
.finding-count { color: var(--p-red); font-size: 13px; }
.asset-findings { display: grid; gap: 2px; margin-top: 3px; }
.asset-finding { font-size: 11.5px; color: var(--p-muted); line-height: 1.4; }
.asset-finding.q { color: #8a1f28; }

/* A group of identical failed runs, folded into one row that opens. */
.run-group summary { cursor: pointer; font-size: 12px; font-weight: 650; color: var(--p-accent); white-space: nowrap; }
.run-group ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.run-group li { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.run-group li a { font-size: 11.5px; }

/* Asset register table. It had no rules of its own, so the last column fell off the panel edge. */
.asset-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.asset-search input[type="search"] {
  flex: 1 1 220px; min-width: 180px; padding: 9px 11px;
  border: 1px solid var(--p-line-strong); border-radius: 9px; font: inherit; font-size: 13px;
  background: var(--p-card); color: var(--p-ink);
}
.asset-search select {
  padding: 9px 10px; border: 1px solid var(--p-line-strong); border-radius: 9px;
  font: inherit; font-size: 12.5px; background: var(--p-card); color: var(--p-ink);
}
.asset-search .filter-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .45px; text-transform: uppercase;
  color: var(--p-muted); white-space: nowrap;
}
.asset-search .filter-label select { text-transform: none; letter-spacing: 0; font-weight: 500; }
.asset-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.asset-table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px;
  color: #98a2b3; font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--p-line);
  white-space: nowrap;
}
.asset-table td { padding: 10px; border-bottom: 1px solid #f2f4f8; vertical-align: top; }
.asset-table tr:last-child td { border-bottom: 0; }
.asset-table .name { font-weight: 650; color: var(--p-ink); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.asset-table .asset-key { display: block; margin-top: 3px; font-size: 11px; color: var(--p-muted); word-break: break-all; }
.asset-table td[data-label="Used by"] { min-width: 150px; }
.asset-table td[data-label="Open findings"] { min-width: 130px; }
.asset-table { table-layout: fixed; }
.asset-table td { overflow-wrap: anywhere; }
.stack-links a { max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }

/* The application tree row: the name was being squeezed by three fixed metric columns, so
   "Payment Processing" wrapped and the owner line broke into four. The metrics move into one
   flexible group that wraps as a unit. */
.tree-system { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tree-main { flex: 1 1 160px; min-width: 0; }
.tree-metrics { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tree-system .arrow { margin-left: auto; }

/* Scan progress. The report must not open until the run is finished, so progress is a first-class
   surface rather than a thin bar inside one page. It also names the stage that is running: a hosted
   read, a private-runner completion, or the report being built. */
.qr-run-modal {
  position: fixed; inset: 0; z-index: 220; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(7, 12, 22, .62); backdrop-filter: blur(3px);
}
.qr-run-modal[hidden] { display: none; }
.qr-run-card {
  width: min(640px, 100%); background: var(--p-card, #fff); color: var(--p-ink, #101828);
  border: 1px solid var(--p-line, #e4e7ec); border-radius: 16px; padding: 24px;
  box-shadow: 0 24px 70px rgba(6, 15, 30, .28);
}
.qr-run-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.qr-run-head h2 { margin: 2px 0 4px; font-size: 22px; letter-spacing: -.3px; }
.qr-run-head p { margin: 0; max-width: 470px; }
.qr-run-elapsed {
  flex: 0 0 auto; padding: 5px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700;
  color: #344054; background: #f2f4f7; border: 1px solid #e4e7ec; font-variant-numeric: tabular-nums;
}
.qr-run-track { height: 9px; margin: 18px 0 10px; border-radius: 99px; overflow: hidden; background: #eaecf0; }
.qr-run-track span {
  display: block; width: 0; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #2f5cff, #7c5cff); transition: width .45s ease;
}
.qr-run-track span.done { background: #12b76a; }
.qr-run-track span.failed { background: #d92d20; }
.qr-run-stage { min-height: 20px; font-size: 13px; font-weight: 600; color: #344054; }
.qr-run-steps { list-style: none; display: grid; gap: 7px; margin: 16px 0 0; padding: 0; }
.qr-run-step { display: flex; gap: 9px; align-items: baseline; font-size: 12.5px; color: #98a2b3; }
.qr-run-step .qr-run-dot {
  display: inline-grid; place-items: center; width: 19px; height: 19px; flex: 0 0 auto;
  border-radius: 50%; border: 1px solid #d0d5dd; font-size: 10px; font-weight: 700;
}
.qr-run-step.done { color: #344054; }
.qr-run-step.done .qr-run-dot { border-color: #12b76a; background: #ecfdf3; color: #027a48; }
.qr-run-step.active { color: #101828; font-weight: 650; }
.qr-run-step.active .qr-run-dot { border-color: #2f5cff; background: #eef2ff; color: #2f5cff; }
.qr-run-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.qr-run-card .tiny { margin-top: 14px; }
@media (max-width: 620px) {
  .qr-run-card { padding: 18px; border-radius: 14px; }
  .qr-run-head { flex-direction: column; }
  .qr-run-elapsed { align-self: flex-start; }
}

/* The run page's own progress meter, used while a completion is in flight. */
.run-progress { height: 9px; border-radius: 99px; overflow: hidden; background: #eaecf0; margin: 14px 0 8px; }
.run-progress span {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #2f5cff, #7c5cff); transition: width .5s ease;
}

/* Why a target stopped. Kept next to the target, not in a separate footnote. */
.run-target-reasons { margin: 7px 0 0; padding-left: 17px; color: #667085; font-size: 12px; line-height: 1.5; }
.run-target-reasons li { margin: 2px 0; }

/* ---------------------------------------------------------------- workbench additions */

/* A certificate row has eight columns and several long values (an issuer DN, a hostname, a renewal
   note). Auto layout used to divide the available width equally, so "DigiCert Inc" broke one letter
   per line and the owner field was clipped. The table now keeps readable column widths and scrolls
   inside its own box on a narrow window. */
.portal .cert-scroll { overflow-x: auto; }
.portal .cert-table { table-layout: fixed; min-width: 1060px; }
.portal .cert-table th, .portal .cert-table td { vertical-align: top; overflow-wrap: break-word; }
.portal .cert-table td:first-child strong { overflow-wrap: anywhere; }
.portal .cert-table td:nth-child(2) { font-size: 12.5px; line-height: 1.5; }
.portal .cert-issuer { display: grid; gap: 2px; }
.portal .cert-issuer b { font-weight: 600; color: var(--p-ink-soft); overflow-wrap: anywhere; }
.portal .cert-issuer small { font-size: 11.5px; color: var(--p-muted); }
.portal .cert-table input { width: 100%; min-width: 0; }
.portal .cert-table td:last-child { white-space: nowrap; }

.portal .setup-map { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 20px; margin-top: 6px; }
.portal .setup-map > div { display: grid; gap: 3px; }
.portal .setup-map b { font-size: 12.5px; color: var(--p-ink); }
.portal .setup-map span { font-size: 12px; line-height: 1.5; color: var(--p-muted); }
.portal .people-list { display: grid; gap: 10px; margin-top: 14px; }
.portal .person-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--p-line); border-radius: 11px; background: #fbfcff;
}
.portal .person-row label { font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--p-muted); }
.portal .person-row input { display: block; width: 100%; min-height: 34px; margin-top: 4px; padding: 7px 9px; border: 1px solid var(--p-line-strong); border-radius: 8px; font: inherit; font-size: 13px; color: var(--p-ink); background: #fff; }
.portal .wave-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.portal .wave-column { margin-bottom: 0; }
.portal .wave-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.portal .wave-head h2 { font-size: 16px; }
.portal .wave-head p { margin: 4px 0 0; font-size: 12px; line-height: 1.5; }
.portal .wave-items { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.portal .wave-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding-top: 8px; border-top: 1px solid #f0f2f7; }
.portal .wave-items li:first-child { border-top: 0; padding-top: 0; }
.portal .wave-item-name { display: grid; gap: 1px; min-width: 0; font-size: 12.5px; color: var(--p-ink); }
.portal .wave-item-name small { font-size: 11px; color: var(--p-muted); overflow-wrap: anywhere; }
.portal .wave-items select { max-width: 96px; min-height: 32px; padding: 5px 7px; border: 1px solid var(--p-line-strong); border-radius: 7px; background: #fff; font: inherit; font-size: 11.5px; }
@media (max-width: 1180px) { .portal .wave-board { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .portal .person-row { grid-template-columns: 1fr; align-items: stretch; }
  .portal .person-row .btn { justify-self: start; }
}

/* The workbench's explanatory panels. Signed in, they are reference material and start collapsed;
   signed out they are the introduction, so they stay open and carry no toggle. */
.wb-about { margin-bottom: 14px; }
.wb-about > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px; border: 1px solid var(--p-line-strong); border-radius: 999px;
  background: #fff; font-size: 13px; font-weight: 600; color: var(--p-ink-soft);
}
.wb-about > summary::-webkit-details-marker { display: none; }
.wb-about > summary::after { content: "▾"; font-size: 11px; line-height: 1; transition: transform .15s ease; }
.wb-about[open] > summary::after { transform: rotate(180deg); }
.wb-about > summary:hover { border-color: var(--p-accent); color: var(--p-accent); background: var(--p-accent-soft); }
.wb-about.is-public > summary { display: none; }
.wb-about > .wb-about-body { margin-top: 12px; }

/* Refreshing from Applications is an account action, not an explanation. It stays visible when the
   explanatory panels collapse, and it is hidden for a signed out reader who has no register to read. */
.wb-refresh { display: none; margin: 0 0 14px; }
body.authed .wb-refresh { display: flex; }
