/* =========================================================================
   HatchAnalytics Portal | Shared styles
   Tokens + components. No inline styles. No per-screen CSS.
   Breakpoints: 375 / 768 / 1024 / 1440. Mobile-first base, overrides below.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Fonts
   ------------------------------------------------------------------------- */
@font-face {
  font-family: "HV Fitzgerald";
  src: url("../fonts/HV-Fitzgerald-Regular.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "HV Fitzgerald";
  src: url("../fonts/HV-Fitzgerald-Bold.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}

/* -------------------------------------------------------------------------
   Tokens
   ------------------------------------------------------------------------- */
:root {
  /* Brand color */
  --forest:    #233c36;
  --juniper:   #2b4a44;
  --jade:      #315c52;
  --volt:      #cdf765;
  --linen:     #e9e2d1;
  --soft:      #f7f3eb;
  --mint:      #c7dccd;
  --stone:     #b2a37f;
  --charcoal:  #141414;
  --sunset:    #ff835b;
  --danger-text: #8c2a10;
  --white:     #ffffff;

  /* Derived */
  --bg:           var(--soft);
  --surface:      #ffffff;
  --surface-warm: #fbf8f1;
  --border:       rgba(35, 60, 54, 0.14);
  --border-2:     rgba(35, 60, 54, 0.28);
  --border-dark:  rgba(247, 243, 235, 0.16);
  --muted:        rgba(20, 20, 20, 0.62);
  --muted-2:      rgba(20, 20, 20, 0.48);
  --muted-dark:   rgba(247, 243, 235, 0.7);

  /* Typography */
  --display: "HV Fitzgerald", Georgia, "Times New Roman", serif;
  --body:    neue-haas-unica, "Inter", ui-sans-serif, system-ui, -apple-system,
             BlinkMacSystemFont, "Segoe UI", sans-serif;

  --text-xs:  12px;
  --text-sm:  13px;
  --text-md:  15px;
  --text-lg:  17px;
  --text-xl:  20px;
  --h-sm:     22px;
  --h-md:     28px;
  --h-lg:     38px;
  --h-xl:     54px;

  /* Spacing scale, 4px base */
  --s-1:   4px;
  --s-2:   8px;
  --s-3:   12px;
  --s-4:   16px;
  --s-5:   20px;
  --s-6:   24px;
  --s-7:   32px;
  --s-8:   40px;
  --s-9:   48px;
  --s-10:  64px;
  --s-11:  80px;
  --s-12: 112px;

  /* Layout */
  --max:        1320px;
  --nav:        72px;
  --gutter-sm:  16px;
  --gutter-md:  24px;
  --gutter-lg:  32px;

  /* Radius */
  --r1:   4px;
  --r2:   8px;
  --r3:   12px;
  --pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(35, 60, 54, 0.06),
               0 1px 1px rgba(35, 60, 54, 0.04);
  --shadow-md: 0 12px 28px rgba(35, 60, 54, 0.08),
               0 2px 6px rgba(35, 60, 54, 0.05);
  --shadow-lg: 0 24px 60px rgba(35, 60, 54, 0.14),
               0 4px 12px rgba(35, 60, 54, 0.06);
  --softshadow: var(--shadow-md);
  --shadow:     var(--shadow-lg);

  /* Motion */
  --t-fast: 120ms cubic-bezier(.2,.7,.3,1);
  --t-norm: 220ms cubic-bezier(.2,.7,.3,1);
}

/* -------------------------------------------------------------------------
   Reset + base
   ------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--charcoal);
  font-family: var(--body);
  font-size: var(--text-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--volt); color: var(--forest); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus { outline: none; }
:focus-visible {
  outline: 3px solid rgba(205, 247, 101, 0.95);
  outline-offset: 2px;
  border-radius: 4px;
}

/* -------------------------------------------------------------------------
   Typography utilities
   ------------------------------------------------------------------------- */
h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--forest); letter-spacing: -0.01em; }
h1 { font-size: var(--h-lg); line-height: 1.1; }
h2 { font-size: var(--h-md); line-height: 1.2; }
h3 { font-size: var(--h-sm); line-height: 1.25; }
p  { margin: 0; }

.app-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(36px, 4.4vw, var(--h-xl));
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--forest);
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jade);
}

.lede {
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--muted);
  max-width: 60ch;
}

.helper {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--muted);
}

.helper.tight { line-height: 1.4; }
.helper.center { text-align: center; }
.helper.narrow { max-width: 42ch; }

.text-strong,
.link-strong {
  color: var(--forest);
  font-weight: 700;
}
.link-strong {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-on-dark {
  color: var(--volt);
  font-weight: 700;
}

.label-note {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--muted-2);
}

.mt-3 { margin-top: var(--s-3); }
.align-start { justify-self: start; }
.actions-centered { justify-content: center; }

.app-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s-2) 0 0;
}

.breadcrumb {
  font-size: var(--text-sm);
  color: var(--muted);
}
.breadcrumb a {
  color: var(--forest);
  font-weight: 600;
}

/* -------------------------------------------------------------------------
   App shell
   ------------------------------------------------------------------------- */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: var(--nav) 1fr;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(205,247,101,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(199,220,205,0.18), transparent 55%),
    var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--s-6);
  padding: 0 clamp(16px, 4vw, 48px);
  background: rgba(35, 60, 54, 0.98);
  backdrop-filter: saturate(140%) blur(6px);
  color: var(--soft);
  border-bottom: 1px solid var(--border-dark);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 180px;
}
.brand img {
  width: 132px;
  height: auto;
  filter: brightness(0) invert(1);
}

.product-pill {
  border: 1px solid rgba(205, 247, 101, 0.4);
  color: var(--volt);
  border-radius: var(--pill);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  flex-wrap: wrap;
}
.nav a {
  color: var(--muted-dark);
  padding: 8px 12px;
  border-radius: var(--pill);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color var(--t-fast), background var(--t-fast);
}
@media (hover: hover) {
  .nav a:hover { color: var(--soft); background: rgba(247, 243, 235, 0.08); }
}
.nav a[aria-current="page"] {
  color: var(--forest);
  background: var(--volt);
}

.account-menu {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--soft);
  font-size: var(--text-sm);
  font-weight: 600;
}
.account-menu .avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--volt);
  color: var(--forest);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* -------------------------------------------------------------------------
   Main + page header
   ------------------------------------------------------------------------- */
.main {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 48px) var(--s-11);
  display: grid;
  gap: var(--s-7);
}

.page-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  align-items: end;
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--border);
}
.page-header > div:not(.button-row):not(.page-header__side) { display: grid; gap: var(--s-2); }
.page-header .lede { margin-top: 4px; }

/* Smaller title pairing for screens with simplified headers. */
.app-title--sm {
  font-family: var(--display);
  font-size: var(--h-lg);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--forest);
  line-height: 1.15;
}

/* Right column of page-header: optional meta line + button-row stacked */
.page-header__side {
  display: grid;
  justify-items: end;
  gap: 10px;
}
.page-header__side .button-row { justify-content: flex-end; }

/* Inline variant: meta and button-row on one row, meta to the left of the
   button. Used when the right side has a single action so the header
   stays single-row. */
