/*
 * Brevily console partials. Unlayered, prefixed `brv-c-`, tokens only.
 * The frames come from the library's AuthLayout and SidebarLayout; these
 * are the pieces that fill them.
 */

/* ---------- auth ---------- */

.brv-c-auth-narrative {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: 26rem;
}

.brv-c-auth-narrative__title {
  margin: 0;
  font-family: var(--font-family-display);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tighter);
  color: var(--color-text-inverse);
}

.brv-c-auth-narrative__text {
  margin: 0;
  color: var(--color-text-inverse);
  opacity: 0.8;
  line-height: var(--line-height-relaxed);
}

.brv-c-auth-points {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--font-size-sm);
  color: var(--color-text-inverse);
}

.brv-c-auth-points li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: var(--space-2);
  align-items: start;
}

.brv-c-auth-points svg {
  color: var(--color-accent-inverse);
}

.brv-c-auth-quote {
  margin: auto 0 0;
  padding: var(--space-4);
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  color: var(--color-text-inverse);
}

.brv-c-auth-quote__meta {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--color-text-inverse);
  opacity: 0.7;
}

.brv-c-auth-card {
  width: 100%;
  max-width: 24rem;
}

.brv-c-auth-title {
  margin: 0;
  font-family: var(--font-family-display);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text);
}

.brv-c-auth-sub {
  margin: var(--space-2) 0 var(--space-5);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.brv-c-auth-form {
  display: grid;
  gap: var(--space-4);
}

.brv-c-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
}

.brv-c-auth-foot {
  margin: var(--space-5) 0 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-align: center;
}

.brv-c-auth-legal {
  margin: var(--space-4) 0 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
  text-align: center;
}

.brv-c-or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-3);
  align-items: center;
  font-size: var(--font-size-xs);
  letter-spacing: var(--letter-spacing-caps);
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.brv-c-or::before,
.brv-c-or::after {
  content: "";
  height: var(--border-width);
  background: var(--color-border);
}

.brv-c-otp {
  display: grid;
  gap: var(--space-4);
  justify-items: center;
}

.brv-c-otp .otp__cells {
  justify-content: center;
}

/* ---------- console chrome ---------- */

.brv-c-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brv-c-side-foot {
  margin-top: auto;
  flex: 0 0 auto;
  padding: var(--space-4);
  display: grid;
  gap: var(--space-3);
}

.brv-c-usage__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.brv-c-usage__value {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.brv-c-usage__bar {
  display: block;
  height: 6px;
  margin-top: var(--space-2);
  border-radius: var(--radius-full);
  background: var(--color-surface-sunken);
  overflow: hidden;
}

.brv-c-usage__fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-accent);
}

.brv-c-usage__fill--warn {
  background: var(--color-warning);
}

.brv-c-plan {
  padding: var(--space-4);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

/* ---------- console content ---------- */

.brv-c-page {
  display: grid;
  gap: var(--space-5);
}

.brv-c-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.brv-c-panel {
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.brv-c-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: var(--border-width) solid var(--color-border-subtle);
}

.brv-c-panel__title {
  margin: 0;
  font-family: var(--font-family-display);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.brv-c-panel__body {
  padding: var(--space-5);
}

.brv-c-panel__body--flush {
  padding: 0;
}

.brv-c-panel__foot {
  padding: var(--space-3) var(--space-5);
  border-top: var(--border-width) solid var(--color-border-subtle);
  text-align: center;
}

.brv-c-cols {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.brv-c-chart {
  display: block;
  width: 100%;
  height: auto;
}

.brv-c-chart-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

/* The 2px gap between stacked segments is the surface showing through, so
   the column group paints nothing of its own. */
.brv-c-chart__col {
  fill: none;
}

.brv-c-chart__bar {
  fill: var(--brv-series-1);
}
.brv-c-chart__bar--alt {
  fill: var(--brv-series-2);
}
.brv-c-chart__grid {
  stroke: var(--color-border);
  stroke-width: 1;
}
.brv-c-chart__axis {
  stroke: var(--color-border-strong);
  stroke-width: 1;
}
.brv-c-chart__label {
  fill: var(--color-text-subtle);
  font-size: 10px;
  font-family: var(--font-family-base);
}

.brv-c-legend {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-3);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.brv-c-legend__key {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-inline-end: var(--space-1);
  border-radius: 2px;
  background: var(--brv-series-1);
}

.brv-c-legend__key--alt {
  background: var(--brv-series-2);
}

.brv-c-bars {
  display: grid;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
}

.brv-c-bars__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-3);
  align-items: center;
}

.brv-c-bars__label {
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brv-c-bars__value {
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.brv-c-bars__track {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-surface-sunken);
  overflow: hidden;
}

.brv-c-bars__fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-accent);
}

