/*
 * The account site's styles. Colours, radii, spacing and shadows come from the --brand-*,
 * --base-*, --radius-*, --space-* and --shadow-* variables lib/token-css.ts builds from
 * @qualifier/shared's tokens; nothing here is a raw hex. Lighter tints are mixed from those
 * with color-mix().
 *
 * Layout follows designs/account (Claude Design, 2026-10-27): signed-out screens are a navy
 * brand panel beside the form (.auth, app/_components/Card.tsx); signed-in screens are a top
 * bar over the page (.topbar + .shell, app/_components/AppPage.tsx).
 */

@font-face {
  font-family: 'Arimo';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/arimo-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Arimo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/arimo-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/roboto-mono-latin-400-normal.woff2') format('woff2');
}

:root {
  --mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 16%, transparent);
  --row-line: color-mix(in srgb, var(--base-line) 70%, var(--base-white));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--base-paper);
  color: var(--brand-charcoal);
  font-family: 'Arimo', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
}

a:hover {
  color: var(--brand-secondary);
  text-decoration: underline;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* ── The lockup: mark, BlueDog, Account ───────────────────────────────────────── */

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-charcoal);
}

.lockup:hover {
  color: var(--brand-charcoal);
  text-decoration: none;
}

.lockup img {
  display: block;
  width: auto;
  height: 30px;
}

.lockup b,
.lockup i {
  font-size: 19px;
  letter-spacing: -0.01em;
}

.lockup b {
  font-weight: 700;
}

.lockup i {
  font-style: normal;
  color: var(--brand-supporting);
  padding-left: 10px;
  border-left: 1px solid var(--base-line2);
}

.lockup.rev,
.lockup.rev:hover {
  color: var(--base-white);
}

.lockup.rev i {
  color: color-mix(in srgb, var(--base-fg-on-dark) 75%, var(--brand-secondary));
  border-color: color-mix(in srgb, var(--base-white) 25%, transparent);
}

/* ── Type ─────────────────────────────────────────────────────────────────────── */

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-primary);
}

.lead {
  font-size: 15px;
  line-height: 1.5;
  color: var(--brand-supporting);
  text-wrap: pretty;
}

.muted {
  margin: 0 0 var(--space-4);
  color: var(--brand-supporting);
}

/* Fine print at the foot of a card. */
.muted.small {
  margin: var(--space-4) 0 0;
  font-size: 13px;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
}

/* ── Signed-out screens: brand panel + form ───────────────────────────────────── */

.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px var(--space-4);
}

.split {
  width: 100%;
  max-width: 880px;
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  min-height: 540px;
  background: var(--base-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.brandside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px;
  overflow: hidden;
  background: var(--brand-secondary);
  color: var(--base-white);
}

.brandside-art,
.brandside-art .rule,
.brandside-art .dot,
.brandside-art .stem {
  position: absolute;
}

.brandside-art {
  inset: 0;
}

.brandside-art .rule {
  left: 0;
  right: 0;
  bottom: 118px;
  height: 2px;
  background: color-mix(in srgb, var(--base-white) 12%, transparent);
}

.brandside-art .dot {
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, var(--base-white) 28%, transparent);
  border-radius: 50%;
}

.brandside-art .dot.one {
  left: 250px;
  bottom: 111px;
}

.brandside-art .dot.two {
  left: 96px;
  bottom: 150px;
}

.brandside-art .stem {
  left: 102px;
  bottom: 120px;
  width: 2px;
  height: 30px;
  background: color-mix(in srgb, var(--base-white) 12%, transparent);
}

.brandside > .lockup,
.brandside-copy {
  position: relative;
}

.brandside-line {
  max-width: 280px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brandside-host {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: color-mix(in srgb, var(--base-fg-on-dark) 75%, var(--brand-secondary));
}

.formside {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 56px 56px 40px;
}

.formhead {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.formhead h1,
.phead h1 {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--brand-charcoal);
}

/* The way back sits at the foot of the form, under a hairline. */
.formside > .back {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--base-line);
}