.page-header__side--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-3) var(--s-4);
}

/* Small inline meta strip shown above page-header actions */
.page-meta {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.page-meta > span { white-space: nowrap; }
.page-meta > span[aria-hidden="true"] { color: var(--border-2); }


.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 var(--s-5);
  border: 1px solid transparent;
  border-radius: var(--pill);
  background: transparent;
  color: var(--forest);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast),
              border-color var(--t-fast), transform var(--t-fast),
              box-shadow var(--t-fast);
}
.btn.primary {
  background: var(--forest);
  color: var(--soft);
  border-color: var(--forest);
}
.btn.secondary {
  background: var(--surface);
  border-color: var(--border-2);
  color: var(--forest);
}
.btn.accent {
  background: var(--volt);
  color: var(--forest);
  border-color: var(--volt);
}
.btn.destructive {
  background: transparent;
  color: var(--danger-text);
  border-color: rgba(255, 131, 91, 0.4);
}
.btn.ghost {
  background: transparent;
  color: var(--forest);
  border-color: var(--border-2);
}
.btn.full { width: 100%; }
.btn.sm   { min-height: 34px; padding: 0 14px; font-size: var(--text-xs); white-space: nowrap; }

@media (hover: hover) {
  .btn:hover           { transform: translateY(-1px); }
  .btn.primary:hover   { background: var(--juniper); border-color: var(--juniper); color: var(--volt); }
  .btn.secondary:hover { border-color: var(--forest); }
  .btn.accent:hover    { box-shadow: 0 8px 22px rgba(205, 247, 101, 0.45); }
  .btn.destructive:hover { background: rgba(255, 131, 91, 0.08); border-color: var(--danger-text); }
  .btn.ghost:hover     { background: rgba(35, 60, 54, 0.06); border-color: var(--forest); }
}
.btn[aria-disabled="true"] {
  opacity: 0.72;
  cursor: not-allowed;
}
.btn[aria-disabled="true"]:hover {
  transform: none;
  box-shadow: none;
}

/* -------------------------------------------------------------------------
   Cards + grids
   ------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: var(--s-6);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: var(--s-4);
}
.card > h2,
.card > h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  color: var(--forest);
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.card > h2 { font-size: 24px; }
.card > h3 { font-size: 19px; }

.card.flush { padding: 0; }
.card.warm  { background: var(--surface-warm); }

.grid {
  display: grid;
  gap: var(--s-4);
}
.grid.two   { grid-template-columns: 1fr; }
.grid.three { grid-template-columns: 1fr; }
.grid.four  { grid-template-columns: 1fr; }

.card.metric {
  padding: var(--s-5) var(--s-6);
  gap: 4px;
}
.card.metric strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1;
  color: var(--forest);
  letter-spacing: -0.01em;
}
.card.metric > span {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Two-up split layout */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  align-items: start;
}

/* Account page subscription block (single in-portal billing surface; all
   changes route out to Stripe Customer Portal per the SOW). */
.account-subscription {
  display: grid;
  gap: var(--s-5);
  padding-top: var(--s-7);
  margin-top: var(--s-3);
  border-top: 1px solid var(--border);
}
.account-subscription__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.account-subscription__head > div { display: grid; gap: 6px; }
.account-subscription__head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  color: var(--forest);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

/* Account page sign-out row */
.account-signout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
}
.account-signout__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--h-md);
  color: var(--forest);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
@media (hover: hover) {
  .account-signout .btn.ghost:hover,
  .account-subscription .btn.ghost:hover {
    background: var(--forest);
    border-color: var(--forest);
    color: var(--volt);
  }
}

/* Card-internal action row: left-aligned action below a form. */
.card-actions {
  justify-content: flex-start;
  margin-top: var(--s-3);
}

/* Welcome banner shown on account.html after fresh signup (?welcome=1). */
.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r2);
  background: var(--mint);
  border: 1px solid rgba(49, 92, 82, 0.18);
}
.welcome-banner > div:first-child { display: grid; gap: 2px; min-width: 0; }
.welcome-banner strong { color: var(--forest); font-size: var(--text-md); }
.welcome-banner span { color: var(--muted); font-size: var(--text-sm); }
.welcome-banner[hidden] { display: none; }

/* Subscription handoff button is kept aria-disabled (intentional stub) but
   reads as a full-strength CTA so the design conveys the production state. */
.account-subscription .btn[aria-disabled="true"] {
  opacity: 1;
}

/* Utility spacing for sections inside .main */
.section + .section,
.card-row + .card-row,
.section-gap { margin-top: var(--s-3); }

/* -------------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------------- */
.form-stack {
  display: grid;
  gap: var(--s-4);
}
.field {
  display: grid;
  gap: 6px;
}
.field label,
.form-stack > label:not(.checkbox-row) {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--jade);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--r1);
  background: var(--surface);
  color: var(--charcoal);
  font-size: var(--text-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

/* Replace the native select chevron with a custom one so the arrow has
   consistent breathing room from the right edge across browsers. */
.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23315c52' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
}
.field select::-ms-expand { display: none; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(35, 60, 54, 0.10);
  outline: none;
}
.field .hint  { font-size: var(--text-xs); color: var(--muted-2); }
.field .error { font-size: var(--text-xs); color: var(--danger-text); font-weight: 600; }
.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--danger-text);
  box-shadow: 0 0 0 4px rgba(140, 42, 16, 0.10);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.5;
}
.checkbox-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--forest);
}

/* -------------------------------------------------------------------------
   Tables + mobile collapse
   ------------------------------------------------------------------------- */
.table-card {
  padding: 0;
  overflow: hidden;
}

.desktop-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.desktop-table caption { position: absolute; left: -9999px; }
.desktop-table thead th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: var(--s-4) var(--s-6);
  background: var(--surface-warm);
  border-bottom: 1px solid var(--border);
}
.desktop-table tbody td {
  padding: var(--s-4) var(--s-6);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--charcoal);
}
.desktop-table tbody tr:last-child td { border-bottom: none; }
.desktop-table tbody tr {
  transition: background var(--t-fast);
}
@media (hover: hover) {
  .desktop-table tbody tr:hover { background: rgba(199, 220, 205, 0.18); }
}

