@font-face {
  font-family: "Onest";
  src: url("fonts/onest-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: optional;
  unicode-range: U+0301, U+0400-052F, U+1C80-1C8A, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Onest";
  src: url("fonts/onest-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: optional;
  unicode-range: U+0100-02FF, U+1E00-1EFF, U+20A0-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Onest";
  src: url("fonts/onest-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f3f6fa;
  --bg-deep: #e9eef5;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --panel-blue: #f3f8ff;
  --border: #dfe5ed;
  --border-strong: #cbd4df;
  --text: #17202b;
  --muted: #6a7686;
  --accent: #1769d1;
  --accent-hover: #1057b2;
  --accent-soft: #eaf3ff;
  --ok: #247a4d;
  --ok-bg: #eaf7ef;
  --danger: #c43c34;
  --danger-bg: #fff0ef;
  --info: #1769d1;
  --info-bg: #eaf3ff;
  --shadow-soft: 0 12px 36px rgba(28, 48, 75, 0.07);
  --shadow-card: 0 24px 72px rgba(28, 48, 75, 0.11);
  --radius-card: 22px;
  --radius-control: 14px;
  --radius-small: 10px;
  --radius-pill: 999px;
  --max-width: 1320px;
  --font-ui: "Onest", "Segoe UI Variable Text", "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", "Menlo", monospace;
}

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

html {
  min-height: 100%;
  scrollbar-gutter: stable;
  color-scheme: light;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 0%, rgba(34, 158, 217, 0.1), transparent 28rem),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 58%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

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

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

pre,
.mono {
  font-family: var(--font-mono);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

.metrika-pixel {
  position: absolute;
  left: -9999px;
}

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

:where(a, button, textarea, input, [tabindex]):focus-visible {
  outline: 3px solid rgba(23, 105, 209, 0.24);
  outline-offset: 3px;
}

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

.page-title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.page-title__domain {
  color: #455264;
  font-weight: 400;
}

.brand-kicker,
.panel__eyebrow,
.settings-summary__label,
.wallet-card__label,
.messenger-nav__label {
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

.language-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(2.35rem, 1fr));
  gap: 0.2rem;
  padding: 0.22rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: rgba(247, 249, 252, 0.9);
}

.language-switch__option {
  min-width: 2.35rem;
  min-height: 2.35rem;
  padding: 0.35rem 0.45rem;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.language-switch__option:hover {
  color: var(--text);
}

.language-switch__option:active {
  transform: translateY(1px);
}

.language-switch__option.is-active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(28, 48, 75, 0.09);
}

/* Login */
.login-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(24rem, 29rem);
  align-items: center;
  gap: clamp(3rem, 8vw, 8rem);
  width: min(100%, 70rem);
  min-height: calc(100dvh - 3.85rem);
  margin: 0 auto;
  padding: 3rem 0;
}

.language-switch--login {
  position: absolute;
  top: 0.75rem;
  right: 0;
  z-index: 1;
}

.login-copy {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 1rem;
  max-width: 35rem;
  padding-left: clamp(0rem, 4vw, 2.5rem);
}

.login-copy::before {
  content: "";
  position: absolute;
  top: -4rem;
  left: -3.5rem;
  width: 13rem;
  height: 13rem;
  border: 1px solid rgba(23, 105, 209, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.login-copy::after {
  content: "";
  position: absolute;
  top: 7.5rem;
  left: -0.75rem;
  width: 4.75rem;
  height: 1px;
  background: rgba(23, 105, 209, 0.42);
  pointer-events: none;
}

.login-copy .page-title {
  max-width: none;
  font-size: clamp(4rem, 7.2vw, 6.25rem);
  line-height: 0.9;
  letter-spacing: -0.075em;
  white-space: nowrap;
}

.login-copy .page-title__domain {
  font-size: 0.72em;
  letter-spacing: -0.06em;
}

.lead-text {
  max-width: 31rem;
  margin: 0.25rem 0 0;
  font-size: clamp(1rem, 1.45vw, 1.18rem);
  line-height: 1.65;
}

.login-card {
  position: relative;
  display: grid;
  gap: 1.5rem;
  padding: clamp(1.5rem, 3.2vw, 2.2rem);
  border: 1px solid rgba(203, 212, 223, 0.9);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-card);
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 2.2rem;
  left: 2.2rem;
  height: 2px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #229ed9 0 48%, #6e1aff 52% 100%);
}

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

.login-card__title {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.login-card__copy {
  max-width: 35ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

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

.auth-provider__form,
.auth-provider__form button,
.auth-provider--pending form {
  width: 100%;
  margin: 0;
}

.auth-provider {
  display: grid;
  grid-template-columns: 2.9rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  min-height: 4.8rem;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.14s ease, background 0.18s ease;
}

.auth-provider:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: #fbfdff;
  box-shadow: 0 10px 24px rgba(28, 48, 75, 0.08);
}

.auth-provider:active {
  transform: translateY(1px);
}

.auth-provider--telegram {
  border-color: rgba(34, 158, 217, 0.25);
  background: #f7fcff;
}

.auth-provider--max {
  border-color: rgba(110, 26, 255, 0.2);
  background: #fcfaff;
}

.auth-provider__logo {
  width: 2.9rem;
  height: 2.9rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.auth-provider__copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.auth-provider__copy strong {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

.auth-provider__copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 400;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-provider__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 1.05rem;
  transition: transform 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.auth-provider--telegram:hover .auth-provider__arrow {
  transform: translateX(2px);
  background: rgba(34, 158, 217, 0.1);
  color: #1687bd;
}

.auth-provider--max:hover .auth-provider__arrow {
  transform: translateX(2px);
  background: rgba(110, 26, 255, 0.08);
  color: #6e1aff;
}

.auth-provider--pending {
  grid-template-columns: 1fr;
  gap: 0.8rem;
  cursor: default;
}

.auth-provider--pending:hover {
  transform: none;
}

.auth-provider__identity {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.auth-provider__status {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-small);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

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

.auth-provider__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.85rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-small);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.18s ease, border-color 0.18s ease;
}

.auth-provider__button:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.auth-provider__button:active {
  transform: translateY(1px);
}

.auth-provider__button--secondary {
  border-color: var(--border-strong);
  background: var(--panel);
  color: var(--text);
}

.auth-provider__button--secondary:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.login-channels {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}

.login-channels > span {
  margin-right: auto;
}

.login-channels a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-pill);
  color: #455264;
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease;
}

.login-channels a:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.login-channels img {
  width: 1.15rem;
  height: 1.15rem;
}

.auth-notice {
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-small);
  font-size: 0.88rem;
  line-height: 1.45;
}

.auth-notice--info {
  background: var(--info-bg);
  color: #0f529e;
}

.auth-notice--error {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Header */
.screen-head {
  position: relative;
  z-index: 35;
  margin-bottom: 1.15rem;
}

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

.brand-lockup {
  display: grid;
  flex: 0 0 auto;
  gap: 0.32rem;
}

.brand-lockup .page-title {
  font-size: clamp(2rem, 3vw, 2.7rem);
}

.brand-lockup__caption {
  color: var(--muted);
  font-size: 0.73rem;
  letter-spacing: 0.04em;
}

.screen-head__tools {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0.65rem;
  min-width: 0;
}

.screen-head__utility {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0.65rem;
  min-width: 0;
}

.language-switch--header {
  align-self: stretch;
}

.messenger-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 3.55rem;
  padding: 0.32rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.8);
}

.messenger-nav__label {
  padding: 0 0.6rem;
  white-space: nowrap;
}

.messenger-link {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 2.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-small);
  color: #455264;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.messenger-link:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.messenger-link img {
  width: 1.45rem;
  height: 1.45rem;
}

