/* ==========================================================
   Aetas Content Studio - Main Stylesheet
   Design: Premium SaaS, Notion/Linear aesthetic
   Brands: Aetas Deep Blue #00205B, Turquoise #009CA6, Gold #9A7B3A
   ========================================================== */

/* ---- Custom Properties ---- */
:root {
  --brand-blue:    #00205B;
  --brand-teal:    #009CA6;
  --brand-gold:    #9A7B3A;
  --brand-gold-light: #B8975A;

  /* Light theme tokens */
  --bg-primary:    #FFFFFF;
  --bg-secondary:  #F8F9FA;
  --bg-tertiary:   #F1F3F5;
  --bg-elevated:   #FFFFFF;

  --text-primary:  #111827;
  --text-secondary: #4B5563;
  --text-tertiary: #9CA3AF;
  --text-muted:    #D1D5DB;

  --border-subtle: #E5E7EB;
  --border-default: #D1D5DB;
  --border-strong: #9CA3AF;

  --sidebar-bg:    #00205B;
  --sidebar-text:  rgba(255,255,255,0.7);
  --sidebar-text-active: #FFFFFF;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(255,255,255,0.12);
  --sidebar-border: rgba(255,255,255,0.08);

  --accent-blue:   #00205B;
  --accent-teal:   #009CA6;
  --accent-gold:   #9A7B3A;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.07), 0 4px 6px rgba(0,0,0,0.05);

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

  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  --sidebar-width: 230px;
  --topbar-height: 52px;

  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark theme */
[data-theme="dark"] {
  --bg-primary:    #0F0F0F;
  --bg-secondary:  #1A1A1A;
  --bg-tertiary:   #242424;
  --bg-elevated:   #1A1A1A;

  --text-primary:  #F9FAFB;
  --text-secondary: #D1D5DB;
  --text-tertiary: #6B7280;
  --text-muted:    #374151;

  --border-subtle: #1F2937;
  --border-default: #374151;
  --border-strong: #4B5563;

  --sidebar-bg:    #0A0A0A;
  --sidebar-text:  rgba(255,255,255,0.55);
  --sidebar-text-active: #FFFFFF;
  --sidebar-hover: rgba(255,255,255,0.05);
  --sidebar-active: rgba(0,156,166,0.15);
  --sidebar-border: rgba(255,255,255,0.06);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow: hidden;
}
a { color: var(--brand-teal); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
img, svg { display: block; }
ul, ol { list-style: none; }
details summary { cursor: pointer; }

/* ---- App Shell ---- */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--transition-slow), min-width var(--transition-slow);
  position: relative;
  z-index: 100;
}

.sidebar--collapsed {
  width: 56px;
  min-width: 56px;
}

.sidebar--collapsed .sidebar-brand-text,
.sidebar--collapsed .sidebar-section-label,
.sidebar--collapsed .sidebar-nav-item span:not(.sidebar-badge),
.sidebar--collapsed .sidebar-badge {
  opacity: 0;
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--sidebar-border);
  min-height: 60px;
}

.sidebar-logo {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-brand-text {
  overflow: hidden;
  transition: opacity var(--transition);
}

.sidebar-brand-name {
  display: block;
  color: white;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.sidebar-brand-sub {
  display: block;
  color: var(--sidebar-text);
  font-size: 11px;
  white-space: nowrap;
}

.sidebar-section {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}

.sidebar-section::-webkit-scrollbar { width: 4px; }
.sidebar-section::-webkit-scrollbar-track { background: transparent; }
.sidebar-section::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-section-label {
  display: block;
  color: var(--sidebar-text);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px 4px;
  transition: opacity var(--transition);
}

.sidebar-nav { display: flex; flex-direction: column; gap: 1px; }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 14px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.sidebar-nav-item svg {
  min-width: 16px;
  flex-shrink: 0;
}

.sidebar-nav-item:hover:not(:disabled) {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.sidebar-nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
}

.sidebar-nav-item--disabled {
  opacity: 0.45;
  cursor: default;
}

.sidebar-badge {
  margin-left: auto;
  font-size: 10px;
  background: rgba(255,255,255,0.1);
  color: var(--sidebar-text);
  padding: 1px 5px;
  border-radius: 10px;
  flex-shrink: 0;
}

.sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 6px 0;
}

.sidebar-settings {
  color: var(--sidebar-text);
}

/* ---- Main Area ---- */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-secondary);
}

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  flex-shrink: 0;
}