.mobile-cards { display: none; gap: var(--s-3); padding: var(--s-5); }
.member-card {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4);
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--r2);
}
.member-card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.member-card .helper { font-size: var(--text-sm); }
.member-card .btn { justify-self: start; }
.member-card--link {
  color: inherit;
  text-decoration: none;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.clickable-row {
  cursor: pointer;
}
.clickable-row:focus-visible {
  outline: 3px solid rgba(205, 247, 101, 0.95);
  outline-offset: -3px;
}
@media (hover: hover) {
  .member-card--link:hover {
    border-color: var(--forest);
    background: rgba(199, 220, 205, 0.24);
    transform: translateY(-1px);
  }
}

/* -------------------------------------------------------------------------
   Badges
   ------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--mint);
  color: var(--forest);
  border: 1px solid rgba(49, 92, 82, 0.18);
  white-space: nowrap;
}
.badge.admin {
  background: var(--volt);
  color: var(--forest);
  border-color: rgba(35, 60, 54, 0.18);
}
/* Primary admin: account owner / billing contact. Forest fill with volt text
   reads as the highest-priority role visually. */
.badge.admin-primary {
  background: var(--forest);
  color: var(--volt);
  border-color: var(--forest);
}
.badge.invited {
  background: var(--linen);
  color: var(--juniper);
  border-color: rgba(178, 163, 127, 0.4);
}
.badge.warn {
  background: rgba(255, 131, 91, 0.14);
  color: #a13a1d;
  border-color: rgba(255, 131, 91, 0.4);
}

/* Row actions: inline cluster used in mobile cards where buttons stack
   side by side. The desktop table uses dedicated cells per action instead. */
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Remove column: narrow right-aligned cell holding only the trash icon. */
.cell-remove { text-align: right; width: 48px; }

/* Icon-only action button matching the sidebar collapse/signout style. Used
   for destructive row actions where a labeled button would be noisy. */
.action-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r1);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 -1px 0 rgba(35, 60, 54, 0.08), 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.action-icon svg { width: 14px; height: 14px; }
@media (hover: hover) {
  .action-icon:hover { border-color: var(--border-2); color: var(--forest); }
  .action-icon--danger:hover {
    border-color: var(--danger-text);
    color: var(--danger-text);
    background: rgba(255, 131, 91, 0.06);
  }
}

/* Status indicator: lighter visual treatment than .badge so role pills carry
   the dominant identity signal and status reads as state. Color via modifier. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status--active { color: var(--jade); }
.status--invited { color: var(--stone); }
.status--onboarding { color: var(--juniper); }

/* -------------------------------------------------------------------------
   Embed frame + chart art
   ------------------------------------------------------------------------- */
.embed-frame {
  background: transparent;
  color: var(--charcoal);
}
.embed-body {
  background: transparent;
  color: var(--charcoal);
}

.embed-iframe-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--r2);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.embed-iframe-wrap iframe {
  display: block;
  width: 100%;
  height: 820px;
  border: 0;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}
.panel {
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: var(--s-5);
  background: var(--surface-warm);
  display: grid;
  gap: var(--s-3);
}

.chart-line {
  height: 110px;
  border-radius: var(--r1);
  background:
    linear-gradient(180deg, rgba(49, 92, 82, 0.18), rgba(49, 92, 82, 0.02) 80%),
    linear-gradient(90deg, transparent 0 calc(100% - 1px), rgba(35,60,54,0.06) 100%) 0 0/40px 100%,
    linear-gradient(0deg,  transparent 0 calc(100% - 1px), rgba(35,60,54,0.06) 100%) 0 0/100% 32px,
    var(--surface);
  position: relative;
  overflow: hidden;
}
.chart-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 100% at 0% 80%, rgba(35,60,54,0) 0 30%, rgba(35,60,54,0.18) 60%, transparent 90%),
    radial-gradient(50% 100% at 50% 30%, rgba(205,247,101,0.42) 0 30%, transparent 70%),
    radial-gradient(80% 100% at 100% 50%, rgba(35,60,54,0.2) 0 40%, transparent 80%);
  mix-blend-mode: multiply;
  opacity: 0.7;
}

.bar-list { display: grid; gap: 8px; }
.bar {
  height: 14px;
  background: rgba(35, 60, 54, 0.08);
  border-radius: var(--pill);
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--jade), var(--forest));
  border-radius: var(--pill);
}
.bar-fill--86 { width: 86%; }
.bar-fill--72 { width: 72%; }
.bar-fill--57 { width: 57%; }
.bar-fill--41 { width: 41%; }

/* Status grid, legacy preview cards for older state-card pattern */
.status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
.state-card {
  border: 1px dashed var(--border-2);
  border-radius: var(--r2);
  padding: var(--s-5);
  background: var(--surface);
  display: grid;
  gap: 6px;
}
.state-card strong { color: var(--forest); font-size: var(--text-md); }

/* -------------------------------------------------------------------------
   Embed-frame states (dashboard.html). Drives loading / error / empty via
   body.state-embed-* classes from the explorer.
   ------------------------------------------------------------------------- */
.embed-state { display: none; }
body:not(.state-embed-loading):not(.state-embed-error):not(.state-embed-empty) .embed-state--default,
body.state-embed-loading .embed-state--loading,
body.state-embed-error   .embed-state--error,
body.state-embed-empty   .embed-state--empty {
  display: grid;
}

.embed-state--loading {
  gap: var(--s-4);
}
.skeleton {
  border-radius: var(--r2);
  background:
    linear-gradient(100deg, rgba(35, 60, 54, 0.04), rgba(35, 60, 54, 0.08), rgba(35, 60, 54, 0.04));
  background-size: 200% 100%;
  animation: skeleton-shimmer 1400ms ease-in-out infinite;
}
.skeleton.tall  { height: 160px; }
.skeleton.short { height: 90px; }
.skeleton.table-row { height: 42px; }
@keyframes skeleton-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.embed-state--error,
.embed-state--empty {
  padding: var(--s-9) var(--s-7);
  text-align: center;
  place-items: center;
  gap: var(--s-3);
  background: var(--surface-warm);
  border: 1px dashed var(--border-2);
  border-radius: var(--r2);
}
.embed-empty-icon {
  width: 64px;
  height: 64px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r2);
  background: var(--surface);
  color: var(--jade);
  margin-bottom: var(--s-2);
  border: 1px solid var(--border);
}
.embed-empty-icon svg { width: 36px; height: 36px; }
.embed-state--error strong,
.embed-state--empty strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  color: var(--forest);
  letter-spacing: -0.01em;
}
.embed-state--error p,
.embed-state--empty p {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.55;
  max-width: 46ch;
  margin: 0 auto;
}
.embed-state--error .btn { margin-top: var(--s-2); }

/* Empty state for tables (team, admin-clients) */
.is-empty-state {
  display: none;
  padding: var(--s-9) var(--s-7);
  text-align: center;
  place-items: center;
  gap: var(--s-3);
  background: var(--surface-warm);
  border: 1px dashed var(--border-2);
  border-radius: var(--r2);
}
.is-empty-state strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  color: var(--forest);
}
.is-empty-state p { color: var(--muted); font-size: var(--text-sm); line-height: 1.55; max-width: 46ch; margin: 0 auto; }

body.state-empty .is-empty-state { display: grid; }
body.state-empty .hide-on-empty { display: none; }

/* Loading state for admin tables (shows skeleton rows) */
body.state-loading .is-loading-state { display: grid; }
.is-loading-state { display: none; gap: var(--s-3); }
.loading-panel { padding: var(--s-5); }
body.state-loading .hide-on-loading { display: none; }

