:root {
  color-scheme: light;
  --app-height: 100vh;
  --bg: #f3f1eb;
  --bg-alt: #ebe7df;
  --panel: rgba(255, 252, 247, 0.88);
  --panel-strong: rgba(250, 247, 241, 0.96);
  --text: #1d222b;
  --muted: #64707d;
  --line: rgba(30, 38, 52, 0.12);
  --accent: #2a7fff;
  --accent-strong: #0f1722;
  --accent-glow: rgba(42, 127, 255, 0.18);
  --accent-warm: #b78b35;
  --danger: #d45454;
  --success: #2f8d66;
  --shadow: 0 24px 60px rgba(38, 42, 50, 0.12);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: var(--app-height);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(42, 127, 255, 0.14), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(183, 139, 53, 0.12), transparent 22%),
    linear-gradient(160deg, #f7f4ee 0%, #f0ece4 46%, #e8e3da 100%);
}

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 20px 24px;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.top-nav-primary,
.top-nav-account,
.top-nav-account-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.top-nav-account {
  justify-content: flex-end;
}

.generation-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  width: min(320px, calc(100vw - 24px));
}

.generation-widget-card {
  padding: 14px 14px 12px;
  border: 1px solid rgba(30, 38, 52, 0.1);
  border-radius: 18px;
  background: rgba(250, 247, 241, 0.96);
  box-shadow: 0 18px 40px rgba(28, 34, 43, 0.16);
  backdrop-filter: blur(16px);
}

.generation-widget-header,
.generation-widget-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.generation-widget-copy {
  margin: 8px 0 10px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.generation-widget-progress {
  overflow: hidden;
  height: 8px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(30, 38, 52, 0.08);
}

.generation-widget-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(42, 127, 255, 0.82), rgba(183, 139, 53, 0.76));
}

.generation-widget-close {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.admin-page {
  max-width: 1440px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
}

.admin-sidebar,
.admin-main {
  min-width: 0;
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav-link {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--accent-strong);
  background: rgba(20, 29, 43, 0.04);
  font-weight: 600;
}

.admin-nav-link[data-active="true"] {
  background: rgba(42, 127, 255, 0.12);
  color: var(--accent);
}

.admin-stack {
  display: grid;
  gap: 18px;
}

.nav-user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(20, 29, 43, 0.05);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero {
  margin-bottom: 34px;
}

.flow-step-header,
.panel-section-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.flow-step-header-compact {
  margin-top: 6px;
}

.flow-step-eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: none;
}

.flow-step-header h2,
.panel-section-heading h2 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 1.35rem;
  line-height: 1.1;
}

.flow-step-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.hero-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(30, 38, 52, 0.08);
  background: rgba(255, 252, 247, 0.76);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: none;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 650;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 4vw, 4.4rem);
  line-height: 0.92;
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-weight: 700;
  letter-spacing: -0.06em;
  color: var(--accent-strong);
}

.intro {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--accent-strong);
  font-size: 1.12rem;
  line-height: 1.45;
  font-weight: 600;
}

.intro-detail {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 500;
}

