/* Editorial dark — общие токены и переопределения для страниц с body.editorial.
   Загружается ПОСЛЕ styles.css, поэтому переопределяет нужное в своей зоне. */

body.editorial {
  --bg: #0e0e0c;
  --bg-elev: #131311;
  --surface: rgba(255, 255, 255, 0.025);
  --surface-strong: rgba(255, 255, 255, 0.04);
  --line: rgba(237, 233, 224, 0.10);
  --line-strong: rgba(237, 233, 224, 0.20);
  --text: #ede9e0;
  --muted: #9a968b;
  --muted-soft: #6a665d;
  --accent: #e8b768;
  --accent-soft: rgba(232, 183, 104, 0.14);
  --accent-text: #f4cd8a;
  --accent-ink: #1a1407;
  --danger: #d9785a;
  --success: #7fb069;
  --serif: "Instrument Serif", "Source Serif 4", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --page: 1180px;
  --gutter: 28px;

  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  isolation: isolate;
}

/* Спокойный editorial-фон: статичная сетка + один тёплый радиал.
   Анимация фона осталась только на лендинге (.landing-v2), чтобы рабочие
   страницы не отвлекали от текста. */
body.editorial::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(rgba(237, 233, 224, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237, 233, 224, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 12% 14%, rgba(232, 183, 104, 0.10), transparent 36%),
    var(--bg);
  background-size: 56px 56px, 56px 56px, 100% 100%, 100% 100%;
}

body.editorial::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(120deg, transparent 0%, transparent 42%, rgba(232, 183, 104, 0.05) 50%, transparent 58%, transparent 100%),
    linear-gradient(180deg, rgba(14, 14, 12, 0.18), rgba(14, 14, 12, 0.78));
  background-size: 220% 220%, 100% 100%;
  background-position: 0% 0%, 0% 0%;
  animation: editorialShine 18s ease-in-out infinite;
}

@keyframes editorialShine {
  0%, 100% { background-position: 0% 0%, 0% 0%; }
  50%      { background-position: 100% 100%, 0% 0%; }
}

@media (prefers-reduced-motion: reduce) {
  body.editorial::after {
    animation: none;
  }
}

body.editorial > * {
  position: relative;
  z-index: 1;
}

body.editorial::selection,
body.editorial *::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

body.editorial a {
  color: inherit;
  text-decoration: none;
}

/* Универсальный курсивный акцент в заголовках */
body.editorial h1 em,
body.editorial h2 em,
body.editorial .section-title em {
  font-style: italic;
  color: var(--accent-text);
}

/* ── Переопределение базовых button-классов в editorial-зоне ───── */
body.editorial .primary-button,
body.editorial .secondary-button,
body.editorial .ghost-button {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 11px 18px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body.editorial .primary-button {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
body.editorial .primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(232, 183, 104, 0.20);
}
body.editorial .primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

body.editorial .secondary-button {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
body.editorial .secondary-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
body.editorial .secondary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

body.editorial .ghost-button {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  padding: 8px 10px;
}
body.editorial .ghost-button:hover:not(:disabled) {
  color: var(--text);
}

body.editorial .compact-button {
  padding: 7px 12px;
  font-size: 13px;
}

/* Поля ввода */
body.editorial .input,
body.editorial input[type="text"],
body.editorial input[type="email"],
body.editorial input[type="password"],
body.editorial select,
body.editorial textarea {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
body.editorial .input::placeholder,
body.editorial textarea::placeholder {
  color: var(--muted-soft);
}
body.editorial .input:focus,
body.editorial input[type="text"]:focus,
body.editorial input[type="email"]:focus,
body.editorial input[type="password"]:focus,
body.editorial select:focus,
body.editorial textarea:focus {
  border-color: var(--accent);
}

/* Утилитарные классы из styles.css сохраняем, но в editorial-зоне переопределяем */
body.editorial .hidden { display: none !important; }
body.editorial .hidden-panel { display: none !important; }

/* Surface-панель в editorial — без блюра, тонкая рамка */
body.editorial .surface-panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

/* Микро-лейбл — моноширинный, маленький */
body.editorial .micro-label,
body.editorial .e-micro {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
body.editorial .micro-label::before,
body.editorial .e-micro::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  display: inline-block;
}

/* Заголовки secций в editorial — serif */
body.editorial .section-title,
body.editorial .e-h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}
body.editorial .e-h1 em {
  font-style: italic;
  color: var(--accent-text);
}

body.editorial .section-text {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

/* Топбар (общая шапка для /app, /billing, /admin и т.д.) */
body.editorial .e-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--page);
  margin: 0 auto;
  padding: 18px var(--gutter);
  border-bottom: 1px solid var(--line);
  gap: 24px;
}
body.editorial .e-topbar-brand {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
}
body.editorial .e-topbar-brand .e-dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  transform: translateY(-2px);
}
body.editorial .e-topbar-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
  justify-content: center;
}
body.editorial .e-topbar-nav a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  transition: color 0.15s ease;
}
body.editorial .e-topbar-nav a:hover,
body.editorial .e-topbar-nav a.is-active {
  color: var(--text);
}
body.editorial .e-topbar-nav a.is-active {
  position: relative;
}
body.editorial .e-topbar-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 1px;
  background: var(--accent);
}
body.editorial .e-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
body.editorial .e-tokens {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: var(--r-md);
  transition: border-color 0.15s ease, color 0.15s ease;
}
body.editorial .e-tokens:hover {
  border-color: var(--accent);
  color: var(--text);
}
body.editorial .e-tokens strong {
  color: var(--text);
  font-weight: 500;
  margin-left: 6px;
}

/* Подавляем старую брэнд-шапку из styles.css если она используется на editorial-страницах */
body.editorial .app-topbar {
  display: none !important;
}

