:root {
  --ink: #172022;
  --muted: #627175;
  --line: #dce5e1;
  --paper: #f6f8f3;
  --panel: #ffffff;
  --panel-soft: #eef7f3;
  --deep: #142d2e;
  --teal: #0f8f84;
  --teal-dark: #08645d;
  --coral: #e85d45;
  --amber: #f1a527;
  --blue: #3867d6;
  --green: #2d9b62;
  --red: #c94b38;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(23, 32, 34, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  border: 0;
}

code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f7f4;
  color: #254145;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(219, 226, 223, 0.82);
  background: rgba(247, 248, 244, 0.94);
  backdrop-filter: blur(18px);
}

.topbar.appbar,
.topbar.adminbar {
  background: rgba(255, 255, 255, 0.96);
}

.topbar.adminbar .brand-mark {
  background: linear-gradient(135deg, #172022, #3867d6);
}

.topbar.appbar .brand-mark {
  background: linear-gradient(135deg, var(--teal), #3867d6);
}

.site-banner {
  border-bottom: 1px solid #f4d48e;
  background: #fff5d9;
  color: #705018;
  font-size: 14px;
  font-weight: 800;
}

.site-banner .shell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: conic-gradient(from 170deg, var(--teal), var(--coral), var(--amber), var(--teal));
  box-shadow: 0 10px 24px rgba(15, 143, 132, 0.24);
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.nav-links,
.nav-actions,
.footer-links,
.hero-actions,
.quick-actions,
.admin-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a,
.footer-links a,
.side-links a,
.admin-nav a {
  padding: 8px 10px;
  border-radius: 7px;
  color: #354448;
  font-size: 14px;
  font-weight: 750;
}

.nav-links a:hover,
.nav-links a.active,
.side-links a:hover,
.admin-nav a:hover {
  background: #e8efec;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.language-toggle:hover {
  background: #eef4f1;
}

.button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 7px;
  color: #fff;
  background: var(--teal);
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

.button:hover {
  background: var(--teal-dark);
}

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

.button.disabled:hover,
.button:disabled:hover {
  background: var(--teal);
}

.button.secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

.button.secondary:hover {
  background: #eef4f1;
}

.button.ghost {
  color: var(--ink);
  background: transparent;
}

.button.fill {
  width: 100%;
}

.button.small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 13px;
}

.link-button {
  min-height: auto;
  padding: 0;
  color: var(--teal-dark);
  background: transparent;
}

main {
  min-height: calc(100vh - 150px);
}

section {
  padding: 60px 0;
}

.hero {
  padding: 42px 0 34px;
  background:
    linear-gradient(118deg, rgba(15, 143, 132, 0.11), transparent 42%),
    linear-gradient(295deg, rgba(232, 93, 69, 0.12), transparent 40%),
    var(--paper);
}

.product-hero {
  padding-top: 54px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 248, 243, 0.96)),
    var(--paper);
}

.hero-grid,
.split,
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.8fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 540px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid rgba(15, 143, 132, 0.24);
  border-radius: 999px;
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 850;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(45, 155, 98, 0.13);
}