.pricing-note {
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.help-tip {
  position: relative;
}

.help-tip summary {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(30, 38, 52, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.help-tip summary::-webkit-details-marker {
  display: none;
}

.help-tip[open] summary {
  background: rgba(42, 127, 255, 0.1);
  border-color: rgba(42, 127, 255, 0.28);
}

.help-tip-card {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 12;
  width: min(320px, calc(100vw - 48px));
  padding: 14px 16px;
  border: 1px solid rgba(30, 38, 52, 0.12);
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.98);
  box-shadow: 0 18px 40px rgba(20, 29, 43, 0.16);
}

.help-tip-card-wide {
  width: min(360px, calc(100vw - 48px));
}

.help-tip-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.help-tip-card .pricing-note {
  margin: 0;
}

.help-tip-card p + p,
.help-tip-card ul {
  margin-top: 10px;
}

.purchase-section {
  display: grid;
  gap: 0;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(30, 38, 52, 0.08);
}

.purchase-actions {
  margin-top: 4px;
}

.purchase-clarifier {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.checkout-info-toggle {
  margin-top: 16px;
}

.checkout-info-toggle summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid rgba(30, 38, 52, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--accent-strong);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.checkout-info-toggle summary::-webkit-details-marker {
  display: none;
}

.checkout-info-toggle summary::after {
  content: "+";
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.checkout-info-toggle[open] summary::after {
  content: "-";
}

.checkout-info-toggle .checkout-trust-card {
  margin-top: 10px;
}

.purchase-section-panel {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.purchase-empty-state {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed rgba(30, 38, 52, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.34);
}

.status-panel[data-unlocked="true"] .purchase-empty-state {
  display: none;
}

.status-panel[data-unlocked="false"] #purchase-section {
  display: none;
}

.purchase-empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.purchase-empty-state-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(20, 29, 43, 0.06);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: none;
}

.checkout-choice {
  margin: 0 0 18px;
}

.checkout-choice-compact {
  margin-bottom: 16px;
}

.choice-heading-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-tip-inline summary {
  width: 30px;
  height: 30px;
  font-size: 0.85rem;
}

.checkout-choice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.checkout-choice-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 60px;
  padding: 14px 16px;
  border: 1px solid rgba(30, 38, 52, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 241, 233, 0.98)),
    rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.checkout-interest-card {
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
  cursor: default;
}

.checkout-choice-card:has(input:disabled) {
  opacity: 0.68;
  cursor: not-allowed;
}

.checkout-choice-card:has(input:checked) {
  border-color: rgba(42, 127, 255, 0.45);
  box-shadow:
    0 0 0 4px rgba(42, 127, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.checkout-choice-card input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.checkout-choice-title {
  display: block;
  width: 100%;
  color: var(--accent-strong);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.checkout-choice-copy {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.checkout-choice-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.checkout-choice-note[data-tone="success"] {
  color: #1d6b45;
}

.checkout-choice-note[data-tone="error"] {
  color: #a63b32;
}

.account-prompt-inline {
  margin-top: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.example-presets {
  margin: 6px 0 18px;
}

.field-hints {
  display: grid;
  gap: 8px;
  margin: -2px 0 14px;
}

.field-hint {
  padding: 10px 12px;
  border: 1px solid rgba(30, 38, 52, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.field-hint[data-state="pass"] {
  border-color: rgba(47, 141, 102, 0.22);
  background: rgba(47, 141, 102, 0.08);
  color: var(--success);
}

.field-hint[data-state="fail"] {
  border-color: rgba(212, 84, 84, 0.22);
  background: rgba(212, 84, 84, 0.08);
  color: var(--danger);
}

.example-presets-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.example-presets-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.example-preset-button {
  padding: 9px 13px;
  border: 1px solid rgba(30, 38, 52, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 243, 235, 0.98)),
    rgba(255, 255, 255, 0.78);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.example-preset-button:hover:not(:disabled),
.example-preset-button:focus-visible {
  background:
    linear-gradient(180deg, rgba(236, 245, 255, 0.96), rgba(245, 241, 232, 0.98)),
    rgba(255, 255, 255, 0.85);
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.mobile-accordion {
  margin: 0 0 18px;
}

.mobile-accordion > summary {
  display: none;
}

.mobile-accordion-content {
  display: grid;
  gap: 0;
}

.mode-tab {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(30, 38, 52, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 243, 235, 0.96)),
    rgba(255, 255, 255, 0.62);
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.92rem;
  font-weight: 600;
}

.mode-tab[aria-selected="true"] {
  color: var(--accent);
  border-color: rgba(42, 127, 255, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 0 0 1px rgba(42, 127, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(233, 242, 255, 0.98)),
    rgba(255, 255, 255, 0.8);
}

#word-form[data-mode="basic"] .expert-only {
  display: none;
}

#word-form[data-mode="basic"] .basic-hidden {
  display: none !important;
}

#word-form[data-mode="expert"] .basic-only {
  display: none;
}

.layout-editors {
  display: grid;
  gap: 14px;
  margin: 4px 0 18px;
}

.word-editor-card {
  border-radius: 18px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 242, 236, 0.96)),
    var(--panel-strong);
  border: 1px solid rgba(30, 38, 52, 0.08);
}

.layout-popup {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(8, 12, 18, 0.62);
}

.layout-popup[hidden] {
  display: none;
}

.layout-popup-shell {
  width: min(1180px, calc(100vw - 36px));
  max-height: calc(var(--app-height) - 36px);
  display: flex;
}

.word-editor-card[data-expanded="true"] {
  width: 100%;
  min-height: min(760px, calc(var(--app-height) - 36px));
  max-height: calc(var(--app-height) - 36px);
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 18px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.38);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.word-editor-card[data-expanded="true"] .word-editor-stage {
  flex: 1 1 auto;
  min-height: min(62dvh, 640px) !important;
}

body[data-layout-expanded="true"] {
  overflow: hidden;
}

.word-editor-header,
.layout-width-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.word-editor-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.word-editor-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.editor-inline-help {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.word-editor-stage {
  position: relative;
  min-height: 160px;
  border-radius: 16px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(16, 21, 29, 0.88), rgba(27, 32, 40, 0.96));
  border: 1px solid rgba(12, 18, 27, 0.18);
}

.word-editor-mask {
  position: absolute;
  object-fit: fill;
  opacity: 1;
  filter: drop-shadow(0 7px 18px rgba(0, 0, 0, 0.34));
  pointer-events: none;
  z-index: 1;
}

.word-editor-mask-invalid {
  filter:
    saturate(1.25)
    hue-rotate(-25deg)
    brightness(0.95)
    drop-shadow(0 0 18px rgba(212, 84, 84, 0.42));
}

.word-editor-connectivity-warning {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 14px;
  z-index: 3;
  padding: 8px 10px;
  border: 1px solid rgba(212, 84, 84, 0.28);
  border-radius: 12px;
  background: rgba(35, 16, 18, 0.82);
  color: #ff8f8f;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  pointer-events: none;
}

.word-editor-stage[data-invalid-preview="true"] .word-editor-letter::before {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.word-editor-stage[data-invalid-preview="true"] .word-editor-letter-handle {
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)),
    rgba(13, 18, 26, 0.3);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.word-editor-stage[data-invalid-preview="true"] .word-editor-letter-handle-label,
.word-editor-stage[data-invalid-preview="true"] .word-editor-letter-handle-grip::before,
.word-editor-stage[data-invalid-preview="true"] .word-editor-letter-handle-grip::after {
  opacity: 0.45;
}

.word-editor-letter-label {
  position: absolute;
  transform: translateX(-50%);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 700;
  line-height: 1;
  color: rgba(245, 247, 250, 0.88);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.42);
  pointer-events: none;
  z-index: 2;
}

.word-editor-letter-label[data-overlap="false"] {
  color: #ff4040;
  text-shadow: 0 0 16px rgba(255, 64, 64, 0.25);
}

.word-editor-band {
  position: absolute;
  top: 16px;
  bottom: 16px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

.word-editor-baseline {
  position: absolute;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  pointer-events: none;
}

.word-editor-width-handle {
  position: absolute;
  top: 26px;
  bottom: 26px;
  width: 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.05);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: ew-resize;
  z-index: 3;
}

.word-editor-width-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 24px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}

.word-editor-width-handle:hover:not(:disabled),
.word-editor-width-handle:focus-visible {
  transform: translateX(-50%);
}

.word-editor-letter {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  color: transparent;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 700;
  font-size: 0;
  line-height: 0;
  letter-spacing: -0.08em;
  text-shadow: none;
  cursor: grab;
  user-select: none;
  z-index: 3;
}

.word-editor-letter::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: min(100%, 56px);
  height: 40px;
  transform: translateX(-50%);
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.word-editor-letter-handle {
  position: absolute;
  left: 50%;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 54px;
  min-height: 36px;
  padding: 7px 11px;
  transform: translateX(-50%);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08)),
    rgba(13, 18, 26, 0.46);
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.word-editor-letter-handle-grip {
  position: relative;
  width: 18px;
  height: 12px;
  flex: 0 0 auto;
}

.word-editor-letter-handle-grip::before,
.word-editor-letter-handle-grip::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transform: translateY(-50%);
}

.word-editor-letter-handle-grip::before {
  left: 0;
  border-right: 6px solid rgba(245, 247, 250, 0.78);
}

.word-editor-letter-handle-grip::after {
  right: 0;
  border-left: 6px solid rgba(245, 247, 250, 0.78);
}

.word-editor-letter-handle-label {
  color: rgba(245, 247, 250, 0.96);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.word-editor-letter:hover,
.word-editor-letter:focus-visible {
  color: transparent;
}

.word-editor-letter:hover::before,
.word-editor-letter:focus-visible::before,
.word-editor-letter:active::before,
.word-editor-stage[data-dragging="true"] .word-editor-letter[data-active="true"]::before {
  border-color: rgba(42, 127, 255, 0.55);
  background: rgba(42, 127, 255, 0.12);
}

.word-editor-letter:hover .word-editor-letter-handle,
.word-editor-letter:focus-visible .word-editor-letter-handle,
.word-editor-letter:active .word-editor-letter-handle,
.word-editor-stage[data-dragging="true"] .word-editor-letter[data-active="true"] .word-editor-letter-handle {
  border-color: rgba(42, 127, 255, 0.68);
  background:
    linear-gradient(180deg, rgba(114, 176, 255, 0.28), rgba(42, 127, 255, 0.12)),
    rgba(12, 18, 28, 0.62);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.3),
    0 0 0 3px rgba(42, 127, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.word-editor-letter:active,
.word-editor-stage[data-dragging="true"] .word-editor-letter[data-active="true"] {
  cursor: grabbing;
  color: transparent;
}

.word-editor-letter[data-width-anchor="true"] {
  pointer-events: none;
}

.word-editor-letter[data-width-anchor="true"]::before {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.word-editor-letter[data-width-anchor="true"] .word-editor-letter-handle {
  border-color: rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05)),
    rgba(13, 18, 26, 0.28);
  opacity: 0.75;
}

.word-editor-letter[data-width-anchor="true"] .word-editor-letter-handle-grip::before,
.word-editor-letter[data-width-anchor="true"] .word-editor-letter-handle-grip::after {
  opacity: 0.36;
}

.layout-width-row {
  margin: 0 0 18px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.layout-card-range {
  margin-top: 14px;
}

.layout-width-row .field-label {
  margin-bottom: 10px;
}

.layout-width-actions output {
  color: var(--accent-strong);
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 280px;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.form-panel,
.status-panel {
  padding: 20px;
}

.preview-panel {
  overflow: hidden;
  min-height: 620px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 241, 233, 0.96)),
    var(--panel-strong);
}

.preview-panel .panel-section-heading,
.status-panel .panel-section-heading {
  padding: 18px 18px 0;
  margin-bottom: 0;
}

.panel-section-heading-inline {
  padding: 0;
}

.preview-status-section {
  display: grid;
  gap: 18px;
  padding: 18px;
  border-top: 1px solid rgba(30, 38, 52, 0.08);
  background: rgba(255, 252, 247, 0.48);
}

.mobile-preview-summary {
  display: none;
}

.preview-status-stack {
  display: grid;
  gap: 16px;
}

.preview-status-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(30, 38, 52, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.52);
}

.connectivity-alert-card {
  border-color: rgba(212, 84, 84, 0.24);
  background:
    linear-gradient(135deg, rgba(212, 84, 84, 0.08), rgba(183, 139, 53, 0.08)),
    rgba(255, 255, 255, 0.74);
}

.connectivity-alert-eyebrow {
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.connectivity-alert-message {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.95rem;
  line-height: 1.5;
}

.preview-status-label {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 1rem;
}

label,
.field-label,
.rules h2 {
  display: block;
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-weight: 600;
}

.field-label-plain {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 14px 16px;
  margin-bottom: 14px;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
}

textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 14px 16px;
  font-size: 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  resize: vertical;
  min-height: 110px;
  font-family: inherit;
}

input[type="range"] {
  margin-bottom: 0;
  padding: 0;
}

select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 14px 16px;
  margin-bottom: 14px;
  font-size: 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible,
label:has(input:focus-visible) {
  outline: 3px solid rgba(42, 127, 255, 0.58);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(42, 127, 255, 0.16);
}

.model-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.model-color-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(30, 38, 52, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-strong);
  cursor: pointer;
}

