/*
 * The portal header (layouts/_portal_header.html.erb).
 *
 * It renders on both stacks: the legacy reports layout (no Bootstrap,
 * html font-size 62.5%, body text-align center) and NextGen
 * reports_responsive (Bootstrap reboot, html font-size 14px). So everything
 * here is scoped to #s3-portal-header, sized in px, and sets its own box
 * model, font and colors rather than inheriting either stack's.
 */

/* ---------- Ground rules ---------- */

#s3-portal-header,
#s3-portal-header *,
#s3-portal-header *::before,
#s3-portal-header *::after {
  box-sizing: border-box;
}

/* The header's colors, in one place so another theme can swap the set.
   Product colors come separately, per product, as --s3n-fill, --s3n-line,
   --s3n-card and --s3n-pane (PortalNavHelper#portal_nav_suite_style). */
#s3-portal-header {
  --s3n-c-bg: #000b70;
  --s3n-c-text: #ffffff;
  --s3n-c-tab: #d3d8f2;
  --s3n-c-tab-muted: #a3abd6;
  --s3n-c-muted: #a9b1dc;
  --s3n-c-soft: #c9cff0;
  --s3n-c-quiet: #bcc3ea;
  --s3n-c-faint: #8a93c4;
  --s3n-c-link-hover: #9fdcf7;
  --s3n-c-focus: #5ec8f2;
  --s3n-c-panel: #0f1552;
  --s3n-c-field: #0a0f45;
  --s3n-c-field-faint: rgba(255, 255, 255, 0.07);
  --s3n-c-hover: rgba(255, 255, 255, 0.12);
  --s3n-c-hover-soft: rgba(255, 255, 255, 0.08);
  --s3n-c-hover-faint: rgba(255, 255, 255, 0.05);
  --s3n-c-open: rgba(255, 255, 255, 0.10);
  --s3n-c-line: rgba(255, 255, 255, 0.12);
  --s3n-c-edge: rgba(255, 255, 255, 0.28);
  --s3n-c-edge-strong: rgba(255, 255, 255, 0.3);
  --s3n-c-panel-edge: rgba(255, 255, 255, 0.16);
  --s3n-c-rule: rgba(255, 255, 255, 0.22);
  --s3n-c-scroll: rgba(255, 255, 255, 0.26);
  --s3n-c-sep: rgba(255, 255, 255, 0.4);
  --s3n-c-pill: rgba(255, 255, 255, 0.15);
  --s3n-c-pill-hover: rgba(255, 255, 255, 0.28);
  --s3n-c-shadow: rgba(0, 0, 0, 0.6);
  --s3n-c-shadow-soft: rgba(0, 0, 0, 0.5);
  --s3n-c-legacy-bg: #262626;
  --s3n-c-legacy-edge: #444444;
  --s3n-c-legacy-hover: #3d3d3d;
  --s3n-c-new: #0dcaf0;
  --s3n-c-beta: #ffc107;
  --s3n-c-ann: #ffc107;
  --s3n-c-ann-hover: #ffcd39;
  --s3n-c-ann-ink: #0a0f45;
  --s3n-c-preview: #a370f7;
  --s3n-c-bm-off: rgba(255, 255, 255, 0.55);
  --s3n-c-avatar: #284e85;
  --s3n-c-avatar-edge: #4692c2;
  --s3n-c-portrait: #c9e7f7;
  --s3n-c-ask-bg: #ffffff;
  --s3n-c-ask-text: #000b70;
  --s3n-c-ask-hover: #dde3ff;
  position: sticky;
  top: 0;
  z-index: 1030;
  width: 100%;
  background: var(--s3n-c-bg);
  /* On a product's page the top strip is that product's color
     (_portal_header sets --s3n-stripe); elsewhere it's the navy itself. */
  border-top: 3px solid var(--s3n-stripe, #000b70);
  color: var(--s3n-c-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: normal;
  letter-spacing: normal;
  text-align: left;
}

#s3-portal-header a,
#s3-portal-header a:visited {
  color: var(--s3n-c-text);
  text-decoration: none;
}

#s3-portal-header a:hover {
  color: var(--s3n-c-link-hover);
  text-decoration: none;
}

#s3-portal-header ul,
#s3-portal-header li {
  list-style: none;
  margin: 0;
  padding: 0;
}

#s3-portal-header p {
  margin: 0;
}

#s3-portal-header img {
  max-width: none;
  border: 0;
  vertical-align: middle;
}

#s3-portal-header button {
  margin: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: none;
  line-height: normal;
}

#s3-portal-header [hidden] {
  display: none !important;
}

#s3-portal-header button:focus-visible,
#s3-portal-header a:focus-visible,
#s3-portal-header input:focus-visible,
#s3-portal-header select:focus-visible {
  outline: 2px solid var(--s3n-c-focus);
  outline-offset: 2px;
}

#s3-portal-header .s3n-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#s3-portal-header svg path,
#s3-portal-header svg rect,
#s3-portal-header svg circle {
  vector-effect: non-scaling-stroke;
}

/* The classic NextGen header was fixed, and the body cleared it with a
   110px top margin. This one is sticky, in the page flow. */
body.s3n-on.layout-reports-responsive {
  margin-top: 0 !important;
}

body.s3n-on.layout-reports-responsive #mainAppContainer {
  margin-top: 10px;
}

/* The classic legacy header spanned the viewport inside #maincontent. A
   report wider than the window scrolls sideways; the header stays put, as
   the filter rail does, rather than scrolling off and leaving a black gap. */
body.s3n-on.s3n-legacy-layout #s3-portal-header {
  left: 0;
  width: calc(100vw - var(--scrollbarWidth, 0px));
  min-width: 99vw;
}

/* ---------- Header row: logo, title, tools ---------- */

