:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --soft: #f1f1f4;
  --soft-2: #ebebef;
  --line: #e8e8ed;
  --text: #1d1d1f;
  --muted: #707070;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --danger: #ff6b6f;
  --danger-soft: #fff1f1;
  --success: #34c759;
  --warn: #d97706;
  --accent-text: #b64400;
  --brace-1: #0071e3;
  --brace-2: #7c3aed;
  --brace-3: #059669;
  --brace-4: #b64400;
  --zone-bg: #ecfeff;
  --zone-text: #0e7490;
  --motion-fast: 150ms;
  --motion-standard: 200ms;
  --motion-ease: cubic-bezier(0.2, 0, 0, 1);
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 12px;
  --space-8: 16px;
  --space-10: 20px;
  --space-12: 24px;
  --font-xs: 12px;
  --font-sm: 14px;
  --font-page: 20px;
  --line-sm: 20px;
  --line-page: 28px;
  --radius-card: 28px;
  --radius-control: 12px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, system-ui, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  cursor: pointer;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.neo-shell {
  min-height: 100vh;
}

.neo-top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid #e8e8ed;
  background: #fff;
}

.neo-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 64rem;
  height: 3.5rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.genvito-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 96px;
  height: 20px;
  background: url('/assets/logo.svg') center / contain no-repeat;
  color: #1d1d1f;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.genvito-logo:hover {
  opacity: 0.7;
}

.genvito-logo svg {
  display: none;
}

.top-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.header-account-email {
  display: inline-block;
  max-width: 220px;
  margin-left: 1rem;
  margin-right: auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 33px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-account-email:empty {
  display: none;
}

.top-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 0;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  text-decoration: none;
}

.top-tab.active {
  background: #f5f5f7;
  color: #1d1d1f;
}

.top-tab:hover:not(.active) {
  background: #f5f5f7;
  color: #1d1d1f;
}

.top-tab-icon {
  width: auto;
  margin-left: 0.25rem;
  padding: 0.5rem;
  color: var(--muted);
}

.top-tab .lucide {
  width: 16px;
  height: 16px;
}

.top-tab-icon:hover {
  background: #fef2f2;
  color: #ef4444;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.5rem;
  width: min(64rem, calc(100% - 2rem));
  margin: 2rem auto 3rem;
}

.dashboard-shell { position: relative; }
.access-lock[hidden] { display: none; }
.access-lock { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 20; pointer-events: none; }
.access-lock-card { width: min(21rem, calc(100vw - 2.5rem)); padding: 1.125rem 1.25rem 1.25rem; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .96); text-align: center; box-shadow: 0 12px 36px rgba(29, 29, 31, .14); pointer-events: auto; }
.access-lock-icon { font-size: 1.5rem; margin-bottom: .5rem; }
.access-lock-icon .icon { width: 1.5rem; height: 1.5rem; color: var(--text); }
.access-lock-card h2 { margin: 0; color: var(--text); font-size: 1.25rem; }
.access-lock-card p { margin: .5rem 0 1rem; color: var(--muted); font-size: 12px; line-height: 1.35; }
.access-lock-card .btn { display: inline-flex; text-decoration: none; }
body.access-locked #generate-btn { display: none; }
body.access-locked .header-profile-bar,
body.access-locked .header-project-divider {
  display: none;
}
body.account-pending .header-profile-bar,
body.account-pending .header-project-divider {
  display: none;
}
body.access-locked .generate-box {
  padding: 12px 0;
  border: 0;
  background: transparent;
}
body.access-locked .generate-summary {
  margin-bottom: 0;
}

.sidebar {
  position: sticky;
  top: 89px;
  align-self: start;
  padding: 0.75rem;
  border-radius: 28px;
  background: var(--surface);
  transition: box-shadow var(--motion-standard) var(--motion-ease);
}

.sidebar:hover {
  box-shadow: 0 10px 24px rgba(29, 29, 31, 0.04);
}

.neo-account {
  margin-bottom: 0.75rem;
  padding: 0 0.75rem 0.75rem;
  border-bottom: 1px solid #e8e8ed;
}

.brand-name,
.brand-caption {
  margin: 0;
}

.brand-name {
  overflow: hidden;
  color: #1d1d1f;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-caption {
  margin-top: 0.125rem;
  color: #707070;
  font-size: 0.75rem;
  line-height: 1rem;
}

.sidebar-divider {
  height: 1px;
  margin: 0.75rem 0 0;
  background: #e8e8ed;
}

.side-tabs {
  display: grid;
  gap: 0.125rem;
}

.side-tabs a {
  text-decoration: none;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 0;
  padding: 0.625rem 0.75rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: #707070;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.tab-btn.active {
  background: #f5f5f7;
  color: #1d1d1f;
}

.tab-btn[aria-current="page"] {
  background: var(--soft);
  color: var(--text);
  font-weight: 600;
}

.tab-btn:hover:not(.active) {
  background: #f5f5f7;
  color: #1d1d1f;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.625rem 0.75rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: #707070;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-logout:hover {
  background: #fef2f2;
  color: #ef4444;
}

.profile-bar {
  display: flex;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.header-profile-bar {
  margin-left: auto;
  margin-right: 1rem;
}

.header-project-divider {
  width: 1px;
  height: 24px;
  margin-right: 1rem;
  background: var(--line);
}

.profile-bar-icon {
  display: flex;
  color: var(--muted);
}

#profile-select {
  width: 100%;
  min-width: 0;
  padding: 9px 38px 9px 10px;
  border: 0;
  border-radius: 12px;
  background: var(--soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  appearance: none;
  cursor: pointer;
}

.header-project-select {
  min-width: 188px;
  flex: 0 1 188px;
  border-radius: 10px;
  background: #f5f5f7;
}

.header-project-select #profile-select {
  width: 100%;
  min-width: 0;
  padding-left: 38px;
  padding-right: 38px;
  background: transparent;
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-project-select #profile-select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.project-picker-trigger { width: 100%; min-height: 36px; padding: 9px 38px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: left; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-picker-trigger.is-loading { color: var(--muted); cursor: wait; }
.project-picker-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; display: grid; gap: 4px; width: 100%; min-width: 188px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 12px 28px rgba(20, 24, 32, .14); }
.project-picker-menu[hidden] { display: none; }
.project-picker-option { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text); text-align: left; font: inherit; font-size: 13px; cursor: pointer; }
.project-picker-option:hover, .project-picker-option.selected { background: var(--soft); }

.header-project-select .profile-bar-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  pointer-events: none;
  transform: translateY(-50%);
}

.header-project-select .profile-bar-icon .icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
}

.header-profile-bar .icon-btn {
  border-radius: 8px;
  background: #f5f5f7;
}

.header-profile-bar .icon-btn:hover {
  background: #e9e9ee;
}

.header-profile-bar .icon-btn .icon {
  stroke-width: 1.5;
}

.header-profile-bar .icon-btn {
  width: 33px;
  height: 33px;
  padding: 0;
}

.header-profile-bar .icon-btn .lucide {
  width: 14px;
  height: 14px;
}

