/* ==========================================================================
   薯卡工坊 RedCard Studio — Commercial Creator Studio Stylesheet
   Zero external CDN / Zero external fonts / Pure Modern CSS
   ========================================================================== */

:root {
  --bg-app: #f4f5f8;
  --bg-panel: #ffffff;
  --bg-subtle: #f7f8fb;
  --bg-hover: #f0f2f6;
  --border: #e5e7ee;
  --border-strong: #d4d8e3;

  --text-main: #18181b;
  --text-secondary: #52525b;
  --text-muted: #8a8f9c;

  --accent: #ff2442;
  --accent-hover: #e51c39;
  --accent-soft: #fff1f3;
  --accent-ring: rgba(255, 36, 66, 0.14);

  --pro-gold: #d97706;
  --pro-gold-light: #fef3c7;
  --pro-dark: #18181b;
  --vip-violet: #6d28d9;
  --success: #059669;
  --success-soft: #ecfdf5;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 14px 36px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-modal: 0 28px 70px rgba(15, 23, 42, 0.24);

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;

  --topbar-h: 60px;
  --panel-w: 430px;
  --card-preview-w: 310px;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-main);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ==================== TOP HEADER BAR ==================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar-left,
.topbar-center,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-left,
.topbar-right {
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff3856 0%, #e11d48 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 36, 66, 0.28);
  flex-shrink: 0;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  flex-shrink: 0;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-en {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 99px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-slogan {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
}

.save-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
  margin-left: 4px;
}

.save-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.save-pill.saving .save-dot {
  background: #f59e0b;
}

/* Sample Switcher */
.sample-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 99px;
}

