:root {
  --bg-obsidian: #0b0e14;
  /* Subtle center lift — breaks flat obsidian without brightening the whole page */
  --bg-depth: radial-gradient(
    circle at center,
    #16191e 0%,
    var(--bg-obsidian) 100%
  );
  --surface-glass: rgba(22, 28, 40, 0.55);
  --surface-glass-strong: rgba(28, 35, 52, 0.72);
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-primary: rgba(255, 255, 255, 0.94);
  --text-secondary: rgba(255, 255, 255, 0.58);
  --text-muted: rgba(255, 255, 255, 0.38);
  --mint-500: #10b981;
  --mint-400: #34d399;
  --mint-glow-alpha: 0.35;
  --mint-glow: rgb(52 211 153 / var(--mint-glow-alpha));
  --mint-gradient: linear-gradient(135deg, var(--mint-500), var(--mint-400));
  --mint-gradient-hover: linear-gradient(
    135deg,
    color-mix(in srgb, var(--mint-500) 78%, white 22%),
    color-mix(in srgb, var(--mint-400) 75%, white 25%)
  );
  --mint-glow-hover: rgb(52 211 153 / calc(var(--mint-glow-alpha) * 0.92));
  --shadow-soft: 0 18px 48px rgba(0, 0, 0, 0.45);
  --preview-canvas-elevated-shadow:
    0 18px 52px rgba(0, 0, 0, 0.58),
    0 10px 36px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.07),
    0 0 52px rgb(52 211 153 / calc(var(--mint-glow-alpha) * 0.2));
  --shell-max-width: 1120px;
  --shell-max-width-doc-active: min(92vw, 740px);
  --preview-max-width-desktop: 740px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --blur: blur(22px);
}

@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-depth);
  background-color: var(--bg-obsidian);
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(1rem, 3vw, 2rem);
  max-width: var(--shell-max-width);
  width: 100%;
  margin: 0 auto;
}

/* Wide “hero preview” layout whenever the PDF workspace is open (upload or demo). */
body.doc-loaded .app-shell,
.app-shell:has(#workspace:not([hidden])) {
  max-width: var(--preview-max-width-desktop) !important;
  width: 100% !important;
  box-sizing: border-box;
}

body.doc-loaded .app-main,
.app-shell:has(#workspace:not([hidden])) .app-main {
  max-width: var(--preview-max-width-desktop) !important;
  width: 100% !important;
  box-sizing: border-box;
}

.glass {
  background: var(--surface-glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

@supports not (backdrop-filter: blur(1px)) {
  .glass {
    background: var(--surface-glass-strong);
  }
}

.svg-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.app-header {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-lg);
}

/* Softer, wider mint wash under the header — reads as a spotlight toward the hero */
.app-header.glass {
  box-shadow: var(--shadow-soft),
    0 36px 100px -48px rgb(52 211 153 / 0.16),
    0 72px 160px -72px rgb(52 211 153 / 0.09),
    0 120px 220px -100px rgb(52 211 153 / 0.05);
}

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

.brand--link {
  text-decoration: none;
  color: inherit;
}

.brand--link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.brand__mark {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 10px var(--mint-glow))
    drop-shadow(0 0 22px rgb(52 211 153 / 0.18))
    drop-shadow(0 2px 10px rgb(16 185 129 / 0.28));
}

.brand__mark-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand__name {
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

.app-header__nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  padding-left: 0.65rem;
  margin-left: 0.1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

@media (prefers-reduced-motion: no-preference) {
  .user-profile {
    animation: header-profile-fade 0.18s ease-out;
  }
}

@keyframes header-profile-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.user-profile__avatar {
  display: block;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(22, 27, 34, 0.9);
}

.user-profile__logout {
  margin: 0;
  padding: 0.38rem 0.72rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.user-profile__logout:hover {
  background: rgba(255, 255, 255, 0.085);
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.12);
}

.user-profile__logout:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 2px;
}

.app-header__link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.app-header__link:hover {
  color: var(--mint-400);
  border-bottom-color: color-mix(in srgb, var(--mint-400) 40%, transparent);
}

.app-header__link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.hero {
  position: relative;
  isolation: isolate;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 38rem;
  margin-inline: auto;
  text-align: center;
}

/* Mint spotlight from above — pairs with header glow; stays non-interactive */
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: clamp(-200px, -28vw, -100px);
  z-index: -1;
  width: min(36rem, 94vw);
  height: clamp(260px, 42vw, 400px);
  translate: -50% 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 100% 52% at 50% 0%,
    rgb(52 211 153 / 0.12) 0%,
    rgb(52 211 153 / 0.045) 42%,
    transparent 70%
  );
  filter: blur(32px);
}

.hero__title {
  margin: 0 0 0.65rem;
  font-size: clamp(
    calc(1.35rem + 10px),
    calc(4.2vw + 10px),
    calc(1.85rem + 10px)
  );
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-primary);
}

.hero__lead {
  margin: 0;
  font-size: 1rem;
  font-weight: 450;
  line-height: 1.55;
  color: var(--text-secondary);
}

