:root {
  --bg: #f4f5f7;
  --bg-soft: #eef1f4;
  --panel: #ffffff;
  --panel-soft: #f2f4f7;
  --border: #d8dde5;
  --border-strong: #c7ced8;
  --text: #191c20;
  --muted: #69717d;
  --accent: #b11127;
  --accent-soft: #fff1ef;
  --accent-dark: #1e2b39;
  --ok: #2d8a57;
  --ok-bg: #edf8f1;
  --danger: #cf3d31;
  --danger-bg: #fff1ef;
  --info: #205ecf;
  --info-bg: #edf3ff;
  --shadow: 0 8px 24px rgba(20, 24, 31, 0.06);
  --radius-xl: 10px;
  --radius-lg: 8px;
  --radius-md: 6px;
  --max-width: 1440px;
  --font-ui: "Stapel", "Avenir Next", "Segoe UI Variable", "Segoe UI", sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font-ui);
  background: linear-gradient(180deg, #f7f8fa 0%, #eef1f4 100%);
  color: var(--text);
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

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

button,
textarea,
input {
  font: inherit;
}

pre,
.mono {
  font-family: "SFMono-Regular", "JetBrains Mono", "Menlo", monospace;
}

.page {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1.2rem 0 2rem;
}

.screen-head {
  position: relative;
  z-index: 35;
  margin-bottom: 1rem;
}

.screen-head__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.page-title {
  margin: 0;
  font-size: clamp(2rem, 2.6vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.lead-text,
.intro-card__copy,
.panel__text,
.field__label,
.package-tile__label,
.package-tile__meta {
  color: var(--muted);
}

.panel__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  color: var(--muted);
}

.login-screen {
  display: grid;
  gap: 1.35rem;
  justify-items: stretch;
  align-content: center;
  max-width: 28rem;
  min-height: calc(100vh - 6rem);
  margin: 0 auto;
  padding-block: 2rem;
}

.lead-text {
  max-width: 26rem;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
}

.login-copy {
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  text-align: center;
  min-width: 0;
}

.login-copy .page-title {
  font-size: clamp(2.45rem, 5vw, 3.6rem);
  line-height: 0.94;
}

.login-card,
.intro-card,
.workspace-card,
.modal__dialog {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card,
.intro-card,
.workspace-card,
.modal__dialog {
  border-radius: var(--radius-xl);
}

.login-card {
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: 1.35rem;
  border-radius: 20px;
  box-shadow: 0 16px 36px rgba(20, 24, 31, 0.08);
}

.login-card__title,
.section-title {
  margin: 0;
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  line-height: 1.08;
}

.login-card__header {
  display: grid;
  gap: 0.3rem;
}

.login-card__copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.panel__text {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.intro-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

.intro-card__copy {
  flex: 1 1 auto;
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.55;
}

.intro-card__meta {
  display: flex;
  align-items: stretch;
  gap: 0.7rem;
  flex-wrap: nowrap;
  margin-left: auto;
}

.wallet-card,
.account-button {
  display: inline-flex;
  align-items: center;
  min-height: 3.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.wallet-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-width: 20rem;
  padding: 0.4rem;
}

.wallet-card__summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.15rem 0 0.3rem;
  min-width: 0;
  flex: 1 1 auto;
}

.wallet-card__meta-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.wallet-card__label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wallet-card__balance {
  display: flex;
  align-items: baseline;
  gap: 0.38rem;
  white-space: nowrap;
}

.wallet-card__balance strong {
  font-size: 1.3rem;
  line-height: 1;
}

.wallet-card__balance span {
  color: var(--muted);
  font-size: 0.82rem;
}

.wallet-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.25rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--accent-dark);
  border-radius: var(--radius-md);
  background: var(--accent-dark);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.wallet-card__action:hover {
  background: #243444;
  border-color: #243444;
}

.account-menu {
  position: relative;
  min-width: 15rem;
  z-index: 50;
}

.account-button {
  width: 100%;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 4rem;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
}

.account-button__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 0.78rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.account-button__text {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

.account-button__name {
  font-size: 0.98rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-button__sub {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.1;
}

.account-button__balance {
  display: none;
  min-width: 0;
  text-align: right;
}

.account-button__balance-label {
  display: block;
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-button__balance strong {
  display: block;
  font-size: 1rem;
  line-height: 1;
}

.account-button__caret {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.18s ease;
}

.account-menu.is-open .account-button__caret {
  transform: rotate(180deg);
}

.account-menu__panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 80;
  width: 100%;
  min-width: 14rem;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.account-menu__identity {
  display: grid;
  gap: 0.14rem;
  padding: 0.35rem 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.35rem;
}

.account-menu__identity span {
  color: var(--muted);
  font-size: 0.84rem;
}

.account-menu__section {
  display: grid;
  gap: 0.45rem;
  padding: 0.35rem 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.35rem;
}

.account-menu__section-title {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-switch__button {
  min-width: 3rem;
  min-height: 2.35rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.lang-switch__button.is-active {
  border-color: var(--border-strong);
  background: var(--panel);
  color: var(--text);
}

.account-menu__link {
  display: block;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-md);
  font-weight: 700;
}

.account-menu__link--button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.account-menu__action {
  display: none;
  width: 100%;
  min-height: 2.85rem;
  margin: 0.1rem 0 0.35rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--accent-dark);
  border-radius: var(--radius-md);
  background: var(--accent-dark);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.account-menu__link:hover {
  background: var(--panel-soft);
}

.user-chip,
.soft-button,
.energy-pill,
.status-pill,
.icon-button,
.package-tile {
  border-radius: var(--radius-lg);
}

.user-chip,
.soft-button,
.energy-pill,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.3rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  background: var(--panel);
}

.user-chip {
  min-width: 11.5rem;
  justify-content: flex-start;
}

.user-chip__icon,
.energy-pill__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.user-chip__icon {
  background: var(--bg-soft);
}

.user-chip__name {
  font-weight: 700;
  white-space: nowrap;
}

.soft-button,
.primary-button,
.icon-button {
  cursor: pointer;
}

.energy-pill {
  min-width: 6.5rem;
}

.energy-pill__icon {
  background: var(--accent);
  color: #fff;
}

.energy-pill strong {
  font-size: 1.05rem;
}

.workspace-card {
  padding: 1rem;
}

.email-settings-card__actions {
  display: flex;
  gap: 0.7rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.auth-email__form--inline {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  grid-auto-rows: minmax(0, 1fr);
}

.calc-panel,
.response-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0.85rem;
  height: 100%;
  min-height: 100%;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
}

.section-copy {
  margin: -0.15rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.field {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.45rem;
  height: 100%;
  min-height: 0;
}

.field__label {
  font-size: 0.92rem;
}

.editor-shell,
.response-shell {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  min-height: 14rem;
  height: 100%;
  display: grid;
}

.editor-shell {
  padding: 0.95rem;
}

.response-shell {
  min-height: 14rem;
  padding: 0.95rem 1rem;
}

.editor,
.input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
  outline: none;
}

.editor,
.input {
  padding: 0.9rem 1rem;
}

.editor {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  resize: vertical;
  line-height: 1.55;
}

.input {
  min-height: 3.2rem;
}

.editor:focus,
.input:focus {
  border-color: rgba(177, 17, 39, 0.35);
  box-shadow: 0 0 0 3px rgba(177, 17, 39, 0.08);
}

:where(a, button, textarea, input, [tabindex]):focus-visible {
  outline: 3px solid rgba(177, 17, 39, 0.22);
  outline-offset: 3px;
}

.panel__actions,
.response-actions {
  display: flex;
  align-items: flex-end;
  min-height: 3.4rem;
}

.panel__actions {
  justify-content: flex-start;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.4rem;
  min-width: 13rem;
  padding: 0.85rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--accent-dark);
  color: #fff;
  font-weight: 700;
}

.primary-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.primary-button:hover,
.soft-button:hover,
.wallet-card__action:hover,
.account-menu__action:hover,
.lang-switch__button:hover {
  transform: translateY(-1px);
}

.primary-button--wide {
  min-width: 16rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.status-pill--idle {
  min-height: 0;
  padding: 0.3rem 0.65rem;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.status-pill--success {
  border-color: rgba(45, 138, 87, 0.18);
  background: var(--ok-bg);
  color: var(--ok);
}

.status-pill--error {
  border-color: rgba(207, 61, 49, 0.22);
  background: var(--danger-bg);
  color: var(--danger);
}

.status-pill--info {
  border-color: rgba(32, 94, 207, 0.18);
  background: var(--info-bg);
  color: var(--info);
}

.response-box {
  min-height: 0;
  height: 100%;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  font-size: 0.96rem;
}

.response-box--empty {
  color: var(--muted);
}

.response-actions {
  justify-content: flex-end;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.soft-button--dark {
  background: var(--panel);
}

.is-hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  overflow-y: auto;
  padding: 1rem;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 28, 32, 0.38);
}

.modal__dialog {
  position: relative;
  width: min(calc(100% - 2rem), 720px);
  max-height: calc(100vh - 2rem);
  margin: 3vh auto;
  padding: 0.95rem 1rem 1rem;
  overflow-y: auto;
}

.modal__dialog--compact {
  width: min(calc(100% - 2rem), 580px);
}

.modal__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.icon-button {
  width: 3rem;
  min-width: 3rem;
  padding: 0;
  font-size: 1.4rem;
  line-height: 1;
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.package-tile {
  display: grid;
  gap: 0.28rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--panel);
  text-align: left;
  box-shadow: var(--shadow);
}

.package-tile:focus-visible {
  border-color: rgba(177, 17, 39, 0.42);
}

.package-tile strong {
  font-size: 1.78rem;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.package-tile__price {
  margin-top: 0.05rem;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
}

.package-tile.is-selected {
  border-color: rgba(177, 17, 39, 0.22);
  background: var(--accent-soft);
}

.package-tile.is-locked {
  cursor: not-allowed;
}

.package-tile.is-locked:not(.is-selected) {
  opacity: 0.58;
}

.purchase-row {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.purchase-row--single {
  justify-content: flex-start;
}

.purchase-primary-row {
  display: grid;
  justify-items: start;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.purchase-legal {
  max-width: 32rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.auth-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.auth-slot--telegram {
  margin-top: -0.05rem;
}

.telegram-fallback {
  display: grid;
  gap: 0.65rem;
  justify-items: center;
  padding: 0.75rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  text-align: center;
}

.telegram-fallback p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.auth-notice {
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.94rem;
  line-height: 1.45;
}

.auth-notice--info {
  background: rgba(9, 105, 218, 0.08);
  color: #0b4c97;
}

.auth-notice--error {
  background: rgba(177, 17, 39, 0.08);
  color: var(--danger);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.1rem 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
}

.auth-email {
  display: grid;
  gap: 0.8rem;
}

.auth-email__form {
  display: grid;
  gap: 0.75rem;
}

.auth-form-title {
  color: var(--text);
  font-weight: 700;
}

.auth-details {
  border-top: 1px solid var(--border);
  padding-top: 0.7rem;
}

.auth-details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.auth-details[open] summary {
  margin-bottom: 0.7rem;
  color: var(--text);
}

.auth-email__actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.auth-email__meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-email .input {
  min-height: 3.7rem;
  padding-inline: 1rem;
  border-radius: 12px;
}

.auth-email .primary-button,
.auth-email .soft-button {
  width: 100%;
  min-width: 0;
}

.purchase-result {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.purchase-result__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.purchase-feedback {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.purchase-result__hint {
  color: var(--muted);
  font-size: 0.86rem;
}

.response-actions--modal {
  justify-content: flex-start;
  min-height: 0;
}

.purchase-link-shell {
  display: grid;
  position: relative;
}

.purchase-link-box {
  min-height: 2.9rem;
  padding: 0.85rem 3.4rem 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #f7f9fc;
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-all;
}

.purchase-link-copy {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 2.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.purchase-link-copy:hover {
  border-color: var(--border-strong);
  background: var(--panel-soft);
}

.purchase-email-foot {
  display: grid;
  gap: 0.35rem;
  max-width: 20rem;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.purchase-email-foot .input {
  min-height: 2.7rem;
  padding: 0.65rem 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
}

.purchase-footer {
  display: grid;
  justify-content: flex-start;
  gap: 0.45rem;
  padding-top: 0.8rem;
  margin-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.settings-grid {
  display: grid;
  gap: 0.65rem;
}

.settings-password {
  display: grid;
  gap: 0.75rem;
}

.settings-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
}

.settings-summary__copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.settings-summary__copy strong {
  font-size: 1rem;
  word-break: break-word;
}

.settings-summary__label {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-summary__meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.section-copy--compact {
  min-height: 0;
  margin-bottom: 0.8rem;
}

.history-card {
  margin-top: 1rem;
}

.history-table-wrap {
  position: relative;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.history-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.history-col--status {
  width: 7.8rem;
}

.history-col--time {
  width: 10rem;
}

.history-col--request,
.history-col--response {
  width: calc((100% - 17.8rem) / 2);
}

.history-table th,
.history-table td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}

.history-table th {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

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

.history-table__wrap {
  max-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.history-table__narrow {
  white-space: normal;
}

.history-status {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

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

.history-status--error {
  color: var(--danger);
}

.history-kind {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.empty-state {
  padding: 1rem;
  color: var(--muted);
}

.history-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.history-page-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.history-pagination {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.history-pagination__button {
  min-width: 2.4rem;
  min-height: 2.4rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.history-pagination__button.is-active {
  border-color: var(--border-strong);
  background: var(--panel-soft);
}

.history-pagination__button:disabled {
  opacity: 0.45;
  cursor: default;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.intro-card,
.workspace-card,
.login-card {
  animation: fade-up 0.34s ease both;
}

.response-shell,
.history-table-wrap {
  position: relative;
}

.response-shell.is-loading::after,
.history-table-wrap.is-loading::after,
.purchase-link-shell.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.72) 50%, transparent 100%);
  animation: shimmer 1.05s ease infinite;
  pointer-events: none;
}

.primary-button.is-loading,
.soft-button.is-loading,
.wallet-card__action.is-loading,
.account-menu__action.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.primary-button.is-loading::after,
.soft-button.is-loading::after,
.wallet-card__action.is-loading::after,
.account-menu__action.is-loading::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.soft-button.is-loading::after {
  border-color: rgba(30, 43, 57, 0.2);
  border-top-color: var(--accent-dark);
}

@media (max-width: 1180px) {
  .workspace-grid,
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-screen {
    gap: 1.2rem;
    min-height: calc(100vh - 5rem);
    max-width: 28rem;
  }

  .screen-head__row {
    flex-direction: column;
    align-items: stretch;
  }

  .intro-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .intro-card__meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-left: 0;
  }

  .wallet-card {
    min-width: 0;
  }

  .account-menu {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .page {
    width: min(calc(100% - 1rem), var(--max-width));
    padding-top: 0.8rem;
  }

  .screen-head__row {
    gap: 0.75rem;
  }

  .intro-card,
  .workspace-card,
  .login-card,
  .modal__dialog {
    padding: 0.85rem;
  }

  .login-card {
    padding: 1rem;
    border-radius: 18px;
  }

  .intro-card__meta,
  .purchase-row,
  .modal__head,
  .section-head,
  .settings-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .intro-card__copy {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .intro-card__meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.55rem;
  }

  .auth-email .primary-button,
  .auth-email .soft-button {
    width: 100%;
    min-width: 0;
  }

  .auth-email__form--inline {
    grid-template-columns: 1fr;
  }

  .email-settings-card__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .purchase-primary-row .primary-button,
  .purchase-email-foot,
  .purchase-footer .primary-button {
    width: 100%;
    max-width: none;
  }

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

  .user-chip,
  .soft-button,
  .energy-pill,
  .primary-button,
  .account-menu,
  .account-button {
    width: 100%;
  }

  .wallet-card {
    display: none !important;
  }

  .account-menu__panel {
    left: 0;
    right: 0;
    width: auto;
    min-width: 0;
  }

  .account-button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    min-height: 3.5rem;
    padding: 0.65rem 0.75rem;
    column-gap: 0.65rem;
  }

  .account-button__balance {
    display: grid;
    gap: 0.08rem;
    align-items: end;
    margin-left: 0;
    padding-left: 0;
    text-align: right;
  }

  .account-button__balance-label {
    display: none;
  }

  .account-button__name {
    font-size: 0.95rem;
  }

  .account-button__sub {
    font-size: 0.78rem;
  }

  .account-menu__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .history-table,
  .history-table thead,
  .history-table tbody,
  .history-table tr,
  .history-table td {
    display: block;
    width: 100%;
  }

  .history-table thead {
    display: none;
  }

  .history-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .history-table tbody {
    display: grid;
    gap: 0.75rem;
  }

  .history-table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--panel);
    overflow: hidden;
  }

  .history-table td {
    display: grid;
    grid-template-columns: 5.25rem minmax(0, 1fr);
    gap: 0.55rem;
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--border);
  }

  .history-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.4;
  }

  .history-table td:last-child {
    border-bottom: 0;
  }

  .history-table__narrow {
    white-space: normal;
  }

  .history-table__wrap {
    max-width: none;
    overflow-wrap: anywhere;
  }

  .history-footer {
    align-items: stretch;
  }

  .history-page-meta {
    order: 2;
  }

  .history-pagination {
    order: 1;
  }
}

@media (max-width: 520px) {
  .page-title {
    font-size: 1.9rem;
  }

  .login-copy .page-title {
    font-size: 2.35rem;
  }

  .lead-text {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .login-screen {
    gap: 1rem;
    min-height: calc(100vh - 4rem);
    padding-block: 1.35rem;
  }

  .login-card {
    border-radius: 18px;
  }

  .intro-card {
    gap: 0.75rem;
  }

  .intro-card__copy {
    font-size: 0.84rem;
    line-height: 1.38;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .wallet-card,
  .account-button {
    min-height: 3.2rem;
  }

  .wallet-card__balance strong {
    font-size: 1rem;
  }

  .wallet-card__label {
    font-size: 0.66rem;
  }

  .wallet-card__balance span {
    font-size: 0.76rem;
  }

  .wallet-card__action {
    min-width: 6rem;
    min-height: 2.35rem;
    padding: 0.4rem 0.7rem;
  }

  .account-button__icon {
    width: 1.85rem;
    height: 1.85rem;
    font-size: 0.74rem;
  }

  .account-button__balance {
    min-width: 3rem;
  }

  .account-button__balance strong {
    font-size: 1rem;
  }

  .account-button__name {
    font-size: 0.9rem;
  }

  .account-button__sub {
    font-size: 0.75rem;
  }

  .history-table td {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .history-table td::before {
    margin-bottom: 0.1rem;
  }
}

@media (max-width: 390px) {
  .intro-card__meta {
    grid-template-columns: minmax(0, 1fr);
  }
}

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