/* 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; }
.portal .wrap { max-width: 1120px; }
.portal .account-layout { grid-template-columns: 232px 1fr; gap: 30px; }

.portal .account-nav {
  top: 92px;
  padding: 12px;
  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 { color: #98a2b3; letter-spacing: .9px; }
.portal .account-nav a { color: #475467; border-radius: 9px; }
.portal .account-nav a:hover { background: #f2f5ff; color: var(--p-accent); }
.portal .account-nav a.current { background: var(--p-accent-soft); color: var(--p-accent); font-weight: 650; }

.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 .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; }
.portal .btn { border-radius: 10px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.portal .systems-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.portal .report-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: flex-start; }
.portal .report-head > * { min-width: 0; }
.portal .btn.secondary { border-color: var(--p-line-strong); background: #fff; color: var(--p-ink); }
.portal .btn.secondary:hover { border-color: #b8c2d6; background: #fbfcff; }
.portal .btn.ghost { color: var(--p-ink-soft); }
.portal .btn.small { padding: 7px 11px; font-size: 12.5px; }

.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); }

/* ---------------------------------------------------------------- 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; }
.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; }
.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; }
.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; }
.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; }
@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; }
}

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

#findings-table select,
#findings-table input {
  padding: 7px 9px;
  border: 1px solid var(--p-line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--p-ink);
  font: inherit;
  font-size: 12.5px;
}
#findings-table select { min-width: 116px; }
#findings-table input { min-width: 110px; }

/* ---------------------------------------------------------------- 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; }
@media (max-width: 620px) { .modal-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- 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 { grid-template-columns: 1fr; gap: 14px; }
  /* 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; }
  .tree-system { grid-template-columns: 1fr auto; }
  .tree-system .metric:nth-of-type(2), .tree-system .metric:nth-of-type(3) { display: none; }
  .portal-head { flex-direction: column; }
  .env-matrix .sys { max-width: 150px; }
}
