:root {
  --ink: #17211d;
  --ink-soft: #52605a;
  --green: #176f53;
  --green-dark: #0e5a41;
  --green-soft: #e8f5ef;
  --mint: #f4faf7;
  --paper: #ffffff;
  --canvas: #f3f5f2;
  --line: #dfe6e1;
  --warning: #a76615;
  --danger: #b43b3b;
  --shadow: 0 18px 55px rgba(27, 56, 43, 0.09);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 6%, rgba(60, 151, 110, 0.1), transparent 27rem),
    linear-gradient(180deg, #fbfcfb 0%, var(--canvas) 100%);
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid rgba(23, 111, 83, 0.4);
  outline-offset: 3px;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-text {
  display: grid;
  gap: 1px;
}

.brand-text strong {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand-text span {
  color: var(--ink-soft);
  font-size: 12px;
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: none;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.header-link:hover {
  color: var(--green);
  border-color: #b8d1c4;
  background: #fff;
}

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

.purchase-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(400px, 0.97fr);
  gap: 72px;
  align-items: center;
  min-height: 680px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

.hero-title {
  max-width: 650px;
  margin: 0;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.03;
  letter-spacing: -0.055em;
  font-weight: 760;
}

.hero-title span {
  color: var(--green);
}

.hero-copy {
  max-width: 560px;
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.8;
}

.benefit-list {
  display: grid;
  gap: 16px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.benefit-item {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  color: #33433c;
  font-size: 14px;
  line-height: 1.6;
}

.benefit-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 8px;
}

.benefit-icon svg {
  width: 14px;
  height: 14px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 42px;
  color: #6b7872;
  font-size: 12px;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.trust-row svg {
  width: 15px;
  height: 15px;
  color: var(--green);
}

.purchase-card {
  position: relative;
  padding: 30px;
  border: 1px solid rgba(204, 218, 210, 0.88);
  border-radius: 31px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.purchase-card::before {
  content: "";
  position: absolute;
  inset: 12px -12px -12px 12px;
  z-index: -1;
  border: 1px solid rgba(23, 111, 83, 0.1);
  border-radius: 34px;
}

.card-kicker {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-title {
  margin: 8px 0 4px;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.card-copy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.plan-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.plan-option {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.plan-option:hover {
  border-color: #accbbb;
  background: #fbfdfc;
}

.plan-option:active {
  transform: scale(0.99);
}

.plan-option[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--mint);
  box-shadow: inset 0 0 0 1px var(--green);
}

.plan-radio {
  width: 18px;
  height: 18px;
  border: 1.5px solid #b9c7c0;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.plan-option[aria-pressed="true"] .plan-radio {
  border-color: var(--green);
}

.plan-option[aria-pressed="true"] .plan-radio::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.plan-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.plan-meta {
  display: block;
  margin-top: 3px;
  color: #77837d;
  font-size: 12px;
}

.plan-price {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.plan-price small {
  color: #77837d;
  font-size: 11px;
  font-weight: 500;
}

.renew-toggle {
  width: 100%;
  margin-top: 13px;
  padding: 10px;
  color: var(--green);
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.renew-toggle:hover {
  background: var(--green-soft);
}

.primary-button,
.secondary-button,
.quiet-button,
.danger-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, background 180ms ease, border-color 180ms ease,
    color 180ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 17px;
  color: #fff;
  border: 1px solid var(--green);
  background: var(--green);
  box-shadow: 0 8px 20px rgba(23, 111, 83, 0.18);
}

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

.primary-button:active,
.secondary-button:active,
.quiet-button:active,
.danger-button:active {
  transform: scale(0.985);
}

.primary-button:disabled,
.secondary-button:disabled,
.quiet-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.compact-button {
  width: auto;
  min-height: 38px;
  margin: 0;
  padding: 0 13px;
  font-size: 12px;
}

.primary-button svg,
.secondary-button svg,
.quiet-button svg,
.danger-button svg {
  width: 17px;
  height: 17px;
}

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

.secondary-button:hover {
  background: var(--green-soft);
}

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

.quiet-button:hover {
  color: var(--ink);
  border-color: #c7d2cc;
}

.danger-button {
  color: var(--danger);
  border: 1px solid #edd0d0;
  background: #fff7f7;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-row > * {
  flex: 1;
}

.fine-print {
  margin: 13px 0 0;
  color: #7b877f;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.progress-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  padding: 10px 12px;
  color: #52605a;
  border-radius: 12px;
  background: #f5f7f5;
  font-size: 12px;
}

.progress-note svg {
  width: 16px;
  height: 16px;
  color: var(--green);
}

.checkout-view,
.success-view,
.restore-view {
  display: none;
}

.purchase-card[data-view="plans"] .plans-view,
.purchase-card[data-view="checkout"] .checkout-view,
.purchase-card[data-view="success"] .success-view,
.purchase-card[data-view="restore"] .restore-view {
  display: block;
}

.order-summary {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8faf8;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0;
  font-size: 13px;
}

.summary-row span:first-child {
  color: #6e7a74;
}

.summary-row strong {
  text-align: right;
}

.summary-total {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.summary-total strong {
  color: var(--green);
  font-size: 20px;
}

.license-panel {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #cce1d5;
  border-radius: 19px;
  background: linear-gradient(145deg, #f2fbf6, #fff);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #20a474;
  box-shadow: 0 0 0 4px rgba(32, 164, 116, 0.12);
}

.license-key {
  margin: 14px 0 8px;
  color: #173c2d;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.license-expiry {
  margin: 0;
  color: #637069;
  font-size: 12px;
  line-height: 1.6;
}

.success-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 15px;
  background: var(--green);
}

.success-icon svg {
  width: 24px;
  height: 24px;
}

.input-stack {
  display: grid;
  gap: 7px;
  margin-top: 17px;
}

.input-stack label {
  color: #46554e;
  font-size: 12px;
  font-weight: 700;
}

.text-input {
  width: 100%;
  min-height: 45px;
  padding: 0 13px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.text-input::placeholder {
  color: #9aa49f;
}

.text-input:focus {
  border-color: var(--green);
  outline: 3px solid rgba(23, 111, 83, 0.12);
}

.form-error {
  min-height: 18px;
  margin: 7px 0 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}

.inline-notice {
  margin-top: 15px;
  padding: 12px 13px;
  color: #6a5224;
  border: 1px solid #eadbbd;
  border-radius: 12px;
  background: #fffaef;
  font-size: 12px;
  line-height: 1.6;
}

.feature-band {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 1px;
  margin-top: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--line);
}

.feature-band > div {
  min-height: 130px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.84);
}

.feature-band h3 {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.feature-band p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-block {
  min-height: 170px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-size: 12px;
}

.loading-block .spinner {
  border-color: #dce7e1;
  border-top-color: var(--green);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.fade-in {
  animation: fade-in 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Admin */
.admin-body {
  min-height: 100dvh;
  background: #f3f5f2;
}

.admin-login {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 35%, rgba(45, 136, 96, 0.12), transparent 32rem),
    #f6f8f5;
}

.admin-login[hidden] {
  display: none;
}

.login-card {
  width: min(410px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 25px 0 8px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.login-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.admin-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.admin-shell[hidden] {
  display: none;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e2e7e3;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
}

.admin-brand {
  padding: 0 9px 27px;
}

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

.admin-nav button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  color: #5a6861;
  border: 0;
  border-radius: 11px;
  background: transparent;
  font-size: 13px;
  text-align: left;
  transition: background 160ms ease, color 160ms ease;
}

.admin-nav button:hover {
  color: var(--ink);
  background: #f1f5f2;
}

.admin-nav button[aria-current="page"] {
  color: var(--green);
  background: var(--green-soft);
  font-weight: 700;
}

.admin-nav svg {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.admin-main {
  min-width: 0;
  padding: 30px clamp(20px, 4vw, 48px) 60px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.admin-topbar h1 {
  margin: 3px 0 0;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.045em;
}

.admin-topbar p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  gap: 9px;
}

.admin-page {
  display: none;
}

.admin-page.active {
  display: block;
}

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

.stat-card {
  min-height: 130px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.stat-label {
  color: var(--ink-soft);
  font-size: 12px;
}

.stat-value {
  margin-top: 16px;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 750;
  letter-spacing: -0.045em;
}

.stat-note {
  margin-top: 6px;
  color: #7b877f;
  font-size: 11px;
}

.panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
}

.panel-head {
  min-height: 62px;
  padding: 0 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #edf1ee;
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
}

.panel-head p {
  margin: 3px 0 0;
  color: #7b877f;
  font-size: 11px;
}

.panel-body {
  padding: 18px;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf1ee;
  text-align: left;
  font-size: 12px;
}

.data-table th {
  color: #748079;
  background: #fafbfa;
  font-weight: 600;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fbfcfb;
}

.mono {
  font-family: "Cascadia Mono", "Consolas", monospace;
}

.muted {
  color: #7b877f;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.pill.active,
.pill.paid {
  color: #167c57;
  background: #e9f7f0;
}

.pill.pending {
  color: #94601b;
  background: #fff7e9;
}

.pill.revoked,
.pill.blacklisted {
  color: #aa3c3c;
  background: #fdf0f0;
}

.pill.disabled,
.pill.rejected {
  color: #aa3c3c;
  background: #fdf0f0;
}

.pill.approved {
  color: #167c57;
  background: #e9f7f0;
}

.table-actions {
  display: flex;
  gap: 6px;
}

.mini-button {
  min-height: 29px;
  padding: 0 9px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
}

.mini-button:hover {
  color: var(--green);
  border-color: #b8d1c4;
}

.mini-button.danger {
  color: var(--danger);
  border-color: #edd0d0;
}

.empty-state {
  padding: 42px 20px;
  color: var(--ink-soft);
  text-align: center;
  font-size: 12px;
}

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

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

.plan-admin-card h3 {
  margin: 0 0 16px;
  font-size: 15px;
}

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

.agent-admin-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fbfcfb;
}

.agent-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.agent-card-head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.agent-card-head p {
  margin: 5px 0 0;
  color: #748079;
  font-size: 11px;
}

.agent-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}

.agent-identity code,
.rate-badge {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 11px;
}

.agent-identity code {
  color: #173c2d;
  background: #edf5f1;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-weight: 700;
}

.rate-badge {
  color: #59675f;
  border: 1px solid var(--line);
  background: #fff;
}

.agent-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.agent-metrics > div {
  min-width: 0;
  padding: 11px 10px;
  background: #fff;
}

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

.agent-metrics span {
  color: #7b877f;
  font-size: 10px;
}

.agent-metrics strong {
  margin-top: 5px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 15px;
}

.withdrawal-review-summary {
  margin: 10px 0 14px;
  padding: 12px;
  color: #536159;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8faf8;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 11px;
}

.field label {
  color: #65736c;
  font-size: 11px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.field textarea {
  min-height: 76px;
  resize: vertical;
}

.release-form {
  padding: 18px;
}

.release-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.3fr);
  gap: 14px;
}

.release-form-grid .field {
  margin-top: 0;
}

.release-form .compact-button {
  margin-top: 4px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: #536159;
  font-size: 12px;
}

.dialog {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(20, 43, 33, 0.2);
}

.dialog::backdrop {
  background: rgba(19, 31, 25, 0.38);
  backdrop-filter: blur(4px);
}

.dialog-head,
.dialog-body,
.dialog-actions {
  padding: 20px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  margin: 0;
  font-size: 17px;
}

.dialog-body {
  padding-top: 8px;
  max-height: 65dvh;
  overflow: auto;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
}

.dialog-actions > * {
  flex: 0 1 auto;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  max-width: min(380px, calc(100% - 44px));
  padding: 13px 16px;
  color: #fff;
  border-radius: 12px;
  background: #1d2b24;
  box-shadow: 0 14px 40px rgba(20, 39, 31, 0.22);
  font-size: 12px;
  line-height: 1.55;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.toast.error {
  background: #8e3030;
}

.device-list {
  display: grid;
  gap: 9px;
}

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

.device-row strong {
  display: block;
  font-size: 12px;
}

.device-row span {
  display: block;
  margin-top: 3px;
  color: #7b877f;
  font-size: 10px;
}

@media (max-width: 900px) {
  .purchase-layout {
    grid-template-columns: 1fr;
    gap: 46px;
    min-height: 0;
  }

  .hero-title {
    max-width: 720px;
  }

  .purchase-card {
    max-width: 620px;
  }

  .feature-band {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

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

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

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

  .admin-sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-brand {
    padding-bottom: 16px;
  }

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

  .admin-nav button {
    justify-content: center;
    padding: 0 8px;
  }

  .admin-nav button span {
    display: none;
  }

  .sidebar-footer {
    position: absolute;
    top: 13px;
    right: 15px;
    padding: 0;
    border: 0;
  }

  .sidebar-footer .quiet-button {
    min-height: 36px;
  }
}

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

  .site-header {
    padding-top: 18px;
  }

  .header-link {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .header-link span {
    display: none;
  }

  .page-shell {
    padding-top: 4px;
  }

  .hero-title {
    font-size: clamp(39px, 14vw, 58px);
  }

  .hero-copy {
    font-size: 14px;
  }

  .purchase-card {
    padding: 22px;
    border-radius: 24px;
  }

  .purchase-card::before {
    display: none;
  }

  .feature-band {
    grid-template-columns: 1fr;
  }

  .feature-band > div {
    min-height: 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-main {
    padding: 22px 14px 50px;
  }

  .admin-topbar {
    align-items: flex-start;
  }

  .admin-topbar p {
    display: none;
  }

  .topbar-actions .quiet-button {
    min-height: 38px;
    padding: 0 11px;
    font-size: 11px;
  }

  .agent-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .dialog-actions {
    flex-wrap: wrap;
  }

  .release-form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
