body.editorial {
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-strong: #f6faf8;
  --line: #dde8ee;
  --line-strong: #c8d8e2;
  --text: #17202a;
  --muted: #738195;
  --muted-soft: #9aa7b5;
  --accent: #31d17d;
  --accent-soft: rgba(49, 209, 125, 0.12);
  --accent-text: #0bbf70;
  --accent-ink: #0f1a22;
  --danger: #d95f4f;
  --success: #0bbf70;
  --serif: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 8px;
  --page: 1180px;
  --gutter: 24px;
  --shadow: 0 24px 80px rgba(25, 42, 61, 0.1);
  --shadow-soft: 0 14px 40px rgba(25, 42, 61, 0.07);

  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(221, 231, 236, 0.52) 1px, transparent 1px),
    linear-gradient(90deg, rgba(221, 231, 236, 0.52) 1px, transparent 1px),
    radial-gradient(circle at 24% 12%, rgba(49, 209, 125, 0.12), transparent 28%),
    radial-gradient(circle at 85% 76%, rgba(49, 209, 125, 0.08), transparent 30%),
    #fff;
  background-size: 72px 72px, 72px 72px, 100% 780px, 100% 780px, auto;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

body.editorial::before,
body.editorial::after {
  display: none;
}

body.editorial .legal-hero::after,
body.editorial .guide-hero::after,
body.editorial .billing-hero::after,
body.editorial .compose-hero::after,
body.editorial .workspace-panel::after,
body.editorial .surface-panel::after {
  display: none;
}

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

body.editorial a {
  color: inherit;
}

body.editorial h1 em,
body.editorial h2 em,
body.editorial .section-title em {
  color: var(--accent-text);
  font-style: normal;
}

body.editorial .e-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: min(100% - 48px, var(--page));
  min-height: 76px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 26px;
  border: 0;
  border-bottom: 1px solid rgba(221, 231, 236, 0.88);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.editorial .e-topbar-brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #111922;
  font-family: var(--sans);
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

body.editorial .e-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(49, 209, 125, 0.14);
}

body.editorial .e-topbar-nav {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  overflow-x: auto;
  color: #465566;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 800;
  scrollbar-width: none;
}

body.editorial .e-topbar-nav::-webkit-scrollbar {
  display: none;
}

body.editorial .e-topbar-nav a {
  flex: 0 0 auto;
  padding: 10px 0;
  border-bottom: 2px solid transparent;
  color: inherit;
}

body.editorial .e-topbar-nav a:hover,
body.editorial .e-topbar-nav a.is-active {
  color: #111922;
  border-color: var(--accent);
}

body.editorial .e-topbar-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

body.editorial .e-tokens {
  min-width: 86px;
  padding: 9px 12px;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
}

body.editorial .e-tokens span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.editorial .e-tokens strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.1;
}

body.editorial .billing-shell,
body.editorial .workspace-shell,
body.editorial .admin-shell,
body.editorial .legal-shell,
body.editorial .guide-shell,
body.editorial .compose-shell,
body.editorial .account-shell {
  width: min(100% - 48px, var(--page));
  margin: 0 auto;
  padding: 64px 0 96px;
}

body.editorial .surface-panel,
body.editorial .workspace-panel,
body.editorial .billing-hero,
body.editorial .compose-hero,
body.editorial .billing-sales-hero,
body.editorial .auth-gate-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 248, 0.9)),
    #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.editorial .surface-panel-large,
body.editorial .workspace-panel,
body.editorial .billing-hero,
body.editorial .compose-hero {
  box-shadow: var(--shadow);
}

body.editorial .billing-hero,
body.editorial .workspace-panel,
body.editorial .surface-panel-large,
body.editorial .admin-hero {
  padding: 44px;
}

body.editorial .section-title,
body.editorial .e-h1,
body.editorial .e-editor-title,
body.editorial .compose-hero h1,
body.editorial .billing-sales-copy h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 52px;
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: 0;
}

body.editorial-legal .legal-hero h1.section-title,
body.editorial-billing .billing-hero h1.section-title,
body.editorial-billing .billing-sales-copy .section-title,
body.editorial-guide .billing-hero h1.section-title,
body.editorial-history .billing-hero h1.section-title,
body.editorial-account .billing-hero h1.section-title,
body.editorial-verify .billing-hero .section-title,
body.editorial-compose .compose-hero h1.section-title,
body.editorial-admin .billing-hero h1.section-title,
body.editorial-app .e-editor-title {
  color: var(--text);
  font-family: var(--sans);
  font-size: 52px;
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: 0;
}

body.editorial .section-text,
body.editorial .help-line,
body.editorial .status-line,
body.editorial .history-meta,
body.editorial .admin-muted {
  color: #465566 !important;
  opacity: 1 !important;
}

body.editorial .section-text {
  max-width: 820px;
  font-size: 17px;
  line-height: 1.7;
}

body.editorial-app .help-line,
body.editorial-app .legal-notice .section-text,
body.editorial-app .legal-notice p,
body.editorial-app #modeDescription,
body.editorial-app #statusMessage {
  color: #3f4f60 !important;
  -webkit-text-fill-color: #3f4f60 !important;
  opacity: 1 !important;
}

body.editorial-app .legal-notice {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: #c8d8e2 !important;
}

body.editorial .micro-label,
body.editorial .e-micro,
body.editorial .editor-card-label,
body.editorial .e-toolbar-label,
body.editorial .admin-filter-label,
body.editorial .admin-kicker,
body.editorial .billing-metric-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--accent-text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.editorial .micro-label::before,
body.editorial .e-micro::before {
  background: currentColor;
}

body.editorial .primary-button,
body.editorial .secondary-button,
body.editorial .ghost-button,
body.editorial .document-tab,
body.editorial .admin-chip,
body.editorial .info-pill,
body.editorial .feature-tag {
  border-radius: var(--r-md);
  font-family: var(--sans);
  letter-spacing: 0;
}

body.editorial .primary-button {
  min-height: 46px;
  border: 1px solid var(--accent);
  background: var(--accent) !important;
  color: #0f1a22 !important;
  font-weight: 900;
  box-shadow: 0 12px 32px rgba(49, 209, 125, 0.24);
}

body.editorial .primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 38px rgba(49, 209, 125, 0.3);
}

body.editorial .secondary-button,
body.editorial .ghost-button,
body.editorial .document-tab,
body.editorial .admin-chip,
body.editorial .info-pill,
body.editorial .feature-tag {
  border: 1px solid var(--line) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  color: #253242 !important;
  font-weight: 800;
}

body.editorial .secondary-button:hover:not(:disabled),
body.editorial .ghost-button:hover:not(:disabled),
body.editorial .document-tab:hover,
body.editorial .admin-chip:hover,
body.editorial .info-pill:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #0f1a22;
}

body.editorial .document-tab.active,
body.editorial .admin-chip.is-active,
body.editorial .feature-tag {
  border-color: var(--accent) !important;
  background: var(--accent) !important;
  color: #0f1a22 !important;
}

body.editorial .input,
body.editorial input[type="text"],
body.editorial input[type="email"],
body.editorial input[type="password"],
body.editorial input[type="number"],
body.editorial select,
body.editorial textarea,
body.editorial .editor-area,
body.editorial .compare-preview {
  background: rgba(255, 255, 255, 0.94) !important;
  color: #17202a !important;
  -webkit-text-fill-color: #17202a !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  caret-color: #17202a !important;
}

body.editorial textarea,
body.editorial .editor-area,
body.editorial .compare-preview {
  padding: 20px;
  line-height: 1.65;
}

body.editorial .input::placeholder,
body.editorial textarea::placeholder,
body.editorial .editor-area::placeholder {
  color: #8a99a9 !important;
  -webkit-text-fill-color: #8a99a9 !important;
}

body.editorial .input:focus,
body.editorial input:focus,
body.editorial select:focus,
body.editorial textarea:focus,
body.editorial .editor-area:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(49, 209, 125, 0.12);
}

body.editorial .pill-row,
body.editorial .billing-value-strip,
body.editorial .billing-usecases,
body.editorial .billing-fact-links,
body.editorial .editor-upsell-scenarios {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.editorial .document-tabs,
body.editorial .analytics-range,
body.editorial .admin-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.editorial .legal-stack,
body.editorial .history-list,
body.editorial .guide-steps,
body.editorial .admin-receipts-list {
  display: grid;
  gap: 20px;
}

body.editorial .legal-hero,
body.editorial .legal-notice,
body.editorial .legal-section,
body.editorial .guide-step,
body.editorial .history-card,
body.editorial .details-card,
body.editorial .billing-card,
body.editorial .billing-fact,
body.editorial .billing-faq-item,
body.editorial .billing-chooser,
body.editorial .compose-form,
body.editorial .compose-result,
body.editorial .admin-receipt-card,
body.editorial .analytics-chart-card,
body.editorial .analytics-list-card {
  overflow: hidden;
}

body.editorial .legal-section {
  padding: 30px;
}

body.editorial .legal-section h2,
body.editorial .details-card h2,
body.editorial .guide-step h2,
body.editorial .billing-fact h2,
body.editorial .billing-faq-item h2,
body.editorial .compose-section-head h2,
body.editorial .analytics-list-card h2 {
  margin: 12px 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
}

body.editorial .legal-section ul {
  margin: 18px 0 0;
  padding-left: 21px;
  color: var(--muted);
}

body.editorial .legal-section li + li {
  margin-top: 10px;
}

body.editorial-legal .document-tabs {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: stretch;
  margin-top: 28px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

body.editorial-legal .document-tab {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 12px 14px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-right: 0 !important;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.18;
}

body.editorial-legal .document-tab:first-child {
  padding-left: 14px !important;
}

body.editorial .legal-download-card {
  margin-top: 26px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(246, 250, 248, 0.8);
}

body.editorial-legal .legal-hero p.section-text,
body.editorial-legal .legal-download-card p.section-text,
body.editorial-legal .legal-download-card .section-text,
body.editorial-legal .legal-section li,
body.editorial-legal .legal-notice p.section-text {
  color: #465566 !important;
  opacity: 1 !important;
}

body.editorial-legal .legal-hero .inline-link {
  color: #0bbf70 !important;
  border-bottom-color: rgba(11, 191, 112, 0.42) !important;
}

body.editorial-legal .legal-download-card strong,
body.editorial-legal .legal-section h2,
body.editorial-legal .legal-notice strong {
  color: #17202a !important;
}

body.editorial-legal .legal-download-card,
body.editorial-legal .legal-section,
body.editorial-legal .legal-notice {
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--shadow-soft) !important;
}

body.editorial .billing-sales-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.46fr);
  gap: 36px;
  align-items: stretch;
}

