:root {
  --bg: #f2f6f4;
  --panel: #ffffff;
  --text: #15201a;
  --muted: #647067;
  --line: #d8e4dd;
  --green: #16835f;
  --green-dark: #0d6048;
  --green-soft: #e4f6ee;
  --blue: #2867c9;
  --amber: #b7791f;
  --red: #c43b3b;
  --shadow: 0 18px 48px rgba(22, 45, 36, 0.11);
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html,
body {
  margin: 0;
  overflow-x: hidden;
}

body {
  color: var(--text);
  background: var(--bg);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

button,
input,
select,
textarea {
  max-width: 100%;
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(216, 228, 221, 0.86);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.brand,
.site-nav,
.site-footer,
.hero-actions,
.hero-metrics,
.section-title,
.dash-head,
.price-head,
.inline-form,
.form-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-size: 19px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 3px solid #9ccbb7;
  border-radius: 50%;
  color: var(--green-dark);
  background: var(--green-soft);
}

.site-nav {
  gap: 18px;
  flex-wrap: wrap;
  color: #26372e;
  font-weight: 700;
}

.site-nav form {
  margin: 0;
}

.site-nav button {
  border: 0;
  background: transparent;
  color: #26372e;
  cursor: pointer;
  font-weight: 700;
}

.nav-cta {
  padding: 8px 13px;
  border-radius: 8px;
  color: #fff;
  background: #15201a;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(380px, 0.98fr);
  gap: 44px;
  align-items: center;
  padding: 76px clamp(18px, 6vw, 86px) 58px;
  background:
    linear-gradient(115deg, rgba(228, 246, 238, 0.9), rgba(255, 255, 255, 0) 44%),
    radial-gradient(circle at 90% 12%, rgba(40, 103, 201, 0.12), transparent 34%);
}

.hero h1 {
  max-width: 720px;
  margin: 12px 0 18px;
  font-size: clamp(38px, 4.8vw, 62px);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow {
  display: inline-flex;
  padding: 4px 10px;
  border: 1px solid #b9dacb;
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(228, 246, 238, 0.86);
  font-weight: 800;
}

.hero-actions {
  gap: 12px;
  flex-wrap: wrap;
  margin: 28px 0 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #1f2e25;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.btn.primary {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.btn.primary:hover {
  background: var(--green-dark);
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 24, 18, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.support-modal {
  position: relative;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.support-modal h2 {
  margin: 12px 0 8px;
  font-size: 28px;
}

.support-modal p {
  margin: 0 auto 16px;
  color: var(--muted);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 22px;
}

.support-qr {
  display: block;
  width: min(260px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.support-placeholder {
  display: grid;
  place-items: center;
  width: min(260px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px dashed #b9dacb;
  border-radius: 10px;
  color: var(--muted);
  background: #f8fbf9;
}

.hero-metrics {
  gap: 10px;
  flex-wrap: wrap;
}

.hero-metrics div {
  min-width: 130px;
  padding: 12px 14px;
  border: 1px solid rgba(216, 228, 221, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.hero-metrics strong,
.hero-metrics span {
  display: block;
}

.hero-metrics strong {
  font-size: 24px;
}

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

.hero-visual {
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(188, 211, 198, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.hero-visual img {
  display: block;
  width: 100%;
  border-radius: 10px;
}

.section,
.dashboard {
  padding: 54px clamp(18px, 5vw, 72px);
}

.section-title {
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.section-title h2,
.dash-head h1,
.auth-card h1 {
  margin: 8px 0 0;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.feature-grid,
.price-grid,
.flow-grid,
.dash-grid,
.help-grid,
.referral-benefits,
.referral-layout,
.referral-summary,
.admin-plan-grid,
.limit-grid {
  display: grid;
  gap: 16px;
}

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

.feature-card,
.price-card,
.panel,
.auth-card,
.flow-grid div,
.help-card,
.referral-card,
.contact {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 8px 26px rgba(22, 45, 36, 0.05);
}

.feature-card {
  padding: 22px;
}

.feature-card span {
  display: block;
  width: 36px;
  height: 5px;
  margin-bottom: 16px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.feature-card h3,
.price-card h3,
.flow-grid h3,
.panel h2 {
  margin: 0 0 8px;
}

.feature-card p,
.price-card p,
.flow-grid p,
.help-card li,
.referral-card p,
.flow-list p,
.auth-card p,
.dash-head p,
.contact p,
.site-footer span {
  margin: 0;
  color: var(--muted);
}

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

.help-page {
  gap: 20px;
}

.help-hero {
  position: relative;
  overflow: hidden;
  padding: 30px;
  background:
    linear-gradient(135deg, rgba(228, 246, 238, 0.96), rgba(255, 255, 255, 0.92) 58%),
    radial-gradient(circle at 92% 12%, rgba(40, 103, 201, 0.12), transparent 28%);
}

.help-hero::after {
  content: "";
  position: absolute;
  right: 32px;
  bottom: -34px;
  width: 150px;
  height: 150px;
  border: 28px solid rgba(22, 131, 95, 0.08);
  border-radius: 50%;
}

.help-hero > * {
  position: relative;
  z-index: 1;
}

.help-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.help-nav {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 8px;
  padding: 18px;
}

.help-nav h2 {
  margin-bottom: 6px;
}

.help-nav a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #25382d;
  font-weight: 800;
}

.help-nav a:hover {
  border-color: #b9dacb;
  background: #f5fbf8;
}

.help-nav a span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 28px;
  border-radius: 7px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 12px;
}

.help-tip {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #b9dacb;
  border-radius: 8px;
  background: #f5fbf8;
}

.help-tip p {
  margin: 4px 0 0;
  color: var(--muted);
}

.help-content {
  display: grid;
  gap: 16px;
}

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

.help-overview div {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(22, 45, 36, 0.04);
}

.help-overview strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
}

.help-overview span {
  font-weight: 900;
}

.help-card {
  padding: 0;
  overflow: hidden;
}

.help-card-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid #edf3ef;
  background: linear-gradient(180deg, #fff, #fbfdfb);
}

.help-card-head > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-weight: 900;
}

.help-card-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.help-card-head p {
  margin: 0;
  color: var(--muted);
}

.help-card ol {
  counter-reset: help-step;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 22px 24px 24px;
  list-style: none;
}

.help-card li + li {
  margin-top: 0;
}

.help-card li {
  position: relative;
  min-height: 34px;
  padding: 6px 0 6px 48px;
}

.help-card li::before {
  counter-increment: help-step;
  content: counter(help-step);
  position: absolute;
  left: 0;
  top: 3px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #b9dacb;
  border-radius: 50%;
  color: var(--green-dark);
  background: #f5fbf8;
  font-size: 13px;
  font-weight: 900;
}

.help-card code {
  padding: 3px 7px;
  border: 1px solid #cfe9dc;
  border-radius: 7px;
  color: #0b5c45;
  background: #edf8f2;
}

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

.referral-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 220px;
  padding: 30px 24px;
  text-align: center;
}

.referral-card strong {
  color: #1684e3;
}

.referral-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #111d17;
  font-size: 30px;
  font-weight: 900;
}

.referral-layout {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  align-items: start;
}

.flow-list {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.flow-list div {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 12px;
}

.flow-list div::after {
  content: "";
  position: absolute;
  top: 34px;
  left: 15px;
  width: 1px;
  height: calc(100% + 10px);
  background: var(--line);
}

.flow-list div:last-child::after {
  display: none;
}

.flow-list span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--green-dark);
  background: var(--green-soft);
  font-weight: 900;
}

.flow-list strong,
.flow-list p {
  grid-column: 2;
}

.rebate-detail {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 54px;
  text-align: center;
}

.rebate-detail .kv {
  width: 100%;
}

.rebate-detail .kv div {
  grid-template-columns: 1fr auto;
  padding: 12px 0;
  border-bottom: 1px solid #edf3ef;
  text-align: left;
}

.rebate-note {
  width: 100%;
  padding: 14px;
  border: 1px solid #a9df91;
  border-radius: 8px;
  color: var(--green-dark);
  background: #f4fff0;
  font-weight: 800;
}

.referral-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 14px 0;
}

.referral-summary div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.referral-summary span,
.referral-summary strong {
  display: block;
}

.referral-summary span {
  color: var(--muted);
}

.referral-summary strong {
  font-size: 24px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 14px 0;
}

.copy-row input {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.referral-table table {
  min-width: 680px;
}

.pricing {
  background: #edf4f0;
}

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

.price-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.price-card {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.price-card .price > span {
  font: inherit;
}

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

.pricing-title > div {
  min-width: 0;
}

.billing-cycle-selector {
  display: grid;
  grid-template-columns: repeat(4, minmax(68px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.billing-cycle-selector label {
  position: relative;
  cursor: pointer;
}

.billing-cycle-selector input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.billing-cycle-selector span {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 5px 9px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.billing-cycle-selector input:checked + span {
  color: #fff;
  background: var(--green);
}

.billing-cycle-selector input:focus-visible + span {
  outline: 2px solid var(--green-dark);
  outline-offset: 2px;
}

.plan-billing-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.plan-billing-picker label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.plan-billing-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-billing-picker span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.plan-billing-picker span small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.plan-billing-picker input:checked + span {
  border-color: var(--green);
  color: var(--green-dark);
  background: var(--green-soft);
  box-shadow: 0 0 0 2px rgba(22, 131, 95, 0.1);
}

.plan-billing-picker input:focus-visible + span {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.price-card.featured {
  border-color: var(--green);
  box-shadow: 0 16px 44px rgba(22, 131, 95, 0.18);
}

.price-head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.price-head span {
  color: var(--green-dark);
  font-weight: 800;
}

.price {
  font-size: 42px;
  font-weight: 900;
}

.price small,
.price em {
  color: var(--muted);
  font-size: 16px;
  font-style: normal;
}

.price-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.price-card li::before {
  content: "✓";
  margin-right: 8px;
  color: var(--green);
  font-weight: 900;
}

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

.flow-grid div {
  padding: 24px;
}

.flow-grid b {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  border-radius: 50%;
  color: #fff;
  background: #15201a;
}

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 clamp(18px, 5vw, 72px) 54px;
  padding: 30px;
}

.site-footer {
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  background: #fff;
}

.site-footer div {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

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

.auth-card {
  width: min(460px, 100%);
  padding: 28px;
}

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

.form label {
  display: grid;
  gap: 7px;
  color: #2a3b30;
  font-weight: 800;
}

.form input,
.form select,
.form textarea,
.inline-form input,
.inline-form select {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.form textarea {
  min-height: 130px;
  font-family: Consolas, monospace;
}

.form-row {
  gap: 10px;
}

.admin-create-user {
  margin: 16px 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.check {
  display: inline-flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.alert {
  margin: 16px 0;
  padding: 12px;
  border: 1px solid #f0caca;
  border-radius: 8px;
  color: #8f2424;
  background: #fff0f0;
}

.alert.ok {
  color: var(--green-dark);
  border-color: #b9dacb;
  background: var(--green-soft);
}

.alert.notice {
  color: #8a5a0a;
  border-color: #f3c779;
  background: #fff8e9;
}

.compact-actions {
  margin: 0;
}

.switch {
  margin-top: 14px;
}

.switch a {
  color: var(--green-dark);
  font-weight: 900;
}

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

.dash-head {
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.profile-page {
  gap: 16px;
}

.profile-hero {
  align-items: center;
  padding: 26px;
  background:
    linear-gradient(135deg, #ffffff 0%, #f7fbf9 55%, #edf6f2 100%);
}

.profile-title p strong {
  color: var(--green-dark);
}

.profile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

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

.profile-overview article {
  min-height: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(22, 45, 36, 0.04);
}

.profile-overview span,
.profile-overview strong {
  display: block;
}

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

.profile-overview strong {
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.profile-grid {
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  align-items: start;
}

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

.limits-panel .limit-grid {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}

.compact-head {
  gap: 14px;
}

.referral-panel .panel-head {
  margin-bottom: 8px;
}

.referral-summary.mini {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.referral-summary.mini div {
  padding: 12px;
}

.referral-summary.mini strong {
  font-size: 20px;
}

.compact-copy {
  margin-bottom: 0;
}

.password-panel {
  align-self: start;
}

.password-form {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.plan-panel .price-grid.compact {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
}

.profile-page .price-card {
  gap: 11px;
  padding: 20px;
}

.profile-page .price {
  font-size: 34px;
}

.profile-page .price-card p {
  min-height: 42px;
}

.billing-panel .table-wrap,
.invoice-panel .table-wrap {
  margin-top: 14px;
}

.dash-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.dash-grid.profile-grid {
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
}

.panel {
  padding: 22px;
}

.kv {
  display: grid;
  gap: 10px;
  margin: 0;
}

.kv div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
}

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

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--green-dark);
  background: var(--green-soft);
}

.limit-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.limit-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafdfb;
}

.limit-grid span,
.limit-grid strong {
  display: block;
}

.limit-grid span {
  color: var(--muted);
}

.daily-quota {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.daily-quota > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.daily-quota strong {
  color: var(--ink);
}

.quota-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce8e1;
}

.quota-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf3ef;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f5faf7;
}

td small {
  display: block;
  color: var(--muted);
}

.inline-form {
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form input {
  width: 80px;
}

.user-management .inline-form input[type="password"] {
  width: 130px;
}

.user-management td strong,
.order-management td strong,
.invoice-management td strong {
  display: block;
}

.order-management td small,
.invoice-management td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.invoice-admin-form {
  min-width: 520px;
  gap: 8px;
}

.invoice-admin-form .form-row {
  align-items: stretch;
}

.invoice-admin-form input[type="file"] {
  padding: 7px 10px;
}

.admin-plan-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
}

.admin-plan {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.admin-plan-form {
  gap: 14px;
}

.admin-plan-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-plan-title h3 {
  margin: 2px 0 0;
  font-size: 20px;
}

.admin-plan-title span {
  color: var(--muted);
  font-size: 12px;
}

.admin-plan-flags {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-unsaved {
  padding: 3px 7px;
  border-radius: 999px;
  color: #7a4b00 !important;
  background: #fff0c2;
  font-weight: 900;
}

.admin-plan:has(.admin-plan-form.dirty) {
  border-color: #d29a2e;
  box-shadow: 0 0 0 2px rgba(210, 154, 46, 0.12);
}

.admin-plan-form > .btn[type="submit"] {
  position: sticky;
  bottom: 10px;
  z-index: 2;
  box-shadow: 0 8px 18px rgba(22, 131, 95, 0.16);
}

.admin-fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-fieldset legend {
  padding: 0 7px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
}

.admin-price-grid,
.admin-limit-fields,
.admin-switch-grid {
  display: grid;
  gap: 10px;
}

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

.admin-limit-fields {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.admin-switch-grid .check {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7faf8;
}

.admin-qr-preview {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

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

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

@media (max-width: 520px) {
  .admin-price-grid,
  .admin-limit-fields,
  .admin-switch-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .hero,
  .feature-grid,
  .price-grid,
  .flow-grid,
  .help-grid,
  .referral-benefits,
  .referral-layout,
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-visual {
    grid-column: 1 / -1;
  }

  .help-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

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

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

  .dash-grid.profile-grid {
    grid-template-columns: 1fr;
  }

  .plan-panel .price-grid.compact {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header,
  .dash-head,
  .contact,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    gap: 10px;
  }

  .hero,
  .feature-grid,
  .price-grid,
  .flow-grid,
  .help-grid,
  .referral-benefits,
  .referral-layout,
  .dash-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 44px;
  }

  .hero h1 {
    font-size: 33px;
    line-height: 1.14;
  }

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

  .hero-metrics div {
    min-width: 0;
    padding: 10px 12px;
  }

  .hero-visual {
    padding: 10px;
  }

  .btn,
  .hero-actions a {
    width: 100%;
  }

  .section-title {
    display: grid;
  }

  .section-title h2 {
    font-size: 28px;
    line-height: 1.18;
  }

  .kv div {
    grid-template-columns: 1fr;
  }

  .help-layout,
  .help-overview,
  .help-card-head {
    grid-template-columns: 1fr;
  }

  .profile-overview,
  .dash-grid.profile-grid,
  .password-form,
  .plan-panel .price-grid.compact,
  .referral-summary.mini {
    grid-template-columns: 1fr;
  }

  .profile-actions,
  .profile-actions .btn,
  .compact-copy .btn {
    width: 100%;
  }

  .pricing-title,
  .plan-panel .panel-head {
    display: grid;
  }

  .billing-cycle-selector {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .help-nav {
    position: static;
  }

  .help-card li {
    padding-left: 42px;
  }

  .copy-row {
    grid-template-columns: 1fr;
  }

  .rebate-detail {
    padding: 28px;
  }
}

/* Admin workspace */
.admin-body {
  background: #f3f6f8;
}

.admin-body .site-header {
  position: sticky;
  top: 0;
  z-index: 20;
}

.admin-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  width: min(1720px, 100%);
  min-height: calc(100vh - 66px);
  margin: 0 auto;
  padding: 24px clamp(18px, 3vw, 44px) 48px;
}

.admin-sidebar {
  position: sticky;
  top: 90px;
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(20, 36, 48, 0.06);
}

.admin-sidebar-head {
  display: grid;
  gap: 4px;
  padding: 2px 4px 14px;
  border-bottom: 1px solid #e6ebef;
}

.admin-sidebar-head strong {
  font-size: 20px;
}

.admin-sidebar-head small {
  overflow: hidden;
  color: #71808d;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-side-nav {
  display: grid;
  gap: 5px;
}

.admin-side-nav a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #25313c;
  text-decoration: none;
}

.admin-side-nav a:hover {
  border-color: #d6e2ec;
  background: #f5f8fb;
}

.admin-side-nav a.active {
  border-color: #b8d1e7;
  color: #184f7f;
  background: #eaf3fb;
}

.admin-side-nav a > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.admin-side-nav strong {
  font-size: 14px;
}

.admin-side-nav small {
  color: #74818c;
  font-size: 12px;
}

.admin-side-nav b {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #53616d;
  background: #edf1f4;
  font-size: 11px;
  text-align: center;
}

.admin-nav-icon,
.admin-shortcut-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  color: #245d8d;
  background: #e7f0f8;
  font-size: 13px;
  font-weight: 900;
}

.admin-side-nav a.active .admin-nav-icon {
  color: #fff;
  background: #23679e;
}

.admin-back-link {
  padding: 12px 8px 2px;
  border-top: 1px solid #e6ebef;
  color: #52616d;
  font-weight: 800;
  text-decoration: none;
}

.admin-workspace {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.admin-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 104px;
  padding: 10px 2px 20px;
  border-bottom: 1px solid #d9e1e7;
}

.admin-page-head h1 {
  margin: 7px 0 5px;
  font-size: 30px;
  line-height: 1.2;
}

.admin-page-head p {
  margin: 0;
  color: #677681;
}

.admin-module {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.admin-module > .panel {
  margin: 0;
  border-color: #dbe2e8;
  box-shadow: 0 8px 22px rgba(20, 36, 48, 0.045);
}

.admin-module .panel-head h2 {
  font-size: 20px;
}

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

.admin-metrics a {
  display: grid;
  gap: 6px;
  min-height: 116px;
  padding: 17px;
  border: 1px solid #dbe2e8;
  border-radius: 8px;
  color: #1d2933;
  background: #fff;
  text-decoration: none;
  box-shadow: 0 7px 18px rgba(20, 36, 48, 0.04);
}

.admin-metrics a:hover {
  border-color: #9fbfd9;
}

.admin-metrics span,
.admin-metrics small {
  color: #697782;
}

.admin-metrics strong {
  font-size: 28px;
  line-height: 1;
}

.admin-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #e5eaee;
  border-left: 1px solid #e5eaee;
}

.admin-shortcuts a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 3px 10px;
  min-height: 82px;
  padding: 14px;
  border-right: 1px solid #e5eaee;
  border-bottom: 1px solid #e5eaee;
  color: #24313b;
  text-decoration: none;
}

.admin-shortcuts a:hover {
  background: #f6f9fb;
}

.admin-shortcuts .admin-shortcut-icon {
  grid-row: 1 / 3;
}

.admin-shortcuts small {
  color: #72808b;
}

.admin-workspace .admin-plan-grid {
  grid-template-columns: 1fr;
}

.admin-workspace .admin-create-user {
  margin: 16px 0 18px;
  padding: 16px 0;
  border-width: 1px 0;
  border-radius: 0;
  background: #f8fafb;
}

.admin-workspace .table-wrap {
  border-color: #dce3e8;
}

.admin-workspace th {
  color: #4d5c68;
  background: #f3f6f8;
  font-size: 13px;
}

.email-settings-form {
  gap: 16px;
}

.email-settings-form .admin-fieldset {
  padding: 16px;
}

.admin-advanced-settings {
  padding: 12px 14px;
  border: 1px solid #dce3e8;
  border-radius: 7px;
  background: #fff;
}

.admin-advanced-settings summary {
  cursor: pointer;
  color: #53616d;
  font-weight: 800;
}

.admin-advanced-settings .form-row {
  margin-top: 14px;
}

.email-test-form {
  margin: 14px 0 18px;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8ec;
}

.email-test-form input {
  width: min(360px, 100%);
}

.email-test-form span {
  color: #687681;
  font-size: 13px;
}

@media (max-width: 1120px) {
  .admin-layout {
    grid-template-columns: 214px minmax(0, 1fr);
    gap: 16px;
  }

  .admin-metrics,
  .admin-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .admin-body .site-header {
    position: static;
  }

  .admin-layout {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px 12px 32px;
  }

  .admin-sidebar {
    position: static;
    gap: 12px;
    padding: 14px;
  }

  .admin-sidebar-head {
    padding-bottom: 10px;
  }

  .admin-side-nav {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }

  .admin-side-nav a {
    grid-template-columns: 30px minmax(98px, 1fr) auto;
    flex: 0 0 auto;
    min-height: 48px;
  }

  .admin-nav-icon {
    width: 30px;
    height: 30px;
  }

  .admin-back-link {
    display: none;
  }

  .admin-page-head {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 4px 2px 16px;
  }

  .admin-page-head h1 {
    font-size: 26px;
  }

  .admin-page-head .btn,
  .admin-module .panel-head .btn {
    width: 100%;
  }

  .admin-metrics,
  .admin-shortcuts {
    grid-template-columns: 1fr 1fr;
  }

  .admin-metrics a {
    min-height: 104px;
    padding: 14px;
  }

  .admin-shortcuts a {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 12px;
  }

  .admin-module > .panel {
    padding: 16px;
  }
}

@media (max-width: 430px) {
  .admin-metrics,
  .admin-shortcuts {
    grid-template-columns: 1fr;
  }
}
