/* ============================================
           GLOBAL STYLES & UNIFIED THEME SYSTEM
           ============================================ */

/* Midnight Theme (Dark - Default) */
:root,
[data-theme="midnight"] {
  --bg: #0b1221;
  --bg-alt: #101827;
  --surface: #1a2436;
  --panel: #1a2332;
  --panel-light: #293548;
  --ink: #f8fafc;
  --ink-secondary: #94a3b8;
  --ink-muted: #64748b;
  --muted: #64748b;
  --line: #334155;
  --line-soft: #1e293b;
  --border: rgba(255, 255, 255, 0.06);
  --accent: #10b981;
  --accent-secondary: #059669;
  --accent-glow: rgba(16, 185, 129, 0.15);
  --cyan: #06b6d4;
  --teal: #10b981;
  --orange: #f97316;
  --gold: #E9C46A;
  --glow: 0 18px 44px rgba(0,0,0,0.4);
  --blue-500: #10b981;
  --blue-600: #059669;
}

/* Cream Theme (Light) */
[data-theme="cream"] {
  --bg: #fdfbf7;
  --bg-alt: #f8f5f0;
  --surface: #ffffff;
  --panel: #ffffff;
  --panel-light: #f0ebe3;
  --ink: #1a1a1a;
  --ink-secondary: #4a4a4a;
  --ink-muted: #7a7a7a;
  --muted: #7a7a7a;
  --line: #e5e0d8;
  --line-soft: #f0ebe3;
  --border: #d4cfc4;
  --accent: #d97706;
  --accent-secondary: #b45309;
  --accent-glow: rgba(217, 119, 6, 0.1);
  --cyan: #0891b2;
  --teal: #0d9488;
  --glow: 0 18px 44px rgba(0,0,0,0.08);
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
}

/* Ocean Breeze Theme (Light) */
[data-theme="ocean"] {
  --bg: #f0f9ff;
  --bg-alt: #e0f2fe;
  --surface: #ffffff;
  --panel: #ffffff;
  --panel-light: #e0f2fe;
  --ink: #0c4a6e;
  --ink-secondary: #075985;
  --ink-muted: #0369a1;
  --muted: #0369a1;
  --line: #bae6fd;
  --line-soft: #e0f2fe;
  --border: #bae6fd;
  --accent: #0284c7;
  --accent-secondary: #0369a1;
  --accent-glow: rgba(2, 132, 199, 0.1);
  --cyan: #0284c7;
  --teal: #0d9488;
  --glow: 0 18px 44px rgba(0,0,0,0.08);
  --blue-500: #0ea5e9;
  --blue-600: #0284c7;
}

/* Tanzanite Theme (Dark) */
[data-theme="tanzanite"] {
  --bg: #0f0d1a;
  --bg-alt: #1a1625;
  --surface: #252136;
  --panel: #1e1a2e;
  --panel-light: #352f4a;
  --ink: #e8e4f0;
  --ink-secondary: #c4bdd4;
  --ink-muted: #8b82a8;
  --muted: #8b82a8;
  --line: #3d3654;
  --line-soft: #2a2440;
  --border: #3d3654;
  --accent: #a78bfa;
  --accent-secondary: #8b5cf6;
  --accent-glow: rgba(167, 139, 250, 0.15);
  --cyan: #a78bfa;
  --teal: #8b5cf6;
  --glow: 0 18px 44px rgba(0,0,0,0.4);
  --blue-500: #a78bfa;
  --blue-600: #8b5cf6;
}

/* Obsidian Theme (Dark) */
[data-theme="obsidian"] {
  --bg: #09090b;
  --bg-alt: #18181b;
  --surface: #27272a;
  --panel: #1c1c1f;
  --panel-light: #3f3f46;
  --ink: #fafafa;
  --ink-secondary: #d4d4d8;
  --ink-muted: #71717a;
  --muted: #71717a;
  --line: #3f3f46;
  --line-soft: #27272a;
  --border: #3f3f46;
  --accent: #f59e0b;
  --accent-secondary: #d97706;
  --accent-glow: rgba(245, 158, 11, 0.15);
  --cyan: #f59e0b;
  --teal: #d97706;
  --glow: 0 18px 44px rgba(0,0,0,0.4);
  --blue-500: #f59e0b;
  --blue-600: #d97706;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LISTING STUDIO SPECIFIC VARIABLE MAPPINGS
   Map legacy variable names to unified theme system
   ═══════════════════════════════════════════════════════════════════════════ */

:root, [data-theme="midnight"], [data-theme="tanzanite"], [data-theme="obsidian"] {
  /* Legacy variable mappings for backwards compatibility */
  --bg-primary: var(--bg);
  --bg-secondary: var(--surface);
  --bg-tertiary: var(--panel);
  --bg-elevated: var(--panel-light);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-secondary);
  --text-muted: var(--ink-muted);
  --border-subtle: var(--line-soft);
  --border-medium: var(--line);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-glow: var(--glow);
  --accent-warm: var(--orange);
  --accent-warm-dim: rgba(249, 115, 22, 0.1);
  --accent-blue: var(--cyan);
  --accent-blue-dim: rgba(6, 182, 212, 0.1);
  --accent-success: var(--teal);
  --accent-success-dim: rgba(16, 185, 129, 0.1);
  --accent-warning: var(--gold);
  --accent-warning-dim: rgba(233, 196, 106, 0.1);
  --accent-error: #ef4444;
}

[data-theme="cream"], [data-theme="ocean"] {
  /* Legacy variable mappings for light themes */
  --bg-primary: var(--bg);
  --bg-secondary: var(--surface);
  --bg-tertiary: var(--panel);
  --bg-elevated: var(--panel-light);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-secondary);
  --text-muted: var(--ink-muted);
  --border-subtle: var(--line-soft);
  --border-medium: var(--line);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-glow: var(--glow);
  --accent-warm: #c45c40;
  --accent-warm-dim: rgba(196, 92, 64, 0.1);
  --accent-blue: var(--cyan);
  --accent-blue-dim: rgba(8, 145, 178, 0.1);
  --accent-success: var(--teal);
  --accent-success-dim: rgba(13, 148, 136, 0.1);
  --accent-warning: #d97706;
  --accent-warning-dim: rgba(217, 119, 6, 0.1);
  --accent-error: #dc2626;
}

/* ═══════════════════════════════════════════════════════════════════════════
   UNIFIED TOOLBAR STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.app-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-toolbar.active {
  display: flex;
}

/* Toolbar Sections */
.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Theme Selector */
.theme-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-label {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

.theme-label svg {
  width: 18px;
  height: 18px;
}

.theme-selector select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 32px 8px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.theme-selector select:hover {
  border-color: var(--cyan);
}

.theme-selector select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

@media (max-width: 768px) {
  .theme-selector select {
    padding: 6px 28px 6px 10px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .theme-selector {
    display: none;
  }
}

/* Toolbar Buttons */
.toolbar-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.toolbar-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.toolbar-btn:hover {
  border-color: var(--cyan);
}

.toolbar-btn:active {
  transform: scale(0.95);
}

/* Toolbar Logo */
.toolbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-logo .logo-icon-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.toolbar-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-warm), #C45C40);
  color: #050811;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.toolbar-logo .logo-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text-primary);
}

@media (max-width: 600px) {
  .toolbar-logo .logo-text {
    display: none;
  }
}

/* Profile Button & Dropdown */
.toolbar-profile {
  position: relative;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-btn:hover {
  background: var(--surface);
  border-color: var(--muted);
}

.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-warm), #C45C40);
  color: #050811;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.toolbar-profile.open .profile-chevron {
  transform: rotate(180deg);
}

@media (max-width: 600px) {
  .profile-name {
    display: none;
  }
  .profile-btn {
    padding: 6px;
    border-radius: 50%;
  }
  .profile-chevron {
    display: none;
  }
}