body.editorial .billing-checkout-preview {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid rgba(49, 209, 125, 0.36);
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 80% 16%, rgba(49, 209, 125, 0.24), transparent 34%),
    #f8fbfa;
  box-shadow: var(--shadow-soft);
}

body.editorial .billing-checkout-preview strong {
  color: var(--text);
  font-size: 40px;
  line-height: 1.05;
}

body.editorial .billing-promo-badge,
body.editorial .billing-badge {
  width: fit-content;
  padding: 8px 14px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: #0f1a22;
  font-size: 13px;
  font-weight: 900;
}

body.editorial .billing-grid,
body.editorial .billing-facts-grid,
body.editorial .billing-faq-grid,
body.editorial .account-grid,
body.editorial .analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

body.editorial .analytics-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 32px;
}

body.editorial .billing-card,
body.editorial .details-card,
body.editorial .billing-fact,
body.editorial .billing-faq-item,
body.editorial .analytics-kpi {
  padding: 28px;
}

body.editorial .billing-card-featured {
  border-color: var(--accent);
  box-shadow: 0 24px 70px rgba(49, 209, 125, 0.14);
}

body.editorial .billing-card-head,
body.editorial .billing-card-footer,
body.editorial .compose-section-head,
body.editorial .history-card-head,
body.editorial .admin-hero-topline,
body.editorial .admin-receipt-head,
body.editorial .analytics-card-head,
body.editorial .account-referral-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

body.editorial .billing-card-head strong,
body.editorial .details-card h2,
body.editorial .analytics-kpi strong {
  color: var(--text);
}

body.editorial .billing-price,
body.editorial .billing-card-head strong {
  font-size: 32px;
  line-height: 1.05;
}

body.editorial .billing-old-price {
  color: var(--muted-soft);
}

body.editorial .billing-chooser,
body.editorial .billing-facts-grid,
body.editorial .billing-faq-grid,
body.editorial .billing-grid,
body.editorial .account-grid,
body.editorial .account-referral-card,
body.editorial .account-ledger,
body.editorial .guide-steps,
body.editorial .guide-tips,
body.editorial .legal-stack,
body.editorial .legal-notice,
body.editorial .analytics-chart-grid,
body.editorial .analytics-insight-grid,
body.editorial .analytics-table-grid,
body.editorial .admin-receipts-list {
  margin-top: 24px;
}

body.editorial .workspace-panel {
  padding: 42px;
}

body.editorial .e-editor-header,
body.editorial .compose-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.36fr);
  gap: 28px;
  align-items: start;
}

body.editorial .e-meter,
body.editorial .compose-hero-note,
body.editorial .compose-need-box,
body.editorial .compose-balance-bar {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(246, 250, 248, 0.82);
  color: var(--text);
}

body.editorial .editor-stage,
body.editorial .compose-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  margin-top: 34px;
}

body.editorial .editor-card,
body.editorial .compose-form,
body.editorial .compose-result {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
}

body.editorial .editor-area {
  min-height: 320px;
  resize: vertical;
}

body.editorial .result-output-shell {
  display: grid;
  gap: 12px;
}

body.editorial .result-copy-button {
  justify-self: end;
}

body.editorial .e-toolbar,
body.editorial .control-grid,
body.editorial .compose-control-grid,
body.editorial .admin-filters,
body.editorial .admin-quick-grid,
body.editorial .admin-details-grid {
  display: grid;
  gap: 16px;
}

body.editorial .e-toolbar {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(246, 250, 248, 0.78);
}

body.editorial .e-toolbar-sep {
  display: none;
}

body.editorial .toggle-row {
  min-height: 48px;
  align-items: center;
}

body.editorial .toggle-ui {
  background: #dfe8ee;
}

body.editorial .toggle-input:checked + .toggle-ui {
  background: var(--accent);
}

body.editorial .action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

body.editorial .history-grid,
body.editorial .guide-step,
body.editorial .analytics-chart-grid,
body.editorial .analytics-insight-grid,
body.editorial .analytics-table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

body.editorial .guide-step,
body.editorial .history-card,
body.editorial .admin-receipt-card,
body.editorial .account-referral-card,
body.editorial .account-ledger {
  padding: 28px;
}

body.editorial .guide-visual-card,
body.editorial .billing-chooser-card,
body.editorial .admin-quick-card,
body.editorial .admin-meta-block {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(246, 250, 248, 0.82);
}

body.editorial .compare-preview.is-scrollable {
  max-height: 360px;
  overflow: auto;
}

body.editorial .admin-filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}

body.editorial .admin-summary-pill,
body.editorial .receipt-state {
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 900;
}

body.editorial .admin-price-line strong {
  color: var(--text);
  font-size: 30px;
}

body.editorial .admin-email-line {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

body.editorial .admin-copy-block {
  min-height: 170px;
}

body.editorial .admin-dropzone {
  display: block;
  border: 1px dashed rgba(49, 209, 125, 0.48);
  border-radius: var(--r-lg);
  background: rgba(49, 209, 125, 0.08);
}

body.editorial .admin-dropzone-body {
  display: grid;
  gap: 6px;
}

body.editorial .analytics-hero {
  background:
    radial-gradient(circle at 86% 20%, rgba(49, 209, 125, 0.18), transparent 34%),
    #fff;
}

body.editorial .analytics-kpi {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(246, 250, 248, 0.84);
}

body.editorial .analytics-kpi span,
body.editorial .analytics-kpi small,
body.editorial .analytics-list-row span,
body.editorial .analytics-table-row em,
body.editorial .analytics-user-pill span {
  color: var(--muted);
}

body.editorial .analytics-kpi strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 32px;
  line-height: 1;
}

body.editorial .analytics-chart-card,
body.editorial .analytics-list-card {
  padding: 26px;
}

body.editorial .analytics-bars {
  min-height: 190px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18px, 1fr));
  align-items: end;
  gap: 6px;
  padding-top: 20px;
  overflow-x: auto;
}