.local-processing-badge {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 2500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.4rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  background: var(--surface-glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  pointer-events: none;
  user-select: none;
}

@supports not (backdrop-filter: blur(1px)) {
  .local-processing-badge {
    background: var(--surface-glass-strong);
  }
}

.local-processing-badge__icon {
  font-size: 0.85em;
  line-height: 1;
}

.fixed-badges-tray {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 2500;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  max-width: min(calc(100vw - 2rem), 22rem);
  flex-wrap: wrap;
}

.fixed-badges-tray .local-processing-badge {
  position: static;
  bottom: auto;
  right: auto;
}

.badge-pro-lifetime {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.4rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mint-400);
  background: color-mix(in srgb, var(--mint-400) 14%, rgba(22, 27, 34, 0.92));
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid color-mix(in srgb, var(--mint-400) 38%, transparent);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  pointer-events: none;
  user-select: none;
}

.toolbar__btn.landing-pricing__cta--premium.landing-pricing__cta--disabled,
.toolbar__btn.landing-pricing__cta--premium.landing-pricing__cta--disabled:hover {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
  box-shadow: none;
}

.toolbar__btn.landing-pricing__cta--premium.landing-pricing__cta--disabled:focus-visible {
  outline: none;
}

@media (max-width: 480px) {
  .fixed-badges-tray {
    bottom: 0.65rem;
    right: 0.65rem;
  }

  .badge-pro-lifetime {
    font-size: 0.68rem;
    padding: 0.35rem 0.55rem;
  }

  .local-processing-badge {
    bottom: 0.65rem;
    right: 0.65rem;
    max-width: min(calc(100vw - 2rem), 14rem);
    font-size: 0.68rem;
  }
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 3rem) 0;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  min-height: 0;
}

.app-main--workspace {
  justify-content: flex-start;
  padding-top: clamp(0.65rem, 2vw, 1.35rem);
  padding-bottom: clamp(1rem, 3vw, 2rem);
  gap: clamp(0.65rem, 2vw, 1.25rem);
  min-height: 0;
}

.dropzone-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.dropzone-section.dropzone-section--reenter {
  animation: dropzone-section-reenter 0.28s ease-out;
}

@keyframes dropzone-section-reenter {
  from {
    opacity: 0.65;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dropzone-section.dropzone-section--reenter {
    animation: none;
  }
}

.dropzone {
  --drop-r: var(--radius-lg);
  position: relative;
  width: min(100%, 560px);
  cursor: pointer;
  border-radius: var(--drop-r);
  padding: clamp(2.5rem, 6vw, 3.75rem) clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  background: rgba(16, 19, 28, 0.65);
  border: 1px dashed rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.dropzone.dropzone--dismissed {
  display: none !important;
}

.dropzone.is-dragover,
.dropzone.is-loading,
.dropzone:hover {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--mint-400) 45%, transparent);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 32px color-mix(in srgb, var(--mint-glow) 55%, transparent);
}

.dropzone:focus {
  outline: none;
}

.dropzone:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 3px;
}

.dropzone__content {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.dropzone__title {
  margin: 0 0 0.35rem;
  font-size: calc(1.15rem + 10px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dropzone__hint {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

.dropzone__demo-link {
  display: inline-block;
  margin: 0.65rem 0 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--mint-400) 82%, var(--text-secondary));
  cursor: pointer;
  pointer-events: auto;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--mint-500) 35%, transparent);
  text-underline-offset: 3px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease,
    text-shadow 0.18s ease;
}

.dropzone__demo-link:hover {
  color: var(--mint-400);
  text-decoration-color: color-mix(in srgb, var(--mint-400) 65%, transparent);
  text-shadow: 0 0 20px color-mix(in srgb, var(--mint-glow) 50%, transparent);
}

.dropzone__demo-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 75%, transparent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.dropzone::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--angle),
    transparent 70%,
    var(--mint-500) 90%,
    #ffffff 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
}

.dropzone.is-dragover::before,
.dropzone.is-loading::before,
.dropzone:hover::before {
  opacity: 1;
  animation: dropzone-snake 2.6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .dropzone::before {
    animation: none;
    opacity: 0;
  }

  .dropzone.is-dragover::before,
  .dropzone.is-loading::before,
  .dropzone:hover::before {
    opacity: 0.85;
    --angle: 42deg;
  }
}

@keyframes dropzone-snake {
  to {
    --angle: 360deg;
  }
}

.dropzone-error {
  margin: 0.75rem 0 0;
  min-height: 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  color: #fca5a5;
}

.dropzone-error[hidden] {
  display: none !important;
}

.dropzone-trust {
  margin: 0.55rem 0 0;
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  max-width: min(100%, 560px);
  margin-inline: auto;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-secondary);
}

.dropzone-trust__icon {
  font-size: 0.95em;
  line-height: 1;
  flex-shrink: 0;
}