.model-color-chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
}

.model-color-chip:has(input:checked) {
  border-color: rgba(42, 127, 255, 0.34);
  box-shadow: 0 0 0 4px rgba(42, 127, 255, 0.1);
  background: rgba(242, 247, 255, 0.96);
}

.model-color-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(30, 38, 52, 0.18);
  flex: 0 0 auto;
}

.model-color-swatch-white { background: #f4f4f0; }
.model-color-swatch-blue { background: #4a7fff; }
.model-color-swatch-green { background: #4da767; }
.model-color-swatch-red { background: #d65252; }
.model-color-swatch-pink { background: #d97bb8; }
.model-color-swatch-purple { background: #8f6bff; }

.model-color-name {
  font-size: 0.92rem;
  font-weight: 600;
}

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

.rules {
  border-radius: 18px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 241, 233, 0.96)),
    var(--panel-strong);
  border: 1px solid rgba(30, 38, 52, 0.08);
  margin-bottom: 18px;
}

.range-application-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(124, 230, 182, 0.12);
  color: var(--success);
  font-size: 0.9rem;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.range-row output {
  min-width: 76px;
  text-align: right;
  color: var(--muted);
  font-size: 0.92rem;
}

.rules ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.actions,
.preview-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.step-one-actions {
  align-items: center;
}

.grid-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}

.grid-toggle input {
  width: auto;
  margin: 0;
  padding: 0;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 0.96rem;
  cursor: pointer;
  background: rgba(20, 29, 43, 0.06);
  color: var(--accent-strong);
  transition:
    transform 120ms ease,
    background 120ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.word-editor-letter:hover:not(:disabled),
.word-editor-letter:focus-visible,
.word-editor-letter:active,
.word-editor-stage[data-dragging="true"] .word-editor-letter[data-active="true"] {
  transform: translate(-50%, -50%);
}

.word-editor-width-handle:hover:not(:disabled),
.word-editor-width-handle:focus-visible,
.word-editor-width-handle:active {
  transform: translateX(-50%);
}

.button-primary {
  background: linear-gradient(135deg, #2a7fff 0%, #7d6dff 100%);
  color: #f8fbff;
  box-shadow: 0 18px 30px rgba(42, 127, 255, 0.22);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ghost-button {
  padding: 10px 14px;
  background: rgba(20, 29, 43, 0.05);
  color: var(--muted);
  font-size: 0.86rem;
  box-shadow: none;
}

.ghost-button:hover:not(:disabled) {
  background: rgba(42, 127, 255, 0.08);
}

.preview-toolbar {
  padding: 18px 18px 0;
}

.preview-zoom-row {
  padding: 14px 18px 0;
}

.preview-zoom-row label {
  margin-bottom: 10px;
}

.preview-zoom-range {
  margin-bottom: 0;
}

#preview-zoom {
  margin: 0;
}

#preview-zoom-value {
  min-width: 56px;
}

#preview {
  position: relative;
  width: 100%;
  height: clamp(360px, 56vh, 560px);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.18));
}

.preview-empty-state {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.preview-empty-state[hidden] {
  display: none;
}

.preview-empty-state-card {
  width: min(360px, 100%);
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 22px;
  background: rgba(248, 251, 255, 0.9);
  box-shadow: 0 18px 40px rgba(20, 29, 43, 0.18);
  backdrop-filter: blur(12px);
}

.preview-empty-state-eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.03em;
}

.preview-empty-state-card h3 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 1.2rem;
  line-height: 1.2;
}