/* Profile Dropdown */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transform-origin: top right;
  transition: all 0.2s ease;
  z-index: 1001;
}

.toolbar-profile.open .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.dropdown-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-warm), #C45C40);
  color: #050811;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropdown-user-details {
  flex: 1;
  min-width: 0;
}

.dropdown-user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-email {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-plan {
  font-size: 0.7rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--surface);
}

.dropdown-item:last-child {
  border-radius: 0 0 12px 12px;
}

.dropdown-item svg {
  color: var(--muted);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP LAUNCHER STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.app-launcher-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 998;
}

.app-launcher-overlay.active {
  opacity: 1;
  visibility: visible;
}

.app-launcher {
  position: fixed;
  top: 64px;
  left: 16px;
  width: 320px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9) translateY(-10px);
  transform-origin: top left;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  overflow: hidden;
}

.app-launcher.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.app-launcher-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.app-launcher-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px;
}

.app-launcher-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--text-primary);
}

.app-launcher-item:hover {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}

.app-launcher-item.current {
  background: var(--bg-elevated);
  border-color: var(--accent-warm);
}

.app-launcher-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-tertiary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-warm);
  transition: all 0.2s ease;
}

.app-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.app-launcher-item:hover .app-launcher-icon {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.app-launcher-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  color: var(--text-primary);
  line-height: 1.3;
}

@media (max-width: 400px) {
  .app-launcher {
    left: 8px;
    right: 8px;
    width: auto;
  }
}

/* Adjust body padding when toolbar is visible */
body.toolbar-active {
  padding-top: 56px;
}

/* Hide old user-info-badge when toolbar is active */
body.toolbar-active .user-info-badge {
  display: none !important;
}

/* ============================================
           GLOBAL ELEMENT STYLES
           ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-warm) 0%, #C45C40 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    flex-shrink: 0;
}

.logo-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logo-version {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    font-family: 'Inter', sans-serif;
}

/* Header Activity Indicator */
.header-activity {
    display: none;
    position: relative;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.header-activity.active {
    display: flex;
}

.header-activity.active+.logo-text {
    margin-left: -0.25rem;
}

.logo-icon.hidden {
    display: none;
}

.header-spinner {
    position: absolute;
    width: 38px;
    height: 38px;
    border: 2.5px solid var(--border-medium);
    border-top-color: var(--accent-warm);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
    box-shadow:
        0 0 12px rgba(212, 149, 106, 0.4),
        0 0 24px rgba(212, 149, 106, 0.2),
        inset 0 0 8px rgba(212, 149, 106, 0.1);
}

/* Glowing circle behind the X */
.header-activity::before {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 149, 106, 0.15) 0%, transparent 70%);
    animation: glow-pulse 1.5s ease-in-out infinite;
}

@keyframes glow-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
        box-shadow: 0 0 15px rgba(212, 149, 106, 0.5);
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
        box-shadow: 0 0 25px rgba(212, 149, 106, 0.7);
    }
}

.header-x-logo {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    filter: drop-shadow(0 0 4px rgba(212, 149, 106, 0.6));
    animation: x-pulse 1.5s ease-in-out infinite;
}

@keyframes x-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        filter: drop-shadow(0 0 4px rgba(212, 149, 106, 0.6));
    }

    50% {
        opacity: 0.85;
        transform: scale(0.95);
        filter: drop-shadow(0 0 8px rgba(212, 149, 106, 0.9));
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.92);
    }
}

/* Header Style Selector */
.header-style-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.header-style-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.header-style-dropdown {
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    min-width: 100px;
}

.header-style-dropdown:hover {
    border-color: var(--accent-warm);
}

.header-style-dropdown:focus {
    outline: none;
    border-color: var(--accent-warm);
    box-shadow: 0 0 0 2px rgba(224, 122, 95, 0.2);
}

/* Main Layout */
.main-container {
    display: flex;
    min-height: calc(100vh - 65px);
    flex: 1;
}

/* Input Mode */
.input-mode {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 2rem 2rem;
}

.input-mode.hidden {
    display: none;
}

.input-container {
    width: 100%;
    max-width: 800px;
}

.input-header {
    text-align: center;
    margin-bottom: 2rem;
}

.input-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.input-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 32px 20px 16px;
    margin-bottom: 20px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(6,182,212,0.15), rgba(20,184,166,0.1));
    border: 1px solid rgba(6,182,212,0.3);
    border-radius: 50px;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cyan);
    margin-bottom: 14px;
    animation: pulse-glow 2s ease-in-out infinite !important;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(6,182,212,0.3); }
    50% { box-shadow: 0 0 20px 4px rgba(6,182,212,0.15); }
}

.hero-badge-icon {
    font-size: 1.1rem;
}

.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 10px;
    letter-spacing: -1px;
    position: relative;
}

.hero-title .gradient-text {
    background: linear-gradient(135deg, var(--accent-warm), #C45C40);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

.hero-subtitle strong {
    color: var(--text-primary);
    font-weight: 700;
}

.input-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: var(--radius-md);
}

.input-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    font-family: inherit;
}

.input-tab.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.input-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-subtle);
}

.input-panel.hidden {
    display: none;
}

.paste-area {
    width: 100%;
    min-height: 300px;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.7;
    resize: vertical;
    transition: border-color 0.2s;
}

.paste-area:focus {
    outline: none;
    border-color: var(--accent-warm);
}

.paste-area::placeholder {
    color: var(--text-muted);
}

/* Headline Input */
.headline-input-group {
    margin-bottom: 1rem;
}

.headline-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.headline-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    transition: border-color 0.2s;
}

.headline-input:focus {
    outline: none;
    border-color: var(--accent-warm);
}

.headline-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* Quick Form */
.quick-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.8rem;
    color: var(--ink-muted);
    font-weight: 500;
}

.form-input,
.form-textarea,
.form-select {
    padding: 0.7rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--cyan);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

/* Analyze Button */
.analyze-section {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Writing Style Section */
.writing-style-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.style-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.style-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
}

.style-section-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.writing-styles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.writing-style {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.writing-style:hover {
    border-color: var(--border-medium);
    background: var(--bg-elevated);
}

.writing-style.selected {
    border-color: var(--accent-warm);
    background: var(--accent-warm-dim);
}

.writing-style .style-check {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: transparent;
    transition: all 0.2s;
}

.writing-style.selected .style-check {
    background: var(--accent-warm);
    border-color: var(--accent-warm);
    color: white;
}

.style-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.style-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.style-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.btn-analyze {
    flex: 1;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-warm) 0%, #C45C40 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-analyze:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(224, 122, 95, 0.3);
}

/* Comparison Mode */
.comparison-mode {
    flex: 1;
    display: none;
    flex-direction: column;
}

.comparison-mode.active {
    display: flex;
}

/* Three Column Layout */
.columns-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    flex: 1;
    overflow: hidden;
}

.column {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-subtle);
    overflow: hidden;
    min-height: 0;
    /* Critical: allows flex shrinking below content size */
}

.column:last-child {
    border-right: none;
}

/* Column Color Theme: OLD → ANALYSIS → NEW */
/* Left: Cool slate (past/original) */
.column-original {
    background: linear-gradient(180deg,
            rgba(107, 154, 196, 0.12) 0%,
            rgba(107, 154, 196, 0.04) 40%,
            rgba(107, 154, 196, 0.08) 100%);
    border-left: 1px solid rgba(107, 154, 196, 0.2);
    box-shadow: inset 0 0 60px rgba(107, 154, 196, 0.04);
}

.column-header-original {
    border-top: 3px solid #6B9AC4;
    background: linear-gradient(180deg,
            rgba(107, 154, 196, 0.28) 0%,
            rgba(107, 154, 196, 0.10) 100%);
    box-shadow:
        inset 0 -1px 0 rgba(107, 154, 196, 0.15),
        0 2px 8px rgba(107, 154, 196, 0.08);
}