/* On a phone the brand panel becomes a band over the form. */
@media (max-width: 760px) {
  .auth {
    display: block;
    padding: 0;
  }
  .split {
    display: block;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
  .brandside {
    padding: 28px 24px;
  }
  .brandside-art .rule {
    bottom: 16px;
  }
  .brandside-art .dot,
  .brandside-art .stem,
  .brandside-host {
    display: none;
  }
  .brandside-line {
    margin: 34px 0 12px;
    max-width: 260px;
    font-size: 21px;
    line-height: 1.25;
  }
  .formside {
    gap: 24px;
    padding: 28px 24px 40px;
  }
  .formhead h1 {
    font-size: 26px;
  }
  .formside > .back {
    margin-top: 4px;
    padding-top: 0;
    border-top: 0;
  }
}

/* "Sent": the form, swapped for what happened (reset). */
.sent {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--brand-tint-success) 55%, var(--base-white));
  border: 1px solid color-mix(in srgb, var(--brand-success) 22%, var(--base-white));
}

.sent .ok {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-success);
}

.sent .ok::after {
  content: '';
  position: absolute;
  left: 13px;
  top: 8px;
  width: 8px;
  height: 15px;
  border-right: 3px solid var(--base-white);
  border-bottom: 3px solid var(--base-white);
  transform: rotate(45deg);
}

/* ── Signed-in screens: top bar + page ────────────────────────────────────────── */

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 32px;
  background: var(--base-white);
  border-bottom: 1px solid var(--base-line);
}

.topbar.navy {
  background: var(--brand-secondary);
  border-color: var(--brand-secondary);
}

.whois {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 14px;
  color: var(--brand-supporting);
}

.navy .whois {
  color: var(--base-fg-on-dark);
}

.whois-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  background: var(--brand-gold-fill);
  color: var(--brand-charcoal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.avatar {
  flex: none;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand-secondary);
  font-size: 13px;
  font-weight: 700;
}

.avatar.you {
  background: color-mix(in srgb, var(--brand-primary) 14%, var(--base-white));
  color: var(--brand-primary);
}

/* Someone invited, not yet in. */
.avatar.invited {
  background: var(--base-white);
  border: 1.5px dashed var(--base-line2);
  color: var(--brand-supporting);
}

.shell {
  margin: 0 auto;
  padding: 28px 32px 48px;
}

.shell.narrow {
  max-width: 704px;
}

.shell.page {
  max-width: 1088px;
}

.shell.wide {
  max-width: 1376px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}

.back > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

a.back::before,
.back > a::before {
  content: '';
  width: 7px;
  height: 7px;
  margin-right: 2px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.phead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  margin: 22px 0 24px;
}

.phead .eyebrow {
  margin-bottom: 8px;
  /* Page-header eyebrows are gold, as the design system's screens show (#1266); the
     signed-out card's eyebrow (.auth) stays primary. */
  color: var(--brand-gold-text);
}

.meta {
  margin-top: 8px;
  font-size: 14px;
  color: var(--brand-supporting);
}

.phead-action {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 15px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .topbar {
    padding: 14px 16px;
  }
  .whois-email {
    display: none;
  }
  .shell {
    padding: 20px 16px 40px;
  }
  .phead {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin: 18px 0;
  }
  .phead h1 {
    font-size: 26px;
  }
}

/* A white card on the page. `.panel` pads its content; list cards pad their rows. */
.panel,
.listcard {
  background: var(--base-white);
  border: 1px solid var(--base-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}

.panel {
  padding: var(--space-6);
}

.panel + .panel {
  margin-top: var(--space-6);
}

.listcard {
  overflow: hidden;
}

/* A table wider than the screen scrolls inside its card rather than off the page. */
.listcard.scrolls,
.dupes {
  overflow-x: auto;
}

.panel h2,
.formside h2 {
  margin: var(--space-6) 0 var(--space-3);
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-charcoal);
}

.panel > h2:first-child {
  margin-top: 0;
}

.panel > :last-child {
  margin-bottom: 0;
}

.chead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 16px 20px;
  border-bottom: 1px solid var(--base-line);
}

.chead h2 {
  font-size: 16px;
  font-weight: 700;
}

.chead span {
  font-size: 13px;
  color: var(--brand-supporting);
}

@media (max-width: 760px) {
  .panel {
    padding: 20px 16px;
  }
}

/* ── Banners ──────────────────────────────────────────────────────────────────── */

.alert,
.note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
}