.doc-loaded .dropzone-trust,
body:has(#workspace:not([hidden])) .dropzone-trust {
  display: none;
}

.workspace {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 1rem 0.95rem;
  border-radius: var(--radius-lg);
  min-width: 0;
  max-height: min(85vh, 980px);
  min-height: 0;
}

.workspace__chrome {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  margin-bottom: 0.2rem;
  padding: 0.2rem 0.35rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(10, 13, 20, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

#workspace:not([hidden]) {
  flex: 1 1 auto;
  min-height: 0;
}

.workspace[hidden] {
  display: none !important;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.6rem;
  padding: 0.15rem 0 0.55rem;
  min-width: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.toolbar__download-cluster {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.28rem;
  max-width: min(100%, 15rem);
  flex-shrink: 0;
}

.toolbar__export-note {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.35;
  padding: 0 0.2rem;
}

.toolbar__spacer {
  flex: 1 1 1.5rem;
  min-width: 0.5rem;
}

.toolbar__label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}

.toolbar__filename {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(42vw, 320px);
}

.toolbar__btn {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease,
    opacity 0.15s ease;
}

.toolbar__btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
}

.toolbar__btn--replace {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toolbar__btn--replace:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.14);
}

.toolbar__btn.btn-secondary-muted,
#clear-doc-btn {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.72rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.toolbar__btn.btn-secondary-muted:hover:not(:disabled),
#clear-doc-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.085);
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.12);
}

.toolbar__btn.btn-secondary-muted:focus-visible,
#clear-doc-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 2px;
}

.toolbar__btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 2px;
}

.toolbar__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.toolbar__btn--primary {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--mint-gradient);
  color: #04120c;
  box-shadow: 0 4px 20px var(--mint-glow);
}

.toolbar__btn--primary:hover:not(:disabled) {
  background: var(--mint-gradient-hover);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 5px 26px var(--mint-glow-hover);
}

.toolbar__btn--demo-pulse:not(:disabled) {
  animation: demo-export-pulse 2.4s ease-in-out infinite;
}

@keyframes demo-export-pulse {
  0%,
  100% {
    box-shadow: 0 4px 20px var(--mint-glow);
  }
  50% {
    box-shadow:
      0 5px 28px var(--mint-glow-hover),
      0 0 0 1px rgb(52 211 153 / 0.22);
  }
}

@keyframes stamp-demo-entrance {
  from {
    opacity: 0;
    transform: rotate(var(--stamp-rot)) translateY(14px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: rotate(var(--stamp-rot)) translateY(0) scale(1);
  }
}

.demo-post-cta {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(22, 27, 34, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.32);
}

.demo-post-cta[hidden] {
  display: none !important;
}

.demo-post-cta__text {
  margin: 0;
  flex: 1 1 12rem;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.demo-post-cta__btn {
  flex-shrink: 0;
}

.workspace-status {
  margin: 0;
  min-height: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: #fca5a5;
}

.workspace-status[hidden] {
  display: none !important;
}

.preview {
  position: relative;
  z-index: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: var(--radius-md);
  background: rgba(7, 9, 14, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.5rem;
  min-width: 0;
}

.preview__stage {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  min-height: 240px;
  max-height: 100%;
  width: 100%;
  min-width: 0;
  padding-bottom: 2.35rem;
  overflow: visible;
}

.preview__canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

body.doc-loaded .preview__canvas-wrap,
.app-shell:has(#workspace:not([hidden])) .preview__canvas-wrap {
  width: 100% !important;
  max-width: var(--preview-max-width-desktop) !important;
  flex: 0 0 auto !important;
}

body.doc-loaded #workspace,
.app-shell:has(#workspace:not([hidden])) #workspace {
  width: 100% !important;
  max-width: var(--preview-max-width-desktop) !important;
  max-height: 85vh !important;
  box-sizing: border-box;
}

.preview__page-frame {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
  min-width: 0;
  overflow: visible;
}

.preview__canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: calc(var(--radius-sm) - 2px);
  box-shadow: var(--preview-canvas-elevated-shadow);
}

.preview__stamp-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: calc(var(--radius-sm) - 2px);
  overflow: visible;
}

.pdf-pager {
  position: absolute;
  left: 50%;
  bottom: 0.4rem;
  z-index: 3;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.45rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  background: rgba(10, 14, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  transform: translateX(-50%);
  max-width: calc(100% - 1rem);
}

.pdf-pager[hidden] {
  display: none !important;
}

.pdf-pager__label {
  min-width: 5.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pdf-pager__btn {
  font-family: inherit;
  display: inline-grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 999px;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pdf-pager__btn:hover:not(:disabled) {
  background: rgb(52 211 153 / 0.12);
  color: var(--mint-400);
}

.pdf-pager__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pdf-pager__btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 70%, transparent);
  outline-offset: 2px;
}

.pdf-pager__sync {
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.65rem;
  padding: 0.2rem 0.55rem;
  margin: 0;
  border: none;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.pdf-pager__sync-text {
  line-height: 1.2;
}

.pdf-pager__sync:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.09);
}

.pdf-pager__sync.is-active {
  color: var(--mint-400);
  background: rgb(52 211 153 / 0.14);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--mint-400) 38%, transparent), 0 0 20px var(--mint-glow);
}