#s3-portal-header .s3n-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  min-height: 54px;
  padding: 8px 16px 8px 14px;
}

#s3-portal-header .s3n-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

#s3-portal-header .s3n-logo img {
  display: block;
  width: 50px;
  height: 37px;
  object-fit: contain;
}

#s3-portal-header .s3n-brand-rule {
  width: 1px;
  height: 28px;
  background: var(--s3n-c-rule);
}

/* A client's logo sits on the bar as drawn, white for the navy header. One
   drawn for a light page (COMPANY_LOGOS plate: true) gets a white plate. */
#s3-portal-header .s3n-client-logo {
  display: inline-flex;
  align-items: center;
  height: 36px;
  max-width: 150px;
}

#s3-portal-header .s3n-client-logo img {
  display: block;
  max-height: 36px;
  max-width: 150px;
  width: auto;
  height: auto;
}

#s3-portal-header .s3n-client-logo.is-plated {
  height: 30px;
  padding: 3px 10px;
  border-radius: 6px;
  background: #ffffff;
}

#s3-portal-header .s3n-client-logo.is-plated img {
  max-height: 24px;
  max-width: 130px;
}

#s3-portal-header .s3n-title {
  display: flex;
  flex: 1 1 320px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  font-size: 28px;
  line-height: 1.15;
}

#s3-portal-header .s3n-title-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

#s3-portal-header .s3n-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 13px;
  color: var(--s3n-line);
}

#s3-portal-header .s3n-title-text {
  font-size: 28px;
  font-weight: 400;
  color: var(--s3n-c-text);
}

#s3-portal-header .s3n-bm-toggle {
  display: flex;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--s3n-c-bm-off);
  cursor: pointer;
}

#s3-portal-header .s3n-bm-toggle path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

#s3-portal-header .s3n-bm-toggle:hover {
  color: var(--s3n-c-text);
}

#s3-portal-header .s3n-bm-toggle[aria-pressed="true"] {
  color: var(--s3n-c-text);
}

#s3-portal-header .s3n-bm-toggle[aria-pressed="true"] path {
  fill: currentColor;
}

#s3-portal-header .s3n-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

#s3-portal-header .s3n-muted {
  color: var(--s3n-c-soft);
}

#s3-portal-header .s3n-sep {
  margin: 0 2px;
  color: var(--s3n-c-sep);
}

#s3-portal-header .s3n-sign-in {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border: 1px solid var(--s3n-c-sep);
  border-radius: 14px;
  font-size: 13px;
}

#s3-portal-header .s3n-sign-in:hover {
  background: var(--s3n-c-hover);
  color: var(--s3n-c-text);
}

/* Company picker: still a real select, styled as a chip. */
#s3-portal-header .s3n-company {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
}

#s3-portal-header .s3n-company-icon {
  position: absolute;
  left: 9px;
  pointer-events: none;
}

#s3-portal-header .s3n-company-icon path {
  fill: none;
  stroke: var(--s3n-c-soft);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#s3-portal-header .s3n-company .s3n-chev {
  position: absolute;
  right: 9px;
  pointer-events: none;
}

#s3-portal-header .s3n-company-select {
  height: 28px;
  margin: 0;
  padding: 0 26px 0 27px;
  border: 1px solid var(--s3n-c-edge);
  border-radius: 14px;
  background: transparent;
  color: var(--s3n-c-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 26px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
}

#s3-portal-header .s3n-company-select:hover {
  background: var(--s3n-c-hover);
}

#s3-portal-header .s3n-company-select option {
  background: var(--s3n-c-panel);
  color: var(--s3n-c-text);
}

/* Announcements: an amber chip, first in the tools, only while one is live
   (caution amber, as for warnings elsewhere). */
#s3-portal-header .s3n-ann-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px 0 9px;
  border: 0;
  border-radius: 14px;
  background: var(--s3n-c-ann);
  color: var(--s3n-c-ann-ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#s3-portal-header .s3n-ann-btn:hover {
  background: var(--s3n-c-ann-hover);
}

#s3-portal-header .s3n-ann-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#s3-portal-header .s3n-ann-count {
  min-width: 16px;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--s3n-c-ann-ink);
  color: var(--s3n-c-ann);
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}

/* The announcement banner under the menu bar: the newest message in
   caution amber, two lines at most, until it's dismissed. */
#s3-portal-header .s3n-ann-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 16px;
  background: var(--s3n-c-ann);
  color: var(--s3n-c-ann-ink);
  font-size: 13px;
  line-height: 18px;
}

#s3-portal-header .s3n-ann-banner[hidden],
#s3-portal-header .s3n-ann-more[hidden] {
  display: none;
}

#s3-portal-header .s3n-ann-banner-icon {
  display: flex;
  flex: 0 0 auto;
}

#s3-portal-header .s3n-ann-banner-text {
  display: -webkit-box;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: inherit;
  font-weight: 600;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

#s3-portal-header .s3n-ann-more {
  flex: 0 0 auto;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--s3n-c-ann-ink);
  border-radius: 6px;
  background: transparent;
  color: var(--s3n-c-ann-ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

#s3-portal-header .s3n-ann-more:hover,
#s3-portal-header .s3n-ann-dismiss:hover {
  background: rgba(10, 15, 69, 0.12);
}

#s3-portal-header .s3n-ann-dismiss {
  display: flex;
  flex: 0 0 auto;
  padding: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--s3n-c-ann-ink);
  cursor: pointer;
}

#s3-portal-header .s3n-ann-dismiss path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

#s3-portal-header .s3n-ann-more:focus-visible,
#s3-portal-header .s3n-ann-dismiss:focus-visible {
  outline: 2px solid var(--s3n-c-ann-ink);
  outline-offset: 1px;
}

/* The announcements dialog, in the middle of the page over a dimmed
   backdrop: these are usually problems with the data. */
