:root {
  --page-bg: #f7f7f5;
  --card-bg: #ffffff;
  --soft-bg: #f0f0ed;
  --text: #191919;
  --muted: #6d6d68;
  --border: rgba(25, 25, 25, 0.13);
  --border-strong: rgba(25, 25, 25, 0.25);
  --accent: #10a37f;
  --accent-hover: #0d8f70;
  --danger: #e05252;
  --warn: #d28b26;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family:
    'Segoe UI',
    'PingFang SC',
    'Hiragino Sans GB',
    'Microsoft YaHei',
    sans-serif;
  background:
    radial-gradient(
      circle at 50% -10%,
      rgba(16, 163, 127, 0.1),
      transparent 28rem
    ),
    var(--page-bg);
}

body.is-dark {
  --page-bg: #171717;
  --card-bg: #212121;
  --soft-bg: #2a2a2a;
  --text: #f5f5f5;
  --muted: #a7a7a2;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.24);
  background:
    radial-gradient(
      circle at 50% -10%,
      rgba(16, 163, 127, 0.12),
      transparent 30rem
    ),
    var(--page-bg);
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.page-shell.narrow {
  width: min(920px, calc(100% - 48px));
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px 0 48px;
  text-align: center;
}

.hero.records {
  padding-bottom: 36px;
}

.back-button,
.manage-button {
  position: absolute;
  top: 0;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 12px;
  color: var(--muted);
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s ease;
}

.back-button:hover,
.manage-button:hover {
  color: var(--text);
  background: var(--soft-bg);
}

.back-button {
  left: 0;
}

.manage-button {
  right: 0;
  max-width: min(42vw, 200px);
  font-size: 13px;
  line-height: 1.3;
  text-align: right;
}

.modal-card--confirm h3 {
  margin-bottom: 6px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.modal-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.confirm-checkout {
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--soft-bg);
}

.confirm-plan {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(
    135deg,
    rgba(16, 163, 127, 0.12),
    rgba(16, 163, 127, 0.02)
  );
  border-bottom: 1px solid var(--border);
}

.confirm-plan-label {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.confirm-plan-price {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.confirm-details {
  padding: 6px 0;
  margin: 0;
  list-style: none;
}

.confirm-details li {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 12px;
  align-items: start;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

.confirm-details li:first-child {
  border-top: 0;
}

.confirm-details-key {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.confirm-details-val {
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
  word-break: break-word;
}

.confirm-details-val--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.modal-card--confirm .modal-actions {
  margin-top: 4px;
}

.modal-card--confirm .modal-actions .primary {
  min-width: 120px;
  border-radius: 999px;
}


.back-button svg,
.manage-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.brand-mark {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.hero.records h1 {
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -0.04em;
}

.hero > p {
  max-width: 620px;
  margin: 18px auto 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.hero.records > p {
  margin: 16px auto 20px;
  font-size: 15px;
}

.device-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  color: var(--muted);
  font-size: 12px;
  background: var(--soft-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(16, 163, 127, 0.12);
}

.device-pill.disconnected .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(224, 82, 82, 0.12);
}

.device-id {
  padding-left: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  border-left: 1px solid var(--border);
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  padding: 26px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.plan-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
}

.plan-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.plan-card.featured {
  background:
    linear-gradient(180deg, rgba(16, 163, 127, 0.055), transparent 45%),
    var(--card-bg);
}

.popular-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  padding: 5px 11px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--accent);
  border-radius: 999px;
}

.plan-heading {
  display: flex;
  justify-content: space-between;
  min-height: 64px;
}

.plan-kicker,
.section-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.plan-heading h2 {
  margin: 7px 0 0;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.selected-check {
  display: grid;
  width: 26px;
  height: 26px;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  place-items: center;
}

.plan-description {
  min-height: 48px;
  margin: 15px 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.price-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 20px;
  white-space: nowrap;
}

.currency {
  margin-right: 2px;
  font-size: 22px;
  font-weight: 500;
}

.price-row strong {
  font-size: 42px;
  font-weight: 500;
  letter-spacing: -0.055em;
}

.billing {
  margin-left: 7px;
  color: var(--muted);
  font-size: 12px;
}

.select-button,
.checkout-button,
.empty-state button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  color: var(--page-bg);
  font-weight: 600;
  background: var(--text);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s ease;
}

.select-button:hover:not(:disabled),
.checkout-button:hover:not(:disabled),
.empty-state button:hover:not(:disabled) {
  color: #fff;
  background: var(--accent-hover);
}

.select-button:disabled,
.checkout-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.select-button svg,
.checkout-button svg {
  width: 17px;
  margin-left: 7px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.plan-card.selected .select-button {
  color: #fff;
  background: var(--accent);
}

.divider {
  height: 1px;
  margin: 24px 0 20px;
  background: var(--border);
}

.includes {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
}

.plan-card ul {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.plan-card li {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.check-icon {
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 700;
}

.checkout-section {
  display: none;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1.1fr);
  gap: 48px;
  scroll-margin-top: 24px;
  margin-top: 32px;
  padding: 42px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 22px;
}

.checkout-section.is-visible {
  display: grid;
}

.checkout-copy h2 {
  margin: 10px 0 14px;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.checkout-copy > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  margin-top: 28px;
  background: var(--soft-bg);
  border-radius: 14px;
}

.order-summary > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.order-summary small {
  color: var(--muted);
}

.order-summary > strong {
  font-size: 20px;
}

.checkout-form {
  display: flex;
  flex-direction: column;
}

.checkout-form > label,
.form-field > label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
}

.checkout-form > label:not(:first-child) {
  margin-top: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.checkout-form > input,
.form-field > input {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  background: var(--soft-bg);
  border: 1px solid transparent;
  border-radius: 12px;
  transition: 0.2s ease;
}

.checkout-form > input:focus,
.form-field > input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.12);
}

.checkout-form > input.cvc-input {
  max-width: 140px;
}

.payment-method {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 0 14px;
  background: var(--soft-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.payment-method > div:nth-child(2) {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.payment-method strong {
  font-size: 13px;
}

.payment-method small {
  color: var(--muted);
  font-size: 11px;
}

.card-symbol {
  position: relative;
  width: 34px;
  height: 24px;
  border: 1.5px solid var(--muted);
  border-radius: 5px;
}

.card-symbol::before {
  position: absolute;
  top: 6px;
  right: 0;
  left: 0;
  height: 3px;
  content: '';
  background: var(--muted);
}

.card-symbol span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 3px;
  background: var(--muted);
  border-radius: 1px;
}

.secure-badge {
  padding: 4px 8px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  background: rgba(16, 163, 127, 0.1);
  border-radius: 999px;
}

.order-status {
  display: none;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-top: 16px;
  background: rgba(16, 163, 127, 0.08);
  border: 1px solid rgba(16, 163, 127, 0.2);
  border-radius: 12px;
}

.order-status.is-visible {
  display: flex;
}

.order-status > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.order-status strong {
  font-size: 12px;
}

.order-status small {
  color: var(--muted);
  font-size: 10px;
}

.order-status button {
  padding: 5px 8px;
  color: var(--accent);
  font-size: 11px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

.checkout-button {
  height: 50px;
  margin-top: 22px;
  color: #fff;
  background: var(--accent);
  border-radius: 12px;
}

.terms {
  margin: 12px 10px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.button-spinner {
  display: none;
  width: 15px;
  height: 15px;
  margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.checkout-button.is-loading .button-spinner {
  display: inline-block;
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 36px 12px 0;
}

.trust-row > div {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.trust-row strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 12px;
}

.trust-icon {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 50%;
  place-items: center;
}

.empty-state {
  display: none;
  max-width: 480px;
  padding: 64px 36px;
  margin: 0 auto;
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.empty-state.is-visible {
  display: block;
}

.empty-state h2 {
  margin: 18px 0 8px;
}

.empty-state p {
  margin: 0 0 22px;
  color: var(--muted);
}

.empty-state button {
  width: auto;
  padding: 0 22px;
  margin: 0 auto;
}

.empty-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto;
  color: var(--muted);
  background: var(--soft-bg);
  border-radius: 50%;
  place-items: center;
}

.skeleton-card {
  gap: 18px;
  pointer-events: none;
}

.skeleton {
  display: block;
  height: 14px;
  background: linear-gradient(
    90deg,
    var(--soft-bg),
    var(--border),
    var(--soft-bg)
  );
  background-size: 200% 100%;
  border-radius: 8px;
  animation: shimmer 1.4s infinite;
}

.line-sm {
  width: 28%;
}

.line-lg {
  width: 60%;
  height: 26px;
}

.price-line {
  width: 50%;
  height: 42px;
  margin-top: 16px;
}

.button-line {
  width: 100%;
  height: 44px;
  border-radius: 999px;
}

.feature-line {
  width: 85%;
}

.records-lookup {
  margin-bottom: 20px;
  padding: 20px 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.records-lookup > label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
}

.lookup-row {
  display: flex;
  gap: 12px;
}

.lookup-row input {
  flex: 1;
  height: 44px;
  padding: 0 15px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  background: var(--soft-bg);
  border: 1px solid transparent;
  border-radius: 12px;
}

.lookup-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.12);
}

.lookup-row button {
  height: 44px;
  padding: 0 18px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.lookup-row button:hover {
  background: var(--accent-hover);
}

.records-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.records-tabs-card {
  padding: 0;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.records-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 6px;
  background: var(--soft-bg);
  border-bottom: 1px solid var(--border);
}

.records-tab {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.2s ease;
}

.records-tab:hover {
  color: var(--text);
}

.records-tab.is-active {
  color: var(--text);
  background: var(--card-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.records-tab .tab-count {
  min-width: 22px;
  padding: 2px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  background: var(--soft-bg);
  border-radius: 999px;
}

.records-tab.is-active .tab-count {
  color: var(--accent);
  background: rgba(16, 163, 127, 0.12);
}

.records-tab-panels {
  padding: 8px 24px 20px;
}

.records-tab-panel .records-panel {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.records-tab-panel .panel-heading {
  display: none;
}

.records-tab-empty {
  padding: 36px 12px 28px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.records-panel {
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.panel-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.panel-heading span {
  min-width: 28px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  background: var(--soft-bg);
  border-radius: 999px;
}

.record-card {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.record-card:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.record-main {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.record-main strong {
  font-size: 15px;
}

.status-badge {
  padding: 4px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  background: var(--soft-bg);
  border-radius: 999px;
}

.status-badge.active,
.status-badge.paid,
.status-badge.authorized,
.status-badge.created {
  color: var(--accent);
  background: rgba(16, 163, 127, 0.12);
}

.status-badge.failed,
.status-badge.canceled {
  color: var(--danger);
  background: rgba(224, 82, 82, 0.12);
}

.status-badge.refund_requested,
.status-badge.refunding {
  color: var(--warn);
  background: rgba(210, 139, 38, 0.14);
}

.status-badge.refunded {
  color: var(--muted);
  background: var(--soft-bg);
}

.record-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.refund-button {
  min-height: 34px;
  padding: 0 16px;
  color: var(--warn);
  font-size: 13px;
  font-weight: 600;
  background: rgba(210, 139, 38, 0.1);
  border: 1px solid rgba(210, 139, 38, 0.28);
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s ease;
}

.refund-button:hover:not(:disabled) {
  background: rgba(210, 139, 38, 0.16);
}

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

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

.record-meta div {
  min-width: 0;
}

.record-meta dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
}

.record-meta dd {
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-meta dd.billing-canceled {
  color: var(--danger);
  font-weight: 600;
}


.skeleton-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.record-line {
  width: 100%;
  height: 72px;
}

.toast {
  position: fixed;
  top: auto;
  bottom: 28px;
  left: 50%;
  z-index: 1500;
  max-width: min(90vw, 420px);
  padding: 12px 18px;
  color: #fff;
  font-size: 13px;
  background: rgba(25, 25, 25, 0.92);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.success {
  background: rgba(16, 163, 127, 0.95);
}

.toast.error {
  background: rgba(224, 82, 82, 0.95);
}

.toast.warning {
  background: rgba(210, 139, 38, 0.95);
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(100%, 420px);
  padding: 28px 26px 22px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
  transform: translateY(8px);
  transition: transform 0.2s ease;
}

.modal-backdrop.is-open .modal-card {
  transform: translateY(0);
}

.modal-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
}

.modal-card p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.modal-summary {
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.55;
  background: var(--soft-bg);
  border-radius: 12px;
}

.modal-summary strong {
  display: block;
  margin-bottom: 6px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-actions button {
  min-height: 40px;
  padding: 0 18px;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s ease;
}

.modal-actions .ghost {
  color: var(--text);
  background: var(--soft-bg);
}

.modal-actions .ghost:hover {
  background: var(--border);
}

.modal-actions .primary {
  color: #fff;
  background: var(--accent);
}

.modal-actions .primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.modal-actions .primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.modal-actions .primary.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 132px;
}

.modal-actions .primary.is-loading::before {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  content: '';
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.modal-success-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  background: var(--accent);
  border-radius: 50%;
  place-items: center;
}

.cancel-button {
  min-height: 34px;
  padding: 0 16px;
  margin-right: 10px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  background: rgba(224, 82, 82, 0.1);
  border: 1px solid rgba(224, 82, 82, 0.28);
  border-radius: 999px;
  cursor: pointer;
}

.cancel-button:hover:not(:disabled) {
  background: rgba(224, 82, 82, 0.16);
}

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

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

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

@keyframes pulse {
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}

.lang-switcher {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 5000;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateX(-50%);
}

.lang-switcher button {
  min-width: 40px;
  height: 30px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.lang-switcher button:hover {
  color: var(--text);
  background: var(--soft-bg);
}

.lang-switcher button.is-active {
  color: #fff;
  background: var(--accent);
}

@media (max-width: 860px) {
  .page-shell,
  .page-shell.narrow {
    width: min(100% - 28px, 680px);
  }

  .hero {
    padding-top: 64px;
  }

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

  .plan-card {
    min-height: auto;
  }

  .checkout-section.is-visible {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 28px;
  }

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

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

@media (max-width: 640px) {
  .record-meta {
    grid-template-columns: 1fr;
  }

  .device-id {
    display: none;
  }
}

@media (max-width: 520px) {
  .page-shell,
  .page-shell.narrow {
    width: calc(100% - 20px);
    padding-top: 18px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .plan-card,
  .checkout-section.is-visible {
    padding: 22px;
    border-radius: 15px;
  }
}