.pdf-pager__sync:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 70%, transparent);
  outline-offset: 2px;
}

.pdf-pager__sync[hidden] {
  display: none !important;
}

.doc-toast {
  position: fixed;
  bottom: 1.35rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3500;
  max-width: min(90vw, 22rem);
  padding: 0.45rem 0.95rem;
  font-size: 0.79rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  text-align: center;
  background: rgba(12, 16, 24, 0.94);
  border: 1px solid color-mix(in srgb, var(--mint-400) 32%, transparent);
  border-radius: 999px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45), 0 0 36px var(--mint-glow);
  pointer-events: none;
}

.doc-toast[hidden] {
  display: none !important;
}

/* ——— App toasts (upload / validation) ——— */
.toast-container {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: min(calc(100vw - 2rem), 26rem);
  pointer-events: none;
}

.toast {
  width: 100%;
  margin: 0;
  padding: 0.85rem 1.1rem;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-primary);
  text-align: center;
  border-radius: var(--radius-md);
  background: rgba(20, 20, 25, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.42);
  opacity: 0;
  transform: translateY(-1.125rem);
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--error {
  border-color: color-mix(in srgb, #ff6b6b 52%, var(--border-subtle));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.42),
    0 0 28px rgb(255 107 107 / 0.14);
}

.toast--success {
  border-color: color-mix(in srgb, var(--mint-500) 48%, var(--border-subtle));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.42),
    0 0 28px var(--mint-glow);
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition-duration: 0.12s;
  }
}

/* ——— Cookie consent ——— */
.cookie-banner {
  position: fixed;
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  left: max(1rem, env(safe-area-inset-left, 0px));
  z-index: 9450;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  max-width: min(18rem, calc(100vw - 2rem));
  padding: 1rem 1.15rem;
  margin: 0;
  border-radius: var(--radius-md);
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(0.85rem);
  transition: opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner--visible {
  opacity: 1;
  transform: translateY(0);
}

.cookie-banner--dismissing {
  opacity: 0;
  transform: translateY(0.65rem);
  transition-duration: 0.32s;
}

.cookie-banner__text {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 450;
  line-height: 1.55;
  color: var(--text-secondary);
}

.cookie-banner__btn {
  align-self: flex-start;
  margin: 0;
  padding: 0.45rem 0.95rem;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  color: rgba(255, 255, 255, 0.96);
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--mint-400) 52%, transparent);
  background: color-mix(in srgb, var(--mint-500) 18%, transparent);
  box-shadow: 0 0 28px rgb(52 211 153 / 0.18);
  transition: border-color 0.15s ease, background-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.15s ease;
}

.cookie-banner__btn:hover {
  border-color: color-mix(in srgb, var(--mint-400) 68%, transparent);
  background: color-mix(in srgb, var(--mint-500) 28%, transparent);
  box-shadow: 0 0 32px var(--mint-glow);
}

.cookie-banner__btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 2px;
}

.cookie-banner__btn:active:not(:disabled) {
  transform: scale(0.98);
}

@supports not (backdrop-filter: blur(1px)) {
  .cookie-banner {
    background: var(--surface-glass-strong);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner {
    transition-duration: 0.14s;
  }

  .cookie-banner--dismissing {
    transition-duration: 0.12s;
  }
}

.global-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgb(6 10 14 / 0.58);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.global-drop-overlay[hidden] {
  display: none !important;
}

.global-drop-overlay__panel {
  max-width: min(90vw, 420px);
  padding: 1.35rem 1.75rem;
  text-align: center;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--mint-400) 42%, transparent);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 56px var(--mint-glow);
}

.global-drop-overlay__text {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.stamp {
  position: absolute;
  transform: rotate(var(--stamp-rot, 0deg));
  transform-origin: center center;
  cursor: grab;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.stamp.stamp--demo-reveal {
  animation: stamp-demo-entrance 0.62s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.stamp__delete[hidden] {
  display: none !important;
}

.stamp__delete {
  position: absolute;
  top: -14px;
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--text-secondary);
  background: rgba(18, 24, 36, 0.92);
  box-shadow: 0 0 0 1px var(--border-subtle);
  cursor: pointer;
  pointer-events: auto;
}

.stamp__delete:hover {
  color: #fecaca;
  background: rgba(50, 20, 22, 0.95);
}

.stamp__delete:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 75%, transparent);
  outline-offset: 2px;
}

.stamp__frame {
  position: relative;
  display: inline-block;
  line-height: 0;
  box-shadow:
    0 0 0 1px #ffffff,
    0 0 0 2px #111111;
  border-radius: 2px;
}

