/* 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: 5px; color: var(--cx-subdued); font-weight: 550; margin-bottom: 6px; font-size: 13px; }
.cx-back svg { width: 15px; height: 15px; flex: none; }
.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-brand {
  background: var(--cx-brand); border-color: var(--cx-brand); color: #fff;
  box-shadow: 0 1px 2px rgba(11, 110, 79, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.cx-btn.cx-brand:hover:not([disabled]) { background: #095840; border-color: #095840; }
.cx-btn.cx-brand:active:not([disabled]) { background: #074734; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2); }
.cx-btn.cx-brand[disabled] { background: #dce5e1; border-color: #cbd8d2; color: #678076; opacity: 1; box-shadow: none; }
.cx-btn.cx-brand.cx-busy::after { border-color: rgba(255, 255, 255, 0.4); border-top-color: #fff; }
.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.15fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 28px; }
@media (max-width: 760px) { .cx-hero { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 20px; } }
.cx-hero-copy h2 { font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; margin-top: 6px; }
.cx-hero-lead { color: var(--cx-subdued); margin-top: 10px; font-size: 14px; line-height: 1.55; max-width: 48ch; }
.cx-hero-cta { margin-top: 20px; display: grid; gap: 8px; justify-items: start; }
.cx-hero-note { color: var(--cx-faint); font-size: 12px; }
.cx-howto-wrap { display: grid; gap: 10px; }
.cx-howto-kicker { padding-left: 2px; }
.cx-howto { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: howto; }
.cx-howto li { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 10px; background: var(--cx-surface-soft); border: 1px solid #eceeef; 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; margin-top: 1px; }
.cx-howto strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.cx-howto span { color: var(--cx-subdued); line-height: 1.45; }

/* ----- 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: 330px; 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; }

.cx-scan { display: grid; gap: 12px; padding: 8px 4px 4px; text-align: left; }
.cx-scan h2 { font-size: 18px; line-height: 1.35; }
.cx-scan-list { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--cx-border); border-radius: 10px; overflow: hidden; }
.cx-scan-step { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: #fff; border-top: 1px solid var(--cx-border); color: var(--cx-faint); }
.cx-scan-step:first-child { border-top: 0; }
.cx-scan-step.cx-done { color: var(--cx-text); background: #fbfefc; }
.cx-scan-step.cx-now { color: var(--cx-text); font-weight: 650; background: var(--cx-brand-soft); }
.cx-scan-mark {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--cx-border-strong);
  display: grid; place-items: center; flex: none; background: #fff;
}
.cx-scan-step.cx-done .cx-scan-mark { background: var(--cx-brand); border-color: var(--cx-brand); color: #fff; }
.cx-scan-step.cx-now .cx-scan-mark { border-color: transparent; background: transparent; }
.cx-scan-mark svg { width: 14px; height: 14px; display: block; }
.cx-scan-detail { margin: 0; min-height: 1.4em; color: var(--cx-subdued); }

@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; }

/* ----- seed selector & live keyword engine ---------------------------------- */

.cx-kw-shell { max-width: 900px; margin: 0 auto; width: 100%; display: grid; gap: 18px; }

.cx-kw-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cx-kw-nav .cx-back { margin-bottom: 0; padding: 4px 8px 4px 4px; margin-left: -4px; border-radius: 8px; transition: background 0.12s, color 0.12s; }
.cx-kw-nav .cx-back:hover { background: rgba(0, 0, 0, 0.05); }