.sidebar-toggle {
  color: var(--text-secondary);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.sidebar-toggle:hover { background: var(--bg-tertiary); }

.topbar-breadcrumb {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-warning {
  font-size: 12px;
  background: #FEF3C7;
  color: #92400E;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
}

[data-theme="dark"] .topbar-warning {
  background: #451A03;
  color: #FDE68A;
}

.topbar-theme {
  color: var(--text-secondary);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.topbar-theme:hover { background: var(--bg-tertiary); }

/* ---- Content Area ---- */
.content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}

.content-area::-webkit-scrollbar { width: 6px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }

/* ---- Loading / Error States ---- */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--brand-teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-state, .coming-soon {
  padding: 80px 40px;
  text-align: center;
  color: var(--text-secondary);
}

.coming-soon h2 {
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.coming-soon-phase {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.coming-soon .btn { margin-top: 24px; }

/* ---- Dashboard ---- */
.dashboard {
  padding: 32px 36px;
  max-width: 1200px;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.dashboard-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.dashboard-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.dashboard-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  white-space: nowrap;
}

[data-theme="dark"] .dashboard-notice {
  background: #1C1400;
  border-color: #451A03;
  color: #FDE68A;
}

.link-btn {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.module-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity var(--transition);
}

.module-card:hover:not(.module-card--disabled) {
  border-color: var(--border-default);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.module-card:hover:not(.module-card--disabled)::before { opacity: 1; }

.card--blue::before  { background: var(--brand-blue); }
.card--teal::before  { background: var(--brand-teal); }
.card--gold::before  { background: var(--brand-gold); }
.card--grey::before  { background: var(--border-default); }

.module-card--disabled { cursor: default; opacity: 0.7; }

.card-icon {
  color: var(--text-tertiary);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
}

.card--blue .card-icon { background: #EEF2FF; color: var(--brand-blue); }
.card--teal .card-icon { background: #ECFEFF; color: var(--brand-teal); }
.card--gold .card-icon { background: #FFFBEB; color: var(--brand-gold); }

[data-theme="dark"] .card--blue .card-icon { background: rgba(0,32,91,0.3); }
[data-theme="dark"] .card--teal .card-icon { background: rgba(0,156,166,0.15); }
[data-theme="dark"] .card--gold .card-icon { background: rgba(154,123,58,0.15); }

.card-body { flex: 1; }

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.card-description {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.card-footer { display: flex; align-items: center; }

.card-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}

.card-status--active {
  background: #DCFCE7;
  color: #166534;
}

.card-status--soon {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
}

[data-theme="dark"] .card-status--active {
  background: rgba(22,163,74,0.15);
  color: #4ADE80;
}

.dashboard-phases {
  margin-top: 28px;
}

.phase-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}

.phase-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.phase-dot--blue { background: var(--brand-blue); }
.phase-dot--teal { background: var(--brand-teal); }
.phase-dot--gold { background: var(--brand-gold); }

/* ---- Module Container ---- */
.module-container {
  min-height: 100%;
}

.module-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 24px 36px 20px;
}

.module-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.module-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ---- Create Content Layout ---- */
.create-layout {
  display: flex;
  height: calc(100vh - var(--topbar-height) - 89px);
  overflow: hidden;
}

.create-form-panel {
  width: 340px;
  min-width: 340px;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
}

.create-form-panel::-webkit-scrollbar { width: 4px; }
.create-form-panel::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 2px; }

.create-results-panel {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-secondary);
}

.create-results-panel::-webkit-scrollbar { width: 6px; }
.create-results-panel::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }

/* ---- Form ---- */
.create-form { display: flex; flex-direction: column; gap: 0; }

.form-section {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.form-section:last-child { border-bottom: none; margin-bottom: 0; }

.form-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.form-group:last-child { margin-bottom: 0; }

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.required { color: #EF4444; margin-left: 2px; }

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 2px rgba(0,156,166,0.12);
}

.form-group input::placeholder { color: var(--text-muted); }

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-row input { flex: 1; }

.field-unit {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.field-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.field-hint code {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10px;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--brand-teal);
  color: white;
  border-color: var(--brand-teal);
}

.btn-primary:hover { background: #007f88; border-color: #007f88; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-generate {
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.btn-danger {
  background: #FEE2E2;
  color: #B91C1C;
  border-color: #FCA5A5;
}

.btn-danger:hover { background: #FECACA; }

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

.btn-small:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.btn-spinner svg {
  animation: spin 0.8s linear infinite;
}

/* ---- Results Empty State ---- */
.results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
}

.results-empty-icon {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.results-empty h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.results-empty p {
  font-size: 13px;
  max-width: 320px;
  line-height: 1.6;
}

.api-key-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
}

[data-theme="dark"] .api-key-notice {
  background: #1C1400;
  border-color: #451A03;
  color: #FDE68A;
}

/* ---- Results Content ---- */
.results-content {
  padding: 24px;
  max-width: 860px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.results-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.results-brand {
  font-weight: 600;
  color: var(--brand-blue);
}

[data-theme="dark"] .results-brand { color: var(--brand-teal); }

.results-sep { color: var(--text-muted); }

.results-exports {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---- Tabs ---- */
.results-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  overflow-x: auto;
}

.results-tabs::-webkit-scrollbar { height: 0; }

.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}

.tab:hover { color: var(--text-primary); }

.tab.active {
  color: var(--brand-teal);
  border-bottom-color: var(--brand-teal);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Result Blocks ---- */
.result-block {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.result-block h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.result-block p {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
}

.result-block ul {
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-block ul li {
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.result-block ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 4px;
  height: 4px;
  background: var(--brand-teal);
  border-radius: 50%;
}

.result-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.result-block-header h4 { margin-bottom: 0; }

.result-headline {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* Alternative headlines */
.alt-headlines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alt-headlines li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.alt-headlines li::before { display: none; }

.alt-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  min-width: 14px;
  margin-top: 1px;
}

.alt-text { flex: 1; color: var(--text-primary); line-height: 1.4; }

/* Article body */
.result-block--article .article-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  margin-top: 4px;
}

.article-body h1, .article-body h2, .article-body h3 {
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.article-body h1 { font-size: 20px; letter-spacing: -0.02em; }
.article-body h2 { font-size: 16px; letter-spacing: -0.01em; color: var(--brand-blue); }
.article-body h3 { font-size: 14px; }

[data-theme="dark"] .article-body h2 { color: var(--brand-teal); }

.article-body p { margin-bottom: 12px; }

.article-body ul, .article-body ol {
  margin: 8px 0 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.article-body li {
  list-style: disc;
  padding-left: 0;
}

.article-body li::before { display: none; }

.article-body strong { font-weight: 600; }

/* Takeaways */
.takeaways-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.takeaways-list li {
  padding: 8px 12px 8px 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  position: relative;
  line-height: 1.5;
}

.takeaways-list li::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 14px;
  width: 6px;
  height: 6px;
  background: var(--brand-teal);
  border-radius: 50%;
}

/* FAQ list */
.faq-list { display: flex; flex-direction: column; gap: 6px; }

.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-item summary {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-secondary);
  user-select: none;
  list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  float: right;
  font-size: 16px;
  color: var(--text-tertiary);
  line-height: 1;
}

.faq-item[open] summary::after { content: '-'; }

.faq-item p {
  padding: 10px 14px;
  font-size: 13px;
  border-top: 1px solid var(--border-subtle);
  line-height: 1.6;
}

/* SEO */
.seo-value {
  font-size: 13px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  line-height: 1.5;
  word-break: break-all;
}

.char-count {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  font-weight: 400;
  margin-left: 4px;
  letter-spacing: 0;
  text-transform: none;
}

.char-count.over { color: #EF4444; }

/* Social */
.social-preview {
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  background: var(--bg-secondary);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

/* Email */
.email-body-preview {
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  background: var(--bg-secondary);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  max-height: 400px;
  overflow-y: auto;
}

/* Schema */
.schema-code {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-height: 400px;
  overflow-y: auto;
}

/* Copy button */
.copy-btn {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  transition: all var(--transition);
}

.copy-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }

.copy-btn-small {
  font-size: 10px;
  color: var(--text-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  margin-left: auto;
  flex-shrink: 0;
}

.copy-btn-small:hover { background: var(--bg-secondary); }

/* ---- Settings ---- */
.settings-layout {
  padding: 28px 36px;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.settings-section h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.settings-section p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.6;
}

.api-key-row {
  display: flex;
  gap: 8px;
}

.api-key-row input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.api-key-row input:focus {
  outline: none;
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 2px rgba(0,156,166,0.12);
}

.theme-toggle-row {
  display: flex;
  gap: 8px;
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--bg-primary);
  transition: all var(--transition);
}

.theme-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }

.theme-btn.active {
  border-color: var(--brand-teal);
  color: var(--brand-teal);
  background: rgba(0,156,166,0.06);
}

.settings-section--info {
  border-top: 1px solid var(--border-subtle);
  padding-top: 28px;
}

.info-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.info-list div {
  background: var(--bg-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.info-list dt {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.info-list dd {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ---- Toast ---- */
.acs-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(8px);
  opacity: 0;
  transition: all var(--transition-slow);
  box-shadow: var(--shadow-lg);
  max-width: 360px;
}

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

.acs-toast--success {
  background: #0F766E;
  color: white;
}

.acs-toast--error {
  background: #B91C1C;
  color: white;
}

.acs-toast--info {
  background: var(--brand-blue);
  color: white;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .create-layout { flex-direction: column; height: auto; }
  .create-form-panel { width: 100%; min-width: 0; border-right: none; border-bottom: 1px solid var(--border-subtle); }
  .result-grid { grid-template-columns: 1fr; }
  .dashboard { padding: 20px; }
  .module-header, .settings-layout { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 600px) {
  .module-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-header { flex-direction: column; }
  .results-header { flex-direction: column; align-items: flex-start; }
  .results-exports { gap: 4px; }
  .btn-small { padding: 4px 8px; font-size: 11px; }
}

/* ---- Focus States ---- */
:focus-visible {
  outline: 2px solid var(--brand-teal);
  outline-offset: 2px;
}

button:focus:not(:focus-visible) { outline: none; }

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================
   Phase 2 Additions
   ========================================================== */

/* ---- Checkbox groups ---- */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--brand-teal);
}

/* ---- Campaign overview grid ---- */
.campaign-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.overview-stat {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--brand-teal);
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Email meta rows ---- */
.email-meta-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 4px;
}

.email-meta-label {
  font-weight: 600;
  color: var(--text-tertiary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 70px;
  flex-shrink: 0;
}

.email-meta-value {
  color: var(--text-primary);
  flex: 1;
}

/* ---- Numbered list ---- */
.numbered-list {
  list-style: decimal;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
}

.numbered-list li { line-height: 1.5; }

/* ---- Objection handling ---- */
.objection-item {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.objection-q { margin-bottom: 6px; }
.objection-a { color: var(--text-secondary); }

/* ---- Tags ---- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

/* ---- SEO checklist ---- */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.checklist-item--pass {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
}

.checklist-item--warn {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
}

[data-theme="dark"] .checklist-item--pass {
  background: rgba(22,163,74,0.1);
  border-color: rgba(22,163,74,0.2);
}

[data-theme="dark"] .checklist-item--warn {
  background: rgba(234,179,8,0.1);
  border-color: rgba(234,179,8,0.2);
}

.checklist-icon {
  font-size: 13px;
  font-weight: 700;
  min-width: 16px;
  margin-top: 1px;
}

.checklist-item--pass .checklist-icon { color: #16A34A; }
.checklist-item--warn .checklist-icon { color: #D97706; }

.checklist-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checklist-label {
  font-weight: 500;
  color: var(--text-primary);
}

.checklist-note {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---- Schema Generator ---- */
.schema-gen-layout {
  min-height: calc(100vh - var(--topbar-height) - 89px);
}

.schema-type-grid {
  padding: 28px 36px;
}

.schema-selector-header {
  margin-bottom: 20px;
}

.schema-selector-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.schema-type-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.schema-type-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.schema-type-card:hover {
  border-color: var(--brand-teal);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.schema-type-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.schema-type-desc {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.schema-back-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 16px 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.schema-current-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-teal);
}

.schema-build-area .create-layout {
  height: calc(100vh - var(--topbar-height) - 89px);
}

/* ---- Textarea form fields ---- */
.form-group textarea {
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-primary);
  resize: vertical;
  min-height: 70px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 2px rgba(0,156,166,0.12);
}

.form-group textarea::placeholder { color: var(--text-muted); }

/* ---- FAQ input groups ---- */
.faq-input-group {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 10px;
}