.stamp__handle {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #111111;
  box-sizing: border-box;
  z-index: 4;
  pointer-events: auto;
  touch-action: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.stamp__handle--tl {
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
}

.stamp__handle--tr {
  right: 0;
  top: 0;
  transform: translate(50%, -50%);
}

.stamp__handle--bl {
  left: 0;
  bottom: 0;
  transform: translate(-50%, 50%);
}

.stamp__handle--br {
  right: 0;
  bottom: 0;
  transform: translate(50%, 50%);
}

.stamp__img {
  display: block;
  width: calc(var(--stamp-base-w, 140px) * var(--stamp-scale, 1));
  max-width: 90vw;
  height: auto;
  vertical-align: middle;
  filter: url(#ink-bleed);
  opacity: 0.92;
}

.stamp.is-dragging {
  cursor: grabbing;
}

.stamp.is-dragging .stamp__img {
  filter: url(#ink-bleed) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4));
  opacity: 0.98;
}

@media (prefers-reduced-motion: reduce) {
  .stamp__img {
    filter: blur(0.35px);
    opacity: 0.88;
  }

  .stamp.is-dragging .stamp__img {
    filter: blur(0.35px);
  }

  .stamp.stamp--demo-reveal {
    animation: none;
  }

  .toolbar__btn--demo-pulse:not(:disabled) {
    animation: none;
  }
}

.signature-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.signature-modal[hidden] {
  display: none !important;
}

.signature-modal__panel {
  position: relative;
  width: min(100%, 400px);
  padding: 1.35rem 1.5rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.signature-modal__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.signature-modal__hint {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.signature-modal__pad {
  display: block;
  width: 320px;
  max-width: 100%;
  height: 160px;
  margin: 0 auto 1rem;
  touch-action: none;
  cursor: crosshair;
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 7px,
      rgba(255, 255, 255, 0.04) 7px,
      rgba(255, 255, 255, 0.04) 8px
    ),
    rgba(12, 16, 24, 0.95);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
}

.signature-modal__pad:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 70%, transparent);
  outline-offset: 2px;
}

.signature-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
}

.signature-modal__apply-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  flex-basis: 100%;
  width: 100%;
}

.signature-modal__save-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.signature-modal__save-label--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.signature-modal__save-label input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--mint-400);
  cursor: inherit;
}

.saved-signatures-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.saved-signatures__title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.saved-signatures__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.saved-signatures__grid--locked {
  pointer-events: none;
  opacity: 0.42;
  filter: grayscale(0.35);
}

.saved-signatures-promo {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0;
}

.signature-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 2 / 1;
  padding: 0.35rem;
  margin: 0;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 16, 24, 0.85);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.signature-slot:hover {
  border-color: color-mix(in srgb, var(--mint-400) 45%, transparent);
  background: rgba(16, 22, 32, 0.92);
}

.signature-slot:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 2px;
}

.signature-slot img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.signature-modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.signature-modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.signature-modal__close:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 2px;
}

/* ——— Landing below tool ——— */
.landing-below-tool {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 8vw, 120px);
  padding: clamp(0.5rem, 2vw, 1rem) 0
    clamp(1.25rem, 4vw, 2.5rem);
  width: 100%;
}

/* ——— Section reveal (IntersectionObserver in section-reveal.js) ——— */
.section-reveal {
  opacity: 0;
  transform: translate3d(0, 1.75rem, 0);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .section-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (scripting: none) {
  .section-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.landing-flow {
  margin: 0;
}

.landing-flow__title {
  margin: 0 0 clamp(1rem, 3vw, 1.35rem);
  font-size: clamp(
    calc(1.15rem + 10px),
    calc(2.8vw + 10px),
    calc(1.45rem + 10px)
  );
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-align: center;
}

.landing-flow__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.85rem, 2.5vw, 1.1rem);
}

@media (min-width: 640px) {
  .landing-flow__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(0.75rem, 2vw, 1rem);
  }
}

.landing-flow__card {
  margin: 0;
  border-radius: var(--radius-md);
  padding: clamp(1rem, 2.5vw, 1.25rem) clamp(1rem, 2.8vw, 1.35rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.4rem;
  min-height: 0;
}

.landing-flow__icon {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 0.15rem;
  color: var(--mint-400);
}

.landing-flow__svg {
  width: 1.42rem;
  height: 1.42rem;
  flex-shrink: 0;
}

.landing-flow__step {
  margin: 0;
  font-size: calc(1rem + 10px);
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.landing-flow__tag {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--mint-400);
  line-height: 1.35;
}

.landing-flow__desc {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ——— Landing: comparison table ——— */
.landing-compare {
  margin: 0;
}

.landing-compare__title {
  margin: 0 0 clamp(1rem, 3vw, 1.35rem);
  font-size: clamp(
    calc(1.15rem + 10px),
    calc(2.8vw + 10px),
    calc(1.45rem + 10px)
  );
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-align: center;
}

.landing-compare__shell {
  margin: 0;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--surface-glass);
  overflow: hidden;
}

.landing-compare__scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.landing-compare__scroll:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 2px;
}

.landing-compare__table {
  width: 100%;
  min-width: min(100%, 520px);
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.4;
}

