@font-face {
  font-family: "BlenderPro-Bold";
  src: url("/fonts/BlenderPro-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Roboto-Regular";
  src: url("/fonts/Roboto-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Roboto-Bold";
  src: url("/fonts/Roboto-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Sora";
  src: url("/fonts/Sora-Latin-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --page-bg: #edf1f5;
  --surface: #ffffff;
  --surface-muted: #f5f7fa;
  --surface-soft: #f1f4f8;
  --surface-tint: #eef4fb;
  --surface-tint-strong: #d6e1ed;
  --ink: #394150;
  --ink-strong: #2f3b4e;
  --copy: #5d6573;
  --muted: #6c7380;
  --line: rgba(57, 65, 80, 0.14);
  --line-strong: rgba(57, 65, 80, 0.22);
  --brand: #0b2a4f;
  --brand-900: #163f68;
  --brand-850: #1d4b77;
  --brand-700: #2f6697;
  --brand-soft: rgba(11, 42, 79, 0.08);
  --brand-border: rgba(11, 42, 79, 0.16);
  --success: #2d8a57;
  --success-strong: #17623d;
  --success-border: rgba(45, 138, 87, 0.34);
  --success-soft: #e9f7ef;
  --warning-soft: #fff5c7;
  --danger: #c24040;
  --danger-soft: rgba(194, 64, 64, 0.12);
  --shell-max: 1320px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--page-bg);
  color: var(--ink);
  font-family: "Roboto-Regular", "Segoe UI", system-ui, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--brand-850);
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(11, 42, 79, 0.28);
  outline-offset: 3px;
}

.app-shell {
  width: min(var(--shell-max), calc(100vw - 2rem));
  max-width: none;
  margin-inline: auto;
  padding-inline: 0;
}

body > .app-shell {
  flex: 1;
}

.pool-nav {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.pool-nav__inner {
  display: flex;
  min-height: 5.4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pool-nav--public {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 0;
  backdrop-filter: blur(16px);
}

.pool-nav--public .pool-nav__inner {
  justify-content: center;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink-strong);
  font-family: "BlenderPro-Bold", sans-serif;
  font-size: 1.35rem;
  line-height: 1;
}

.brand-logo {
  width: clamp(10.5rem, 18vw, 15.5rem);
  height: auto;
}

.brand-mark {
  width: 1.2rem;
  height: 1.2rem;
  display: inline-block;
  background:
    linear-gradient(135deg, var(--brand) 0 48%, transparent 48% 55%, var(--brand-700) 55% 100%);
  border: 1px solid var(--brand-border);
}

.public-nav-spacer {
  display: none;
}

.nav-link {
  color: var(--copy);
  font-family: "Roboto-Bold", sans-serif;
}

.nav-link:hover {
  color: var(--brand);
}

.public-shell {
  width: 100%;
  max-width: none;
}

.public-shell main {
  padding-bottom: 0 !important;
}

.page-kicker {
  margin: 0 0 0.7rem;
  color: var(--brand-850);
  font-family: "Roboto-Bold", sans-serif;
  font-size: 0.78rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  max-width: 58rem;
  color: var(--ink-strong);
  font-family: "BlenderPro-Bold", sans-serif;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.94;
}

.button,
.btn-primary {
  display: inline-flex;
  min-height: 3.1rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.82rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(11, 42, 79, 0.14);
  font-family: "Roboto-Bold", sans-serif;
  line-height: 1;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.button:hover,
.button:focus-visible,
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--brand-850);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(11, 42, 79, 0.18);
  transform: translateY(-1px);
}

.btn-quiet {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-strong);
  font-family: "Roboto-Bold", sans-serif;
}

.share-hero {
  width: min(48rem, calc(100vw - 2rem));
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 8rem) 0 clamp(4rem, 9vw, 7rem);
}

.share-hero.compact {
  display: grid;
  min-height: calc(100svh - 14rem);
  place-items: center;
}

.share-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  justify-items: center;
}

.share-copy {
  display: grid;
  justify-items: center;
  gap: 1.05rem;
  max-width: 42rem;
  text-align: center;
}

.share-copy h1,
.result-panel h1,
.config-title {
  margin: 0;
  color: var(--ink-strong);
  font-family: "BlenderPro-Bold", sans-serif;
  letter-spacing: 0;
}

.share-copy h1 {
  max-width: 12ch;
  font-size: clamp(2.65rem, 7vw, 4.9rem);
  line-height: 0.96;
}

.share-copy p {
  max-width: 36rem;
  margin: 0;
  color: var(--copy);
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  line-height: 1.68;
}

.share-copy .share-lead {
  color: var(--ink);
  font-family: "Roboto-Bold", sans-serif;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  padding-top: 0.6rem;
}

.share-cta {
  min-height: 3.45rem;
  padding-inline: 1.55rem;
  font-size: 1.05rem;
}

.share-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.3rem 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.4;
  list-style: none;
}

.share-points li {
  display: inline-flex;
  align-items: center;
}