body.editorial .analytics-bar-wrap {
  min-width: 14px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: end;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

body.editorial .analytics-bar-wrap i {
  min-height: 8px;
  display: block;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, var(--accent), #8be8b5);
}

body.editorial .analytics-bars-money .analytics-bar-wrap i {
  background: linear-gradient(180deg, #17202a, #6d7b8d);
}

body.editorial .analytics-bars-orders .analytics-bar-wrap i {
  background: linear-gradient(180deg, #ffb21f, #ffe0a1);
}

body.editorial .analytics-bars-blue .analytics-bar-wrap i {
  background: linear-gradient(180deg, #49a5ff, #b8dcff);
}

body.editorial .analytics-bars-active .analytics-bar-wrap i {
  background: linear-gradient(180deg, #ffb21f, #ffe0a1);
}

body.editorial .analytics-bar-value {
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}

body.editorial .analytics-list,
body.editorial .analytics-table,
body.editorial .analytics-user-strip,
body.editorial .ledger-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

body.editorial .analytics-list-row,
body.editorial .analytics-table-row,
body.editorial .analytics-user-pill,
body.editorial .ledger-row {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.74);
}

body.editorial .analytics-list-row,
body.editorial .ledger-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

body.editorial .analytics-table-row strong,
body.editorial .analytics-list-row strong,
body.editorial .analytics-user-pill strong {
  color: var(--text);
  word-break: break-word;
}

body.editorial .analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

body.editorial .analytics-summary-pill {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}

body.editorial .analytics-summary-pill span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

body.editorial .analytics-summary-pill strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 20px;
}

body.editorial .generation-overlay-card {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
}

body.editorial .copy-toast,
body.editorial .balance-sticky,
body.editorial .billing-mobile-sticky {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

body.editorial .cookie-consent {
  right: 18px;
  bottom: 18px;
  left: auto;
  width: min(540px, calc(100% - 36px));
  max-width: 540px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
  transform: translateY(18px) scale(0.98);
}

body.editorial .cookie-consent.visible {
  transform: translateY(0) scale(1);
}

body.editorial .cookie-copy p {
  color: var(--muted);
}

@media (max-width: 980px) {
  body.editorial .e-topbar {
    width: min(100% - 28px, var(--page));
    flex-wrap: wrap;
    gap: 10px 18px;
  }

  body.editorial .e-topbar-brand {
    font-size: 19px;
  }

  body.editorial .e-topbar-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 18px;
  }

  body.editorial .billing-shell,
  body.editorial .workspace-shell,
  body.editorial .admin-shell,
  body.editorial .legal-shell,
  body.editorial .guide-shell,
  body.editorial .compose-shell,
  body.editorial .account-shell {
    width: min(100% - 28px, var(--page));
    padding-top: 42px;
  }

  body.editorial .billing-sales-hero,
  body.editorial .e-editor-header,
  body.editorial .compose-hero,
  body.editorial .billing-grid,
  body.editorial .billing-facts-grid,
  body.editorial .billing-faq-grid,
  body.editorial .account-grid,
  body.editorial .history-grid,
  body.editorial .guide-step,
  body.editorial .analytics-chart-grid,
  body.editorial .analytics-insight-grid,
  body.editorial .analytics-table-grid,
  body.editorial .admin-filters,
  body.editorial .analytics-summary-grid {
    grid-template-columns: 1fr;
  }

  body.editorial .analytics-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body.editorial {
    font-size: 15px;
  }

  body.editorial .e-topbar {
    width: calc(100% - 20px);
  }

  body.editorial .e-topbar-right {
    margin-left: auto;
  }

  body.editorial .e-topbar .ghost-button {
    min-height: 42px;
    padding: 9px 12px;
  }

  body.editorial .billing-shell,
  body.editorial .workspace-shell,
  body.editorial .admin-shell,
  body.editorial .legal-shell,
  body.editorial .guide-shell,
  body.editorial .compose-shell,
  body.editorial .account-shell {
    width: calc(100% - 20px);
    padding: 28px 0 72px;
  }

  body.editorial .billing-hero,
  body.editorial .workspace-panel,
  body.editorial .surface-panel-large,
  body.editorial .admin-hero,
  body.editorial .guide-step,
  body.editorial .history-card,
  body.editorial .admin-receipt-card,
  body.editorial .account-referral-card,
  body.editorial .account-ledger {
    padding: 22px;
  }

  body.editorial .section-title,
  body.editorial .e-h1,
  body.editorial .e-editor-title,
  body.editorial .compose-hero h1,
  body.editorial .billing-sales-copy h1,
  body.editorial-legal .legal-hero h1.section-title,
  body.editorial-billing .billing-hero h1.section-title,
  body.editorial-billing .billing-sales-copy .section-title,
  body.editorial-guide .billing-hero h1.section-title,
  body.editorial-history .billing-hero h1.section-title,
  body.editorial-account .billing-hero h1.section-title,
  body.editorial-verify .billing-hero .section-title,
  body.editorial-compose .compose-hero h1.section-title,
  body.editorial-admin .billing-hero h1.section-title,
  body.editorial-app .e-editor-title {
    font-size: 34px;
    line-height: 1.08;
  }

  body.editorial .section-text {
    font-size: 15px;
  }

  body.editorial .billing-checkout-preview strong {
    font-size: 30px;
  }

  body.editorial .analytics-kpi-grid {
    grid-template-columns: 1fr;
  }

  body.editorial .e-toolbar {
    grid-template-columns: 1fr;
  }

  body.editorial .billing-card-head,
  body.editorial .billing-card-footer,
  body.editorial .compose-section-head,
  body.editorial .history-card-head,
  body.editorial .admin-hero-topline,
  body.editorial .admin-receipt-head,
  body.editorial .analytics-card-head,
  body.editorial .account-referral-head {
    display: grid;
    justify-content: stretch;
  }

  body.editorial .document-tab,
  body.editorial .admin-chip {
    flex: 0 0 auto;
    justify-content: center;
  }

  body.editorial .document-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  body.editorial-legal .document-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.editorial .admin-chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  body.editorial .admin-chip-row::-webkit-scrollbar {
    display: none;
  }

  body.editorial .cookie-consent {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-width: none;
    max-height: min(72vh, 460px);
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr;
    overflow-y: auto;
    transform: translateY(18px) scale(0.98);
  }

  body.editorial .cookie-consent.visible {
    transform: translateY(0) scale(1);
  }

  body.editorial .cookie-copy {
    min-width: 0;
  }

  body.editorial .cookie-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  body.editorial .cookie-actions .primary-button,
  body.editorial .cookie-actions .ghost-button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  body.editorial-legal .document-tabs {
    grid-template-columns: 1fr;
  }
}

/* Fast polish pass for the light product UI. Keep this layer last so it wins over
   the older dark/editorial stylesheet that is still loaded on internal pages. */
@keyframes fthDotPulse {
  0%, 100% {
    box-shadow: 0 0 0 5px rgba(49, 209, 125, 0.14), 0 0 0 0 rgba(49, 209, 125, 0.36);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(49, 209, 125, 0.14), 0 0 0 10px rgba(49, 209, 125, 0);
  }
}

body.editorial .e-dot {
  animation: fthDotPulse 1.8s ease-in-out infinite;
}

body.editorial .e-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  place-items: center;
  gap: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  cursor: pointer;
}

body.editorial .e-menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

body.editorial .e-topbar {
  width: min(100% - 56px, var(--page));
  padding: 14px 28px;
  gap: 24px;
}

body.editorial .e-topbar-brand {
  min-height: 44px;
}

body.editorial .e-topbar-nav {
  gap: 24px;
}

body.editorial .e-topbar-nav a {
  white-space: nowrap;
}

body.editorial .e-topbar-right {
  gap: 12px;
}

body.editorial .toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  color: #52647a !important;
}

body.editorial .toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

body.editorial .toggle-ui {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 28px;
  border: 2px solid #c7d8e2;
  border-radius: 999px;
  background: #f5faf8 !important;
  box-sizing: border-box;
  transition: background 0.18s ease, border-color 0.18s ease;
}

body.editorial .toggle-ui::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #8fa1b2;
  transition: transform 0.18s ease, background 0.18s ease;
}

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

body.editorial .toggle-input:checked + .toggle-ui::after {
  transform: translateX(20px);
  background: #fff;
}

body.editorial .toggle-copy {
  color: #52647a !important;
  -webkit-text-fill-color: #52647a !important;
}

body.editorial .legal-notice .pill-row,
body.editorial .billing-fact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

body.editorial .info-pill,
body.editorial .billing-fact-links a,
body.editorial .document-tab {
  min-height: 38px;
  padding: 9px 14px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #263543 !important;
  -webkit-text-fill-color: #263543 !important;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(25, 42, 61, 0.06);
}

body.editorial .document-tabs {
  gap: 10px;
}

body.editorial .document-tab.is-active,
body.editorial .billing-fact-links a:hover,
body.editorial .info-pill:hover {
  border-color: var(--accent) !important;
  background: rgba(49, 209, 125, 0.1) !important;
  color: var(--accent-text) !important;
  -webkit-text-fill-color: var(--accent-text) !important;
}

body.editorial .section-text,
body.editorial .help-line,
body.editorial .status-line,
body.editorial .legal-notice p,
body.editorial .verify-notice p,
body.editorial .billing-card-text,
body.editorial .billing-card p,
body.editorial .billing-fact p,
body.editorial .billing-upsell-note,
body.editorial .billing-checkout-preview p,
body.editorial .details-card p {
  color: #52647a !important;
  -webkit-text-fill-color: #52647a !important;
  opacity: 1 !important;
}

body.editorial .billing-metric-label,
body.editorial .billing-badge,
body.editorial .feature-tag {
  color: var(--accent-text) !important;
  -webkit-text-fill-color: var(--accent-text) !important;
}

body.editorial .billing-badge,
body.editorial .feature-tag {
  border-color: rgba(49, 209, 125, 0.32) !important;
  background: rgba(49, 209, 125, 0.1) !important;
}

body.editorial-billing .billing-hero,
body.editorial-compose .compose-hero,
body.editorial-history .billing-hero,
body.editorial-account .billing-hero {
  padding: 42px !important;
}

body.editorial-billing .billing-sales-copy .section-title,
body.editorial-billing .billing-hero h1.section-title {
  max-width: 880px;
}

body.editorial-billing .billing-value-strip {
  gap: 12px;
}

body.editorial-billing .billing-card {
  padding: 32px !important;
}

body.editorial-billing .billing-card-featured {
  background: linear-gradient(180deg, rgba(49, 209, 125, 0.1), rgba(255, 255, 255, 0.98)) !important;
}

body.editorial-compose .compose-hero {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.34fr);
  gap: 34px;
  align-items: center;
}

body.editorial-compose .compose-grid {
  grid-template-columns: minmax(0, 1fr) minmax(430px, 0.9fr);
  align-items: start;
  gap: 24px;
}

body.editorial-compose .compose-form,
body.editorial-compose .compose-result {
  padding: 28px !important;
}

body.editorial-compose .compose-topic-area {
  min-height: 300px !important;
}

body.editorial-compose .compose-comments-area {
  min-height: 124px !important;
}

body.editorial-compose .compose-output {
  min-height: 460px !important;
}

body.editorial-history .history-card {
  padding: 34px !important;
}

body.editorial-history .history-grid {
  gap: 24px;
}

body.editorial-history .compare-preview.is-scrollable,
body.editorial-history .compare-preview {
  min-height: 280px;
  max-height: 480px;
  overflow-wrap: anywhere;
}

body.editorial-account .billing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  border-color: rgba(22, 33, 45, 0.14) !important;
  background:
    radial-gradient(circle at 82% 34%, rgba(49, 209, 125, 0.2), transparent 28%),
    linear-gradient(135deg, #111922, #1b2a36) !important;
  color: #fff !important;
}