#s3-portal-header .s3n-ann-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 0;
  border: 1px solid var(--s3n-c-panel-edge);
  border-radius: 12px;
  background: var(--s3n-c-panel);
  box-shadow: 0 24px 64px var(--s3n-c-shadow);
  color: var(--s3n-c-text);
  overflow: hidden;
}

#s3-portal-header .s3n-ann-dialog[open] {
  display: flex;
  flex-direction: column;
}

#s3-portal-header .s3n-ann-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

#s3-portal-header .s3n-ann-band {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 18px;
  background: var(--s3n-c-ann);
  color: var(--s3n-c-ann-ink);
}

#s3-portal-header .s3n-ann-badge {
  display: flex;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: 50%;
  background: var(--s3n-c-ann-ink);
  color: var(--s3n-c-ann);
}

#s3-portal-header .s3n-ann-badge .s3n-ann-icon {
  width: 18px;
  height: 18px;
}

#s3-portal-header .s3n-ann-heading {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  font-size: 12px;
  line-height: 16px;
}

#s3-portal-header .s3n-ann-heading strong {
  font-size: 17px;
  font-weight: 700;
  line-height: 22px;
}

#s3-portal-header .s3n-ann-close {
  display: flex;
  padding: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

#s3-portal-header .s3n-ann-close:hover {
  background: rgba(10, 15, 69, 0.12);
}

#s3-portal-header .s3n-ann-close path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

#s3-portal-header .s3n-ann-list {
  flex: 1 1 auto;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--s3n-c-scroll) transparent;
}

#s3-portal-header .s3n-ann-note {
  padding: 16px 20px;
  border-bottom: 1px solid var(--s3n-c-hover-soft);
}

#s3-portal-header .s3n-ann-note:last-child {
  border-bottom: 0;
}

#s3-portal-header .s3n-ann-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--s3n-c-muted);
  font-size: 12px;
  line-height: 16px;
}

#s3-portal-header .s3n-ann-until {
  padding: 0 8px;
  border: 1px solid rgba(255, 193, 7, 0.55);
  border-radius: 10px;
  color: var(--s3n-c-ann);
  font-size: 11px;
  line-height: 18px;
}

/* The message is the admin's own HTML. */
#s3-portal-header .s3n-ann-text {
  color: var(--s3n-c-text);
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

#s3-portal-header .s3n-ann-text p,
#s3-portal-header .s3n-ann-text ul,
#s3-portal-header .s3n-ann-text ol {
  margin: 0 0 8px;
}

#s3-portal-header .s3n-ann-text > :last-child {
  margin-bottom: 0;
}

#s3-portal-header .s3n-ann-text a,
#s3-portal-header .s3n-ann-text a:visited {
  color: var(--s3n-c-link-hover);
  text-decoration: underline;
}

#s3-portal-header .s3n-ann-foot {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--s3n-c-line);
}

#s3-portal-header .s3n-ann-ok {
  height: 34px;
  padding: 0 20px;
  border: 0;
  border-radius: 6px;
  background: var(--s3n-c-ann);
  color: var(--s3n-c-ann-ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#s3-portal-header .s3n-ann-ok:hover {
  background: var(--s3n-c-ann-hover);
}

#s3-portal-header .s3n-ann-ok:focus-visible,
#s3-portal-header .s3n-ann-close:focus-visible {
  outline: 2px solid var(--s3n-c-focus);
  outline-offset: 2px;
}

/* What's new: a chip like the company picker's, a dot while there are
   unread notes, and a panel of release notes. */
#s3-portal-header .s3n-wn-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--s3n-c-edge);
  border-radius: 14px;
  background: transparent;
  color: var(--s3n-c-text);
  font-size: 12px;
  cursor: pointer;
}

#s3-portal-header .s3n-wn-btn:hover,
#s3-portal-header .s3n-wn-btn[aria-expanded="true"] {
  background: var(--s3n-c-hover);
}

#s3-portal-header .s3n-wn-icon path {
  fill: currentColor;
}

/* A major release unread: a ring in the new color around the button. */
#s3-portal-header .s3n-wn-btn.is-major {
  border-color: var(--s3n-c-new);
  box-shadow: 0 0 0 2px var(--s3n-c-bg), 0 0 0 4px var(--s3n-c-new), 0 0 14px 4px rgba(13, 202, 240, 0.45);
}

#s3-portal-header .s3n-wn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--s3n-c-new);
  box-shadow: 0 0 0 2px var(--s3n-c-bg);
}

#s3-portal-header .s3n-wn-card {
  left: auto;
  right: 0;
  width: 380px;
  overflow: hidden;
}

#s3-portal-header .s3n-wn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 10px 16px;
  border-bottom: 1px solid var(--s3n-c-line);
  font-size: 15px;
  font-weight: 700;
}

#s3-portal-header .s3n-wn-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Under the title when the panel opened by itself (the weekly open). */
#s3-portal-header .s3n-wn-auto {
  color: var(--s3n-c-muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 14px;
}

#s3-portal-header .s3n-wn-close {
  display: flex;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--s3n-c-text);
  opacity: 0.7;
  cursor: pointer;
}

#s3-portal-header .s3n-wn-close:hover {
  opacity: 1;
}

#s3-portal-header .s3n-wn-close path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

#s3-portal-header .s3n-wn-list {
  display: flex;
  flex-direction: column;
  max-height: 460px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--s3n-c-scroll) transparent;
}

/* A note: its product's color down the left (no product: a quiet line). */
#s3-portal-header .s3n-wn-note {
  display: flex;
  gap: 12px;
  padding: 12px 16px 14px;
  border-bottom: 1px solid var(--s3n-c-hover-soft);
}

#s3-portal-header .s3n-wn-note:last-child {
  border-bottom: 0;
}