.project-modal[hidden] {
  display: none;
}

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: var(--space-12);
}

.project-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(29, 29, 31, 0.28);
}

.project-modal-card {
  position: relative;
  width: min(100%, 22rem);
  padding: var(--space-12);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: 0 16px 48px rgba(29, 29, 31, 0.16);
}

.project-modal-card h2 {
  margin: 0 0 var(--space-8);
  font-size: var(--font-page);
  line-height: var(--line-page);
}
.project-access-card p { margin: 12px 0 0; color: var(--muted); font-size: var(--font-sm); line-height: var(--line-sm); }
.project-access-card .btn { text-decoration: none; }

.project-modal-label {
  display: block;
  margin-bottom: var(--space-4);
  color: var(--muted);
  font-size: var(--font-xs);
  font-weight: 500;
}

.project-modal-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  outline: none;
}

.project-modal-card input:focus {
  border-color: var(--blue);
}

.project-modal-error {
  min-height: var(--line-sm);
  margin: var(--space-4) 0 0;
  color: var(--accent-text);
  font-size: var(--font-xs);
}

.project-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-6);
  margin-top: var(--space-8);
}

body.payment-active .header-profile-bar,
body.login-active .header-profile-bar {
  display: none;
}

body.payment-active .header-project-divider {
  display: none;
}

body.login-active .header-project-divider {
  display: none;
}

body.document-active .header-profile-bar,
body.document-active .header-project-divider {
  display: none;
}

body.document-active .dashboard-shell {
  display: block;
  width: 100%;
  margin-top: 0;
  padding: 0 1rem 1rem;
}

body.document-active .workspace {
  width: min(64rem, 100%);
  margin: 0 auto;
  padding-top: 20px;
}

.workspace {
  min-width: 0;
}

body.payment-active .dashboard-shell {
  display: block;
  width: min(28rem, 100%);
  margin-top: 0;
  padding: 0 1rem 1rem;
}

body.payment-active .sidebar {
  display: none;
}