@media screen and (max-width: 1199px) {
  .brv-c-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .brv-c-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media screen and (max-width: 767px) {
  .brv-c-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
  }

  .brv-c-stats .stat__icon {
    display: none;
  }

  .brv-c-stats .stat__label {
    font-size: var(--font-size-2xs);
    letter-spacing: var(--letter-spacing-caps);
    text-transform: uppercase;
  }

  .brv-c-stats .stat__value {
    font-size: var(--font-size-xl);
  }

  .brv-c-chart {
    min-width: 620px;
  }

  .brv-c-panel__body {
    padding: var(--space-4);
  }
}

/* ---------- width step scale (bars, usage meters) ---------- */
.brv-c-w-0 {
  width: 0%;
}
.brv-c-w-5 {
  width: 5%;
}
.brv-c-w-10 {
  width: 10%;
}
.brv-c-w-15 {
  width: 15%;
}
.brv-c-w-20 {
  width: 20%;
}
.brv-c-w-25 {
  width: 25%;
}
.brv-c-w-30 {
  width: 30%;
}
.brv-c-w-35 {
  width: 35%;
}
.brv-c-w-40 {
  width: 40%;
}
.brv-c-w-45 {
  width: 45%;
}
.brv-c-w-50 {
  width: 50%;
}
.brv-c-w-55 {
  width: 55%;
}
.brv-c-w-60 {
  width: 60%;
}
.brv-c-w-65 {
  width: 65%;
}
.brv-c-w-70 {
  width: 70%;
}
.brv-c-w-75 {
  width: 75%;
}
.brv-c-w-80 {
  width: 80%;
}
.brv-c-w-85 {
  width: 85%;
}
.brv-c-w-90 {
  width: 90%;
}
.brv-c-w-95 {
  width: 95%;
}
.brv-c-w-100 {
  width: 100%;
}

/* Grid and flex children must be allowed to shrink, or a wide scroller
   (the chart) pushes the whole column past the viewport. */
.layout__content,
.brv-c-page,
.brv-c-page > *,
.brv-c-cols > *,
.brv-c-panel,
.brv-c-panel__body,
.brv-c-chart-scroll {
  min-width: 0;
}

.brv-c-chart-scroll {
  max-width: 100%;
}

/* The sidebar plan card is narrow: stack label over value. */
.brv-c-plan .brv-c-usage__head {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.brv-c-plan .brv-c-usage__head + .brv-c-usage__head {
  margin-top: var(--space-3);
}

/* ---------- app frame: fixed top bar, full-height sidebar ----------
 * The base frame makes the header sticky and hangs the sidebar below it
 * at --scroll-padding-top, which leaves a gap. Here the bar is pinned for
 * good and the sidebar fills everything under it, scrolling on its own
 * menu rather than with the page.
 */

.layout--sidebar {
  --brv-c-topbar: 3.5rem;
}

.layout--sidebar .layout__header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  height: var(--brv-c-topbar);
  z-index: var(--z-sticky);
  border-bottom: var(--border-width) solid var(--color-border);
}

.layout--sidebar .layout__header > .navbar {
  height: 100%;
}

.layout--sidebar .layout__body {
  padding-top: var(--brv-c-topbar);
}

.layout--sidebar .layout__body > .sidebar {
  position: sticky;
  top: var(--brv-c-topbar);
  height: calc(100dvh - var(--brv-c-topbar));
  padding: 0;
  overflow: hidden;
  gap: 0;
}

/* Only the menu scrolls; the plan card stays put at the bottom. */
.layout--sidebar .sidebar__nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-3);
  scrollbar-width: thin;
}

/* Collapse control: top-right of the sidebar, revealed on hover or focus
   (and always visible once collapsed, so it can be brought back). */
.brv-c-collapse {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-muted);
  opacity: 0;
  transition: opacity var(--transition-fast), color var(--transition-fast),
    background var(--transition-fast);
  cursor: pointer;
}