.alert::before,
.note::before {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  color: var(--base-white);
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.alert {
  background: var(--brand-danger-soft);
  border: 1px solid color-mix(in srgb, var(--brand-danger) 22%, var(--base-white));
  color: color-mix(in srgb, var(--brand-danger) 80%, var(--brand-charcoal));
}

.alert::before {
  content: '!';
  background: var(--brand-danger);
}

.note {
  display: block;
  background: var(--base-white);
  border: 1px solid var(--base-line2);
  color: var(--brand-supporting);
}

.note.ok {
  display: flex;
  background: color-mix(in srgb, var(--brand-tint-success) 55%, var(--base-white));
  border-color: color-mix(in srgb, var(--brand-success) 22%, var(--base-white));
  color: color-mix(in srgb, var(--brand-success) 80%, var(--brand-charcoal));
}

.note.ok::before {
  content: '✓';
  background: var(--brand-success);
}

.note.info {
  display: flex;
}

.note.info::before {
  content: 'i';
  background: var(--brand-supporting);
}

.alert > span,
.note > span {
  flex: 1;
}

.dismiss {
  flex: none;
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
  color: inherit;
  opacity: 0.8;
}

.dismiss:hover {
  color: inherit;
}

/* Inside a form, a banner sits flush with the fields. */
.formside .alert,
.formside .note {
  margin: 0;
}

/* ── Forms ────────────────────────────────────────────────────────────────────── */

.stack {
  display: grid;
  gap: var(--space-4);
}

/* Two short fields side by side (first and last name), one above the other on a phone. */
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

@media (max-width: 480px) {
  .pair {
    grid-template-columns: minmax(0, 1fr);
  }
}

.label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-supporting);
}

/* "Optional" beside a field's name: quieter, and not in the label's capitals. */
.label .optional {
  margin-left: 6px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  font: inherit;
  font-weight: 400;
  /* 16px: iOS zooms the page in on any focused field smaller than that, which pushed the
     card off the screen in BDQ's app sign-in (M5). */
  font-size: 16px;
  letter-spacing: normal;
  text-transform: none;
  background: var(--base-white);
  border: 1px solid var(--base-line2);
  border-radius: var(--radius-sm);
  color: var(--brand-charcoal);
}

.input::placeholder {
  color: var(--base-fg3);
}

.input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: var(--focus-ring);
}

.input[aria-invalid='true'] {
  border-color: var(--brand-danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-danger) 12%, transparent);
}

/* A password field with its show/hide eye inside the right-hand end (PasswordInput). */
.password-field {
  position: relative;
  display: block;
}

.password-field .input {
  padding-right: 48px;
}

/* Edge draws its own reveal eye in password fields; ours replaces it, not joins it. */
.password-field .input::-ms-reveal {
  display: none;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  transform: translateY(-50%);
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--base-fg3);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--brand-charcoal);
}

.password-toggle:focus-visible {
  outline: none;
  color: var(--brand-primary);
  box-shadow: var(--focus-ring);
}

.input.code {
  font-size: 24px;
  letter-spacing: 0.3em;
  text-align: center;
}

.select {
  appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--brand-supporting) 50%),
    linear-gradient(135deg, var(--brand-supporting) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.input.sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.input.select.sm {
  padding-right: 32px;
}

/* An error under its field. */
.field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--brand-danger);
}

.field-error::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.check {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  font-size: 14px;
  color: var(--brand-supporting);
}

.check input {
  margin-top: 3px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-primary);
  background: var(--brand-primary);
  color: var(--base-white);
  cursor: pointer;
}

.button:hover {
  background: var(--brand-primary-deep);
  border-color: var(--brand-primary-deep);
  color: var(--base-white);
  text-decoration: none;
}

.button.quiet {
  background: var(--base-white);
  color: var(--brand-charcoal);
  border-color: var(--base-line2);
}

.button.quiet:hover {
  background: var(--brand-tint);
  color: var(--brand-charcoal);
}

.button.danger {
  background: var(--brand-danger);
  border-color: var(--brand-danger);
}

.button.danger:hover {
  filter: brightness(0.92);
}

.button.sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
}

.button.block {
  width: 100%;
}

.button:disabled,
.button:disabled:hover {
  opacity: 0.6;
  cursor: progress;
  filter: none;
}

.row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.row > form,
.row > a,
.row > button {
  flex: 1 1 140px;
  display: grid;
}

/* A form button that reads as a link (row actions). */
.link {
  padding: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: inherit;
  border: 0;
  background: none;
  color: var(--brand-primary);
  cursor: pointer;
}

.link:hover {
  color: var(--brand-secondary);
  text-decoration: underline;
}

.link.danger {
  color: var(--brand-danger);
}