body.login-active .sidebar { display: none; }
body.login-active #logout-view-btn { display: none; }
body.login-active .dashboard-shell { display: block; width: 100%; margin: 0; padding: 0 1rem; }
body.login-active main { max-width: none; }
.login-page { display: flex; min-height: calc(100vh - 56px); flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.login-card { width: 100%; max-width: 24rem; padding: 24px; border-radius: var(--radius-card); background: var(--surface); text-align: left; animation: neoFade var(--motion-standard) var(--motion-ease); }
.login-initial-content[hidden] { display: none; }
.login-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--soft); }
.login-icon .icon { width: 20px; height: 20px; }
.login-card h2 { margin: 16px 0 0; font-size: var(--font-page); line-height: var(--line-page); font-weight: 700; letter-spacing: -0.025em; }
.login-initial-content > p { margin-top: 0.5rem; color: var(--muted); font-size: var(--font-sm); }
.login-card > p { margin: 2px 0 0; color: var(--muted); font-size: var(--font-sm); }
.login-input-wrap { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.login-input-wrap .icon { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.login-input-wrap input { width: 100%; border: 0; outline: 0; background: transparent; font-size: var(--font-sm); font-weight: 500; }
.login-input-wrap input:focus { outline: none; box-shadow: none; }
.login-input-wrap.has-error { border-color: #b45320; }
.login-error { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; color: #b45320; font-size: var(--font-sm); font-weight: 600; }
.login-error[hidden], .login-register-btn[hidden] { display: none; }
.login-error .lucide { width: 18px; height: 18px; flex-shrink: 0; }
.login-register-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 16px; padding: 14px; border: 0; border-radius: var(--radius-pill); background: var(--blue); color: #fff; font-size: var(--font-sm); font-weight: 600; }
.login-register-btn .lucide { width: 18px; height: 18px; }
.login-code-step[hidden] { display: none; }
.login-code-step .login-icon { margin-top: var(--space-6); }
.login-back-btn { display: inline-flex; align-items: center; gap: var(--space-2); padding: 0; border: 0; background: transparent; color: var(--muted); font-size: var(--font-xs); font-weight: 500; }
.login-back-btn .lucide { width: 14px; height: 14px; }
.login-code-step h2 { margin-top: var(--space-10); }
.login-code-step > p:not(.login-code-error):not(.login-resend) { margin-top: var(--space-1); }
.login-code-stack { display: flex; flex-direction: column; align-items: center; gap: var(--space-8); margin-top: var(--space-10); }
.login-code-inputs { display: flex; justify-content: center; gap: var(--space-4); }
.login-code-input { width: 40px; height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); text-align: center; font-size: 18px; font-weight: 700; outline: none; }
.login-code-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 113, 227, .12); }
.login-code-error { margin: 12px 0 0; color: #b45320; text-align: center; font-size: var(--font-sm); font-weight: 600; }
.login-resend { margin: 0; text-align: center; color: var(--muted); font-size: var(--font-xs); font-weight: 500; }
.login-resend-btn { padding: 0; border: 0; background: transparent; color: var(--blue); font-size: var(--font-xs); font-weight: 600; cursor: pointer; }
.login-resend-btn:disabled { color: var(--muted); cursor: default; }
.login-spam-note { width: fit-content; max-width: 100%; margin: 0; padding: var(--space-4) var(--space-6); border-radius: var(--radius-control); background: #eef0f3; color: #c62828; text-align: center; font-size: var(--font-xs); line-height: var(--line-sm); font-weight: 600; }
.payment-email-step[hidden] { display: none; }
.payment-email-field { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease); }
.payment-email-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 113, 227, .12); }
.payment-email-field.has-error { border-color: #c62828; }
.payment-email-field.has-error:focus-within { border-color: #c62828; box-shadow: 0 0 0 3px rgba(198, 40, 40, .12); }
.payment-email-field .icon { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.payment-email-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; line-height: 24px; }
.payment-email-field input:focus { outline: none; box-shadow: none; }
.payment-email-step > p { margin: var(--space-6) 0 0; color: var(--muted); font-size: var(--font-sm); line-height: var(--line-sm); }
.payment-email-step > .payment-email-error { margin: var(--space-3) 0 0; color: #c62828; font-size: var(--font-xs); line-height: var(--line-sm); font-weight: 600; }
.checkout-legal { max-width: 36rem; margin: 16px auto 0; color: var(--muted); text-align: center; font-size: 12px; }
.checkout-consent { margin-top: 0; }
.checkout-autorenew-note { width: 100%; max-width: 28rem; margin-right: auto; margin-left: auto; }
.checkout-legal a { color: var(--text); text-decoration: underline; }
.login-card form > button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 16px; padding: 14px; border: 0; border-radius: var(--radius-pill); background: var(--blue); color: #fff; font-size: var(--font-sm); font-weight: 600; }
.login-card form > button .lucide { width: 16px; height: 16px; }
.login-card form > button:disabled, .login-register-btn:disabled { background: #b8bdc5; color: #fff; cursor: wait; }
.login-spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: loginSpin .7s linear infinite; }
@keyframes loginSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .login-spinner { animation-duration: 1.5s; } }
.login-card form > button .icon { width: 16px; height: 16px; }
.login-note { margin: 16px 0 0; color: var(--muted); font-size: var(--font-xs); }
.login-note + .login-note { margin-top: 8px; }
.login-note a { color: var(--text); text-decoration: underline; }
.login-note button[data-copy-email] { padding: 0; border: 0; background: transparent; color: var(--text); font: inherit; text-decoration: underline; cursor: pointer; }
.copy-toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; padding: 10px 16px; border-radius: var(--radius-pill); background: #222; color: #fff; font-size: var(--font-xs); font-weight: 600; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease); }
.copy-toast.visible { opacity: 1; transform: translate(-50%, 0); }

body.payment-active main {
  max-width: none;
}

body.payment-active .checkout-page {
  padding: 3rem 0 1rem;
}

main {
  max-width: 820px;
}

.subtitle,
.checkout-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25rem;
  font-weight: 400;
}

.app-view,
.tab-panel {
  display: none;
}

.app-view.active,
.tab-panel.active {
  display: block;
  animation: neoFade var(--motion-standard) var(--motion-ease);
}

.app-view.login-page.active {
  display: flex;
}

@keyframes neoFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-panel {
  padding: 20px;
  border-radius: 28px;
  background: var(--surface);
}

/* Document pages use the same card surface, but their sections are always visible. */
body.profile-active main.workspace > .tab-panel {
  display: block;
}

body.profile-active .workspace > main > .tab-panel {
  display: block;
  margin-bottom: 8px;
}

body.profile-active .workspace > main > .tab-panel h2 {
  margin: 0 0 var(--space-4);
  font-size: var(--font-page);
  line-height: var(--line-page);
  font-weight: 700;
  letter-spacing: -0.025em;
}

body.profile-active .workspace > main > .tab-panel p {
  margin: 0 0 var(--space-4);
  color: var(--text);
  font-size: var(--font-sm);
  line-height: 1.5;
}

body.profile-active .workspace > main > .tab-panel p:last-child {
  margin-bottom: 0;
}

body.profile-active .workspace > main > .tab-panel .profile-subscription-meta {
  display: block;
  color: var(--text);
  font-size: var(--font-sm);
  line-height: 1.5;
}

body.profile-active .workspace > main > .tab-panel span {
  overflow-wrap: anywhere;
}

body.profile-active .workspace > main > .tab-panel img[alt="Т-Банк"] {
  width: 22px;
  height: 22px;
  border-radius: 100px;
  margin-right: 0;
  margin-bottom: 2px;
}

/* The Genvito profile is an unframed page with white rows on the gray canvas. */
.tab-panel.profile-panel {
  padding: 0;
  border-radius: 0;
  background: transparent;
}

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

.profile-panel .profile-panel-heading {
  margin-bottom: 0;
}

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

.tab-panel.profile-payments-panel { padding: 0; border-radius: 0; background: transparent; }
.profile-payments-panel h2 { margin: 0; font-size: var(--font-page); line-height: var(--line-page); font-weight: 700; letter-spacing: -0.025em; }
.profile-payments-panel > .subtitle { margin-top: 2px; }
.autorenew-card { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); margin-top: var(--space-12); padding: var(--space-8); border-radius: var(--radius-card); background: var(--surface); }
.autorenew-card div { display: grid; gap: 2px; }
.autorenew-card strong { font-size: var(--font-sm); font-weight: 600; }
.autorenew-card small { color: var(--muted); font-size: var(--font-xs); }
.autorenew-toggle { position: relative; width: 48px; height: 28px; padding: 0; border: 0; border-radius: 999px; background: #d1d5db; flex-shrink: 0; transition: background 0.2s ease; }
.autorenew-toggle span { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; }
.autorenew-toggle.is-on { background: var(--blue); }
.autorenew-toggle.is-on span { transform: translateX(20px); }
.autorenew-toggle:disabled { opacity: 0.55; cursor: not-allowed; }
.payment-empty-card { display: grid; justify-items: center; gap: var(--space-6); margin-top: var(--space-12); padding: 24px; border: 1px dashed var(--line); border-radius: var(--radius-card); background: var(--surface); text-align: center; }
.payment-empty-card .icon { width: 32px; height: 32px; color: var(--muted); }
.payment-empty-card p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 500; }
.payment-method-row { display: flex; align-items: center; width: 100%; gap: 16px; text-align: left; }
.payment-method-list { display: grid; width: 100%; gap: 12px; }
.payment-method-list .payment-method-row { padding: 4px 0; }
.payment-method-primary { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 5px 9px; border: 0; border-radius: 999px; color: var(--blue); background: #e7f0ff; font: inherit; font-size: 12px; cursor: pointer; }
.payment-method-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.payment-method-primary[aria-pressed="true"] { color: #16845a; background: #e5f8ef; cursor: default; }
.payment-method-primary:disabled { color: var(--muted); background: var(--soft); cursor: not-allowed; }
.payment-method-row[hidden] { display: none !important; }
.payment-method-card-icon { width: 54px; height: 54px; flex: 0 0 54px; }
.payment-method-card-icon.is-payment-logo { width: 44px; height: 44px; flex-basis: 44px; object-fit: cover; border-radius: 10px; }
.payment-method-card-icon.is-sbp-logo { width: 64px; height: 44px; flex-basis: 64px; object-fit: contain; }
.payment-method-copy { display: grid; gap: 4px; min-width: 0; flex: 1; }
.payment-method-copy strong { color: var(--text); font-size: 15px; font-weight: 650; }
.payment-method-copy small { color: var(--muted); font-size: 13px; }
.payment-method-remove { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px; color: var(--muted); background: transparent; cursor: pointer; }
.payment-method-remove:hover { color: #d14343; background: #fff1f1; }
.payment-method-remove svg { width: 20px; height: 20px; }

.payment-success-page { min-height: calc(100vh - 78px); display: grid; place-items: center; padding: 48px 20px; }
.payment-success-card { width: min(100%, 560px); display: grid; justify-items: center; gap: 16px; padding: 48px; border-radius: 36px; background: var(--surface); text-align: center; }
.payment-success-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 24px; color: var(--blue); background: #e7f0ff; }
.payment-success-icon.is-success { color: #08a875; background: #e5f8ef; }
.payment-success-icon.is-error { color: #d14343; background: #fff0f0; }
.payment-success-icon.is-pending { color: #9a6b00; background: #fff7dd; }
.payment-success-icon svg { width: 36px; height: 36px; }
.payment-success-card h1 { margin: 4px 0 0; font-size: clamp(28px, 5vw, 40px); }
.payment-success-card > p { max-width: 430px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.5; }
.payment-success-details { width: 100%; display: flex; justify-content: space-between; gap: 16px; padding: 18px 20px; border-radius: 18px; background: var(--panel); text-align: left; }
.payment-success-details[hidden], .payment-success-actions [hidden] { display: none !important; }
.payment-success-details span { color: var(--muted); }
.payment-success-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; margin-top: 8px; }
.payment-success-actions .btn { min-width: 180px; }

@media (max-width: 600px) {
  .payment-success-page { min-height: calc(100vh - 80px); padding: 24px 16px; }
  .payment-success-card { padding: 32px 24px; border-radius: 28px; }
  .payment-success-actions { display: grid; }
  .payment-success-actions .btn { width: 100%; }
}
.payment-empty-text[hidden] { display: none !important; }
.tab-panel.profile-history-panel { padding: 0; border-radius: 0; background: transparent; }
.profile-history-panel h2 { margin: 0; font-size: var(--font-page); line-height: var(--line-page); font-weight: 700; letter-spacing: -0.025em; }
.profile-history-panel > .subtitle { margin-top: 2px; }
.history-list { display: grid; gap: 8px; margin-top: 24px; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 64px; padding: 16px; border-radius: 28px; background: var(--surface); }
.history-row div { min-width: 0; flex: 1; }
.history-row strong, .history-row small { display: block; }
.history-row strong { font-size: 14px; font-weight: 600; }
.history-row small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.history-row > strong { flex-shrink: 0; }
.history-empty { margin: 0; padding: 20px 16px; border-radius: 28px; background: var(--surface); color: var(--muted); font-size: 14px; text-align: center; }

.profile-panel-heading h2 {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.profile-panel-heading .subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25rem;
  font-weight: 400;
  letter-spacing: 0;
}

.cabinet-heading h1,
.cabinet-heading h2 {
  font-size: 20px;
  line-height: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.cabinet-heading .subtitle {
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.25rem;
  font-weight: 400;
  letter-spacing: 0;
}

.panel-header.cabinet-heading {
  display: block;
}

body.profile-active .cabinet-heading {
  display: none;
}

body.generate-active .cabinet-heading {
  display: none;
}

.referral-panel h2 { margin: 0; font-size: 20px; line-height: 1.75rem; font-weight: 700; letter-spacing: -0.025em; }
.neo-back-button { display: inline-flex; width: fit-content; align-items: center; gap: 6px; margin-bottom: 20px; padding: 6px 8px; border: 0; border-radius: var(--radius-pill); background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 500; text-decoration: none; }
.neo-back-button .icon { width: 14px; height: 14px; }
.referral-card { margin-top: 20px; border-radius: 28px; background: var(--surface); }
.referral-info { display: flex; gap: var(--space-6); margin-top: var(--space-12); padding: var(--space-8); border-radius: var(--radius-card); background: var(--surface); }
.referral-info > .icon { display: block; width: 40px; height: 40px; padding: 10px; flex: 0 0 40px; border-radius: var(--radius-control); background: var(--bg); color: var(--text); }
.referral-info > #referral-sparkles-icon { display: grid; place-items: center; width: 40px; height: 40px; padding: 10px; flex: 0 0 40px; border-radius: var(--radius-control); background: var(--bg); color: var(--text); }
.referral-info > #referral-sparkles-icon svg { width: 18px; height: 18px; stroke-width: 1; }
.referral-info svg { width: 18px; height: 18px; stroke-width: 1 !important; }
.referral-info p { margin: 0; font-size: 14px; line-height: 1.5; }
.referral-link-card { padding: 20px; }
.referral-card-heading { display: flex; align-items: center; gap: 10px; }
.referral-gift-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--radius-control); background: var(--bg); }
.referral-gift-icon svg { display: block; width: 18px; height: 18px; color: var(--text); stroke-width: 1 !important; }
.referral-link-field button .icon { width: 16px; height: 16px; flex-shrink: 0; }
.referral-card-heading h3, .referral-latest h3 { margin: 0; font-size: 14px; font-weight: 700; }
.referral-card-heading p, .referral-latest p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.referral-link-field { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.referral-link-field input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-family: ui-monospace, monospace; font-size: 12px; }
.referral-link-field input:focus { outline: 0; box-shadow: none; }
.referral-link-field button { display: flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 500; }
.referral-link-field button .icon { width: 14px; height: 14px; }
.referral-link-field button.is-copied { background: #34a853; }
.referral-link-field button:disabled { background: #c9c9cf; color: #fff; cursor: not-allowed; }
.referral-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.referral-stat { padding: 12px 14px; border-radius: 16px; background: var(--surface); }
.referral-stat span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.referral-stat span .icon { width: 16px; height: 16px; }
.referral-stat strong { display: block; margin-top: 4px; font-size: 14px; }
.referral-latest { padding: 20px; }
.referral-panel > .referral-latest { margin-top: var(--space-8); border-radius: var(--radius-card); background: var(--surface); }
.referral-latest p { margin-top: 12px; font-size: 14px; }

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

#tab-districts,
#tab-services,
#tab-generate {
  margin-top: 0;
}

#tab-services {
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.services-main-card {
  padding: 20px;
  border-radius: var(--radius-card);
  background: var(--surface);
}

.services-main-card:not(.has-services) .services-toolbar {
  margin-bottom: 0;
}

#tab-services > .synonym-help {
  margin-top: var(--space-8);
}

#tab-generate {
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.generate-content-card {
  margin-top: 20px;
}

.generate-content-card .ads-per-district-row {
  margin: 0;
  padding: 20px;
}

.ads-per-district-card {
  border-radius: var(--radius-card);
  background: var(--surface);
}

.ads-per-district-card .ads-per-district-hint {
  margin: 0;
  padding: 0 20px 20px;
}

.panel-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  line-height: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.hint code {
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--text);
  font-size: 12px;
}

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

.muted.length-status-bad {
  color: var(--danger);
  font-weight: 800;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.districts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.districts-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.districts-table td {
  padding: 3px;
  border-bottom: 1px solid var(--line);
}

.districts-table tbody tr:last-child td {
  border-bottom: none;
}

.districts-table td:last-child {
  width: 44px;
  padding: 4px;
}

.districts-table input[type="text"] {
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.districts-table input[type="text"]:hover,
.districts-table input[type="text"]:focus {
  background: var(--soft);
  outline: none;
}

.districts-table .remove-district-btn {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
}

.districts-toolbar,
.services-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#toggle-all-services-btn[hidden] {
  display: none;
}

#toggle-all-services-btn {
  display: none;
}

#tab-districts .table-scroll[hidden] {
  display: none;
}

#tab-districts .table-scroll {
  display: none;
}

.synonym-help {
  margin: var(--space-8) 0 0;
  padding: var(--space-8);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--font-sm);
  line-height: 1.5;
}