.sidebar:hover .brv-c-collapse,
.brv-c-collapse:focus-visible,
.sidebar--collapsed .brv-c-collapse {
  opacity: 1;
}

.brv-c-collapse:hover {
  color: var(--color-accent);
  background: var(--color-surface-alt);
}

.sidebar--collapsed .brv-c-collapse {
  position: static;
  margin: var(--space-2) auto 0;
}

.sidebar--collapsed .brv-c-collapse svg {
  transform: scaleX(-1);
}

/* Collapsed rail: the plan card has no room, so it goes. */
.sidebar--collapsed .brv-c-side-foot {
  display: none;
}

.sidebar--collapsed .sidebar__nav {
  padding-inline: var(--space-2);
}

@media (prefers-reduced-motion: reduce) {
  .brv-c-collapse {
    transition: none;
  }
}

/* Leave the collapse control a strip of its own, so it never sits on the
   first menu item. */
.layout--sidebar .sidebar__nav {
  padding-top: 2.75rem;
}

.sidebar--collapsed .sidebar__nav {
  padding-top: var(--space-2);
}

/* Collapsing is a desktop affordance; the drawer has its own toggle. */
@media screen and (max-width: 991px) {
  .brv-c-collapse {
    display: none;
  }
  .layout--sidebar .sidebar__nav {
    padding-top: var(--space-3);
  }
}

/* ---------- global create bar ----------
 * Shortening is the product's one verb, so it lives in the chrome: a
 * sticky strip at the top of the content column on every console page.
 * It condenses once the page scrolls (see console.js, which sets
 * data-scrolled on <html>), giving the page back ~20px without ever
 * taking the action away.
 */

.brv-c-createbar {
  position: sticky;
  top: var(--brv-c-topbar);
  z-index: 20;
  margin: calc(var(--layout-gutter) * -1) calc(var(--layout-gutter) * -1) 0;
  padding: var(--space-3) var(--layout-gutter);
  background: var(--color-canvas);
  border-bottom: var(--border-width) solid var(--color-border);
  transition: padding var(--transition-base);
}

.brv-c-createbar__form {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), border-color
    var(--transition-fast);
}

.brv-c-createbar__form:focus-within {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}

.brv-c-createbar__icon {
  display: inline-flex;
  color: var(--color-text-subtle);
}

.brv-c-createbar__input {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--control-height-lg);
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--font-size-base);
  color: var(--color-text);
  transition: height var(--transition-base), font-size var(--transition-base);
}

.brv-c-createbar__input::placeholder {
  color: var(--color-text-subtle);
}
.brv-c-createbar__input:focus {
  outline: none;
}