.preview-empty-state-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.preview-empty-state-list li + li {
  margin-top: 6px;
}

.preview-progress-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.preview-progress-overlay[hidden] {
  display: none;
}

.preview-progress-card {
  width: min(340px, 100%);
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 20px;
  background: rgba(248, 251, 255, 0.92);
  box-shadow: 0 18px 40px rgba(20, 29, 43, 0.18);
  backdrop-filter: blur(12px);
}

.preview-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 600;
}

.preview-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(248, 251, 255, 0.9);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(20, 29, 43, 0.14);
  pointer-events: none;
}

.preview-loading[hidden] {
  display: none;
}

.messages {
  min-height: 22px;
  color: var(--danger);
  margin: 14px 0 0;
  font-size: 0.95rem;
}

.messages.success {
  color: var(--success);
}

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

.word-warning {
  margin: 8px 0 16px;
  min-height: 0;
}

.rules-trigger {
  margin-bottom: 16px;
  width: 100%;
  justify-content: center;
  background: linear-gradient(135deg, rgba(42, 127, 255, 0.14), rgba(183, 139, 53, 0.14));
  border: 1px solid rgba(42, 127, 255, 0.18);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#status-list {
  margin: 0;
}

.generation-progress {
  margin: 14px 0 12px;
}

.generation-progress-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.generation-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.generation-progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(20, 29, 43, 0.08);
}