.landing-compare__table th,
.landing-compare__table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.landing-compare__table th:last-child,
.landing-compare__table td:last-child {
  border-right: none;
}

.landing-compare__table tbody tr:last-child th,
.landing-compare__table tbody tr:last-child td {
  border-bottom: none;
}

.landing-compare__table thead th {
  font-weight: 650;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface-glass-strong) 88%, transparent);
}

.landing-compare__th-feature {
  width: 28%;
}

.landing-compare__feature {
  font-weight: 600;
  color: var(--text-primary);
  background: color-mix(
    in srgb,
    var(--surface-glass-strong) 55%,
    transparent
  );
}

.landing-compare__col-winner {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--mint-500) 9%, var(--surface-glass));
  box-shadow: inset 1px 0 0 0 color-mix(in srgb, var(--mint-400) 42%, transparent),
    -6px 0 28px -12px var(--mint-glow);
}

.landing-compare__cell--winner {
  font-weight: 500;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--mint-500) 7%, transparent);
  box-shadow: inset 1px 0 0 0 color-mix(in srgb, var(--mint-400) 38%, transparent),
    -4px 0 22px -10px var(--mint-glow);
}

@media (max-width: 639px) {
  .landing-compare__table {
    min-width: 0;
  }

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

  .landing-compare__table tbody tr {
    display: block;
    margin-bottom: clamp(0.65rem, 2vw, 0.85rem);
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--surface-glass-strong) 40%, transparent);
  }

  .landing-compare__table tbody tr:last-child {
    margin-bottom: 0;
  }

  .landing-compare__table tbody th[scope="row"],
  .landing-compare__table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.65rem;
    padding: 0.4rem 0;
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: none;
    background: transparent;
  }

  .landing-compare__table tbody th[scope="row"] {
    display: block;
    padding-top: 0;
    padding-bottom: 0.55rem;
    margin-bottom: 0.35rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-strong);
  }

  .landing-compare__table tbody td:last-of-type {
    border-bottom: none;
    padding-bottom: 0.15rem;
  }

  .landing-compare__table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: calc(0.72rem + 5px);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    flex-shrink: 0;
  }

  .landing-compare__table tbody td.landing-compare__cell--winner {
    margin-top: 0.15rem;
    padding: 0.55rem 0.6rem;
    border: 1px solid color-mix(in srgb, var(--mint-400) 35%, transparent);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--mint-500) 9%, transparent);
    box-shadow: 0 0 24px -14px var(--mint-glow);
  }

  .landing-compare__table tbody td.landing-compare__cell--winner::before {
    color: var(--mint-400);
  }

  .landing-compare__table tbody td:not(.landing-compare__cell--winner) {
    font-size: 1rem;
  }
}

/* ——— Landing: pricing ——— */
.landing-pricing {
  margin: 0;
  padding: 0 0 clamp(0.35rem, 1.5vw, 0.85rem);
}

.landing-pricing__heading {
  margin: 0 0 clamp(1.15rem, 3.5vw, 1.75rem);
  font-size: clamp(
    calc(1.15rem + 10px),
    calc(2.8vw + 10px),
    calc(1.45rem + 10px)
  );
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.2;
}

.landing-pricing__grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: clamp(1.1rem, 3vw, 1.5rem);
  width: 100%;
  max-width: 52rem;
  margin: 0 auto;
}

@media (min-width: 800px) {
  .landing-pricing__grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.35rem;
  }
}

.landing-pricing__plan {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(1.5rem, 3.5vw, 2rem) clamp(1.2rem, 3vw, 1.65rem);
  border-radius: var(--radius-lg);
  min-height: 0;
}

.landing-pricing__plan--free {
  height: 100%;
  background: color-mix(in srgb, var(--surface-glass) 55%, transparent);
  border: 1px solid var(--border-subtle);
  box-shadow: none;
}

.landing-pricing__premium-wrap {
  position: relative;
  display: flex;
  min-height: 100%;
  padding: clamp(0.55rem, 2vw, 0.85rem);
  margin: calc(-1 * clamp(0.55rem, 2vw, 0.85rem));
}

.landing-pricing__premium-wrap .landing-pricing__glow {
  position: absolute;
  inset: 2% -2% 8% -2%;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(
    ellipse 72% 58% at 50% 42%,
    var(--mint-glow) 0%,
    transparent 70%
  );
  opacity: 0.38;
  filter: blur(40px);
  transform: translateZ(0);
}

.landing-pricing__plan--lifetime {
  position: relative;
  z-index: 1;
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--mint-400) 22%, transparent);
  box-shadow: 0 0 40px -16px var(--mint-glow);
  background: var(--surface-glass);
}