/* ── AUTH ─────────────────────────────────────────────────────── */
body.editorial-auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}
body.editorial-auth .auth-shell {
  width: 100%;
  max-width: 420px;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  margin-inline: auto;
}
body.editorial-auth .auth-layout {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-items: center;
  gap: 0;
}
body.editorial-auth .auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 36px 32px;
  text-align: left;
  box-shadow: none;
  backdrop-filter: none;
}
body.editorial-auth .auth-back-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-soft);
  display: inline-block;
  margin-bottom: 24px;
  transition: color 0.15s ease;
}
body.editorial-auth .auth-back-link:hover {
  color: var(--text);
}
body.editorial-auth .auth-title-centered,
body.editorial-auth .section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 16px 0 8px;
  text-align: left;
}
body.editorial-auth .auth-subtitle-centered,
body.editorial-auth .section-text {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 28px;
  text-align: left;
}
body.editorial-auth .auth-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 3px;
  margin-bottom: 22px;
  background: var(--bg);
}
body.editorial-auth .auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
body.editorial-auth .auth-tab.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}
body.editorial-auth .auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body.editorial-auth .consent-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  padding: 8px 0 4px;
}
body.editorial-auth .consent-row a {
  color: var(--accent-text);
  border-bottom: 1px dashed var(--line-strong);
}
body.editorial-auth .consent-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}
body.editorial-auth .captcha-box {
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  color: var(--muted-soft);
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
}
body.editorial-auth .auth-referral-note {
  background: var(--accent-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body.editorial-auth .auth-referral-note strong {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}
body.editorial-auth .auth-referral-note span {
  font-size: 13px;
  color: var(--muted);
}
body.editorial-auth .status-line {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}
body.editorial-auth .primary-button {
  width: 100%;
  justify-content: center;
  padding: 13px 18px;
  margin-top: 6px;
}

/* ── APP / редактор ───────────────────────────────────────────── */
body.editorial-app {
  min-height: 100vh;
}
body.editorial-app .workspace-shell {
  max-width: var(--page);
  margin: 0 auto;
  padding: 32px var(--gutter) 80px;
}
body.editorial-app .workspace-panel {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
}

/* Подавляем «героический» блок редактора */
body.editorial-app .rewrite-hero {
  display: none !important;
}

/* Заголовок страницы перед редактором */
body.editorial-app .e-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 22px;
  gap: 20px;
}
body.editorial-app .e-editor-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 6px 0 0;
}
body.editorial-app .e-editor-title em {
  font-style: italic;
  color: var(--accent-text);
}
body.editorial-app .e-meter {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
body.editorial-app .e-meter strong {
  color: var(--text);
  font-weight: 500;
}

/* Двухпанельный редактор */
body.editorial-app .editor-stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  overflow: hidden;
  margin-bottom: 20px;
}
body.editorial-app .editor-stage.has-result {
  grid-template-columns: 1fr 1fr;
}
body.editorial-app .editor-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 20px 22px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  min-height: 420px;
}
body.editorial-app .editor-card + .editor-card {
  border-left: 1px solid var(--line);
}
body.editorial-app .editor-card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
body.editorial-app .editor-card-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
body.editorial-app .editor-area {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0;
  resize: none;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  width: 100%;
  outline: none;
  min-height: 380px;
}
body.editorial-app .editor-area::placeholder {
  color: var(--muted-soft);
}
body.editorial-app .compare-preview {
  flex: 1;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
body.editorial-app .preview-added {
  background: transparent;
  color: inherit;
  border-radius: 0;
  padding: 0;
}
body.editorial-app .preview-removed {
  color: inherit;
  background: transparent;
  text-decoration: none;
}
body.editorial-app .result-output-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: static;
  overflow: visible;
  border-radius: 0;
}
body.editorial-app .result-copy-button {
  align-self: flex-end;
  position: static;
  top: auto;
  right: auto;
  z-index: auto;
  min-height: 0;
  margin: 0;
}
body.editorial-app .result-badges {
  display: flex;
  gap: 10px;
  align-items: center;
}
body.editorial-app .human-score {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-text);
  border: 1px solid var(--line-strong);
  background: transparent;
  padding: 4px 8px;
  border-radius: var(--r-sm);
}
body.editorial-app .cache-badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-soft);
  border: 1px solid var(--line);
  padding: 3px 7px;
  border-radius: var(--r-sm);
}

/* Тулбар контролов */
body.editorial-app .e-toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  margin-bottom: 18px;
}
body.editorial-app .e-toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
body.editorial-app .e-toolbar-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
body.editorial-app .e-toolbar select {
  width: auto;
  padding: 7px 28px 7px 10px;
  font-size: 13px;
  background: var(--bg);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%239a968b' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 8px;
  cursor: pointer;
}
body.editorial-app .e-toolbar-sep {
  width: 1px;
  height: 18px;
  background: var(--line);
}
body.editorial-app .toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
body.editorial-app .toggle-input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
body.editorial-app .toggle-ui {
  display: none;
}
body.editorial-app .toggle-copy {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

body.editorial-app .help-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-soft);
  margin: 0 0 14px;
}
body.editorial-app .action-row {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}
body.editorial-app .status-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
  margin: 0 0 24px;
}

/* Verify notice — компактный */
body.editorial-app .verify-notice {
  background: var(--accent-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 22px;
  transition: opacity 0.4s ease;
}
body.editorial-app .verify-notice.verified {
  opacity: 0;
}
body.editorial-app .verify-code-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
body.editorial-app .verify-code-input {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.4em;
  color: var(--text);
  width: 140px;
  text-align: center;
}

/* Legal notice — мелкий */
body.editorial-app .legal-notice {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  background: transparent;
  margin-top: 24px;
}
body.editorial-app .pill-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
}
body.editorial-app .info-pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px dashed var(--line-strong);
  padding: 2px 0 1px;
  border-radius: 0;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  transition: color 0.15s ease;
}
body.editorial-app .info-pill:hover {
  color: var(--text);
}

/* Zero balance sticky */
body.editorial-app .balance-sticky {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev);
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 50;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
body.editorial-app .balance-sticky-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body.editorial-app .balance-sticky-copy strong {
  font-size: 14px;
  color: var(--text);
}
body.editorial-app .balance-sticky-copy span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* Copy toast */
body.editorial-app .copy-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 10px 14px;
  display: none;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  z-index: 60;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
body.editorial-app .copy-toast.visible {
  display: inline-flex;
}
body.editorial-app .copy-toast-mark {
  color: var(--success);
}

/* Меню-кнопка топбара (мобильная) */
body.editorial .menu-button {
  display: none;
}

@media (max-width: 760px) {
  body.editorial .e-topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px var(--gutter);
  }
  body.editorial .e-topbar-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  body.editorial .e-topbar-nav a.is-active::after {
    bottom: -6px;
  }
  body.editorial-app .editor-stage.has-result {
    grid-template-columns: 1fr;
  }
  body.editorial-app .editor-card + .editor-card {
    border-left: none;
    border-top: 1px solid var(--line);
  }
  body.editorial-app .e-editor-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  body.editorial-app .e-meter {
    text-align: left;
  }
  body.editorial-app .action-row {
    flex-direction: column;
  }
  body.editorial-app .action-row .primary-button,
  body.editorial-app .action-row .secondary-button {
    width: 100%;
    justify-content: center;
  }
}