.synonym-help-heading {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
  color: var(--text);
  font-size: var(--font-sm);
  line-height: var(--line-sm);
}

.synonym-help-heading .icon {
  width: 18px;
  height: 18px;
}

.synonym-help-description {
  max-width: 58rem;
  margin: 0;
}

.synonym-help code {
  color: var(--text);
}

.synonym-examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.synonym-example {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--soft);
}

.synonym-example-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: var(--font-xs);
  font-weight: 600;
}

.synonym-example-label svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  stroke-width: 1.5;
}

.synonym-example code {
  overflow-wrap: anywhere;
  font-size: var(--font-xs);
  line-height: 1.45;
}

.synonym-example-results {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--muted);
  font-size: var(--font-xs);
}

.districts-toolbar {
  margin-top: 12px;
}

.districts-toolbar .muted {
  margin: 0;
}

.services-toolbar {
  margin-bottom: 16px;
}

.services-toolbar #add-service-btn {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.services-toolbar #add-service-btn:hover {
  border-color: var(--blue-hover);
  background: var(--blue-hover);
}

.service-card {
  margin-bottom: 12px;
  padding: 16px 18px 14px;
  border: 0;
  border-radius: 18px;
  background: var(--soft);
  transition: background var(--motion-standard) var(--motion-ease), box-shadow var(--motion-standard) var(--motion-ease), transform var(--motion-standard) var(--motion-ease);
}