/* Saved toast for account.html */
.saved-toast {
  display: none;
  position: fixed;
  bottom: var(--s-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  padding: 12px 18px;
  background: var(--forest);
  color: var(--volt);
  border-radius: var(--pill);
  font-size: var(--text-sm);
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(35, 60, 54, 0.28);
  align-items: center;
  gap: 10px;
  animation: toast-rise 240ms cubic-bezier(.22, 1, .36, 1);
}
.saved-toast svg { width: 16px; height: 16px; }
body.state-saved .saved-toast[data-toast-state="saved"],
body.state-saved .saved-toast:not([data-toast-state]),
body.state-member-removed .saved-toast[data-toast-state="member-removed"],
body.state-member-managed .saved-toast[data-toast-state="member-managed"],
body.state-invite-resent .saved-toast[data-toast-state="invite-resent"],
body.state-primary-transferred .saved-toast[data-toast-state="primary-transferred"],
body.state-signed-out .saved-toast[data-toast-state="signed-out"] { display: inline-flex; }
@keyframes toast-rise {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* -------------------------------------------------------------------------
   Page banners (billing past-due, billing trial, admin deactivated).
   Inline page-level alerts driven by body.state-* classes. Each banner
   element carries data-state="..." that matches its trigger state.
   ------------------------------------------------------------------------- */
.page-banner {
  display: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: var(--r2);
  border: 1px solid var(--border);
  background: var(--surface-warm);
  color: var(--text);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.page-banner__body { display: grid; gap: 4px; min-width: 240px; flex: 1 1 320px; }
.page-banner__body strong { color: var(--forest); font-weight: 700; }
.page-banner__actions { display: flex; gap: var(--s-2); flex: 0 0 auto; }
.page-banner--danger {
  background: rgba(255, 131, 91, 0.08);
  border-color: rgba(255, 131, 91, 0.3);
  color: var(--danger-text);
}
.page-banner--danger strong { color: var(--danger-text); }
.page-banner--info {
  background: var(--mint);
  border-color: rgba(49, 92, 82, 0.22);
  color: var(--forest);
}
.page-banner--info strong { color: var(--forest); }

body.state-past-due .page-banner[data-state="past-due"],
body.state-trial    .page-banner[data-state="trial"],
body.state-deactivated .page-banner[data-state="deactivated"] {
  display: flex;
}

/* Inline copy swaps for new states. Mirrors the .hide-on-empty pattern. */
.show-on-past-due,
.show-on-trial,
.show-on-deactivated { display: none; }
body.state-past-due    .show-on-past-due    { display: inline; }
body.state-trial       .show-on-trial       { display: inline; }
body.state-deactivated .show-on-deactivated { display: inline; }
body.state-past-due    .hide-on-past-due    { display: none; }
body.state-trial       .hide-on-trial       { display: none; }
body.state-deactivated .hide-on-deactivated { display: none; }

/* Element-specific overrides for elements whose natural display is not inline. */
body.state-deactivated .btn.show-on-deactivated         { display: inline-flex; }
body.state-deactivated .timeline-item.show-on-deactivated { display: grid; }

/* -------------------------------------------------------------------------
   Modals (mock, inline), legacy preview cards kept for any inline use
   ------------------------------------------------------------------------- */
.modal-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
.mock-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: var(--s-6);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: var(--s-3);
}

/* -------------------------------------------------------------------------
   Modal overlays (real). Visibility driven by body.state-*-open classes.
   ------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
}
body.state-invite-open     .modal[data-modal="invite-open"],
body.state-remove-open     .modal[data-modal="remove-open"],
body.state-deactivate-open .modal[data-modal="deactivate-open"],
body.state-signout-open    .modal[data-modal="signout-open"],
body.state-cancel-open     .modal[data-modal="cancel-open"] {
  display: flex;
}
.modal[aria-hidden="false"] {
  display: flex;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 60, 54, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  cursor: pointer;
  animation: modal-fade 180ms ease-out;
}
.modal__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: var(--s-7);
  box-shadow: 0 24px 60px rgba(35, 60, 54, 0.22), 0 4px 12px rgba(35, 60, 54, 0.08);
  display: grid;
  gap: var(--s-4);
  animation: modal-pop 220ms cubic-bezier(.22, 1, .36, 1);
}
.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--t-fast), color var(--t-fast);
}
.modal__close:hover { background: var(--surface-warm); color: var(--forest); }
.modal__head {
  display: grid;
  gap: 4px;
}
.modal__head h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  color: var(--forest);
  letter-spacing: -0.01em;
  margin: 0;
}
.modal__head .eyebrow { color: var(--jade); }

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-3);
  margin-top: 2px;
}
.modal__actions .btn { min-width: 110px; }

.modal-callout {
  padding: 14px;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--r1);
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.5;
}
.modal-callout strong { color: var(--forest); font-weight: 700; }
.modal-callout--danger {
  background: rgba(255, 131, 91, 0.08);
  border-color: rgba(255, 131, 91, 0.3);
  color: var(--danger-text);
}
.modal-callout--danger strong { color: var(--danger-text); }

.invite-modal-view {
  display: none;
  gap: var(--s-4);
}
.modal[data-active-invite-state="default"] [data-invite-state="default"],
.modal[data-active-invite-state="success"] [data-invite-state="success"],
.modal[data-active-invite-state="error"] [data-invite-state="error"] {
  display: grid;
}

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* -------------------------------------------------------------------------
   Login + signup pages (two-column)
   ------------------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background:
    radial-gradient(1000px 600px at 100% 0%, rgba(205,247,101,0.18), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(199,220,205,0.30), transparent 60%),
    var(--bg);
}

.login-art {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--s-7);
  padding: clamp(28px, 6vw, 64px);
  color: var(--forest);
}
.login-brand { display: inline-flex; }
.login-brand img {
  width: 150px;
  height: auto;
  margin-bottom: var(--s-6);
}
.login-art h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin-top: var(--s-4);
  max-width: 14ch;
}
.login-art .lede { margin-top: var(--s-4); max-width: 46ch; }

.dashboard-art {
  align-self: center;
}
.browser-frame {
  background: var(--forest);
  border-radius: var(--r3);
  padding: var(--s-4) var(--s-5) var(--s-5);
  box-shadow: var(--shadow-lg);
  color: var(--soft);
}
.browser-dots {
  display: flex;
  gap: 6px;
  margin-bottom: var(--s-3);
}
.browser-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(247, 243, 235, 0.28);
}
.browser-dots span:nth-child(1) { background: rgba(255, 131, 91, 0.7); }
.browser-dots span:nth-child(2) { background: rgba(205, 247, 101, 0.6); }
.browser-dots span:nth-child(3) { background: rgba(199, 220, 205, 0.6); }

.art-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}
.chart-card {
  background: var(--surface);
  color: var(--charcoal);
  border-radius: var(--r2);
  padding: var(--s-4);
  display: grid;
  gap: var(--s-3);
}
.chart-card h3 {
  font-family: var(--body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.faq-list {
  display: grid;
  gap: var(--s-3);
}
.faq-item {
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: var(--s-4) var(--s-5);
  display: grid;
  gap: 4px;
}
.faq-item strong { color: var(--forest); font-size: var(--text-md); }
.faq-item p { color: var(--muted); font-size: var(--text-sm); line-height: 1.55; }

.login-panel {
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 64px);
  background:
    linear-gradient(180deg, rgba(247,243,235,0.6), rgba(247,243,235,0.2));
}
.auth-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  box-shadow: var(--shadow-md);
  padding: clamp(24px, 4vw, 36px);
  display: grid;
  gap: var(--s-5);
}
.auth-card h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.sso-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
.sso-row .btn { width: 100%; }

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s-3);
  color: var(--muted-2);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--border);
}

.auth-footer {
  font-size: var(--text-sm);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  justify-content: space-between;
}
.auth-footer a { color: var(--forest); font-weight: 700; }
.auth-footer a:hover { text-decoration: underline; }

/* -------------------------------------------------------------------------
   Signup-specific (stepper, plans, summary)
   ------------------------------------------------------------------------- */
.stepper {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--pill);
  background: var(--surface-warm);
  border: 1px solid var(--border);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--forest);
}
.step span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--soft);
  font-size: 11px;
}
.step.active { background: var(--volt); border-color: var(--volt); }
.step.done span { background: var(--jade); }

.plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}
.plan-card {
  position: relative;
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast),
              transform var(--t-fast);
}
.plan-card.featured {
  border-color: var(--forest);
  box-shadow: var(--shadow-md);
}
.plan-card.featured::after {
  content: "Recommended";
  position: absolute;
  top: -10px;
  left: var(--s-5);
  background: var(--volt);
  color: var(--forest);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--pill);
}
.plan-card.disabled {
  background: var(--surface-warm);
  opacity: 0.92;
}
.plan-card .price {
  font-family: var(--display);
  font-weight: 400;
  font-size: 44px;
  line-height: 1;
  color: var(--forest);
  letter-spacing: -0.015em;
}

.summary-list { display: grid; gap: 10px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--muted);
}
.summary-row strong { color: var(--charcoal); font-weight: 700; }
.summary-row.total {
  padding-top: 6px;
  border-bottom: none;
  font-size: var(--text-md);
  color: var(--forest);
}
.summary-row.total strong { color: var(--forest); }

/* -------------------------------------------------------------------------
   Account / profile
   ------------------------------------------------------------------------- */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}

/* -------------------------------------------------------------------------
   Admin
   ------------------------------------------------------------------------- */
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  width: max-content;
  max-width: 100%;
  overflow: auto;
}
.admin-nav a {
  padding: 8px 14px;
  border-radius: var(--pill);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--forest);
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
@media (hover: hover) {
  .admin-nav a:hover { background: rgba(35, 60, 54, 0.06); }
}
.admin-nav a[aria-current="page"] {
  background: var(--forest);
  color: var(--soft);
}

.timeline {
  display: grid;
  gap: 14px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding-left: var(--s-4);
  border-left: 2px solid var(--border-2);
  position: relative;
}
.timeline-item::before {
  content: "";
  position: absolute;
  top: 4px;
  left: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--forest);
  border: 2px solid var(--bg);
}
.timeline-item strong { color: var(--forest); font-size: var(--text-md); }
.timeline-item .helper { color: var(--muted); }
.timeline-item__date {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

/* -------------------------------------------------------------------------
   App shell (authenticated screens): cream sidebar LEFT + content RIGHT.
   Three nav variants by role: Client Admin (Dashboard/Team/Billing/Account),
   Client User (Dashboard/Account), Hatchery Admin (Clients).
   ------------------------------------------------------------------------- */
.app-shell {
  min-height: 100vh;
  background: var(--bg);
  display: grid;
  grid-template-columns: 1fr;
}

.app-side {
  background: var(--surface-warm);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-side__head {
  position: relative;
  padding: var(--s-5) var(--s-5) var(--s-4);
  display: grid;
  gap: 12px;
  justify-items: start;
  border-bottom: 1px solid var(--border);
  transition: padding 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
.app-side__logo { display: inline-flex; align-items: center; }
.app-side__logo-full {
  width: 120px;
  height: auto;
  filter: brightness(0) saturate(100%) invert(18%) sepia(11%) saturate(1648%) hue-rotate(118deg) brightness(95%) contrast(92%);
}
.app-side__logo-mark {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--r2);
  background: var(--forest);
  padding: 8px;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.app-side__logo-mark img { width: 100%; height: 100%; display: block; }

/* Collapse toggle: small beveled square button. Only visible at desktop.
   Positioned to vertically center against the horizontal logo. */
.app-side__collapse {
  position: absolute;
  top: var(--s-5);
  right: var(--s-3);
  width: 28px;
  height: 28px;
  border-radius: var(--r1);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: none;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 -1px 0 rgba(35, 60, 54, 0.08), 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
@media (hover: hover) {
  .app-side__collapse:hover { background: var(--surface-warm); color: var(--forest); border-color: var(--border-2); }
}
.app-side__collapse svg {
  width: 14px;
  height: 14px;
  transition: transform var(--t-fast);
}
.app-side.is-collapsed .app-side__collapse svg { transform: rotate(180deg); }
.app-side__product-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--forest);
  border-radius: var(--pill);
  background: var(--forest);
  color: var(--volt);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  line-height: 1.2;
}

.app-side__workspace {
  margin: var(--s-4) var(--s-3) var(--s-3);
  padding: 10px 12px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--r1);
  background: var(--surface);
}
.app-side__workspace span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.app-side__workspace strong {
  color: var(--forest);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* Collapsed sidebar variant: spark mark only, nav icons only, profile avatar
   only. Visual width is 72px. State persisted in localStorage by portal.js. */
.app-side.is-collapsed .app-side__workspace { display: none; }
.app-side.is-collapsed .app-side__head {
  padding: var(--s-4) var(--s-3) var(--s-3);
  justify-items: center;
}
.app-side.is-collapsed .app-side__logo-full,
.app-side.is-collapsed .app-side__product-pill { display: none; }
.app-side.is-collapsed .app-side__logo-mark { display: inline-flex; }
.app-side.is-collapsed .app-side__collapse {
  position: static;
  margin-top: 4px;
  justify-self: center;
}
.app-side.is-collapsed .app-side__nav { padding: var(--s-3) 8px; }
.app-side.is-collapsed .app-side__nav a {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
}
.app-side.is-collapsed .nav-label { display: none; }
.app-side.is-collapsed .app-side__foot {
  flex-direction: column;
  align-items: center;
  padding: var(--s-3) var(--s-2);
  gap: 8px;
}
.app-side.is-collapsed .app-side__profile {
  width: auto;
  flex: 0 0 auto;
  padding: 0;
  justify-content: center;
}
.app-side.is-collapsed .app-side__foot .user-meta { display: none; }

.app-side__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--s-3) var(--s-3);
  transition: padding 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
.app-side__nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r1);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--charcoal);
  transition: background var(--t-fast), color var(--t-fast),
              padding 260ms cubic-bezier(0.22, 1, 0.36, 1),
              gap 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
@media (hover: hover) {
  .app-side__nav a:hover { background: rgba(35, 60, 54, 0.05); }
}
.app-side__nav a[aria-current="page"] {
  background: var(--forest);
  color: var(--soft);
}
.app-side__nav a[aria-current="page"] .nav-icon { color: var(--volt); }