/* ── COOKIE BANNER (в base.html, общее для всех editorial-страниц) ─ */
body.editorial .cookie-consent {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 14px 18px;
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  z-index: 80;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: none;
}
body.editorial .cookie-consent.hidden {
  display: none;
}
body.editorial .cookie-copy {
  flex: 1;
  min-width: 240px;
}
body.editorial .cookie-copy strong {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}
body.editorial .cookie-copy p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
body.editorial .cookie-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
body.editorial .cookie-actions .primary-button,
body.editorial .cookie-actions .ghost-button {
  padding: 8px 14px;
  font-size: 13px;
}
body.editorial .cookie-actions .ghost-button {
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
body.editorial .cookie-actions .ghost-button:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ── BILLING ─────────────────────────────────────── */
body.editorial-billing {
  min-height: 100vh;
}
body.editorial-billing .billing-shell {
  max-width: var(--page);
  margin: 0 auto;
  padding: 40px var(--gutter) 80px;
}
body.editorial-billing .billing-hero {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  margin-bottom: 32px;
}
body.editorial-billing .billing-hero h1.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 56px);
  margin: 12px 0 16px;
  letter-spacing: -0.02em;
}
body.editorial-billing .billing-value-strip {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
body.editorial-billing .billing-value-strip .info-pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 0;
  letter-spacing: 0.02em;
}
body.editorial-billing .billing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 40px;
}
body.editorial-billing .billing-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: none;
  backdrop-filter: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
body.editorial-billing .billing-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
body.editorial-billing .billing-card-featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), var(--bg-elev) 60%);
}
body.editorial-billing .billing-card-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body.editorial-billing .billing-card-head strong {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
body.editorial-billing .billing-card-head > span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
body.editorial-billing .billing-badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 4px;
}
body.editorial-billing .billing-card-text {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
body.editorial-billing .billing-card-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
body.editorial-billing .billing-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
body.editorial-billing .billing-metric-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
body.editorial-billing .billing-metric strong {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
body.editorial-billing .billing-usecases {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body.editorial-billing .billing-usecases .info-pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 0;
}
body.editorial-billing .billing-usecases .info-pill::before {
  content: "·";
  margin-right: 8px;
  color: var(--accent);
}
body.editorial-billing .billing-upsell-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
  font-style: italic;
}
body.editorial-billing .billing-upsell-note-strong {
  color: var(--accent-text);
  font-style: normal;
}
body.editorial-billing .billing-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
body.editorial-billing .billing-price {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.02em;
}
body.editorial-billing .buy-token-button {
  padding: 11px 18px;
}

body.editorial-billing .billing-chooser {
  margin: 0 0 32px;
}
body.editorial-billing .billing-chooser-copy h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 8px 0 18px;
}
body.editorial-billing .billing-chooser-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
body.editorial-billing .billing-chooser-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body.editorial-billing .billing-chooser-card strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
}
body.editorial-billing .billing-chooser-card span {
  font-size: 13px;
  color: var(--muted);
}
body.editorial-billing .billing-chooser-card-featured {
  border-color: var(--accent);
  background: var(--accent-soft);
}

body.editorial-billing .billing-facts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}
body.editorial-billing .billing-fact {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
body.editorial-billing .billing-fact h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  margin: 8px 0 8px;
  letter-spacing: -0.01em;
}
body.editorial-billing .billing-fact p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
body.editorial-billing .billing-fact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}
body.editorial-billing .billing-fact-links a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px dashed var(--line-strong);
  padding-bottom: 1px;
  transition: color 0.15s ease;
}
body.editorial-billing .billing-fact-links a:hover {
  color: var(--text);
}

/* Upsell modal */
body.editorial-billing .billing-upsell-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
}
body.editorial-billing .billing-upsell-modal.hidden {
  display: none;
}
body.editorial-billing .billing-upsell-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
body.editorial-billing .billing-upsell-panel {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 28px 32px;
  max-width: 420px;
  width: calc(100% - 40px);
  z-index: 1;
  backdrop-filter: none;
}
body.editorial-billing .billing-upsell-panel h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  margin: 10px 0 12px;
  letter-spacing: -0.01em;
}
body.editorial-billing .billing-upsell-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

body.editorial-billing .copy-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 10px 14px;
  display: none;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  z-index: 60;
}
body.editorial-billing .copy-toast.visible {
  display: inline-flex;
}

body.editorial-billing .status-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
  margin: 12px 0 0;
}
body.editorial-billing .token-pill {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: var(--r-md);
  background: transparent;
}
body.editorial-billing .token-pill .token-value {
  color: var(--text);
  margin-left: 6px;
  font-weight: 500;
}

/* ── VERIFY ─────────────────────────────────────── */
body.editorial-verify {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.editorial-verify .billing-shell {
  max-width: 520px;
  margin: 0 auto;
  padding: 60px var(--gutter) 80px;
  width: 100%;
}
body.editorial-verify .billing-hero {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  margin-bottom: 24px;
  text-align: left;
}
body.editorial-verify .billing-hero .verify-title,
body.editorial-verify .billing-hero .section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 40px;
  letter-spacing: -0.02em;
  margin: 10px 0 12px;
}
body.editorial-verify .verify-grid {
  display: block;
}
body.editorial-verify .verification-card,
body.editorial-verify .details-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: none;
  backdrop-filter: none;
}
body.editorial-verify .verification-card h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  margin: 10px 0 8px;
}
body.editorial-verify .verification-card p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.5;
}
body.editorial-verify .verify-code-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
body.editorial-verify .verify-code-input {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.4em;
  color: var(--text);
  width: 160px;
  text-align: center;
}
body.editorial-verify .verify-code-input:focus {
  border-color: var(--accent);
  outline: none;
}
body.editorial-verify .status-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
}

/* ── LEGAL ──────────────────────────────────────── */
body.editorial-legal {
  min-height: 100vh;
}
body.editorial-legal .billing-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px var(--gutter) 80px;
}
body.editorial-legal .billing-hero,
body.editorial-legal .legal-hero {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  margin-bottom: 32px;
}
body.editorial-legal .ghost-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-soft);
  display: inline-block;
  margin-bottom: 18px;
  transition: color 0.15s ease;
}
body.editorial-legal .ghost-link:hover {
  color: var(--text);
}
body.editorial-legal .legal-hero h1.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.4vw, 48px);
  margin: 12px 0 14px;
  letter-spacing: -0.02em;
}
body.editorial-legal .legal-hero p.section-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}
body.editorial-legal .legal-hero .inline-link {
  color: var(--accent-text);
  border-bottom: 1px dashed var(--line-strong);
}
body.editorial-legal .document-tabs {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
body.editorial-legal .document-tab {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding: 6px 14px;
  border-right: 1px solid var(--line);
  transition: color 0.15s ease;
}
body.editorial-legal .document-tab:last-child {
  border-right: none;
}
body.editorial-legal .document-tab:first-child {
  padding-left: 0;
}
body.editorial-legal .document-tab:hover {
  color: var(--text);
}
body.editorial-legal .document-tab.active {
  color: var(--accent-text);
}
body.editorial-legal .legal-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
body.editorial-legal .legal-section {
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 20px 0 0;
  box-shadow: none;
  backdrop-filter: none;
}
body.editorial-legal .legal-section h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
body.editorial-legal .legal-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.editorial-legal .legal-section li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
}
body.editorial-legal .legal-section li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}
body.editorial-legal .legal-notice {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-top: 30px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
body.editorial-legal .legal-notice p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 760px) {
  body.editorial-billing .billing-grid,
  body.editorial-billing .billing-chooser-grid,
  body.editorial-billing .billing-facts-grid {
    grid-template-columns: 1fr;
  }
}