.column-original .column-body-top,
.column-original .column-body-bottom {
    border-right: 1px solid rgba(107, 154, 196, 0.08);
}

/* Middle: Warm gold (analysis/insight) */
.column-signalboard {
    background: linear-gradient(180deg,
            rgba(212, 165, 116, 0.12) 0%,
            rgba(212, 165, 116, 0.04) 40%,
            rgba(212, 165, 116, 0.09) 100%);
    border-left: 1px solid rgba(212, 165, 116, 0.15);
    border-right: 1px solid rgba(212, 165, 116, 0.15);
    box-shadow: inset 0 0 80px rgba(212, 165, 116, 0.05);
}

.column-header-signalboard {
    border-top: 3px solid #D4A574;
    background: linear-gradient(180deg,
            rgba(212, 165, 116, 0.30) 0%,
            rgba(212, 165, 116, 0.12) 100%);
    box-shadow:
        inset 0 -1px 0 rgba(212, 165, 116, 0.18),
        0 2px 8px rgba(212, 165, 116, 0.10);
}

/* Right: Fresh green (future/improved) */
.column-rewrite {
    background: linear-gradient(180deg,
            rgba(129, 178, 154, 0.14) 0%,
            rgba(129, 178, 154, 0.05) 40%,
            rgba(129, 178, 154, 0.10) 100%);
    border-right: 1px solid rgba(129, 178, 154, 0.2);
    box-shadow: inset 0 0 60px rgba(129, 178, 154, 0.05);
}

.column-header-rewrite {
    border-top: 3px solid #81B29A;
    background: linear-gradient(180deg,
            rgba(129, 178, 154, 0.32) 0%,
            rgba(129, 178, 154, 0.12) 100%);
    box-shadow:
        inset 0 -1px 0 rgba(129, 178, 154, 0.15),
        0 2px 8px rgba(129, 178, 154, 0.10);
}

.column-rewrite .column-body {
    border-left: 1px solid rgba(129, 178, 154, 0.08);
    background: linear-gradient(180deg,
            transparent 0%,
            rgba(129, 178, 154, 0.03) 100%);
    padding: 1.5rem;
}

/* Split Column Layout */
.column-split {
    display: flex;
    flex-direction: column;
}

.column-body-top {
    flex: 0.75;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    min-height: 0;
}

.column-body-bottom {
    flex: 0.25;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0.75rem;
    border-top: none;
    background: linear-gradient(180deg,
            rgba(107, 154, 196, 0.05) 0%,
            rgba(107, 154, 196, 0.02) 100%);
    min-height: 0;
    /* Removed max-height: 25% - let flex ratio handle sizing */
}

/* Resize Handle */
.resize-handle {
    flex-shrink: 0;
    height: 12px;
    background: linear-gradient(180deg,
            rgba(107, 154, 196, 0.08) 0%,
            rgba(107, 154, 196, 0.15) 50%,
            rgba(107, 154, 196, 0.08) 100%);
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.2s ease;
    border-top: 1px solid rgba(107, 154, 196, 0.15);
    border-bottom: 1px solid rgba(107, 154, 196, 0.15);
}

.resize-handle:hover {
    background: linear-gradient(180deg,
            rgba(107, 154, 196, 0.15) 0%,
            rgba(107, 154, 196, 0.25) 50%,
            rgba(107, 154, 196, 0.15) 100%);
}

.resize-handle:active,
.resize-handle.dragging {
    background: linear-gradient(180deg,
            rgba(212, 165, 116, 0.2) 0%,
            rgba(212, 165, 116, 0.35) 50%,
            rgba(212, 165, 116, 0.2) 100%);
}

.resize-handle-bar {
    width: 40px;
    height: 4px;
    background: rgba(107, 154, 196, 0.4);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.resize-handle:hover .resize-handle-bar {
    background: rgba(107, 154, 196, 0.6);
    width: 50px;
}

.resize-handle:active .resize-handle-bar,
.resize-handle.dragging .resize-handle-bar {
    background: rgba(212, 165, 116, 0.7);
    width: 60px;
}

/* Advanced Bubble Container */
.advanced-bubble {
    background: transparent;
    padding: 0;
    margin-top: 0;
}

.advanced-bubble-header {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6B9AC4;
    font-weight: 700;
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(107, 154, 196, 0.2);
}

/* 4-Box Grid Layout */
.advice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
}

.advice-box {
    background: linear-gradient(180deg,
            rgba(107, 154, 196, 0.12) 0%,
            rgba(107, 154, 196, 0.04) 100%);
    border: 1px solid rgba(107, 154, 196, 0.2);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    min-width: 0;
    /* Allow grid item to shrink */
}

.advice-box:hover {
    background: linear-gradient(180deg,
            rgba(107, 154, 196, 0.18) 0%,
            rgba(107, 154, 196, 0.08) 100%);
    border-color: rgba(107, 154, 196, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 154, 196, 0.15);
}

.advice-box.expanded {
    background: linear-gradient(180deg,
            rgba(107, 154, 196, 0.22) 0%,
            rgba(107, 154, 196, 0.10) 100%);
    border-color: rgba(107, 154, 196, 0.4);
}

.advice-box-header {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.15rem;
}

.advice-box-icon {
    font-size: 0.75rem;
    line-height: 1;
}

.advice-box-title {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8BB8DC;
    flex: 1;
}

.advice-box-badge {
    font-size: 0.55rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 10px;
    background: rgba(107, 154, 196, 0.25);
    color: #A0C4E8;
}

.advice-box-badge.warning {
    background: rgba(224, 122, 95, 0.25);
    color: #E89B7F;
}

.advice-box-badge.success {
    background: rgba(129, 178, 154, 0.25);
    color: #9FD4BB;
}

