/* Carvanta — "Carbon Ledger" design system
   Layered on top of the compiled Tailwind utilities. */

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Display face for headings; body stays IBM Plex Sans via Tailwind preflight. */
h1, h2, h3, h4, .font-display {
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.02em;
}

::selection {
  background: #C3F53C;
  color: #0B2A20;
}

/* Every financial figure reads as instrument data. */
.fig {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Eyebrow / section label — small measured capitals.
   The colour is wrapped in :where() so it carries zero specificity: an eyebrow
   sitting on a dark surface can still be re-coloured with a `text-white/40`
   utility, which would otherwise lose to this rule on source order alone.
   Note: eyebrows are only ever on p/span/dt, which no preflight rule colours.
   On an element preflight *does* colour (`a`), zero specificity would lose —
   see the `a:where(.nav-link)` rule below. */
.eyebrow {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
:where(.eyebrow) {
  color: #2C8462;
}

/* ---- Navigation ---- */
.nav-link {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: color 0.15s ease, background-color 0.15s ease;
}
/* Default colour, kept low-specificity so `nav-link text-signal` (admin) stays
   lime. It must still out-rank Tailwind preflight's `a { color: inherit }`
   (0,0,1) — a bare `:where(.nav-link)` is (0,0,0) and loses to it, which leaves
   every nav link inheriting the body's near-black ink on the dark green bar.
   `a:where(.nav-link)` ties preflight at (0,0,1) and wins on source order,
   while any `text-*` utility (0,1,0) still overrides it. */
a:where(.nav-link) {
  color: rgba(255, 255, 255, 0.72);
}
.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.nav-badge {
  display: inline-grid; place-items: center; min-width: 1.1rem; height: 1.1rem;
  padding: 0 0.3rem; border-radius: 999px; background: #C3F53C; color: #0B2A20;
  font-size: 0.65rem; font-weight: 700; line-height: 1;
  font-family: "IBM Plex Mono", monospace;
}

/* ---- Surfaces ---- */
.card {
  background: #fff;
  border: 1px solid rgba(11, 42, 32, 0.08);
  border-radius: 0.875rem;
  box-shadow: 0 1px 2px rgba(11, 42, 32, 0.05), 0 6px 16px -12px rgba(11, 42, 32, 0.18);
}

/* ---- Project instrument hero (buy-project detail) ---- */
.proj-hero {
  position: relative;
  border-radius: 1.125rem;
  overflow: hidden;
  isolation: isolate;
  background: #0B2A20;
}
.proj-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
}
.proj-hero__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(200deg, rgba(11, 42, 32, 0.05) 0%, rgba(11, 42, 32, 0.30) 46%, rgba(11, 42, 32, 0.90) 100%);
}

/* ---- Carousel ----
   Once JS has taken over (`is-ready`), slide visibility is owned entirely by
   `is-active` — nothing in the utility cascade can hide the slide we just
   switched to, and a slide whose file 404s is skipped by `is-broken` instead
   of being pinned to display:none forever. The controls sit above the scrim
   and the hero body so they always receive the click. */
[data-carousel].is-ready [data-carousel-slide] { display: none; }
[data-carousel].is-ready [data-carousel-slide].is-active { display: block; }
[data-carousel] [data-carousel-slide].is-broken { visibility: hidden; }
.carousel-controls {
  position: absolute; z-index: 20; top: 0.85rem; right: 0.85rem;
  display: flex; align-items: center; gap: 0.5rem;
}
/* The controls sit on top of photography of any brightness, so they carry their
   own contrast rather than relying on the image behind them. */