/* ── Choosing a company (sign-in), and the one you're in (home) ───────────────── */

.company {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: var(--space-3) var(--space-4);
  font: inherit;
  text-align: left;
  border: 1px solid var(--base-line2);
  border-radius: var(--radius-md);
  background: var(--base-white);
  cursor: pointer;
}

.company:hover {
  border-color: var(--brand-primary);
  background: var(--brand-tint);
}

.company.current,
.company.current:hover {
  cursor: default;
  border-color: var(--base-line2);
  background: var(--base-white);
}

.company strong {
  color: var(--brand-charcoal);
}

.company span {
  color: var(--brand-supporting);
  font-size: 14px;
}

/* ── Tags ─────────────────────────────────────────────────────────────────────── */

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--radius-xs);
  background: var(--brand-tint);
  color: var(--brand-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: 1px;
}

/* Waiting on something, or worth a look: invited, unpaid, possible duplicate. */
.tag.pending {
  background: var(--base-tint-gold);
  color: var(--brand-gold-text);
  border: 1px solid var(--brand-gold-soft);
}

/* Switched off. */
.tag.off {
  background: var(--base-sand);
  color: var(--brand-supporting);
  border: 1px solid var(--base-line2);
}

.tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 8px;
  vertical-align: 1px;
}

/* ── Simple lists (staff company, billing invoices) ──────────────────────────── */

.people {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  border-top: 1px solid var(--base-line);
}

.person {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-2) var(--space-4);
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--row-line);
}

.person .who {
  display: grid;
  min-width: 0;
}

.person .who strong,
.person .who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person .who span,
.person .what {
  color: var(--brand-supporting);
  font-size: 14px;
}

.person .what {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.person .actions {
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
  justify-content: flex-end;
}

@media (max-width: 520px) {
  .person {
    grid-template-columns: 1fr auto;
  }
  .person .actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.confirm {
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--brand-danger) 22%, var(--base-white));
  border-radius: var(--radius-md);
  background: var(--brand-danger-soft);
}

.confirm p {
  margin: 0 0 var(--space-3);
}

/* A confirmation that isn't a loss: /billing's level upgrade (P5, PR 2). */
.confirm.calm {
  border-color: color-mix(in srgb, var(--brand-primary) 30%, var(--base-white));
  background: var(--brand-tint);
}

/* Label-value pairs: a company's or a subscription's facts. */
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-2) var(--space-6);
  margin: 0 0 var(--space-4);
  font-size: 14px;
}

.facts dt {
  color: var(--brand-supporting);
}

.facts dd {
  margin: 0;
  color: var(--brand-charcoal);
  overflow-wrap: anywhere;
}

/* An email's plain text, shown to staff before it goes out (/staff/existing-customers, P7). */
.email-text {
  max-width: 72ch;
  margin: var(--space-2) 0 var(--space-4);
  padding: var(--space-4);
  border-radius: 8px;
  background: var(--brand-tint);
  font:
    13px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* /billing's level picker (subscription plan P5): one card per BlueDog Data level. */
.plans {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.plans legend {
  margin-bottom: var(--space-2);
}

.plan-choice {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--base-line);
  border-radius: var(--radius-md);
  background: var(--base-white);
  cursor: pointer;
}

.plan-choice:has(input:checked) {
  border-color: var(--brand-primary);
  background: var(--brand-tint);
}

.plan-choice:has(input:focus-visible) {
  box-shadow: var(--focus-ring);
}

.plan-choice input {
  margin-top: 3px;
  accent-color: var(--brand-primary);
}

/* The level a subscription is on, in the change picker: shown, not choosable. */
.plan-choice.current {
  cursor: default;
  background: color-mix(in srgb, var(--base-line) 25%, var(--base-white));
}

.plan-choice.current .tag {
  margin-left: var(--space-2);
}

.plan-body {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
  font-size: 14px;
  color: var(--brand-supporting);
}

.plan-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 var(--space-3);
}

.plan-head strong,
.plan-price {
  color: var(--brand-charcoal);
}

.plan-price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.extend {
  display: grid;
  grid-template-columns: 160px max-content;
  margin: 0 0 var(--space-3);
  gap: var(--space-3);
  align-items: end;
  justify-content: start;
}

/* The staff page's data-level grant: level and end date side by side, the reason under them. */
.grant-level {
  display: grid;
  grid-template-columns: minmax(0, 260px) 180px;
  margin: 0 0 var(--space-3);
  gap: var(--space-3);
  align-items: end;
  justify-content: start;
}