body.editorial-account .billing-hero .section-title,
body.editorial-account .billing-hero .section-text,
body.editorial-account .billing-hero .micro-label {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

body.editorial-account .account-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 22px;
}

body.editorial-account .details-card,
body.editorial-account .account-referral-card,
body.editorial-account .account-ledger {
  padding: 28px !important;
}

body.editorial-account .details-card {
  min-height: 260px;
}

@media (max-width: 1120px) {
  body.editorial-compose .compose-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  body.editorial .e-topbar {
    width: 100%;
    min-height: 72px;
    padding: 10px 18px;
    flex-wrap: wrap;
    gap: 10px;
  }

  body.editorial .e-menu-toggle {
    display: grid;
  }

  body.editorial .e-topbar-nav,
  body.editorial .e-topbar-right {
    display: none;
    width: 100%;
    margin-left: 0;
  }

  body.editorial.menu-open .e-topbar-nav,
  body.editorial.menu-open .e-topbar-right {
    display: grid;
  }

  body.editorial.menu-open .e-topbar-nav {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 8px;
  }

  body.editorial.menu-open .e-topbar-nav a,
  body.editorial.menu-open .e-topbar-right > * {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
  }

  body.editorial.menu-open .e-topbar-right {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body.editorial-billing .billing-hero,
  body.editorial-compose .compose-hero,
  body.editorial-history .billing-hero,
  body.editorial-account .billing-hero {
    padding: 26px !important;
  }

  body.editorial .legal-notice .pill-row,
  body.editorial .billing-fact-links,
  body.editorial .document-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.editorial .info-pill,
  body.editorial .billing-fact-links a,
  body.editorial .document-tab {
    width: 100%;
    min-width: 0;
    white-space: normal;
    text-align: center;
  }

  body.editorial-compose .compose-hero,
  body.editorial-account .billing-hero,
  body.editorial-account .account-grid {
    grid-template-columns: 1fr;
  }

  body.editorial-compose .compose-topic-area {
    min-height: 240px !important;
  }

  body.editorial-compose .compose-output {
    min-height: 320px !important;
  }
}

/* PaperBleach-like authenticated workspace with a collapsible sidebar. */
body.editorial.app-shell {
  --sidebar-width: 252px;
  --sidebar-collapsed-width: 88px;
  min-height: 100vh;
  background: #fff !important;
}

body.editorial.app-shell[data-theme="dark"] {
  --bg: #101820;
  --bg-elev: #141f29;
  --surface: #192530;
  --surface-strong: #22313d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f6f8fb;
  --muted: #9aa8b6;
  --muted-soft: #748393;
  color: var(--text);
  background: #101820 !important;
}

body.editorial.app-shell .e-topbar {
  display: none !important;
}

body.editorial.app-shell .app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-width);
  padding: 26px 14px 18px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: width 0.2s ease, background 0.2s ease;
}

body.editorial.app-shell[data-theme="dark"] .app-sidebar {
  background: #101820;
}

body.editorial.app-shell .app-sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin-bottom: 28px;
}

body.editorial.app-shell .app-sidebar-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
  font-weight: 900;
}

body.editorial.app-shell .app-sidebar-logo {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--text);
  border-radius: 9px;
  color: var(--accent-text);
  font-weight: 900;
  transform: rotate(-7deg);
}