.generation-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2a7fff 0%, #7d6dff 100%);
  transition: width 180ms ease;
}

#status-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

dt {
  font-weight: 600;
}

dd {
  margin: 0;
  color: var(--muted);
}

::selection {
  background: rgba(42, 127, 255, 0.2);
}

.mesh-stats {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.mobile-sticky-cta {
  display: none;
}

.portal-page {
  max-width: 1180px;
}

.portal-hero {
  margin-bottom: 18px;
}

.portal-section {
  margin-top: 28px;
}

.portal-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.portal-main,
.portal-sidebar {
  display: grid;
  gap: 18px;
}

.portal-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(30, 38, 52, 0.08);
  border-radius: 24px;
  background: rgba(255, 252, 247, 0.78);
  box-shadow: var(--shadow);
}

.merchant-entry-panel .compact-copy {
  margin-top: 0;
}

.merchant-entry-header {
  align-items: center;
}

.merchant-entry-dismiss {
  margin-left: auto;
}

.portal-grid {
  display: grid;
  gap: 16px;
}

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

.portal-grid.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-header {
  margin-bottom: 14px;
}

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

.section-header h2 {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 1.4rem;
}

.section-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.ui-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(30, 38, 52, 0.1);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.ui-card[data-emphasized="true"],
.ui-card[data-selected="true"] {
  border-color: rgba(42, 127, 255, 0.32);
  box-shadow: 0 18px 42px rgba(42, 127, 255, 0.12);
}