#s3-portal-header .s3n-wn-bar {
  flex: 0 0 3px;
  border-radius: 2px;
  background: var(--s3n-line, var(--s3n-c-rule));
}

#s3-portal-header .s3n-wn-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

#s3-portal-header .s3n-wn-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--s3n-c-muted);
  font-size: 11px;
  line-height: 14px;
}

#s3-portal-header .s3n-wn-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--s3n-c-line);
  font-size: 12px;
}

#s3-portal-header .s3n-wn-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

#s3-portal-header .s3n-wn-note.is-major .s3n-wn-title {
  font-size: 15px;
}

#s3-portal-header .s3n-wn-text {
  color: var(--s3n-c-soft);
  font-size: 12px;
  line-height: 1.45;
}

#s3-portal-header .s3n-wn-link,
#s3-portal-header .s3n-wn-link:visited {
  align-self: flex-start;
  margin-top: 2px;
  color: var(--s3n-c-link-hover);
  font-size: 12px;
}

#s3-portal-header .s3n-wn-link:hover {
  color: var(--s3n-c-text);
  text-decoration: underline;
}

/* A note's actions: its report (or Ask S3), then See a demo, as matching
   outline buttons in equal halves; one action takes the first half. */
#s3-portal-header .s3n-wn-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

#s3-portal-header .s3n-wn-links .s3n-wn-link,
#s3-portal-header .s3n-wn-links .s3n-wn-link:visited {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  gap: 5px;
  min-height: 28px;
  margin: 0;
  padding: 4px 8px;
  border: 1px solid var(--s3n-c-focus);
  border-radius: 6px;
  background: transparent;
  color: var(--s3n-c-link-hover);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

#s3-portal-header .s3n-wn-links .s3n-wn-link:hover {
  background: rgba(94, 200, 242, 0.14);
  color: var(--s3n-c-text);
  text-decoration: none;
}

#s3-portal-header .s3n-wn-links .s3n-wn-link.is-asked {
  color: var(--s3n-c-text);
}

#s3-portal-header .s3n-play path {
  fill: currentColor;
}

#s3-portal-header .s3n-wn-demo-len {
  font-weight: 400;
  opacity: 0.8;
}

/* Company picker with search, for logins with many companies. */
#s3-portal-header .s3n-company-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px 0 9px;
  border: 1px solid var(--s3n-c-edge);
  border-radius: 14px;
  background: transparent;
  color: var(--s3n-c-text);
  font-size: 12px;
  cursor: pointer;
}

#s3-portal-header .s3n-company-btn:hover,
#s3-portal-header .s3n-company-btn[aria-expanded="true"] {
  background: var(--s3n-c-hover);
}

#s3-portal-header .s3n-company-btn.is-switching {
  opacity: 0.6;
  cursor: progress;
}

#s3-portal-header .s3n-company-btn .s3n-company-icon {
  position: static;
  flex: 0 0 auto;
}

#s3-portal-header .s3n-company-card {
  left: auto;
  right: 0;
  width: 300px;
  overflow: hidden;
}

#s3-portal-header .s3n-company-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px;
  padding: 0 10px;
  border: 1px solid var(--s3n-c-edge-strong);
  border-radius: 6px;
  background: var(--s3n-c-field);
}

#s3-portal-header .s3n-company-search:focus-within {
  border-color: var(--s3n-c-focus);
}

#s3-portal-header .s3n-search-icon {
  flex: 0 0 auto;
}

#s3-portal-header .s3n-search-icon path,
#s3-portal-header .s3n-check path {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#s3-portal-header .s3n-search-icon path {
  stroke: var(--s3n-c-muted);
}

#s3-portal-header .s3n-check path {
  stroke: var(--s3n-c-focus);
  stroke-width: 1.8;
}

#s3-portal-header .s3n-company-q {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  color: var(--s3n-c-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 32px;
  text-align: left;
}

#s3-portal-header .s3n-company-q::placeholder {
  color: var(--s3n-c-faint);
  opacity: 1;
}

#s3-portal-header .s3n-company-q:focus-visible {
  outline: none;
}

#s3-portal-header .s3n-company-head {
  padding: 6px 14px 4px;
  color: var(--s3n-c-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#s3-portal-header .s3n-company-all {
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--s3n-c-scroll) transparent;
  padding-bottom: 6px;
}

#s3-portal-header #s3n-company-recent {
  padding-bottom: 4px;
}

#s3-portal-header .s3n-co {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  font-size: 13px;
  line-height: 16px;
  cursor: pointer;
}

#s3-portal-header .s3n-co:hover,
#s3-portal-header .s3n-co.is-active {
  background: var(--s3n-c-hover);
}

#s3-portal-header .s3n-co-mpid {
  flex: 0 0 auto;
  min-width: 64px;
  font-weight: 700;
}

#s3-portal-header .s3n-co-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--s3n-c-quiet);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#s3-portal-header .s3n-check {
  flex: 0 0 auto;
}

#s3-portal-header .s3n-company-none {
  padding: 4px 14px 14px;
  color: var(--s3n-c-muted);
  font-size: 13px;
}

/* ---------- Shared pieces ---------- */

#s3-portal-header .s3n-chev path,
#s3-portal-header .s3n-chev-right path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#s3-portal-header .s3n-chev {
  flex: 0 0 auto;
  transition: transform 0.15s;
}

#s3-portal-header [aria-expanded="true"] > .s3n-chev {
  transform: rotate(180deg);
}

#s3-portal-header .s3n-lock {
  flex: 0 0 auto;
}

#s3-portal-header .s3n-lock rect,
#s3-portal-header .s3n-lock path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
}

#s3-portal-header .s3n-pill {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 12px;
  white-space: nowrap;
}