/* ── ACCOUNT ────────────────────────────────────── */
body.editorial-account {
  min-height: 100vh;
}
body.editorial-account .billing-shell {
  max-width: var(--page);
  margin: 0 auto;
  padding: 40px var(--gutter) 80px;
}
body.editorial-account .billing-hero {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  margin-bottom: 28px;
}
body.editorial-account .billing-hero h1.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.6vw, 48px);
  margin: 12px 0 12px;
  letter-spacing: -0.02em;
}
body.editorial-account .account-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
body.editorial-account .details-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: none;
  backdrop-filter: none;
}
body.editorial-account .details-card h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
}
body.editorial-account .details-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
body.editorial-account .details-card .primary-button,
body.editorial-account .details-card .secondary-button {
  align-self: flex-start;
  margin-top: 4px;
}
body.editorial-account .compact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.editorial-account .verify-code-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
body.editorial-account .verify-code-input {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.3em;
  color: var(--text);
  width: 130px;
  text-align: center;
}
body.editorial-account .account-referral-card {
  background: var(--bg-elev);
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: none;
  backdrop-filter: none;
}
body.editorial-account .account-referral-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
body.editorial-account .account-referral-head h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  margin: 6px 0 0;
}
body.editorial-account .account-referral-link-row {
  margin-top: 12px;
}
body.editorial-account .account-referral-link-row .input {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg);
}
body.editorial-account .account-ledger {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: none;
  backdrop-filter: none;
}
body.editorial-account .history-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}
body.editorial-account .history-card-head h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  margin: 6px 0 0;
}
body.editorial-account .ledger-list {
  display: flex;
  flex-direction: column;
}
body.editorial-account .ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
body.editorial-account .ledger-row:first-child {
  border-top: none;
}
body.editorial-account .ledger-row strong {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
body.editorial-account .ledger-row p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}
body.editorial-account .ledger-row > span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-soft);
}
body.editorial-account .status-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
  min-height: 16px;
}

/* ── HISTORY ────────────────────────────────────── */
body.editorial-history {
  min-height: 100vh;
}
body.editorial-history .billing-shell {
  max-width: var(--page);
  margin: 0 auto;
  padding: 40px var(--gutter) 80px;
}
body.editorial-history .billing-hero {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  margin-bottom: 28px;
}
body.editorial-history .billing-hero h1.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.6vw, 48px);
  margin: 12px 0 12px;
  letter-spacing: -0.02em;
}
body.editorial-history .history-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
body.editorial-history .history-card,
body.editorial-history .surface-panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: none;
  backdrop-filter: none;
}
body.editorial-history .history-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}
body.editorial-history .history-card-head strong {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text);
  text-transform: lowercase;
}
body.editorial-history .history-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-soft);
  margin: 4px 0 0;
}
body.editorial-history .feature-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  border: 1px solid var(--line-strong);
  padding: 3px 8px;
  border-radius: var(--r-sm);
}
body.editorial-history .history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
body.editorial-history .history-column {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.editorial-history .history-column + .history-column {
  border-left: 1px solid var(--line);
}
body.editorial-history .history-column .micro-label {
  margin-bottom: 0;
}
body.editorial-history .history-column .compare-preview {
  background: transparent;
  border: none;
  padding: 0;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── COMPOSE ────────────────────────────────────── */
body.editorial-compose {
  min-height: 100vh;
}
body.editorial-compose .workspace-shell {
  max-width: var(--page);
  margin: 0 auto;
  padding: 32px var(--gutter) 80px;
}
body.editorial-compose .compose-hero {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 32px;
  align-items: start;
}
body.editorial-compose .compose-hero h1.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 44px);
  margin: 10px 0 12px;
  letter-spacing: -0.02em;
}
body.editorial-compose .compose-hero p.section-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
body.editorial-compose .editor-upsell-scenarios {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}
body.editorial-compose .editor-upsell-scenarios .info-pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 0;
}
body.editorial-compose .editor-upsell-scenarios .info-pill::before {
  content: "·";
  margin-right: 6px;
  color: var(--accent);
}
body.editorial-compose .compose-hero-note {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body.editorial-compose .compose-hero-note .feature-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-text);
  letter-spacing: 0.04em;
}
body.editorial-compose .compose-hero-note p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

body.editorial-compose .compose-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
}
body.editorial-compose .compose-form,
body.editorial-compose .compose-result {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: none;
  backdrop-filter: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
body.editorial-compose .compose-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
body.editorial-compose .compose-section-head h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  margin: 6px 0 0;
  letter-spacing: -0.01em;
}
body.editorial-compose .compose-need-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 8px 12px;
  min-width: 110px;
}
body.editorial-compose .compose-need-box strong {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
body.editorial-compose .compose-need-box span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
body.editorial-compose .compose-control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
body.editorial-compose .control-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body.editorial-compose .control-block > span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
body.editorial-compose .select-wrap {
  position: relative;
}
body.editorial-compose .select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 36px 10px 14px;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%239a968b' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
}
body.editorial-compose .select:focus {
  border-color: var(--accent);
  outline: none;
}
body.editorial-compose .compose-balance-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: transparent;
}
body.editorial-compose .compose-balance-bar p {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
body.editorial-compose .compose-balance-bar .micro-label {
  margin-bottom: 0;
}
body.editorial-compose .compose-topic-area,
body.editorial-compose .compose-comments-area {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
  min-height: 90px;
  resize: vertical;
}
body.editorial-compose .compose-topic-area {
  min-height: 120px;
}
body.editorial-compose .help-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-soft);
  margin: 0;
}
body.editorial-compose .action-row {
  display: flex;
  gap: 10px;
}
body.editorial-compose .status-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
  margin: 0;
}
body.editorial-compose .compose-result {
  min-height: 480px;
}
body.editorial-compose .result-output-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body.editorial-compose .result-copy-button {
  align-self: flex-end;
}
body.editorial-compose .compose-output {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  min-height: 240px;
  max-height: 480px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
}
body.editorial-compose .human-score {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-text);
  border: 1px solid var(--line-strong);
  padding: 4px 8px;
  border-radius: var(--r-sm);
}
body.editorial-compose .compose-meta-row {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
body.editorial-compose .compose-meta-line {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-soft);
}
body.editorial-compose .copy-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 10px 14px;
  display: none;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  z-index: 60;
}
body.editorial-compose .copy-toast.visible {
  display: inline-flex;
}
body.editorial-compose .copy-toast-mark {
  color: var(--success);
}