.advice-box-preview {
    font-size: 0.6rem;
    color: var(--text-secondary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.advice-box-expand {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.7rem;
    color: rgba(107, 154, 196, 0.5);
    transition: all 0.2s;
}

.advice-box:hover .advice-box-expand {
    color: rgba(107, 154, 196, 0.8);
}

.advice-box.expanded .advice-box-expand {
    transform: rotate(45deg);
    color: #6B9AC4;
}

.advice-box-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease;
}

.advice-box.expanded .advice-box-content {
    max-height: 200px;
    margin-top: 0.5rem;
}

.advice-box-content-inner {
    font-size: 0.7rem;
    color: var(--text-primary);
    line-height: 1.5;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(107, 154, 196, 0.15);
}

/* Standards Mini Form */
.standards-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.standards-mini-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.standards-mini-item input {
    width: 32px;
    padding: 0.2rem 0.3rem;
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(107, 154, 196, 0.25);
    border-radius: 4px;
    color: var(--text-primary);
    text-align: center;
}

.standards-mini-item input:focus {
    outline: none;
    border-color: #6B9AC4;
}

.btn-apply-mini {
    width: 100%;
    margin-top: 0.4rem;
    padding: 0.35rem;
    font-size: 0.65rem;
    font-weight: 600;
    background: linear-gradient(180deg, #6B9AC4 0%, #5A89B3 100%);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: none;
}

.btn-apply-mini.visible {
    display: block;
}

.btn-apply-mini:hover {
    background: linear-gradient(180deg, #7BAAD4 0%, #6B9AC4 100%);
}

/* Insights List */
.insights-mini-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.3rem;
}

.insight-mini-item {
    font-size: 0.65rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(107, 154, 196, 0.1);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.insight-mini-item:last-child {
    border-bottom: none;
}

.insight-mini-icon {
    font-size: 0.6rem;
}

/* Advice Popup Modal */
.advice-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
}

.advice-popup-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.advice-popup {
    background: linear-gradient(180deg, #2A3441 0%, #232B35 100%);
    border: 1px solid rgba(107, 154, 196, 0.3);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(107, 154, 196, 0.1);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.advice-popup-overlay.active .advice-popup {
    transform: scale(1) translateY(0);
}

.advice-popup-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.advice-popup-close:hover {
    background: rgba(224, 122, 95, 0.3);
    color: #E07A5F;
}

.advice-popup-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(180deg,
            rgba(107, 154, 196, 0.15) 0%,
            rgba(107, 154, 196, 0.05) 100%);
    border-bottom: 1px solid rgba(107, 154, 196, 0.2);
}

.advice-popup-icon {
    font-size: 1.5rem;
}

.advice-popup-title {
    font-size: 1rem;
    font-weight: 700;
    color: #8BB8DC;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.advice-popup-content {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.popup-section {
    margin-bottom: 1rem;
}

.popup-section:last-child {
    margin-bottom: 0;
}

.popup-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(107, 154, 196, 0.15);
}

.popup-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.popup-item-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.popup-standards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.popup-standard-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.popup-standard-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.popup-standard-input {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.popup-standard-input input {
    width: 60px;
    padding: 0.5rem;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(107, 154, 196, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
    text-align: center;
}

.popup-standard-input input:focus {
    outline: none;
    border-color: #6B9AC4;
    box-shadow: 0 0 0 3px rgba(107, 154, 196, 0.15);
}

.popup-standard-input span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.popup-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: linear-gradient(180deg, #6B9AC4 0%, #5A89B3 100%);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: none;
}

.popup-btn.visible {
    display: block;
}

.popup-btn:hover {
    background: linear-gradient(180deg, #7BAAD4 0%, #6B9AC4 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 154, 196, 0.3);
}

.popup-insight-card {
    background: rgba(107, 154, 196, 0.08);
    border: 1px solid rgba(107, 154, 196, 0.15);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.popup-insight-card:last-child {
    margin-bottom: 0;
}

.popup-insight-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.popup-insight-icon {
    font-size: 0.9rem;
}

.popup-insight-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #8BB8DC;
}

.popup-insight-body {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.popup-level-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: linear-gradient(135deg, var(--accent-warm-dim), var(--accent-blue-dim));
    border-radius: 8px;
    margin-bottom: 1rem;
}

.popup-level-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-warm);
}

.popup-level-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.popup-level-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-warm), var(--accent-success));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Collapsible Sections - Keep for compatibility */
.collapsible-section {
    margin-top: 0.5rem;
    cursor: pointer;
    display: none;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.collapsible-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.collapsible-section.expanded .collapsible-icon {
    color: var(--accent-warm);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.collapsible-section.expanded .collapsible-content {
    max-height: 300px;
    padding-top: 0.5rem;
}

.section-header-mini {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-subtle);
    display: none;
}

/* Intelligence Panels - Hidden, replaced by grid */
.intelligence-panels {
    display: none;
}

.intel-panel {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.intel-panel:hover {
    background: rgba(255, 255, 255, 0.05);
}

.intel-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
}

.intel-panel-icon {
    font-size: 0.8rem;
}

.intel-panel-title {
    flex: 1;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.intel-expand {
    font-size: 0.9rem;
    color: var(--text-muted);
    width: 16px;
    text-align: center;
}

.intel-panel.expanded .intel-expand {
    color: var(--accent-warm);
}

.intel-panel-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    font-size: 0.75rem;
    color: var(--text-primary);
    line-height: 1.5;
    padding: 0 0.6rem;
}

.intel-panel.expanded .intel-panel-content {
    max-height: 200px;
    padding: 0 0.6rem 0.6rem 0.6rem;
}

.intel-brief {
    white-space: pre-wrap;
}

/* Key Insights Left Column - Hidden, in grid now */
.key-insights-left {
    display: none;
    flex-direction: column;
    gap: 0.4rem;
}

.insights-level-badge-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: linear-gradient(135deg, var(--accent-warm-dim), var(--accent-blue-dim));
    border-radius: var(--radius-sm);
}

.level-label-left {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--accent-warm);
}

.level-progress-left {
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.level-progress-bar-left {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-warm), var(--accent-success));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.insights-cards-left {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.insight-card-left {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 2px solid var(--accent-blue);
}

.insight-card-left:hover {
    background: rgba(255, 255, 255, 0.05);
}

.insight-card-left.transformation {
    border-left-color: var(--accent-success);
}

.insight-card-left.warning {
    border-left-color: var(--accent-warning);
}

.insight-card-left.improvement {
    border-left-color: var(--accent-warm);
}

.insight-card-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.5rem;
}

.insight-icon-left {
    font-size: 0.7rem;
}

