/* CartAEO embedded app. Styled to sit comfortably inside the Shopify admin. */

:root {
  --cx-bg: #f1f1f1;
  --cx-surface: #ffffff;
  --cx-surface-soft: #f7f7f7;
  --cx-border: #e3e3e3;
  --cx-border-strong: #c9cccf;
  --cx-text: #303030;
  --cx-subdued: #616161;
  --cx-faint: #8a8a8a;
  --cx-brand: #0b6e4f;
  --cx-brand-soft: #e3f5ec;
  --cx-primary: #303030;
  --cx-primary-hover: #1a1a1a;
  --cx-success: #0c5132;
  --cx-success-bg: #cdfee1;
  --cx-info: #00527c;
  --cx-info-bg: #e0f0ff;
  --cx-attention: #5e4200;
  --cx-attention-bg: #ffef9d;
  --cx-warning: #5e4200;
  --cx-warning-bg: #fff1d6;
  --cx-critical: #8e1f0b;
  --cx-critical-bg: #fedad9;
  --cx-critical-strong: #c5280c;
  --cx-radius: 12px;
  --cx-radius-sm: 8px;
  --cx-shadow: 0 1px 0 rgba(26, 26, 26, 0.07), 0 1px 3px rgba(26, 26, 26, 0.06);
  --cx-shadow-lift: 0 8px 28px rgba(26, 26, 26, 0.16), 0 1px 3px rgba(26, 26, 26, 0.1);
  --cx-focus: 0 0 0 2px #fff, 0 0 0 4px #005bd3;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cx-bg);
  color: var(--cx-text);
  font: 400 13px/1.54 Inter, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: #005bd3; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
ui-nav-menu { display: none; }

:focus-visible { outline: none; box-shadow: var(--cx-focus); border-radius: 6px; }

.cx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ----- frame ---------------------------------------------------------------- */

.cx-app { max-width: 1040px; margin: 0 auto; padding: 20px 20px 96px; }
.cx-app.cx-narrow { max-width: 760px; }

.cx-boot { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 96px 0; color: var(--cx-subdued); }

.cx-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--cx-border-strong); border-top-color: var(--cx-text);
  animation: cx-spin 0.8s linear infinite; display: inline-block; flex: none;
}
.cx-spinner.cx-small { width: 12px; height: 12px; border-width: 2px; }
@keyframes cx-spin { to { transform: rotate(360deg); } }

.cx-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.cx-head-main { min-width: 0; flex: 1 1 320px; }
.cx-back { display: inline-flex; align-items: center; gap: 4px; color: var(--cx-subdued); font-weight: 550; margin-bottom: 6px; }
.cx-back:hover { color: var(--cx-text); text-decoration: none; }
.cx-title { font-size: 20px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cx-subtitle { color: var(--cx-subdued); margin-top: 4px; max-width: 68ch; }
.cx-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.cx-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cx-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cx-row.cx-between { justify-content: space-between; }
.cx-grow { flex: 1 1 auto; min-width: 0; }
.cx-muted { color: var(--cx-subdued); }
.cx-faint { color: var(--cx-faint); }
.cx-strong { font-weight: 650; }
.cx-nowrap { white-space: nowrap; }

.cx-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.cx-layout > * { min-width: 0; }
@media (max-width: 880px) { .cx-layout { grid-template-columns: minmax(0, 1fr); } }

/* ----- cards ---------------------------------------------------------------- */

.cx-card { background: var(--cx-surface); border-radius: var(--cx-radius); box-shadow: var(--cx-shadow); padding: 16px; }
.cx-card.cx-flush { padding: 0; overflow: hidden; }
.cx-card-title { font-size: 14px; font-weight: 650; }
.cx-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cx-card-sub { color: var(--cx-subdued); margin-top: 2px; }
.cx-divider { height: 1px; background: var(--cx-border); border: 0; margin: 14px 0; }
.cx-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cx-subdued); }

/* ----- buttons -------------------------------------------------------------- */