.grant-level .reason {
  grid-column: 1 / -1;
  max-width: 456px;
}

.grant-level .button {
  justify-self: start;
}

@media (max-width: 520px) {
  .grant-level {
    grid-template-columns: minmax(0, 1fr);
  }
  .facts {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .facts dd {
    margin-bottom: var(--space-2);
  }
}

/* ── Team (app/members) ───────────────────────────────────────────────────────── */

.grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--space-6);
  align-items: start;
}

.side {
  display: grid;
  gap: var(--space-4);
}

.seats {
  list-style: none;
  margin: 0;
  padding: 0;
}

.seat {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 150px 112px;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
}

.seat-wrap {
  border-bottom: 1px solid var(--row-line);
}

.seat-wrap:last-child {
  border-bottom: 0;
}

/* Someone who can't change anyone: name and role only. */
.seats.read-only .seat {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.seat.confirming {
  background: color-mix(in srgb, var(--brand-danger-soft) 50%, var(--base-white));
}

.seat-name {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.seat-sub {
  margin-top: 2px;
  font-size: 14px;
  color: var(--brand-supporting);
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat-role {
  padding-left: 12px;
  font-size: 14px;
}

.seat-action {
  text-align: right;
}

.seat-action .link {
  color: var(--brand-danger);
}

/* A pending invite's two actions, Resend over Revoke. */
.seat-action.stacked {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.seat-action .link.resend {
  color: var(--brand-primary);
}

.seat-action .link.resend:hover {
  color: var(--brand-secondary);
}

.seat-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 16px 20px 16px 68px;
  background: var(--brand-danger-soft);
  border-top: 1px solid color-mix(in srgb, var(--brand-danger) 22%, var(--base-white));
}

.seat-confirm p {
  font-size: 15px;
  line-height: 1.45;
  color: color-mix(in srgb, var(--brand-danger) 55%, var(--brand-charcoal));
}

.seat-confirm strong {
  color: var(--brand-danger);
}

.seat-confirm .row {
  flex: none;
  flex-wrap: nowrap;
}

.seat-confirm .row > * {
  flex: none;
}

.invite {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 20px;
}

.invite h2 {
  font-size: 16px;
  font-weight: 700;
}

.seatcount {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
  font-size: 14px;
  color: var(--brand-supporting);
}

.seatcount-head {
  display: flex;
  justify-content: space-between;
}

.seatcount-head strong {
  color: var(--brand-charcoal);
}

.seatcount small {
  font-size: 13px;
}

.bar {
  height: 6px;
  border-radius: 3px;
  background: var(--base-line);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: var(--brand-primary);
}

@media (max-width: 900px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

/* On a phone a person's role and action drop under their name. */
@media (max-width: 600px) {
  .seat,
  .seats.read-only .seat {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 14px 16px;
  }
  .seat-role {
    grid-column: 2;
    padding-left: 0;
  }
  .seat > div:empty {
    display: none;
  }
  .seat-controls {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    align-items: center;
  }
  .seat-controls > form:first-child {
    flex: 1;
  }
  /* An invite's Resend/Revoke sit at the right edge, where Remove does. */
  .seat-action.stacked {
    margin-left: auto;
  }
  .seat-confirm {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
  }
  .seat-confirm .row > * {
    flex: 1;
  }
}

@media (min-width: 601px) {
  .seat-controls {
    display: contents;
  }
}

/* ── Staff (app/staff) ────────────────────────────────────────────────────────── */

.search {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: end;
  margin: 0 0 var(--space-6);
}

.search .label {
  width: 520px;
  max-width: 100%;
}

/* The Show filter beside the search (#898): only as wide as its options need. */
.search .label.show {
  width: 220px;
}

.search-input {
  padding-left: 38px;
  background-image: radial-gradient(
    circle at 18px 50%,
    transparent 5px,
    var(--brand-supporting) 5.5px,
    var(--brand-supporting) 7px,
    transparent 7.5px
  );
}

.sh {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin: 0 0 10px;
}

.sh h2 {
  font-size: 18px;
  font-weight: 700;
}

.sh span {
  font-size: 14px;
  color: var(--brand-supporting);
}

/* Newer · Page n of m · Older under the staff company list. */
.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
  font-size: 14px;
  color: var(--brand-supporting);
}

.pager a:last-child {
  justify-self: end;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tbl th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-supporting);
  border-bottom: 1px solid var(--base-line);
  background: color-mix(in srgb, var(--base-paper) 60%, var(--base-white));
}

.tbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--row-line);
  vertical-align: middle;
  white-space: nowrap;
}