.cx-kw-hero {
  background: var(--cx-surface); border-radius: 14px; border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: var(--cx-shadow); overflow: hidden;
}
.cx-kw-hero-top {
  display: flex; align-items: center; gap: 16px; padding: 18px 22px; flex-wrap: wrap;
}
.cx-kw-thumb {
  width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--cx-border);
  background: #f5f6f7; flex: none; overflow: hidden; display: grid; place-items: center; color: var(--cx-faint);
}
.cx-kw-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cx-kw-thumb svg { width: 22px; height: 22px; }
.cx-kw-hero-meta { flex: 1 1 260px; min-width: 0; display: grid; gap: 4px; }
.cx-kw-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--cx-brand);
}
.cx-kw-eyebrow svg { width: 13px; height: 13px; }
.cx-kw-title { font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -0.015em; color: #1a1a1a; }
.cx-kw-meta-pills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

.cx-kw-stepper {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #eceeef; background: #fafbfb;
}
.cx-kw-step {
  display: flex; align-items: center; gap: 10px; padding: 11px 18px;
  font-size: 12.5px; color: var(--cx-faint); font-weight: 500; position: relative;
}
.cx-kw-step + .cx-kw-step { border-left: 1px solid #eceeef; }
.cx-kw-step-num {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #d0d5dd;
  background: #fff; color: var(--cx-subdued); font-size: 11px; font-weight: 700;
  display: grid; place-items: center; flex: none; font-variant-numeric: tabular-nums;
}
.cx-kw-step-num svg { width: 13px; height: 13px; }
.cx-kw-step-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-kw-step.cx-done { color: var(--cx-text); }
.cx-kw-step.cx-done .cx-kw-step-num { background: var(--cx-brand); border-color: var(--cx-brand); color: #fff; }
.cx-kw-step.cx-now { color: #11181c; font-weight: 650; background: #f2faf6; }
.cx-kw-step.cx-now .cx-kw-step-num { background: var(--cx-brand); border-color: var(--cx-brand); color: #fff; box-shadow: 0 0 0 3px rgba(11, 110, 79, 0.16); }

.cx-kw-card {
  background: var(--cx-surface); border-radius: 14px; border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: var(--cx-shadow); overflow: hidden;
}
.cx-kw-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 22px 16px; border-bottom: 1px solid #f0f1f3;
}
.cx-kw-card-heading { min-width: 0; flex: 1 1 auto; display: grid; gap: 4px; }
.cx-kw-card-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cx-kw-card-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: #1a1a1a; }
.cx-kw-card-sub { color: var(--cx-subdued); font-size: 13px; line-height: 1.5; max-width: 74ch; }

.cx-seed-toolbar {
  display: inline-flex; align-items: center; gap: 6px; flex: none; white-space: nowrap;
}
.cx-seed-toolbar .cx-btn { min-height: 30px; padding: 4px 11px; font-size: 12.5px; border-radius: 8px; }

.cx-kw-card-body { padding: 18px 22px 20px; }

.cx-seed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cx-seed-chip {
  display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 11px 14px;
  border-radius: 10px; border: 1.5px solid #e1e4e8; background: #ffffff; color: #1f2421;
  font-size: 13.5px; font-weight: 600; line-height: 1.3; text-align: left; cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease, transform 0.12s ease;
}
.cx-seed-chip:hover:not([disabled]) {
  border-color: #7cc4a5; background: #fbfefd;
  box-shadow: 0 2px 8px rgba(11, 110, 79, 0.07); transform: translateY(-1px);
}
.cx-seed-chip:active:not([disabled]) { transform: translateY(0); }
.cx-seed-chip.cx-on {
  border-color: var(--cx-brand); background: #eff9f4; color: #084a34;
  box-shadow: 0 0 0 1px rgba(11, 110, 79, 0.12), 0 2px 8px rgba(11, 110, 79, 0.08);
}
.cx-seed-chip.cx-started {
  border-color: #d6e7df; background: #f6fbf8; color: var(--cx-subdued);
  cursor: default; box-shadow: none; transform: none;
}
.cx-seed-check {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #c4c9cf;
  background: #fff; color: transparent; display: grid; place-items: center; flex: none;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.cx-seed-check svg { width: 13px; height: 13px; stroke-width: 2.75; }
.cx-seed-chip:hover:not([disabled]) .cx-seed-check { border-color: var(--cx-brand); }
.cx-seed-chip.cx-on .cx-seed-check { border-color: var(--cx-brand); background: var(--cx-brand); color: #fff; }
.cx-seed-chip.cx-started .cx-seed-check { border-color: #63b08e; background: #63b08e; color: #fff; }
.cx-seed-text { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
.cx-seed-state {
  font-size: 11px; font-weight: 650; color: var(--cx-brand); background: rgba(11, 110, 79, 0.1);
  padding: 2px 8px; border-radius: 999px; flex: none; white-space: nowrap;
}

.cx-kw-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 22px; background: #fafbfb; border-top: 1px solid #eceeef;
}
.cx-seed-summary { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cx-subdued); }
.cx-seed-summary strong { color: var(--cx-text); font-weight: 650; font-variant-numeric: tabular-nums; }
.cx-seed-dot { width: 8px; height: 8px; border-radius: 50%; background: #c4c9cf; flex: none; transition: background 0.15s; }
.cx-seed-dot.cx-active { background: var(--cx-brand); box-shadow: 0 0 0 3px rgba(11, 110, 79, 0.15); }
.cx-seed-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ----- live article creation studio & spotlight ----------------------------- */

.cx-studio-card { background: var(--cx-surface); }
.cx-studio-top {
  display: grid; justify-items: center; text-align: center; gap: 12px;
  padding: 32px 24px 24px;
  background: radial-gradient(ellipse at top, rgba(11, 110, 79, 0.08), rgba(255, 255, 255, 0) 68%);
}
.cx-studio-badge-host { min-height: 22px; }

.cx-studio-orb {
  position: relative; width: 82px; height: 82px; display: grid; place-items: center; margin: 4px 0 2px;
}
.cx-orb-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(11, 110, 79, 0.24);
  animation: cx-orb-ripple 2.4s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}
.cx-orb-ring.cx-orb-ring-2 { animation-delay: 1.2s; }
.cx-orb-arc {
  position: absolute; inset: 7px; border-radius: 50%;
  border: 2.5px solid transparent; border-top-color: var(--cx-brand); border-right-color: rgba(11, 110, 79, 0.35);
  animation: cx-spin 1.6s linear infinite;
}
.cx-orb-core {
  position: relative; z-index: 1; width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(145deg, #0d825d, var(--cx-brand));
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(11, 110, 79, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  animation: cx-orb-float 2.8s ease-in-out infinite;
}
.cx-orb-core svg { width: 22px; height: 22px; }

.cx-orb-sparks { position: absolute; inset: -6px; display: none; pointer-events: none; animation: cx-spin 4.5s linear infinite; }
.cx-orb-spark {
  position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: #34b37f; box-shadow: 0 0 8px rgba(52, 179, 127, 0.75);
  animation: cx-spark-twinkle 1.5s ease-in-out infinite;
}
.cx-orb-spark:nth-child(1) { top: 0; left: 50%; margin-left: -3.5px; }
.cx-orb-spark:nth-child(2) { bottom: 10px; left: 4px; width: 5px; height: 5px; animation-delay: 0.5s; }
.cx-orb-spark:nth-child(3) { bottom: 14px; right: 2px; width: 6px; height: 6px; animation-delay: 1s; }

.cx-studio-orb.cx-mode-drafting .cx-orb-sparks { display: block; }
.cx-studio-orb.cx-mode-drafting .cx-orb-arc { animation-duration: 1.1s; }
.cx-studio-orb.cx-mode-drafting .cx-orb-core {
  animation: cx-orb-float 2.8s ease-in-out infinite, cx-orb-glow 1.8s ease-in-out infinite;
}
.cx-studio-orb.cx-mode-drafting .cx-orb-core svg { animation: cx-sparkle-write 1.8s ease-in-out infinite; }

@keyframes cx-spark-twinkle {
  0%, 100% { transform: scale(0.4); opacity: 0.25; }
  50% { transform: scale(1.15); opacity: 1; }
}
@keyframes cx-sparkle-write {
  0%, 100% { transform: rotate(-12deg) scale(0.92); }
  50% { transform: rotate(14deg) scale(1.14); }
}
@keyframes cx-orb-glow {
  0%, 100% { box-shadow: 0 8px 20px rgba(11, 110, 79, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24); }
  50% { box-shadow: 0 8px 28px rgba(11, 110, 79, 0.42), 0 0 0 6px rgba(52, 179, 127, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.24); }
}
@keyframes cx-orb-ripple {
  0% { transform: scale(0.76); opacity: 0.75; }
  100% { transform: scale(1.38); opacity: 0; }
}
@keyframes cx-orb-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.03); }
}

.cx-studio-title { font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -0.015em; color: #1a1a1a; }
.cx-studio-sub { color: var(--cx-subdued); font-size: 13.5px; line-height: 1.5; max-width: 54ch; }
.cx-studio-bar-wrap { width: min(460px, 100%); margin-top: 2px; }

.cx-studio-ticker { min-height: 20px; font-size: 12.5px; color: var(--cx-subdued); }
.cx-ticker-line { display: inline-flex; align-items: center; gap: 7px; animation: cx-ticker-in 0.35s ease both; }
.cx-ticker-line .cx-spinner { border-top-color: var(--cx-brand); }
@keyframes cx-ticker-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.cx-studio-milestones {
  list-style: none; margin: 6px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.cx-ms-item {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 7px;
  border-radius: 999px; font-size: 12px; font-weight: 550;
  background: #f4f5f6; color: var(--cx-faint); border: 1px solid #eceeef;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.cx-ms-mark {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #d0d5dd;
  background: #fff; display: grid; place-items: center; flex: none;
}
.cx-ms-mark svg { width: 11px; height: 11px; stroke-width: 2.75; }
.cx-ms-item.cx-done { background: var(--cx-brand-soft); color: var(--cx-brand); border-color: #bfe8d4; }
.cx-ms-item.cx-done .cx-ms-mark { background: var(--cx-brand); border-color: var(--cx-brand); color: #fff; }
.cx-ms-item.cx-now { background: #fff; color: #1a1a1a; border-color: #8ccbb0; font-weight: 650; box-shadow: 0 2px 8px rgba(11, 110, 79, 0.08); }
.cx-ms-item.cx-now .cx-ms-mark { border-color: transparent; background: transparent; }

.cx-studio-body {
  padding: 18px 22px 22px; border-top: 1px solid #f0f1f3; background: #fafbfb;
  display: grid; gap: 12px;
}

.cx-research-preview { display: grid; gap: 12px; }
.cx-research-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cx-search-stream { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-search-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  border-radius: 999px; background: #fff; border: 1px solid #e3e7ea;
  font-size: 12.5px; font-weight: 550; color: #2b3033;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  animation: cx-pill-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.cx-search-pill svg { width: 13px; height: 13px; color: var(--cx-brand); flex: none; }
.cx-search-pill.cx-pill-skel {
  width: 148px; height: 30px; border-color: transparent;
  background: linear-gradient(90deg, #eceeef 25%, #f6f7f8 50%, #eceeef 75%);
  background-size: 200% 100%; animation: cx-shimmer 1.5s linear infinite;
}
@keyframes cx-pill-in {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.cx-draft-preview {
  background: #fff; border: 1px solid #e4e7ea; border-radius: 12px;
  padding: 16px 18px; display: grid; gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.cx-draft-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cx-draft-pct { font-size: 12.5px; font-weight: 700; color: var(--cx-brand); font-variant-numeric: tabular-nums; }
.cx-draft-title { font-size: 16px; line-height: 1.3; font-weight: 700; color: #1a1a1a; }
.cx-draft-skel { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 14px; align-items: center; }
.cx-skel-cover {
  width: 100%; aspect-ratio: 16 / 10; border-radius: 8px;
  background: linear-gradient(90deg, #edf0f2 25%, #f7f9fa 50%, #edf0f2 75%);
  background-size: 200% 100%; animation: cx-shimmer 1.6s linear infinite;
}
.cx-skel-lines { display: grid; gap: 8px; }
.cx-skel-line {
  display: block; height: 10px; border-radius: 999px; width: 92%;
  background: linear-gradient(90deg, #edf0f2 25%, #f7f9fa 50%, #edf0f2 75%);
  background-size: 200% 100%; animation: cx-shimmer 1.6s linear infinite;
}
.cx-skel-line.cx-skel-lg { width: 100%; height: 12px; }
.cx-skel-line.cx-skel-md { width: 78%; }
.cx-skel-line.cx-skel-sm { width: 54%; }
@keyframes cx-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.cx-draft-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding-top: 10px; border-top: 1px solid #f0f1f3; font-size: 12.5px;
}
.cx-draft-link { font-weight: 600; }

/* ----- article spotlight hero ----------------------------------------------- */

.cx-article-hero { padding: 22px; }
.cx-article-hero-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; align-items: center; }
.cx-article-hero-grid.cx-no-media { grid-template-columns: minmax(0, 1fr); }
.cx-article-hero-media {
  display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--cx-border);
  aspect-ratio: 16 / 10; background: #f2f3f5;
}
.cx-article-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; }
.cx-article-hero-media:hover img { transform: scale(1.02); }
.cx-article-hero-content { display: grid; gap: 10px; min-width: 0; }
.cx-article-hero-title { font-size: 21px; line-height: 1.25; font-weight: 750; letter-spacing: -0.015em; color: #161817; }
.cx-article-hero-summary {
  color: var(--cx-subdued); font-size: 13.5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cx-article-hero-meta { font-size: 12.5px; color: var(--cx-faint); }
.cx-article-hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.cx-next-draft-card { padding: 16px 20px; }

.cx-topic-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; }
.cx-topic-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
.cx-topic-title { font-weight: 550; color: var(--cx-text); }
.cx-topic-foot { padding: 8px 12px; border-top: 1px solid var(--cx-border); text-align: center; }

.cx-kw-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-kw-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: 999px; background: #f2faf6; border: 1px solid #cde8da;
  color: #0b5c42; font-size: 12.5px; font-weight: 600;
}
.cx-kw-pill svg { width: 13px; height: 13px; stroke-width: 2.5; }

@media (max-width: 680px) {
  .cx-kw-hero-top { padding: 16px; }
  .cx-kw-stepper { grid-template-columns: minmax(0, 1fr); }
  .cx-kw-step + .cx-kw-step { border-left: 0; border-top: 1px solid #eceeef; }
  .cx-kw-card-head { flex-direction: column; align-items: stretch; padding: 16px; }
  .cx-kw-card-body { padding: 14px 16px 16px; }
  .cx-kw-card-foot { padding: 12px 16px; }
  .cx-seed-grid { grid-template-columns: minmax(0, 1fr); }
  .cx-studio-top { padding: 24px 16px 20px; }
  .cx-studio-body { padding: 14px 16px 16px; }
  .cx-draft-skel { grid-template-columns: minmax(0, 1fr); }
  .cx-article-hero { padding: 16px; }
  .cx-article-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}

/* ----- 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-cover-fresh { animation: cx-cover-reveal 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes cx-cover-reveal {
  from { opacity: 0.35; transform: scale(0.985); }
  to { opacity: 1; transform: none; }
}

.cx-cover-stage { position: relative; border-radius: 10px; overflow: hidden; }
.cx-cover-stage.cx-cover-working .cx-cover { filter: blur(2.5px) brightness(0.72); transform: scale(1.03); transition: filter 0.25s ease, transform 0.25s ease; }
.cx-cover-overlay {
  position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 6px;
  padding: 12px; text-align: center; color: #fff;
  background: radial-gradient(circle at center, rgba(16, 24, 20, 0.42), rgba(16, 24, 20, 0.68));
}
.cx-cover-shimmer {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.22) 50%, rgba(255, 255, 255, 0) 80%);
  background-size: 220% 100%;
  animation: cx-shimmer 1.8s linear infinite;
}
.cx-cover-orb { position: relative; width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 2px; }
.cx-cover-orb .cx-orb-ring { border-color: rgba(255, 255, 255, 0.45); }
.cx-cover-orb .cx-orb-arc { inset: 4px; border-width: 2px; border-top-color: #7fd3a8; border-right-color: rgba(255, 255, 255, 0.35); }
.cx-cover-orb-core {
  position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(145deg, #0d825d, var(--cx-brand));
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  animation: cx-orb-float 2.4s ease-in-out infinite;
}
.cx-cover-orb-core svg { width: 15px; height: 15px; }
.cx-cover-overlay-title { position: relative; z-index: 1; font-size: 13px; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.cx-cover-overlay-sub { position: relative; z-index: 1; font-size: 11.5px; color: rgba(255, 255, 255, 0.86); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }

.cx-seg {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
  padding: 3px; border-radius: 9px; background: #eceeef; border: 1px solid #e1e4e7;
}
.cx-seg-btn {
  border: 0; background: transparent; border-radius: 7px; padding: 6px 8px;
  font-size: 12px; font-weight: 600; color: var(--cx-subdued); cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.cx-seg-btn:hover { color: var(--cx-text); }
.cx-seg-btn.cx-on {
  background: #fff; color: var(--cx-text);
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.12);
}

.cx-textarea-compact { min-height: 68px; font-size: 12.5px; }

.cx-note-pill, .cx-rewrite-notes-box {
  display: grid; gap: 4px; padding: 10px 12px; border-radius: 9px;
  background: var(--cx-surface-soft); border: 1px solid var(--cx-border);
}
.cx-note-pill p, .cx-rewrite-notes-box p { font-size: 12.5px; color: var(--cx-text); white-space: pre-wrap; overflow-wrap: anywhere; }
.cx-rewrite-notes-box { background: #fff; }

.cx-skel-cover-stage { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: #edf0f2; }
.cx-skel-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; filter: blur(1.5px) saturate(0.75) brightness(0.92); opacity: 0.72; }

.cx-thumb.cx-thumb-working { position: relative; }
.cx-thumb.cx-thumb-working::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0) 80%);
  background-size: 220% 100%;
  animation: cx-shimmer 1.6s linear infinite;
}

.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; }

  /* Progress indicators are exempt: a frozen orb reads as a stuck page. */
  .cx-spinner { animation-duration: 0.8s !important; animation-iteration-count: infinite !important; }
  .cx-badge .cx-dot.cx-pulse { animation-duration: 1.2s !important; animation-iteration-count: infinite !important; }
  .cx-progress.cx-working > i { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
  .cx-orb-ring { animation-duration: 2.4s !important; animation-iteration-count: infinite !important; }
  .cx-orb-arc { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
  .cx-orb-core { animation-duration: 2.8s !important; animation-iteration-count: infinite !important; }
  .cx-orb-sparks { animation-duration: 4.5s !important; animation-iteration-count: infinite !important; }
  .cx-orb-spark { animation-duration: 1.5s !important; animation-iteration-count: infinite !important; }
  .cx-studio-orb.cx-mode-drafting .cx-orb-arc { animation-duration: 1.1s !important; }
  .cx-studio-orb.cx-mode-drafting .cx-orb-core { animation-duration: 2.8s, 1.8s !important; }
  .cx-studio-orb.cx-mode-drafting .cx-orb-core svg { animation-duration: 1.8s !important; animation-iteration-count: infinite !important; }
  .cx-cover-orb-core { animation-duration: 2.4s !important; animation-iteration-count: infinite !important; }
}
@keyframes cx-fade-out { to { opacity: 0; } }