.app-side__nav .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--jade);
  display: inline-flex;
}
.app-side__nav .nav-icon svg { width: 100%; height: 100%; stroke-width: 1.6; }

.app-side__foot {
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

/* Avatar + name link area inside the foot. On client screens this links to
   account.html; on admin screens it's a non-interactive div. */
.app-side__profile {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 6px 8px;
  border-radius: var(--r1);
  color: inherit;
  text-decoration: none;
  transition: background var(--t-fast);
}
@media (hover: hover) {
  a.app-side__profile:hover { background: rgba(35, 60, 54, 0.04); }
}

/* Sign-out icon button: beveled square matching the collapse-toggle style. */
.app-side__signout {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--r1);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 -1px 0 rgba(35, 60, 54, 0.08), 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
@media (hover: hover) {
  .app-side__signout:hover { background: var(--surface-warm); color: var(--forest); border-color: var(--border-2); }
}
.app-side__signout svg { width: 14px; height: 14px; }
.app-side__foot .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--volt);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.app-side__foot .user-meta {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}
.app-side__foot .user-meta strong {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--forest);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-side__foot .user-meta span {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-main {
  padding: clamp(20px, 3vw, 40px) clamp(20px, 4vw, 56px) var(--s-11);
  display: flex;
  flex-direction: column;
  gap: var(--s-7);
  min-width: 0;
}

/* Tight content rhythm: smaller gap between header and content. Pairs with
   page-header--bare on screens that should give the content room to breathe. */
.app-main--tight { gap: var(--s-4); }

.mobile-appbar,
.app-drawer-backdrop {
  display: none;
}

.mobile-appbar {
  background: rgba(251, 248, 241, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px) saturate(130%);
}
.mobile-appbar__identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.mobile-appbar__logo {
  display: inline-flex;
  flex-shrink: 0;
}
.mobile-appbar__logo img {
  width: 104px;
  height: auto;
  filter: brightness(0) saturate(100%) invert(18%) sepia(11%) saturate(1648%) hue-rotate(118deg) brightness(95%) contrast(92%);
}
.mobile-appbar__product {
  display: inline-flex;
  padding: 5px 10px;
  font-size: 11px;
}

/* Mobile menu toggle: icon-only, no pill or background. Left to the menu
   icon to carry the action. */
.mobile-menu-button {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--forest);
  cursor: pointer;
  transition: color var(--t-fast);
}
.mobile-menu-button__icon {
  width: 20px;
  display: grid;
  gap: 4px;
}
.mobile-menu-button__icon span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: var(--pill);
}
@media (hover: hover) {
  .mobile-menu-button:hover { color: var(--juniper); }
}

/* Client User reduced-nav variant: hides Team and Billing nav, plus any
   admin-only actions tagged with .is-admin-only. Triggered by body.state-role-user. */
body.state-role-user .app-side__nav a[href="team.html"],
body.state-role-user .is-admin-only {
  display: none;
}
body.state-role-user .app-side__workspace strong::after {
  content: " · Client User";
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
}

/* -------------------------------------------------------------------------
   Auth screen v2 (Base44-inspired split layout)
   Used by login.html (and signup.html once migrated). Cream form pane on
   the left, rounded forest brand pane on the right. State-driven banners
   and loading via body.state-* classes set by _explorer.js.
   ------------------------------------------------------------------------- */
.auth-screen {
  min-height: 100vh;
  background: var(--soft);
  padding: clamp(16px, 2vw, 30px);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 2vw, 30px);
}

.auth-form-pane {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--s-7);
  padding: clamp(8px, 2vw, 24px);
  min-height: 480px;
}
.auth-form-pane__logo { display: inline-flex; align-self: start; }
.auth-form-pane__logo img {
  width: 132px;
  height: auto;
  /* Source SVG is volt; recolor to dark forest for the cream pane */
  filter: brightness(0) saturate(100%) invert(18%) sepia(11%) saturate(1648%) hue-rotate(118deg) brightness(95%) contrast(92%);
}

.auth-form-pane__center {
  display: grid;
  place-items: center;
  align-self: stretch;
  padding: var(--s-4) 0;
}

.auth-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  box-shadow: var(--shadow-md);
  padding: clamp(24px, 3.4vw, 32px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
}
.auth-card > * { min-width: 0; }

.auth-card__head {
  display: grid;
  gap: 4px;
  text-align: center;
}
.auth-card__welcome {
  font-size: var(--text-md);
  color: var(--jade);
  font-weight: 500;
}
.auth-card__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(36px, 4.4vw, 48px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--forest);
  margin: 0;
}
.auth-card__title sup {
  font-size: 0.4em;
  vertical-align: super;
  letter-spacing: 0;
  margin-left: 2px;
  font-weight: 400;
  color: var(--jade);
}

/* State-driven banners. Hidden by default; shown via body.state-* */
.auth-banner {
  display: none;
  padding: 12px 14px;
  border-radius: var(--r1);
  font-size: var(--text-sm);
  line-height: 1.45;
  text-align: left;
  flex-direction: column;
  gap: 4px;
}
.auth-banner strong { display: block; font-weight: 700; }
.auth-banner a { color: inherit; text-decoration: underline; font-weight: 700; }
.auth-banner--error {
  background: rgba(255, 131, 91, 0.10);
  border: 1px solid rgba(255, 131, 91, 0.35);
  color: #8c2a10;
}
.validation-summary {
  text-align: left;
}
.validation-summary:not([hidden]) {
  display: flex;
}
.auth-banner--info {
  background: rgba(199, 220, 205, 0.4);
  border: 1px solid rgba(49, 92, 82, 0.18);
  color: var(--forest);
}
.auth-banner--success {
  background: rgba(205, 247, 101, 0.25);
  border: 1px solid rgba(35, 60, 54, 0.22);
  color: var(--forest);
}

body.state-invalid-credentials .auth-banner[data-state="invalid-credentials"],
body.state-account-not-found .auth-banner[data-state="account-not-found"],
body.state-system-error      .auth-banner[data-state="system-error"],
body.state-error             .auth-banner[data-state="error"],
body.state-success           .auth-banner[data-state="success"],
body.state-account-exists    .auth-banner[data-state="account-exists"],
body.state-workspace-exists  .auth-banner[data-state="workspace-exists"],
body.state-verify-error      .auth-banner[data-state="verify-error"],
body.state-verify-resent     .auth-banner[data-state="verify-resent"] {
  display: flex;
}

/* OAuth pill button row */
.oauth-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}
.btn-oauth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--pill);
  background: var(--white);
  color: var(--forest);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
  min-width: 0;
}
.btn-oauth svg { width: 16px; height: 16px; flex-shrink: 0; }
@media (hover: hover) {
  .btn-oauth:hover { border-color: var(--forest); background: rgba(35,60,54,0.03); transform: translateY(-1px); }
}

/* Tighter labels with optional inline 'forgot' link */
.field--auth label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--jade);
}
.field--auth input {
  padding: 12px 14px;
  border-radius: var(--r1);
}
.field--auth input::placeholder { color: var(--muted-2); }

.field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.field__forgot {
  font-size: var(--text-xs);
  color: var(--forest);
  text-decoration: none;
  font-weight: 600;
}
.field__forgot:hover { text-decoration: underline; }