@media (max-width: 760px) {
  body.editorial-account .account-grid {
    grid-template-columns: 1fr;
  }
  body.editorial-compose .compose-hero {
    grid-template-columns: 1fr;
  }
  body.editorial-compose .compose-grid {
    grid-template-columns: 1fr;
  }
  body.editorial-compose .compose-control-grid {
    grid-template-columns: 1fr;
  }
  body.editorial-history .history-grid {
    grid-template-columns: 1fr;
  }
  body.editorial-history .history-column + .history-column {
    border-left: none;
    border-top: 1px solid var(--line);
  }
}

/* ── ADMIN RECEIPTS ─────────────────────────────── */
body.editorial-admin {
  min-height: 100vh;
}
body.editorial-admin .billing-shell,
body.editorial-admin .admin-shell {
  max-width: var(--page);
  margin: 0 auto;
  padding: 40px var(--gutter) 80px;
}
body.editorial-admin .admin-hero,
body.editorial-admin .billing-hero {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 28px;
  box-shadow: none;
  backdrop-filter: none;
}
body.editorial-admin .admin-hero-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 14px;
}
body.editorial-admin .admin-title,
body.editorial-admin .billing-hero h1.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.6vw, 48px);
  margin: 8px 0 0;
  letter-spacing: -0.02em;
}
body.editorial-admin .admin-summary-pill {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  padding: 6px 12px;
  border-radius: var(--r-md);
}
body.editorial-admin .admin-hero-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 22px;
}
body.editorial-admin .admin-filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
body.editorial-admin .admin-filter-group {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
body.editorial-admin .admin-filter-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-soft);
  min-width: 110px;
}
body.editorial-admin .admin-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
body.editorial-admin .admin-chip {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
body.editorial-admin .admin-chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}
body.editorial-admin .admin-chip.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent);
}

body.editorial-admin .admin-receipts-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}
body.editorial-admin .admin-receipt-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: none;
  backdrop-filter: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
body.editorial-admin .admin-receipt-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}
body.editorial-admin .admin-price-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
body.editorial-admin .admin-price-line h2 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.02em;
}
body.editorial-admin .admin-package-pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  padding: 3px 8px;
  border-radius: var(--r-sm);
}
body.editorial-admin .receipt-state {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
}
body.editorial-admin .receipt-state-pending {
  color: var(--danger);
  border-color: rgba(217, 120, 90, 0.4);
}
body.editorial-admin .receipt-state-created {
  color: var(--accent-text);
  border-color: rgba(232, 183, 104, 0.5);
}
body.editorial-admin .receipt-state-sent {
  color: var(--success);
  border-color: rgba(127, 176, 105, 0.5);
}
body.editorial-admin .admin-email-line {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
}
body.editorial-admin .admin-subline {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
body.editorial-admin .admin-subline strong {
  color: var(--text);
  font-weight: 500;
}
body.editorial-admin .admin-side-meta .info-pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: var(--r-sm);
}
body.editorial-admin .admin-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
body.editorial-admin .admin-quick-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
}
body.editorial-admin .admin-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
body.editorial-admin .admin-quick-card strong {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
  font-weight: 500;
}
body.editorial-admin .admin-muted {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
body.editorial-admin .admin-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
body.editorial-admin .receipt-toggle-group {
  display: flex;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
body.editorial-admin .receipt-toggle-button {
  flex: 1;
  background: transparent;
  border: none;
  border-right: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  padding: 7px 8px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
body.editorial-admin .receipt-toggle-button:last-child {
  border-right: none;
}
body.editorial-admin .receipt-toggle-button:hover {
  color: var(--text);
}
body.editorial-admin .receipt-toggle-button.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
}
body.editorial-admin .admin-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
body.editorial-admin .admin-meta-block {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.editorial-admin .admin-copy-block {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  line-height: 1.5;
  min-height: 90px;
  resize: vertical;
}
body.editorial-admin .admin-action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body.editorial-admin .admin-upload-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
body.editorial-admin .admin-upload-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-soft);
  letter-spacing: 0.06em;
}
body.editorial-admin .admin-receipt-file-input {
  display: none;
}
body.editorial-admin .admin-dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  padding: 16px;
  text-align: center;
  background: transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
body.editorial-admin .admin-dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
body.editorial-admin .admin-dropzone-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body.editorial-admin .admin-dropzone-title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}
body.editorial-admin .admin-dropzone-subtitle {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-soft);
}
body.editorial-admin .admin-dropzone-filename {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent-text);
  margin-top: 4px;
}
body.editorial-admin .admin-helper-text {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-soft);
  line-height: 1.45;
}
body.editorial-admin .receipt-status-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
  margin: 0;
}
body.editorial-admin .copy-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 10px 14px;
  display: none;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  z-index: 60;
}
body.editorial-admin .copy-toast.visible {
  display: inline-flex;
}

/* ── GUIDE ──────────────────────────────────────── */
body.editorial-guide {
  min-height: 100vh;
}
body.editorial-guide .billing-shell {
  max-width: var(--page);
  margin: 0 auto;
  padding: 40px var(--gutter) 80px;
}
body.editorial-guide .billing-hero {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 36px;
  box-shadow: none;
  backdrop-filter: none;
}
body.editorial-guide .billing-hero h1.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.6vw, 48px);
  margin: 12px 0 12px;
  letter-spacing: -0.02em;
}
body.editorial-guide .guide-steps {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
body.editorial-guide .guide-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 32px;
  align-items: center;
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
  padding: 28px 0 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}
