:root {
  --ink: #17191e;
  --muted: #5c616b;
  --line: #e6e1d6;
  --card: #fff;
  --paper: #f6f3ec;
  --blue: #2c74f6;
  --blue-dark: #1b5ed4;
  --shadow: 0 18px 50px rgba(23, 25, 30, 0.08);
  --sans: "Instrument Sans", "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

body::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #2c74f6 0 25%, #e23b38 25% 50%, #e2a400 50% 75%, #0f9a52 75% 100%);
}

a { color: var(--blue-dark); }

img { display: block; max-width: 100%; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 243, 236, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(23, 25, 30, 0.08);
}

.top, .wrap, .foot-inner { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.logo img { width: 36px; height: 36px; border-radius: 10px; }

.nav { display: flex; align-items: center; gap: 18px; }

.nav a { color: var(--ink); font-weight: 600; text-decoration: none; }

.nav a:hover { color: var(--blue); }

.nav-cta, .button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff !important;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  padding: 11px 18px;
  cursor: pointer;
}

.nav-cta { padding: 9px 16px; }

.button svg { width: 18px; height: 18px; }

.button-xl {
  padding: 16px 22px;
  font-size: 17px;
  box-shadow: 0 12px 28px rgba(44, 116, 246, 0.32);
}

.button.secondary, a.secondary {
  background: transparent;
  color: var(--ink) !important;
  box-shadow: none;
  border: 1px solid rgba(23, 25, 30, 0.18);
}

.button:hover, .nav-cta:hover { background: var(--blue-dark); }

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

.hero .button.secondary {
  color: #f7f4ee !important;
  border-color: rgba(247, 244, 238, 0.35);
}

.hero .button.secondary:hover { background: rgba(255, 255, 255, 0.08); }

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

.hero {
  background:
    radial-gradient(900px 420px at 80% 20%, rgba(44, 116, 246, 0.28), transparent 60%),
    #12151c;
  color: #f7f4ee;
}

.hero-inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  padding: 72px 0 78px;
}