.insight-title-left {
    flex: 1;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.insight-expand-left {
    font-size: 0.8rem;
    color: var(--text-muted);
    width: 14px;
    text-align: center;
}

.insight-card-left.expanded .insight-expand-left {
    color: var(--accent-warm);
}

.insight-body-left {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    font-size: 0.7rem;
    color: var(--text-primary);
    line-height: 1.4;
    padding: 0 0.5rem;
}

.insight-card-left.expanded .insight-body-left {
    max-height: 150px;
    padding: 0 0.5rem 0.5rem 0.5rem;
}

.insights-encouragement-left {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    color: var(--text-primary);
    border-left: 2px solid var(--accent-warm);
}

/* SignalBoard Column with Chat */
.column-body-signalboard {
    flex: 1;
    overflow: hidden;
    /* Container clips, not scrolls */
    padding: 1rem;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Inline Chat - Light Warm Bubble */
.chat-inline {
    background: transparent;
    flex-shrink: 0;
    /* Never shrink the chat */
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    margin-top: 1rem;
    /* Add spacing after buyer selector */
}

.chat-bubble {
    border-radius: var(--radius-md);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--glow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-input-inline {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    gap: 0.5rem;
    background: var(--surface);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    flex-shrink: 0;
    align-items: flex-end;
}

.chat-input-inline .chat-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    min-height: 72px;
    border-radius: var(--radius-sm);
    background: var(--bg-alt);
    border: 1px solid var(--line);
    color: var(--ink);
    resize: none;
    line-height: 1.4;
    font-family: inherit;
}

.chat-input-inline .chat-input::placeholder {
    color: var(--ink-muted);
}

.chat-input-inline .btn-send {
    padding: 0.5rem 0.75rem;
    min-height: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    border: none;
    flex-shrink: 0;
    align-self: flex-end;
    color: var(--bg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-input-inline .btn-send svg {
    stroke: currentColor;
}

.chat-input-inline .btn-send:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.chat-messages-inline {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 0;
    max-height: 90px;
    background: var(--bg-alt);
}

.chat-messages-inline::-webkit-scrollbar {
    width: 6px;
}

.chat-messages-inline::-webkit-scrollbar-track {
    background: var(--line-soft);
    border-radius: 3px;
}

.chat-messages-inline::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 3px;
}

.chat-messages-inline::-webkit-scrollbar-thumb:hover {
    background: var(--accent-glow);
}

.chat-messages-inline .chat-message {
    color: var(--ink-secondary) !important;
    font-size: 0.75rem !important;
    padding: 0.35rem 0.6rem !important;
    border-radius: 6px !important;
    max-width: 85% !important;
    background: transparent !important;
}

.chat-messages-inline .chat-message.user {
    align-self: flex-end !important;
    background: var(--accent-glow) !important;
    color: var(--ink) !important;
    border-bottom-right-radius: 2px !important;
}

.chat-messages-inline .chat-message.assistant {
    align-self: flex-start !important;
    background: var(--surface) !important;
    color: var(--ink-secondary) !important;
    border-bottom-left-radius: 2px !important;
}

.column-header {
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.column-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
}

.column-score {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
}

.score-before {
    color: #6B9AC4;
    /* Cool blue - matches original column */
}

.score-after {
    color: #81B29A;
    /* Fresh green - matches rewrite column */
}

.column-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.25rem;
    min-height: 0;
    /* Critical for flex shrinking */
}

/* Original Listing Column */
.original-content {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.original-content .highlight-bad {
    background: var(--accent-warning-dim);
    color: var(--accent-warning);
    padding: 0 4px;
    border-radius: 3px;
}

.original-content .highlight-generic {
    background: rgba(224, 122, 95, 0.15);
    color: var(--accent-warm);
    padding: 0 4px;
    border-radius: 3px;
    text-decoration: line-through;
    text-decoration-color: var(--accent-warm);
}

.original-headline {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}

.original-headline::before {
    content: 'ORIGINAL HEADLINE';
    position: absolute;
    top: -1.25rem;
    left: 0;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.original-body {
    white-space: pre-wrap;
    line-height: 1.7;
}

/* SignalBoard Column */
.signalboard {
    font-size: 0.85rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.signalboard-section {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(212, 165, 116, 0.04);
    border-radius: var(--radius-md);
    border: 1px solid rgba(212, 165, 116, 0.08);
}

/* Adjust Target Market section */
.signalboard-section.buyer-section {
    margin-bottom: 0;
}

/* Total Score Circles Section */
.total-score-section {
    padding: 1rem 0.75rem;
}

.total-score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.score-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.score-circle-before {
    background: linear-gradient(135deg, rgba(224, 122, 106, 0.15) 0%, rgba(224, 122, 106, 0.05) 100%);
    border: 3px solid rgba(224, 122, 106, 0.5);
    box-shadow: 0 0 20px rgba(224, 122, 106, 0.2);
}

.score-circle-after {
    background: linear-gradient(135deg, rgba(122, 196, 160, 0.2) 0%, rgba(122, 196, 160, 0.08) 100%);
    border: 3px solid rgba(122, 196, 160, 0.6);
    box-shadow: 0 0 25px rgba(122, 196, 160, 0.3);
}

.score-circle-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.score-circle-before .score-circle-value {
    color: #E07A6A;
}

.score-circle-after .score-circle-value {
    color: #7AC4A0;
}

.score-circle-label {
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-top: 2px;
}

.score-arrow-large {
    font-size: 1.8rem;
    color: var(--accent-warm);
    font-weight: 300;
    opacity: 0.8;
}

.score-improvement {
    font-size: 0.85rem;
    font-weight: 700;
    color: #7AC4A0;
    background: rgba(122, 196, 160, 0.15);
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    margin-left: 0.5rem;
}

.signalboard-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #D4A574;
    margin-bottom: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.coaching-level-badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    background: rgba(212, 165, 116, 0.2);
    color: #D4A574;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-left: auto;
}

/* Score Grid */
.score-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.score-row {
    display: grid;
    grid-template-columns: 1fr 60px 60px;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: rgba(212, 165, 116, 0.06);
    border-radius: var(--radius-sm);
    gap: 0.5rem;
    border: 1px solid rgba(212, 165, 116, 0.06);
}

.score-row-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.score-cell {
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.score-cell.before {
    background: rgba(107, 154, 196, 0.15);
    color: #6B9AC4;
    /* Cool blue - original */
}

.score-cell.after {
    background: rgba(129, 178, 154, 0.15);
    color: #81B29A;
    /* Fresh green - rewrite */
}

/* Expandable Score Rows */
.score-row-expandable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.score-row-expandable:hover {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.score-row-main {
    display: grid;
    grid-template-columns: 1fr 60px 60px 24px;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    gap: 0.5rem;
    min-width: 0;
    /* Allow grid to shrink */
}

.score-row-main>* {
    min-width: 0;
    /* Allow all children to shrink */
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-row-expandable:hover .score-row-main {
    background: rgba(255, 255, 255, 0.05);
}

.expand-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 300;
    transition: transform 0.2s;
}

.score-row-expandable.expanded .expand-icon {
    color: var(--accent-warm);
}

.score-row-tip {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.5;
    padding: 0 0.75rem;
    background: rgba(224, 122, 95, 0.08);
    border-left: 3px solid var(--accent-warm);
    margin: 0 0.5rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.score-row-expandable.expanded .score-row-tip {
    max-height: 100px;
    padding: 0.75rem;
    opacity: 1;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.score-header-row {
    display: grid;
    grid-template-columns: 1fr 60px 60px 24px;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: transparent;
}

.score-header-row .score-row-label {
    color: var(--text-muted);
    font-weight: 600;
}

.score-header-row .score-cell {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.65rem;
    padding: 0;
}

/* Legacy styles kept for compatibility */
.score-grid-enhanced {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.score-row-enhanced {
    display: grid;
    grid-template-columns: 120px 100px 1fr;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    align-items: center;
}

.score-dim {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.score-values {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
}

.score-values .score-before {
    color: #6B9AC4;
    background: rgba(107, 154, 196, 0.15);
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    font-weight: 600;
}

.score-values .score-after {
    color: #81B29A;
    background: rgba(129, 178, 154, 0.15);
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    font-weight: 600;
}

.score-values .score-arrow {
    color: #D4A574;
    font-size: 0.7rem;
}

.score-tip {
    font-size: 0.7rem;
    color: var(--text-primary);
    font-style: italic;
}

/* Buyer Mode Selector */
.buyer-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.buyer-mode-selector {
    margin-top: 0.5rem;
}

.buyer-mode-dropdown {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg-tertiary);
    border: 2px solid #D4A574;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23D4A574' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
    box-shadow: 0 0 12px rgba(212, 165, 116, 0.4), 0 0 20px rgba(212, 165, 116, 0.2);
}

.buyer-mode-dropdown:hover {
    border-color: #E8C598;
    box-shadow: 0 0 16px rgba(232, 197, 152, 0.5), 0 0 28px rgba(232, 197, 152, 0.3);
}

.buyer-mode-dropdown:focus {
    outline: none;
    border-color: #E8C598;
    box-shadow: 0 0 20px rgba(232, 197, 152, 0.6), 0 0 32px rgba(232, 197, 152, 0.35);
}

.buyer-mode-dropdown option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem;
}

.buyer-mode-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    font-style: italic;
}

/* Style Selector (output page - matches input page design) */
.style-hint {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-muted);
    font-style: italic;
    margin-left: 0.5rem;
}

.style-selector-output {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.style-option-full {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.style-option-full:hover {
    border-color: var(--border-medium);
    background: var(--bg-elevated);
}

.style-option-full.selected {
    border-color: var(--accent-warm);
    background: var(--accent-warm-dim);
}

.style-option-full .style-radio {
    width: 14px;
    height: 14px;
    min-width: 14px;
    border-radius: 50%;
    border: 2px solid var(--border-medium);
    transition: all 0.2s;
    margin-top: 2px;
}

.style-option-full.selected .style-radio {
    background: var(--accent-warm);
    border-color: var(--accent-warm);
    box-shadow: inset 0 0 0 2px var(--bg-primary);
}

.style-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.style-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.style-option-full.selected .style-name {
    color: var(--accent-warm);
}

.style-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Make last 2 items span properly in 3-col grid */
.style-selector-output .style-option-full:nth-child(4) {
    grid-column: 1;
}

.style-selector-output .style-option-full:nth-child(5) {
    grid-column: 2;
}

.no-issues {
    padding: 0.6rem 0.75rem;
    background: var(--accent-success-dim);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--accent-success);
    border-left: 3px solid var(--accent-success);
}

/* Writing Standards Section */
.standards-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.standards-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.standard-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.standard-control-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.standard-control-inputs {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.standard-input {
    width: 45px;
    padding: 0.25rem 0.4rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    text-align: center;
}

.standard-input-wide {
    width: 60px;
}

.standard-input:focus {
    outline: none;
    border-color: var(--accent-warm);
}

.standard-separator {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.standard-unit {
    font-size: 0.65rem;
    color: var(--text-muted);
    min-width: 32px;
}

.btn-apply-standards {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--accent-warm);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-apply-standards:hover {
    background: #C45C40;
}

.btn-apply-standards.pending {
    animation: pulse-btn 1.5s infinite;
}

@keyframes pulse-btn {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.standards-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.standard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.standard-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.standard-value {
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.standard-note {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.65rem;
}

/* AI Insights Section */
.insights-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.insights-level-badge {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--accent-warm-dim), var(--accent-blue-dim));
    border-radius: var(--radius-sm);
}

.level-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.level-progress {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.level-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-warm), var(--accent-success));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.insights-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.insight-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--text-muted);
}

.insight-card.observation {
    border-left-color: var(--accent-blue);
}

.insight-card.transformation {
    border-left-color: var(--accent-success);
    background: linear-gradient(135deg, var(--bg-tertiary), rgba(76, 175, 80, 0.08));
}

.insight-card.strength {
    border-left-color: var(--accent-success);
}

.insight-card.tip {
    border-left-color: var(--accent-warm);
}

.insight-card.pattern {
    border-left-color: #9b59b6;
}

.insight-card.upgrade {
    border-left-color: #e67e22;
}

.insight-card.insight {
    border-left-color: #3498db;
}

.insight-card.mastery {
    border-left-color: #f1c40f;
}

.insight-card.advanced {
    border-left-color: #9b59b6;
}

.insight-card.elite {
    border-left-color: #e74c3c;
}

.insight-card.wisdom {
    background: linear-gradient(135deg, var(--bg-tertiary), rgba(241, 196, 15, 0.1));
    border-left-color: #f1c40f;
}

.insight-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.insight-text {
    flex: 1;
}

.insight-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.insight-body {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.insights-encouragement {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-primary);
    font-style: normal;
    text-align: left;
    border-left: 3px solid var(--accent-warm);
}

/* Issues List */
.issues-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.issues-list-left {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.issue-item-left {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.4rem 0.5rem;
    background: var(--accent-warm-dim);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--text-secondary);
    border-left: 2px solid var(--accent-warm);
}

.issue-item-left.no-issues {
    background: var(--accent-success-dim);
    border-left-color: var(--accent-success);
    color: var(--accent-success);
}

.issue-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--accent-warm-dim);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent-warm);
}

.issue-icon {
    color: var(--accent-warm);
    flex-shrink: 0;
}

/* Coaching Notes */
.coaching-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.coaching-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--accent-success-dim);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent-success);
}