body.editorial-guide .guide-step-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.editorial-guide .feature-tag {
  font-family: var(--serif);
  font-size: 40px;
  color: var(--accent-text);
  font-weight: 400;
  line-height: 1;
}
body.editorial-guide .guide-step-copy h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  margin: 4px 0 4px;
  letter-spacing: -0.01em;
}
body.editorial-guide .guide-step-copy p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
body.editorial-guide .screenshot-slot {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-elev);
}
body.editorial-guide .screenshot-slot img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 760px) {
  body.editorial-admin .admin-quick-grid,
  body.editorial-admin .admin-details-grid {
    grid-template-columns: 1fr;
  }
  body.editorial-guide .guide-step {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ── FINAL EDITORIAL UNIFICATION ──────────────────
   Старый neon/sales CSS содержит глобальные правила с лаймовым акцентом,
   крупными скруглениями и !important. Эти правила намеренно добивают
   legacy-классы на внутренних страницах до единого editorial-вида. */
body.editorial {
  --success: var(--accent);
  --success-soft: var(--accent-soft);
  --success-text: var(--accent-text);
}

body.editorial .micro-label,
body.editorial .e-micro {
  color: var(--accent-text) !important;
}

body.editorial .primary-button,
body.editorial .secondary-button,
body.editorial .ghost-button,
body.editorial .compact-button,
body.editorial .info-pill,
body.editorial .feature-tag,
body.editorial .billing-badge,
body.editorial .admin-chip,
body.editorial .document-tab,
body.editorial .token-pill,
body.editorial .e-tokens,
body.editorial .auth-tab,
body.editorial .captcha-box,
body.editorial .auth-referral-note,
body.editorial .yandex-login-button,
body.editorial .billing-checkout-meta span,
body.editorial .billing-mobile-sticky,
body.editorial .billing-upsell-panel,
body.editorial .auth-gate-card,
body.editorial .copy-toast {
  border-radius: var(--r-md) !important;
}

body.editorial .primary-button,
body.editorial .buy-token-button-featured,
body.editorial .billing-checkout-preview .primary-button,
body.editorial .billing-mobile-sticky .primary-button {
  background: var(--accent) !important;
  color: var(--accent-ink) !important;
  border-color: var(--accent) !important;
  box-shadow: none !important;
}

body.editorial .secondary-button,
body.editorial .ghost-button,
body.editorial .info-pill,
body.editorial .feature-tag,
body.editorial .admin-chip,
body.editorial .document-tab,
body.editorial .billing-checkout-meta span {
  background: transparent !important;
  border-color: var(--line-strong) !important;
  color: var(--muted) !important;
}

body.editorial .secondary-button:hover,
body.editorial .ghost-button:hover,
body.editorial .admin-chip:hover,
body.editorial .document-tab:hover {
  border-color: var(--accent) !important;
  color: var(--text) !important;
  background: var(--accent-soft) !important;
}

body.editorial .admin-chip.is-active,
body.editorial .document-tab.active,
body.editorial .auth-tab.active,
body.editorial .receipt-toggle-button.is-active {
  color: var(--accent-text) !important;
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

body.editorial :is(
  .surface-panel,
  .billing-card,
  .billing-checkout-preview,
  .billing-fact,
  .billing-faq-item,
  .billing-chooser-card,
  .guide-visual-card,
  .guide-tips,
  .details-card,
  .admin-hero,
  .admin-receipt-card,
  .admin-quick-card,
  .admin-meta-block,
  .auth-card,
  .legal-notice,
  .legal-download-card,
  .compose-form,
  .compose-result,
  .compose-hero-note,
  .account-referral-card,
  .account-ledger
) {
  border-radius: var(--r-lg) !important;
  background: var(--bg-elev) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: var(--text) !important;
}

body.editorial-billing .billing-shell,
body.editorial-guide .billing-shell,
body.editorial-account .billing-shell,
body.editorial-history .billing-shell,
body.editorial-admin .billing-shell,
body.editorial-legal .billing-shell,
body.editorial-compose .workspace-shell {
  max-width: var(--page) !important;
  padding-left: var(--gutter) !important;
  padding-right: var(--gutter) !important;
}

body.editorial-billing .billing-sales-hero {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px) !important;
  gap: 28px !important;
  align-items: start !important;
  padding: 34px 0 0 !important;
  margin-bottom: 34px !important;
  border: 0 !important;
  border-top: 1px solid var(--line) !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  border-radius: 0 !important;
}

body.editorial-billing .billing-sales-copy {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  align-content: stretch !important;
}

body.editorial-billing .billing-sales-copy .section-title,
body.editorial-billing .billing-hero h1.section-title {
  max-width: 720px !important;
  font-size: clamp(38px, 5vw, 58px) !important;
  line-height: 1.02 !important;
}

body.editorial-billing .billing-checkout-preview {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  padding: 22px !important;
  background:
    linear-gradient(180deg, rgba(232, 183, 104, 0.08), rgba(255, 255, 255, 0.025)) !important;
  border-color: var(--line-strong) !important;
}

body.editorial-billing .billing-checkout-preview .billing-promo-badge,
body.editorial-billing .billing-badge,
body.editorial-billing .billing-badge-soft {
  width: fit-content !important;
  background: transparent !important;
  border: 1px solid var(--line-strong) !important;
  color: var(--accent-text) !important;
  border-radius: var(--r-sm) !important;
  padding: 5px 8px !important;
  font-family: var(--mono) !important;
  font-size: 10px !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
}

body.editorial-billing .billing-checkout-preview strong {
  font-family: var(--serif) !important;
  font-size: clamp(30px, 4vw, 42px) !important;
  line-height: 1.02 !important;
  letter-spacing: -0.02em !important;
  font-weight: 400 !important;
  color: var(--text) !important;
}

body.editorial-billing .billing-checkout-preview p,
body.editorial-billing .billing-faq-item p,
body.editorial-guide .guide-visual-card p,
body.editorial-guide .guide-tips p {
  color: var(--muted) !important;
}

body.editorial-billing .billing-checkout-meta {
  display: flex !important;
  gap: 8px !important;
}

body.editorial-billing .billing-checkout-meta span {
  min-height: 0 !important;
  padding: 6px 8px !important;
  font-family: var(--mono) !important;
  font-size: 11px !important;
  font-weight: 400 !important;
}

body.editorial-billing .billing-card-featured,
body.editorial-billing .billing-chooser-card-featured {
  border-color: var(--accent) !important;
  background: linear-gradient(180deg, var(--accent-soft), var(--bg-elev) 70%) !important;
}

body.editorial-billing .billing-card-title-wrap,
body.editorial-billing .billing-price-wrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

body.editorial-billing .billing-old-price {
  color: var(--muted-soft) !important;
  font-family: var(--mono) !important;
  font-size: 12px !important;
}

body.editorial-billing .billing-faq-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 16px !important;
  margin-top: 32px !important;
}

body.editorial-billing .billing-faq-item {
  padding: 20px !important;
  border: 1px solid var(--line) !important;
}

body.editorial-billing .billing-fact {
  padding: 22px !important;
  border: 1px solid var(--line) !important;
  border-top: 1px solid var(--line) !important;
}

body.editorial-billing .billing-faq-item h2 {
  font-family: var(--serif) !important;
  font-size: 22px !important;
  font-weight: 400 !important;
  margin: 8px 0 !important;
}

body.editorial-billing .billing-mobile-sticky {
  background: var(--bg-elev) !important;
  border: 1px solid var(--line-strong) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

body.editorial-guide .guide-hero {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 0 32px !important;
  border-bottom: 1px solid var(--line) !important;
}

body.editorial-guide .guide-visual-card,
body.editorial-guide .guide-visual-card-accent,
body.editorial-guide .guide-visual-card-sale {
  min-height: 0 !important;
  padding: 22px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  justify-content: center !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.018)) !important;
  border-color: var(--line) !important;
}