#s3-portal-header .s3n-pill-new { color: var(--s3n-c-new); }
#s3-portal-header .s3n-pill-major { border-color: var(--s3n-c-new); background: var(--s3n-c-new); color: var(--s3n-c-field); }
#s3-portal-header .s3n-pill-beta { color: var(--s3n-c-beta); }
#s3-portal-header .s3n-pill-preview { color: var(--s3n-c-preview); }
#s3-portal-header .s3n-pill-off { color: var(--s3n-c-faint); }
#s3-portal-header .s3n-pill-soon { border-color: var(--s3n-c-muted); color: var(--s3n-c-soft); }

/* A product's mark: its icon on a tile of its color. */
#s3-portal-header .s3n-mark {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--s3n-fill);
  color: var(--s3n-ink, #ffffff);
  font-size: 10px;
  line-height: 1;
}

#s3-portal-header .s3n-mark-lg {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 17px;
}

#s3-portal-header .s3n-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--s3n-line, var(--s3n-c-focus));
}

#s3-portal-header .s3n-quiet {
  color: var(--s3n-c-quiet);
}

#s3-portal-header .s3n-quiet:hover {
  color: var(--s3n-c-text);
}

#s3-portal-header .s3n-underline {
  text-decoration: underline;
}

#s3-portal-header .s3n-grow {
  flex: 1 1 auto;
}

#s3-portal-header .s3n-linkbtn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--s3n-c-quiet);
  font-size: 12px;
  cursor: pointer;
}

#s3-portal-header .s3n-linkbtn:hover {
  color: var(--s3n-c-text);
}

#s3-portal-header .s3n-item {
  position: relative;
  display: flex;
  flex: 0 0 auto;
}

/* Every dropdown hangs off its item; portal_nav.js nudges it left when it
   would run off the right edge. */
#s3-portal-header .s3n-panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 40;
  margin-top: 6px;
  background: var(--s3n-c-panel);
  border: 1px solid var(--s3n-c-panel-edge);
  border-radius: 10px;
  box-shadow: 0 24px 48px var(--s3n-c-shadow);
  color: var(--s3n-c-text);
}

/* A bridge over the 6px gap, so the pointer can cross from tab to card. */
#s3-portal-header .s3n-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 8px;
}

/* ---------- Menu bar ---------- */

#s3-portal-header .s3n-bar {
  position: relative;
  z-index: 30;
  background: var(--s3n-c-bg);
  border-top: 1px solid var(--s3n-c-panel-edge);
}

#s3-portal-header .s3n-bar-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  min-height: 48px;
  padding: 0 10px;
}

#s3-portal-header .s3n-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--s3n-c-tab);
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
}

#s3-portal-header .s3n-tab:hover {
  color: var(--s3n-c-text);
}

#s3-portal-header .s3n-tab[aria-expanded="true"] {
  background: var(--s3n-c-open);
  color: var(--s3n-c-text);
}

/* The open menu and the current page's product wear their color. The
   current one is bold too, so it doesn't rest on color alone. */
#s3-portal-header .s3n-tab[aria-expanded="true"],
#s3-portal-header .s3n-tab.is-current {
  border-bottom-color: var(--s3n-line, var(--s3n-c-focus));
}

#s3-portal-header .s3n-tab.is-current {
  color: var(--s3n-c-text);
  font-weight: 700;
}

/* The bar's tabs are its main controls, so their marks run larger than the
   ones beside menu rows. */
#s3-portal-header .s3n-tab > .s3n-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 12px;
}

#s3-portal-header .s3n-suite.is-locked > .s3n-tab {
  color: var(--s3n-c-tab-muted);
}

#s3-portal-header .s3n-suite.is-locked > .s3n-tab .s3n-mark {
  opacity: 0.45;
}

#s3-portal-header .s3n-bar-rule {
  flex: 0 0 1px;
  margin: 13px 8px;
  background: var(--s3n-c-rule);
}

#s3-portal-header .s3n-group-label {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--s3n-c-muted);
}

/* ---------- Legacy: the classic menu, unchanged inside ---------- */

#s3-portal-header .s3n-legacy-card {
  width: 250px;
  margin-top: 0;
  padding: 4px 0;
  background: var(--s3n-c-legacy-bg);
  border: 1px solid var(--s3n-c-legacy-edge);
  border-top: 0;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 16px 32px var(--s3n-c-shadow-soft);
}

#s3-portal-header .s3n-legacy-card::before {
  display: none;
}

#s3-portal-header .s3n-legacy-list li {
  position: relative;
}

#s3-portal-header .s3n-legacy-list a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  color: var(--s3n-c-text);
  font-size: 14px;
}

#s3-portal-header .s3n-legacy-list li.is-open > a,
#s3-portal-header .s3n-legacy-list a:hover {
  background: var(--s3n-c-legacy-hover);
  color: var(--s3n-c-text);
}

#s3-portal-header .s3n-legacy-list a.sf-with-ul::after {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}

#s3-portal-header .s3n-legacy-list .menu-nav-icon {
  flex: 0 0 auto;
}

/* Flyouts open to the right of their row. portal_nav.js pins each one to the
   window (position: fixed) as it opens, so a long list can scroll without
   clipping the flyouts nested inside it. */
#s3-portal-header .s3n-legacy-list ul {
  display: none;
  position: fixed;
  z-index: 1;
  width: max-content;
  min-width: 220px;
  max-width: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--s3n-c-scroll) transparent;
  padding: 4px 0;
  background: var(--s3n-c-legacy-bg);
  border: 1px solid var(--s3n-c-legacy-edge);
  border-radius: 6px;
  box-shadow: 0 16px 32px var(--s3n-c-shadow-soft);
}

#s3-portal-header .s3n-legacy-list li.is-open > ul {
  display: block;
}