.coaching-icon {
    color: var(--accent-success);
    flex-shrink: 0;
}

/* Buyer Mode Badge */
.buyer-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--accent-blue-dim);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-blue);
    margin-top: 0.5rem;
}

/* Quick Actions in Rewrite Column */
.quick-actions-rewrite {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg,
            rgba(129, 178, 154, 0.08) 0%,
            transparent 100%);
    border-bottom: 1px solid rgba(129, 178, 154, 0.15);
}

.quick-action-rewrite {
    padding: 0.4rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 500;
    background: rgba(129, 178, 154, 0.12);
    border: 1px solid rgba(129, 178, 154, 0.25);
    border-radius: 20px;
    color: #81B29A;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action-rewrite:hover {
    background: rgba(129, 178, 154, 0.22);
    border-color: rgba(129, 178, 154, 0.4);
    box-shadow: 0 0 10px rgba(129, 178, 154, 0.2);
}

/* Rewrite Column */
.rewrite-content {
    font-size: 0.9rem;
    line-height: 1.8;
    color: #B8B8B8;
    /* Just above original's #A0A0A0 */
}

.rewrite-content .highlight-good {
    background: var(--accent-success-dim);
    color: var(--accent-success);
    padding: 0 4px;
    border-radius: 3px;
}

/* Rewrite Anchor (first paragraph - bolded) */
.rewrite-headline {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    margin-top: 0.75rem;
    /* Space above HEADLINE label */
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent-success);
    position: relative;
}

.rewrite-headline::before {
    content: 'HEADLINE';
    position: absolute;
    top: -1.5rem;
    left: 0;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent-success);
}