.service-card:last-child {
  margin-bottom: 0;
}

.service-card:hover {
  background: #efeff3;
  box-shadow: 0 6px 16px rgba(29, 29, 31, 0.035);
  transform: translateY(-1px);
}

.service-card-header {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-bottom: 14px;
}

.service-card-primary,
.service-card-meta,
.service-card-actions,
.service-meta-fields {
  display: flex;
  align-items: center;
}

.service-card-primary { gap: 12px; }
.service-card-meta { justify-content: space-between; gap: 18px; }
.service-card-actions { gap: 4px; flex-shrink: 0; }
.service-meta-fields { gap: 8px; min-width: 0; }

.service-card-actions .icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: transparent;
}

.service-card-actions .icon-btn:hover { background: var(--surface); }
.service-card-actions .remove-service-btn { opacity: .58; }
.service-card:hover .remove-service-btn,
.service-card-actions .remove-service-btn:focus-visible { opacity: 1; }

.service-card-primary .service-name {
  height: auto;
  padding: 2px 0;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.025em;
}

.service-card-primary .service-name:hover { border-bottom-color: #d2d2d7; }
.service-card-primary .service-name:focus {
  border-color: transparent;
  border-bottom-color: var(--blue);
  box-shadow: none;
}

.collapse-toggle-btn .icon {
  transition: transform 0.15s ease;
}

.service-card.collapsed .collapse-toggle-btn .icon {
  transform: rotate(-90deg);
}

.service-card-body {
  overflow: hidden;
}

.service-card.collapsed .service-card-body {
  display: none;
}

.service-card.collapsed .service-card-header {
  margin-bottom: 12px;
}

.service-collapsed-summary {
  display: none;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(29, 29, 31, .08);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.service-card.collapsed .service-collapsed-summary {
  display: block;
}

.service-collapsed-summary.length-status-bad {
  color: var(--danger);
  font-weight: 800;
}

.service-name,
.service-price,
.service-avito-category,
#ads-per-district-input,
textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}

.service-name,
.service-price,
.service-avito-category,
#ads-per-district-input,
textarea {
  transition: border-color var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease), background var(--motion-fast) var(--motion-ease);
}

.service-name {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
}

.service-price {
  width: 96px;
  flex-shrink: 0;
  padding: 7px 11px;
}

.select-control {
  position: relative;
  min-width: 220px;
  flex: 0 1 310px;
}

.profile-bar .header-project-select {
  min-width: 188px;
  flex: 0 1 188px;
}

.service-avito-category {
  width: 100%;
  padding: 7px 12px;
  padding-right: 2.5rem;
  appearance: none;
}

.select-control-icon {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  display: flex;
  width: 1rem;
  height: 1rem;
  color: var(--text);
  pointer-events: none;
  transform: translateY(-50%);
  transition: color var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}

.select-control:focus-within .select-control-icon {
  color: var(--blue);
  transform: translateY(-50%) rotate(180deg);
}

.select-control-icon .icon {
  width: 1rem;
  height: 1rem;
}