.carousel-btn {
  display: grid; place-items: center;
  height: 2.75rem; width: 2.75rem; border-radius: 9999px;
  background: rgba(11, 42, 32, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff; font-size: 1.35rem; line-height: 1;
  box-shadow: 0 4px 14px rgba(11, 42, 32, 0.35);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  cursor: pointer;
}
.carousel-btn:hover { background: #124433; border-color: #fff; transform: scale(1.06); }
.carousel-count {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem; color: #fff;
  background: rgba(11, 42, 32, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0.15rem 0.6rem; border-radius: 9999px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.proj-hero__body {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(300px, 42vw, 420px);
  padding: clamp(1.25rem, 3vw, 2rem);
  color: #fff;
}
/* Frosted instrument rail of live figures at the base of the hero. */
.proj-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  margin-top: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.85rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  gap: 1px;
}
.proj-rail__cell {
  background: rgba(9, 34, 26, 0.42);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  padding: 0.7rem 0.95rem;
}
.proj-rail__label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}
.proj-rail__value {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  font-size: 1.05rem;
  margin-top: 0.15rem;
  color: #fff;
}

/* Quiet stat tile for the facts grid. */
.stat-tile {
  background: #F7F9F5;
  border: 1px solid rgba(11, 42, 32, 0.07);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
}

/* A hairline chip used for verification standards. */
.std-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(11, 42, 32, 0.12);
  border-radius: 9999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  color: #124433;
  background: #fff;
}

/* ---- Signature: the measurement meter ---- */
.meter {
  position: relative;
  height: 0.6rem;
  border-radius: 9999px;
  background: #DCE3D9;
  overflow: hidden;
}
.meter__fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #124433 0%, #2C8462 62%, #C3F53C 100%);
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Instrument tick marks every 10% for a gauge-like read. */
.meter__ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc(10% - 1px),
    rgba(255, 255, 255, 0.55) calc(10% - 1px),
    rgba(255, 255, 255, 0.55) 10%
  );
}