.ui-card[data-disabled="true"] {
  opacity: 0.72;
}

.ui-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ui-card h2,
.ui-card h3 {
  margin: 0;
  color: var(--accent-strong);
}

.ui-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.ui-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(42, 127, 255, 0.1);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: none;
}

.ui-badge.status-paid {
  background: rgba(47, 141, 102, 0.12);
  color: var(--success);
}

.ui-badge.status-pending {
  background: rgba(183, 139, 53, 0.14);
  color: var(--accent-warm);
}

.ui-badge.status-failed {
  background: rgba(212, 84, 84, 0.12);
  color: var(--danger);
}

.ui-badge.status-refunded,
.ui-badge.status-unknown {
  background: rgba(100, 112, 125, 0.12);
  color: var(--muted);
}

.ui-price,
.stat-value {
  color: var(--accent-strong);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label,
.inline-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.merchant-upgrade-card {
  align-items: start;
}

.merchant-settings-note {
  line-height: 1.5;
}

.checkout-success-layout {
  justify-content: center;
}

.checkout-success-panel {
  max-width: 520px;
}

.checkout-trust-card,
.checkout-order-meta,
.checkout-support-panel {
  margin-top: 16px;
}

.checkout-trust-list {
  margin: 14px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.checkout-trust-list li {
  line-height: 1.5;
}

.checkout-order-meta {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(20, 29, 43, 0.03);
  color: var(--muted);
}

.checkout-order-meta-note {
  margin-top: 4px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.checkout-support-panel h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--accent-strong);
}

.account-signup-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.account-signup-panel h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  color: var(--accent-strong);
}

.account-signup-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.account-inline-help {
  display: flex;
  justify-content: flex-end;
}

.text-button {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 650;
}

.text-button:hover:not(:disabled) {
  background: transparent;
  transform: none;
  text-decoration: underline;
}

.account-signup-form input[readonly] {
  color: var(--muted);
  background: rgba(20, 29, 43, 0.04);
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 720px) {
  .checkout-choice-grid {
    grid-template-columns: 1fr;
  }
}