h1 {
  margin: 18px 0 14px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2,
h3 {
  letter-spacing: 0;
}

.hero-copy p,
.section-head p,
.muted,
.info-panel p,
.feature p,
.legal-doc p,
.legal-doc li {
  color: var(--muted);
}

.hero-copy p {
  max-width: 670px;
  margin: 0;
  font-size: 18px;
}

.product-hero h1 {
  max-width: 760px;
}

.product-hero .hero-copy p {
  max-width: 720px;
}

.hero-actions {
  flex-wrap: wrap;
  margin-top: 30px;
}

.metric-strip,
.cards-3,
.cards-4 {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.metric-strip,
.cards-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric,
.stat-card {
  min-height: 92px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.metric b,
.stat-card b {
  display: block;
  margin-top: 6px;
  font-size: 27px;
  line-height: 1.1;
}

.metric span,
.stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.console,
.info-panel,
.plan,
.feature,
.auth-card,
.sidebar,
.doc-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.console {
  overflow: hidden;
  box-shadow: var(--shadow);
}

.product-panel {
  align-self: center;
}

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

.signal-list div {
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-areas:
    "icon title"
    "icon body";
  gap: 1px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf7;
}

.signal-list span {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 7px;
  color: #fff;
  background: var(--deep);
}

.signal-list strong {
  grid-area: title;
  font-size: 15px;
}

.signal-list small {
  grid-area: body;
  color: var(--muted);
}

.console-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.console-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 850;
}

.console-body.padded,
.info-panel,
.auth-card,
.sidebar {
  padding: 22px;
}

.console-body h2 {
  margin: 0 0 10px;
  font-size: 30px;
}

.notice,
.flash {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 7px;
  color: #285450;
  background: #e3f4ef;
  font-size: 14px;
}

.notice {
  margin-top: 16px;
}

.flash {
  position: sticky;
  top: 78px;
  z-index: 19;
  width: min(720px, calc(100% - 32px));
  margin: 14px auto -24px;
  box-shadow: 0 10px 30px rgba(23, 32, 34, 0.1);
}

.flash.error {
  color: #803224;
  background: #ffe7e1;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-head.compact {
  align-items: start;
  display: grid;
  margin-bottom: 14px;
}

.section-head h1,
.section-head h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.04;
}

.section-head p {
  max-width: 620px;
  margin: 0;
}

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

.plans.single-plan {
  grid-template-columns: minmax(280px, 460px);
}

.plan {
  display: flex;
  flex-direction: column;
  min-height: 430px;
  padding: 22px;
}

.plan.featured {
  border-color: rgba(15, 143, 132, 0.45);
  box-shadow: 0 16px 34px rgba(15, 143, 132, 0.13);
}

.plan-top {
  min-height: 28px;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: #dff2ed;
  font-size: 12px;
  font-weight: 900;
}

.pill.degraded,
.pill.planned,
.pill.pending,
.pill.waiting {
  color: #7a4b03;
  background: #fff2cc;
}

.pill.offline,
.pill.maintenance,
.pill.suspended,
.pill.cancelled,
.pill.error,
.pill.past_due {
  color: #803324;
  background: #ffe3dd;
}

.pill.online,
.pill.active,
.pill.paid,
.pill.open {
  color: #23584d;
  background: #e1f3ec;
}

.plan h3 {
  margin: 18px 0 6px;
  font-size: 24px;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0 0 16px;
}

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

.price span {
  color: var(--muted);
  font-weight: 750;
}

.plan ul {
  display: grid;
  gap: 12px;
  margin: 2px 0 20px;
  padding: 0;
  list-style: none;
}

.plan li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.plan form,
.plan .button {
  margin-top: auto;
}

.band {
  background: #fff;
  border-block: 1px solid var(--line);
}

.node-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.node-table.small {
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

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

th {
  color: #687477;
  background: #f5f7f4;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  color: #2f3b3f;
  font-weight: 650;
}

.split {
  grid-template-columns: 0.94fr 1.06fr;
}

.formula {
  display: grid;
  gap: 10px;
  margin: 16px 0 18px;
  padding: 16px;
  border-radius: 7px;
  color: #fff;
  background: var(--deep);
}

.formula strong {
  font-size: 21px;
}

.feature-grid,
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-features .feature {
  min-height: 142px;
}

.feature {
  display: flex;
  min-height: 118px;
  gap: 13px;
  padding: 16px;
}

.feature > svg,
.feature > i {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--teal);
}

.feature h3 {
  margin: 0 0 5px;
  font-size: 17px;
}

.feature p {
  margin: 0;
  font-size: 14px;
}

.auth-section {
  min-height: calc(100vh - 150px);
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(460px, calc(100% - 28px));
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 42px;
}

.oauth-button {
  margin-bottom: 10px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-switch {
  margin-bottom: 0;
}

.tiny {
  margin: 8px 0 0;
  font-size: 12px;
}

.auth-switch a,
.back-link {
  color: var(--teal-dark);
  font-weight: 850;
}

.form-grid,
.grid-form {
  display: grid;
  gap: 12px;
}

.grid-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 6px;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

textarea {
  padding-block: 10px;
  resize: vertical;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.checkbox-line input {
  width: 16px;
  min-height: 16px;
}

.copy-box {
  overflow-wrap: anywhere;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf7;
}

.copy-box code {
  border: 0;
  padding: 0;
  background: transparent;
}

.qr-panel {
  display: grid;
  place-items: center;
  margin: 12px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.qr-panel img {
  width: min(100%, 260px);
  height: auto;
  image-rendering: pixelated;
}

.steps-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

.dashboard-grid {
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 92px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #fff;
  background: var(--deep);
  font-size: 24px;
  font-weight: 900;
}

.sidebar h2 {
  margin: 14px 0 0;
  font-size: 21px;
}

.sidebar p {
  margin: 5px 0 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.side-links {
  display: grid;
  gap: 4px;
  margin-top: 18px;
}

.side-links a,
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eeea;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--coral));
}

.inline-form,
.table-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table-form {
  flex-wrap: wrap;
}

.table-form input,
.table-form select {
  width: auto;
  min-width: 92px;
}

.table-form textarea {
  width: min(360px, 100%);
}

.plan-edit-form input[name="name"],
.plan-edit-form input[name="stripe_price_id"] {
  min-width: 180px;
}

.table-form.row {
  flex-wrap: nowrap;
}

.admin-nav {
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.big-number {
  margin: 0;
  color: var(--ink);
  font-size: 42px;
  font-weight: 900;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.doc-card {
  display: grid;
  gap: 8px;
  min-height: 134px;
  padding: 18px;
}

.doc-card svg {
  color: var(--teal);
}

.doc-card strong {
  font-size: 18px;
}

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

.legal-doc {
  max-width: 880px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.legal-doc h1 {
  font-size: clamp(34px, 5vw, 54px);
}

.legal-doc h2 {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.legal-doc li {
  margin-bottom: 8px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  max-width: min(440px, calc(100vw - 40px));
  padding: 14px 16px;
  border-radius: 8px;
  color: #fff;
  background: rgba(20, 45, 46, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

footer {
  padding: 28px 0 44px;
  color: #5e6b6e;
  font-size: 14px;
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

@media (max-width: 1000px) {
  .nav-links {
    display: none;
  }

  .hero-grid,
  .split,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: auto;
  }

  .plans,
  .doc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 28px, 1180px);
  }

  .nav {
    min-height: 64px;
  }

  .brand small,
  .nav-actions .secondary,
  .nav-actions .ghost {
    display: none;
  }

  section {
    padding: 42px 0;
  }

  h1 {
    font-size: 42px;
  }

  .metric-strip,
  .cards-3,
  .cards-4,
  .plans,
  .feature-grid,
  .two-col,
  .grid-form,
  .doc-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
  }

  .inline-form,
  .table-form.row {
    display: grid;
  }

  .footer-grid,
  .footer-links {
    align-items: flex-start;
    flex-direction: column;
  }
}