/* ---- Flash messages ---- */
.flash {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  border: 1px solid transparent;
}
.flash-dot {
  margin-top: 0.4rem;
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: currentColor;
}
.flash-success { background: #EDF6F1; color: #0E3728; border-color: #AEDAC5; }
.flash-danger  { background: #FBECEC; color: #8A1C1C; border-color: #F3C4C4; }
.flash-warning { background: #FBF3DF; color: #7A5A16; border-color: #EBD79C; }
.flash-info    { background: #EAF1F6; color: #1D4A66; border-color: #C2D9E7; }

/* ---- Forms ---- */
input, textarea, select {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #2C8462;
  box-shadow: 0 0 0 3px rgba(44, 132, 98, 0.18);
}
/* Checkboxes and radios pick up the forest, not the browser's default blue. */
input[type="checkbox"], input[type="radio"] {
  accent-color: #124433;
  width: 1rem;
  height: 1rem;
}

/* The standard field. One control shape across sign-in, sign-up, access codes,
   the footprint survey and the profile forms. */
.field {
  display: block;
  width: 100%;
  background: #fff;
  color: #0B2A20;
  border: 1px solid rgba(11, 42, 32, 0.14);
  border-radius: 0.625rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.925rem;
  line-height: 1.4;
}
.field::placeholder { color: rgba(11, 42, 32, 0.35); }
.field:disabled { background: #F1F4EE; color: rgba(11, 42, 32, 0.5); cursor: not-allowed; }
.field.is-error { border-color: #D98A8A; }
.field.is-error:focus { border-color: #C06565; box-shadow: 0 0 0 3px rgba(192, 101, 101, 0.15); }

/* Native select arrows differ per platform; draw our own chevron instead. */
select.field {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%232C8462' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(11, 42, 32, 0.7);
  margin-bottom: 0.35rem;
}
.field-error { color: #8A1C1C; font-size: 0.78rem; margin-top: 0.35rem; }
.field-hint { color: rgba(11, 42, 32, 0.5); font-size: 0.78rem; margin-top: 0.35rem; }
.field-row + .field-row { margin-top: 1rem; }

/* ---- Centred single-card pages (sign in, sign up, access code) ---- */
.auth-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(64vh, 34rem);
  padding-bottom: 1.5rem;
}
.auth-card { width: 100%; max-width: 27rem; padding: 2rem; }
.auth-card--wide { max-width: 32rem; }

/* ---- Icon tile ----
   The square-ish mark used for feature/step icons. Same family as .credit-icon,
   so every icon on the site sits in the same shape rather than mixed circles. */
.icon-tile {
  display: inline-grid;
  place-items: center;
  height: 3rem; width: 3rem;
  border-radius: 0.85rem;
  flex: none;
  background: rgba(44, 132, 98, 0.1);
  border: 1px solid rgba(44, 132, 98, 0.18);
  color: #1B6B4E;
}
.icon-tile--lg { height: 3.5rem; width: 3.5rem; border-radius: 1rem; }
.icon-tile--pine { background: rgba(18, 68, 51, 0.08); border-color: rgba(18, 68, 51, 0.16); color: #124433; }
.icon-tile--signal { background: rgba(195, 245, 60, 0.3); border-color: rgba(140, 190, 30, 0.35); color: #3F5A11; }
.icon-tile--sand { background: rgba(231, 198, 135, 0.28); border-color: rgba(184, 137, 47, 0.28); color: #8A6A22; }
.icon-tile .fig { font-size: 1.05rem; font-weight: 700; }

/* ---- Motion & interaction ---- */
button, a {
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
table tbody tr {
  transition: background-color 0.12s ease;
}
table tbody tr:hover {
  background-color: #F6F8F4;
}

/* Accessible keyboard focus everywhere. */
a:focus-visible, button:focus-visible {
  outline: 2px solid #2C8462;
  outline-offset: 2px;
  border-radius: 0.375rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   Admin console — "control room" for the Carbon Ledger
   ============================================================ */

.admin-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (min-width: 900px) {
  .admin-shell { grid-template-columns: 15.5rem minmax(0, 1fr); }
}

/* ---- Sidebar ---- */
.admin-sidebar {
  background: #0B2A20;
  color: rgba(255, 255, 255, 0.75);
  border-radius: 1rem;
  padding: 1rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
@media (min-width: 900px) {
  .admin-sidebar { position: sticky; top: 5rem; }
}
.admin-sidebar__brand {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.25rem 0.5rem 0.9rem;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.85rem;
}
.admin-sidebar__brand-badge {
  display: grid; place-items: center; height: 1.75rem; width: 1.75rem;
  border-radius: 0.5rem; background: #C3F53C; color: #0B2A20;
}
.admin-sidebar__group + .admin-sidebar__group { margin-top: 1.1rem; }
.admin-sidebar__label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(195, 245, 60, 0.72);
  padding: 0 0.5rem; margin-bottom: 0.4rem;
}
.admin-nav-link {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.5rem 0.65rem; border-radius: 0.6rem;
  font-size: 0.875rem; color: rgba(255, 255, 255, 0.72);
}
.admin-nav-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.admin-nav-link.is-active { background: #2C8462; color: #fff; }
.admin-nav-link svg { flex: none; opacity: 0.8; }
.admin-nav-link .admin-nav-count {
  margin-left: auto;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.68rem; font-weight: 600;
  background: #C3F53C; color: #0B2A20;
  padding: 0.02rem 0.42rem; border-radius: 9999px;
}
.admin-nav-link.is-active .admin-nav-count { background: rgba(255, 255, 255, 0.28); color: #fff; }

/* ---- Page header ---- */
.admin-head {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem;
}
.admin-head__title { font-size: 1.85rem; font-weight: 700; color: #0B2A20; line-height: 1.1; }
.admin-head__sub { color: #5B6B60; font-size: 0.9rem; margin-top: 0.25rem; }
.admin-head__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---- Stat tiles ---- */
.stat {
  display: block; padding: 1.1rem 1.25rem; position: relative; overflow: hidden;
}
.stat__label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: #2C8462;
}
.stat__value {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 1.9rem; font-weight: 600; color: #124433; margin-top: 0.3rem; line-height: 1;
}
.stat__meta { font-size: 0.75rem; color: #7A8A80; margin-top: 0.4rem; }
a.stat:hover { border-color: rgba(44, 132, 98, 0.5); }
.stat--alert { background: #FBF3DF; border-color: #EBD79C; }
.stat--alert .stat__label { color: #7A5A16; }
.stat--alert .stat__value { color: #7A5A16; }
.stat--clear { background: #EDF6F1; border-color: #AEDAC5; }
.stat--clear .stat__label,
.stat--clear .stat__value { color: #0E3728; }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.72rem; font-weight: 600; line-height: 1.2;
  padding: 0.2rem 0.55rem; border-radius: 9999px; border: 1px solid transparent;
  white-space: nowrap;
}
.badge__dot { width: 0.45rem; height: 0.45rem; border-radius: 9999px; background: currentColor; }
.badge-ok     { background: #EDF6F1; color: #0E3728; border-color: #AEDAC5; }
.badge-warn   { background: #FBF3DF; color: #7A5A16; border-color: #EBD79C; }
.badge-danger { background: #FBECEC; color: #8A1C1C; border-color: #F3C4C4; }
.badge-info   { background: #EAF1F6; color: #1D4A66; border-color: #C2D9E7; }
.badge-muted  { background: #EEF1EC; color: #55655B; border-color: #D8DFD4; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.5rem 0.9rem; border-radius: 0.6rem;
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; text-align: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-xs { padding: 0.3rem 0.6rem; font-size: 0.72rem; border-radius: 0.5rem; }
.btn-lg { padding: 0.7rem 1.3rem; font-size: 0.95rem; border-radius: 0.7rem; }
.btn-block { width: 100%; }
.btn-primary { background: #124433; color: #fff; }
.btn-primary:hover { background: #2C8462; }
.btn-ghost { background: #fff; color: #124433; border-color: rgba(11, 42, 32, 0.15); }
.btn-ghost:hover { border-color: #2C8462; color: #2C8462; }
.btn-danger { background: #fff; color: #8A1C1C; border-color: #F3C4C4; }
.btn-danger:hover { background: #FBECEC; }
.btn-signal { background: #C3F53C; color: #0B2A20; }
.btn-signal:hover { background: #d6ff6b; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover { background: #124433; }
.btn-ghost:disabled:hover { background: #fff; }

/* ---- Data tables ---- */
.data-table { width: 100%; font-size: 0.875rem; text-align: left; border-collapse: collapse; }
.data-table thead th {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.66rem; letter-spacing: 0.09em; text-transform: uppercase; color: #55655B;
  padding: 0.7rem 1rem; background: #F1F4EE; border-bottom: 1px solid rgba(11, 42, 32, 0.1);
  white-space: nowrap;
}
.data-table tbody td { padding: 0.85rem 1rem; border-bottom: 1px solid rgba(11, 42, 32, 0.06); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background-color: #F6F8F4; }
.data-empty { padding: 3rem 1rem; text-align: center; color: #9AA79E; }

/* ---- Section tabs (e.g. Users → Accounts / KYC review) ---- */
.admin-tabs {
  display: inline-flex; gap: 0.25rem; padding: 0.25rem;
  background: #E7ECE4; border-radius: 0.7rem;
}
.admin-tab {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.9rem; border-radius: 0.55rem;
  font-size: 0.85rem; font-weight: 500; color: #55655B;
}
.admin-tab:hover { color: #124433; }
.admin-tab.is-active { background: #fff; color: #124433; box-shadow: 0 1px 2px rgba(11, 42, 32, 0.08); }
.admin-tab__count {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.66rem; font-weight: 600;
  background: #FBF3DF; color: #7A5A16; border: 1px solid #EBD79C;
  padding: 0.02rem 0.4rem; border-radius: 9999px;
}

/* Compact inline inputs inside tables/forms */
.field-sm {
  border: 1px solid rgba(11, 42, 32, 0.16); border-radius: 0.5rem;
  padding: 0.35rem 0.55rem; font-size: 0.8rem; background: #fff;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(11, 42, 32, 0.55);
  backdrop-filter: blur(2px);
  animation: modal-fade 0.15s ease;
}
.modal-card {
  background: #fff; border-radius: 1rem; width: 100%; max-width: 40rem;
  box-shadow: 0 24px 60px -20px rgba(11, 42, 32, 0.5);
  animation: modal-pop 0.16s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

/* ---- Generic dialog (always in the DOM, toggled by main.js) ----
   Used for anything that has to interrupt: confirming a purchase, requesting a
   withdrawal, setting the Withdraw PIN, explaining membership tiers. */
.dlg {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(11, 42, 32, 0.55);
  backdrop-filter: blur(2px);
  animation: modal-fade 0.15s ease;
}
.dlg.hidden { display: none; }
.dlg__card {
  background: #fff; border-radius: 1rem; width: 100%; max-width: 30rem;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px -20px rgba(11, 42, 32, 0.5);
  animation: modal-pop 0.16s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  text-align: left;
}
.dlg__card--wide { max-width: 38rem; }
.dlg__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.4rem; border-bottom: 1px solid rgba(11, 42, 32, 0.1);
}
.dlg__title {
  font-family: "Space Grotesk", ui-sans-serif, sans-serif;
  font-size: 1.1rem; font-weight: 700; color: #0B2A20; line-height: 1.2;
}
.dlg__sub { font-size: 0.8rem; color: #5B6B60; margin-top: 0.2rem; }
.dlg__x {
  font-size: 1.5rem; line-height: 1; color: rgba(11, 42, 32, 0.4);
  background: none; border: 0; cursor: pointer; padding: 0 0.25rem;
}
.dlg__x:hover { color: #124433; }
.dlg__body { padding: 1.25rem 1.4rem; overflow-y: auto; }
.dlg__foot {
  display: flex; justify-content: flex-end; gap: 0.6rem;
  padding: 1rem 1.4rem; border-top: 1px solid rgba(11, 42, 32, 0.1); background: #F8FAF6;
}
body.dlg-open { overflow: hidden; }

/* Settled-transaction seal in the receipt dialog's header. */
.receipt-seal {
  display: grid; place-items: center;
  height: 2.4rem; width: 2.4rem; border-radius: 9999px;
  flex: none;
  background: #C3F53C; color: #0B2A20;
  box-shadow: 0 0 0 5px rgba(195, 245, 60, 0.22);
}
.receipt-seal--sell { background: #2C8462; color: #fff; box-shadow: 0 0 0 5px rgba(44, 132, 98, 0.18); }

/* Summary rows inside a dialog (order review, tier ladder, …). */
.dlg-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: 0.5rem 0; border-bottom: 1px dashed rgba(11, 42, 32, 0.1);
}
.dlg-row:last-child { border-bottom: 0; }
.dlg-row__k { font-size: 0.85rem; color: #5B6B60; }
.dlg-row__v { font-family: "IBM Plex Mono", ui-monospace, monospace; font-weight: 600; color: #0B2A20; }
.dlg-total {
  display: flex; align-items: center; justify-content: space-between;
  background: #124433; color: #fff; border-radius: 0.7rem;
  padding: 0.8rem 1rem; margin-top: 0.9rem;
}

/* ---- Terms & Conditions modal (scrollable, always-in-DOM) ---- */
.terms-overlay {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(11, 42, 32, 0.55);
  backdrop-filter: blur(2px);
  animation: modal-fade 0.15s ease;
}
.terms-overlay.hidden { display: none; }
.terms-card {
  background: #fff; border-radius: 1rem; width: 100%; max-width: 44rem;
  max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px -20px rgba(11, 42, 32, 0.5);
  animation: modal-pop 0.16s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
.terms-card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.5rem; border-bottom: 1px solid rgba(11, 42, 32, 0.1);
}
.terms-card__x {
  font-size: 1.6rem; line-height: 1; color: rgba(11, 42, 32, 0.45);
  background: none; border: 0; cursor: pointer; padding: 0 0.25rem;
}
.terms-card__x:hover { color: #124433; }
.terms-card__body {
  padding: 1.25rem 1.5rem; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.terms-card__foot {
  display: flex; justify-content: flex-end; gap: 0.6rem;
  padding: 1rem 1.5rem; border-top: 1px solid rgba(11, 42, 32, 0.1);
  background: #F8FAF6;
}
.terms-h {
  font-family: "Space Grotesk", ui-sans-serif, sans-serif;
  font-size: 0.95rem; font-weight: 600; color: #124433;
  margin: 1.1rem 0 0.35rem;
}
.terms-h:first-of-type { margin-top: 0; }
.terms-p {
  font-size: 0.85rem; line-height: 1.65; color: rgba(11, 42, 32, 0.8);
  margin: 0 0 0.5rem;
}

/* ---- Support chat (two-pane live chat) ---- */
.support-layout {
  display: grid; grid-template-columns: 19rem 1fr;
  height: 70vh; min-height: 26rem; overflow: hidden; padding: 0;
}
.support-side {
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid rgba(11, 42, 32, 0.1); background: #FBFCFA;
}
.support-side__head {
  padding: 0.9rem 1rem 0.4rem; display: flex; align-items: center; justify-content: space-between;
}
.thread-list { flex: 1 1 auto; overflow-y: auto; padding: 0 0.5rem 0.5rem; }
.thread-list__empty { color: rgba(11, 42, 32, 0.45); font-size: 0.8rem; padding: 1rem; }
.thread-item {
  display: block; padding: 0.6rem 0.65rem; border-radius: 0.6rem; margin-bottom: 0.15rem;
  border: 1px solid transparent; transition: background 0.12s ease, border-color 0.12s ease;
}
.thread-item:hover { background: #F1F4EE; }
.thread-item.is-active { background: #EDF6F1; border-color: rgba(44, 132, 98, 0.35); }
.thread-item__top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.thread-item__subject {
  font-weight: 600; font-size: 0.85rem; color: #124433;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread-item.is-unread .thread-item__subject { color: #0B2A20; }
.thread-item__badge {
  flex: none; display: inline-grid; place-items: center; min-width: 1.05rem; height: 1.05rem;
  padding: 0 0.28rem; border-radius: 999px; background: #124433; color: #fff;
  font-size: 0.62rem; font-weight: 700; font-family: "IBM Plex Mono", monospace;
}
.thread-item__preview {
  font-size: 0.76rem; color: rgba(11, 42, 32, 0.6); margin-top: 0.15rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread-item.is-unread .thread-item__preview { color: rgba(11, 42, 32, 0.85); font-weight: 500; }
.thread-item__by { color: rgba(11, 42, 32, 0.4); }
.thread-item__meta { font-size: 0.65rem; color: rgba(11, 42, 32, 0.42); margin-top: 0.2rem; font-family: "IBM Plex Mono", monospace; }

.support-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.support-main__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.85rem 1.1rem; border-bottom: 1px solid rgba(11, 42, 32, 0.1); background: #fff;
}
.support-main__subject {
  font-family: "Space Grotesk", ui-sans-serif, sans-serif; font-weight: 600;
  font-size: 1rem; color: #124433; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.support-main__meta { font-size: 0.68rem; color: rgba(11, 42, 32, 0.45); font-family: "IBM Plex Mono", monospace; }
.support-empty {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2rem; gap: 0.15rem;
}
.support-empty__icon {
  display: grid; place-items: center; height: 3.5rem; width: 3.5rem; border-radius: 999px;
  background: #EDF6F1; color: #2C8462; margin-bottom: 0.5rem;
}
.support-empty__title { font-family: "Space Grotesk", ui-sans-serif, sans-serif; font-weight: 600; font-size: 1.15rem; color: #124433; }
.support-empty__text { font-size: 0.85rem; color: rgba(11, 42, 32, 0.6); max-width: 22rem; }

/* Admin single-pane chat (no conversation sidebar). */
.support-thread-shell {
  display: flex; flex-direction: column; height: 66vh; min-height: 24rem; overflow: hidden; padding: 0;
}

.chat-window {
  flex: 1 1 auto; overflow-y: auto; padding: 1.1rem 1.25rem;
  display: flex; flex-direction: column; gap: 0.55rem;
  background: linear-gradient(180deg, #F8FAF6, #ffffff);
}
.chat-row { display: flex; }
.chat-row--mine { justify-content: flex-end; }
.chat-row--theirs { justify-content: flex-start; }
.chat-bubble {
  max-width: 78%; border-radius: 1rem; padding: 0.55rem 0.8rem;
  box-shadow: 0 1px 2px rgba(11, 42, 32, 0.06);
}
.chat-bubble--mine { background: #124433; color: #fff; border-bottom-right-radius: 0.35rem; }
.chat-bubble--theirs { background: #fff; color: #0B2A20; border: 1px solid rgba(11, 42, 32, 0.1); border-bottom-left-radius: 0.35rem; }
.chat-bubble__body { font-size: 0.9rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.chat-bubble__meta { font-size: 0.65rem; margin-top: 0.25rem; opacity: 0.6; font-family: "IBM Plex Mono", monospace; }
.chat-bubble--mine .chat-bubble__meta { text-align: right; }
.chat-empty { margin: auto; color: rgba(11, 42, 32, 0.45); font-size: 0.85rem; }
.chat-compose {
  display: flex; gap: 0.6rem; align-items: flex-end;
  padding: 0.75rem; border-top: 1px solid rgba(11, 42, 32, 0.1); background: #fff;
}
.chat-input {
  flex: 1 1 auto; resize: none; border: 1px solid rgba(11, 42, 32, 0.16);
  border-radius: 0.6rem; padding: 0.55rem 0.7rem; font-size: 0.9rem; font-family: inherit;
}
.chat-input:focus { outline: none; border-color: #2C8462; box-shadow: 0 0 0 3px rgba(44, 132, 98, 0.15); }
.chat-send { align-self: stretch; }

/* Compose pane for a new (not-yet-created) conversation: subject + message. */
.chat-compose--new { flex-direction: column; align-items: stretch; gap: 0.5rem; }
.chat-compose__row { display: flex; gap: 0.6rem; align-items: flex-end; }
.chat-subject {
  border: 1px solid rgba(11, 42, 32, 0.16); border-radius: 0.6rem;
  padding: 0.5rem 0.7rem; font-size: 0.85rem; font-family: inherit; background: #fff;
}
.chat-subject:focus { outline: none; border-color: #2C8462; box-shadow: 0 0 0 3px rgba(44, 132, 98, 0.15); }
.support-side__head .btn.is-active-new { background: #2C8462; }

/* Stack the two panes on small screens. */
@media (max-width: 768px) {
  .support-layout { grid-template-columns: 1fr; height: auto; }
  .support-side { border-right: 0; border-bottom: 1px solid rgba(11, 42, 32, 0.1); }
  .thread-list { max-height: 12rem; }
  .support-main { height: 60vh; }
}

/* ---- Partner / trust bar ---- */
.partner-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 1.25rem 1.5rem;
}
/* A fixed box per logo: wide wordmarks scale down, compact marks scale up, so
   the row reads as one visual weight instead of by raw height. */
.partner-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 9rem; height: 3rem;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.partner-logo:hover { transform: translateY(-1px); }
.partner-logo__img {
  max-height: 100%; max-width: 100%; width: auto; height: auto;
  object-fit: contain; display: block;
}

/* On-dark footer: white monochrome marks, muted to a soft grey. */
.partner-logo--light .partner-logo__img { opacity: 0.5; }
.partner-logo--light:hover .partner-logo__img { opacity: 0.85; }

/* ---- Buyer-company marks (sell side) ---- */
.buyer-logo { display: inline-flex; align-items: center; height: 2.3rem; }
.buyer-logo__img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}
.buyer-logo--onhero { height: 2rem; }
.buyer-logo--onhero .buyer-logo__img { filter: brightness(0) invert(1); }
.buyer-logo__fallback {
  display: none;
  grid-auto-flow: column;
  place-items: center;
  height: 2.3rem;
  padding: 0 0.75rem;
  border-radius: 9999px;
  background: #124433;
  color: #fff;
  font-family: "Space Grotesk", ui-sans-serif, sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
}
.buyer-logo.is-missing .buyer-logo__fallback { display: inline-grid; }

/* ---- Buyer card banner ---- */
.buyer-banner {
  position: relative;
  height: 7rem;
  overflow: hidden;
  isolation: isolate;
}
.buyer-banner__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.buyer-banner__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(11, 42, 32, 0) 35%, rgba(11, 42, 32, 0.55) 100%);
}
.buyer-banner__sector {
  position: absolute; left: 0.75rem; bottom: 0.7rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #fff; background: rgba(11, 42, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.15rem 0.5rem; border-radius: 9999px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}

/* ---- Credit-type marks ----
   ACCU and privileged credits are different instruments and get told apart at a
   glance: a leaf for ordinary ACCU stock, a seal for the privileged allocation. */
.credit-icon {
  display: inline-grid; place-items: center;
  height: 1.9rem; width: 1.9rem; border-radius: 0.6rem;
  flex: none;
}
.credit-icon--accu { background: rgba(44, 132, 98, 0.12); color: #2C8462; }
.credit-icon--priv { background: rgba(231, 198, 135, 0.28); color: #B8892F; }
.credit-icon--sm { height: 1.5rem; width: 1.5rem; border-radius: 0.45rem; }
.credit-icon--onhero { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* ---- Verification-authority marks (home page) ---- */
.authority-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 3rem;
}
.authority-logo__img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}
.authority-logo__fallback {
  display: none;
  font-family: "Space Grotesk", ui-sans-serif, sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: #124433;
}
.authority-logo.is-missing .authority-logo__fallback { display: block; }

/* Small thumbnail tile for documents */
.doc-thumb {
  height: 3rem; width: 3rem; border-radius: 0.5rem; object-fit: cover;
  border: 1px solid rgba(11, 42, 32, 0.12);
}
.doc-tile {
  display: grid; place-items: center; height: 3rem; width: 3rem; border-radius: 0.5rem;
  border: 1px solid rgba(11, 42, 32, 0.12); background: #F1F4EE;
  font-family: "IBM Plex Mono", monospace; font-size: 0.62rem; font-weight: 600; color: #124433;
}

/* ---- Pre-sale ladder (project detail) ----
   Three fixed stages with the buyer's current position marked, so the two-step
   qualification reads as a process rather than a surprise. */
.presale-steps { display: flex; flex-direction: column; gap: 0.15rem; }
.presale-step {
  display: flex; align-items: flex-start; gap: 0.7rem;
  padding: 0.55rem 0.7rem; border-radius: 0.6rem;
  border: 1px solid transparent;
}
.presale-step__n {
  display: grid; place-items: center; flex: none;
  height: 1.5rem; width: 1.5rem; border-radius: 0.5rem;
  background: rgba(11, 42, 32, 0.06); color: rgba(11, 42, 32, 0.45);
  font-size: 0.75rem; font-weight: 700;
}
.presale-step__t { font-size: 0.875rem; font-weight: 600; color: rgba(11, 42, 32, 0.55); }
.presale-step__d { font-size: 0.75rem; color: rgba(11, 42, 32, 0.45); }
.presale-step.is-current {
  background: #EDF6F1; border-color: rgba(44, 132, 98, 0.3);
}
.presale-step.is-current .presale-step__n { background: #2C8462; color: #fff; }
.presale-step.is-current .presale-step__t { color: #0B2A20; }
.presale-step.is-current .presale-step__d { color: rgba(11, 42, 32, 0.65); }
.presale-step.is-done .presale-step__n { background: rgba(44, 132, 98, 0.16); color: #1B6B4E; }
.presale-step.is-done .presale-step__t { color: rgba(11, 42, 32, 0.7); }

/* ---- Admin: pre-sale approval slider ----
   One control spans the whole 2x-30x range; the JS read-out shows the offer
   size and what the buyer will pay as the admin drags. */
.approve-form { width: 17rem; }
.approve-slider {
  width: 100%; height: 1.25rem; cursor: pointer;
  accent-color: #2C8462;
}