.share-points li + li::before {
  content: "";
  width: 0.25rem;
  height: 0.25rem;
  margin-right: 0.75rem;
  border-radius: 50%;
  background: var(--line-strong);
}

.public-panel {
  width: min(46rem, 100%);
  padding: clamp(1.6rem, 4vw, 2.75rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 20px 48px rgba(18, 30, 64, 0.1);
}

.result-panel {
  display: grid;
  gap: 1rem;
}

.result-panel h1,
.config-title {
  font-size: clamp(3rem, 7vw, 6.2rem);
  line-height: 0.88;
}

.result-panel p {
  margin: 0;
  color: var(--copy);
  font-size: 1.08rem;
  line-height: 1.65;
}

.result-panel code {
  color: var(--brand);
  overflow-wrap: anywhere;
}

.device-panel {
  justify-items: center;
  text-align: center;
}

.device-panel h1 {
  max-width: 11ch;
  font-size: clamp(2.35rem, 4.5vw, 3.7rem);
  line-height: 0.98;
}

.device-code {
  width: min(100%, 25rem);
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink-strong);
  font-family: "Sora", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(1.65rem, 6vw, 2.7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.device-steps {
  display: grid;
  width: min(100%, 34rem);
  gap: 0;
  margin-top: 0.35rem;
  border-block: 1px solid var(--line);
}

.device-step {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  padding: 1.35rem 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    border-color 180ms ease;
}

.device-step + .device-step {
  border-top: 1px solid var(--line);
}

.device-step__head {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
}

.device-step__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.65rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--copy);
  font-family: "Roboto-Bold", sans-serif;
  font-size: 0.76rem;
  line-height: 1;
}

.device-step h2 {
  margin: 0;
  color: var(--ink-strong);
  font-family: "Roboto-Bold", sans-serif;
  font-size: 1.08rem;
  line-height: 1.25;
}

.device-step p {
  max-width: 26rem;
  margin: 0;
  color: var(--copy);
  font-size: 0.98rem;
  line-height: 1.5;
}

.device-step--active .device-step__index {
  border-color: var(--brand-border);
  background: var(--brand-soft);
  color: var(--brand);
}

.device-step--done .device-step__index {
  border-color: var(--success-border);
  background: var(--success-soft);
  color: var(--success-strong);
}

.device-step--done .device-copy,
.device-step--done .device-copy:hover,
.device-step--done .device-copy:focus-visible {
  border-color: var(--success);
  background: var(--success);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(45, 138, 87, 0.18);
}

.device-step--locked {
  opacity: 0.48;
}

.device-step--locked .device-open {
  pointer-events: none;
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  box-shadow: none;
  transform: none;
}

.device-step--active .device-open {
  background: var(--brand);
}

.device-copy {
  min-height: 3.1rem;
  padding: 0.8rem 1.2rem;
}

.device-open {
  min-height: 3.1rem;
  padding-inline: 1.25rem;
}

.device-status {
  color: var(--ink-strong) !important;
  font-family: "Roboto-Bold", sans-serif;
}

.device-expiry {
  color: var(--muted) !important;
  font-size: 0.94rem !important;
}

.device-panel--complete {
  padding: clamp(1.4rem, 4vw, 2.5rem);
  border-color: var(--success-border);
  background: var(--success-soft);
  box-shadow: 0 20px 48px rgba(45, 138, 87, 0.13);
}

.device-success-alert {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  max-width: 34rem;
  color: var(--success-strong);
  text-align: center;
}

.device-success-alert__mark {
  display: inline-grid;
  width: 3.1rem;
  height: 3.1rem;
  place-items: center;
  border-radius: 50%;
  background: var(--success);
  color: #ffffff;
  font-family: "Roboto-Bold", sans-serif;
  font-size: 1.6rem;
  line-height: 1;
}

.device-success-alert h1 {
  margin: 0;
  color: var(--success-strong);
  font-family: "BlenderPro-Bold", sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 0.95;
}

.device-success-alert p {
  margin: 0;
  color: var(--success-strong);
  font-family: "Roboto-Bold", sans-serif;
  font-size: clamp(1rem, 1.2vw, 1.14rem);
  line-height: 1.55;
}

.result-success {
  border-color: rgba(45, 138, 87, 0.28);
}