.brv-c-createbar__opts {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding-inline: var(--space-2);
  border-inline-start: var(--border-width) solid var(--color-border-subtle);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.brv-c-createbar__hint {
  margin: var(--space-2) 0 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
  transition: opacity var(--transition-fast);
}

/* Condensed: a shorter control, no hint line, small button. */
:root[data-scrolled] .brv-c-createbar {
  padding-block: var(--space-2);
  box-shadow: var(--shadow-sm);
}

:root[data-scrolled] .brv-c-createbar__input {
  height: var(--control-height-md);
  font-size: var(--font-size-sm);
}

:root[data-scrolled] .brv-c-createbar__hint {
  display: none;
}

:root[data-scrolled] .brv-c-createbar__form {
  box-shadow: none;
}

:root[data-scrolled] .brv-c-createbar .btn--lg {
  height: var(--control-height-md);
  padding-inline: var(--space-4);
  font-size: var(--font-size-sm);
}

/* The page's own header starts below the bar. */
.brv-c-createbar + * {
  margin-top: var(--space-5);
}

@media screen and (max-width: 767px) {
  .brv-c-createbar {
    padding-block: var(--space-2);
  }
  .brv-c-createbar__opts {
    display: none;
  }
  .brv-c-createbar__hint {
    display: none;
  }
  .brv-c-createbar__input {
    height: var(--control-height-md);
    font-size: var(--font-size-sm);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brv-c-createbar,
  .brv-c-createbar__input,
  .brv-c-createbar__form {
    transition: none;
  }
}

/* The full-height sticky sidebar is a desktop rule only. Below 992px the
   base frame turns it into an off-canvas drawer, and a sticky element
   would take space in the flow and push the content down the page. */
@media screen and (max-width: 991px) {
  .layout--sidebar .layout__body > .sidebar {
    position: fixed;
    top: var(--brv-c-topbar);
    height: calc(100dvh - var(--brv-c-topbar));
    padding: var(--space-3) 0;
  }
}

/* Mobile: the create bar is chrome, not a hero. Tighten it to a single
   compact row hugging the header, and shorten the gap to the page title. */
@media screen and (max-width: 767px) {
  .brv-c-createbar {
    padding-block: var(--space-1);
  }

  .brv-c-createbar__form {
    padding: 2px 2px 2px var(--space-2);
    gap: var(--space-1);
    border-radius: var(--radius-md);
  }

  .brv-c-createbar .btn--lg {
    height: var(--control-height-md);
    padding-inline: var(--space-3);
    font-size: var(--font-size-sm);
  }

  .brv-c-createbar + * {
    margin-top: var(--space-3);
  }

  /* Already compact, so scrolling changes nothing but the shadow. */
  :root[data-scrolled] .brv-c-createbar {
    padding-block: var(--space-1);
  }
}

/* The page grid owns the rhythm, so the header's own bottom margin (from
   the base component) would double the gap. */
.brv-c-page > .page-header {
  margin-bottom: 0;
}

@media screen and (max-width: 767px) {
  .brv-c-page {
    gap: var(--space-4);
  }
}

/* ---------- links list ---------- */

.brv-c-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: var(--border-width) solid var(--color-border-subtle);
}

.brv-c-toolbar__search {
  flex: 1 1 16rem;
  min-width: 0;
}

.brv-c-toolbar__grow {
  flex: 1 1 auto;
}

.brv-c-cell-link {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brv-c-cell-link__dest {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 30rem;
}

.brv-c-cell-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
  white-space: nowrap;
}

.brv-c-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* ---------- link detail ---------- */

.brv-c-linkhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.brv-c-linkhead__link {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.brv-c-linkhead__dest {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.brv-c-kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
}

.brv-c-kv dt {
  color: var(--color-text-subtle);
}

.brv-c-kv dd {
  margin: 0;
  color: var(--color-text);
}

.brv-c-qr {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  margin-inline: auto;
  border-radius: var(--radius-md);
  background: var(--color-on-media);
}

.brv-c-qr__mod {
  fill: var(--color-text);
}

.brv-c-qr-card {
  display: grid;
  gap: var(--space-4);
  justify-items: center;
  text-align: center;
}

.brv-c-danger {
  border-color: var(--color-danger);
}

.brv-c-danger__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* ---------- analytics ---------- */

.brv-c-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.brv-c-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

@media screen and (max-width: 1199px) {
  .brv-c-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 767px) {
  .brv-c-grid-2,
  .brv-c-grid-3 {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }
  .brv-c-toolbar {
    padding: var(--space-3) var(--space-4);
  }
  .brv-c-linkhead__link {
    font-size: var(--font-size-lg);
  }
}

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

.brv-c-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.brv-c-modal-grid > .brv-c-span {
  grid-column: 1 / -1;
}

@media screen and (max-width: 575px) {
  .brv-c-modal-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.brv-c-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

/* ---------- toolbar combobox ---------- */

.brv-c-toolbar .combobox {
  flex: 0 1 15rem;
  min-width: 11rem;
}

.brv-c-toolbar .combobox .form-field__label {
  display: none;
}

/* ---------- organisation / profile ---------- */

.brv-c-person {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.brv-c-person__name {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brv-c-person__mail {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.brv-c-key {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.brv-c-dns {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
}

.brv-c-dns th,
.brv-c-dns td {
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--border-width) solid var(--color-border-subtle);
  text-align: start;
  white-space: nowrap;
}

.brv-c-dns th {
  font-family: var(--font-family-base);
  font-size: var(--font-size-2xs);
  letter-spacing: var(--letter-spacing-caps);
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.brv-c-dns-scroll {
  overflow-x: auto;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
}

.brv-c-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.brv-c-plan-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.brv-c-plan-card--current {
  border-color: var(--color-accent);
  border-width: var(--border-width-thick);
}

.brv-c-plan-card__price {
  font-family: var(--font-family-display);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
}

.brv-c-meters {
  display: grid;
  gap: var(--space-4);
}

.brv-c-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  padding-block: var(--space-3);
}

.brv-c-settings-row + .brv-c-settings-row {
  border-top: var(--border-width) solid var(--color-border-subtle);
}

.brv-c-settings-row__text {
  display: grid;
  gap: 2px;
  font-size: var(--font-size-sm);
}

.brv-c-settings-row__label {
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.brv-c-settings-row__hint {
  color: var(--color-text-muted);
}

.brv-c-avatar-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

@media screen and (max-width: 991px) {
  .brv-c-plans {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media screen and (max-width: 575px) {
  .brv-c-settings-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Keep the toolbar's multi-select on one line until it really has to wrap. */
.brv-c-toolbar .combobox__input {
  min-width: 3.5rem;
}

/* Collapsed rail: a parent with children has no room for its branch, so
   clicking it expands the sidebar (console.js) rather than opening a
   flyout — the base marks closed branches [hidden] with !important, which
   CSS alone cannot undo. The caret goes, since nothing expands in place. */
.sidebar--collapsed .menu__caret {
  display: none;
}

/* Keep the toolbar's multi-select on one line until it really has to wrap. */
.brv-c-toolbar .combobox__input {
  min-width: 3.5rem;
}

/* Collapsed rail: a parent's submenu becomes a flyout, so nested pages are
   still reachable without expanding the sidebar. Hover or keyboard focus
   opens it; the base hides sublists in the rail, this brings them back
   beside it. */
.sidebar--collapsed .menu__list > li {
  position: relative;
}

.sidebar--collapsed .menu__list > li:hover > .menu__sublist,
.sidebar--collapsed .menu__list > li:focus-within > .menu__sublist {
  display: block;
  position: absolute;
  inset-inline-start: 100%;
  top: 0;
  z-index: var(--z-dropdown);
  min-width: 12rem;
  margin-inline-start: var(--space-2);
  padding: var(--space-2);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.sidebar--collapsed .menu__list > li > .menu__sublist .menu__link-label {
  display: inline;
}

.sidebar--collapsed .menu__list > li > .menu__sublist .menu__caret {
  display: inline;
}

/* Inside a flyout the whole branch shows at once — a second hover level in
   a 72px rail is a hit-target trap. */
.sidebar--collapsed .menu__list > li:hover > .menu__sublist .menu__sublist,
.sidebar--collapsed .menu__list > li:focus-within > .menu__sublist .menu__sublist {
  display: block;
  position: static;
  margin: 0;
  padding: 0 0 0 var(--space-4);
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* A flyout has to escape the rail, so the rail stops clipping while
   collapsed (its icon list is short enough not to need the scroller). */
.layout--sidebar .layout__body > .sidebar--collapsed {
  overflow: visible;
}

.sidebar--collapsed .sidebar__nav {
  overflow: visible;
}

/* Six status options do not fit a phone: the filter takes its own row and
   scrolls sideways rather than pushing the page wide. */
@media screen and (max-width: 767px) {
  .brv-c-toolbar .segmented {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .brv-c-toolbar .combobox {
    flex: 1 1 100%;
  }
}

/* ---------- notifications, toasts specimen ---------- */

.brv-c-notif-panel {
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  overflow: hidden;
}

.brv-c-notif-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.brv-c-notif {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3) var(--space-4);
}

.brv-c-notif + .brv-c-notif {
  border-top: var(--border-width) solid var(--color-border-subtle);
}

.brv-c-notif__body {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: var(--font-size-sm);
}

.brv-c-notif__title {
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

.brv-c-notif__text {
  color: var(--color-text-muted);
}

.brv-s-icon--success {
  color: var(--color-success);
}
.brv-s-icon--warning {
  color: var(--color-warning);
}
.brv-s-icon--danger {
  color: var(--color-danger);
}
.brv-s-icon--ink {
  color: var(--color-text);
}

.brv-c-notif .brv-s-icon {
  width: 32px;
  height: 32px;
  margin: 0;
}

/* The toast specimen sits in the page instead of the corner region. */
.brv-c-toast-specimen .toast {
  position: static;
  width: 100%;
}

.brv-c-steps .timeline__body .btn {
  margin-top: var(--space-2);
}

/* ---------- public redirect pages ---------- */

.brv-p {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  min-height: 100dvh;
  padding: var(--space-6) var(--space-4);
  background: var(--color-canvas);
}

.brv-p__card {
  width: 100%;
  max-width: 26rem;
  padding: var(--space-6);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.brv-p__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-surface-sunken);
  color: var(--color-accent);
}

.brv-p__icon--warn {
  color: var(--color-warning);
}
.brv-p__icon--danger {
  color: var(--color-danger);
}

.brv-p__title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-family-display);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text);
}

.brv-p__text {
  margin: 0;
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
}

.brv-p__actions {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-5);
  text-align: start;
}

.brv-p__hint {
  margin: var(--space-4) 0 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
}

.brv-p__foot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
}

.brv-p__foot a {
  color: var(--color-text-muted);
}

/* ---------- staff tools (internal) ---------- */

.brv-t .navbar__brand {
  opacity: .9;
}

.brv-t-env {
  margin-left: var(--space-3);
  letter-spacing: .05em;
  text-transform: uppercase;
  font-size: var(--font-size-2xs);
}

.brv-t-count {
  margin-left: auto;
}

.brv-t-search {
  flex: 1 1 16rem;
  min-width: 0;
}

.brv-t-note {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border: var(--border-width) dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-muted);
}

.brv-t-note svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--color-text-subtle);
}

.brv-t-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-5);
  border-bottom: var(--border-width) solid var(--color-border-subtle);
  font-size: var(--font-size-sm);
}

.brv-t-check:last-child {
  border-bottom: 0;
}
.brv-t-check__name {
  color: var(--color-text);
}

.brv-t-decide {
  display: grid;
  gap: var(--space-3);
}

.brv-t-decide__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.brv-t-note-form {
  display: grid;
  gap: var(--space-3);
}

/* A stand-in for the sandbox screenshot: shapes only, never a real brand. */
.brv-t-shot {
  display: grid;
  gap: var(--space-3);
}

.brv-t-shot__frame {
  overflow: hidden;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.brv-t-shot__chrome {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-sunken, var(--color-canvas));
  border-bottom: var(--border-width) solid var(--color-border);
}

.brv-t-shot__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-border-strong);
}