.auth-card__foot {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
  margin-top: -2px;
}
.auth-card__foot a {
  color: var(--forest);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Loading state structure: btn__label hides and btn__loading appears when
   body.state-loading is set. Buttons inside auth card otherwise inherit the
   global .btn.primary treatment for visual consistency app-wide. */
.auth-card .btn.primary .btn__loading { display: none; align-items: center; gap: 8px; }

/* Loading state: button shows spinner, label hides, form disabled feel */
body.state-loading .auth-card .btn.primary { pointer-events: none; opacity: 0.92; }
body.state-loading .auth-card .btn.primary .btn__label   { display: none; }
body.state-loading .auth-card .btn.primary .btn__loading { display: inline-flex; }
body.state-loading .auth-card input { background: var(--surface-warm); }

.spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(205, 247, 101, 0.3);
  border-top-color: var(--volt);
  animation: x-spin 700ms linear infinite;
}
@keyframes x-spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------------------
   Auth brand pane (right side: forest, rounded, grid texture, FAQ carousel)
   ------------------------------------------------------------------------- */
.auth-brand-pane {
  background: var(--forest);
  color: var(--soft);
  border-radius: clamp(18px, 2vw, 30px);
  padding: clamp(32px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 480px;
  max-height: calc(100vh - clamp(32px, 4vw, 60px));
  background-image:
    radial-gradient(900px 600px at 100% 0%, rgba(205,247,101,0.06), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(199,220,205,0.06), transparent 60%);
}

/* Subtle grid pattern overlay */
.auth-brand-pane::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(247,243,235,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(247,243,235,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.7;
}

.auth-brand-pane__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-6);
  max-width: 560px;
  width: 100%;
  min-width: 0;
  text-align: left;
}
.auth-brand-pane__inner > * { min-width: 0; max-width: 100%; }

.brand-pill {
  align-self: start;
  justify-self: start;
  width: max-content;
  display: inline-flex;
  align-items: center;
  padding: 9px 22px;
  border-radius: var(--pill);
  background: transparent;
  border: 1px solid var(--volt);
  color: var(--volt);
  font-family: var(--body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: default;
}

.brand-headline {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(26px, 2.8vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--linen);
  margin: 0;
  text-wrap: balance;
}
.brand-headline em {
  font-style: normal;
  color: var(--volt);
}

.brand-lede {
  font-size: var(--text-lg);
  line-height: 1.5;
  color: rgba(247, 243, 235, 0.88);
  max-width: 48ch;
  margin: 0;
}

/* Login dashboard preview: short static placeholder, sits between lede and FAQ carousel.
   Replaces the SOW's "laptop graphic with embedded screen recording" until Hatchery
   provides the recording. Full width of brand-pane__inner, ~140px tall. */
/* Hero media on the brand pane: fills the inner pane width fully so it
   visually aligns with the FAQ carousel below it. */
.brand-hero-media {
  width: 100%;
  margin-top: var(--s-3);
  display: block;
}
.brand-hero-media img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
}

.brand-carousel {
  position: relative;
  margin-top: var(--s-4);
  min-width: 0;
  width: 100%;
}
.brand-carousel__viewport {
  position: relative;
  border-radius: var(--r1);
  width: 100%;
  min-width: 0;
}
/* Slide pattern: cards stack in one grid cell. Incoming card slides in
   solid (no fade); outgoing card slides out AND fades. Direction-aware so
   wrap-around (last → first) feels natural. */
.brand-carousel__viewport { overflow: hidden; }
.brand-carousel__track {
  display: grid;
  width: 100%;
  min-width: 0;
}
.brand-faq-card {
  grid-area: 1 / 1;
  min-width: 0;
  box-sizing: border-box;
  padding: var(--s-5);
  background: rgba(49, 92, 82, 0.35);
  border: 1px solid rgba(247, 243, 235, 0.18);
  border-radius: var(--r1);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateX(100%);
  pointer-events: none;
  transition: opacity 520ms cubic-bezier(.22, 1, .36, 1),
              transform 520ms cubic-bezier(.22, 1, .36, 1);
}
.brand-faq-card.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 2;
}
.brand-faq-card.is-exit-left {
  opacity: 0;
  transform: translateX(-100%);
  z-index: 1;
}
.brand-faq-card.is-exit-right {
  opacity: 0;
  transform: translateX(100%);
  z-index: 1;
}
/* Pre-position with no transition so the incoming card snaps to its
   offscreen start before the JS adds .is-active and animates it in. */
.brand-faq-card.is-pre-right {
  opacity: 1;
  transform: translateX(100%);
  transition: none;
}
.brand-faq-card.is-pre-left {
  opacity: 1;
  transform: translateX(-100%);
  transition: none;
}
.brand-faq-card h3 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  color: var(--volt);
  margin: 0 0 6px;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.brand-faq-card p {
  font-size: var(--text-sm);
  color: rgba(199, 220, 205, 0.95);
  line-height: 1.55;
  margin: 0;
}

.brand-carousel__nav {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: var(--s-3);
}
.brand-arrow {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  color: var(--soft);
  opacity: 0.45;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition: opacity var(--t-fast), background var(--t-fast);
}
.brand-arrow:hover { opacity: 1; background: rgba(247,243,235,0.06); }

/* -------------------------------------------------------------------------
   Auth multi-step (signup): pagination dots + per-step panels
   ------------------------------------------------------------------------- */


/* Step panels: only the matching one is visible */
.auth-step-panel {
  display: none;
  flex-direction: column;
  gap: var(--s-5);
}
body:not(.state-step-company):not(.state-step-tier):not(.state-verify-email):not(.state-verify-error):not(.state-verify-resent):not(.state-contact-state) .auth-step-panel[data-panel="step-account"],
body.state-step-company   .auth-step-panel[data-panel="step-company"],
body.state-step-tier      .auth-step-panel[data-panel="step-tier"],
body.state-verify-email   .auth-step-panel[data-panel="verify-email"],
body.state-verify-error   .auth-step-panel[data-panel="verify-email"],
body.state-verify-resent  .auth-step-panel[data-panel="verify-email"],
body.state-contact-state  .auth-step-panel[data-panel="contact-state"] {
  display: flex;
}

/* Forgot password: two panels, default + sent */
body:not(.state-sent) .auth-step-panel[data-panel="default-forgot"],
body.state-sent       .auth-step-panel[data-panel="sent"] {
  display: flex;
}

.forgot-sent {
  display: grid;
  place-items: center;
  text-align: center;
  gap: var(--s-3);
  padding: var(--s-5);
  background: var(--mint);
  border: 1px solid rgba(49, 92, 82, 0.18);
  border-radius: var(--r2);
}
.forgot-sent__icon {
  width: 32px;
  height: 32px;
  color: var(--forest);
}
.forgot-sent p {
  font-size: var(--text-sm);
  color: var(--forest);
  line-height: 1.55;
  max-width: 38ch;
}
.forgot-sent strong { font-weight: 700; }