.result-error {
  border-color: rgba(194, 64, 64, 0.28);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 0.85rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(8.75rem, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric {
  min-height: 4.35rem;
  padding: 0.7rem 0.85rem;
}

.metric-value {
  display: block;
  color: var(--ink-strong);
  font-family: "Sora", sans-serif;
  font-size: 1.72rem;
  font-weight: 800;
  line-height: 1;
}

.metric-label {
  display: block;
  margin-top: 0.28rem;
  color: var(--copy);
  font-family: "Roboto-Bold", sans-serif;
  font-size: 0.9rem;
}

.panel {
  overflow: hidden;
}

.page-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  color: var(--ink-strong);
  font-family: "Roboto-Bold", sans-serif;
  font-size: 1.08rem;
}

.stack {
  display: grid;
  gap: 1.1rem;
}

.dashboard-stack {
  display: grid;
  gap: 0.75rem;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(19rem, 0.75fr);
  gap: 1.1rem;
  align-items: start;
}

.secondary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.split-grid > * {
  min-width: 0;
}

.table-pool {
  margin: 0;
  vertical-align: middle;
}

.table-pool th {
  color: var(--copy);
  font-size: 0.68rem;
  font-family: "Roboto-Bold", sans-serif;
  text-transform: uppercase;
}

.table-pool td,
.table-pool th {
  border-color: var(--line);
  padding: 0.42rem 0.55rem;
  line-height: 1.12;
}

.status-pill {
  display: inline-flex;
  min-width: 5.2rem;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-family: "Roboto-Bold", sans-serif;
}

.status-available {
  background: var(--success-soft);
  color: #13663b;
}

.status-leased,
.status-unknown {
  background: var(--surface-tint-strong);
  color: var(--brand);
}

.status-exhausted5h,
.status-exhaustedweekly {
  background: var(--warning-soft);
  color: #8a6400;
}

.status-invalid,
.status-revoked,
.status-disabled {
  background: var(--danger-soft);
  color: var(--danger);
}

.capacity-cell {
  min-width: 8.25rem;
  font-variant-numeric: tabular-nums;
  font-family: "Roboto-Bold", sans-serif;
}

.accounts-table {
  width: 100%;
  min-width: 82rem;
  table-layout: fixed;
}

.accounts-table td,
.accounts-table th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accounts-table .col-label {
  width: 16%;
}

.accounts-table .col-company {
  width: 16%;
}

.accounts-table .col-donor {
  width: 17%;
}

.accounts-table .col-status {
  width: 8%;
}

.accounts-table .col-capacity {
  width: 11%;
}

.accounts-table .col-polled {
  width: 8%;
}

.accounts-table .col-actions {
  width: 13%;
}

.company-cell,
.capacity-cell,
.actions-cell {
  overflow: visible !important;
}

.cell-ellipsis {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0.35rem;
  white-space: nowrap;
}

.row-actions form {
  margin: 0;
}

.inline-company-form {
  display: grid;
  grid-template-columns: minmax(7.5rem, 1fr) auto;
  gap: 0.28rem;
  align-items: center;
  min-width: 12.5rem;
}

.inline-company-form .form-control {
  min-width: 0;
  height: 1.8rem;
  padding-block: 0.15rem;
  font-size: 0.82rem;
}

.inline-company-form .btn,
.row-actions .btn {
  padding: 0.24rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.1;
}

.limit-meter {
  display: grid;
  grid-template-columns: minmax(3.6rem, 1fr) auto;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
}

.limit-track {
  display: block;
  height: 0.46rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e9edf2;
}

.limit-fill {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.limit-low .limit-fill {
  background: #d69b18;
}

.limit-critical .limit-fill {
  background: var(--danger);
}

.limit-unknown .limit-fill {
  background: #a8b1bd;
}

.limit-value {
  min-width: 4.1rem;
  color: var(--ink-strong);
  font-size: 0.78rem;
  text-align: right;
}

.subtle {
  color: var(--muted);
  font-size: 0.9rem;
}

.form-panel {
  max-width: 47.5rem;
  padding: 1.5rem;
}

.form-label {
  color: var(--ink-strong);
  font-family: "Roboto-Bold", sans-serif;
}

.form-control {
  border-color: var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-control:focus,
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus {
  border-color: var(--brand-700);
  box-shadow: 0 0 0 0.2rem rgba(47, 102, 151, 0.2);
}

.btn-danger {
  font-family: "Roboto-Bold", sans-serif;
}

.alert {
  border-radius: 8px;
}

.empty-row {
  padding: 2.1rem 1.25rem;
  color: var(--muted);
  text-align: center;
}

.footer {
  width: 100%;
  margin-top: 2.5rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.footer--public {
  margin-top: 0;
  background: #ffffff;
  color: var(--copy);
}

.footer--public .app-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3rem;
}

@media (max-width: 1040px) {
  .summary-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .pool-nav__inner {
    min-height: 4.7rem;
  }

  .share-hero {
    width: min(100%, calc(100vw - 2rem));
    padding-top: 3.5rem;
  }

  .share-copy h1 {
    max-width: 11ch;
    font-size: clamp(2.45rem, 12vw, 3.55rem);
  }

  .share-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .share-cta {
    width: 100%;
  }

  .share-points {
    display: grid;
    gap: 0.42rem;
  }

  .share-points li + li::before {
    display: none;
  }

  .page-head {
    display: grid;
    align-items: start;
  }

  .page-actions,
  .form-actions,
  .form-grid {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .page-actions .btn,
  .form-actions .btn {
    width: 100%;
  }

  .table-pool {
    min-width: 60rem;
  }
}