.service-photos-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 18px 0 10px; }
.service-photos-header .field-label { margin: 0; }
.service-photos-hint { max-width: 580px; margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 17px; }
.service-photos-count { flex-shrink: 0; padding: 4px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.service-photos { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }

.service-enabled-label { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12px; font-weight: 550; color: var(--muted); cursor: pointer; }
.service-enabled-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.service-toggle { position: relative; display: inline-block; width: 34px; height: 20px; border-radius: 999px; background: #c7cbd1; transition: background .2s ease; }
.service-toggle::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; content: ''; box-shadow: 0 1px 2px rgba(0,0,0,.16); transition: transform .2s ease; }
.service-enabled:checked + .service-toggle { background: var(--blue); }
.service-enabled:checked + .service-toggle::after { transform: translateX(14px); }
.service-enabled-label:has(.service-enabled:not(:checked)) .service-enabled-text { color: var(--muted); }
.service-enabled-label:has(.service-enabled:checked) .service-enabled-text::after { content: ''; }
.service-card:not(:has(.service-enabled:checked)) { opacity: .62; }

.service-photo-row { display: grid; grid-template-columns: minmax(0, 1fr) max-content 32px; align-items: center; gap: 8px; min-height: 48px; padding: 5px 7px 5px 10px; }
.service-photo-row + .service-photo-row { border-top: 1px solid var(--line); }
.service-photo-row .service-photo-input { width: 100%; min-width: 0; height: 36px; padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text); font-size: 14px; }
.service-photo-row .service-photo-input:hover { background: var(--bg); }
.service-photo-row .service-photo-input:focus { border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 3px rgba(0, 113, 227, .1); }
.service-photo-pin { display: inline-flex; width: max-content; justify-self: end; align-items: center; justify-content: center; gap: 5px; height: 30px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 650; white-space: nowrap; transition: background var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease); }
.service-photo-pin .icon, .service-photo-pin .lucide { width: 13px; height: 13px; }
.service-photo-pin:hover { background: var(--soft); color: var(--text); }
.service-photo-pin.active { background: #e8f2ff; color: #0066cc; }
.service-photo-row .remove-photo-btn { width: 30px; height: 30px; border-radius: 8px; background: transparent; opacity: .65; }
.service-photo-row:hover .remove-photo-btn,
.service-photo-row .remove-photo-btn:focus-visible { opacity: 1; }
.add-photo-btn { min-height: 34px; margin-top: 9px; padding: 0 12px; background: var(--surface); font-size: 12px; }

textarea {
  width: 100%;
  padding: 12px 14px;
  line-height: 1.5;
  resize: none;
  overflow: hidden;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.field-label:first-of-type {
  margin-top: 0;
}

.saved-indicator {
  color: transparent;
  font-size: 13px;
  transition: color 0.2s ease;
}

.saved-indicator.saved-flash {
  color: var(--success);
}

.tpl-grow-wrap {
  display: grid;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  transition: max-height .25s ease;
}
.template-field.is-collapsed .tpl-grow-wrap { max-height: calc(3 * 1.5em + 26px); overflow: hidden; }
.template-field.is-expanded .tpl-grow-wrap { max-height: 2000px; overflow: hidden; }
.template-expand-btn { position: absolute; right: 10px; bottom: 6px; z-index: 3; display: block; margin: 0; padding: 3px 7px; border: 0; border-radius: 100px; background: #111; color: #fff; font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.template-expand-btn:hover { background: #2c2c2e; color: #fff; transform: translateY(-1px); }

.tpl-grow-wrap > .tpl-backdrop,
.tpl-grow-wrap > textarea {
  box-sizing: border-box;
  grid-area: 1 / 1 / 2 / 2;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.tpl-backdrop {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: transparent;
  pointer-events: none;
  z-index: 1;
}

.tpl-grow-wrap textarea {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  width: 100%;
  padding-bottom: 30px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  caret-color: var(--text);
  border-color: transparent;
  background: transparent;
}

.tpl-grow-wrap textarea::placeholder {
  color: var(--muted);
}

.tpl-grow-wrap:focus-within > .tpl-backdrop {
  border-color: var(--blue);
}

.tok-brace.depth-1 { color: var(--brace-1); }
.tok-brace.depth-2 { color: var(--brace-2); }
.tok-brace.depth-3 { color: var(--brace-3); }
.tok-brace.depth-4 { color: var(--brace-4); }

.tok-brace.invalid {
  border-radius: 3px;
  background: var(--danger);
  color: #fff;
}

.tok-zone {
  border-radius: 5px;
  background: var(--zone-bg);
  color: var(--zone-text);
}

.brace-status,
.length-status {
  min-height: 16px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.brace-status.brace-status-bad,
.length-status.length-status-bad {
  color: var(--danger);
  font-weight: 800;
}

.field-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.field-footer .brace-status {
  flex: 1;
}

.length-status {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: var(--soft);
  color: var(--muted);
  flex-shrink: 0;
  transition: background var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}

.icon-btn:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.icon-btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.btn.secondary {
  background: var(--soft);
  color: var(--text);
}

.btn.secondary.add-photo-btn { background: var(--surface); }
.btn.secondary.add-photo-btn:hover { background: var(--blue); color: #fff; }

.btn.primary {
  background: var(--blue);
  color: #fff;
}

.btn.primary:hover {
  background: var(--blue-hover);
}

.btn:active,
.tab-btn:active,
.top-tab:active {
  transform: scale(0.98);
}

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

.ads-per-district-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.ads-per-district-hint {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: var(--font-xs);
  line-height: var(--line-sm);
}

.ads-per-district-row .field-label {
  margin: 0;
}

.ads-per-district-row .field-label > svg {
  width: 40px;
  height: 40px;
  padding: 10px;
  flex: 0 0 40px;
  border-radius: var(--radius-control);
  background: var(--bg);
  stroke-width: 1px;
}

#ads-per-district-input {
  width: 72px;
  padding: 8px 10px;
}

.generate-box {
  margin-top: 12px;
  padding: 20px;
  border-radius: var(--radius-card);
  border: 1px dashed var(--line);
  background: var(--surface);
  text-align: center;
}

.generate-summary {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
}

.error-text {
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 13px;
}
.error-text:empty { display: none; }

.generate-results {
  margin-top: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 14px;
  border-radius: 16px;
  background: var(--soft);
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}

.stat-label,
.stat-sub {
  color: var(--muted);
}

.stat-label {
  margin-top: 4px;
  font-size: 12px;
}

.stat-sub {
  margin-top: 8px;
  font-size: 11px;
}

.stat-card.stat-good .stat-value { color: var(--success); }
.stat-card.stat-warn .stat-value { color: var(--warn); }
.stat-card.stat-bad .stat-value { color: var(--danger); }
.stat-card.stat-bad .stat-sub { color: var(--danger); }

.download-row {
  text-align: center;
}

.checkout-heading {
  max-width: 28rem;
  margin: 0 auto 2rem;
  text-align: center;
}

.checkout-heading h2 {
  margin: 0 0 0.4rem;
  color: #1d1d1f;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.feature-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 28rem;
  margin: 1rem auto 0;
}

.feature-pills span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 0;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  transition: box-shadow var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}

.feature-pills span:hover {
  box-shadow: 0 4px 12px rgba(29, 29, 31, 0.04);
  transform: translateY(-1px);
}

.feature-pills .lucide {
  width: 1rem;
  height: 1rem;
  stroke-width: 2;
}

.checkout-step {
  max-width: 28rem;
  margin: 0 auto 1.5rem;
}

.step-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.step-number {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
}

.step-title h3 {
  margin: 0;
  color: #1d1d1f;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
}

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

.tariff-card--wide {
  grid-column: 1 / -1;
}

.tariff-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 140px;
  min-height: 0;
  padding: 1rem;
  border: 0;
  border-radius: 1rem;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: border-color var(--motion-standard) var(--motion-ease), background var(--motion-standard) var(--motion-ease), box-shadow var(--motion-standard) var(--motion-ease), transform var(--motion-standard) var(--motion-ease);
}

.tariff-card:hover:not(.selected) {
  border-color: #d1d1d6;
  box-shadow: 0 6px 16px rgba(29, 29, 31, 0.035);
  transform: translateY(-1px);
}

.tariff-card.selected {
  border: 1px solid #0071e3;
  background: rgba(0, 113, 227, 0.06);
}

.tariff-card:active,
.feature-pills span:active,
.sbp-card:active {
  transform: scale(0.985);
}

.tariff-name {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
}

.tariff-card strong {
  margin-top: auto;
  color: #1d1d1f;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.tariff-card strong span {
  color: #707070;
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
}

.tariff-card small {
  display: block;
  margin-top: 0.125rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1rem;
}

.radio-circle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  color: #fff;
}

.radio-circle.checked {
  border: 0;
  background: var(--blue);
}

.radio-circle .icon {
  width: 0.75rem;
  height: 0.75rem;
  stroke-width: 3;
}

.sbp-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 76px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--blue);
  border-radius: 1rem;
  background: rgba(0, 113, 227, 0.06);
  color: var(--text);
  text-align: left;
  transition: box-shadow var(--motion-standard) var(--motion-ease), transform var(--motion-standard) var(--motion-ease);
}

.sbp-card:hover {
  box-shadow: 0 6px 16px rgba(0, 113, 227, 0.1);
}

.sbp-card:not(.selected) {
  border: 1px solid #e8e8ed;
  background: var(--surface);
}

.payment-methods {
  display: grid;
  gap: 0.75rem;
}

.payment-method {
  position: relative;
  cursor: pointer;
}

.card-method {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 76px;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 1rem;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: border-color var(--motion-standard) var(--motion-ease), box-shadow var(--motion-standard) var(--motion-ease), transform var(--motion-standard) var(--motion-ease);
}

.card-method:hover {
  border-color: #d1d1d6;
  box-shadow: 0 6px 16px rgba(29, 29, 31, 0.035);
  transform: translateY(-1px);
}

.card-method.selected {
  border: 2px solid var(--blue);
  background: rgba(0, 113, 227, 0.06);
}

.card-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 42px;
  flex-shrink: 0;
}

