:root {
  --bg-top: #edf0f6;
  --bg-bottom: #edf0f6;
  --card: #ffffff;
  --text: #111622;
  --muted: #70798f;
  --line: #dce3ef;
  --primary: #3b7bff;
  --primary-dark: #2d65cf;
  --warn-bg: #fff7eb;
  --warn-icon: #f2a43c;
  --ok: #1a875f;
  --danger: #d34768;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

button {
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  min-height: 100vh;
  padding-bottom: 90px;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

.material-symbols-rounded {
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
  font-size: 22px;
  line-height: 1;
}

.app-shell {
  width: min(420px, calc(100vw - 14px));
  min-height: calc(100vh - 106px);
  margin: 10px auto 18px;
  display: grid;
  gap: 10px;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(38, 62, 106, 0.08);
  padding: 13px;
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}

/* subtle pixel accent: tiny step in top-right corner */
.card::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  background:
    linear-gradient(90deg, transparent 50%, #c5d6f8 0),
    linear-gradient(0deg, transparent 50%, #c5d6f8 0);
  background-size: 5px 5px;
  opacity: 0.55;
  border-radius: 2px;
}

.view.active .card {
  animation: lift-in 220ms ease both;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 31px;
  font-weight: 600;
}

h2 {
  font-size: 20px;
  font-weight: 600;
}

.topbar {
  background: #fff;
  color: var(--text);
  border-color: #dbe2ef;
  box-shadow: 0 8px 20px rgba(38, 52, 83, 0.09);
}

.brand-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #f8f9fd;
  border: 1px solid #d6deeb;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: none;
}

.brand-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}

.brand-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: lowercase;
}