.tbl tr:last-child td {
  border-bottom: 0;
}

.tbl td.company-cell a {
  font-weight: 700;
}

.tbl .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tbl .quiet {
  color: var(--brand-supporting);
}

.tbl .none {
  color: var(--brand-gold-text);
}

.tbl tr.off td {
  color: var(--brand-supporting);
}

.tbl tr.off td.company-cell a {
  color: var(--brand-supporting);
}

.dupes {
  margin-bottom: 28px;
  padding: 18px 20px 6px;
  background: color-mix(in srgb, var(--base-tint-gold) 50%, var(--base-white));
  border: 1px solid var(--brand-gold-soft);
  border-radius: var(--radius-lg);
}

.dupes .lead {
  max-width: 760px;
  margin: -2px 0 12px;
  font-size: 14px;
}

.dupes .tbl th {
  background: transparent;
  border-color: var(--brand-gold-soft);
}

.dupes .tbl td {
  border-color: color-mix(in srgb, var(--brand-gold-soft) 50%, var(--base-white));
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 56px 20px;
  text-align: center;
}

.empty h3 {
  font-size: 17px;
  font-weight: 700;
}

.empty p {
  font-size: 14px;
  color: var(--brand-supporting);
}

/* On a phone each company is a short card instead of a table row. */
.prows {
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prow {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--row-line);
  font-size: 14px;
}

.prow:last-child {
  border-bottom: 0;
}

.prow-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.prow-head a {
  font-size: 15px;
  font-weight: 700;
}

.prow-head span,
.prow .quiet {
  color: var(--brand-supporting);
}

.prow-head span {
  flex: none;
  font-size: 13px;
}

.prow .tags {
  margin: 2px 0 0;
}

@media (max-width: 900px) {
  .tbl.companies {
    display: none;
  }
  .prows {
    display: block;
  }
  .dupes {
    padding: 14px 0 0;
    overflow: hidden;
  }
  .dupes .sh,
  .dupes .lead {
    padding: 0 16px;
  }
  .dupes .prows {
    background: var(--base-white);
    border-top: 1px solid var(--brand-gold-soft);
  }
  .sh h2 {
    font-size: 16px;
  }
}

/* /staff/import (M7): one Zoho customer per section, its actions in a wrapping row. */
.candidate {
  padding: 0 0 var(--space-2);
  border-bottom: 1px solid var(--base-line);
}

.candidate h2 .tag {
  margin-left: var(--space-2);
}

/* The Create form: who owns the company, then the button. */
.import-create {
  margin: 0 0 var(--space-4);
}

.owners {
  display: grid;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  padding: 0;
  border: 0;
}

.owners legend {
  margin-bottom: var(--space-2);
}

.owner {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  font-size: 14px;
  color: var(--brand-supporting);
  overflow-wrap: anywhere;
}

.owner strong {
  color: var(--brand-charcoal);
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin: 0 0 var(--space-4);
}

/* ── API keys (app/api-keys, app/staff/api-clients; ProjX360 plan P3) ─────────── */