.brv-t-shot__url {
  margin-left: var(--space-2);
  font-family: var(--font-family-mono);
  font-size: var(--font-size-2xs);
  color: var(--color-danger);
}

.brv-t-shot__body {
  display: grid;
  gap: var(--space-3);
  place-items: center;
  padding: var(--space-6) var(--space-5);
}

.brv-t-shot__logo {
  width: 5rem;
  height: 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-border-strong);
}

.brv-t-shot__line {
  width: 60%;
  height: .6rem;
  border-radius: 999px;
  background: var(--color-border);
}

.brv-t-shot__line--title {
  width: 45%;
  height: .9rem;
  background: var(--color-border-strong);
}

.brv-t-shot__field {
  width: 70%;
  height: 2rem;
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius-sm);
}

.brv-t-shot__btn {
  width: 70%;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: var(--color-border-strong);
}

@media screen and (max-width: 767px) {
  .brv-t-env {
    display: none;
  }
  .brv-t-check {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .brv-t-check .brv-c-cell-meta {
    grid-column: 2;
  }
}

/* Toolbar comboboxes: keep the tokens, the input and the caret on one line.
   Without this the caret drops to a second row and the filter is twice as
   tall as the controls beside it. */
.brv-c-toolbar .combobox {
  flex: 0 1 auto;
  min-width: 12rem;
  max-width: 15rem;
}

.brv-c-toolbar .combobox__field {
  flex-wrap: nowrap;
  overflow-x: auto;
  min-height: var(--control-height-sm, 2rem);
  padding-block: var(--space-1);
  scrollbar-width: none;
}

.brv-c-toolbar .combobox__field::-webkit-scrollbar {
  display: none;
}

.brv-c-toolbar .combobox__input {
  flex: 1 1 4rem;
  min-width: 4rem;
}

.brv-c-toolbar .combobox__token {
  flex: 0 0 auto;
}
.brv-c-toolbar .combobox__caret {
  flex: 0 0 auto;
}

/* ---------- the link-preview page ---------- */

.brv-p__facts {
  display: grid;
  gap: 0;
  margin: var(--space-5) 0 var(--space-5);
  text-align: left;
  border-top: var(--border-width) solid var(--color-border);
}

.brv-p__row {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: var(--space-3);
  padding-block: var(--space-3);
  border-bottom: var(--border-width) solid var(--color-border-subtle);
  font-size: var(--font-size-sm);
}

.brv-p__k {
  font-size: var(--font-size-xs);
  letter-spacing: var(--letter-spacing-caps);
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.brv-p__v {
  color: var(--color-text-muted);
}

/* The destination is the whole point of the page, so it is set large, in the
   mono face, and allowed to wrap rather than being truncated. */
.brv-p__dest {
  display: block;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-base);
  line-height: 1.5;
  overflow-wrap: anywhere;
  color: var(--color-text);
}

@media screen and (max-width: 767px) {
  .brv-p__row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
  }
}