.subtle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.topbar-main {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.topbar-balance {
  display: grid;
  text-align: right;
  line-height: 1.1;
}

.topbar-balance-label {
  font-size: 12px;
  color: #7b8398;
}

.topbar-balance-value {
  font-size: 25px;
  font-weight: 600;
  color: #e34665;
}

.topbar-balance-value.is-positive {
  color: #189e5f;
}

.topbar-subtle {
  margin-top: 7px;
  font-size: 12px;
}

.view {
  display: none;
  gap: 10px;
}

.view.active {
  display: grid;
}

.warning {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: center;
  background: var(--warn-bg);
}

.warning-icon {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: var(--warn-icon);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.warning p {
  font-size: 14px;
  font-weight: 600;
}

.home-promo {
  text-align: center;
  padding: 22px 16px;
  border: 1px solid #cddaf5;
  background: linear-gradient(145deg, #f8fbff 0%, #edf4ff 100%);
  box-shadow: 0 12px 26px rgba(47, 91, 170, 0.14);
}

.home-days-caption {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #5c6f96;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.home-days-value {
  margin: 6px 0 0;
  font-size: 52px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: #2458b8;
}

.home-days-hint {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #4f6288;
}

.home-promo.is-active {
  border-color: #b9d0ff;
  background: linear-gradient(145deg, #f7fbff 0%, #e9f2ff 100%);
}

.home-promo.is-active .home-days-value {
  color: #2154b6;
}

.home-promo.is-expired {
  border-color: #f1c7cf;
  background: linear-gradient(145deg, #fff8f8 0%, #fff1f3 100%);
}

.home-promo.is-expired .home-days-value {
  color: #c13b53;
}

.home-promo.is-expired .home-days-hint {
  color: #8c4a56;
}

.home-promo.is-inactive {
  border-color: #d9e0ef;
  background: linear-gradient(145deg, #f8f9fc 0%, #f2f4f9 100%);
}

.home-promo.is-inactive .home-days-value {
  color: #6f7c96;
}

.home-promo.is-inactive .home-days-hint {
  color: #5f6b83;
}

.home-connect-btn {
  margin-top: 8px;
}

.balance {
  text-align: left;
}

.balance-history {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #dce6fa;
  text-align: left;
}

.payments-details {
  border: 1px solid #d7e3fb;
  border-radius: 12px;
  background: #f7faff;
  padding: 0;
  overflow: hidden;
}

.payments-details summary {
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #2e569f;
  padding: 10px 12px;
  background: linear-gradient(180deg, #eef4ff 0%, #e7f0ff 100%);
}

.payments-details summary::-webkit-details-marker {
  display: none;
}

.payments-details[open] summary {
  border-bottom: 1px solid #d6e1f9;
}

.payments-details-body {
  padding: 10px;
}

.payments-details-body .status-head h2 {
  font-size: 16px;
}

.status-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.status-card {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 10px;
  font-size: 14px;
}

.status-card.loading {
  color: var(--muted);
}

.status-active {
  color: var(--ok);
}

.status-inactive,
.status-expired {
  color: #b77521;
}

.history-list {
  margin-top: 8px;
  display: grid;
  gap: 9px;
}

.history-group {
  border: 1px solid #d4e0f8;
  border-radius: 13px;
  padding: 8px;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f6ff 100%);
}

.history-date {
  font-size: 12px;
  font-weight: 600;
  color: #3f5d93;
  letter-spacing: 0.02em;
  margin: 2px 3px 7px;
}

.history-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #dfe8fa;
  border-radius: 11px;
  background: #ffffff;
  padding: 9px 10px;
}

.history-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.history-dot {
  margin-top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: linear-gradient(135deg, #3c7afe 0%, #63a5ff 100%);
  box-shadow: 0 0 0 3px #e9f1ff;
  flex-shrink: 0;
}

.history-title {
  font-size: 13px;
  font-weight: 600;
}

.history-meta {
  font-size: 11px;
  color: #74839b;
}

.history-amount {
  font-size: 14px;
  font-weight: 600;
  color: #16784f;
}

.history-empty {
  border: 1px dashed #cdd7eb;
  border-radius: 11px;
  padding: 11px;
  color: #6a7790;
  font-size: 13px;
}

.devices-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.devices-slots {
  font-size: 13px;
  font-weight: 600;
  color: #5f6d86;
}

.device-add-row {
  margin-top: 9px;
  display: grid;
  gap: 7px;
}

.devices-list {
  margin-top: 8px;
  display: grid;
  gap: 7px;
}

.device-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 9px;
  display: grid;
  gap: 4px;
}

.device-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.device-name {
  font-size: 14px;
  font-weight: 600;
}

.device-type {
  font-size: 12px;
  color: #4f6080;
  background: #edf3ff;
  border-radius: 999px;
  padding: 3px 8px;
}

.device-meta {
  font-size: 12px;
  color: #6c7c95;
}

.device-actions {
  margin-top: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.device-actions .ghost-btn {
  padding: 8px 7px;
  font-size: 12px;
  margin-top: 0;
}

.device-delete-btn {
  border: 0;
  border-radius: 10px;
  padding: 8px 7px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: #e04f4f;
  cursor: pointer;
}

.device-delete-btn:hover {
  background: #c74343;
}

.device-empty {
  border: 1px dashed #cdd7eb;
  border-radius: 12px;
  padding: 11px;
  font-size: 13px;
  color: #627089;
}

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

.plan-option {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 4px;
  text-align: left;
  cursor: pointer;
}

.plan-option.active {
  border-color: #5a90ff;
  background: #f2f7ff;
  box-shadow: inset 0 0 0 1px #5a90ff;
}

.plan-title-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.plan-name {
  font-size: 15px;
  font-weight: 600;
}

.plan-price {
  font-size: 21px;
  font-weight: 600;
}

.plan-meta {
  color: var(--muted);
  font-size: 13px;
}

.device-selector {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px;
  background: #f8fbff;
}

.selector-title {
  font-size: 14px;
  font-weight: 600;
}

.counter-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
}

.counter-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 22px;
  color: #1d2b47;
  cursor: pointer;
}

.counter-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.counter-value {
  min-width: 44px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
}

.summary-box {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px;
  background: #f6f9ff;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  padding: 3px 0;
}

.summary-line.total {
  margin-top: 5px;
  border-top: 1px dashed #d3ddf0;
  padding-top: 8px;
  font-size: 15px;
  font-weight: 600;
}

.primary-btn,
.ghost-btn {
  border-radius: 12px;
  border: 0;
  padding: 11px 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.primary-btn {
  width: 100%;
  margin-top: 10px;
  color: #fff;
  background: var(--primary);
  transition: transform 0.14s ease, background-color 0.14s ease;
}

.primary-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.ghost-btn {
  color: #2d63cb;
  background: #edf3ff;
  transition: transform 0.14s ease, background-color 0.14s ease;
}

.ghost-btn:hover {
  transform: translateY(-1px);
  background: #e6eeff;
}

.primary-btn:disabled,
.ghost-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.keys-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.keys-sections-nav {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.keys-tab-btn {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f6f9ff;
  color: #4f6285;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 10px;
  cursor: pointer;
}

.keys-tab-btn.active {
  background: #e9f0ff;
  border-color: #9eb8ed;
  color: #2b4f94;
  box-shadow: inset 0 0 0 1px #8fb0ec;
}

.keys-section {
  display: none;
}

.keys-section.active {
  display: block;
}

.keys-subtitle {
  font-size: 17px;
  font-weight: 600;
}

.keys-devices {
  margin-top: 9px;
}

.subscriptions-tools {
  margin-top: 9px;
  border: 1px solid #d9e4fb;
  border-radius: 12px;
  padding: 10px;
  background: #f7faff;
}

.subscriptions-devices-btn {
  width: 100%;
  margin-top: 8px;
}

.key-item {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0;
  background: #fcfdff;
  overflow: hidden;
  transition:
    transform 180ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease,
    opacity 220ms ease,
    height 260ms cubic-bezier(0.2, 0.72, 0.22, 1),
    margin 240ms ease,
    border-width 220ms ease;
}

.key-item.clickable {
  cursor: pointer;
}

.key-item.clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(47, 82, 145, 0.14);
}

.key-item.expanded {
  border-color: #8eb3fd;
  box-shadow: 0 12px 22px rgba(52, 90, 164, 0.16);
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
}

.key-main-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px;
  display: grid;
  gap: 3px;
  cursor: inherit;
  transition: background-color 180ms ease;
}

.key-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.key-expand-indicator {
  flex-shrink: 0;
  color: #5f7bbb;
  font-size: 18px;
  line-height: 1;
  transition: transform 220ms ease, color 180ms ease;
}

.key-main-btn:focus-visible {
  outline: 2px solid #6a9bff;
  outline-offset: -2px;
}

.key-title {
  font-size: 14px;
  font-weight: 600;
}

.key-meta {
  font-size: 13px;
  color: #627089;
}

.key-status-block {
  margin-top: 6px;
  border: 1px solid #d8e3f8;
  border-radius: 11px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
  padding: 8px 9px;
  display: grid;
  gap: 6px;
}

.key-status-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #61739a;
}

.key-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.key-status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
}

.key-status-chip.is-active {
  color: #116a47;
  background: #e8f9f1;
  border: 1px solid #b8ead2;
}

.key-status-chip.is-expired {
  color: #a4511a;
  background: #fff2e5;
  border: 1px solid #f3d2b5;
}

.key-status-chip.is-inactive,
.key-status-chip.is-unknown {
  color: #5d6a84;
  background: #edf2fc;
  border: 1px solid #d2ddf4;
}

.key-days-left {
  font-size: 12px;
  font-weight: 600;
  color: #2f4f88;
}

.key-status-meta {
  font-size: 12px;
  color: #5f6f8e;
}

.key-config-link {
  margin-top: 4px;
  font-size: 11px;
  color: #2e5cb6;
  overflow-wrap: anywhere;
  background: #edf3ff;
  border: 1px dashed #bfd1f4;
  border-radius: 9px;
  padding: 6px 8px;
}

.key-hint {
  margin-top: 2px;
  font-size: 11px;
  color: #8491a7;
}

.key-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-top: 1px solid transparent;
  padding: 0 10px;
  background: #f8fbff;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-5px);
  transition: max-height 260ms cubic-bezier(0.2, 0.72, 0.22, 1), opacity 180ms ease, transform 220ms ease, padding 220ms ease,
    border-color 220ms ease;
}

.key-item.expanded .key-actions {
  max-height: 124px;
  opacity: 1;
  transform: translateY(0);
  border-top-color: #d7e3fa;
  padding: 9px 10px 10px;
}

.key-item.expanded .key-expand-indicator {
  transform: rotate(180deg);
  color: #2d63cb;
}

.key-item.is-processing {
  opacity: 0.72;
  pointer-events: none;
}

.key-item.is-removing {
  opacity: 0;
  transform: translateY(-8px) scale(0.985);
  height: 0 !important;
  margin: 0 !important;
  border-width: 0;
}

.key-copy-btn,
.key-delete-btn {
  border: 0;
  border-radius: 10px;
  padding: 9px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

.key-lock-note {
  display: grid;
  place-items: center;
  border-radius: 10px;
  padding: 9px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #8d4f12;
  border: 1px solid #f4d49b;
  background: linear-gradient(180deg, #fff9ee 0%, #fff4df 100%);
}

.key-copy-btn {
  background: #23a96b;
}

.key-copy-btn:hover {
  background: #1f975f;
}

.key-delete-btn {
  background: #e04f4f;
}

.key-delete-btn:hover {
  background: #c74343;
}

.key-empty {
  border: 1px dashed #cdd7eb;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  color: #627089;
}

.debug {
  border-style: dashed;
}

.hidden {
  display: none;
}

.debug-row {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  font-size: 14px;
}

.notice {
  min-height: 18px;
  margin-top: 2px;
  font-size: 13px;
  color: #4d5b72;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.notice.error {
  border: 1px solid #f0c7c7;
  border-radius: 12px;
  padding: 9px 11px;
  background: #fff5f5;
  color: #b93131;
}

.notice.success {
  border: 1px solid #bfe6d1;
  border-radius: 12px;
  padding: 9px 11px;
  background: #f2fcf6;
  color: #116a47;
}

.notice.warning {
  border: 1px solid #f4d49b;
  border-radius: 12px;
  padding: 10px 11px;
  background: linear-gradient(180deg, #fff9ee 0%, #fff4df 100%);
  color: #8d4f12;
  font-weight: 600;
  box-shadow: 0 8px 16px rgba(190, 130, 36, 0.14);
}

.support-callout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid #b6caf3;
  background: linear-gradient(145deg, #f3f7ff, #e8f0ff);
  border-radius: 14px;
  padding: 11px;
  box-shadow: 0 8px 18px rgba(52, 95, 172, 0.13);
}

.faq .support-callout {
  margin-top: 8px;
  margin-bottom: 8px;
}

.support-label {
  font-size: 14px;
  font-weight: 600;
  color: #2c4f93;
}

.support-text {
  margin-top: 2px;
  font-size: 12px;
  color: #5f7091;
}

.support-btn {
  flex-shrink: 0;
  text-decoration: none;
  background: #2f6ce0;
  color: #fff;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 600;
}

.support-btn:hover {
  background: #275bc1;
}

.referral-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.referral-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: #eaf1ff;
  font-size: 16px;
}

.ref-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: #1e7a55;
  background: #e7fbf2;
  border: 1px solid #bcebd5;
  border-radius: 999px;
  padding: 3px 8px;
}

.ref-step {
  margin-top: 5px;
  color: #4d5d79;
  font-size: 13px;
}

.ref-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ref-actions .primary-btn,
.ref-actions .ghost-btn {
  margin-top: 0;
  width: 100%;
}

.install-links {
  margin-top: 9px;
  display: grid;
  gap: 7px;
}

.install-link {
  display: block;
  text-decoration: none;
  color: #274372;
  background: #f7faff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 600;
}

.install-link:hover {
  background: #edf4ff;
}

.faq-item {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0;
  background: #f9fbff;
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  padding: 12px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "expand_more";
  font-family: "Material Symbols Rounded";
  font-size: 20px;
  line-height: 1;
  color: #6f7f9e;
  transition: transform 220ms ease, color 180ms ease;
}

.faq-item p {
  margin-top: 0;
  padding: 0 12px;
  font-size: 13px;
  color: #5f6e87;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 260ms cubic-bezier(0.2, 0.72, 0.22, 1), opacity 200ms ease, margin-top 220ms ease;
}

.faq-item[open] {
  border-color: #bdd0f6;
  box-shadow: inset 0 0 0 1px #d5e2fb;
}

.faq-item[open] summary::after {
  transform: rotate(180deg);
  color: #3a74ea;
}

.faq-item[open] p {
  max-height: 220px;
  opacity: 1;
  margin-top: 4px;
  padding-bottom: 12px;
}

.support-btn-wide {
  margin-top: 10px;
  display: block;
  text-align: center;
}

.setup-flow {
  background: transparent;
}

.setup-shell {
  width: 100%;
  min-height: calc(100vh - 106px);
  background: #f0f2f8;
  border: 1px solid #d8dfeb;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.setup-header {
  background: #fff;
  border-bottom: 1px solid #dde4f1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
}

.setup-back-btn {
  border: 0;
  background: transparent;
  color: #3b7bff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.setup-header-title {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #4f5a70;
}

.setup-step {
  display: none;
  align-content: start;
  justify-items: center;
  gap: 8px;
  padding: 22px 18px;
}

.setup-step.active {
  display: grid;
}

.setup-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #edf4ff;
  border: 1px solid #d6e3fd;
  color: #386fda;
}

.setup-icon .material-symbols-rounded {
  font-size: 32px;
}

.setup-kicker {
  color: #848da1;
  font-size: 16px;
}

.setup-step h2 {
  text-align: center;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.setup-muted {
  text-align: center;
  color: #5f6a82;
  font-size: 16px;
}

.setup-device-list {
  margin-top: 10px;
  width: 100%;
  border: 1px solid #dce3f1;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.setup-device-option {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e4eaf6;
  background: #fff;
  padding: 13px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 23px;
  font-weight: 600;
  cursor: pointer;
}

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

.setup-device-label .material-symbols-rounded {
  font-size: 22px;
  color: #4f5a73;
}

.setup-device-option:last-child {
  border-bottom: 0;
}

.setup-device-option.active {
  background: #edf4ff;
}

.setup-radio {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid #c2c9d8;
}

.setup-device-option.active .setup-radio {
  border-color: #3d7dff;
  box-shadow: inset 0 0 0 6px #3d7dff;
}

.setup-store-list {
  margin-top: 10px;
  width: 100%;
  display: grid;
  gap: 8px;
}

.setup-store-link {
  display: block;
  width: 100%;
  text-decoration: none;
  border-radius: 12px;
  border: 1px solid #cad7f3;
  background: #ecf3ff;
  color: #2d63cb;
  text-align: center;
  padding: 14px;
  font-size: 17px;
  font-weight: 600;
}

.setup-config-url {
  margin-top: 10px;
  width: 100%;
  border: 1px solid #d8e1f4;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  color: #2e3d5f;
  overflow-wrap: anywhere;
}

.setup-details {
  width: 100%;
  border: 1px solid #dbe2f1;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.setup-details summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  padding: 11px 12px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.setup-details summary::-webkit-details-marker {
  display: none;
}

.setup-details summary::after {
  content: "expand_more";
  font-family: "Material Symbols Rounded";
  font-size: 20px;
  line-height: 1;
  color: #6f7f9e;
  transition: transform 220ms ease, color 180ms ease;
}

.setup-details-body {
  border-top: 1px solid transparent;
  padding: 0 12px;
  display: grid;
  gap: 7px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 260ms cubic-bezier(0.2, 0.72, 0.22, 1),
    opacity 200ms ease,
    padding 220ms ease,
    border-color 220ms ease;
}

.setup-details[open] {
  border-color: #bfd2f8;
  box-shadow: inset 0 0 0 1px #d8e4fb;
}

.setup-details[open] .setup-details-body {
  border-top-color: #e2e9f7;
  max-height: 260px;
  opacity: 1;
  padding: 10px 12px;
}

.setup-details[open] summary::after {
  transform: rotate(180deg);
  color: #3a74ea;
}

@keyframes details-content-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.setup-details-body a {
  color: #2f69d8;
  text-decoration: none;
  font-weight: 600;
}

.setup-error {
  width: 100%;
  border: 1px solid #f0c0c0;
  background: #fff2f2;
  color: #b83838;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
}

.setup-inline-warning {
  width: 100%;
  margin-top: 8px;
  border: 1px solid #f4d49b;
  border-radius: 12px;
  padding: 10px 11px;
  background: linear-gradient(180deg, #fff9ee 0%, #fff4df 100%);
  color: #8d4f12;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 16px rgba(190, 130, 36, 0.14);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 14px));
  bottom: 8px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  background: #ffffffd6;
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 8px 20px rgba(29, 50, 87, 0.15);
}

.bottom-nav.hidden {
  display: none;
}

.nav-btn {
  border: 0;
  border-radius: 11px;
  padding: 8px 5px;
  display: grid;
  place-items: center;
  gap: 2px;
  font-size: 11px;
  background: transparent;
  color: #6e7990;
  cursor: pointer;
  transition: color 0.14s ease, background-color 0.14s ease, transform 0.14s ease;
}

.nav-btn.active {
  color: var(--primary);
  background: #ecf2ff;
  font-weight: 600;
}

.nav-btn:active {
  transform: translateY(1px);
}

.nav-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 360px) {
  .home-days-value {
    font-size: 44px;
  }

  .home-days-hint {
    font-size: 14px;
  }

  .topbar-balance-value {
    font-size: 28px;
  }

  .setup-step h2 {
    font-size: 34px;
  }

  .setup-device-option {
    font-size: 23px;
  }

  .support-callout {
    align-items: flex-start;
    flex-direction: column;
  }

  .support-btn {
    width: 100%;
    text-align: center;
  }

  .ref-actions {
    grid-template-columns: 1fr;
  }

  .key-actions {
    grid-template-columns: 1fr;
  }

  .device-actions {
    grid-template-columns: 1fr;
  }
}

/* === Design Refresh === */
:root {
  --bg-top: #e7eefb;
  --bg-bottom: #f4f7ff;
  --card: #ffffff;
  --text: #101725;
  --muted: #66728a;
  --line: #d8e2f4;
  --primary: #3772ff;
  --primary-dark: #2a60de;
  --success: #1b9b65;
  --danger: #c94260;
}

body {
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, #d8e6ff 0%, transparent 60%),
    radial-gradient(1000px 420px at 100% -20%, #dbe9ff 0%, transparent 58%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.app-shell {
  width: min(440px, calc(100vw - 16px));
  margin: 10px auto 18px;
  gap: 12px;
}

.card {
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 16px 34px rgba(37, 69, 128, 0.1);
  padding: 14px;
}

.card::after {
  display: none;
}

.view.active .card {
  animation: rise-in 280ms cubic-bezier(0.2, 0.65, 0.2, 1) both;
}

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

h1,
h2 {
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 30px;
  font-weight: 700;
}

h2 {
  font-size: 19px;
  font-weight: 700;
}

.topbar {
  background: linear-gradient(145deg, #ffffff 0%, #f5f9ff 100%);
  border-color: #d2def6;
}

.topbar-main {
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.brand-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #d3def2;
}

.brand-icon {
  width: 30px;
  height: 30px;
}

.brand-title {
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 21px;
  font-weight: 700;
}

.topbar-balance-value {
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 24px;
  font-weight: 700;
}

.warning {
  border-color: #f4ddb6;
  background: linear-gradient(145deg, #fffaf1 0%, #fff3df 100%);
}

.warning-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.warning p {
  font-size: 13px;
  font-weight: 600;
}

.home-promo {
  padding: 18px;
  border-color: #c4d7ff;
  background: linear-gradient(145deg, #eef5ff 0%, #e3eeff 100%);
}

.home-days-caption {
  color: #4f5f84;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.home-days-value {
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 56px;
  margin-top: 7px;
}

.home-days-hint {
  font-size: 14px;
  margin-top: 6px;
}

.status-head {
  align-items: center;
}

.status-card {
  border-radius: 14px;
  padding: 12px;
}

.history-group {
  border-radius: 15px;
}

.history-row {
  border-radius: 13px;
  padding: 10px 11px;
}

.history-title {
  font-weight: 600;
}

.history-amount {
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
}

.primary-btn,
.ghost-btn,
.counter-btn,
.input,
.install-link,
.faq-item,
.plan-option,
.summary-box,
.device-item,
.key-item,
.subscriptions-tools {
  border-radius: 14px;
}

.primary-btn {
  background: linear-gradient(145deg, var(--primary) 0%, #4d85ff 100%);
  box-shadow: 0 10px 20px rgba(56, 106, 211, 0.28);
  font-weight: 700;
}

.primary-btn:hover {
  background: linear-gradient(145deg, var(--primary-dark) 0%, #3b71e8 100%);
  transform: translateY(-1px);
}

.ghost-btn {
  background: #edf3ff;
  color: #2f61c7;
  font-weight: 600;
}

.plan-option {
  border-color: #d4dff3;
  padding: 12px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
}

.plan-option.active {
  border-color: #8fb2ff;
  box-shadow: inset 0 0 0 1px #8fb2ff;
  background: linear-gradient(145deg, #eff5ff 0%, #e6efff 100%);
}

.plan-price {
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
}

.device-selector,
.summary-box {
  border-color: #d5dff2;
  background: linear-gradient(145deg, #f8fbff 0%, #f1f6ff 100%);
}

.counter-btn {
  border-color: #cfd9f0;
}

.counter-value {
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
}

.key-main-btn {
  padding: 12px;
}

.key-title {
  font-weight: 700;
}

.key-config-link {
  border-radius: 11px;
}

.key-actions {
  background: #f4f8ff;
}

.device-item {
  background: linear-gradient(145deg, #ffffff 0%, #f7faff 100%);
}

.device-name {
  font-weight: 700;
}

.referral {
  background: linear-gradient(145deg, #ffffff 0%, #f7faff 100%);
}

.referral-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.ref-badge {
  font-weight: 700;
}

.install {
  background: linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
}

.install-link {
  border-color: #d4dff5;
  background: #f2f7ff;
}

.faq-item {
  border-color: #d4def2;
  background: #f8fbff;
}

.support-callout {
  border-color: #b9ccf4;
  background: linear-gradient(145deg, #f4f8ff 0%, #e8f1ff 100%);
}

.support-btn {
  background: linear-gradient(145deg, #3f77e9 0%, #2f63ce 100%);
}

.setup-shell {
  border-radius: 24px;
  border-color: #c9d8f6;
  background: linear-gradient(180deg, #edf3ff 0%, #e8f0ff 100%);
}

.setup-header {
  border-bottom-color: #d3def4;
  background: #ffffff;
}

.setup-step {
  padding: 24px 18px;
}

.setup-step h2 {
  font-size: 32px;
  font-weight: 700;
}

.setup-kicker {
  font-size: 14px;
}

.setup-icon {
  border-radius: 18px;
  width: 58px;
  height: 58px;
}

.setup-device-list,
.setup-details,
.setup-config-url {
  border-radius: 16px;
}

.setup-device-option {
  font-size: 20px;
  padding: 14px 14px;
}

.setup-store-link {
  background: #f1f6ff;
  border-color: #c8d8f8;
  padding: 13px 12px;
}

.setup-config-url {
  background: #ffffff;
}

.setup-error {
  border-radius: 12px;
}

.bottom-nav {
  width: min(440px, calc(100vw - 16px));
  border-radius: 18px;
  border-color: #d0dbf3;
  padding: 7px;
  box-shadow: 0 14px 28px rgba(31, 56, 103, 0.18);
}

.nav-btn {
  border-radius: 12px;
  padding: 9px 5px;
  font-size: 11px;
}

.nav-btn.active {
  background: #e8f0ff;
}

@media (max-width: 390px) {
  .home-days-value {
    font-size: 48px;
  }

  .setup-step h2 {
    font-size: 28px;
  }

  .setup-device-option {
    font-size: 17px;
  }
}

@media (max-width: 430px) {
  .app-shell {
    width: calc(100vw - 10px);
    margin: 8px auto 14px;
    gap: 9px;
  }

  .card {
    padding: 11px;
    border-radius: 18px;
  }

  .topbar-balance-value {
    font-size: 22px;
  }

  .brand-title {
    font-size: 19px;
  }

  .bottom-nav {
    width: calc(100vw - 10px);
    bottom: 6px;
  }
}

/* Motion pass */
.view.active > .card {
  animation: card-enter 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--card-idx, 0) * 55ms);
}

.view.active > .card:nth-of-type(1) {
  --card-idx: 0;
}
.view.active > .card:nth-of-type(2) {
  --card-idx: 1;
}
.view.active > .card:nth-of-type(3) {
  --card-idx: 2;
}
.view.active > .card:nth-of-type(4) {
  --card-idx: 3;
}
.view.active > .card:nth-of-type(5) {
  --card-idx: 4;
}
.view.active > .card:nth-of-type(6) {
  --card-idx: 5;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.history-row,
.plan-option,
.key-item,
.device-item,
.faq-item,
.install-link {
  animation: item-enter 360ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.history-row:nth-child(1),
.plan-option:nth-child(1),
.key-item:nth-child(1),
.device-item:nth-child(1),
.faq-item:nth-child(1),
.install-link:nth-child(1) {
  animation-delay: 35ms;
}

.history-row:nth-child(2),
.plan-option:nth-child(2),
.key-item:nth-child(2),
.device-item:nth-child(2),
.faq-item:nth-child(2),
.install-link:nth-child(2) {
  animation-delay: 70ms;
}

.history-row:nth-child(3),
.plan-option:nth-child(3),
.key-item:nth-child(3),
.device-item:nth-child(3),
.faq-item:nth-child(3) {
  animation-delay: 100ms;
}

.history-row:nth-child(4),
.plan-option:nth-child(4),
.key-item:nth-child(4),
.device-item:nth-child(4),
.faq-item:nth-child(4) {
  animation-delay: 130ms;
}

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

.primary-btn,
.ghost-btn,
.nav-btn,
.counter-btn,
.setup-device-option {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.primary-btn:hover,
.ghost-btn:hover,
.counter-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:active,
.ghost-btn:active,
.counter-btn:active,
.nav-btn:active,
.setup-device-option:active {
  transform: translateY(1px) scale(0.99);
}

.nav-btn.active {
  animation: nav-bump 280ms ease;
}

@keyframes nav-bump {
  0% {
    transform: scale(0.94);
  }
  65% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

.status-card.loading {
  position: relative;
  overflow: hidden;
}

.status-card.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(120%);
  }
}

.setup-step.active {
  animation: step-enter 360ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.step-pop {
  animation: step-pop 360ms cubic-bezier(0.22, 0.68, 0.18, 1) both;
}

@keyframes step-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes step-pop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.home-promo.is-active .home-days-value {
  animation: soft-glow 2.2s ease-in-out infinite;
}

@keyframes soft-glow {
  0%,
  100% {
    text-shadow: 0 0 0 rgba(36, 88, 184, 0);
  }
  50% {
    text-shadow: 0 0 14px rgba(69, 133, 255, 0.28);
  }
}

.value-pop {
  animation: value-pop 460ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.counter-pop {
  animation: counter-pop 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.panel-pop {
  animation: panel-pop 460ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.status-pop {
  animation: status-pop 460ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes value-pop {
  0% {
    transform: scale(0.96);
    opacity: 0.8;
  }
  60% {
    transform: scale(1.04);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes panel-pop {
  0% {
    transform: translateY(3px) scale(0.99);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes counter-pop {
  0% {
    transform: scale(0.95);
  }
  65% {
    transform: scale(1.07);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes status-pop {
  0% {
    transform: scale(0.985);
    opacity: 0.85;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Advanced motion layer */
.view {
  will-change: transform, opacity;
}

.view.active,
.view.view-enter {
  display: grid;
}

.view.view-enter.from-right {
  animation: view-slide-in-right 320ms cubic-bezier(0.2, 0.72, 0.22, 1) both;
}

.view.view-enter.from-left {
  animation: view-slide-in-left 320ms cubic-bezier(0.2, 0.72, 0.22, 1) both;
}

.view.view-enter:not(.from-right):not(.from-left) {
  animation: view-fade-in 260ms ease both;
}

@keyframes view-slide-in-right {
  from {
    opacity: 0;
    transform: translateX(22px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes view-slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-22px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.setup-header-title {
  display: grid;
  justify-items: center;
  gap: 7px;
}

.setup-progress {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
}

.setup-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ccd8ee;
  transition: transform 260ms ease, background-color 260ms ease, box-shadow 260ms ease;
}

.setup-progress-dot.done {
  background: #8baef4;
}

.setup-progress-dot.active {
  background: #3a74ea;
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(58, 116, 234, 0.18);
}

.setup-device-option.active {
  animation: setup-option-hit 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes setup-option-hit {
  0% {
    transform: scale(0.985);
  }
  70% {
    transform: scale(1.015);
  }
  100% {
    transform: scale(1);
  }
}

.setup-store-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(59, 112, 214, 0.2);
}

.setup-store-link:active {
  transform: translateY(1px) scale(0.99);
}

.stagger-item {
  animation: stagger-in 360ms cubic-bezier(0.2, 0.72, 0.22, 1) both;
  animation-delay: calc(var(--stagger-index, 0) * 34ms);
}

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

.skeleton {
  position: relative;
  overflow: hidden;
  border: 1px solid #d6e1f8;
  border-radius: 13px;
  background: linear-gradient(145deg, #f1f5ff 0%, #e9f0ff 100%);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.58) 50%, transparent 75%);
  animation: shimmer 1.05s linear infinite;
}

.history-skeleton {
  height: 64px;
}

.device-skeleton {
  height: 116px;
}

.key-skeleton {
  height: 130px;
}

.notice-pop {
  animation: notice-pop 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes notice-pop {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.button-pop {
  animation: button-pop 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes button-pop {
  0% {
    transform: scale(0.98);
  }
  60% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

.action-success {
  background: #1da367 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 16px rgba(24, 140, 89, 0.3);
}

.action-error {
  background: #d94d4d !important;
  color: #ffffff !important;
  box-shadow: 0 8px 16px rgba(206, 64, 64, 0.28);
}

.nav-click-pop {
  animation: nav-click-pop 220ms ease;
}

@keyframes nav-click-pop {
  0% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1);
  }
}

.keys-section.active {
  animation: keys-section-enter 280ms cubic-bezier(0.2, 0.72, 0.22, 1) both;
}

@keyframes keys-section-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-pop {
  animation: section-pop 320ms cubic-bezier(0.22, 0.68, 0.18, 1);
}

@keyframes section-pop {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.setup-step.step-forward {
  animation: setup-step-forward 300ms cubic-bezier(0.2, 0.72, 0.22, 1) both;
}

.setup-step.step-backward {
  animation: setup-step-backward 300ms cubic-bezier(0.2, 0.72, 0.22, 1) both;
}

@keyframes setup-step-forward {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes setup-step-backward {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.setup-option-active-pulse {
  animation: setup-option-active-pulse 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes setup-option-active-pulse {
  0% {
    transform: scale(0.985);
  }
  70% {
    transform: scale(1.015);
  }
  100% {
    transform: scale(1);
  }
}

/* Setup header tune */
.setup-header {
  padding: 10px 12px;
  min-height: 68px;
  grid-template-columns: 92px 1fr 92px;
}

.setup-header > :last-child {
  width: 92px;
}

.setup-back-btn {
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  padding: 7px 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-8px);
  transition: background-color 180ms ease, color 180ms ease, transform 220ms ease, opacity 220ms ease, visibility 220ms ease;
}

.setup-back-btn.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.setup-back-btn:hover {
  background: #eaf1ff;
}

.setup-back-btn:active {
  transform: translateY(1px);
}

.back-enter-pop {
  animation: back-enter-pop 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes back-enter-pop {
  0% {
    opacity: 0;
    transform: translateX(-10px);
  }
  65% {
    opacity: 1;
    transform: translateX(2px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.setup-header-title > span {
  font-size: 15px;
  font-weight: 700;
  color: #4a5a78;
  line-height: 1.15;
}

.setup-progress {
  gap: 7px;
}

.setup-progress-dot {
  width: 9px;
  height: 9px;
}

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