.landing-pricing__plan-title {
  margin: 0 0 clamp(0.85rem, 2vw, 1.1rem);
  font-size: clamp(
    calc(1.05rem + 10px),
    calc(2.4vw + 10px),
    calc(1.25rem + 10px)
  );
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.landing-pricing__price-block {
  margin: 0 0 clamp(1.1rem, 3vw, 1.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.landing-pricing__price {
  margin: 0;
  line-height: 1;
}

.landing-pricing__amount {
  font-size: clamp(
    calc(2.1rem + 10px),
    calc(6vw + 10px),
    calc(2.65rem + 10px)
  );
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.landing-pricing__sub {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 22ch;
  line-height: 1.45;
}

.landing-pricing__features {
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
  max-width: 22.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
  flex: 1 1 auto;
}

.landing-pricing__feature {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.landing-pricing__features--muted .landing-pricing__feature {
  color: var(--text-muted);
}

.landing-pricing__check {
  flex-shrink: 0;
  width: 1.15rem;
  margin-top: 0.08rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--mint-400);
}

.landing-pricing__features--muted .landing-pricing__check {
  color: var(--text-muted);
}

a.landing-pricing__cta {
  text-decoration: none;
  box-sizing: border-box;
}

a.landing-pricing__cta--premium:visited {
  color: #04120c;
}

a.landing-pricing__cta--outline:visited {
  color: var(--text-primary);
}

.landing-pricing__cta {
  margin-top: clamp(1.35rem, 3.5vw, 1.75rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 19rem;
  min-height: 2.65rem;
  font-size: 1rem;
}

.toolbar__btn.landing-pricing__cta--outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}

.toolbar__btn.landing-pricing__cta--outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  border-color: color-mix(in srgb, var(--mint-400) 35%, var(--border-strong));
  color: var(--text-primary);
  box-shadow: none;
}

.toolbar__btn.landing-pricing__cta--outline:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 2px;
}

/* ——— Landing: FAQ ——— */
.landing-faq {
  margin: 0;
  padding: 0;
  width: 100%;
}

.landing-faq__title {
  margin: 0 0 clamp(0.85rem, 2.5vw, 1.2rem);
  font-size: clamp(
    calc(1.05rem + 10px),
    calc(2.6vw + 10px),
    calc(1.3rem + 10px)
  );
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.25;
}

.landing-faq__panel {
  margin: 0;
  width: 100%;
  max-width: none;
  border-radius: var(--radius-md);
  padding: 0.15rem clamp(0.65rem, 2.2vw, 1.15rem);
  background: var(--surface-glass);
}

.landing-faq__item {
  border-bottom: 1px solid var(--border-subtle);
}

.landing-faq__item:last-child {
  border-bottom: none;
}

.landing-faq__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.82rem 0.15rem 0.82rem 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.landing-faq__question-text {
  flex: 1;
  text-align: left;
  min-width: 0;
}

.landing-faq__toggle-icon {
  position: relative;
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.landing-faq__toggle-icon::before,
.landing-faq__toggle-icon::after {
  content: "";
  position: absolute;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: transform 0.32s ease, opacity 0.28s ease;
}

.landing-faq__toggle-icon::before {
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  transform: translateY(-50%);
}

.landing-faq__toggle-icon::after {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
}

.landing-faq__item[open] .landing-faq__toggle-icon::after {
  transform: translateX(-50%) scaleY(0);
  opacity: 0;
}

.landing-faq__summary::-webkit-details-marker {
  display: none;
}

.landing-faq__summary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.landing-faq__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease;
}

.landing-faq__item[open] .landing-faq__body {
  grid-template-rows: 1fr;
}

.landing-faq__answer {
  overflow: hidden;
  min-height: 0;
  padding: 0 0.25rem 0.95rem 0.25rem;
}

.landing-faq__answer p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .landing-faq__body {
    transition-duration: 0.01ms;
  }

  .landing-faq__toggle-icon::before,
  .landing-faq__toggle-icon::after {
    transition-duration: 0.01ms;
  }
}

.app-footer {
  margin-top: auto;
  padding-top: clamp(1.35rem, 4vw, 2.25rem);
  padding-bottom: 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.app-footer__founder {
  margin: 0;
  max-width: 40rem;
  padding: 0;
  border: none;
  background: none;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  color: var(--text-muted);
}

.app-footer__block--product {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}

.app-footer__copyright {
  margin: 0;
}

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

.app-footer__line--tablexport {
  max-width: min(100%, 34rem);
  line-height: 1.5;
}

.app-footer__product-desc {
  font-size: 13px;
  font-weight: 450;
  color: var(--text-muted);
}

.app-footer__link {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.app-footer__link:hover {
  color: var(--mint-400);
  border-bottom-color: color-mix(in srgb, var(--mint-400) 40%, transparent);
}

.app-footer__link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 3px;
  border-radius: 2px;
}

.app-footer__link--mint {
  color: var(--mint-400);
  border-bottom-color: transparent;
}

.app-footer__link--mint:hover {
  color: var(--mint-500);
  border-bottom-color: color-mix(in srgb, var(--mint-400) 50%, transparent);
}

.app-footer__bug {
  margin: 0;
  text-align: center;
}

.app-footer__bug-link {
  font-size: 13px;
  font-weight: 500;
  color: color-mix(in srgb, var(--mint-400) 88%, var(--text-secondary) 12%);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--mint-400) 38%, transparent);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.app-footer__bug-link:hover {
  color: var(--mint-400);
  border-bottom-color: color-mix(in srgb, var(--mint-400) 58%, transparent);
}

.app-footer__bug-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 3px;
  border-radius: 2px;
}