/* ---------- density pass ----------
   A console is used for hours a day. It should read quieter and tighter
   than its own marketing site: hairlines instead of cards, one elevation,
   no decorative icons, and numbers that sit in a strip rather than in four
   boxes with pastel chips beside them. */

.brv-c-page {
  gap: var(--space-4);
}

.brv-c-panel {
  border-radius: var(--radius-md);
}

.brv-c-panel__head {
  padding: var(--space-3) var(--space-4);
}

.brv-c-panel__body {
  padding: var(--space-4);
}

.brv-c-panel__body--flush {
  padding: 0;
}

.brv-c-panel__title {
  font-family: var(--font-family-display);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-tight);
}

/* The page header carries a title and a subtitle, not a hero. */
.brv-c-page > .page-header {
  margin-bottom: 0;
}

.brv-c-page .page-header__title {
  font-family: var(--font-family-display);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-tighter);
}

.brv-c-page .page-header__subtitle {
  margin-top: var(--space-1);
  max-width: 46rem;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-base);
  color: var(--color-text-muted);
}

/* Figures: one hairline strip across the top of a page. */
.brv-c-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-top: var(--border-width) solid var(--color-border);
  border-bottom: var(--border-width) solid var(--color-border);
}

.brv-c-fig {
  display: grid;
  gap: var(--space-1);
  align-content: start;
  min-width: 0;
  padding-left: var(--space-4);
  border-left: var(--border-width) solid var(--color-border-subtle);
}