.kicker {
  margin: 0 0 10px;
  color: #8eb6ff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1, .section h2, .cta-band h2, .card h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.hero h1 { font-size: clamp(42px, 5vw, 68px); max-width: 12ch; }

.lede { max-width: 46ch; font-size: 18px; color: #c8c2b6; }

.hero .lede { margin: 18px 0 0; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 28px 0 0; }

.fine { margin: 14px 0 0; color: #9a9488; font-size: 14px; }

.stage { min-width: 0; }

.browser {
  border-radius: 22px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.browser-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 4px 12px;
}

.browser-top i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3a4150;
}

.browser-top span {
  margin-left: 8px;
  color: #9aa3b2;
  font-size: 12px;
}

.side {
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
}

.side-stripe { height: 4px; background: linear-gradient(90deg, #2c74f6 0 25%, #e23b38 25% 50%, #e2a400 50% 75%, #0f9a52 75% 100%); }

.side-head, .side article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.side-head { border-bottom: 1px solid #eee8dc; }

.side-head img { width: 36px; height: 36px; border-radius: 10px; }

.side-head div { flex: 1; min-width: 0; }

.side-head strong, .side article strong { display: block; font-size: 14px; }

.side-head em, .side article span { color: #6d7280; font-style: normal; font-size: 12px; }

.side-head b {
  min-width: 28px;
  padding: 4px 0;
  border-radius: 999px;
  background: #2c74f6;
  color: #fff;
  font-size: 12px;
  text-align: center;
}

.side article { border-top: 1px solid #f1ece3; }

.side article em {
  flex: none;
  color: #1b5ed4;
  font-style: normal;
  font-size: 12px;
  font-weight: 650;
}

.side article em.empty { color: #8b8172; font-weight: 500; }

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

.facts-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  padding: 22px 0;
}

.facts p { margin: 0; }

.facts strong, .facts span { display: block; }

.facts strong { font-size: 15px; }

.facts span { margin-top: 3px; color: var(--muted); font-size: 14px; }

.section { padding: 78px 0; }

.section h2, .cta-band h2 { font-size: clamp(36px, 5vw, 56px); max-width: 16ch; }

.section .kicker { color: var(--blue); }

.section .lede { color: #3e4450; margin-top: 14px; }

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.features article, .plan, .card, .note {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.features h3, .plan h3 { margin: 0 0 8px; font-size: 20px; }

.features p, .plan li, .card p, .note p { color: #3e4450; }

.install { padding-top: 0; }

.install-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 36px;
  align-items: center;
  padding: 28px;
  border-radius: 28px;
  background: #fff;
  border: 1px solid var(--line);
}

.install ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }

.install li { display: flex; gap: 14px; align-items: flex-start; }

.install li span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: #12151c;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.install li p { margin: 2px 0 0; color: var(--muted); }

.install .button { margin-top: 18px; }

.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 28px;
}

.plan { display: flex; flex-direction: column; }

.plan.pro {
  background: #12151c;
  color: #f7f4ee;
  border-color: #12151c;
}

.plan.pro li, .plan.pro p { color: #d9d3c7; }

.plan-flag {
  margin: 0 0 8px;
  color: #8eb6ff !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.price {
  margin: 8px 0 14px;
  font-family: var(--serif);
  font-size: 48px;
  letter-spacing: -0.04em;
}

.plan ul { margin: 0 0 22px; padding-left: 18px; flex: 1; }

.plan-renew { margin: 14px 0 0; font-weight: 400; }

.plan li { margin: 8px 0; }

.plan.pro .button { background: #fff; color: #12151c !important; }

.plan.pro .button:hover { background: #e7e2d8; }

.cta-band {
  background: #12151c;
  color: #f7f4ee;
  text-align: center;
}

.cta-band .wrap { padding: 72px 0; }

.cta-band h2, .cta-band p { margin-left: auto; margin-right: auto; }

.cta-band p { max-width: 42ch; color: #c8c2b6; font-size: 18px; }

.cta-band .button { margin-top: 8px; }

.card { max-width: 460px; margin: 36px auto 56px; }

.card h1 { font-size: 42px; margin-bottom: 8px; }

form.stack { display: grid; gap: 12px; margin-top: 16px; }

label { display: grid; gap: 4px; font-size: 13px; font-weight: 650; color: var(--muted); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
form.stack select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  box-sizing: border-box;
}

form.stack select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23666' d='M4.5 6.5L8 10l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

input:focus, form.stack select:focus { outline: 2px solid #d7e4ff; border-color: var(--blue); }

.alert, .ok { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; }

.alert { background: #fde8e7; color: #9b1c1c; }

.ok { background: #e7f6ee; color: #0d5c32; }

.label-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.saved-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e7f6ee;
  color: #0d5c32;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.stripe-badge-bad {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fde8e7;
  color: #9b1c1c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.admin-stripe-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 16px;
  align-items: start;
  max-width: 1100px;
}

.admin-stripe-side {
  display: grid;
  gap: 16px;
}

.admin-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.admin-box h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.admin-stat-number {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 48px;
  line-height: 1;
  color: var(--ink);
}

.admin-sub-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.admin-sub-split > div {
  padding: 12px;
  border-radius: 14px;
  background: #f7f5f0;
}

.admin-sub-split > div:first-child {
  background: #e7f6ee;
}

.admin-sub-split > div:last-child {
  background: #fff7e6;
}

.admin-sub-split .admin-stat-number {
  font-size: 36px;
}

.admin-sub-split p {
  margin: 0;
  font-size: 14px;
}

.admin-renewal {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef3ff;
  color: #1e3a6e;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 1100px;
}

.admin-kpi {
  display: grid;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease;
}

.admin-kpi:hover {
  border-color: #c5ccd8;
  transform: translateY(-1px);
}

.admin-kpi-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}

.admin-kpi-value {
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1;
  color: var(--ink);
}

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

.admin-kpi-ok {
  background: #e7f6ee;
  border-color: #b7e0c5;
}

.admin-kpi-warn {
  background: #fff7e6;
  border-color: #f0d9a8;
}

.admin-kpi-bad {
  background: #fde8e7;
  border-color: #f0bdb9;
}

@media (max-width: 900px) {
  .admin-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .admin-kpi-grid { grid-template-columns: 1fr; }
}

.stripe-status {
  border: 1px solid var(--line);
  background: #f7f5f0;
}

.stripe-status.is-ok {
  background: #e7f6ee;
  border-color: #b7e0c5;
}

.stripe-status.is-warn {
  background: #fff7e6;
  border-color: #f0d9a8;
}

.stripe-status.is-bad {
  background: #fde8e7;
  border-color: #f0bdb9;
}

.stripe-status-line {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.stripe-price-facts {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.stripe-price-facts li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.stripe-price-facts strong {
  min-width: 72px;
  color: var(--muted);
  font-weight: 650;
}

.usage { height: 8px; border-radius: 999px; background: #ece7de; overflow: hidden; margin: 8px 0 4px; }

.usage span { display: block; height: 100%; background: var(--blue); }

.account-page { padding: 36px 0 8px; }

.account-page h2 { font-size: 42px; max-width: none; }

.account-page .lede { margin-top: 8px; }

.account-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: start;
  gap: 14px;
  margin: 18px 0 24px;
}

.account-page .plan ul { flex: none; }

.danger-zone {
  max-width: 860px;
  margin: 0 0 48px;
  border-color: #f0c7c4;
}

.danger-zone h3 { color: #9b1c1c; }

.delete-form { max-width: 420px; margin-top: 12px; }

.check-delete {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.check-delete input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: none;
}

.button.danger {
  background: #fc413d;
  color: #fff !important;
}

.button.danger:hover { background: #e03632; }

.admin-page { padding: 28px 0 8px; }

.admin-page h1 { margin: 0 0 12px; font-family: var(--serif); font-size: 42px; font-weight: 400; }

.admin-page h2 { margin: 0 0 12px; font-size: 24px; }

.admin-page form.stack label {
  font-weight: 400;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.admin-tabs a {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
}

.admin-tabs a[aria-current="page"] {
  background: #12151c;
  border-color: #12151c;
  color: #fff;
}

.admin-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  align-items: center;
}

.admin-search input[type="search"] {
  flex: 1;
  min-width: 220px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.admin-filter select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  min-width: 160px;
}

.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;
}

.admin-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f8fa;
}

.admin-bulk-count {
  margin-right: 4px;
  min-width: 110px;
}

.admin-check-col {
  width: 36px;
}

.admin-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.admin-check input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.admin-table-wrap {
  overflow-x: auto;
  margin: 12px 0;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.admin-table th a {
  color: inherit;
  text-decoration: none;
}

.admin-table th a:hover,
.admin-table th.is-sorted a {
  color: var(--ink);
}

.admin-plan-form {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.gift-dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  width: min(420px, calc(100vw - 32px));
  box-shadow: 0 18px 50px rgba(18, 21, 28, 0.18);
}

.gift-dialog::backdrop {
  background: rgba(18, 21, 28, 0.42);
}

.gift-dialog-form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.gift-dialog-form h3 {
  margin: 0;
  font-size: 22px;
}

.gift-dialog-form p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.gift-dialog-label {
  display: grid;
  gap: 6px;
  font-weight: 650;
}

.gift-dialog-label input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.gift-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.admin-pager a { font-weight: 650; }

.muted { color: var(--muted); }

.foot { padding: 8px 0 28px; color: var(--muted); font-size: 14px; }

.foot-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.foot p { margin: 6px 0; }

.foot a { margin-right: 14px; color: var(--muted); }

.honeypot { position: absolute; left: -9999px; }

@media (max-width: 900px) {
  .hero-inner, .facts-row, .features, .install-grid, .plans, .account-grid, .admin-stripe-grid { grid-template-columns: 1fr; }
  .hero-inner { padding: 48px 0 56px; }
  .hero h1 { max-width: none; }
  .nav { gap: 12px; }
}

@media (max-width: 560px) {
  .nav-plans { display: none; }
  .top { flex-wrap: wrap; align-items: center; min-height: 64px; padding: 10px 0; }
  .nav { gap: 12px; margin-left: auto; }
  .top, .wrap, .foot-inner, .hero-inner { width: min(1120px, calc(100% - 28px)); }
}