.app-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  max-width: 36rem;
}

.app-footer__legal-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.app-footer__legal-link:hover {
  color: var(--text-secondary);
  border-bottom-color: color-mix(in srgb, var(--text-secondary) 35%, transparent);
}

.app-footer__legal-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Legal pages (privacy, terms, refund) */
.legal-content {
  flex: 1;
  width: 100%;
  max-width: 800px;
  margin-inline: auto;
  padding: 4rem 2rem;
}

.legal-content__back {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--mint-400);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.legal-content__back:hover {
  color: var(--mint-500);
  border-bottom-color: color-mix(in srgb, var(--mint-400) 45%, transparent);
}

.legal-content__back:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.legal-content h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.65rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.legal-content__updated {
  margin: 0 0 2.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.legal-content h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.legal-content p {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.legal-content p:last-child {
  margin-bottom: 0;
}

.legal-content a:not(.legal-content__back) {
  color: var(--mint-400);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.legal-content a:not(.legal-content__back):hover {
  color: var(--mint-500);
  border-bottom-color: color-mix(in srgb, var(--mint-400) 45%, transparent);
}

.legal-content a:not(.legal-content__back):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint-400) 85%, transparent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ——— Header User Profile ——— */
.user-profile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border-subtle);
}

.user-profile__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-profile__logout {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}

.user-profile__logout:hover {
  color: #fca5a5; /* Мягкий красный при наведении */
}

/* На мобилках сделаем отступ чуть меньше */
@media (max-width: 480px) {
  .user-profile {
    gap: 0.5rem;
  }
}

/* ——— Pro Badge ——— */
.badge-pro-lifetime {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: linear-gradient(135deg, #2e1065 0%, #1e1b4b 100%);
  border: 1px solid #7c3aed;
  border-radius: 100px;
  color: #c084fc;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.25);
  animation: proGlow 3s ease-in-out infinite alternate;
}

.badge-pro-lifetime::before {
  content: "💎";
  font-size: 0.85rem;
}

@keyframes proGlow {
  0% { box-shadow: 0 0 8px rgba(124, 58, 237, 0.2); }
  100% { box-shadow: 0 0 16px rgba(124, 58, 237, 0.45); }
}

/* ——— Premium Paywall Modal ——— */
.paywall-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 12, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.paywall-overlay--active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.paywall-card {
  background: #16161a;
  border: 1px solid #2a2a32;
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.paywall-overlay--active .paywall-card {
  transform: translateY(0);
}

.paywall-card__icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: inline-block;
  animation: pulseGem 2s infinite alternate;
}

.paywall-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
  font-family: var(--font);
}

.paywall-card__text {
  font-size: 0.95rem;
  color: #9a9a86;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.paywall-card__features {
  text-align: left;
  background: #1c1c22;
  border: 1px solid #2e2e38;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  list-style: none;
}

.paywall-card__feature-item {
  font-size: 0.9rem;
  color: #e2e2e9;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.paywall-card__feature-item:last-child {
  margin-bottom: 0;
}

.paywall-card__cta {
  width: 100%;
  margin: 0;
  justify-content: center;
  box-sizing: border-box;
}

.paywall-card__btn-close {
  background: none;
  border: none;
  color: #62626a;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 1.25rem;
  transition: color 0.15s ease;
  text-decoration: underline;
}

.paywall-card__btn-close:hover {
  color: #9a9a86;
}

/* Метка оставшихся лимитов возле кнопки скачивания */
.export-limit-notice {
  font-size: 0.8rem;
  color: #62626a;
  margin-top: 0.5rem;
  text-align: center;
  display: block;
}

@keyframes pulseGem {
  0% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(124,58,237,0.3)); }
  100% { transform: scale(1.1); filter: drop-shadow(0 0 15px rgba(124,58,237,0.7)); }
}

/* ——— Saved Signatures Panel ——— */
.saved-signatures-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #2a2a32;
  text-align: left;
}

.saved-signatures__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #9a9a86;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.saved-signatures__grid {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  position: relative;
}

.signature-slot {
  width: 100px;
  height: 60px;
  background: #1c1c22;
  border: 1px solid #2e2e38;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
  transition: all 0.2s ease;
  position: relative;
}

.signature-slot:hover {
  border-color: #7c3aed;
  background: #22222a;
  transform: translateY(-2px);
}

.signature-slot img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: invert(1); /* Если подпись черная на прозрачном, инвертируем для темной темы */
}

/* Состояние блокировки для бесплатных юзеров */
.saved-signatures__grid--locked .signature-slot {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.saved-signatures-promo {
  font-size: 0.8rem;
  color: #62626a;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
}