.cx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 6px 12px; border-radius: var(--cx-radius-sm);
  border: 1px solid var(--cx-border-strong); background: var(--cx-surface); color: var(--cx-text);
  font-weight: 600; font-size: 13px; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(26, 26, 26, 0.06);
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.cx-btn:hover { background: var(--cx-surface-soft); text-decoration: none; }
.cx-btn:active { background: #ebebeb; box-shadow: inset 0 1px 2px rgba(26, 26, 26, 0.12); }
.cx-btn[disabled], .cx-btn.cx-disabled { opacity: 0.5; cursor: not-allowed; }
.cx-btn.cx-primary { background: var(--cx-primary); border-color: var(--cx-primary); color: #fff; }
.cx-btn.cx-primary:hover { background: var(--cx-primary-hover); }
.cx-btn.cx-critical { background: var(--cx-critical-strong); border-color: var(--cx-critical-strong); color: #fff; }
.cx-btn.cx-critical:hover { background: #a21b00; }
.cx-btn.cx-plain { border-color: transparent; background: transparent; box-shadow: none; color: #005bd3; padding-left: 6px; padding-right: 6px; }
.cx-btn.cx-plain:hover { background: rgba(0, 91, 211, 0.08); }
.cx-btn.cx-plain.cx-danger { color: var(--cx-critical-strong); }
.cx-btn.cx-plain.cx-danger:hover { background: rgba(197, 40, 12, 0.08); }
.cx-btn.cx-large { min-height: 40px; padding: 9px 18px; font-size: 14px; }
.cx-btn.cx-block { width: 100%; }
.cx-btn svg { width: 16px; height: 16px; flex: none; }
.cx-btn.cx-busy { position: relative; color: transparent !important; pointer-events: none; }
.cx-btn.cx-busy::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(128, 128, 128, 0.45); border-top-color: #808080; animation: cx-spin 0.8s linear infinite;
}
.cx-btn.cx-primary.cx-busy::after, .cx-btn.cx-critical.cx-busy::after { border-color: rgba(255, 255, 255, 0.4); border-top-color: #fff; }

/* ----- badges, banners ------------------------------------------------------ */

.cx-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 8px;
  font-size: 12px; font-weight: 550; line-height: 1.4; background: #e3e3e3; color: #4a4a4a; white-space: nowrap;
}
.cx-badge.cx-success { background: var(--cx-success-bg); color: var(--cx-success); }
.cx-badge.cx-info { background: var(--cx-info-bg); color: var(--cx-info); }
.cx-badge.cx-attention { background: var(--cx-attention-bg); color: var(--cx-attention); }
.cx-badge.cx-warning { background: var(--cx-warning-bg); color: var(--cx-warning); }
.cx-badge.cx-critical { background: var(--cx-critical-bg); color: var(--cx-critical); }
.cx-badge.cx-brand { background: var(--cx-brand-soft); color: var(--cx-brand); }
.cx-badge .cx-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cx-badge .cx-dot.cx-pulse { animation: cx-pulse 1.2s ease-in-out infinite; }
@keyframes cx-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.cx-banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--cx-radius); background: var(--cx-info-bg); color: #003a5a; box-shadow: var(--cx-shadow); }
.cx-banner.cx-success { background: var(--cx-success-bg); color: var(--cx-success); }
.cx-banner.cx-warning { background: var(--cx-warning-bg); color: var(--cx-warning); }
.cx-banner.cx-critical { background: var(--cx-critical-bg); color: var(--cx-critical); }
.cx-banner-body { flex: 1 1 auto; min-width: 0; }
.cx-banner-title { font-weight: 650; }
.cx-banner-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.cx-banner .cx-btn:not(.cx-primary):not(.cx-critical) { background: rgba(255, 255, 255, 0.85); }

/* ----- forms ---------------------------------------------------------------- */

.cx-field { display: grid; gap: 4px; }
.cx-label { font-weight: 550; }
.cx-help { color: var(--cx-subdued); font-size: 12px; }
.cx-input, .cx-textarea, .cx-select {
  width: 100%; padding: 6px 10px; min-height: 32px; border-radius: var(--cx-radius-sm);
  border: 1px solid #8a8a8a; background: #fdfdfd; color: var(--cx-text);
}
.cx-textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.cx-input:focus, .cx-textarea:focus, .cx-select:focus { outline: none; border-color: #005bd3; box-shadow: 0 0 0 1px #005bd3; }
.cx-count { color: var(--cx-faint); font-size: 12px; text-align: right; }
.cx-count.cx-over { color: var(--cx-critical-strong); }

.cx-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.cx-check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--cx-primary); flex: none; }
.cx-check-title { font-weight: 550; }

/* ----- tabs ----------------------------------------------------------------- */

.cx-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.cx-tab {
  border: 0; background: transparent; padding: 6px 12px; border-radius: var(--cx-radius-sm); cursor: pointer;
  font-weight: 550; color: var(--cx-subdued); display: inline-flex; gap: 6px; align-items: center;
}
.cx-tab:hover { background: rgba(0, 0, 0, 0.05); color: var(--cx-text); }
.cx-tab[aria-selected="true"] { background: #e3e3e3; color: var(--cx-text); }
.cx-tab-count { font-size: 11px; padding: 0 6px; border-radius: 8px; background: rgba(0, 0, 0, 0.08); }

/* ----- lists ---------------------------------------------------------------- */

.cx-list { list-style: none; margin: 0; padding: 0; }
.cx-list > li + li { border-top: 1px solid var(--cx-border); }
.cx-item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; color: inherit; }
a.cx-item:hover { background: var(--cx-surface-soft); text-decoration: none; }
.cx-item-main { flex: 1 1 auto; min-width: 0; }
.cx-item-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-item-meta { color: var(--cx-subdued); font-size: 12px; margin-top: 1px; display: flex; gap: 6px 10px; flex-wrap: wrap; }
.cx-item-side { display: flex; gap: 8px; align-items: center; flex: none; }
@media (max-width: 560px) {
  /* Phones: the title gets the full row, the badges and buttons move underneath. */
  .cx-item { flex-wrap: wrap; }
  .cx-item-main { flex: 1 1 0; }
  .cx-item-title { white-space: normal; }
  .cx-item-side { flex: 1 1 100%; flex-wrap: wrap; }
}

.cx-thumb { width: 44px; height: 44px; border-radius: 8px; background: #ececec center / cover no-repeat; border: 1px solid var(--cx-border); flex: none; overflow: hidden; display: grid; place-items: center; color: var(--cx-faint); }
.cx-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cx-thumb.cx-wide { width: 64px; height: 44px; }

.cx-empty { text-align: center; padding: 40px 20px; color: var(--cx-subdued); }
.cx-empty h3 { color: var(--cx-text); font-size: 15px; margin-bottom: 4px; }
.cx-empty .cx-btn { margin-top: 14px; }

/* ----- progress ------------------------------------------------------------- */

.cx-progress { height: 8px; border-radius: 6px; background: #e3e3e3; overflow: hidden; }
.cx-progress > i { display: block; height: 100%; border-radius: 6px; background: var(--cx-brand); transition: width 0.6s ease; min-width: 4px; }
.cx-progress.cx-working > i { background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0) 100%); background-size: 200% 100%; animation: cx-sheen 1.6s linear infinite; }
@keyframes cx-sheen { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.cx-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding: 0; list-style: none; }
.cx-step { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--cx-faint); padding: 3px 10px 3px 6px; border-radius: 20px; background: var(--cx-surface-soft); }
.cx-step i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--cx-border-strong); display: grid; place-items: center; font-style: normal; font-size: 10px; flex: none; }
.cx-step.cx-done { color: var(--cx-brand); background: var(--cx-brand-soft); }
.cx-step.cx-done i { background: var(--cx-brand); border-color: var(--cx-brand); color: #fff; }
.cx-step.cx-now { color: var(--cx-text); font-weight: 600; background: #ececec; }
.cx-step.cx-now i { border-color: var(--cx-text); border-top-color: transparent; animation: cx-spin 0.9s linear infinite; }

/* ----- dashboard ------------------------------------------------------------ */

.cx-next { position: relative; overflow: hidden; }
.cx-next-message { font-size: 16px; font-weight: 650; line-height: 1.35; margin: 6px 0 12px; }
.cx-next-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.cx-next-article { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }

.cx-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .cx-stats { grid-template-columns: minmax(0, 1fr); } }
.cx-stat-label { color: var(--cx-subdued); font-weight: 550; }
.cx-stat-value { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; margin-top: 2px; }
.cx-stat-note { color: var(--cx-faint); font-size: 12px; }
.cx-spark { width: 100%; height: 36px; margin-top: 8px; display: block; }
.cx-spark path.cx-line { fill: none; stroke: var(--cx-brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cx-spark path.cx-area { fill: var(--cx-brand-soft); stroke: none; }

.cx-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 28px; }
@media (max-width: 760px) { .cx-hero { grid-template-columns: minmax(0, 1fr); padding: 20px; } }
.cx-hero h2 { font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; }
.cx-hero p { color: var(--cx-subdued); margin-top: 8px; font-size: 14px; }
.cx-hero .cx-btn { margin-top: 18px; }
.cx-howto { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: howto; }
.cx-howto li { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 10px; background: var(--cx-surface-soft); counter-increment: howto; }
.cx-howto li::before { content: counter(howto); width: 24px; height: 24px; border-radius: 50%; background: var(--cx-brand); color: #fff; font-weight: 700; display: grid; place-items: center; flex: none; font-size: 12px; }
.cx-howto strong { display: block; }
.cx-howto span { color: var(--cx-subdued); }

/* ----- question cards ------------------------------------------------------- */

.fc { display: grid; gap: 16px; justify-items: center; padding: 8px 0 4px; }
.fc-stage { width: 100%; display: grid; grid-template-columns: minmax(84px, 1fr) minmax(0, 440px) minmax(84px, 1fr); gap: 16px; align-items: center; }
.fc-deck { position: relative; height: 290px; perspective: 1400px; }

.fc-pile { display: grid; justify-items: center; gap: 2px; color: var(--cx-subdued); text-align: center; transition: transform 0.25s; }
.fc-pile svg { width: 26px; height: 26px; }
.fc-pile-count { font-size: 22px; font-weight: 700; color: var(--cx-text); line-height: 1.1; }
.fc-pile.fc-up svg { color: var(--cx-brand); }
.fc-pile.fc-down svg { color: #b0553f; }
.fc-pile.fc-bump { animation: fc-bump 0.45s ease; }
@keyframes fc-bump { 40% { transform: scale(1.18); } }

.fc-card {
  position: absolute; inset: 0; border-radius: 18px; transform-style: preserve-3d;
  will-change: transform; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.fc-card.fc-current { cursor: grab; z-index: 3; animation: fc-enter 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.fc-card.fc-current.fc-dragging { cursor: grabbing; animation: none; }
.fc-card.fc-under { z-index: 2; transform: translateY(10px) scale(0.955); filter: brightness(0.985); }
.fc-card.fc-under-2 { z-index: 1; transform: translateY(20px) scale(0.91); filter: brightness(0.97); }

.fc-face {
  position: absolute; inset: 0; border-radius: 18px; padding: 22px 24px; background: var(--cx-surface);
  box-shadow: 0 1px 0 rgba(26, 26, 26, 0.08), 0 10px 30px rgba(26, 26, 26, 0.12); border: 1px solid var(--cx-border);
  backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column;
}
.fc-back { transform: rotateY(180deg); background: var(--cx-brand); color: #fff; border-color: var(--cx-brand); align-items: center; justify-content: center; gap: 8px; text-align: center; }
.fc-back svg { width: 54px; height: 54px; }
.fc-back strong { font-size: 18px; }
.fc-count { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cx-subdued); }
.fc-phrase { font-size: 23px; line-height: 1.28; font-weight: 700; letter-spacing: -0.015em; margin: auto 0; padding: 10px 0; overflow-wrap: anywhere; }
.fc-meta { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; color: var(--cx-subdued); font-size: 12px; }
.fc-rating b { font-size: 20px; color: var(--cx-text); font-weight: 700; }
.fc-meter { height: 6px; border-radius: 4px; background: #e9e9e9; margin-top: 8px; overflow: hidden; }
.fc-meter i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #7fd3a8, var(--cx-brand)); }

.fc-stamp { position: absolute; top: 18px; padding: 4px 10px; border-radius: 8px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; font-size: 13px; opacity: 0; border: 2px solid currentColor; pointer-events: none; }
.fc-stamp.fc-yes { left: 18px; color: var(--cx-brand); transform: rotate(-8deg); }
.fc-stamp.fc-no { right: 18px; color: #b0553f; transform: rotate(8deg); }

@keyframes fc-enter { from { transform: translateY(10px) scale(0.955); } to { transform: none; } }

/*
 * Thumbs up: the card flips over and lands on the left.
 * The card itself never changes opacity: that would flatten its 3D faces and
 * show the front mirrored instead of the back. The faces fade instead.
 */
@keyframes fc-flip-left {
  0% { transform: translateX(var(--fc-x, 0px)) rotateY(0deg) rotate(var(--fc-r, 0deg)) scale(1); }
  50% { transform: translateX(-26%) rotateY(-180deg) rotate(0deg) scale(1.02); }
  100% { transform: translateX(-128%) rotateY(-180deg) rotate(0deg) scale(0.42); }
}
/* Thumbs down: the card tips and drops off to the right. */
@keyframes fc-drop-right {
  0% { transform: translate(0, 0) rotate(0deg); }
  28% { transform: translate(16%, -3%) rotate(7deg); }
  100% { transform: translate(118%, 120%) rotate(42deg); }
}
/* The same drop for a card that was swiped: it falls from where it was let go. */
@keyframes fc-drop-right-drag {
  0% { transform: translate(var(--fc-x, 0px), 0) rotate(var(--fc-r, 0deg)); }
  100% { transform: translate(118%, 120%) rotate(42deg); }
}
@keyframes fc-fade-late { 0%, 76% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fc-fade-fall { 0%, 40% { opacity: 1; } 100% { opacity: 0; } }
.fc-card.fc-leave-up { animation: fc-flip-left 0.66s cubic-bezier(0.45, 0, 0.3, 1) forwards; pointer-events: none; }
.fc-card.fc-leave-up .fc-face { animation: fc-fade-late 0.66s linear forwards; }
.fc-card.fc-leave-down { animation: fc-drop-right 0.56s cubic-bezier(0.55, 0, 0.9, 0.5) forwards; pointer-events: none; }
.fc-card.fc-leave-down .fc-face { animation: fc-fade-fall 0.56s linear forwards; }
.fc-card.fc-leave-down.fc-from-drag { animation-name: fc-drop-right-drag; animation-duration: 0.44s; }
.fc-card.fc-leave-down.fc-from-drag .fc-face { animation-duration: 0.44s; }
.fc-card.fc-leave-up, .fc-card.fc-leave-down { z-index: 5; }

.fc-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.fc-btn {
  display: inline-flex; align-items: center; gap: 10px; min-width: 168px; justify-content: center;
  padding: 12px 20px; border-radius: 14px; border: 1px solid var(--cx-border-strong); background: var(--cx-surface);
  font-weight: 650; font-size: 14px; cursor: pointer; box-shadow: var(--cx-shadow); transition: transform 0.1s, background 0.12s, border-color 0.12s;
}
.fc-btn svg { width: 22px; height: 22px; }
.fc-btn:hover { transform: translateY(-1px); }
.fc-btn:active { transform: translateY(1px); }
.fc-btn.fc-up { color: var(--cx-brand); border-color: #9ad6b8; }
.fc-btn.fc-up:hover { background: var(--cx-brand-soft); }
.fc-btn.fc-down { color: #9b3e27; border-color: #e7b9ad; }
.fc-btn.fc-down:hover { background: #fdeeea; }
.fc-btn[disabled] { opacity: 0.5; cursor: default; transform: none; }
.fc-hint { color: var(--cx-faint); font-size: 12px; text-align: center; }
.fc-hint kbd { font: inherit; font-weight: 650; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--cx-border-strong); background: #fff; color: var(--cx-subdued); }

.fc-wait { display: grid; justify-items: center; gap: 14px; padding: 46px 16px; text-align: center; }
.fc-wait h2 { font-size: 18px; }
.fc-wait p { color: var(--cx-subdued); max-width: 46ch; }
.fc-orbit { width: 64px; height: 64px; position: relative; }
.fc-orbit i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--cx-brand); animation: cx-spin 1.1s linear infinite; }
.fc-orbit i + i { inset: 9px; border-top-color: #7fd3a8; animation-duration: 1.7s; animation-direction: reverse; }
.fc-orbit i + i + i { inset: 18px; border-top-color: #c7ebd9; animation-duration: 2.3s; }
.fc-done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--cx-brand-soft); color: var(--cx-brand); display: grid; place-items: center; }
.fc-done-mark svg { width: 34px; height: 34px; }

@media (max-width: 620px) {
  .fc-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fc-deck { grid-column: 1 / -1; grid-row: 2; height: 300px; }
  .fc-pile { grid-row: 1; grid-auto-flow: column; align-items: center; justify-content: center; gap: 6px; }
  .fc-pile-count { font-size: 16px; }
  .fc-phrase { font-size: 20px; }
  .fc-btn { min-width: 0; flex: 1 1 140px; }
}

.cx-phrase-row { display: flex; gap: 10px; align-items: center; padding: 9px 16px; }
.cx-phrase-text { flex: 1 1 auto; min-width: 0; }
.cx-phrase-rating { font-weight: 650; color: var(--cx-subdued); width: 30px; text-align: right; flex: none; }

/* ----- plans ---------------------------------------------------------------- */

.cx-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
@media (max-width: 860px) { .cx-plans { grid-template-columns: minmax(0, 1fr); } }
.cx-plan { display: flex; flex-direction: column; gap: 12px; position: relative; border: 1px solid transparent; }
.cx-plan.cx-featured { border-color: var(--cx-brand); box-shadow: 0 0 0 1px var(--cx-brand), var(--cx-shadow); }
.cx-plan.cx-current { border-color: var(--cx-text); box-shadow: 0 0 0 1px var(--cx-text), var(--cx-shadow); }
.cx-plan-name { font-size: 16px; font-weight: 700; }
.cx-plan-price { font-size: 30px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.cx-plan-price small { font-size: 13px; font-weight: 500; color: var(--cx-subdued); letter-spacing: 0; }
.cx-plan-was { color: var(--cx-faint); text-decoration: line-through; font-size: 14px; font-weight: 500; margin-right: 6px; }
.cx-plan-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; align-content: start; flex: 1 1 auto; }
.cx-plan-features li { display: flex; gap: 8px; align-items: flex-start; }
.cx-plan-features svg { width: 16px; height: 16px; color: var(--cx-brand); flex: none; margin-top: 2px; }

/* ----- article editor ------------------------------------------------------- */

.cx-title-input { width: 100%; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; padding: 6px 10px; margin-left: -10px; border-radius: var(--cx-radius-sm); border: 1px solid transparent; background: transparent; resize: none; overflow: hidden; display: block; }
.cx-title-input:hover { border-color: var(--cx-border-strong); background: #fff; }
.cx-title-input:focus { outline: none; border-color: #005bd3; box-shadow: 0 0 0 1px #005bd3; background: #fff; }

.cx-toolbar { display: flex; gap: 2px; flex-wrap: wrap; padding: 6px 8px; border-bottom: 1px solid var(--cx-border); background: var(--cx-surface-soft); position: sticky; top: 0; z-index: 2; }
.cx-tool { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 6px; border: 0; background: transparent; cursor: pointer; font-weight: 650; color: var(--cx-subdued); display: inline-flex; align-items: center; justify-content: center; }
.cx-tool:hover { background: rgba(0, 0, 0, 0.07); color: var(--cx-text); }
.cx-tool svg { width: 16px; height: 16px; }
.cx-tool-sep { width: 1px; background: var(--cx-border); margin: 4px 4px; }

.cx-editor { padding: 18px 22px 26px; min-height: 380px; font-size: 15px; line-height: 1.65; outline: none; overflow-wrap: anywhere; }
.cx-editor:focus-visible { box-shadow: none; }
.cx-editor > :first-child { margin-top: 0; }
.cx-editor h2 { font-size: 20px; line-height: 1.3; margin: 26px 0 8px; letter-spacing: -0.01em; }
.cx-editor h3 { font-size: 16px; line-height: 1.35; margin: 20px 0 6px; }
.cx-editor h4 { font-size: 14px; margin: 16px 0 4px; }
.cx-editor p { margin: 0 0 12px; }
.cx-editor ul, .cx-editor ol { margin: 0 0 12px; padding-left: 22px; }
.cx-editor li { margin-bottom: 4px; }
.cx-editor blockquote { margin: 0 0 12px; padding: 4px 14px; border-left: 3px solid var(--cx-border-strong); color: var(--cx-subdued); }
.cx-editor table { border-collapse: collapse; width: 100%; margin: 0 0 12px; font-size: 14px; }
.cx-editor th, .cx-editor td { border: 1px solid var(--cx-border); padding: 6px 10px; text-align: left; vertical-align: top; }
.cx-editor th { background: var(--cx-surface-soft); }
.cx-editor a { text-decoration: underline; }

.cx-preview-frame { width: 100%; border: 0; display: block; min-height: 520px; background: #fff; }
.cx-cover { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: #ececec; object-fit: cover; display: block; border: 1px solid var(--cx-border); }
.cx-cover-empty { display: grid; place-items: center; color: var(--cx-faint); }

.cx-serp { border: 1px solid var(--cx-border); border-radius: 10px; padding: 12px; background: #fff; }
.cx-serp-url { color: #4d5156; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-serp-title { color: #1a0dab; font-size: 17px; line-height: 1.3; margin: 2px 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cx-serp-desc { color: #4d5156; font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

.cx-notes { white-space: pre-wrap; color: var(--cx-subdued); font-size: 12px; max-height: 180px; overflow: auto; }

.cx-savebar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; border-radius: 14px;
  background: #1a1a1a; color: #fff; box-shadow: var(--cx-shadow-lift); max-width: calc(100vw - 24px);
}
.cx-savebar .cx-btn { border-color: #5a5a5a; background: #303030; color: #fff; box-shadow: none; }
.cx-savebar .cx-btn:hover { background: #454545; }
.cx-savebar .cx-btn.cx-primary { background: #fff; border-color: #fff; color: #1a1a1a; }
.cx-savebar .cx-btn.cx-primary:hover { background: #ececec; }

/* ----- modal ---------------------------------------------------------------- */

.cx-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.45); display: grid; place-items: center; padding: 16px; animation: cx-fade 0.14s ease; }
@keyframes cx-fade { from { opacity: 0; } }
.cx-modal { width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--cx-surface); border-radius: 14px; box-shadow: var(--cx-shadow-lift); animation: cx-pop 0.18s cubic-bezier(0.2, 0.8, 0.2, 1); }
.cx-modal.cx-wide { width: min(720px, 100%); }
@keyframes cx-pop { from { transform: translateY(8px) scale(0.985); opacity: 0; } }
.cx-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--cx-border); }
.cx-modal-title { font-size: 15px; font-weight: 650; }
.cx-modal-close { border: 0; background: transparent; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; color: var(--cx-subdued); display: grid; place-items: center; }
.cx-modal-close:hover { background: rgba(0, 0, 0, 0.06); color: var(--cx-text); }
.cx-modal-close svg { width: 18px; height: 18px; }
.cx-modal-body { padding: 16px; overflow: auto; display: grid; gap: 14px; }
.cx-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--cx-border); flex-wrap: wrap; }

.cx-choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--cx-border); border-radius: 10px; cursor: pointer; }
.cx-choice:hover { background: var(--cx-surface-soft); }
.cx-choice input { margin-top: 3px; accent-color: var(--cx-primary); }
.cx-choice.cx-on { border-color: var(--cx-text); box-shadow: 0 0 0 1px var(--cx-text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .fc-card.fc-leave-up, .fc-card.fc-leave-down { animation: cx-fade-out 0.2s ease forwards !important; }
}
@keyframes cx-fade-out { to { opacity: 0; } }