.brv-c-fig:first-child {
  padding-left: 0;
  border-left: 0;
}

.brv-c-fig__v {
  font-family: var(--font-family-display);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--letter-spacing-tighter);
  line-height: 1.05;
  color: var(--color-text);
}

.brv-c-fig__l {
  font-size: var(--font-size-sm);
  color: var(--color-text-subtle);
}

.brv-c-fig__s {
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
}

.brv-c-fig__d {
  margin-left: var(--space-2);
  font-variant-numeric: tabular-nums;
}

.brv-c-fig__d--up {
  color: var(--color-success);
}
.brv-c-fig__d--down {
  color: var(--color-danger);
}

/* Tables: a row is a line of data, not a list item with air around it. */
.data-table__table td,
.data-table__table th {
  height: 32px;
  padding-inline: var(--space-3);
}

.data-table__table td {
  font-size: var(--font-size-sm);
}

.data-table__table th {
  font-size: var(--font-size-2xs);
  letter-spacing: var(--letter-spacing-caps);
}

.brv-c-cell-meta {
  font-size: var(--font-size-xs);
}

/* Navigation sits closer together; the labels are short. */
.sidebar__nav .menu__link {
  min-height: 30px;
  padding-block: var(--space-1);
  font-size: var(--font-size-sm);
}

.brv-c-side-foot {
  padding: var(--space-3);
}

.brv-c-plan {
  gap: var(--space-2);
}

/* Grids between panels lose a step of air too. */
.brv-c-grid-2,
.brv-c-grid-3 {
  gap: var(--space-4);
}

@media screen and (max-width: 1199px) {
  .brv-c-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .brv-c-fig:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }
}

@media screen and (max-width: 767px) {
  .brv-c-stats {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }
  .brv-c-fig {
    padding-left: 0;
    border-left: 0;
  }
  .brv-c-fig__v {
    font-size: var(--font-size-2xl);
  }
}

/* The auth narrative panel is ink, so anything that defaults to ink has to
   be told otherwise — including the wordmark, which fills with --color-text. */
.brv-c-auth-narrative .brv-logo__letters {
  fill: var(--color-text-inverse);
}
.brv-c-auth-narrative .brv-logo__tittle {
  fill: var(--color-accent-inverse);
}

.brv-c-auth-narrative .brv-s-plus {
  color: var(--color-accent-inverse);
}

.brv-c-auth-quote a,
.brv-c-auth-quote__meta a {
  color: var(--color-accent-inverse);
  text-decoration: underline;
  text-underline-offset: 2px;
}