#s3-portal-header .s3n-legacy-rule {
  height: 1px;
  margin: 4px 0;
  background: var(--s3n-c-legacy-edge);
}

/* ---------- Product menus ---------- */

#s3-portal-header .s3n-card {
  display: flex;
  width: 640px;
  overflow: hidden;
  background: var(--s3n-card, var(--s3n-c-panel));
  border-top: 3px solid var(--s3n-line, var(--s3n-c-panel-edge));
}

#s3-portal-header .s3n-card-wide {
  width: 900px;
}

#s3-portal-header .s3n-card-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  padding: 10px;
}

#s3-portal-header .s3n-cols {
  display: flex;
  gap: 8px;
}

#s3-portal-header .s3n-col {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#s3-portal-header .s3n-col-head {
  margin: 0 0 4px;
  padding: 6px 12px 8px;
  border-bottom: 1px solid var(--s3n-c-line);
  color: var(--s3n-line, var(--s3n-c-muted));
  font-size: 12px;
}

#s3-portal-header .s3n-sub {
  padding: 12px 12px 4px;
  color: var(--s3n-line, var(--s3n-c-muted));
  font-size: 11px;
}

#s3-portal-header .s3n-report {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 7px;
  color: var(--s3n-c-text);
  font-size: 14px;
  font-weight: 700;
}

#s3-portal-header a.s3n-report:hover {
  background: var(--s3n-c-hover-soft);
  color: var(--s3n-c-text);
}

#s3-portal-header .s3n-report.is-off {
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  cursor: default;
}

#s3-portal-header .s3n-report-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--s3n-c-faint);
}

#s3-portal-header .s3n-desc {
  padding-left: 19px;
  color: var(--s3n-c-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

#s3-portal-header .s3n-card-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
  padding: 10px 12px 4px;
  border-top: 1px solid var(--s3n-c-line);
  font-size: 12px;
}

/* The Learning line: Learning Resources and the release notes, opened on
   this product, by its mark with a book. Learning Resources reads like the
   reports above it; the divider and the mark set it apart. */
#s3-portal-header .s3n-learn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 2px 0;
}

#s3-portal-header .s3n-book {
  width: 12px;
  height: 12px;
}

#s3-portal-header .s3n-book path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#s3-portal-header a.s3n-learn-title,
#s3-portal-header a.s3n-learn-title:visited {
  color: var(--s3n-c-text);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

#s3-portal-header a.s3n-learn-notes,
#s3-portal-header a.s3n-learn-notes:visited {
  margin-left: auto;
  color: var(--s3n-c-focus);
  white-space: nowrap;
}

#s3-portal-header a.s3n-learn-title:hover,
#s3-portal-header a.s3n-learn-notes:hover {
  color: var(--s3n-c-text);
  text-decoration: underline;
}

#s3-portal-header .s3n-note {
  color: var(--s3n-c-muted);
}

/* Greyed items hidden (the account menu's switch, off): products not in
   the plan, reports outside it, headings and columns left with none, the
   note about them, and What's new's See a demo for their videos (the
   Learning page leaves those out). portal_nav.js leaves the products out of the bar's
   fitting too; these rules also keep them from showing before it runs. */
#s3-portal-header.s3n-hide-off .s3n-suite.is-locked,
#s3-portal-header.s3n-hide-off .s3n-more-pick.is-locked,
#s3-portal-header.s3n-hide-off .s3n-report.is-off,
#s3-portal-header.s3n-hide-off .s3n-sub.is-all-off,
#s3-portal-header.s3n-hide-off .s3n-col[data-all-off],
#s3-portal-header.s3n-hide-off .s3n-note,
#s3-portal-header.s3n-hide-off .s3n-card-foot.is-note-only,
#s3-portal-header.s3n-hide-off .s3n-wn-demo.is-off {
  display: none;
}

#s3-portal-header.s3n-hide-off .s3n-card-wide[data-cols-on="1"] {
  width: 640px;
}

/* The right-hand pane: your favorites, or why the product is locked. */
#s3-portal-header .s3n-pane {
  display: flex;
  flex: 0 0 280px;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px 12px 14px 16px;
  background: var(--s3n-pane, var(--s3n-c-field));
  border-left: 1px solid var(--s3n-c-line);
}

#s3-portal-header .s3n-pane-head {
  color: var(--s3n-c-muted);
  font-size: 12px;
}

#s3-portal-header .s3n-fav-filter {
  display: flex;
  margin: 0 4px 0 0;
}

#s3-portal-header .s3n-fav-filter input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--s3n-c-edge);
  border-radius: 6px;
  background: var(--s3n-c-field-faint);
  color: var(--s3n-c-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
}

#s3-portal-header .s3n-fav-filter input::placeholder {
  color: var(--s3n-c-muted);
}

#s3-portal-header .s3n-favs {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--s3n-c-scroll) transparent;
}

#s3-portal-header .s3n-favs-pane.is-grouped .s3n-favs {
  max-height: 300px;
}

#s3-portal-header .s3n-fav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#s3-portal-header .s3n-fav-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--s3n-c-muted);
  font-size: 11px;
}

#s3-portal-header .s3n-fav-group-head .s3n-dot {
  width: 6px;
  height: 6px;
}

/* A long favorite name ends in an ellipsis (the full name is its tooltip)
   rather than widening the pane into a sideways scroll; its Company or
   Public tag always shows. */
#s3-portal-header .s3n-favs {
  overflow-x: hidden;
}

#s3-portal-header .s3n-fav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#s3-portal-header .s3n-fav-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
}

#s3-portal-header .s3n-fav-name > span:first-child,
#s3-portal-header .s3n-fav-report {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#s3-portal-header .s3n-vis {
  flex: 0 0 auto;
  padding: 0 5px;
  border: 1px solid var(--s3n-c-edge-strong);
  border-radius: 4px;
  color: var(--s3n-c-soft);
  font-size: 10px;
  font-weight: 400;
  line-height: 14px;
}