.intro-card__meta {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  min-width: 0;
}

.wallet-card,
.account-button {
  min-height: 3.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--panel);
  box-shadow: 0 5px 18px rgba(28, 48, 75, 0.035);
}

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

.wallet-card__summary {
  min-width: 0;
  padding: 0 0.5rem;
}

.wallet-card__meta-copy {
  display: grid;
  gap: 0.08rem;
}

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

.wallet-card__balance strong {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
}

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

.wallet-card__action,
.account-menu__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.14s ease;
}

.wallet-card__action:hover,
.account-menu__action:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.wallet-card__action:active,
.account-menu__action:active {
  transform: translateY(1px);
}

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

.account-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  padding: 0.52rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.account-button:hover,
.account-menu.is-open .account-button {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.account-button__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent-soft);
  overflow: hidden;
  color: #155ebc;
  font-size: 0.76rem;
  font-weight: 600;
}

.account-button__icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.account-button__name {
  overflow: hidden;
  font-size: 0.87rem;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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: 0.95rem;
  font-weight: 600;
  line-height: 1;
}

.account-button__caret {
  width: 0.45rem;
  height: 0.45rem;
  margin: -0.2rem 0.2rem 0 0;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.account-menu.is-open .account-button__caret {
  margin-top: 0.2rem;
  transform: rotate(225deg);
}

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

.account-menu__identity {
  display: grid;
  gap: 0.12rem;
  padding: 0.5rem 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.3rem;
}

.account-menu__identity strong {
  font-size: 0.88rem;
  font-weight: 600;
}

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

.account-menu__link {
  display: block;
  width: 100%;
  padding: 0.64rem 0.7rem;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: #384657;
  font-size: 0.84rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

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

.account-menu__action {
  display: none;
  width: 100%;
  margin: 0.2rem 0 0.3rem;
}

/* Workspace */
.workspace-card {
  border: 0;
  background: transparent;
}

.workspace-grid {
  --workspace-field-height: 15rem;
  --workspace-input-height: var(--workspace-field-height);
  --workspace-result-height: var(--workspace-field-height);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.calc-panel,
.response-panel {
  display: grid;
  gap: 0.75rem;
  height: auto;
  min-height: 0;
  overflow: hidden;
  padding: clamp(1.15rem, 2vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.calc-panel {
  grid-template-rows: auto var(--workspace-input-height) auto;
}

.response-panel {
  grid-template-rows: auto var(--workspace-result-height) auto;
}

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

.section-title {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.workspace-grid .section-title {
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
}

.section-copy {
  margin: -0.2rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.section-copy--compact {
  margin: 0.35rem 0 1rem;
}

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

.field__label {
  font-size: 0.8rem;
  font-weight: 500;
}

.editor-shell,
.response-shell {
  position: relative;
  display: grid;
  min-height: 0;
}

.editor-shell {
  height: var(--workspace-input-height);
}

.response-shell {
  height: var(--workspace-result-height);
}

.editor,
.input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: #fbfcfe;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.editor {
  min-height: 0;
  height: 100%;
  padding: 0.85rem;
  resize: none;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
}

.input {
  min-height: 3.15rem;
  padding: 0.75rem 0.9rem;
}

.editor:hover,
.input:hover {
  border-color: #b9c5d3;
}

.editor:focus,
.input:focus {
  border-color: rgba(23, 105, 209, 0.58);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(23, 105, 209, 0.09);
}

.response-shell {
  overflow: auto;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--panel-soft);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.response-shell--error {
  border-color: rgba(190, 60, 46, 0.42);
  background: rgba(255, 241, 238, 0.72);
}

.response-box {
  min-height: 0;
  height: 100%;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: #253244;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.48;
}

.editor::placeholder,
.response-box--empty {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  line-height: 1.48;
}

.editor::placeholder {
  color: var(--muted);
  opacity: 1;
}

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

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

.panel__actions {
  justify-content: space-between;
  gap: 0.75rem;
}

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

.editor-tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.editor-tool img,
.workspace-copy-button img {
  display: block;
  width: 1.08rem;
  height: 1.08rem;
}

.editor-tool:disabled {
  opacity: 0.38;
  cursor: default;
}

.editor-tool.is-success {
  border-color: rgba(36, 122, 77, 0.28);
  background: var(--ok-bg);
}

.editor-tool.is-error {
  border-color: rgba(196, 60, 52, 0.28);
  background: var(--danger-bg);
}

.workspace-grid .primary-button {
  min-width: 11.5rem;
  height: 2.7rem;
  min-height: 2.7rem;
  padding-block: 0.45rem;
}

.editor-tool,
.workspace-copy-button {
  gap: 0.45rem;
  height: 2.7rem;
  min-height: 2.7rem;
  padding: 0.55rem 0.8rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.primary-button,
.soft-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.primary-button {
  min-width: 12.5rem;
  min-height: 3.15rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.primary-button:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.primary-button:active,
.soft-button:active,
.icon-button:active {
  transform: translateY(1px);
}

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

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

.soft-button {
  min-height: 2.85rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--panel);
  color: #354356;
  font-weight: 500;
}

.soft-button:hover {
  border-color: #afbdcc;
  background: var(--panel-soft);
  color: var(--text);
}

.soft-button--dark {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.soft-button--dark:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: #fff;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.8rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill--idle {
  background: var(--panel-soft);
}

.status-pill--success {
  border-color: rgba(36, 122, 77, 0.13);
  background: var(--ok-bg);
  color: var(--ok);
}

.status-pill--error {
  border-color: rgba(196, 60, 52, 0.14);
  background: var(--danger-bg);
  color: var(--danger);
}

.status-pill--info {
  border-color: rgba(23, 105, 209, 0.13);
  background: var(--info-bg);
  color: var(--info);
}

/* History */
.history-card {
  margin-top: 1rem;
  padding: clamp(0.9rem, 1.5vw, 1.15rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

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

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

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

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

.history-col--request {
  width: 24%;
}

.history-col--response {
  width: auto;
}

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

.history-table th {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.history-table tbody tr {
  transition: background 0.18s ease;
}

.history-table tbody tr:hover {
  background: #fbfcfe;
}

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

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

.history-table__wrap--request {
  font-size: 0.7rem;
  line-height: 1.35;
}

.history-table__wrap--response {
  font-size: 0.64rem;
  line-height: 1.28;
}

.history-table__narrow {
  font-size: 0.72rem;
  white-space: nowrap;
}

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

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

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

.history-kind {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.25;
}

.empty-state {
  padding: 1.15rem;
  color: var(--muted);
  font-size: 0.9rem;
}

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

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

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

.history-pagination__button {
  min-width: 2.3rem;
  min-height: 2.3rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--panel);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}

.history-pagination__button.is-active {
  border-color: rgba(23, 105, 209, 0.32);
  background: var(--accent-soft);
  color: var(--accent);
}

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

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

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 43, 0.46);
  backdrop-filter: blur(5px);
}

.modal__dialog {
  position: relative;
  width: min(calc(100% - 2rem), 46rem);
  max-height: calc(100dvh - 2rem);
  margin: 3vh auto;
  padding: 1.4rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: 0 34px 100px rgba(20, 30, 43, 0.22);
}

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

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

.panel__eyebrow {
  display: inline-flex;
  margin-bottom: 0.35rem;
}

.panel__text {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.icon-button {
  width: 2.65rem;
  min-width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: #465466;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--border-strong);
  background: var(--panel-soft);
  color: var(--text);
}

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

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

.settings-summary__identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.settings-summary__logo {
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
}

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

.settings-summary__copy strong {
  font-size: 0.91rem;
  font-weight: 600;
  word-break: break-word;
}

.settings-summary__meta {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.settings-summary__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.text-button {
  padding: 0.2rem 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.text-button:hover {
  color: var(--accent-hover);
}

.text-button--muted {
  color: var(--muted);
}

.settings-email-editor {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--panel);
}

.settings-email-editor__notice {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.settings-email-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.6rem;
}

.settings-email-field {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.settings-email-field .input {
  min-height: 2.8rem;
  padding: 0.65rem 0.75rem;
  color: var(--text);
  font-size: 0.86rem;
}

.settings-email-form .primary-button {
  min-height: 2.8rem;
  padding: 0.65rem 0.9rem;
}

/* Purchase flow */
.modal__dialog--purchase {
  width: min(calc(100% - 2rem), 34rem);
  padding: 1.75rem 1.8rem 1.5rem;
}

.purchase-modal__head {
  align-items: center;
  margin-bottom: 1.35rem;
}

.purchase-modal__head .section-title {
  font-size: clamp(1.65rem, 4vw, 1.9rem);
}

.purchase-modal__head .panel__text {
  margin-top: 0.25rem;
}

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

.package-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 4.7rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.package-tile:hover:not(.is-locked) {
  border-color: var(--border-strong);
  background: var(--panel-soft);
}

.package-tile__selector {
  position: relative;
  width: 1.15rem;
  height: 1.15rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: var(--panel);
}

.package-tile__selector::after {
  content: "";
  position: absolute;
  inset: 0.22rem;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.package-tile__title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.package-tile__price {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

.package-tile.is-selected {
  border-color: rgba(23, 105, 209, 0.42);
  background: var(--accent-soft);
  box-shadow: 0 8px 24px rgba(23, 105, 209, 0.08);
}

.package-tile.is-selected .package-tile__selector {
  border-color: var(--accent);
}

.package-tile.is-selected .package-tile__selector::after {
  opacity: 1;
  transform: scale(1);
}

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

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

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

.purchase-primary-row .primary-button {
  width: 100%;
  max-width: none;
}

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

.purchase-legal--footer {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.purchase-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  cursor: pointer;
}

.purchase-consent + .purchase-consent {
  margin-top: 0.65rem;
}

.purchase-consent input {
  width: 1rem;
  height: 1rem;
  margin: 0.15rem 0 0;
  accent-color: var(--accent);
}

.purchase-consent a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Brand and legal footer */
.site-footer {
  width: 100%;
  margin-top: clamp(2rem, 5vw, 4.5rem);
  padding: 1.5rem 0 0.4rem;
  border-top: 1px solid var(--border-strong);
  color: var(--muted);
}

.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: start;
}

.site-footer__identity {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.2rem;
  align-items: baseline;
  font-size: 0.76rem;
}

.site-footer__brand,
.legal-head__brand {
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.055em;
}

.site-footer__brand span,
.legal-head__brand span {
  color: #455264;
  font-weight: 400;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem 1rem;
  font-size: 0.76rem;
}

.site-footer__legal a,
.site-footer__legal button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: #455264;
  cursor: pointer;
}

.site-footer__legal a:hover,
.site-footer__legal button:hover {
  border-bottom-color: currentColor;
  color: var(--accent);
}

.brand-family {
  display: grid;
  grid-template-columns: repeat(7, minmax(3.4rem, 1fr));
  gap: clamp(0.7rem, 2.5vw, 2.5rem);
  align-items: center;
  margin: 1.6rem 0 1rem;
  padding: 1.15rem 0;
}

.brand-family__item {
  --brand-logo-width: 2.75rem;
  --brand-logo-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 3.25rem;
  opacity: 0.72;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.brand-family__item:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.brand-family__item img {
  display: block;
  width: var(--brand-logo-width);
  max-width: 100%;
  height: var(--brand-logo-height);
  object-fit: contain;
}

.brand-family__item--audi {
  --brand-logo-width: 5.25rem;
  --brand-logo-height: 2.35rem;
}

.brand-family__item--porsche,
.brand-family__item--lamborghini {
  --brand-logo-width: 2.7rem;
  --brand-logo-height: 3rem;
}

.brand-family__item--bentley {
  --brand-logo-width: 5.4rem;
  --brand-logo-height: 2.85rem;
}

.site-footer__trademark {
  max-width: 72rem;
  margin: 0;
  font-size: 0.67rem;
  line-height: 1.5;
}

/* Cookie choice */
.cookie-consent {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 120;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
  width: min(calc(100% - 2rem), 47rem);
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-card);
}

.cookie-consent__copy {
  display: grid;
  gap: 0.2rem;
}

.cookie-consent__copy strong {
  font-size: 0.9rem;
}

.cookie-consent__copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.cookie-consent__copy a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.cookie-consent__actions {
  display: flex;
  gap: 0.45rem;
}

.cookie-button {
  min-height: 2.65rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-small);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.cookie-button--secondary {
  border: 1px solid var(--border-strong);
  background: var(--panel);
}

.cookie-button--primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.cookie-button:active {
  transform: translateY(1px);
}

/* Legal pages */
.legal-page {
  width: min(calc(100% - 2rem), 92rem);
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
}

.legal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.5rem;
}

.legal-head__brand {
  font-size: 1.75rem;
}

.legal-language {
  display: flex;
  gap: 0.25rem;
}

.legal-language a {
  min-width: 2.6rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-small);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  text-align: center;
}

.legal-language a[aria-current="page"] {
  background: var(--panel);
  color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.legal-document {
  display: grid;
  grid-template-columns: minmax(31rem, 0.95fr) minmax(0, 1.35fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  margin-top: clamp(2rem, 5vw, 4.5rem);
}

.legal-document__intro {
  align-self: start;
  position: sticky;
  top: 1.5rem;
  min-width: 0;
}

.legal-back {
  display: inline-block;
  margin-bottom: 1.4rem;
  color: var(--accent);
  font-size: 0.78rem;
}

.legal-document h1 {
  max-width: 22ch;
  margin: 0;
  font-size: clamp(2rem, 2.5vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.legal-document__description {
  max-width: 30rem;
  margin: 1rem 0 0;
  color: #455264;
  line-height: 1.55;
}

.legal-document__updated {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.legal-document__content {
  display: grid;
  gap: 2rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  min-width: 0;
}

.legal-section h2 {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.legal-section p,
.legal-section li {
  color: #455264;
  font-size: 0.9rem;
  line-height: 1.72;
}

.legal-section p {
  margin: 0.65rem 0 0;
}

.legal-section ul {
  margin: 0.7rem 0 0;
  padding-left: 1.2rem;
}

.legal-section li + li {
  margin-top: 0.35rem;
}

.legal-sources a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.2rem;
  list-style: none;
  padding-left: 0 !important;
}

.legal-links a {
  color: var(--accent);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

[data-purchase-state="paid"] .purchase-legal--footer {
  display: none;
}

.purchase-result {
  display: grid;
  gap: 1.15rem;
}

.purchase-result__hint {
  margin: 0.7rem 0 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.purchase-email-capture {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--panel-soft);
}

.purchase-email-capture label {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.purchase-email-capture p {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.purchase-order-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8.5rem, 0.8fr);
  align-items: stretch;
  min-height: 7.25rem;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--panel-soft);
}

.purchase-order-summary__product,
.purchase-order-summary__amount {
  display: grid;
  align-content: center;
  gap: 0.2rem;
  padding: 1.2rem 1.25rem;
}

.purchase-order-summary__amount {
  justify-items: end;
  border-left: 1px solid var(--border);
  text-align: right;
}

.purchase-order-summary span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.purchase-order-summary__product strong {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
}

.purchase-order-summary__amount strong {
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.purchase-checkout-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: stretch;
  gap: 0.2rem;
}

.purchase-checkout-actions .primary-button {
  width: 100%;
  max-width: none;
  min-height: 3.45rem;
  font-size: 1.05rem;
}

.secondary-button {
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
}

.secondary-button:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.purchase-cancel-button {
  justify-self: center;
  width: auto;
  min-height: 2.5rem;
  padding: 0.35rem 0.65rem;
  border: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
}

.purchase-cancel-button:hover {
  border-color: transparent;
  background: transparent;
  color: var(--text);
}

.purchase-share {
  display: grid;
  gap: 0.9rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.purchase-share__copy {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.purchase-share__copy strong {
  font-size: 1.08rem;
  font-weight: 600;
}

.purchase-share__copy span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.purchase-share__actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0.6rem;
  width: 100%;
}

.purchase-share-action {
  display: inline-grid;
  grid-template-rows: 2rem auto;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
  height: 4.55rem;
  padding: 0.65rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.14s ease;
}

.purchase-share-action:hover {
  border-color: rgba(23, 105, 209, 0.32);
  background: var(--accent-soft);
}

.purchase-share-action__icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-inline: auto;
}

.purchase-share-action__icon img {
  display: block;
  width: 1.65rem;
  height: 1.65rem;
  object-fit: contain;
}

.purchase-share-action__label {
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-receipt {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.purchase-receipt__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.purchase-receipt__summary > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.purchase-receipt strong {
  color: var(--text);
  font-weight: 500;
}

.purchase-receipt__edit,
.purchase-receipt__cancel {
  min-height: 2rem;
  padding: 0.25rem 0.35rem;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.purchase-receipt__edit {
  flex: 0 0 auto;
}

.purchase-receipt__edit:hover,
.purchase-receipt__cancel:hover {
  color: var(--accent-hover);
}

.purchase-receipt__editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
}

.purchase-receipt__field {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.purchase-receipt__field > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.purchase-receipt__field .input {
  min-height: 2.65rem;
  padding: 0.6rem 0.7rem;
  color: var(--text);
  font-size: 0.84rem;
}

.purchase-receipt__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.purchase-receipt__save {
  min-height: 2.65rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.purchase-receipt__save:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.purchase-receipt__save:disabled,
.purchase-receipt__cancel:disabled,
.purchase-receipt__edit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.purchase-result.is-paid {
  gap: 0;
}

.purchase-result.is-paid .purchase-order-summary {
  display: grid;
  min-height: 0;
  border-color: rgba(36, 122, 77, 0.18);
  background: var(--ok-bg);
}

.purchase-result.is-paid .purchase-order-summary__product {
  gap: 0.25rem;
}

.purchase-result.is-paid .purchase-order-summary span {
  color: var(--ok);
}

.purchase-result.is-paid .purchase-order-summary__product strong {
  font-size: 1rem;
  font-weight: 500;
}

.purchase-result.is-paid .purchase-checkout-actions,
.purchase-result.is-paid .purchase-share,
.purchase-result.is-paid .purchase-legal,
.purchase-result.is-paid .purchase-receipt {
  display: none;
}

/* Loading and restrained motion */
@keyframes fade-rise {
  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%);
  }
}

.login-card {
  animation: fade-rise 0.3s ease both;
}

.response-shell.is-loading,
.history-table-wrap.is-loading {
  overflow: hidden;
}

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

.primary-button.is-loading,
.soft-button.is-loading,
.secondary-button.is-loading,
.purchase-share-action.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,
.secondary-button.is-loading::after,
.purchase-share-action.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: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.soft-button.is-loading::after,
.secondary-button.is-loading::after,
.purchase-share-action.is-loading::after {
  border-color: rgba(23, 105, 209, 0.2);
  border-top-color: var(--accent);
}

@media (max-width: 1180px) {
  .legal-document {
    grid-template-columns: minmax(25rem, 0.9fr) minmax(0, 1.35fr);
    gap: 2.5rem;
  }

  .legal-document h1 {
    font-size: clamp(2rem, 3vw, 2.3rem);
  }

  .screen-head__row {
    align-items: flex-start;
  }

  .screen-head__tools {
    display: grid;
    grid-template-columns: 1fr;
  }

  .screen-head__utility {
    justify-self: end;
  }

  .messenger-nav {
    justify-self: end;
  }
}

@media (max-width: 900px) {
  .legal-document {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .legal-document__intro {
    position: static;
  }

  .legal-document h1 {
    max-width: 26ch;
  }

  .login-screen {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 2.2rem;
    width: min(100%, 34rem);
    padding: 2.2rem 0;
  }

  .login-copy {
    justify-items: center;
    max-width: none;
    padding-left: 0;
    text-align: center;
  }

  .login-copy::before {
    top: -2rem;
    left: 50%;
    transform: translateX(-50%);
  }

  .login-copy::after {
    display: none;
  }

  .login-copy .page-title {
    max-width: none;
    font-size: clamp(3.5rem, 12vw, 5rem);
    line-height: 0.92;
  }

  .login-copy .page-title__domain {
    display: inline;
    margin: 0;
    font-size: 0.72em;
  }

  .lead-text {
    max-width: 29rem;
  }

  .screen-head__row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .screen-head__tools {
    display: grid;
    grid-template-columns: 1fr;
  }


  .screen-head__utility {
    justify-self: stretch;
  }

  .screen-head__utility .messenger-nav {
    flex: 1 1 auto;
  }

  .messenger-nav {
    justify-self: stretch;
  }

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

  .wallet-card,
  .account-menu {
    min-width: 0;
  }

  .workspace-grid {
    --workspace-input-height: 8rem;
    --workspace-result-height: 28rem;
    grid-template-columns: 1fr;
  }

  .calc-panel,
  .response-panel {
    height: auto;
    min-height: 0;
  }
}

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

  .screen-head {
    margin-bottom: 0.8rem;
  }

  .brand-lockup {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0.25rem;
  }

  .brand-lockup .page-title {
    font-size: 2rem;
  }

  .brand-lockup__caption {
    text-align: right;
  }

  .site-footer__top {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .site-footer__legal {
    justify-content: flex-start;
  }

  .brand-family {
    grid-template-columns: repeat(4, minmax(3rem, 1fr));
    gap: 0.8rem 1.3rem;
  }

  .legal-page {
    width: calc(100vw - 1rem);
    max-width: 72rem;
    padding-top: 0.7rem;
  }

  .legal-document {
    grid-template-columns: 1fr;
    gap: 1.4rem;
    margin-top: 2rem;
  }

  .legal-document__intro {
    position: static;
  }

  .legal-document h1 {
    max-width: 22ch;
    font-size: clamp(1.9rem, 8.5vw, 2.45rem);
  }

  .legal-document__content {
    border-radius: 18px;
  }

  .cookie-consent {
    right: 0.5rem;
    bottom: 0.5rem;
    grid-template-columns: 1fr;
    gap: 0.8rem;
    width: calc(100% - 1rem);
  }

  .cookie-consent__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .messenger-nav {
    min-height: 3.2rem;
  }

  .messenger-nav__label {
    margin-right: auto;
  }

  .messenger-link {
    min-height: 2.55rem;
  }

  .wallet-card {
    display: none;
  }

  .intro-card__meta {
    grid-template-columns: 1fr;
  }

  .account-menu,
  .account-button {
    width: 100%;
  }

  .account-button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    min-height: 3.4rem;
  }

  .account-button__balance {
    display: grid;
  }

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

  .account-menu__action {
    display: inline-flex;
  }

  .calc-panel,
  .response-panel,
  .history-card,
  .modal__dialog {
    padding: 1rem;
    border-radius: 18px;
  }

  .calc-panel,
  .response-panel {
    height: auto;
    min-height: 0;
  }

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

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

  .purchase-checkout-actions {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .modal {
    padding: 0.5rem;
  }

  .modal__dialog,
  .modal__dialog--compact {
    width: min(calc(100% - 0.5rem), 46rem);
    max-height: calc(100dvh - 1rem);
    margin: 0.5rem auto;
  }

  .settings-summary {
    align-items: flex-start;
  }

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

  .settings-email-form .primary-button {
    width: 100%;
  }

  .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.65rem;
  }

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

  .history-table td {
    display: grid;
    grid-template-columns: 5.3rem 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.7rem;
    font-weight: 600;
    line-height: 1.4;
    text-transform: uppercase;
  }

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

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

@media (max-width: 520px) {
  .screen-head__row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .screen-head__tools {
    display: contents;
  }

  .screen-head__utility {
    grid-column: 2;
    grid-row: 1;
    gap: 0.35rem;
  }

  .brand-lockup {
    grid-column: 1;
    grid-row: 1;
  }

  .messenger-nav {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    width: max-content;
  }

  .intro-card__meta {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .login-screen {
    gap: 1.4rem;
    min-height: calc(100dvh - 1.6rem);
    padding: 1.1rem 0;
  }

  .login-copy {
    gap: 0.65rem;
  }

  .language-switch--login {
    top: 0;
  }

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

  .language-switch__option {
    min-width: 2rem;
    min-height: 2rem;
    padding: 0.25rem 0.35rem;
  }

  .login-copy::before {
    width: 9rem;
    height: 9rem;
  }

  .login-copy .page-title {
    font-size: clamp(2.75rem, 14vw, 3.55rem);
  }

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

  .login-card {
    gap: 1.05rem;
    padding: 1.1rem;
    border-radius: 20px;
  }

  .login-card__title {
    font-size: 1.5rem;
  }

  .auth-provider {
    grid-template-columns: 2.55rem minmax(0, 1fr) auto;
    gap: 0.7rem;
    min-height: 4.2rem;
    padding: 0.6rem 0.7rem;
  }

  .auth-provider__logo {
    width: 2.55rem;
    height: 2.55rem;
  }

  .auth-provider__copy small {
    font-size: 0.72rem;
  }

  .auth-provider__arrow {
    width: 1.75rem;
    height: 1.75rem;
  }

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

  .login-channels {
    flex-wrap: wrap;
  }

  .login-channels > span {
    width: 100%;
  }

  .brand-lockup__caption,
  .messenger-nav__label,
  .messenger-link span {
    display: none;
  }

  .messenger-nav {
    justify-content: flex-end;
  }

  .messenger-link {
    padding: 0.45rem 0.6rem;
  }

  .messenger-link img {
    width: 1.55rem;
    height: 1.55rem;
  }

  .section-title {
    font-size: 1.35rem;
  }

  .workspace-grid .section-title {
    font-size: 1.05rem;
  }

  .editor,
  .response-box {
    font-size: 0.75rem;
    line-height: 1.42;
  }

  .editor::placeholder,
  .response-box--empty {
    font-size: 0.82rem;
    line-height: 1.42;
  }

  .primary-button,
  .soft-button {
    width: 100%;
  }

  .panel__actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.55rem;
    width: 100%;
    height: auto;
  }

  .workspace-grid .primary-button {
    width: 100%;
    min-width: 0;
    padding-inline: 0.8rem;
    font-size: 0.82rem;
  }

  .editor-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
  }

  .editor-tools .editor-tool {
    width: 100%;
  }

  .response-actions {
    align-items: stretch;
  }

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

  .modal__head {
    gap: 0.6rem;
  }

  .modal__dialog--purchase {
    padding: 0.9rem;
  }

  .purchase-modal__head {
    margin-bottom: 0.7rem;
  }

  .purchase-modal__head .icon-button {
    width: 2.4rem;
    min-width: 2.4rem;
    height: 2.4rem;
  }

  .package-tile {
    min-height: 3.8rem;
    padding: 0.65rem 0.7rem;
  }

  .package-tile__title,
  .package-tile__price {
    font-size: 0.88rem;
  }

  .purchase-order-summary {
    grid-template-columns: minmax(0, 1fr) minmax(6.7rem, 0.72fr);
    min-height: 5.4rem;
    padding: 0;
  }

  .purchase-order-summary__product,
  .purchase-order-summary__amount {
    padding: 0.8rem;
  }

  .purchase-order-summary__product strong {
    font-size: 1rem;
  }

  .purchase-order-summary__amount strong {
    font-size: 1.3rem;
  }

  .purchase-checkout-actions {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .purchase-checkout-actions .primary-button {
    width: 100%;
    min-width: 0;
  }

  .purchase-cancel-button {
    width: auto;
    min-width: 0;
    min-height: 2.5rem;
  }

  .purchase-share {
    align-items: flex-start;
    gap: 0.7rem;
  }

  .purchase-share__copy span {
    max-width: none;
  }

  .purchase-share__actions {
    width: 100%;
  }

  .purchase-share-action {
    height: 4.2rem;
  }

  .purchase-share-action__label {
    font-size: 0.72rem;
  }

  .purchase-receipt__summary {
    align-items: flex-start;
  }

  .purchase-receipt__editor {
    grid-template-columns: 1fr;
  }

  .purchase-receipt__actions {
    justify-content: flex-end;
  }
}

@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;
  }
}