body.editorial-guide .guide-visual-card strong {
  font-family: var(--serif) !important;
  font-size: clamp(24px, 3vw, 34px) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.01em !important;
  font-weight: 400 !important;
  color: var(--text) !important;
}

body.editorial-guide .guide-visual-card .ghost-button {
  width: fit-content !important;
  min-height: 0 !important;
  padding: 9px 14px !important;
}

body.editorial-guide .guide-tips {
  padding: 22px !important;
  margin-top: 28px !important;
}

body.editorial-guide .tips-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 14px !important;
}

body.editorial-guide .tips-grid article {
  background: transparent !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-md) !important;
  padding: 16px !important;
}

body.editorial-app .editor-card-label {
  color: var(--muted) !important;
}

body.editorial-app .editor-area {
  background: var(--bg) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-md) !important;
  padding: 16px 18px !important;
  box-sizing: border-box !important;
}

body.editorial-app .editor-area:focus {
  border-color: var(--accent) !important;
  background: var(--bg-elev) !important;
}

body.editorial-app .editor-area::placeholder {
  color: var(--muted-soft) !important;
}

body.editorial-app .toggle-row {
  gap: 9px !important;
  color: var(--muted) !important;
}

body.editorial-app .toggle-input {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.editorial-app .toggle-ui {
  display: inline-flex !important;
  width: 36px !important;
  height: 20px !important;
  padding: 2px !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 999px !important;
  background: var(--bg) !important;
  transition: border-color 0.15s ease, background 0.15s ease !important;
}

body.editorial-app .toggle-ui::after {
  content: "" !important;
  width: 14px !important;
  height: 14px !important;
  border-radius: 50% !important;
  background: var(--muted) !important;
  transform: translateX(0) !important;
  transition: transform 0.15s ease, background 0.15s ease !important;
}

body.editorial-app .toggle-input:checked + .toggle-ui {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

body.editorial-app .toggle-input:checked + .toggle-ui::after {
  transform: translateX(16px) !important;
  background: var(--accent) !important;
}

body.editorial-app .toggle-input:focus-visible + .toggle-ui {
  outline: 2px solid var(--accent) !important;
  outline-offset: 3px !important;
}

body.editorial-app .toggle-copy {
  color: var(--muted) !important;
}

body.editorial-app .result-output-shell {
  position: static !important;
  overflow: visible !important;
  border-radius: 0 !important;
  gap: 12px !important;
}

body.editorial-app .result-copy-button {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  align-self: flex-end !important;
  min-height: 0 !important;
  margin: 0 !important;
}

body.editorial-app .compare-preview,
body.editorial-app .result-preview {
  box-sizing: border-box !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  font-size: 15px !important;
  line-height: 1.65 !important;
  color: var(--text) !important;
  overflow-y: auto !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
}

body.editorial-app .preview-added,
body.editorial-app .preview-removed {
  background: transparent !important;
  color: inherit !important;
  text-decoration: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

body.editorial-app .human-score {
  background: transparent !important;
  color: var(--accent-text) !important;
  border-color: var(--line-strong) !important;
  border-radius: var(--r-sm) !important;
  font-weight: 500 !important;
}

body.editorial-auth {
  display: grid !important;
  place-items: center !important;
}

body.editorial-auth .auth-shell {
  width: min(100%, 420px) !important;
  max-width: 420px !important;
  min-height: 0 !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  margin-inline: auto !important;
}

body.editorial-auth .auth-layout,
body.editorial-auth .auth-layout-single {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  justify-content: center !important;
  justify-items: center !important;
  align-items: center !important;
  gap: 0 !important;
}

body.editorial-auth .auth-card,
body.editorial-auth .auth-card-centered {
  width: 100% !important;
  max-width: 420px !important;
  box-sizing: border-box !important;
  margin-inline: auto !important;
}

@media (max-width: 860px) {
  body.editorial-billing .billing-sales-hero,
  body.editorial-billing .billing-grid,
  body.editorial-billing .billing-chooser-grid,
  body.editorial-billing .billing-facts-grid,
  body.editorial-billing .billing-faq-grid,
  body.editorial-guide .tips-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── GENERATION OVERLAY ─────────────────────────── */
body.generation-busy {
  cursor: progress;
}

body.editorial .generation-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 6, 5, 0.64);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

body.editorial .generation-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.editorial .generation-overlay-card {
  width: min(360px, calc(100vw - 48px));
  min-height: 320px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  padding: 40px 32px 36px;
  text-align: center;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(232, 183, 104, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

body.editorial .generation-mark {
  position: relative;
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
}

body.editorial .generation-pulse {
  position: absolute;
  inset: 38%;
  background: radial-gradient(circle, var(--accent) 0%, rgba(232, 183, 104, 0) 70%);
  border-radius: 50%;
  filter: blur(2px);
  animation: generationPulse 1.6s ease-in-out infinite;
  pointer-events: none;
}

body.editorial .generation-mark-svg {
  position: relative;
  width: 132px;
  height: 132px;
  overflow: visible;
}

body.editorial .generation-ring-track,
body.editorial .generation-ring,
body.editorial .generation-check {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.editorial .generation-ring-track {
  stroke: var(--line);
  stroke-width: 2;
}

body.editorial .generation-ring-outer {
  stroke: var(--accent);
  stroke-dasharray: 90 220;
  transform-origin: center;
  animation: generationRingSpin 1.4s cubic-bezier(0.55, 0.05, 0.45, 0.95) infinite;
  filter: drop-shadow(0 0 6px rgba(232, 183, 104, 0.45));
}

body.editorial .generation-ring-inner {
  stroke: rgba(232, 183, 104, 0.55);
  stroke-width: 2;
  stroke-dasharray: 30 180;
  transform-origin: center;
  animation: generationRingSpinReverse 2.2s linear infinite;
}

body.editorial .generation-check {
  stroke: var(--accent);
  stroke-width: 5;
  stroke-dasharray: 52;
  stroke-dashoffset: 52;
  opacity: 0;
  filter: drop-shadow(0 0 6px rgba(232, 183, 104, 0.4));
}

body.editorial .generation-orbit {
  position: absolute;
  inset: 0;
  pointer-events: none;
  animation: generationOrbit 3.2s linear infinite;
}

body.editorial .generation-orbit-dot {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(232, 183, 104, 0.85);
}

body.editorial .generation-overlay-copy {
  display: grid;
  gap: 8px;
  min-height: 76px;
  align-content: start;
}

body.editorial .generation-overlay-copy strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.08;
}

body.editorial .generation-overlay-copy span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

body.editorial .generation-overlay-elapsed {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--accent-text) !important;
  font-size: 13px !important;
}

body.editorial .generation-overlay-tip {
  font-size: 12px !important;
  color: var(--muted) !important;
  min-height: 16px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

body.editorial .generation-overlay-tip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.editorial .generation-overlay.is-success .generation-ring-outer,
body.editorial .generation-overlay.is-success .generation-ring-inner,
body.editorial .generation-overlay.is-error .generation-ring-outer,
body.editorial .generation-overlay.is-error .generation-ring-inner {
  animation: none;
  stroke-dasharray: 320;
  opacity: 0.25;
}

body.editorial .generation-overlay.is-success .generation-orbit,
body.editorial .generation-overlay.is-error .generation-orbit,
body.editorial .generation-overlay.is-success .generation-pulse,
body.editorial .generation-overlay.is-error .generation-pulse {
  display: none;
}

body.editorial .generation-overlay.is-success .generation-check {
  opacity: 1;
  animation: generationCheckDraw 0.42s ease forwards;
}

body.editorial .generation-overlay.is-success .generation-overlay-copy span::before {
  content: "";
}

body.editorial .generation-overlay.is-error .generation-ring,
body.editorial .generation-overlay.is-error .generation-ring-outer,
body.editorial .generation-overlay.is-error .generation-ring-inner,
body.editorial .generation-overlay.is-error .generation-check {
  stroke: var(--danger);
}

@keyframes generationRingSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes generationRingSpinReverse {
  from { transform: rotate(360deg); }
  to   { transform: rotate(0deg); }
}

@keyframes generationOrbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes generationPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.55; }
  50%      { transform: scale(1.15); opacity: 0.85; }
}

@keyframes generationCheckDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.editorial .generation-ring-outer,
  body.editorial .generation-ring-inner,
  body.editorial .generation-orbit,
  body.editorial .generation-pulse {
    animation: none;
  }
  body.editorial .generation-ring-outer {
    stroke-dasharray: 220 90;
  }
  body.editorial .generation-overlay.is-success .generation-check {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* ── Живость: hover-lift, плавные переходы, мягкие подсветки ─────── */
body.editorial .billing-card,
body.editorial .details-card,
body.editorial .history-card,
body.editorial .billing-faq-item,
body.editorial .billing-chooser-card,
body.editorial .billing-fact,
body.editorial .admin-receipt-card,
body.editorial .admin-quick-card,
body.editorial .compose-form,
body.editorial .compose-result,
body.editorial .lv-preview,
body.editorial .billing-checkout-preview {
  transition:
    transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
    border-color 0.25s ease,
    box-shadow 0.3s ease,
    background 0.25s ease;
}

body.editorial .billing-card:hover,
body.editorial .details-card:hover,
body.editorial .history-card:hover,
body.editorial .billing-faq-item:hover,
body.editorial .billing-chooser-card:hover,
body.editorial .admin-receipt-card:hover,
body.editorial .billing-checkout-preview:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong) !important;
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.30),
    0 0 0 1px rgba(232, 183, 104, 0.14);
}

body.editorial .billing-card-featured:hover,
body.editorial .billing-chooser-card-featured:hover {
  box-shadow:
    0 22px 48px rgba(232, 183, 104, 0.16),
    0 0 0 1px var(--accent);
}

/* Кнопки — мягкий лифт */
body.editorial .primary-button {
  transition:
    transform 0.18s ease,
    box-shadow 0.25s ease,
    filter 0.2s ease,
    background 0.2s ease !important;
}
body.editorial .primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(232, 183, 104, 0.28) !important;
  filter: brightness(1.04);
}
body.editorial .secondary-button {
  transition:
    transform 0.18s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease !important;
}
body.editorial .secondary-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