/* Step button row: Back on left, Continue on right, auto-width */
.auth-step-actions {
  display: flex;
  gap: var(--s-3);
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 2px;
}
.auth-step-actions .btn {
  flex: 0 0 auto;
  min-width: 140px;
  padding-left: var(--s-6);
  padding-right: var(--s-6);
}

.seat-stepper-block {
  display: grid;
  place-items: center;
  padding: var(--s-5) 0;
  gap: var(--s-3);
}

/* Tier cards. Use auto-fit so the grid naturally adapts to container width:
   stacked on narrow viewports, 3-up inside the 560px auth card on desktop. */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s-3);
}
.tier-card {
  position: relative;
  display: grid;
  gap: 4px;
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.tier-card:hover { border-color: var(--forest); transform: translateY(-1px); }
.tier-card[aria-pressed="true"] {
  border-color: var(--forest);
  background: rgba(199, 220, 205, 0.32);
}
.tier-card[aria-pressed="true"]::after {
  content: "\2713";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: var(--forest);
  color: var(--volt);
  font-size: 13px;
  font-weight: 800;
  border-radius: 50%;
}
.tier-card.is-contact { background: var(--surface-warm); }
.tier-card__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--jade);
}
.tier-card__name {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--forest);
  line-height: 1.15;
}
.tier-card__price {
  font-size: var(--text-md);
  color: var(--forest);
  font-weight: 600;
}
.tier-card__price small {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  margin-left: 2px;
}
.tier-card__desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 2px;
}

/* Team size stepper buttons */
.seat-stepper {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: 6px;
  border: 1px solid var(--border-2);
  border-radius: var(--pill);
  background: var(--surface);
}
.seat-stepper button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-warm);
  color: var(--forest);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast);
}
.seat-stepper button:hover { background: var(--mint); }
.seat-stepper .seat-count {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  color: var(--forest);
  min-width: 56px;
  text-align: center;
}

/* Summary card inside step 5 */
.signup-summary {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--r2);
}
.signup-summary__row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--muted);
}
.signup-summary__row strong {
  color: var(--charcoal);
  font-weight: 700;
}
.signup-summary__row.total {
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
  font-size: var(--text-md);
  color: var(--forest);
}
.signup-summary__row.total strong {
  color: var(--forest);
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
}

/* Contact state styling */
.contact-state-callout {
  padding: var(--s-6);
  background: var(--mint);
  border: 1px solid rgba(49, 92, 82, 0.20);
  border-radius: var(--r2);
  display: grid;
  gap: var(--s-3);
  text-align: center;
}
.contact-state-callout h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 28px;
  color: var(--forest);
  line-height: 1.15;
}
.contact-state-callout p {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.55;
  max-width: 48ch;
  margin: 0 auto;
}

/* =========================================================================
   Breakpoints
   ========================================================================= */

/* >= 640px : two-up form rows, summary row alignment */
@media (min-width: 640px) {
  .profile-grid    { grid-template-columns: 1fr 1fr; }
  .sso-row         { grid-template-columns: 1fr 1fr; }
  .oauth-row       { grid-template-columns: 1fr 1fr; }
  .status-grid     { grid-template-columns: repeat(2, 1fr); }
  .modal-row       { grid-template-columns: 1fr 1fr; }
  .analytics-grid  { grid-template-columns: 2fr 1fr; }
}

/* >= 768px : grids open up, page header lays out side by side, tables show */
@media (min-width: 768px) {
  :root { --nav: 76px; }

  .grid.two    { grid-template-columns: repeat(2, 1fr); }
  .grid.three  { grid-template-columns: repeat(3, 1fr); }
  .grid.four   { grid-template-columns: repeat(4, 1fr); }

  .page-header {
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: end;
    gap: var(--s-7);
    padding-bottom: var(--s-4);
  }
  .page-header > .button-row { flex-wrap: nowrap; justify-content: flex-end; }

  .plan-grid   { grid-template-columns: repeat(3, 1fr); }
  .status-grid { grid-template-columns: repeat(3, 1fr); }

  .login-art h1 { font-size: clamp(40px, 4.4vw, 56px); }
}

/* >= 1024px : split / login two-column, stepper visible inline */
@media (min-width: 1024px) {
  .login-page   { grid-template-columns: 1.05fr 0.95fr; }
  .login-art    { padding: clamp(40px, 5vw, 72px); }
  .login-panel  { padding: clamp(40px, 5vw, 72px); }
  .auth-screen  { grid-template-columns: 1fr 1fr; }
  .analytics-grid { gap: var(--s-6); }

  .app-shell    { grid-template-columns: 260px minmax(0, 1fr); transition: grid-template-columns 260ms cubic-bezier(0.22, 1, 0.36, 1); }
  .app-shell:has(.app-side.is-collapsed) { grid-template-columns: 72px minmax(0, 1fr); }
  .app-side     { position: sticky; top: 0; height: 100vh; }
  .app-side__collapse { display: inline-grid; }
}

/* >= 1200px : .split goes two-column once each pane has real room. Below
   this, both panes stack so role pills and small buttons don't crowd. */
@media (min-width: 1200px) {
  .split        { grid-template-columns: 1.15fr 0.85fr; gap: var(--s-7); }
}

/* < 1024px : authenticated shell uses a compact top bar and drawer */
@media (max-width: 1023.98px) {
  /* portal.js never applies .is-collapsed at mobile widths, so the drawer
     always renders in full expanded form. */

  /* Drawer nav: extra breathing room between icon and label so they don't
     visually crowd. Desktop keeps the tighter 12px gap. */
  .app-side__nav a { gap: var(--s-4); padding: 12px 14px; }

  .mobile-appbar {
    position: sticky;
    top: 0;
    z-index: 35;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
  }

  .app-shell.has-mobile-shell .app-side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(320px, calc(100vw - 48px));
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateX(-104%);
    transition: transform var(--t-norm);
  }

  body.app-nav-open {
    overflow: hidden;
  }

  body.app-nav-open .app-shell.has-mobile-shell .app-side {
    transform: translateX(0);
  }

  .app-shell.has-mobile-shell .app-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: block;
    background: rgba(20, 20, 20, 0.32);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-norm);
  }

  body.app-nav-open .app-shell.has-mobile-shell .app-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell.has-mobile-shell .app-main {
    padding-top: var(--s-6);
  }
}


/* < 900px : dense tables collapse to cards */
@media (max-width: 899.98px) {
  .desktop-table { display: none; }
  .mobile-cards  { display: grid; }

  .nav { display: none; }
  .account-menu > span:not(.avatar) { display: none; }
  .topbar { gap: var(--s-3); }
  .brand  { min-width: auto; }
}

/* < 768px : tighter rhythm */
@media (max-width: 767.98px) {
  .page-header { padding-bottom: var(--s-3); }
  .main { gap: var(--s-6); }
}

/* < 480px : tighter padding on cards, smaller display sizes */
@media (max-width: 479.98px) {
  .card { padding: var(--s-5); border-radius: var(--r2); }
  .card.metric strong { font-size: 28px; }
  .auth-card { padding: var(--s-5); }
  .browser-frame { padding: var(--s-3); }
}