.card-preview img {
  display: block;
  width: 41px;
  height: 29px;
}

.card-method-copy {
  display: grid;
  gap: 0.125rem;
}

.card-method-copy strong {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
}

.card-method-copy small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1rem;
}

.sbp-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 42px;
  padding: 0;
  flex-shrink: 0;
}

.sbp-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.payment-divider {
  width: 1px;
  height: 2rem;
  background: var(--line);
  flex-shrink: 0;
}

.payment-method-copy {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
}

.payment-method-copy strong {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
}

.payment-method-copy small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1rem;
}

.checkout-total {
  max-width: 28rem;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  border-radius: 28px;
  background: var(--surface);
  transition: box-shadow var(--motion-standard) var(--motion-ease), transform var(--motion-standard) var(--motion-ease);
}

.checkout-total:hover {
  box-shadow: 0 8px 20px rgba(29, 29, 31, 0.04);
  transform: translateY(-1px);
}

.total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

 .total-row[hidden] { display: none; }

.total-row span {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.total-row strong {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  color: #1d1d1f;
}

.total-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.125rem;
}

.total-amount small {
  color: #16803c;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
}

.checkout-pay-btn {
  min-height: 0;
  width: 100%;
  padding: 0.875rem 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
}
.checkout-pay-btn.is-unavailable {
  background: #aeb4bd;
  color: #fff;
  cursor: not-allowed;
}
.checkout-pay-btn.is-unavailable:hover {
  background: #aeb4bd;
}

.checkout-pay-btn .icon {
  width: 1rem;
  height: 1rem;
  transition: transform var(--motion-fast) var(--motion-ease);
}

.checkout-pay-btn:hover .icon {
  transform: translateX(2px);
}

.checkout-pay-btn.is-processing .icon {
  animation: checkoutSpin 0.8s linear infinite;
}

.checkout-pay-btn.is-complete {
  background: #1d1d1f;
}

.checkout-pay-btn.is-complete:hover {
  background: #313136;
}

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

.checkout-feedback {
  max-height: 0;
  margin: 0;
  overflow: hidden;
  color: var(--success);
  font-size: 0.75rem;
  line-height: 1rem;
  opacity: 0;
  text-align: center;
  transition: max-height var(--motion-standard) var(--motion-ease), margin var(--motion-standard) var(--motion-ease), opacity var(--motion-standard) var(--motion-ease);
}

.checkout-feedback.is-visible {
  max-height: 5rem;
  padding: var(--space-4) var(--space-6);
  border: 0;
  border-radius: var(--radius-control);
  background: #eef0f3;
  margin-top: var(--space-3);
  color: #c62828;
  opacity: 1;
}

.checkout-feedback:not(.is-error) {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--success);
}

.checkout-total p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
}

.checkout-total .checkout-consent { margin-top: 0; }

.checkout-total a {
  color: inherit;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.checkout-total a:hover {
  color: #1d1d1f;
}

.subscription-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.profile-link-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--text);
  flex-shrink: 0;
}

.subscription-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.subscription-head p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.profile-link-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 16px;
  border-radius: 28px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

#tab-profile > .profile-link-row + .profile-link-row {
  margin-top: var(--space-8);
}

#tab-profile > .profile-link-row:first-of-type {
  margin-top: 20px;
}

.profile-link-icon .icon {
  width: 20px;
  height: 20px;
}

.profile-link-icon [data-lucide] {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.profile-referral-banner,
.profile-benefits-banner,
.profile-support-banner {
  width: 100%;
  margin-top: 16px;
  border-radius: 28px;
  box-sizing: border-box;
}

.profile-referral-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 0;
  background: #1d1d1f;
  color: #fff;
  text-align: left;
  text-decoration: none;
}

.profile-banner-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
}