.keys {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* A key: name, ids and dates on the left, Revoke on the right. Rows reuse the Team page's. */
.key {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
}

.key.confirming {
  background: color-mix(in srgb, var(--brand-danger-soft) 50%, var(--base-white));
}

/* Revoked or expired: kept for the record, greyed. */
.key.off .seat-name,
.key.off .seat-sub {
  color: var(--brand-supporting);
}

/* One string, like the key itself; long enough to wrap anywhere on a phone. */
.key-ids {
  overflow-wrap: anywhere;
}

.keys .seat-confirm {
  padding-left: 20px;
}

/* The secret, once: a read-only box with Copy beside it. */
.copyable {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.copyable .input {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.secret-once {
  border-color: var(--brand-gold-soft);
  background: var(--base-tint-gold);
}

.secret-once p {
  font-size: 14px;
  line-height: 1.45;
}

/* The API key's two halves, folded away for software that asks for two values (#1337). */
.secret-parts {
  margin: 14px 0 18px;
}

.secret-parts summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-supporting);
}

.secret-parts[open] summary {
  margin-bottom: 10px;
}

.secret-parts .label + .label {
  margin-top: 10px;
}

@media (max-width: 600px) {
  .key {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 14px 16px;
  }
  .key .seat-action {
    text-align: left;
  }
  .key .seat-action:empty {
    display: none;
  }
}

/* A guard-rail flag on a key (Staff → API clients, ProjX360 plan P4): worth a look. */
.key-flag {
  color: var(--brand-gold-text);
}

.flaglist {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 14px;
}

.flaglist li + li {
  margin-top: 4px;
}

/* ── The signed-in home (#1282) ───────────────────────────────────────────────────
 * Built from the design system (packages/design-system): a company card, the apps as equal
 * cards (no filled buttons, so neither app outranks the other), a quiet list of places to
 * manage, and sign out as text. Sizes follow its type scale: 15px card titles, 14px
 * controls, 13px dense text, 12px labels. */

.home-company {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 18px;
  background: var(--base-white);
  border: 1px solid var(--brand-tint);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}

.home-company-tile {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--brand-tint);
  color: var(--brand-primary);
  font-size: 14px;
  font-weight: 700;
}

.home-company-text {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.home-company-text strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-company-text span {
  font-size: 12px;
  color: var(--brand-supporting);
}

.home-section {
  margin-top: var(--space-8);
}

.home-label {
  margin: 0 0 var(--space-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-supporting);
}

.home-apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}

.home-app {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 20px;
  background: var(--base-white);
  border: 1px solid var(--brand-tint);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  color: var(--brand-charcoal);
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.home-app:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-2);
  color: var(--brand-charcoal);
  text-decoration: none;
}

.home-app:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* The app's colours, as in the "BlueDog apps" switcher inside both apps (#1269). */
.home-app-icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--base-white);
}

.home-app-icon.qualifier {
  background: var(--brand-primary);
}

.home-app-icon.hub {
  background: var(--brand-secondary);
}

.home-app-body {
  display: grid;
  gap: 2px;
}

.home-app-name {
  font-size: 15px;
  font-weight: 700;
}

.home-app-desc {
  font-size: 13px;
  color: var(--brand-supporting);
}

.home-app-open {
  margin-top: auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-primary);
}

/* One app (a member, or a company with the Data Hub alone): one row, not a half-width tile. */
.home-apps.one {
  grid-template-columns: 1fr;
}

.home-apps.one .home-app {
  flex-direction: row;
  align-items: center;
  gap: var(--space-4);
}

.home-apps.one .home-app-body {
  flex: 1 1 auto;
}

.home-apps.one .home-app-open {
  margin-top: 0;
  white-space: nowrap;
}

.home-manage {
  overflow: hidden;
  background: var(--base-white);
  border: 1px solid var(--brand-tint);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}

.home-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 14px 18px;
  color: var(--brand-charcoal);
}

.home-row + .home-row {
  border-top: 1px solid var(--base-line);
}

.home-row:hover {
  background: var(--base-paper);
  color: var(--brand-charcoal);
  text-decoration: none;
}

.home-row:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: -2px;
}

.home-row-text {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.home-row-title {
  font-size: 14px;
  font-weight: 700;
}

.home-row-hint {
  font-size: 12px;
  color: var(--brand-supporting);
}

.home-row-chev {
  flex: none;
  font-size: 18px;
  color: var(--base-fg-mute);
}

.home-foot {
  margin-top: var(--space-6);
}

.home-signout {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-supporting);
  cursor: pointer;
}

.home-signout:hover {
  color: var(--brand-charcoal);
  text-decoration: underline;
}

@media (max-width: 760px) {
  .home-apps.one .home-app {
    flex-wrap: wrap;
  }
}

/* Maintenance strip (#1316): a deploy or planned work, across the top of every page. The same
   gold strip as Qualifier's lockout and maintenance strips. */
.maint {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: 9px 32px;
  background: var(--base-tint-gold);
  border-bottom: 1px solid var(--brand-gold-soft);
  color: var(--brand-gold-text);
  font-size: 14px;
  line-height: 1.5;
}
.maint strong {
  font-weight: 700;
}
/* Wraps beside the headline rather than dropping under it on a narrow screen. */
.maint span {
  flex: 1 1 260px;
}
.maint .button {
  margin-left: auto;
}
@media (max-width: 640px) {
  .maint {
    padding: 9px 16px;
  }
}