#s3-portal-header .s3n-fav-report,
#s3-portal-header .s3n-fav-empty {
  color: var(--s3n-c-muted);
  font-size: 12px;
}

#s3-portal-header .s3n-pane-link {
  font-size: 12px;
}

#s3-portal-header .s3n-lock-pane {
  padding: 18px 18px 16px;
}

#s3-portal-header .s3n-lock-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

#s3-portal-header .s3n-lock-text {
  color: var(--s3n-c-soft);
  font-size: 13px;
  line-height: 1.4;
}

/* Ask S3: one click emails sales (portal_nav.js), then reads Sales notified. */
#s3-portal-header .s3n-ask {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 7px 13px;
  border: 1px solid var(--s3n-c-ask-bg);
  border-radius: 6px;
  background: var(--s3n-c-ask-bg);
  color: var(--s3n-c-ask-text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#s3-portal-header .s3n-ask:hover {
  background: var(--s3n-c-ask-hover);
  color: var(--s3n-c-ask-text);
}

#s3-portal-header .s3n-ask.is-asked {
  border-color: var(--s3n-c-sep);
  background: transparent;
  color: var(--s3n-c-text);
}

#s3-portal-header .s3n-ask-link,
#s3-portal-header button.s3n-wn-link {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

#s3-portal-header .s3n-ask-link {
  color: var(--s3n-c-quiet);
  text-decoration: underline;
}

#s3-portal-header .s3n-ask-link:hover {
  color: var(--s3n-c-text);
}

#s3-portal-header [data-ask].is-asked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}

#s3-portal-header [data-ask].is-asked path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- More ---------- */

#s3-portal-header .s3n-more-card {
  display: flex;
  width: 660px;
  overflow: hidden;
}

#s3-portal-header .s3n-more-list {
  display: flex;
  flex: 0 0 270px;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  background: var(--s3n-c-field);
  border-right: 1px solid var(--s3n-c-line);
}

#s3-portal-header .s3n-more-head,
#s3-portal-header .s3n-more-title {
  padding: 6px 12px 8px;
  color: var(--s3n-c-muted);
  font-size: 12px;
}

#s3-portal-header .s3n-more-title {
  color: var(--s3n-line, var(--s3n-c-muted));
}

#s3-portal-header .s3n-more-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--s3n-c-text);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

#s3-portal-header .s3n-more-pick.is-locked {
  color: var(--s3n-c-tab-muted);
}

#s3-portal-header .s3n-more-pick.is-locked .s3n-mark {
  opacity: 0.45;
}

#s3-portal-header .s3n-more-pick[aria-pressed="true"] {
  background: var(--s3n-c-open);
}

#s3-portal-header .s3n-more-detail {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 10px;
}

#s3-portal-header .s3n-more-pane {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#s3-portal-header .s3n-more-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 6px;
  padding: 10px 12px 4px;
  border-top: 1px solid var(--s3n-c-line);
  font-size: 12px;
}

#s3-portal-header .s3n-ask.s3n-ask-sm {
  margin-top: 0;
  padding: 6px 11px;
  font-size: 12px;
}
/* ---------- Admin ---------- */

#s3-portal-header .s3n-admin-card {
  width: 560px;
  padding: 18px 20px 16px;
}

#s3-portal-header .s3n-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
}

#s3-portal-header .s3n-admin-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#s3-portal-header .s3n-admin-head {
  color: var(--s3n-c-muted);
  font-size: 12px;
}

#s3-portal-header .s3n-admin-link {
  font-size: 13px;
  line-height: 1.3;
}

/* ---------- Bookmarks ---------- */

#s3-portal-header .s3n-bookmarks {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-left: 14px;
  padding-left: 18px;
  border-left: 1px solid var(--s3n-c-rule);
}

#s3-portal-header .s3n-bm-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

#s3-portal-header .s3n-bm-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  max-width: 170px;
  padding: 4px 6px 4px 11px;
  border-radius: 14px;
  background: var(--s3n-c-pill);
  font-size: 12px;
}

/* A bookmark for a product's page leads with that product's mark (its menu
   tab's icon tile, small); a legacy bookmark stays plain. */
#s3-portal-header .s3n-bm-pill.has-mark {
  padding-left: 5px;
}

#s3-portal-header .s3n-mark-sm {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  font-size: 9px;
}

#s3-portal-header .s3n-mark-blank {
  background: transparent;
}

#s3-portal-header .s3n-bm-pill:hover,
#s3-portal-header .s3n-bm-pill.is-current {
  background: var(--s3n-c-pill-hover);
}

#s3-portal-header .s3n-bm-pill.is-dragging {
  opacity: 0.5;
}

#s3-portal-header .s3n-bm-pill a,
#s3-portal-header .s3n-bm-row a {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--s3n-c-text);
}

#s3-portal-header .s3n-bm-x {
  display: flex;
  flex: 0 0 auto;
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--s3n-c-text);
  opacity: 0.6;
  cursor: pointer;
}

#s3-portal-header .s3n-bm-x:hover {
  opacity: 1;
}

#s3-portal-header .s3n-bm-x path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

#s3-portal-header .s3n-bm-more {
  align-self: stretch;
  align-items: center;
}

#s3-portal-header .s3n-bm-rest {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 0;
  border-radius: 14px;
  background: var(--s3n-c-pill);
  color: var(--s3n-c-text);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

#s3-portal-header .s3n-bm-rest:hover,
#s3-portal-header .s3n-bm-rest[aria-expanded="true"] {
  background: var(--s3n-c-pill-hover);
}

#s3-portal-header .s3n-bm-icon path {
  fill: currentColor;
}