.rewrite-description {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.rewrite-description p {
    margin-bottom: 1rem;
}

.rewrite-description p:last-child {
    margin-bottom: 0;
}

.rewrite-description .description-hook {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* Metrics Display */
.headline-metrics {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: -0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.body-metrics {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.metrics-row {
    display: flex;
    gap: 0.5rem;
}

.metric-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
}

.metric-badge.optimal {
    background: var(--accent-success-dim);
    color: var(--accent-success);
}

.metric-badge.acceptable {
    background: var(--accent-warning-dim);
    color: var(--accent-warning);
}

.metric-badge.over,
.metric-badge.under {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.metric-badge.chars {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.metric-standard {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.metric-mls {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
}

.metric-mls.over {
    color: var(--accent-error);
    font-weight: 600;
    font-style: normal;
    background: rgba(239, 68, 68, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    animation: pulse-warning 1.5s ease-in-out infinite;
}

.metric-badge.chars.over {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-error);
    font-weight: 600;
}

@keyframes pulse-warning {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Chat Section */
.chat-section {
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    display: flex;
    flex-shrink: 0;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 33.333%;
    border-right: 1px solid var(--border-subtle);
}

.chat-messages {
    flex: 1;
    max-height: 150px;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-message {
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    max-width: 90%;
}

.chat-message.user {
    background: var(--accent-warm);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-input-container {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    padding: 0.7rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-warm);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.btn-send {
    padding: 0.7rem 1rem;
    background: var(--accent-warm);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-send:hover {
    background: #C45C40;
}

/* Quick Actions in Chat Area */
.quick-actions {
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-top: 1px solid var(--border-subtle);
}

.quick-action {
    padding: 0.4rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.quick-action:hover {
    border-color: var(--accent-warm);
    color: var(--accent-warm);
}

/* Empty area for alignment */
.chat-empty {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Loading State - Flying Pills Animation */
.loading-overlay{position:fixed;inset:0;background:transparent;display:none;align-items:center;justify-content:center;z-index:10002;opacity:0;visibility:hidden;transition:all 0.2s}
.loading-overlay.active{display:flex;opacity:1;visibility:visible;background:rgba(0,0,0,0.7);backdrop-filter:blur(8px)}
.loading-content{background:white;border-radius:20px;width:90%;max-width:440px;padding:2rem;text-align:center;transform:translateY(20px);transition:transform 0.2s;box-shadow:0 25px 50px -12px rgba(0,0,0,0.25);position:relative;z-index:10003}
.loading-overlay.active .loading-content{transform:translateY(0)}
.loading-cancel{position:absolute;top:1rem;right:1rem;background:none;border:none;color:#999;cursor:pointer;padding:0.25rem;font-size:1.5rem;z-index:10;transition:all 0.2s}
.loading-cancel:hover{color:#333}
.loading-spinner{width:48px;height:48px;border:3px solid #e5e5e5;border-top-color:#06b6d4;border-radius:50%;animation:spin 1s linear infinite;margin:0 auto}
.loading-text-container{text-align:center;margin-top:1rem}
.loading-text{font-size:1rem;font-weight:600;color:#1a1a1a}
.loading-subtext{font-size:0.8125rem;color:#666;margin-top:0.5rem}
.loading-progress{width:200px;height:4px;background:#e5e5e5;border-radius:2px;overflow:hidden;margin:1rem auto 0}
.loading-progress-bar{height:100%;background:#06b6d4;border-radius:2px;animation:loadingProgress 2s ease-in-out infinite}
.loading-cancel-btn{margin-top:1rem;padding:0.625rem 1.5rem;background:#f5f5f5;border:1px solid #e5e5e5;border-radius:8px;color:#1a1a1a;font-size:0.875rem;font-weight:600;cursor:pointer;transition:all 0.2s}
.loading-cancel-btn:hover{background:#e8f7fb;border-color:#06b6d4;color:#06b6d4}
.listing-pills-container{position:fixed;inset:0;pointer-events:none;overflow:hidden;opacity:0;transition:opacity 0.3s;z-index:10004}
.listing-pills-container.active{opacity:1}
.listing-pill{position:absolute;padding:8px 14px;border-radius:20px;font-size:12px;font-weight:600;white-space:nowrap;opacity:0;transition:opacity 0.3s;box-shadow:0 4px 16px rgba(0,0,0,0.15);border:1px solid rgba(255,255,255,0.3);z-index:10004}
.listing-pill.visible{opacity:1}
.listing-pill.marketing{background:linear-gradient(135deg,#c4a052 0%,#a88a3e 100%);color:white}
.listing-pill.audience{background:linear-gradient(135deg,#3b82f6 0%,#2563eb 100%);color:white}
.listing-pill.content{background:linear-gradient(135deg,#10b981 0%,#059669 100%);color:white}
.listing-pill.strategy{background:linear-gradient(135deg,#8b5cf6 0%,#6366f1 100%);color:white}
.listing-pill.insight{background:linear-gradient(135deg,#f59e0b 0%,#d97706 100%);color:white}
.listing-pill.creative{background:linear-gradient(135deg,#ec4899 0%,#db2777 100%);color:white}
.listing-pill.processing{background:linear-gradient(135deg,#64748b 0%,#475569 100%);color:white}
@keyframes loadingProgress{0%{width:0%}50%{width:80%}100%{width:100%}}
@keyframes spin{to{transform:rotate(360deg)}}

/* ═══════════════════════════════════════════════════════════════
   ANALYSIS TIMER - Progress with phases
   ═══════════════════════════════════════════════════════════════ */
.analysis-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
}

.timer-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-bottom: 0.5rem;
}

.timer-clock {
    position: relative;
    width: 120px;
    height: 120px;
}

.timer-circle-bg {
    fill: none;
    stroke: var(--border-medium, rgba(255,255,255,0.1));
    stroke-width: 8;
}

.timer-circle-progress {
    fill: none;
    stroke: url(#timerGradient);
    stroke-width: 8;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.5s ease;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.timer-elapsed {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

.timer-unit {
    font-size: 0.75rem;
    color: var(--text-muted, rgba(255,255,255,0.6));
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timer-phases {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 280px;
}

.timer-phase {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    background: var(--surface-elevated, rgba(255,255,255,0.05));
    opacity: 0.5;
    transition: all 0.3s ease;
}

.timer-phase.active {
    opacity: 1;
    background: rgba(249, 115, 22, 0.15);
    border-left: 3px solid var(--accent-warm, #f97316);
}

.timer-phase.complete {
    opacity: 0.7;
}

.timer-phase-icon {
    width: 20px;
    text-align: center;
}

.timer-phase.complete .timer-phase-icon::after {
    content: '✓';
    color: var(--success, #10b981);
}

.timer-phase.active .timer-phase-icon::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent-warm, #f97316);
    border-radius: 50%;
    animation: pulseDot 1s ease-in-out infinite;
}

.timer-phase:not(.active):not(.complete) .timer-phase-icon::after {
    content: '○';
    color: var(--text-muted, rgba(255,255,255,0.6));
}

@keyframes pulseDot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

.timer-phase-label {
    font-size: 0.85rem;
    color: var(--text-primary, #fff);
    flex: 1;
}

.timer-phase.active .timer-phase-label {
    font-weight: 600;
    color: var(--accent-warm, #f97316);
}

.timer-estimate {
    font-size: 0.85rem;
    color: var(--text-muted, rgba(255,255,255,0.6));
    text-align: center;
    margin-top: 0.5rem;
}

.timer-estimate strong {
    color: var(--text-primary, #fff);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Settings Button */
.btn-settings {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-settings:hover {
    border-color: var(--accent-warm);
    color: var(--accent-warm);
}

/* Theme Selector */
.theme-selector {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem;
    background: transparent;
    border-radius: var(--radius-sm);
}

.theme-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-btn:hover {
    transform: scale(1.1);
}

.theme-btn.active {
    border-color: var(--accent-warm);
}

.theme-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(128, 128, 128, 0.3);
}

.theme-swatch.cream {
    background: linear-gradient(135deg, #fdfbf7 50%, #d97706 50%);
}

.theme-swatch.ocean {
    background: linear-gradient(135deg, #f0f9ff 50%, #0284c7 50%);
}

.theme-swatch.tanzanite {
    background: linear-gradient(135deg, #0f0d1a 50%, #a855f7 50%);
}

.theme-swatch.midnight {
    background: linear-gradient(135deg, #0a0e1a 50%, #3b82f6 50%);
}

.theme-swatch.obsidian {
    background: linear-gradient(135deg, #09090b 50%, #a1a1aa 50%);
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.connection-status:hover {
    background: var(--bg-elevated);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s;
}

.status-dot.disconnected {
    background: var(--accent-error);
    box-shadow: 0 0 8px var(--accent-error);
}

.status-dot.connected {
    background: var(--accent-success);
    box-shadow: 0 0 8px var(--accent-success);
}

.status-dot.testing {
    background: var(--accent-warning);
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.status-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Back Button */
.btn-back {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-back:hover {
    border-color: var(--accent-warm);
    color: var(--accent-warm);
}

/* Copy Button */
.btn-copy {
    padding: 0.4rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-copy:hover {
    border-color: var(--accent-success);
    color: var(--accent-success);
}

.btn-copy.copied {
    background: var(--accent-success-dim);
    border-color: var(--accent-success);
    color: var(--accent-success);
}

/* Rewrite Actions Container */
.rewrite-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Share Button & Dropdown */
.share-dropdown-container {
    position: relative;
}

.btn-share {
    padding: 0.4rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-share:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.btn-share.active {
    background: var(--bg-elevated);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.share-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 180px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 500;
}

.share-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-option {
    width: 100%;
    padding: 0.6rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.share-option:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.share-option svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.share-option:hover svg {
    color: var(--accent-blue);
}

.share-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0.4rem 0;
}

/* Score Change Arrow */
.score-change {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
}

.score-arrow {
    color: #D4A574;
    /* Gold - transformation */
}

/* ============================================
           MOBILE RESPONSIVE STYLES
           ============================================ */

/* Tablet - 2 columns */
@media (max-width: 1200px) {
    .columns-container {
        grid-template-columns: 1fr 1fr;
    }

    .column-signalboard {
        grid-column: 1 / -1;
        order: -1;
        max-height: 300px;
    }

    .column-original,
    .column-rewrite {
        min-height: 400px;
    }
}

/* Mobile - Single column */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .logo {
        flex: 1;
        min-width: 200px;
    }

    .logo-text {
        font-size: 1rem;
    }

    .logo-version {
        font-size: 0.65rem;
    }

    .theme-selector {
        order: 10;
        margin-left: auto;
    }

    .header-style-selector {
        order: 5;
    }

    .connection-status {
        display: none;
    }

    .btn-settings {
        width: 44px;
        height: 44px;
    }

    .btn-back {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Stack columns vertically */
    .columns-container {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .column {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        min-height: auto;
    }

    .column-signalboard {
        order: 0;
        max-height: none;
    }

    .column-original {
        order: 1;
    }

    .column-rewrite {
        order: 2;
    }

    .column-header {
        padding: 0.75rem 1rem;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .column-body {
        padding: 1rem;
        max-height: none;
    }

    .column-body-signalboard {
        max-height: none;
    }

    /* SignalBoard adjustments */
    .signalboard {
        padding: 0.5rem;
    }

    .signalboard-section {
        margin-bottom: 1rem;
    }

    .score-grid {
        font-size: 0.85rem;
    }

    .advice-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .advice-box {
        min-height: 80px;
    }

    /* Resize handle - larger touch target on mobile */
    .resize-handle {
        height: 20px;
    }

    .resize-handle-bar {
        width: 60px;
        height: 5px;
    }

    /* Input page adjustments */
    .input-container {
        padding: 1rem;
    }

    .input-header h1 {
        font-size: 1.5rem;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .headline-input,
    .listing-input {
        font-size: 0.95rem;
    }

    .listing-input {
        min-height: 150px;
    }

    .btn-transform {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        min-height: 56px;
    }

    /* Chat adjustments */
    .chat-inline {
        padding: 0.75rem;
    }

    .chat-input {
        font-size: 16px;
        /* Prevents iOS zoom */
        min-height: 44px;
        padding: 0.75rem;
    }

    .btn-send {
        width: 44px;
        height: 44px;
    }

    /* Touch targets - minimum 44px */
    .theme-btn {
        width: 44px;
        height: 44px;
    }

    .theme-swatch {
        width: 24px;
        height: 24px;
    }

    .buyer-mode-dropdown {
        min-height: 44px;
        font-size: 0.9rem;
    }

    .header-style-dropdown {
        min-height: 44px;
    }

    .quick-action-btn {
        min-height: 44px;
        padding: 0.5rem 0.75rem;
    }

    .share-btn {
        min-height: 44px;
        padding: 0.5rem 0.75rem;
    }

    /* Popup/Modal adjustments */
    .advice-popup {
        width: 95%;
        max-height: 85vh;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
    }

    /* Rewrite content */
    .rewrite-headline {
        font-size: 1.1rem;
    }

    .rewrite-body {
        font-size: 0.95rem;
    }

    /* Metrics bar */
    .metrics-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .metric-item {
        font-size: 0.75rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .logo-text {
        font-size: 0.9rem;
    }

    .header-style-selector {
        display: none;
    }

    .input-header h1 {
        font-size: 1.25rem;
    }

    .input-subtitle {
        font-size: 0.85rem;
    }

    .advanced-options {
        padding: 1rem;
    }

    .standards-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .standard-item {
        width: 100%;
    }

    .writing-styles-grid {
        grid-template-columns: 1fr;
    }
}

/* Landscape mobile - prevent keyboard overlap */
@media (max-height: 500px) and (orientation: landscape) {
    .chat-inline {
        position: relative;
    }

    .chat-messages-inline {
        max-height: 100px;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .logo-icon svg,
    .header-x-logo svg {
        shape-rendering: geometricPrecision;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .header-spinner {
        animation: none;
    }
}

/* Footer */
.app-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    padding: 0.75rem 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.app-footer a {
    color: var(--accent-warm);
    text-decoration: none;
    transition: color 0.2s;
}

.app-footer a:hover {
    color: var(--text-primary);
}

.footer-brand {
    font-weight: 600;
    letter-spacing: 0.02em;
}

@media (max-width: 768px) {
    .app-footer {
        padding: 0.5rem 1rem;
        font-size: 0.7rem;
    }
}

/* Print styles */
@media print {

    .header,
    .chat-inline,
    .btn-back,
    .theme-selector,
    .btn-settings,
    .share-section {
        display: none !important;
    }

    .columns-container {
        display: block;
    }

    .column {
        page-break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
}

/* ============================================
   USER INFO BADGE
   ============================================ */
.user-info-badge {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 10px 16px;
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.user-info-badge.active {
    display: flex;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-warm), var(--accent-success));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-plan {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-plan.free {
    color: var(--text-muted);
}

.user-plan.basic {
    color: var(--accent-blue);
}

.user-plan.pro {
    color: var(--accent-success);
}

.user-plan.enterprise {
    color: var(--accent-warm);
}

.btn-logout:hover {
    background: rgba(224, 122, 106, 0.2) !important;
}

/* =================================
   CONFIG MODAL (Unified Pattern)
   ================================= */
.config-modal{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(7,11,18,0.95);
  z-index:2000;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.config-modal.active{display:flex}

.config-panel{
  background:var(--bg-secondary);
  border-radius:16px;
  padding:32px;
  max-width:600px;
  width:100%;
  max-height:90vh;
  overflow-y:auto;
  border:1px solid var(--border-subtle);
  box-shadow:0 8px 32px rgba(0,0,0,0.4);
}

.config-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:24px;
  padding-bottom:16px;
  border-bottom:2px solid var(--border-subtle);
}

.config-title{
  font-size:1.5rem;
  font-weight:700;
  color:var(--accent-blue);
}

.config-close{
  width:32px;
  height:32px;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--border-subtle);
  border-radius:8px;
  color:var(--text-primary);
  font-size:1.2rem;
  cursor:pointer;
  transition:all 0.2s;
}

.config-close:hover{
  background:rgba(255,255,255,0.1);
  border-color:var(--accent-blue);
}

.config-section{
  margin-bottom:24px;
}

.config-section-title{
  font-size:0.85rem;
  font-weight:700;
  color:var(--text-muted);
  text-transform:uppercase;
  letter-spacing:0.5px;
  margin-bottom:12px;
}

/* Theme Picker */
.theme-picker{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.theme-option{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  padding:10px 12px;
  background:var(--bg-tertiary);
  border:2px solid var(--border-subtle);
  border-radius:10px;
  cursor:pointer;
  transition:all 0.2s;
}

.theme-option:hover{
  border-color:var(--accent-blue);
  transform:translateY(-2px);
}

.theme-option.active{
  border-color:var(--accent-warm);
  background:rgba(232,161,139,0.1);
}

.theme-preview{
  width:36px;
  height:36px;
  border-radius:8px;
}

.theme-name{
  font-size:0.75rem;
  font-weight:600;
  color:var(--text-muted);
}

.form-hint{
  font-size:0.8rem;
  color:var(--text-muted);
  font-style:italic;
}

.config-actions{
  display:flex;
  gap:12px;
  margin-top:24px;
  padding-top:20px;
  border-top:2px solid var(--border-subtle);
}

.config-btn-primary{
  flex:1;
  padding:12px 20px;
  background:linear-gradient(135deg, var(--accent-blue), var(--accent-success));
  border:none;
  border-radius:10px;
  color:#050811;
  font-size:1rem;
  font-weight:700;
  cursor:pointer;
  transition:all 0.2s;
}

.config-btn-primary:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 24px rgba(59,130,246,0.4);
}

.config-btn-secondary{
  flex:1;
  padding:12px 20px;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--border-subtle);
  border-radius:10px;
  color:var(--text-primary);
  font-size:1rem;
  font-weight:600;
  cursor:pointer;
  transition:all 0.2s;
}

.config-btn-secondary:hover{
  background:rgba(255,255,255,0.1);
  border-color:var(--accent-blue);
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.footer {
  padding: 24px 16px 40px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.ai-disclaimer {
  background: linear-gradient(145deg, rgba(255, 184, 0, 0.08) 0%, rgba(255, 184, 0, 0.03) 100%);
  border: 1px solid rgba(255, 184, 0, 0.15);
  border-radius: 16px;
  padding: 18px;
  margin: 0 auto 24px;
  max-width: 800px;
}

.ai-disclaimer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #FFB800;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ai-disclaimer-text {
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.footer-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-link:hover {
  color: var(--cyan);
}

.footer-copyright {
  text-align: center;
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
}

/* Bottom CTA */
.bottom-cta{
  text-align:center;
  padding:40px 20px;
  margin-top:32px;
}

.cta-headline{
  font-size:1.5rem;
  font-weight:700;
  color:var(--ink);
  margin-bottom:12px;
}

.cta-subtext{
  font-size:1rem;
  color:var(--muted);
}

.cta-subtext strong{
  color:var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATION SYSTEM
   ═══════════════════════════════════════════════════════════════ */

.copy-toast-container {
  position: fixed;
  top: 70px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.copy-toast {
  background: var(--accent);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: toast-in 0.3s ease;
}

.copy-toast.removing {
  animation: toast-out 0.3s ease forwards;
}

/* Toast type variants */
.toast-success {
  background: var(--accent);
}

.toast-info {
  background: var(--accent);
}

.toast-warning {
  background: var(--accent);
}

.toast-error {
  background: #ef4444;
}

/* Welcome Toast */
.welcome-toast {
  background: var(--accent);
}

/* Toast Animations */
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}