:root {
  color-scheme: light;
  --ink: #101410;
  --muted: #64736a;
  --line: #dae5de;
  --soft: #f5fff7;
  --surface: #ffffff;
  --cream: #fff7ea;
  --primary: #11e852;
  --primary-deep: #087a35;
  --teal: #096b68;
  --aqua: #2ec4b6;
  --sky: #2d9cdb;
  --coral: #ff5b4a;
  --gold: #f5b833;
  --danger: #c9372c;
  --shadow: 0 20px 60px rgba(16, 20, 16, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f7faf8;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f7faf8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.page-muted {
  background: linear-gradient(180deg, #ffffff 0%, #f7faf8 46%, #eef7f0 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 78px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  border-bottom: 1px solid rgba(218, 229, 222, 0.9);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  padding: 0 max(22px, calc((100vw - 1180px) / 2));
}

.brand {
  display: inline-grid;
  grid-template-columns: 46px auto;
  gap: 11px;
  align-items: center;
  color: var(--ink);
  font-size: 20px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
}

.brand img {
  width: 46px;
  height: 46px;
  display: block;
  border-radius: 8px;
  box-shadow: 0 9px 22px rgba(16, 20, 16, 0.14);
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.main-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  color: #45564c;
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--ink);
  background: var(--soft);
}

.header-actions,
.hero-actions,
.form-actions,
.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 15px;
  color: var(--ink);
  font-weight: 820;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  border-color: #0bc847;
  background: var(--primary);
  color: #062b13;
}

.button.ghost {
  border-color: #ccdcd2;
  background: #ffffff;
}

.button.large {
  min-height: 50px;
  padding: 0 19px;
}

.button.mini {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.button.full {
  width: 100%;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.user-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #d7e3dc;
  border-radius: 8px;
  background: #ffffff;
  padding: 0 11px;
  color: #35473d;
  font-size: 13px;
  font-weight: 760;
}

main {
  overflow: hidden;
}

.business-hero {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.74fr);
  gap: 40px;
  align-items: center;
  width: min(1180px, calc(100vw - 44px));
  margin: 0 auto;
  padding: 52px 0 64px;
}

.hero-content {
  display: grid;
  gap: 22px;
}

.eyebrow {
  margin: 0;
  color: var(--primary-deep);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 820px;
  font-size: 64px;
  line-height: 0.96;
}

h2 {
  margin: 0;
  font-size: 33px;
  line-height: 1.08;
}

h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.18;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero-copy {
  max-width: 660px;
  font-size: 19px;
}

.proof-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 0;
}

.proof-row div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 13px 14px;
}

.proof-row dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.proof-row dd {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 900;
}

.hero-product {
  position: relative;
  min-height: 540px;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 1px solid #d6e4db;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(9, 107, 104, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(9, 107, 104, 0.06) 1px, transparent 1px),
    #fbfffc;
  background-size: 44px 44px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-product::before,
.hero-product::after {
  content: "";
  position: absolute;
  width: 390px;
  height: 390px;
  border: 2px dashed rgba(8, 122, 53, 0.28);
  border-radius: 999px;
}

.hero-product::after {
  width: 250px;
  height: 250px;
  border-color: rgba(45, 156, 219, 0.25);
}

.hero-logo {
  position: absolute;
  left: 34px;
  top: 34px;
  width: 82px;
  height: 82px;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(16, 20, 16, 0.16);
}

.campaign-preview {
  position: relative;
  width: min(84%, 360px);
  display: grid;
  gap: 14px;
  border: 1px solid #dbe8e0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 22px;
  box-shadow: 0 18px 50px rgba(16, 20, 16, 0.14);
}

.preview-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #314239;
  font-size: 13px;
  font-weight: 850;
}

.live-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(17, 232, 82, 0.14);
}

.preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.preview-tags span,
.badge {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #26362d;
  background: #eef5f1;
  font-size: 12px;
  font-weight: 820;
}

.badge.good {
  color: #073d1b;
  background: #ceffdd;
}

.badge.warning {
  color: #463200;
  background: #ffe9ad;
}

.badge.danger {
  color: #4f1711;
  background: #ffe0dc;
}

.credit-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eee9;
}

.credit-meter span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--aqua));
}

.campaign-preview small {
  color: var(--muted);
  font-weight: 720;
}

.section {
  width: min(1180px, calc(100vw - 44px));
  margin: 0 auto;
  padding: 74px 0;
}

.band {
  width: 100%;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding-left: max(22px, calc((100vw - 1180px) / 2));
  padding-right: max(22px, calc((100vw - 1180px) / 2));
}

.section-head {
  display: grid;
  gap: 9px;
  max-width: 760px;
  margin-bottom: 24px;
}

.feature-grid,
.pricing-grid,
.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.feature-card,
.price-card,
.panel,
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feature-card,
.price-card {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.feature-icon.teal {
  background: var(--teal);
}

.feature-icon.gold {
  background: var(--gold);
}

.feature-icon.coral {
  background: var(--coral);
}

.feature-icon.blue {
  background: var(--sky);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(340px, 1fr);
  gap: 46px;
  align-items: start;
}

.two-column > div:first-child {
  display: grid;
  gap: 14px;
}

.audience-list,
.role-list {
  display: grid;
  gap: 10px;
}

.audience-list div,
.role-list div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.audience-list span,
.role-list span {
  color: var(--muted);
  line-height: 1.4;
}

.organization-layout {
  width: min(1180px, calc(100vw - 44px));
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin: 0 auto 28px;
}

.organization-list {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 130px);
  overflow: auto;
}

.organization-links {
  display: grid;
  gap: 8px;
}

.organization-links a {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  text-decoration: none;
}

.organization-links a.is-active,
.organization-links a:hover {
  border-color: #b9dec5;
  background: var(--soft);
}