#s3-portal-header .s3n-bm-card {
  left: auto;
  right: 0;
  width: 340px;
  padding: 8px;
}

#s3-portal-header .s3n-bm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 12px;
  border-radius: 6px;
  font-size: 13px;
}

#s3-portal-header .s3n-bm-row:hover {
  background: var(--s3n-c-hover-soft);
}

#s3-portal-header .s3n-bm-row a {
  flex: 1 1 auto;
}

#s3-portal-header .s3n-bm-foot {
  margin-top: 4px;
  padding: 10px 12px 4px;
  border-top: 1px solid var(--s3n-c-line);
}

/* ---------- Account ---------- */

#s3-portal-header .s3n-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 2px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--s3n-c-text);
  cursor: pointer;
}

#s3-portal-header .s3n-avatar-btn:hover,
#s3-portal-header .s3n-avatar-btn[aria-expanded="true"] {
  background: var(--s3n-c-hover);
}

#s3-portal-header .s3n-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: flex-end;
  justify-content: center;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--s3n-c-avatar);
  box-shadow: inset 0 0 0 1px var(--s3n-c-avatar-edge);
}

#s3-portal-header .s3n-avatar-lg {
  width: 36px;
  height: 36px;
}

#s3-portal-header .s3n-portrait {
  width: 100%;
  height: 100%;
}

#s3-portal-header .s3n-portrait circle,
#s3-portal-header .s3n-portrait path {
  fill: var(--s3n-c-portrait);
}

#s3-portal-header .s3n-account-card {
  left: auto;
  right: 0;
  width: 264px;
  overflow: hidden;
}

#s3-portal-header .s3n-account-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--s3n-c-line);
}

#s3-portal-header .s3n-account-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#s3-portal-header .s3n-account-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
}

#s3-portal-header .s3n-account-email {
  overflow: hidden;
  color: var(--s3n-c-soft);
  font-size: 12px;
  line-height: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#s3-portal-header .s3n-account-items,
#s3-portal-header .s3n-account-foot {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

#s3-portal-header .s3n-account-foot {
  border-top: 1px solid var(--s3n-c-line);
}

#s3-portal-header .s3n-account-item,
#s3-portal-header .s3n-account-item:visited {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: var(--s3n-c-text);
  font-size: 13px;
  line-height: 16px;
}

#s3-portal-header .s3n-account-item:hover {
  background: var(--s3n-c-hover-faint);
  color: var(--s3n-c-text);
}

#s3-portal-header .s3n-account-item path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The "Show items not in your plan" switch, under the name. */
#s3-portal-header .s3n-account-setting {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--s3n-c-line);
}

#s3-portal-header .s3n-account-setting-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 13px;
  line-height: 16px;
}

#s3-portal-header .s3n-account-setting-note {
  color: var(--s3n-c-muted);
  font-size: 11px;
  line-height: 14px;
}

#s3-portal-header .s3n-switch {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--s3n-c-focus);
  cursor: pointer;
  transition: background 0.15s;
}

#s3-portal-header .s3n-switch[aria-checked="false"] {
  background: var(--s3n-c-pill-hover);
}

#s3-portal-header .s3n-switch-knob {
  position: absolute;
  top: 2px;
  left: 16px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--s3n-c-text);
  transition: left 0.15s;
}

#s3-portal-header .s3n-switch[aria-checked="false"] .s3n-switch-knob {
  left: 2px;
}

/* ---------- Messages ---------- */

#s3-portal-header .s3n-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--s3n-msg);
  box-shadow: inset 4px 0 0 var(--s3n-msg);
  background: var(--s3n-msg-bg);
  color: var(--s3n-c-text);
  font-size: 13px;
  line-height: 18px;
}

#s3-portal-header .s3n-msg-success { --s3n-msg: #3fb950; --s3n-msg-bg: #0a1e0d; }
#s3-portal-header .s3n-msg-error { --s3n-msg: #ff6b6b; --s3n-msg-bg: #291111; }
#s3-portal-header .s3n-msg-caution { --s3n-msg: #ffc107; --s3n-msg-bg: #291f01; }

#s3-portal-header .s3n-msg-icon {
  flex: 0 0 auto;
  margin-top: 1px;
}

#s3-portal-header .s3n-msg-icon path {
  fill: none;
  stroke: var(--s3n-msg);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#s3-portal-header .s3n-msg-text {
  flex: 1 1 auto;
  min-width: 0;
}

#s3-portal-header .s3n-msg-text a {
  color: inherit;
  text-decoration: underline;
}

#s3-portal-header .s3n-msg-close {
  display: flex;
  flex: 0 0 auto;
  padding: 3px;
  border: 0;
  background: transparent;
  color: var(--s3n-c-text);
  opacity: 0.7;
  cursor: pointer;
}

#s3-portal-header .s3n-msg-close:hover {
  opacity: 1;
}

#s3-portal-header .s3n-msg-close path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* ---------- Narrow screens ---------- */

/* A phone has no room for side-by-side columns, so each card's parts stack:
   More lists its products above the reports of the one picked. portal_nav.js
   keeps the card itself inside the window. */
@media (max-width: 640px) {
  #s3-portal-header .s3n-card,
  #s3-portal-header .s3n-cols,
  #s3-portal-header .s3n-more-card {
    flex-direction: column;
  }

  #s3-portal-header .s3n-col {
    flex: none;
  }

  #s3-portal-header .s3n-pane {
    flex: none;
    border-top: 1px solid var(--s3n-c-line);
    border-left: 0;
  }

  #s3-portal-header .s3n-more-list {
    flex: none;
    border-right: 0;
    border-bottom: 1px solid var(--s3n-c-line);
  }

  #s3-portal-header .s3n-more-pick .s3n-chev-right {
    display: none;
  }

  #s3-portal-header .s3n-admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