.sample-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.sample-pills {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sample-pill-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 99px;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.sample-pill-btn:hover {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.sample-pill-btn.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

/* Header Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
}

.btn-ghost {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.btn-primary {
  background: var(--text-main);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(24, 24, 27, 0.16);
}

.btn-primary:hover {
  background: #27272a;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.btn-pro-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 5px;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #1c1917;
  letter-spacing: 0.03em;
}

.btn-license {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 36, 66, 0.2);
  background: linear-gradient(135deg, #ff2442 0%, #e11d48 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(255, 36, 66, 0.24);
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-license:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 36, 66, 0.34);
}

.btn-license.is-pro {
  background: linear-gradient(135deg, #18181b 0%, #27272a 100%);
  color: #fde68a;
  border-color: rgba(245, 196, 81, 0.45);
  box-shadow: 0 4px 14px rgba(24, 24, 27, 0.22);
}

.btn-license.is-pro:hover {
  box-shadow: 0 6px 18px rgba(245, 196, 81, 0.26);
}

/* ==================== MAIN WORKSPACE LAYOUT ==================== */

.workspace {
  display: grid;
  grid-template-columns: var(--panel-w) minmax(0, 1fr);
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

/* LEFT EDITOR PANEL */
.editor-panel {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.panel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  flex-shrink: 0;
}

.panel-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.16s ease;
}

.panel-tab:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.panel-tab.active {
  background: var(--text-main);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.tab-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
}

.panel-tab:not(.active) .tab-pill {
  background: var(--border);
  color: var(--text-secondary);
}

.panel-body {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  flex-direction: column;
  gap: 12px;
}

.panel-body.active {
  display: flex;
}

.section-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-header h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.badge-soft {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

.editor-stats {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Form Elements */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.field input[type="text"],
.field textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 13.5px;
  line-height: 1.5;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  resize: vertical;
}

.field input[type="text"]:focus,
.field textarea:focus,
.markdown-textarea:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.field input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Switch Toggle */
.switch-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

.switch-inline input {
  display: none;
}

.switch-track {
  width: 34px;
  height: 19px;
  border-radius: 99px;
  background: #d4d8e3;
  position: relative;
  transition: background 0.18s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}

.switch-inline input:checked + .switch-track {
  background: var(--accent);
}

.switch-inline input:checked + .switch-track::after {
  transform: translateX(15px);
}

.switch-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Markdown Editor & Quick Formatting Toolbar */
.md-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.md-btn {
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 7px;
  transition: all 0.14s ease;
}

.md-btn:hover {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border-strong);
}

.md-btn-hl {
  background: #fef9c3;
  border-color: #fde047;
  color: #854d0e;
}

.md-btn-hl:hover {
  background: #fef08a;
  color: #713f12;
}

.md-btn-break {
  background: var(--accent-soft);
  border-color: rgba(255, 36, 66, 0.24);
  color: var(--accent);
}

.markdown-textarea {
  width: 100%;
  min-height: 280px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 13.5px;
  line-height: 1.68;
  resize: vertical;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.md-footnote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.md-footnote code {
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0 4px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.link-btn {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.link-btn:hover {
  color: var(--accent);
}

.link-btn-accent {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==================== THEME GALLERY (8 THEMES) ==================== */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.theme-card {
  position: relative;
  text-align: left;
  padding: 9px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: all 0.16s ease;
}

.theme-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.theme-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.theme-swatch {
  height: 54px;
  border-radius: 8px;
  padding: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.theme-swatch-inner {
  width: 100%;
  height: 100%;
  border-radius: 5px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.swatch-accent-bar {
  width: 24px;
  height: 4px;
  border-radius: 99px;
}

.swatch-line {
  height: 4px;
  border-radius: 99px;
  opacity: 0.72;
}

.swatch-line.short {
  width: 65%;
  opacity: 0.35;
}

.theme-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.theme-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.theme-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.theme-sub {
  font-size: 10.5px;
  color: var(--text-muted);
}

.theme-tag-free {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  background: #ecfdf5;
  color: #059669;
}

.theme-tag-pro {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 5px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

.theme-tag-pro.unlocked {
  background: #18181b;
  color: #fde68a;
}

.theme-card.locked .theme-swatch-inner {
  opacity: 0.72;
}

.swatch-lock-overlay {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.76);
  color: #fde68a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.24);
}

.quick-dot.locked {
  opacity: 0.62;
}

.quick-dot.locked::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f59e0b;
  border: 1.5px solid #ffffff;
}

/* File Protocol Security Banner */
.file-mode-banner {
  margin: 12px 20px 0;
  padding: 10px 15px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 12.5px;
  flex-shrink: 0;
}

.file-mode-text {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  line-height: 1.5;
}

.file-mode-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f59e0b;
  color: #ffffff;
}

.file-mode-banner code,
.file-mode-alert code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: rgba(146, 64, 14, 0.10);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Ratio Selector */
.ratio-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ratio-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  transition: all 0.15s ease;
}

.ratio-btn:hover {
  background: #ffffff;
  border-color: var(--border-strong);
}

.ratio-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.ratio-shape {
  display: inline-block;
  border: 2px solid var(--text-secondary);
  border-radius: 3px;
}

.ratio-btn.active .ratio-shape {
  border-color: var(--accent);
}

.ratio-3-4 { width: 15px; height: 20px; }
.ratio-1-1 { width: 18px; height: 18px; }
.ratio-4-3 { width: 22px; height: 16px; }

.ratio-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.ratio-dim {
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Sliders & Segmented */
.slider-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.slider-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-top label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.slider-val {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: #e2e5ee;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.26);
  cursor: pointer;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: 7px;
  transition: all 0.14s ease;
}

.seg-btn.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.pro-crown-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

.pro-crown-pill.unlocked {
  background: var(--success-soft);
  color: var(--success);
}

.pro-lock-hint {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ==================== RIGHT LIVE PREVIEW STAGE ==================== */

.preview-stage {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: #f1f3f7;
  background-image: radial-gradient(rgba(100, 116, 139, 0.16) 1px, transparent 1px);
  background-size: 20px 20px;
}

.preview-toolbar {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.preview-toolbar-left,
.preview-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.deck-summary {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deck-count-badge {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 99px;
}

.deck-dim {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Quick Theme Dot Bar */
.quick-theme-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.quick-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16);
  position: relative;
  padding: 0;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.quick-dot:hover {
  transform: scale(1.12);
}

.quick-dot.active {
  box-shadow: 0 0 0 2px var(--accent);
  transform: scale(1.12);
}

.quick-dot-inner {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.view-toggle {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: 9px;
  gap: 2px;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
}

.view-btn.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.zoom-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-label {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.zoom-control input[type="range"] {
  width: 96px;
}

/* PRO Trial Nudge Banner */
.trial-banner {
  margin: 12px 20px 0;
  padding: 10px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #18181b 0%, #27272a 100%);
  color: #f4f4f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.trial-banner-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.trial-crown {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #18181b;
}

.btn-trial-cta {
  border: none;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #18181b;
  font-size: 12.5px;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 8px;
  white-space: nowrap;
  transition: transform 0.14s ease;
}

.btn-trial-cta:hover {
  transform: translateY(-1px);
}

/* Preview Scroll & Cards Grid */
.preview-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 48px;
}

.cards-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
}

.card-tile {
  width: var(--card-preview-w);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-canvas-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: zoom-in;
}

.card-canvas-wrap:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.16);
}

.card-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

.card-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.card-page-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-index-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 6px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-action-btn {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.14s ease;
}

.card-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Single Slide Focus Viewer */
.single-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.single-stage-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.single-card-host {
  width: min(460px, 84vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.nav-arrow:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.06);
}

.nav-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.single-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.strip-pill {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 99px;
}

.strip-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* ==================== MODALS (UPGRADE, LICENSE, LIGHTBOX) ==================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-dialog {
  position: relative;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-upgrade {
  max-width: 920px;
  padding: 28px 30px 26px;
}

.modal-compact {
  max-width: 460px;
  padding: 28px 26px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.upgrade-head {
  text-align: center;
  margin-bottom: 20px;
}

.upgrade-eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 8px;
}

.upgrade-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.upgrade-context-tip {
  margin: 8px auto 0;
  max-width: 560px;
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  padding: 6px 14px;
  border-radius: 8px;
}

/* Pricing Comparison Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.price-card {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price-card-featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, #fff8f9 0%, #ffffff 42%);
  box-shadow: 0 10px 26px rgba(255, 36, 66, 0.10);
}

.price-card-vip {
  border-color: #d8b4fe;
  background: linear-gradient(180deg, #faf5ff 0%, #ffffff 42%);
}

.price-badge {
  position: absolute;
  top: -11px;
  right: 14px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--accent);
  color: #ffffff;
}

.price-badge-vip {
  background: var(--vip-violet);
}

.price-tier {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.price-amount {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.price-amount .currency {
  font-size: 16px;
  font-weight: 700;
}

.price-amount .num {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.price-amount .period {
  font-size: 12px;
  color: var(--text-muted);
}

.price-note-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 6px;
}

.price-note-vip {
  color: var(--vip-violet);
  background: #f3e8ff;
}

.price-features {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.price-features li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.4;
}

.price-features .muted-feat {
  color: #a1a1aa;
}

.chk, .chk-pro, .chk-vip, .cross { flex-shrink: 0; }
.chk { color: #10b981; font-weight: 800; }
.chk-pro { color: var(--accent); font-weight: 800; }
.chk-vip { color: var(--vip-violet); font-weight: 800; }
.cross { color: #d4d4d8; font-weight: 700; }

/* Checkout Split: Left Compliant Platforms + Right Server Activation */
.checkout-split {
  display: grid;
  grid-template-columns: 1.12fr 0.98fr;
  gap: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.checkout-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-main);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.platform-checkout-box {
  padding: 15px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.security-guarantee-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 9px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 12px;
  font-weight: 600;
}

.platform-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.platform-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.platform-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.platform-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.platform-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
}

.platform-tag-alt {
  background: #ede9fe;
  color: #6d28d9;
}

.platform-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-platform {
  flex: 1;
  min-width: 132px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.14s ease, opacity 0.14s ease;
  text-align: center;
}

.btn-platform em {
  font-style: normal;
}

.btn-platform:hover {
  transform: translateY(-1px);
}

.btn-platform-primary {
  background: linear-gradient(135deg, #ff2442 0%, #e11d48 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 36, 66, 0.22);
}

.btn-platform-vip {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.22);
}

.btn-platform-outline {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
}

.btn-platform.unconfigured {
  opacity: 0.72;
}

.platform-note-box {
  padding: 9px 11px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px dashed var(--border-strong);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Activation Panel */
.activate-box {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.file-mode-alert {
  padding: 9px 11px;
  border-radius: 9px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 12px;
  line-height: 1.5;
}

.device-quota-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.device-quota-bar strong,
.device-count-highlight {
  color: var(--success);
  font-weight: 700;
}

.btn-activate:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.activate-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.license-input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background: #ffffff;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-main);
}

.license-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.btn-activate {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff2442 0%, #e11d48 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(255, 36, 66, 0.25);
  transition: all 0.16s ease;
}

.btn-activate:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 36, 66, 0.34);
}

.activate-feedback {
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}

.activate-feedback.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.activate-feedback.success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.activate-assurance {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 4px;
}

/* Licensed Info Modal */
.licensed-hero {
  text-align: center;
  margin-bottom: 18px;
}

.licensed-emblem {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, #18181b, #27272a);
  color: #fde68a;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(24, 24, 27, 0.2);
}

.licensed-hero h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
}

.licensed-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.licensed-details {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 14px;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.detail-row code {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

.licensed-perks {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--success);
  font-weight: 600;
}

.licensed-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Lightbox Modal */
.lightbox-shell {
  width: min(760px, 94vw);
  max-height: 92vh;
  background: #141519;
  border-radius: 18px;
  padding: 14px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-modal);
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lightbox-title {
  color: #f4f4f5;
  font-size: 13.5px;
  font-weight: 700;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lightbox-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
}

.lightbox-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
}

.lightbox-body img {
  max-width: calc(100% - 96px);
  max-height: 76vh;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.lightbox-nav {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.lightbox-nav:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* ==================== v2.1 SMART FORMAT, COMPLIANCE & FEED SIMULATOR ==================== */

.smart-assist-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-smart-format {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 29px;
  padding: 0 10px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #18181b 0%, #3f3f46 100%);
  color: #fde68a;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(24, 24, 27, 0.16);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-smart-format:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 24, 27, 0.24);
}

.btn-undo-mini {
  height: 29px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-undo-mini:hover {
  color: var(--text-main);
  border-color: var(--text-main);
}

.compliance-pill {
  margin-left: auto;
  height: 29px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.compliance-pill.warn {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.compliance-pill:hover {
  filter: brightness(0.96);
}

/* Compliance Drawer */
.compliance-drawer {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.compliance-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.compliance-head-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.compliance-head-meta strong {
  font-size: 12.5px;
  color: var(--text-main);
}

.compliance-pool-tag {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-rewrite-safe {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 0 10px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #ff2442 0%, #e11d48 100%);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.btn-rewrite-safe:hover {
  filter: brightness(1.05);
}

.compliance-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 185px;
  overflow-y: auto;
}

.compliance-ok-box {
  padding: 9px 11px;
  border-radius: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 12px;
  font-weight: 600;
}

.compliance-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compliance-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.compliance-word-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.risk-lvl {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}

.risk-lvl.high {
  background: #fee2e2;
  color: #b91c1c;
}

.risk-lvl.medium {
  background: #fef3c7;
  color: #92400e;
}

.risk-word {
  font-size: 12.5px;
  font-weight: 800;
  color: #dc2626;
}

.risk-replace {
  font-size: 11.5px;
  font-weight: 700;
  color: #059669;
  background: #ecfdf5;
  padding: 1px 6px;
  border-radius: 5px;
}

.risk-loc {
  font-size: 11px;
  color: var(--text-muted);
}

.risk-tip {
  font-size: 11px;
  color: var(--text-secondary);
}

.compliance-pro-teaser {
  padding: 8px 10px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px dashed #f59e0b;
  color: #92400e;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Feed Simulator Toolbar Button */
.btn-feed-sim {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 31px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid rgba(255, 36, 66, 0.25);
  background: #fff5f6;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-feed-sim:hover {
  background: var(--accent);
  color: #ffffff;
}

.ctr-mini-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(255, 36, 66, 0.14);
  color: inherit;
}

.btn-feed-sim:hover .ctr-mini-pill {
  background: rgba(255, 255, 255, 0.22);
}

/* Feed Simulator Modal */
.modal-feed-sim {
  max-width: 920px;
  padding: 24px 26px;
}

.feed-sim-layout {
  display: grid;
  grid-template-columns: 356px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.phone-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.phone-frame {
  width: 344px;
  background: #f5f5f7;
  border-radius: 34px;
  border: 7px solid #18181b;
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-status-bar {
  background: #ffffff;
  padding: 7px 18px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  color: #18181b;
}

.phone-notch {
  width: 68px;
  height: 15px;
  border-radius: 99px;
  background: #18181b;
}

.xhs-nav-bar {
  background: #ffffff;
  padding: 6px 0 9px;
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 13px;
  font-weight: 600;
  color: #9ca3af;
  border-bottom: 1px solid #f0f0f2;
}

.xhs-nav-active {
  color: #18181b;
  font-weight: 800;
  position: relative;
}

.xhs-nav-active::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: -5px;
  height: 2.5px;
  border-radius: 99px;
  background: #ff2442;
}

.xhs-feed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 8px;
  max-height: 495px;
  overflow-y: auto;
}

.xhs-feed-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.xhs-card {
  background: #ffffff;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.xhs-card-user {
  box-shadow: 0 0 0 2px #ff2442, 0 6px 16px rgba(255, 36, 66, 0.16);
}

.xhs-cover-box {
  position: relative;
  background: #f3f4f6;
}

.xhs-cover-box img {
  display: block;
  width: 100%;
  height: auto;
}

.xhs-user-pin {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  background: #ff2442;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(255, 36, 66, 0.35);
}

.xhs-card-body {
  padding: 7px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.xhs-card-title {
  font-size: 11px;
  font-weight: 700;
  color: #18181b;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.xhs-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9.5px;
  color: #71717a;
}

.xhs-author {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 82px;
}

/* Mock Competitor Cards inside Discovery Feed */
.xhs-mock-cover {
  padding: 16px 11px;
  min-height: 158px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.mock-cover-life {
  min-height: 174px;
  background: linear-gradient(155deg, #f7ece1 0%, #ead7c3 100%);
  color: #3d2c1e;
}

.mock-cover-tech {
  min-height: 164px;
  background: linear-gradient(155deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
}

.mock-cover-career {
  min-height: 152px;
  background: linear-gradient(155deg, #fef9c3 0%, #fde68a 100%);
  color: #1c1917;
}

.mock-badge,
.mock-badge-light,
.mock-badge-cyan {
  align-self: flex-start;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
}

.mock-badge {
  background: #1c1917;
  color: #fef08a;
}

.mock-badge-light {
  background: rgba(255, 255, 255, 0.72);
  color: #7c4a26;
}

.mock-badge-cyan {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}

.mock-headline,
.mock-headline-serif,
.mock-headline-dark {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
}

.mock-headline-serif {
  font-family: Georgia, serif;
}

.phone-caption {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* CTR Report Right Column */
.ctr-report-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ctr-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 800;
}

.ctr-score-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ctr-score-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ctr-score-num {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.ctr-score-num small {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 3px;
}

.ctr-grade-badge {
  font-size: 12.5px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 99px;
}

.ctr-grade-badge.grade-s { background: #ecfdf5; color: #059669; }
.ctr-grade-badge.grade-a { background: #eff6ff; color: #2563eb; }
.ctr-grade-badge.grade-b { background: #fffbeb; color: #d97706; }
.ctr-grade-badge.grade-c { background: #fef2f2; color: #dc2626; }

.ctr-progress-track {
  height: 9px;
  border-radius: 99px;
  background: #e5e7eb;
  overflow: hidden;
}

.ctr-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ff2442 0%, #f59e0b 50%, #10b981 100%);
  transition: width 0.25s ease;
}

.ctr-score-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.ctr-checks-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.ctr-check-item {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ctr-check-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
}

.ctr-check-pts {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 6px;
}

.ctr-check-pts.pass { background: #ecfdf5; color: #059669; }
.ctr-check-pts.warn { background: #fffbeb; color: #d97706; }
.ctr-check-pts.fail { background: #fef2f2; color: #dc2626; }

.ctr-check-detail {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.ctr-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 860px) {
  .feed-sim-layout {
    grid-template-columns: 1fr;
  }
}

/* Legal Panel Footer, Consumer Notice & Legal Modal */
.panel-legal-footer {
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.consumer-notice-bar {
  padding: 8px 10px;
  border-radius: 9px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 11.5px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.modal-legal {
  max-width: 660px;
  padding: 26px 28px;
}

.legal-head {
  margin-bottom: 16px;
}

.legal-head h2 {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 800;
}

.legal-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.legal-block {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.legal-block h3 {
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.legal-block p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.legal-block code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 0 4px;
  border-radius: 4px;
}

.legal-footer-actions {
  display: flex;
  justify-content: flex-end;
}

/* v2.2 Cover Title A/B Hook Variants Drawer */
.title-label-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-title-variants {
  border: 1px solid rgba(255, 36, 66, 0.28);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.14s ease;
}

.btn-title-variants:hover {
  background: var(--accent);
  color: #ffffff;
}

.variants-drawer {
  margin-top: 6px;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.variants-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-main);
}

.variants-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.variant-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.variant-item.locked {
  background: #fafbfe;
  border-style: dashed;
}

.variant-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.variant-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.variant-hook-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 5px;
  background: #eff6ff;
  color: #2563eb;
}

.variant-hook-tag.is-pro {
  background: #fef3c7;
  color: #92400e;
}

.variant-len {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.variant-preview {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-main);
  white-space: pre-line;
}

.variant-preview mark {
  background: #ffe2e7;
  color: #9f1239;
  padding: 0 3px;
  border-radius: 3px;
}

.variant-locked-mask {
  font-size: 12px;
  color: var(--text-muted);
}

.variant-why {
  font-size: 11px;
  color: var(--text-secondary);
}

.btn-apply-variant {
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-apply-variant:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-apply-variant.unlock-cta {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

/* ==================== TOAST NOTIFICATIONS ==================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #18181b;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.26);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.2s ease-out;
}

.toast.success {
  background: #065f46;
}

.toast.error {
  background: #991b1b;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 1280px) {
  :root {
    --panel-w: 390px;
  }
  .brand-slogan,
  .save-pill,
  .brand-en {
    display: none;
  }
  .btn,
  .btn-license {
    padding: 0 10px;
    font-size: 12.5px;
  }
}

@media (max-width: 1120px) {
  :root {
    --panel-w: 365px;
  }
  .topbar {
    padding: 0 10px;
    gap: 6px;
  }
  .topbar-left,
  .topbar-right {
    gap: 6px;
  }
  .sample-label {
    display: none;
  }
  .sample-switcher {
    padding: 3px 4px;
  }
  .sample-pill-btn {
    padding: 4px 7px;
    font-size: 11.5px;
  }
  .btn,
  .btn-license {
    padding: 0 9px;
    font-size: 12px;
  }
}

@media (max-width: 960px) {
  .topbar {
    height: auto;
    padding: 10px 14px;
    flex-wrap: wrap;
  }
  .topbar-center {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }
  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .editor-panel {
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .panel-body {
    max-height: none;
  }
  .preview-stage {
    min-height: 75vh;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .checkout-split {
    grid-template-columns: 1fr;
  }
}