.profile-banner-icon-dark { background: rgba(255, 255, 255, 0.15); }
.profile-banner-icon .icon { width: 20px; height: 20px; color: #fff; }
.profile-banner-icon [data-lucide] { width: 20px; height: 20px; color: #fff; stroke-width: 2; }
.profile-banner-copy { display: grid; gap: 2px; flex: 1; min-width: 0; }
.profile-banner-copy strong { font-size: 14px; font-weight: 700; text-decoration: none; }
.profile-banner-copy small { color: rgba(255,255,255,.7); font-size: 12px; text-decoration: none; }
.profile-banner-arrow { color: rgba(255,255,255,.8); }

.profile-benefits-banner { padding: 20px; background: var(--surface); }
.profile-benefits-banner h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.profile-benefits-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-benefits-grid span { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 12px; border-radius: 16px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 500; }
.profile-benefits-grid i, .profile-support-heading i, .profile-support-actions i { display: inline-flex; flex-shrink: 0; }
.profile-benefits-grid .icon, .profile-support-actions .icon { width: 16px; height: 16px; }

.profile-support-banner { padding: 16px; border: 1px dashed var(--line); background: var(--surface); }
.profile-support-heading { display: flex; align-items: center; gap: 12px; }
.profile-support-heading .icon { width: 20px; height: 20px; color: var(--muted); }
.profile-support-heading strong { font-size: 14px; }
.profile-support-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.profile-support-actions button, .profile-support-actions a { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 10px 16px; border: 0; border-radius: 12px; background: #e8e8ed; color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none; }
.profile-support-actions a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-link-row > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.profile-subscription-card { margin-top: var(--space-8); padding: var(--space-10); border-radius: var(--radius-card); background: var(--surface); }
.profile-subscription-card.is-loading .profile-expiry { display: none; }
.profile-subscription-card.is-loading .profile-renew-btn { display: none; }
.profile-settings-card { margin-top: var(--space-8); padding: var(--space-8); border-radius: var(--radius-card); background: var(--surface); }
.profile-settings-card h3 { margin: 0 0 var(--space-4); }
.profile-settings-card label { display: block; margin-bottom: var(--space-2); color: var(--muted); font-size: var(--font-sm); }
.profile-category-select { width: min(100%, 28rem); }
.profile-category-select .service-avito-category { width: 100%; }
.profile-settings-card p { margin: var(--space-3) 0 0; color: var(--muted); font-size: var(--font-sm); }
.profile-generation-settings { margin-top: var(--space-12); padding: 0; background: transparent; }
.profile-generation-settings h2 { margin: 0 0 var(--space-4); }
.profile-generation-settings label { display: block; margin-bottom: var(--space-2); color: var(--muted); font-size: var(--font-sm); }
.profile-generation-settings p { margin: var(--space-3) 0 0; color: var(--muted); font-size: var(--font-sm); }
.profile-subscription-head { display: flex; align-items: center; gap: 12px; }
.profile-status-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fef2f2; color: #f87171; flex-shrink: 0; }
.profile-status-icon.is-loading { background: #f1f1f3; color: #8e8e93; }
.profile-status-icon.is-active { background: #ecfdf5; color: #10b981; }
.profile-status-icon .icon { width: 20px; height: 20px; }
.profile-subscription-head strong { font-size: var(--font-sm); font-weight: 700; }
.profile-subscription-meta { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-1); color: var(--muted); font-size: var(--font-xs); font-weight: 500; }
.profile-subscription-meta .icon { width: 12px; height: 12px; }
.profile-expiry { margin-top: 16px; padding: 10px 12px; border-radius: 16px; background: var(--soft); }
.profile-expiry div { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.profile-expiry .icon { width: 16px; height: 16px; }
.profile-expiry > strong { display: block; margin-top: 4px; font-size: 14px; font-weight: 600; }
.profile-renew-btn { display: flex; align-items: center; justify-content: center; gap: var(--space-4); width: auto; margin: 0 0 0 auto; padding: 10px 14px; border: 0; border-radius: var(--radius-pill); background: var(--blue); color: #fff; font-size: var(--font-xs); font-weight: 600; white-space: nowrap; }
.profile-renew-btn[hidden] { display: none !important; }
.profile-renew-btn .icon { width: 16px; height: 16px; }
.profile-cancel-btn { display: block; margin: 10px auto 0; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: var(--font-xs); text-decoration: underline; cursor: pointer; }
#profile-cancel-btn[hidden] { display: none; }
.profile-cancel-link { display: block; margin-top: 12px; color: var(--muted); font-size: 12px; text-align: center; text-decoration: underline; text-underline-offset: 3px; }

.profile-link-row strong,
.profile-link-row small {
  display: block;
}

.profile-link-row strong {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.profile-link-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1rem;
}

.row-arrow {
  display: flex;
  color: var(--muted);
}

.row-arrow .icon {
  width: 24px;
  height: 24px;
}

.profile-history-panel .history-list { gap: 8px; margin-top: 24px; }
.profile-history-panel .history-row { min-height: 64px; padding: 16px; border-radius: 28px; background: var(--surface); }
.profile-history-panel .history-row strong { color: var(--text); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.profile-history-panel .history-row small { margin-top: 2px; color: var(--muted); font-size: 12px; }

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (max-width: 800px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
    width: min(760px, calc(100% - 32px));
  }

  .sidebar {
    position: static;
  }

  .side-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tab-btn {
    justify-content: center;
    text-align: center;
  }

  main {
    max-width: none;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: 76px;
  }

  .neo-header-inner {
    height: 3.5rem;
    padding: 0 0.75rem;
    gap: 0.5rem;
  }

  .genvito-logo {
    width: 72px;
    flex: 0 0 72px;
  }

  .header-account-email,
  .header-profile-bar,
  .header-project-divider {
    display: none;
  }

  .top-tabs {
    margin-left: auto;
    gap: 0.25rem;
  }

  .top-tab {
    padding: 0.5rem 0.625rem;
    white-space: nowrap;
  }

  .top-tabs {
    gap: 0.25rem;
  }

  .top-tab {
    min-height: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }

  .top-tab-icon {
    width: auto;
    padding: 0.5rem;
  }

  .dashboard-shell {
    width: calc(100% - 24px);
    gap: 18px;
    margin-top: 22px;
  }

  .sidebar {
    position: fixed;
    top: auto !important;
    right: 0;
    bottom: 0 !important;
    left: 0;
    z-index: 35;
    display: block;
    padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 24px rgba(29, 29, 31, 0.08);
  }

  .neo-account,
  .sidebar-divider,
  .sidebar-logout {
    display: none;
  }

  .side-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.15rem;
  }

  .tab-btn {
    justify-content: center;
    flex-direction: column;
    gap: 0.15rem;
    min-height: 3rem;
    padding: 0.35rem 0.15rem;
    font-size: 0.65rem;
    line-height: 0.8rem;
    text-align: center;
  }

  .tab-btn .icon {
    width: 18px;
    height: 18px;
  }

  .subtitle:not(.cabinet-heading .subtitle),
  .checkout-heading p {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  .tab-panel {
    padding: 20px;
    border-radius: 28px;
  }

  .panel-header h2,
  .step-title h3 {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  .hint {
    font-size: 14px;
  }

  .tariff-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tariff-card {
    height: 140px;
    padding: 1rem;
  }

  .tariff-card strong {
    font-size: 1.5rem;
    line-height: 2rem;
  }

  .tariff-name,
  .tariff-card small,
  .total-row span {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  .tariff-card small {
    font-size: 0.75rem;
    line-height: 1rem;
  }

  .sbp-card {
    min-height: 58px;
    padding: 0 1rem;
  }

  .checkout-total {
    padding: 1rem 1.5rem;
  }

  .checkout-pay-btn {
    min-height: 0;
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  .services-toolbar,
  .districts-toolbar,
  .ads-per-district-row {
    align-items: stretch;
    flex-direction: column;
  }

  .service-card-meta {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .service-meta-fields { display: grid; grid-template-columns: minmax(0, 1fr) 96px; width: auto; min-width: 0; max-width: 100%; }
  .service-meta-fields .select-control,
  .service-meta-fields .service-avito-category { min-width: 0; max-width: 100%; }

  .select-control,
  #ads-per-district-input {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .header-account-email {
    max-width: 130px;
    margin-left: .5rem;
  }

  .profile-bar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .header-profile-bar {
    margin-right: 0.75rem;
  }

  .header-project-divider {
    margin-right: 0.75rem;
  }

  .header-profile-bar .icon-btn {
    display: none;
  }

  .profile-bar .header-project-select {
    min-width: 0;
    flex-basis: 170px;
  }

  .profile-bar .icon-btn {
    width: 100%;
  }

  .total-row,
  .subscription-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-link-row {
    flex-direction: row;
    align-items: center;
  }

  .profile-link-row > span:nth-child(2) {
    min-width: 0;
  }

  .profile-link-row small {
    white-space: nowrap;
  }

  .profile-panel-heading {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }

  .profile-panel-heading > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
  }

  .profile-panel-heading .subtitle {
    margin-top: 0;
  }

  .synonym-examples {
    grid-template-columns: 1fr;
  }

  .service-card { padding: 14px; }
  .service-card-primary { gap: 6px; }
  .service-card-primary .service-name { font-size: 16px; }
  .service-card-actions { gap: 0; }
  .service-meta-fields { grid-template-columns: minmax(0, 1fr) 88px; }
  .service-card .service-price { width: 88px; }

  .service-photos-header { align-items: flex-start; }
  .service-photo-row { grid-template-columns: minmax(0, 1fr) 30px 30px; gap: 4px; padding-left: 8px; }
  .service-photo-pin { width: 30px; padding: 0; }
  .service-photo-pin span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

  body.payment-active .checkout-page {
    padding-right: 12px;
    padding-left: 12px;
  }

  .payment-active .checkout-page .checkout-heading h1 {
    font-size: 1.65rem;
    line-height: 2rem;
  }

  .payment-active .total-row {
    align-items: baseline;
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
    white-space: nowrap;
  }

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

  #profile-payment-method-card {
    padding: 16px;
  }

  .history-row {
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
#profile-detach-card[hidden] {
  display: none !important;
}

#profile-payment-feedback:empty {
  display: none;
}