body.editorial.app-shell .app-sidebar-collapse,
body.editorial.app-shell .app-sidebar-mini {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

body.editorial.app-shell .app-sidebar-collapse {
  margin-left: auto;
}

body.editorial.app-shell .app-sidebar-collapse span {
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

body.editorial.app-shell .app-sidebar-nav {
  display: grid;
  gap: 8px;
}

body.editorial.app-shell .app-sidebar-section {
  margin: 12px 10px 6px;
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

body.editorial.app-shell .app-sidebar-section-management {
  margin-top: 26px;
}

body.editorial.app-shell .app-sidebar-link {
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 800;
  transition: color 0.16s ease, background 0.16s ease;
}

body.editorial.app-shell .app-sidebar-link:hover,
body.editorial.app-shell .app-sidebar-link.is-active {
  color: var(--accent-text);
  background: rgba(49, 209, 125, 0.1);
}

body.editorial.app-shell[data-theme="dark"] .app-sidebar-link:hover,
body.editorial.app-shell[data-theme="dark"] .app-sidebar-link.is-active {
  background: rgba(49, 209, 125, 0.13);
}

body.editorial.app-shell .app-sidebar-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: #dfe7ed;
  color: inherit;
  position: relative;
}

body.editorial.app-shell .app-sidebar-link.is-active .app-sidebar-icon {
  background: rgba(49, 209, 125, 0.22);
}

body.editorial.app-shell .app-sidebar-icon::before,
body.editorial.app-shell .app-sidebar-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
  opacity: 0.85;
}

body.editorial.app-shell .app-sidebar-icon-dashboard::before {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

body.editorial.app-shell .app-sidebar-icon-docs::before {
  width: 13px;
  height: 2px;
  top: 7px;
}

body.editorial.app-shell .app-sidebar-icon-docs::after {
  width: 13px;
  height: 2px;
  bottom: 7px;
}

body.editorial.app-shell .app-sidebar-icon-humanizer::before {
  width: 16px;
  height: 3px;
  transform: rotate(-45deg);
}

body.editorial.app-shell .app-sidebar-icon-generator::before {
  width: 4px;
  height: 16px;
}

body.editorial.app-shell .app-sidebar-icon-generator::after {
  width: 16px;
  height: 4px;
}

body.editorial.app-shell .app-sidebar-icon-billing::before,
body.editorial.app-shell .app-sidebar-icon-account::before,
body.editorial.app-shell .app-sidebar-icon-admin::before {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

body.editorial.app-shell .app-sidebar-foot {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

body.editorial.app-shell .app-sidebar-avatar,
body.editorial.app-shell .app-sidebar-profile-avatar {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 2px solid rgba(49, 209, 125, 0.7);
  border-radius: 999px;
  background: #101820;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

body.editorial.app-shell .app-theme-sun {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

body.editorial.app-shell .app-sidebar-profile {
  position: fixed;
  left: calc(var(--sidebar-width) + 16px);
  bottom: 18px;
  z-index: 70;
  width: 280px;
  padding: 24px;
  display: grid;
  justify-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

body.editorial.app-shell .app-sidebar-profile[hidden] {
  display: none;
}

body.editorial.app-shell .app-sidebar-profile-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
}

body.editorial.app-shell .app-sidebar-profile strong {
  max-width: 100%;
  color: var(--text);
  font-size: 16px;
  overflow-wrap: anywhere;
  text-align: center;
}

body.editorial.app-shell .app-sidebar-profile span {
  color: var(--muted);
}

body.editorial.app-shell .app-sidebar-profile-link,
body.editorial.app-shell .app-sidebar-logout {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 900;
  text-decoration: none;
}

body.editorial.app-shell .app-sidebar-profile-link {
  border: 1px solid rgba(49, 209, 125, 0.36);
  color: var(--accent-text);
  background: rgba(49, 209, 125, 0.08);
}

body.editorial.app-shell .app-sidebar-logout {
  border: 0;
  color: #b42318;
  background: #fde1dc;
  cursor: pointer;
}

body.editorial.app-shell .workspace-shell,
body.editorial.app-shell .billing-shell,
body.editorial.app-shell .admin-shell,
body.editorial.app-shell .account-shell,
body.editorial.app-shell .compose-shell {
  width: auto !important;
  max-width: none !important;
  margin-left: var(--sidebar-width);
  padding: 28px 32px 84px !important;
  transition: margin-left 0.2s ease;
}

body.editorial.app-shell .workspace-panel,
body.editorial.app-shell .billing-hero,
body.editorial.app-shell .compose-hero,
body.editorial.app-shell .surface-panel,
body.editorial.app-shell .billing-card,
body.editorial.app-shell .history-card,
body.editorial.app-shell .details-card {
  border-radius: 14px !important;
  background: var(--surface) !important;
  color: var(--text);
}

body.editorial.app-shell[data-theme="dark"] .workspace-panel,
body.editorial.app-shell[data-theme="dark"] .billing-hero,
body.editorial.app-shell[data-theme="dark"] .compose-hero,
body.editorial.app-shell[data-theme="dark"] .surface-panel,
body.editorial.app-shell[data-theme="dark"] .billing-card,
body.editorial.app-shell[data-theme="dark"] .history-card,
body.editorial.app-shell[data-theme="dark"] .details-card {
  border-color: var(--line) !important;
  background: var(--surface) !important;
  box-shadow: none;
}

body.editorial.app-shell .e-editor-header,
body.editorial.app-shell .compose-section-head {
  align-items: center;
}

body.editorial.app-shell .e-editor-title,
body.editorial.app-shell .section-title {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
}

body.editorial.app-shell .editor-stage {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

body.editorial.app-shell .editor-card,
body.editorial.app-shell .compose-form,
body.editorial.app-shell .compose-result {
  border-radius: 14px !important;
  background: var(--surface) !important;
  box-shadow: 0 20px 50px rgba(25, 42, 61, 0.06);
}

body.editorial.app-shell[data-theme="dark"] .editor-card,
body.editorial.app-shell[data-theme="dark"] .compose-form,
body.editorial.app-shell[data-theme="dark"] .compose-result {
  box-shadow: none;
}

body.editorial.app-shell .editor-area,
body.editorial.app-shell .compare-preview,
body.editorial.app-shell .input,
body.editorial.app-shell select {
  background: rgba(255, 255, 255, 0.96) !important;
  color: #17202a !important;
  -webkit-text-fill-color: #17202a !important;
}

body.editorial.app-shell[data-theme="dark"] .editor-area,
body.editorial.app-shell[data-theme="dark"] .compare-preview,
body.editorial.app-shell[data-theme="dark"] .input,
body.editorial.app-shell[data-theme="dark"] select {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: #111c25 !important;
  color: #f6f8fb !important;
  -webkit-text-fill-color: #f6f8fb !important;
}

body.editorial.app-shell .section-text,
body.editorial.app-shell .help-line,
body.editorial.app-shell .status-line,
body.editorial.app-shell .history-meta,
body.editorial.app-shell .details-card p,
body.editorial.app-shell .compose-meta-line {
  color: var(--muted) !important;
  -webkit-text-fill-color: var(--muted) !important;
}

body.editorial-account.app-shell .billing-hero {
  min-height: 230px;
  padding: 46px !important;
  background:
    radial-gradient(circle at 82% 24%, rgba(49, 209, 125, 0.2), transparent 26%),
    linear-gradient(135deg, #101820, #1a2a36) !important;
  color: #fff !important;
}

body.editorial-account.app-shell .billing-hero .micro-label,
body.editorial-account.app-shell .billing-hero .section-title,
body.editorial-account.app-shell .billing-hero .section-text {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

body.editorial-account.app-shell .billing-hero .section-title::before {
  content: "С возвращением";
  display: block;
  margin-bottom: 8px;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 900;
}

body.editorial-account.app-shell .account-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
}

body.editorial-account.app-shell .details-card:first-child {
  display: grid;
  gap: 16px;
}

body.editorial-account.app-shell .details-card:first-child h2 {
  font-size: 40px;
  line-height: 1.1;
}

body.editorial-history.app-shell .billing-hero {
  min-height: 180px;
}

body.editorial-history.app-shell .history-list > .surface-panel:only-child {
  min-height: 420px;
  display: grid;
  place-items: center;
  border-style: dashed !important;
}

body.editorial.app-shell.sidebar-collapsed .app-sidebar {
  width: var(--sidebar-collapsed-width);
  padding-left: 10px;
  padding-right: 10px;
}

body.editorial.app-shell.sidebar-collapsed .app-sidebar-brand-text,
body.editorial.app-shell.sidebar-collapsed .app-sidebar-label,
body.editorial.app-shell.sidebar-collapsed .app-sidebar-section {
  display: none;
}

body.editorial.app-shell.sidebar-collapsed .app-sidebar-head,
body.editorial.app-shell.sidebar-collapsed .app-sidebar-link,
body.editorial.app-shell.sidebar-collapsed .app-sidebar-foot {
  justify-content: center;
}

body.editorial.app-shell.sidebar-collapsed .app-sidebar-collapse {
  margin-left: 0;
}

body.editorial.app-shell.sidebar-collapsed .app-sidebar-collapse span {
  transform: rotate(225deg);
}

body.editorial.app-shell.sidebar-collapsed .workspace-shell,
body.editorial.app-shell.sidebar-collapsed .billing-shell,
body.editorial.app-shell.sidebar-collapsed .admin-shell,
body.editorial.app-shell.sidebar-collapsed .account-shell,
body.editorial.app-shell.sidebar-collapsed .compose-shell {
  margin-left: var(--sidebar-collapsed-width);
}

body.editorial.app-shell.sidebar-collapsed .app-sidebar-profile {
  left: calc(var(--sidebar-collapsed-width) + 16px);
}

@media (max-width: 900px) {
  body.editorial.app-shell .app-sidebar {
    width: var(--sidebar-collapsed-width);
    padding-left: 10px;
    padding-right: 10px;
  }

  body.editorial.app-shell .app-sidebar-brand-text,
  body.editorial.app-shell .app-sidebar-label,
  body.editorial.app-shell .app-sidebar-section {
    display: none;
  }

  body.editorial.app-shell .workspace-shell,
  body.editorial.app-shell .billing-shell,
  body.editorial.app-shell .admin-shell,
  body.editorial.app-shell .account-shell,
  body.editorial.app-shell .compose-shell,
  body.editorial.app-shell.sidebar-collapsed .workspace-shell,
  body.editorial.app-shell.sidebar-collapsed .billing-shell,
  body.editorial.app-shell.sidebar-collapsed .admin-shell,
  body.editorial.app-shell.sidebar-collapsed .account-shell,
  body.editorial.app-shell.sidebar-collapsed .compose-shell {
    margin-left: var(--sidebar-collapsed-width);
    padding: 18px 14px 72px !important;
  }

  body.editorial.app-shell .editor-stage,
  body.editorial.app-shell .compose-grid {
    grid-template-columns: 1fr;
  }
}

/* Final app-shell polish: stable collapsed sidebar, Russian workspace, clean toggles. */
html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar,
body.editorial.app-shell.sidebar-collapsed .app-sidebar {
  width: var(--sidebar-collapsed-width);
  padding-left: 14px;
  padding-right: 14px;
}

html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-brand-text,
html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-label,
html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-section,
body.editorial.app-shell.sidebar-collapsed .app-sidebar-brand-text,
body.editorial.app-shell.sidebar-collapsed .app-sidebar-label,
body.editorial.app-shell.sidebar-collapsed .app-sidebar-section {
  display: none !important;
}

html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-head,
body.editorial.app-shell.sidebar-collapsed .app-sidebar-head {
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
}

html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-brand,
body.editorial.app-shell.sidebar-collapsed .app-sidebar-brand {
  justify-content: center;
}

html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-collapse,
body.editorial.app-shell.sidebar-collapsed .app-sidebar-collapse {
  margin-left: 0;
}

html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-link,
html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-foot,
body.editorial.app-shell.sidebar-collapsed .app-sidebar-link,
body.editorial.app-shell.sidebar-collapsed .app-sidebar-foot {
  justify-content: center;
}

html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-foot,
body.editorial.app-shell.sidebar-collapsed .app-sidebar-foot {
  flex-direction: column;
  gap: 12px;
}

html.sidebar-collapsed-preload body.editorial.app-shell .workspace-shell,
html.sidebar-collapsed-preload body.editorial.app-shell .billing-shell,
html.sidebar-collapsed-preload body.editorial.app-shell .admin-shell,
html.sidebar-collapsed-preload body.editorial.app-shell .account-shell,
html.sidebar-collapsed-preload body.editorial.app-shell .compose-shell,
body.editorial.app-shell.sidebar-collapsed .workspace-shell,
body.editorial.app-shell.sidebar-collapsed .billing-shell,
body.editorial.app-shell.sidebar-collapsed .admin-shell,
body.editorial.app-shell.sidebar-collapsed .account-shell,
body.editorial.app-shell.sidebar-collapsed .compose-shell {
  margin-left: var(--sidebar-collapsed-width);
}

html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-profile,
body.editorial.app-shell.sidebar-collapsed .app-sidebar-profile {
  left: calc(var(--sidebar-collapsed-width) + 16px);
}

html.theme-dark-preload body.editorial.app-shell,
body.editorial.app-shell[data-theme="dark"] {
  background: #101820 !important;
}

body.editorial.app-shell .app-sidebar-mini {
  position: relative;
  background: #fff;
  overflow: hidden;
}

body.editorial.app-shell .app-theme-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
  border-radius: 999px;
  background: #7c8ea3;
  transition: transform 0.24s ease, background 0.24s ease;
}

body.editorial.app-shell .app-theme-icon::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  transform: translate(3px, -3px);
  transition: transform 0.24s ease, background 0.24s ease;
}

body.editorial.app-shell[data-theme="dark"] .app-sidebar-mini,
html.theme-dark-preload body.editorial.app-shell .app-sidebar-mini {
  background: #15212b;
}

body.editorial.app-shell[data-theme="dark"] .app-theme-icon,
html.theme-dark-preload body.editorial.app-shell .app-theme-icon {
  background: #d6e2f0;
  transform: rotate(-18deg);
}

body.editorial.app-shell[data-theme="dark"] .app-theme-icon::after,
html.theme-dark-preload body.editorial.app-shell .app-theme-icon::after {
  background: #15212b;
  transform: translate(6px, -2px);
}

body.editorial.app-shell .toggle-row {
  width: fit-content;
  max-width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  color: var(--muted) !important;
  -webkit-text-fill-color: var(--muted) !important;
}

body.editorial.app-shell .toggle-ui {
  flex: 0 0 54px;
  width: 54px;
  height: 30px;
  border: 1px solid #c7d8e2;
  background: #fff !important;
  box-shadow: inset 0 0 0 3px rgba(221, 232, 238, 0.7);
}

body.editorial.app-shell .toggle-ui::after {
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  background: #7f90a6;
}

body.editorial.app-shell .toggle-input:checked + .toggle-ui {
  border-color: var(--accent);
  background: #fff !important;
  box-shadow: inset 0 0 0 3px rgba(49, 209, 125, 0.18);
}

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

body.editorial.app-shell .toggle-copy {
  line-height: 1.2;
}

body.editorial-billing .billing-sales-hero,
body.editorial-billing .billing-chooser,
body.editorial-billing .billing-facts-grid,
body.editorial-billing .billing-faq-grid,
body.editorial-billing .billing-mobile-sticky {
  display: none !important;
}

body.editorial-billing.app-shell .billing-shell {
  min-height: 100vh;
  display: grid;
  align-content: center;
}

body.editorial-billing.app-shell .billing-grid {
  margin-top: 0 !important;
}

body.editorial-billing .billing-payment-status {
  margin-top: 18px;
}

body.editorial-app.app-shell .editor-stage {
  align-items: stretch;
}

body.editorial-app.app-shell .editor-card-result {
  min-height: 100%;
}

body.editorial-app.app-shell #outputPreview:empty::before {
  content: "Здесь появится готовый текст после генерации.";
  color: var(--muted);
}

/* Hard override for the formatting switch. Older theme rules use !important. */
body.editorial.app-shell .toggle-row {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
}

body.editorial.app-shell .toggle-ui {
  position: relative !important;
  display: block !important;
  flex: 0 0 52px !important;
  width: 52px !important;
  height: 28px !important;
  min-width: 52px !important;
  padding: 0 !important;
  border: 2px solid #31d17d !important;
  border-radius: 999px !important;
  background: #fff !important;
  box-sizing: border-box !important;
  box-shadow: inset 0 0 0 3px rgba(49, 209, 125, 0.12) !important;
}

body.editorial.app-shell .toggle-ui::after {
  position: absolute !important;
  top: 50% !important;
  left: 4px !important;
  width: 18px !important;
  height: 18px !important;
  border-radius: 999px !important;
  background: #7f90a6 !important;
  transform: translateY(-50%) !important;
  transition: transform 0.18s ease, background 0.18s ease !important;
}

body.editorial.app-shell .toggle-input:checked + .toggle-ui {
  background: #fff !important;
}

body.editorial.app-shell .toggle-input:checked + .toggle-ui::after {
  background: #31d17d !important;
  transform: translate(24px, -50%) !important;
}

@media (max-width: 900px) {
  body.editorial.app-shell .app-sidebar-head {
    flex-direction: column;
    justify-content: flex-start;
    gap: 14px;
  }

  body.editorial.app-shell .app-sidebar-collapse {
    margin-left: 0;
  }

  body.editorial.app-shell .app-sidebar-foot {
    flex-direction: column;
    gap: 12px;
  }
}

/* Stable app workspace: keep the editor usable after generation. */
body.editorial-app.app-shell .workspace-shell {
  min-height: 100vh;
  padding: 24px 28px 72px !important;
}

body.editorial-app.app-shell .workspace-panel {
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 32px 34px !important;
}

body.editorial-app.app-shell .e-editor-header {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 24px;
  align-items: start;
}

body.editorial-app.app-shell .e-editor-title {
  max-width: 900px;
  margin: 8px 0 0;
  font-size: clamp(34px, 3vw, 54px) !important;
  line-height: 0.98 !important;
}

body.editorial-app.app-shell .e-meter {
  justify-self: end;
  width: min(100%, 320px);
}

body.editorial-app.app-shell .editor-stage {
  flex: 1 1 auto;
  min-height: 520px;
  display: grid !important;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 20px !important;
  align-items: stretch !important;
  margin-top: 28px !important;
}

body.editorial-app.app-shell .editor-card {
  min-height: 0 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  padding: 24px !important;
  transform: none !important;
  opacity: 1 !important;
}

body.editorial-app.app-shell .editor-card-result {
  min-height: 0 !important;
  transform: none !important;
  opacity: 1 !important;
}

body.editorial-app.app-shell .editor-card-topline {
  min-height: 46px;
  align-items: center !important;
  gap: 14px;
  margin-bottom: 0 !important;
}

body.editorial-app.app-shell .result-actions,
body.editorial-app.app-shell .result-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.editorial-app.app-shell .result-copy-button {
  position: static !important;
  align-self: auto !important;
  min-height: 44px !important;
  padding: 0 18px !important;
  margin: 0 !important;
  white-space: nowrap;
}

body.editorial-app.app-shell .editor-stack,
body.editorial-app.app-shell .result-output-shell {
  min-height: 0;
  height: 100%;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr);
  gap: 0 !important;
  overflow: hidden !important;
  border-radius: 12px !important;
}

body.editorial-app.app-shell .editor-area,
body.editorial-app.app-shell .compare-preview {
  width: 100% !important;
  height: clamp(380px, calc(100vh - 430px), 560px) !important;
  min-height: 0 !important;
  max-height: none !important;
  box-sizing: border-box !important;
  padding: 22px 24px !important;
  overflow: auto !important;
  resize: none !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.97) !important;
  color: #17202a !important;
  -webkit-text-fill-color: #17202a !important;
  font-size: 17px !important;
  line-height: 1.64 !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
}

body.editorial-app.app-shell .editor-area:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px rgba(49, 209, 125, 0.13) !important;
}

body.editorial-app.app-shell[data-theme="dark"] .editor-area,
body.editorial-app.app-shell[data-theme="dark"] .compare-preview {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: #111c25 !important;
  color: #f6f8fb !important;
  -webkit-text-fill-color: #f6f8fb !important;
}

body.editorial-app.app-shell .result-preview {
  margin-top: 0 !important;
}

body.editorial-app.app-shell .human-score,
body.editorial-app.app-shell .cache-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  white-space: nowrap;
}

body.editorial-app.app-shell .e-toolbar {
  grid-template-columns: max-content max-content max-content;
  align-items: center;
  justify-content: start;
  gap: 18px !important;
  margin-top: 20px !important;
  padding: 16px 18px !important;
}

body.editorial-app.app-shell .help-line {
  margin: 14px 0 0;
}

body.editorial-app.app-shell .action-row {
  margin-top: 18px;
}

body.editorial-app.app-shell .legal-notice {
  margin-top: 24px !important;
}

@media (max-width: 980px) {
  body.editorial-app.app-shell .workspace-shell {
    padding: 20px 20px 64px !important;
  }

  body.editorial-app.app-shell .editor-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  body.editorial-app.app-shell .editor-area,
  body.editorial-app.app-shell .compare-preview {
    height: clamp(360px, 48vh, 560px) !important;
  }
}

@media (max-width: 760px) {
  body.editorial.app-shell {
    --sidebar-width: 64px;
    --sidebar-collapsed-width: 64px;
  }

  body.editorial.app-shell .app-sidebar {
    width: 64px !important;
    padding: 14px 8px !important;
  }

  body.editorial.app-shell .app-sidebar-brand-text,
  body.editorial.app-shell .app-sidebar-section-title,
  body.editorial.app-shell .app-sidebar-link span:last-child {
    display: none !important;
  }

  body.editorial.app-shell .app-sidebar-head {
    align-items: center;
    gap: 10px;
  }

  body.editorial.app-shell .app-sidebar-logo {
    width: 42px;
    height: 42px;
  }

  body.editorial.app-shell .app-sidebar-collapse {
    width: 38px;
    height: 38px;
  }

  body.editorial.app-shell .app-sidebar-link {
    justify-content: center !important;
    width: 46px;
    padding: 10px !important;
  }

  body.editorial-app.app-shell .workspace-shell {
    margin-left: 64px !important;
    padding: 8px 8px 36px !important;
  }

  body.editorial-app.app-shell .workspace-panel {
    min-height: auto;
    padding: 16px 12px !important;
  }

  body.editorial-app.app-shell .e-editor-header {
    grid-template-columns: minmax(0, 1fr);
  }

  body.editorial-app.app-shell .e-meter {
    justify-self: stretch;
    width: 100%;
  }

  body.editorial-app.app-shell .editor-card {
    padding: 12px !important;
  }

  body.editorial-app.app-shell .editor-card-topline {
    align-items: flex-start !important;
    flex-direction: column;
  }

  body.editorial-app.app-shell .result-actions,
  body.editorial-app.app-shell .result-badges {
    justify-content: flex-start;
  }

  body.editorial-app.app-shell .e-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  body.editorial-app.app-shell .editor-area,
  body.editorial-app.app-shell .compare-preview {
    height: 360px !important;
    padding: 18px !important;
    font-size: 15px !important;
  }
}

/* Workspace polish v13: clearer controls, sidebar symbols, and editor empty state. */
body.editorial.app-shell .app-sidebar-link {
  gap: 13px;
}

body.editorial.app-shell .app-sidebar-icon {
  width: 26px !important;
  height: 26px !important;
  border: 1px solid rgba(125, 145, 166, 0.26) !important;
  border-radius: 8px !important;
  background: #edf3f7 !important;
  color: #6f8196 !important;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.85);
}

body.editorial.app-shell .app-sidebar-link:hover .app-sidebar-icon,
body.editorial.app-shell .app-sidebar-link.is-active .app-sidebar-icon {
  border-color: rgba(49, 209, 125, 0.35) !important;
  background: #dcf8e9 !important;
  color: var(--accent-text) !important;
}

body.editorial.app-shell[data-theme="dark"] .app-sidebar-icon,
html.theme-dark-preload body.editorial.app-shell .app-sidebar-icon {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: #24313d !important;
  color: #9aabbc !important;
  box-shadow: none;
}

body.editorial.app-shell[data-theme="dark"] .app-sidebar-link:hover .app-sidebar-icon,
body.editorial.app-shell[data-theme="dark"] .app-sidebar-link.is-active .app-sidebar-icon,
html.theme-dark-preload body.editorial.app-shell .app-sidebar-link:hover .app-sidebar-icon,
html.theme-dark-preload body.editorial.app-shell .app-sidebar-link.is-active .app-sidebar-icon {
  background: rgba(49, 209, 125, 0.18) !important;
  color: #49e292 !important;
}

body.editorial.app-shell .app-sidebar-icon::before,
body.editorial.app-shell .app-sidebar-icon::after {
  content: "" !important;
  position: absolute !important;
  opacity: 1 !important;
  box-sizing: border-box !important;
}

body.editorial.app-shell .app-sidebar-icon-dashboard::before {
  left: 6px !important;
  top: 8px !important;
  width: 14px !important;
  height: 9px !important;
  border: 2px solid currentColor !important;
  border-bottom: 0 !important;
  border-radius: 12px 12px 0 0 !important;
  background: transparent !important;
}

body.editorial.app-shell .app-sidebar-icon-dashboard::after {
  left: 12px !important;
  top: 12px !important;
  width: 8px !important;
  height: 2px !important;
  border-radius: 99px !important;
  background: currentColor !important;
  transform: rotate(-35deg) !important;
  transform-origin: left center !important;
}

body.editorial.app-shell .app-sidebar-icon-docs::before {
  left: 7px !important;
  top: 6px !important;
  width: 12px !important;
  height: 14px !important;
  border: 2px solid currentColor !important;
  border-radius: 3px !important;
  background: transparent !important;
}

body.editorial.app-shell .app-sidebar-icon-docs::after {
  left: 10px !important;
  top: 11px !important;
  width: 7px !important;
  height: 2px !important;
  border-radius: 99px !important;
  background: currentColor !important;
  box-shadow: 0 4px 0 currentColor !important;
}

body.editorial.app-shell .app-sidebar-icon-humanizer::before {
  left: 7px !important;
  top: 12px !important;
  width: 14px !important;
  height: 4px !important;
  border-radius: 2px !important;
  background: currentColor !important;
  transform: rotate(-42deg) !important;
}

body.editorial.app-shell .app-sidebar-icon-humanizer::after {
  left: 5px !important;
  top: 16px !important;
  width: 10px !important;
  height: 2px !important;
  border-radius: 99px !important;
  background: currentColor !important;
  opacity: 0.42 !important;
}

body.editorial.app-shell .app-sidebar-icon-generator::before,
body.editorial.app-shell .app-sidebar-icon-generator::after {
  left: 50% !important;
  top: 50% !important;
  border-radius: 99px !important;
  background: currentColor !important;
  transform: translate(-50%, -50%) !important;
}

body.editorial.app-shell .app-sidebar-icon-generator::before {
  width: 3px !important;
  height: 16px !important;
}

body.editorial.app-shell .app-sidebar-icon-generator::after {
  width: 16px !important;
  height: 3px !important;
}

body.editorial.app-shell .app-sidebar-icon-billing::before {
  left: 6px !important;
  top: 7px !important;
  width: 14px !important;
  height: 12px !important;
  border: 2px solid currentColor !important;
  border-radius: 4px !important;
  background: transparent !important;
}

body.editorial.app-shell .app-sidebar-icon-billing::after {
  left: 8px !important;
  top: 10px !important;
  width: 10px !important;
  height: 2px !important;
  background: currentColor !important;
  box-shadow: 0 4px 0 currentColor !important;
}

body.editorial.app-shell .app-sidebar-icon-account::before {
  left: 10px !important;
  top: 6px !important;
  width: 7px !important;
  height: 7px !important;
  border-radius: 999px !important;
  background: currentColor !important;
}

body.editorial.app-shell .app-sidebar-icon-account::after {
  left: 7px !important;
  top: 15px !important;
  width: 13px !important;
  height: 7px !important;
  border-radius: 9px 9px 3px 3px !important;
  background: currentColor !important;
}

body.editorial.app-shell .app-sidebar-icon-admin::before {
  left: 7px !important;
  top: 5px !important;
  width: 12px !important;
  height: 15px !important;
  clip-path: polygon(50% 0, 100% 18%, 88% 72%, 50% 100%, 12% 72%, 0 18%) !important;
  background: currentColor !important;
}

body.editorial-app.app-shell .editor-card-topline {
  display: flex !important;
  justify-content: space-between;
}

body.editorial-app.app-shell .source-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

body.editorial-app.app-shell .source-paste-button {
  min-height: 40px !important;
  padding: 0 16px !important;
  border-color: rgba(49, 209, 125, 0.55) !important;
  color: var(--accent-text) !important;
  -webkit-text-fill-color: var(--accent-text) !important;
  background: rgba(49, 209, 125, 0.08) !important;
}

body.editorial-app.app-shell .source-paste-button:hover {
  background: rgba(49, 209, 125, 0.15) !important;
}

body.editorial-app.app-shell .result-preview.is-empty {
  display: grid !important;
  place-items: center !important;
  color: #718399 !important;
  -webkit-text-fill-color: #718399 !important;
  background:
    radial-gradient(circle at 50% 42%, rgba(49, 209, 125, 0.1), transparent 34%),
    rgba(255, 255, 255, 0.97) !important;
}

body.editorial-app.app-shell .result-empty-state {
  width: min(360px, 100%);
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  line-height: 1.35;
}

body.editorial-app.app-shell .result-empty-state strong {
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

body.editorial-app.app-shell .result-empty-state span:last-child {
  max-width: 280px;
  color: #718399;
  -webkit-text-fill-color: #718399;
  font-size: 14px;
}

body.editorial-app.app-shell .result-empty-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 2px solid #16202b;
  border-radius: 13px;
  background: #fff;
  color: var(--accent-text) !important;
  -webkit-text-fill-color: var(--accent-text) !important;
  font-size: 23px;
  font-weight: 950;
  transform: rotate(-7deg);
  box-shadow: 0 12px 28px rgba(16, 24, 32, 0.08);
}

body.editorial-app.app-shell[data-theme="dark"] .result-preview.is-empty,
html.theme-dark-preload body.editorial-app.app-shell .result-preview.is-empty {
  color: #98a9ba !important;
  -webkit-text-fill-color: #98a9ba !important;
  background:
    radial-gradient(circle at 50% 42%, rgba(49, 209, 125, 0.11), transparent 36%),
    #111c25 !important;
}

body.editorial-app.app-shell[data-theme="dark"] .result-empty-icon,
html.theme-dark-preload body.editorial-app.app-shell .result-empty-icon {
  border-color: rgba(255, 255, 255, 0.16);
  background: #172532;
  box-shadow: none;
}

body.editorial.app-shell .toggle-row {
  min-height: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
}

body.editorial.app-shell .toggle-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.editorial.app-shell .toggle-ui {
  position: relative !important;
  display: inline-block !important;
  flex: 0 0 58px !important;
  width: 58px !important;
  height: 32px !important;
  min-width: 58px !important;
  padding: 0 !important;
  border: 2px solid #c6d8e4 !important;
  border-radius: 999px !important;
  background: #f6fbf8 !important;
  box-shadow: inset 0 0 0 2px rgba(214, 229, 237, 0.54) !important;
}

body.editorial.app-shell .toggle-ui::after {
  content: "" !important;
  position: absolute !important;
  top: 50% !important;
  left: 4px !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 999px !important;
  background: #7c8ea3 !important;
  box-shadow: 0 2px 7px rgba(20, 32, 44, 0.18) !important;
  transform: translate(0, -50%) !important;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease !important;
}

body.editorial.app-shell .toggle-input:checked + .toggle-ui {
  border-color: #31d17d !important;
  background: #ecfff4 !important;
  box-shadow: inset 0 0 0 2px rgba(49, 209, 125, 0.16) !important;
}

body.editorial.app-shell .toggle-input:checked + .toggle-ui::after {
  background: #31d17d !important;
  transform: translate(26px, -50%) !important;
  box-shadow: 0 3px 9px rgba(49, 209, 125, 0.26) !important;
}

body.editorial.app-shell .toggle-input:focus-visible + .toggle-ui {
  outline: 3px solid rgba(49, 209, 125, 0.25) !important;
  outline-offset: 3px !important;
}

body.editorial.app-shell[data-theme="dark"] .toggle-ui,
html.theme-dark-preload body.editorial.app-shell .toggle-ui {
  border-color: rgba(255, 255, 255, 0.16) !important;
  background: #12202b !important;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.04) !important;
}

body.editorial.app-shell[data-theme="dark"] .toggle-input:checked + .toggle-ui,
html.theme-dark-preload body.editorial.app-shell .toggle-input:checked + .toggle-ui {
  border-color: #49e292 !important;
  background: rgba(49, 209, 125, 0.14) !important;
}

@media (max-width: 760px) {
  body.editorial-app.app-shell .editor-card-topline {
    align-items: stretch !important;
  }

  body.editorial-app.app-shell .source-actions,
  body.editorial-app.app-shell .source-paste-button {
    width: 100%;
  }

  body.editorial-app.app-shell .source-paste-button {
    justify-content: center;
  }
}

/* Workspace polish v14: centered sidebar icons and real mobile navigation. */
body.editorial.app-shell .app-mobile-topbar,
body.editorial.app-shell .app-sidebar-backdrop {
  display: none;
}

body.editorial.app-shell .app-sidebar-icon {
  display: inline-grid !important;
  place-items: center !important;
  overflow: hidden !important;
}

body.editorial.app-shell .app-sidebar-icon-dashboard::before {
  left: 50% !important;
  top: 51% !important;
  width: 15px !important;
  height: 11px !important;
  transform: translate(-50%, -50%) !important;
}

body.editorial.app-shell .app-sidebar-icon-dashboard::after {
  left: 50% !important;
  top: 54% !important;
  width: 8px !important;
  height: 2px !important;
  transform: translate(-12%, -50%) rotate(-38deg) !important;
}

body.editorial.app-shell .app-sidebar-icon-docs::before {
  left: 50% !important;
  top: 50% !important;
  width: 13px !important;
  height: 15px !important;
  transform: translate(-50%, -50%) !important;
}

body.editorial.app-shell .app-sidebar-icon-docs::after {
  left: 50% !important;
  top: 47% !important;
  width: 7px !important;
  height: 2px !important;
  transform: translate(-50%, -50%) !important;
}

body.editorial.app-shell .app-sidebar-icon-humanizer::before {
  left: 50% !important;
  top: 50% !important;
  width: 15px !important;
  height: 4px !important;
  transform: translate(-50%, -50%) rotate(-42deg) !important;
}

body.editorial.app-shell .app-sidebar-icon-humanizer::after {
  left: 38% !important;
  top: 63% !important;
  width: 9px !important;
  height: 2px !important;
  transform: translate(-50%, -50%) !important;
}

body.editorial.app-shell .app-sidebar-icon-billing::before {
  left: 50% !important;
  top: 50% !important;
  width: 14px !important;
  height: 13px !important;
  transform: translate(-50%, -50%) !important;
}

body.editorial.app-shell .app-sidebar-icon-billing::after {
  left: 50% !important;
  top: 45% !important;
  width: 9px !important;
  height: 2px !important;
  transform: translate(-50%, -50%) !important;
}

body.editorial.app-shell .app-sidebar-icon-account::before {
  left: 50% !important;
  top: 39% !important;
  width: 7px !important;
  height: 7px !important;
  transform: translate(-50%, -50%) !important;
}

body.editorial.app-shell .app-sidebar-icon-account::after {
  left: 50% !important;
  top: 64% !important;
  width: 14px !important;
  height: 7px !important;
  transform: translate(-50%, -50%) !important;
}

body.editorial.app-shell .app-sidebar-icon-admin::before {
  left: 50% !important;
  top: 50% !important;
  width: 13px !important;
  height: 15px !important;
  transform: translate(-50%, -50%) !important;
}

@media (max-width: 760px) {
  body.editorial.app-shell {
    --mobile-topbar-height: 72px;
    --sidebar-width: min(86vw, 320px);
    --sidebar-collapsed-width: min(86vw, 320px);
    overflow-x: hidden;
  }

  body.editorial.app-shell.mobile-sidebar-open {
    overflow: hidden;
  }

  body.editorial.app-shell .app-mobile-topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 95;
    height: var(--mobile-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  body.editorial.app-shell[data-theme="dark"] .app-mobile-topbar,
  html.theme-dark-preload body.editorial.app-shell .app-mobile-topbar {
    background: rgba(16, 24, 32, 0.94);
  }

  body.editorial.app-shell .app-mobile-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 20px;
    font-weight: 950;
  }

  body.editorial.app-shell .app-mobile-brand .app-sidebar-logo {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
  }

  body.editorial.app-shell .app-mobile-brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.editorial.app-shell .app-mobile-menu-button {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    gap: 4px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 10px 24px rgba(20, 32, 44, 0.08);
  }

  body.editorial.app-shell .app-mobile-menu-button span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.18s ease, opacity 0.18s ease;
  }

  body.editorial.app-shell.mobile-sidebar-open .app-mobile-menu-button span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  body.editorial.app-shell.mobile-sidebar-open .app-mobile-menu-button span:nth-child(2) {
    opacity: 0;
  }

  body.editorial.app-shell.mobile-sidebar-open .app-mobile-menu-button span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  body.editorial.app-shell .app-sidebar-backdrop:not([hidden]) {
    position: fixed;
    inset: var(--mobile-topbar-height) 0 0 0;
    z-index: 80;
    display: block;
    border: 0;
    background: rgba(8, 15, 22, 0.34);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  body.editorial.app-shell .app-sidebar,
  body.editorial.app-shell.sidebar-collapsed .app-sidebar,
  html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar {
    top: var(--mobile-topbar-height) !important;
    bottom: 0 !important;
    left: 0 !important;
    width: var(--sidebar-width) !important;
    z-index: 90 !important;
    pointer-events: auto !important;
    padding: 18px 14px !important;
    transform: translateX(-104%);
    transition: transform 0.22s ease, background 0.2s ease !important;
    box-shadow: 20px 0 48px rgba(12, 22, 32, 0.12);
  }

  body.editorial.app-shell.mobile-sidebar-open .app-sidebar,
  body.editorial.app-shell.mobile-sidebar-open.sidebar-collapsed .app-sidebar,
  html.sidebar-collapsed-preload body.editorial.app-shell.mobile-sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  body.editorial.app-shell .app-sidebar-head,
  body.editorial.app-shell.sidebar-collapsed .app-sidebar-head,
  html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-head {
    min-height: 44px;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between !important;
    gap: 12px;
    margin-bottom: 18px;
  }

  body.editorial.app-shell .app-sidebar-brand,
  body.editorial.app-shell.sidebar-collapsed .app-sidebar-brand,
  html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-brand {
    justify-content: flex-start !important;
  }

  body.editorial.app-shell .app-sidebar-brand-text,
  body.editorial.app-shell .app-sidebar-label,
  body.editorial.app-shell .app-sidebar-section,
  body.editorial.app-shell.sidebar-collapsed .app-sidebar-brand-text,
  body.editorial.app-shell.sidebar-collapsed .app-sidebar-label,
  body.editorial.app-shell.sidebar-collapsed .app-sidebar-section,
  html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-brand-text,
  html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-label,
  html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-section {
    display: block !important;
  }

  body.editorial.app-shell.mobile-sidebar-open .app-sidebar .app-sidebar-brand-text,
  body.editorial.app-shell.mobile-sidebar-open .app-sidebar .app-sidebar-label,
  body.editorial.app-shell.mobile-sidebar-open .app-sidebar .app-sidebar-section {
    display: block !important;
    opacity: 1 !important;
    width: auto !important;
    max-width: none !important;
    clip-path: none !important;
  }

  body.editorial.app-shell .app-sidebar-link,
  body.editorial.app-shell.sidebar-collapsed .app-sidebar-link,
  html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-link {
    width: auto !important;
    min-height: 52px;
    justify-content: flex-start !important;
    padding: 11px 12px !important;
    border-radius: 14px;
    font-size: 16px;
  }

  body.editorial.app-shell .app-sidebar-foot,
  body.editorial.app-shell.sidebar-collapsed .app-sidebar-foot,
  html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-foot {
    flex-direction: row !important;
    justify-content: space-between !important;
    gap: 12px;
  }

  body.editorial.app-shell .app-sidebar-profile,
  body.editorial.app-shell.sidebar-collapsed .app-sidebar-profile,
  html.sidebar-collapsed-preload body.editorial.app-shell .app-sidebar-profile {
    left: 14px !important;
    right: 14px !important;
    bottom: 16px !important;
    width: auto !important;
    max-width: none !important;
  }

  body.editorial.app-shell .workspace-shell,
  body.editorial.app-shell .billing-shell,
  body.editorial.app-shell .admin-shell,
  body.editorial.app-shell .account-shell,
  body.editorial.app-shell .compose-shell,
  body.editorial.app-shell.sidebar-collapsed .workspace-shell,
  body.editorial.app-shell.sidebar-collapsed .billing-shell,
  body.editorial.app-shell.sidebar-collapsed .admin-shell,
  body.editorial.app-shell.sidebar-collapsed .account-shell,
  body.editorial.app-shell.sidebar-collapsed .compose-shell,
  html.sidebar-collapsed-preload body.editorial.app-shell .workspace-shell,
  html.sidebar-collapsed-preload body.editorial.app-shell .billing-shell,
  html.sidebar-collapsed-preload body.editorial.app-shell .admin-shell,
  html.sidebar-collapsed-preload body.editorial.app-shell .account-shell,
  html.sidebar-collapsed-preload body.editorial.app-shell .compose-shell {
    margin-left: 0 !important;
    padding: calc(var(--mobile-topbar-height) + 12px) 12px 44px !important;
  }

  body.editorial-app.app-shell .workspace-panel {
    min-height: auto;
    padding: 18px 14px !important;
    overflow: visible;
  }

  body.editorial-app.app-shell .e-editor-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  body.editorial-app.app-shell .e-editor-title {
    font-size: clamp(32px, 11vw, 44px) !important;
    line-height: 1.02 !important;
  }

  body.editorial-app.app-shell .editor-stage {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    margin-top: 20px !important;
  }

  body.editorial-app.app-shell .editor-card {
    min-height: 0 !important;
    padding: 14px !important;
    border-radius: 16px !important;
  }

  body.editorial-app.app-shell .editor-card-topline {
    flex-direction: column;
    align-items: stretch !important;
    min-height: 0;
  }

  body.editorial-app.app-shell .editor-area,
  body.editorial-app.app-shell .compare-preview {
    height: min(48vh, 420px) !important;
    min-height: 300px !important;
    padding: 16px !important;
    font-size: 16px !important;
    line-height: 1.56 !important;
  }

  body.editorial-app.app-shell .e-toolbar {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 14px !important;
  }

  body.editorial-app.app-shell .e-toolbar-sep {
    display: none;
  }

  body.editorial-app.app-shell .e-toolbar-group,
  body.editorial-app.app-shell .toggle-row {
    width: 100%;
    justify-content: space-between;
  }
}