.analysis-results {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

@media (max-width: 1080px) {
  .page {
    padding: 30px 16px 20px;
  }

  .admin-shell,
  .portal-shell,
  .portal-grid.three-up {
    grid-template-columns: 1fr;
  }

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

  .preview-panel {
    min-height: 520px;
  }

}

@media (max-width: 760px) {
  .top-nav,
  .inline-actions {
    justify-content: flex-start;
  }

  .top-nav-account {
    justify-content: flex-start;
  }

  .section-header.compact {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    margin-bottom: 24px;
  }

  .flow-step-header h2,
  .panel-section-heading h2 {
    font-size: 1.22rem;
  }

  .portal-grid.two-up,
  .portal-grid.three-up {
    grid-template-columns: 1fr;
  }

  .intro {
    font-size: 1rem;
  }

  .word-editor-header,
  .layout-width-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .word-editor-actions {
    width: 100%;
    justify-content: stretch;
  }

  .word-editor-actions .ghost-button {
    flex: 1 1 0;
  }

  .preview-toolbar {
    padding: 14px 14px 0;
  }

  .preview-zoom-row {
    padding: 12px 14px 0;
  }

  .preview-status-section {
    padding: 16px;
  }

  #preview {
    height: clamp(320px, 52vh, 480px);
  }

  .form-panel,
  .status-panel {
    padding: 16px;
  }

  .word-editor-letter::before {
    width: min(100%, 64px);
    height: 46px;
  }

  .word-editor-letter-handle {
    min-width: 60px;
    min-height: 40px;
    padding: 8px 12px;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 24px 12px 96px;
  }

  .panel {
    border-radius: 20px;
  }

  .word-editor-card {
    padding: 12px;
  }

  .preview-panel .panel-section-heading,
  .status-panel .panel-section-heading {
    padding: 16px 16px 0;
  }

  .panel-section-heading-inline {
    padding: 0;
  }

  .layout-popup {
    align-items: stretch;
    padding: 0;
    background: rgba(8, 12, 18, 0.78);
  }

  .layout-popup-shell {
    width: 100%;
    max-height: var(--app-height);
  }

  .word-editor-card[data-expanded="true"] {
    min-height: var(--app-height);
    max-height: var(--app-height);
    border-radius: 0;
    padding: 12px;
    box-shadow: none;
  }

  .word-editor-card[data-expanded="true"] .word-editor-stage {
    min-height: clamp(300px, 50dvh, 460px) !important;
  }

  .word-editor-title {
    flex-wrap: wrap;
  }

  .word-editor-actions {
    gap: 6px;
  }

  .word-editor-actions .ghost-button,
  .layout-width-actions .ghost-button,
  .preview-toolbar button,
  .grid-toggle {
    min-height: 44px;
  }

  .range-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .range-row output {
    min-width: 0;
    text-align: left;
  }

  .preview-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .preview-zoom-row {
    padding-top: 10px;
  }

  .preview-toolbar > * {
    width: 100%;
    justify-content: center;
  }

  .grid-toggle {
    padding-inline: 12px;
  }

  #preview {
    height: clamp(280px, 46vh, 420px);
  }

  .mobile-accordion {
    margin-bottom: 14px;
    border: 1px solid rgba(30, 38, 52, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.42);
    overflow: hidden;
  }

  .mobile-accordion > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    color: var(--accent-strong);
    font-size: 0.96rem;
    font-weight: 600;
  }

  .mobile-accordion > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-accordion > summary::after {
    content: "+";
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1;
  }

  .mobile-accordion[open] > summary::after {
    content: "−";
  }

  .mobile-accordion-content {
    padding: 0 16px 16px;
  }

  .mobile-preview-summary {
    position: sticky;
    top: 8px;
    z-index: 5;
    display: grid;
    gap: 4px;
    margin: 0 14px 0;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(15, 23, 34, 0.9);
    color: #f8fbff;
    box-shadow: 0 16px 30px rgba(15, 23, 34, 0.22);
    backdrop-filter: blur(12px);
  }

  .mobile-preview-summary[hidden] {
    display: none;
  }

  .mobile-preview-summary span:last-child {
    color: rgba(248, 251, 255, 0.72);
    font-size: 0.84rem;
    line-height: 1.35;
  }

  .mobile-sticky-cta {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(30, 38, 52, 0.08);
    border-radius: 18px;
    background: rgba(250, 247, 241, 0.96);
    box-shadow: 0 18px 36px rgba(20, 29, 43, 0.2);
    backdrop-filter: blur(18px);
  }

  .mobile-sticky-cta[hidden] {
    display: none;
  }

  .mobile-sticky-cta-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
    flex: 1 1 auto;
  }

  .mobile-sticky-cta-copy strong {
    color: var(--accent-strong);
    font-size: 0.94rem;
  }

  .mobile-sticky-cta-copy span {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .mobile-sticky-cta-button {
    flex: 0 0 auto;
    min-height: 48px;
    padding-inline: 16px;
  }
}

@media (pointer: coarse) {
  .word-editor-letter::before {
    width: min(100%, 68px);
    height: 50px;
    bottom: 6px;
  }

  .word-editor-letter-handle {
    bottom: 8px;
    min-width: 64px;
    min-height: 42px;
    padding: 9px 13px;
  }
}