.organization-links span {
  color: var(--muted);
  font-size: 13px;
}

.organization-detail {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.company-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.info-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.info-list div {
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid #edf2ef;
  padding-bottom: 10px;
}

.info-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.info-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.info-list dd {
  min-width: 0;
  margin: 0;
  color: #25352d;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.pricing {
  border-top: 1px solid var(--line);
}

.price-card strong {
  font-size: 30px;
  line-height: 1;
}

.price {
  color: var(--teal);
  font-size: 22px;
  font-weight: 900;
}

.cta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border: 1px solid #cce4d3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 30px;
  margin-bottom: 64px;
}

.form-page,
.auth-page,
.portal-hero,
.metric-row,
.portal-grid,
.table-section,
.table-grid {
  width: min(1180px, calc(100vw - 44px));
  margin: 0 auto;
}

.form-page {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(460px, 1fr);
  gap: 34px;
  align-items: start;
  padding: 58px 0 76px;
}

.form-intro {
  position: sticky;
  top: 110px;
  display: grid;
  gap: 15px;
}

.form-intro h1,
.auth-card h1,
.portal-hero h1 {
  font-size: 46px;
  line-height: 1;
}

.panel {
  padding: 22px;
}

.form {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.form label span,
.auth-card label span {
  color: #3f5047;
  font-size: 12px;
  font-weight: 850;
}

.form-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #cfded5;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
  padding: 0 12px;
}

textarea {
  min-height: 112px;
  padding-top: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-deep);
  box-shadow: 0 0 0 4px rgba(17, 232, 82, 0.17);
}

.wide {
  grid-column: 1 / -1;
}

.check-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: #3f5047;
  line-height: 1.4;
}

.check-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--primary-deep);
}

.auth-page {
  min-height: calc(100vh - 78px);
  display: grid;
  place-items: center;
  padding: 52px 0;
}

.auth-card {
  width: min(100%, 440px);
  display: grid;
  gap: 16px;
  text-align: center;
}

.auth-card img {
  width: 78px;
  height: 78px;
  justify-self: center;
  border-radius: 18px;
}

.auth-card label {
  display: grid;
  gap: 6px;
  text-align: left;
}

.text-link {
  color: var(--teal);
  font-weight: 820;
  text-decoration: none;
}

.alert,
.flash {
  border-radius: 8px;
  padding: 12px 14px;
  line-height: 1.4;
}

.alert.error,
.flash.error {
  border: 1px solid #ffc2bb;
  background: #fff0ee;
  color: #681d16;
}

.flash.success {
  border: 1px solid #b9edc7;
  background: #e6ffed;
  color: #063d1a;
}

.flash.info {
  border: 1px solid #cbdceb;
  background: #eef7ff;
  color: #173952;
}

.impersonation-bar {
  position: sticky;
  top: 78px;
  z-index: 19;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-bottom: 1px solid #f4c15c;
  background: #fff0bf;
  color: #3d2a00;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 820;
}

.impersonation-bar form {
  margin: 0;
}

.alert ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.flash-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 36px));
}

.portal-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 42px 0 22px;
}

.portal-hero > div:first-child {
  display: grid;
  gap: 9px;
}

.portal-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metric-row {
  margin-bottom: 18px;
}

.metric {
  display: grid;
  gap: 4px;
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.metric strong {
  font-size: 30px;
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.users-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.85fr);
}

.panel-head {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.panel-head.spaced {
  margin-top: 26px;
}

.package-list {
  display: grid;
  gap: 10px;
}

.package-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.package-row div {
  display: grid;
  gap: 3px;
}

.package-row span {
  color: var(--muted);
  font-size: 13px;
}

.compact-form {
  gap: 12px;
}

.table-section,
.table-grid {
  margin-bottom: 18px;
}

.table-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 0;
}

.table-section .panel-head {
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  padding: 18px 20px;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.table-wrap.small table {
  min-width: 560px;
}

th,
td {
  border-bottom: 1px solid #edf2ef;
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #46574d;
  background: #fbfdfb;
  font-size: 12px;
  font-weight: 900;
}

td {
  color: #27372f;
  font-size: 14px;
}

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

.muted {
  color: var(--muted);
  font-size: 13px;
}

.site-footer {
  width: min(1180px, calc(100vw - 44px));
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  margin: 48px auto 0;
  padding: 26px 0 34px;
  color: var(--muted);
}

.site-footer div:first-child {
  display: grid;
  gap: 4px;
}

.site-footer strong {
  color: var(--ink);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  color: var(--teal);
  font-weight: 780;
  text-decoration: none;
}

@media (max-width: 1020px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 18px;
  }

  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .business-hero,
  .form-page,
  .portal-grid,
  .table-grid,
  .two-column,
  .organization-layout,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .organization-list {
    position: static;
    max-height: none;
  }

  .business-hero {
    min-height: 0;
    padding-top: 34px;
  }

  .form-intro {
    position: static;
  }

  .feature-grid,
  .pricing-grid,
  .metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 660px) {
  .business-hero,
  .section,
  .form-page,
  .auth-page,
  .portal-hero,
  .metric-row,
  .portal-grid,
  .table-section,
  .table-grid,
  .site-footer {
    width: min(100% - 28px, 1180px);
  }

  h1,
  .form-intro h1,
  .auth-card h1,
  .portal-hero h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 26px;
  }

  .feature-grid,
  .pricing-grid,
  .metric-row,
  .form-grid,
  .proof-row {
    grid-template-columns: 1fr;
  }

  .hero-product {
    min-height: 430px;
  }

  .portal-hero,
  .company-identity,
  .cta-strip,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand span {
    font-size: 18px;
  }

  .package-row {
    align-items: stretch;
    flex-direction: column;
  }
}