/* Nav-link в editorial-топбаре — анимированное подчёркивание */
body.editorial .e-topbar-nav a {
  position: relative;
}
body.editorial .e-topbar-nav a:not(.is-active)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
body.editorial .e-topbar-nav a:not(.is-active):hover::after {
  transform: scaleX(1);
}
body.editorial .e-topbar-nav a.is-active::after {
  animation: editorialNavSlide 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes editorialNavSlide {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Каскадное появление контента на editorial-страницах */
@keyframes editorialFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
body.editorial main > section,
body.editorial main > div,
body.editorial-app .workspace-panel > *,
body.editorial-billing .billing-grid > *,
body.editorial-billing .billing-facts-grid > *,
body.editorial-billing .billing-faq-grid > *,
body.editorial-account .account-grid > *,
body.editorial-history .history-list > *,
body.editorial-admin .admin-receipts-list > * {
  animation: editorialFadeUp 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
body.editorial-billing .billing-grid > *:nth-child(1),
body.editorial-billing .billing-faq-grid > *:nth-child(1),
body.editorial-account .account-grid > *:nth-child(1),
body.editorial-history .history-list > *:nth-child(1) { animation-delay: 0.05s; }
body.editorial-billing .billing-grid > *:nth-child(2),
body.editorial-billing .billing-faq-grid > *:nth-child(2),
body.editorial-account .account-grid > *:nth-child(2),
body.editorial-history .history-list > *:nth-child(2) { animation-delay: 0.15s; }
body.editorial-billing .billing-grid > *:nth-child(3),
body.editorial-billing .billing-faq-grid > *:nth-child(3),
body.editorial-account .account-grid > *:nth-child(3),
body.editorial-history .history-list > *:nth-child(3) { animation-delay: 0.25s; }

/* Info-pill — мягкий ховер */
body.editorial .info-pill {
  transition: color 0.2s ease, border-color 0.2s ease;
}

/* Анимированная подсветка пакета "Семестр" */
body.editorial-billing .billing-card-featured {
  position: relative;
  overflow: hidden;
}
body.editorial-billing .billing-card-featured::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg,
    rgba(232, 183, 104, 0.0) 0%,
    rgba(232, 183, 104, 0.35) 35%,
    rgba(232, 183, 104, 0.0) 70%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  animation: featuredShimmer 6s linear infinite;
  background-size: 200% 100%;
}
@keyframes featuredShimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  body.editorial main > section,
  body.editorial main > div,
  body.editorial-app .workspace-panel > *,
  body.editorial-billing .billing-grid > *,
  body.editorial-billing .billing-facts-grid > *,
  body.editorial-billing .billing-faq-grid > *,
  body.editorial-account .account-grid > *,
  body.editorial-history .history-list > *,
  body.editorial-admin .admin-receipts-list > * {
    animation: none;
    opacity: 1;
    transform: none;
  }
  body.editorial-billing .billing-card-featured::before {
    animation: none;
  }
}
