/* =========================================================
   PostCraft Pro — Ultra-Modern & Fully Responsive Design
   ========================================================= */

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

:root {
  /* Color Palette - Modern Indigo / LinkedIn Blue Slate */
  --primary: #0A66C2;
  --primary-hover: #084e96;
  --primary-glow: rgba(10, 102, 194, 0.35);
  --accent: #6366F1;
  --accent-gradient: linear-gradient(135deg, #0A66C2 0%, #6366F1 50%, #8B5CF6 100%);
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;

  /* Dark Theme Tokens (Default) */
  --bg-app: #0B0F19;
  --bg-surface: #111827;
  --bg-surface-elevated: #162033;
  --bg-input: #0e1524;
  --bg-hover: #1f2d47;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --text-main: #F9FAFB;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
  --li-card-bg: #162033;
  --li-card-border: rgba(255, 255, 255, 0.09);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

body.light {
  --bg-app: #F3F4F8;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F8FAFC;
  --bg-input: #F1F5F9;
  --bg-hover: #E2E8F0;
  --border-subtle: rgba(0, 0, 0, 0.09);
  --border-focus: rgba(10, 102, 194, 0.5);
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-dim: #94A3B8;
  --shadow-card: 0 12px 30px -8px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 20px rgba(10, 102, 194, 0.15);
  --li-card-bg: #FFFFFF;
  --li-card-border: rgba(0, 0, 0, 0.12);
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

/* App Outer Wrapper */
.app-container {
  max-width: 1680px;
  margin: 0 auto;
  padding: 16px 24px 32px 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =========================================================
   Navbar Header
   ========================================================= */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
  gap: 16px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pro-tag {
  font-size: 10px;
  font-weight: 800;
  background: var(--accent-gradient);
  color: #fff;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.8px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* View Mode Tabs */
.view-mode-tabs {
  display: flex;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
  border: 1px solid var(--border-subtle);
}

.mode-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
}

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

.mode-tab.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

/* Pill Buttons */
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-decoration: none;
}

.pill-btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-dim);
  transform: translateY(-1px);
}

.pill-btn.primary {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
}

.pill-btn.primary:hover {
  box-shadow: var(--shadow-glow);
}

.pill-btn.icon-only {
  padding: 9px 12px;
  font-size: 14px;
}

.pill-btn.linkedin-btn {
  background: #0A66C2;
  color: #fff;
  border-color: #0A66C2;
}

.pill-btn.linkedin-btn:hover {
  background: #084e96;
}

/* =========================================================
   Mobile Navigation Tab Bar
   ========================================================= */

.mobile-nav-bar {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 5px;
  margin-bottom: 12px;
  gap: 6px;
  position: sticky;
  top: 10px;
  z-index: 100;
  box-shadow: var(--shadow-card);
}

.mob-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.mob-tab.active {
  background: var(--primary);
  color: #fff;
}

/* =========================================================
   Toolbar & Template Bar
   ========================================================= */

.toolbar-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.template-selector-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 260px;
}

.selector-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.styled-select {
  flex: 1;
  max-width: 380px;
  padding: 9px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}

.styled-select:focus {
  border-color: var(--primary);
}

.quick-helpers {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Toggle Switch */
.toggle-control {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.toggle-control input {
  display: none;
}

.toggle-slider {
  width: 36px;
  height: 20px;
  background: var(--bg-input);
  border-radius: 20px;
  position: relative;
  border: 1px solid var(--border-subtle);
  transition: 0.25s;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: 0.25s;
}

.toggle-control input:checked + .toggle-slider {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle-control input:checked + .toggle-slider::after {
  transform: translateX(16px);
}

.helper-btn {
  font-size: 12px;
  padding: 8px 12px;
}

.helper-btn.danger-hover:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border-color: var(--danger);
}

/* =========================================================
   Main 3-Column / Split Layout
   ========================================================= */

.main-layout {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Default: Input and Formatted Output together on same screen! */
  gap: 18px;
  flex: 1;
  align-items: stretch;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

/* Default Both Mode (Input + Output side by side or stacked) */
.main-layout.view-both {
  grid-template-columns: 1fr 1fr;
}

.main-layout.view-both #previewPane {
  display: none;
}

/* Studio Mode: 3 Columns (Input + Output + Live Feed Preview) */
.main-layout.view-studio {
  grid-template-columns: 1fr 1fr 1.15fr;
}

.main-layout.view-studio #previewPane {
  display: flex;
}

/* Preview Focus View Mode */
.main-layout.view-preview-focus {
  grid-template-columns: 1fr 1.2fr;
}

.main-layout.view-preview-focus #inputPane {
  display: none;
}

.main-layout.view-preview-focus #previewPane {
  display: flex;
}

.editor-pane {
  display: flex;
  flex-direction: column;
}

/* Conversion Action Group & Pulse Animation */
.convert-action-btn-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.convert-action-btn-group .full-btn {
  flex: 1;
}

.quick-copy-btn {
  white-space: nowrap;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quick-copy-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

@keyframes outputGlow {
  0% { box-shadow: 0 0 0 0 rgba(10, 102, 194, 0.7); border-color: var(--primary); }
  40% { box-shadow: 0 0 18px 3px rgba(10, 102, 194, 0.5); border-color: var(--primary); }
  100% { box-shadow: none; border-color: var(--border-subtle); }
}

.highlight-pulse {
  animation: outputGlow 1.2s ease-out;
}

.pane-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
}

.pane-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pane-emoji {
  font-size: 20px;
  background: var(--bg-surface-elevated);
  padding: 6px;
  border-radius: 10px;
  display: inline-flex;
}

.pane-title h3 {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.pane-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.micro-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: 0.15s;
}

.micro-btn:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

/* Character Badge */
.char-badge {
  font-size: 11.5px;
  font-weight: 700;
  background: var(--bg-surface-elevated);
  padding: 4px 10px;
  border-radius: 20px;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  font-family: 'JetBrains Mono', monospace;
}

.char-badge.warn {
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
}

.char-badge.danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
}

/* Textarea Wrappers */
.textarea-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

textarea {
  width: 100%;
  flex: 1;
  min-height: 380px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--text-main);
  font-size: 14px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

#rawInput {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.65;
}

/* Quick Cheatsheet */
.pane-bottom-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.markdown-quick-cheatsheet {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cheat-pill {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-surface-elevated);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: 0.15s;
}

.cheat-pill:hover {
  color: var(--text-main);
  border-color: var(--primary);
  background: var(--bg-hover);
}

/* Glowing Primary Button */
.glow-primary-btn {
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(10, 102, 194, 0.3);
  font-family: inherit;
}

.glow-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(10, 102, 194, 0.45);
}

.glow-primary-btn.full-btn {
  width: 100%;
}

/* =========================================================
   Pane 2 Formatting Toolbar
   ========================================================= */

.format-toolbar {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  margin-right: 4px;
  font-weight: 700;
}

.tool-btn, .bullet-btn {
  min-width: 32px;
  height: 30px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  font-family: inherit;
}

.tool-btn:hover, .bullet-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.tool-action-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: 0.15s;
  font-family: inherit;
}

.tool-action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.toolbar-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 2px 0;
}

/* Emoji Drawer */
.emoji-drawer {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 10px;
}

.emoji-drawer.hidden {
  display: none;
}

.emoji-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.emoji-cat-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.emoji-cat-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
}

.emoji-item {
  font-size: 18px;
  text-align: center;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  user-select: none;
}

.emoji-item:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: scale(1.2);
}

/* Output Action Row */
.output-action-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.output-action-row .copy-btn {
  flex: 1.5;
  min-width: 170px;
}

.linkedin-action-btn {
  background: #0A66C2;
  color: #fff;
  border-color: #0A66C2;
}

.linkedin-action-btn:hover {
  background: #084e96;
}

/* Metrics Card */
.metrics-card {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  justify-content: space-around;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.metric-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
}

.metric-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-val.hook-val {
  color: var(--success);
}

/* =========================================================
   PANE 3: LinkedIn Feed Simulation Card
   ========================================================= */

.preview-card-pane {
  background: var(--bg-surface);
}

.preview-header-ctrls {
  margin-bottom: 8px;
}

.device-toggle-group {
  display: flex;
  background: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.device-toggle {
  background: transparent;
  border: none;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.6;
  transition: 0.2s;
}

.device-toggle.active {
  background: var(--bg-surface);
  opacity: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.author-config-bar {
  margin-bottom: 12px;
}

.author-details summary {
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

.author-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr 0.6fr;
  gap: 6px;
  margin-top: 8px;
}

.author-inputs-grid input {
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-main);
  outline: none;
}

/* Authentic LinkedIn Feed Post */
.linkedin-preview-container {
  display: flex;
  justify-content: center;
  transition: all 0.3s ease;
  flex: 1;
}

.linkedin-preview-container.mobile-view .linkedin-feed-card {
  max-width: 375px;
  border-radius: 20px;
  border: 2px solid var(--border-focus);
}

.linkedin-feed-card {
  width: 100%;
  max-width: 540px;
  background: var(--li-card-bg);
  border: 1px solid var(--li-card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

/* Post Author Row */
.li-post-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.li-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.li-author-meta {
  flex: 1;
  min-width: 0;
}

.li-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.li-author-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.li-connection-degree {
  font-size: 12px;
  color: var(--text-dim);
}

.li-author-headline {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.li-post-timestamp {
  font-size: 10.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.li-follow-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

/* Hook Alert Banner */
.hook-status-bar {
  background: rgba(10, 102, 194, 0.1);
  border: 1px dashed rgba(10, 102, 194, 0.3);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.hook-status-bar.warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.4);
}

/* Post Content Body */
.li-post-content-wrap {
  position: relative;
  margin-bottom: 14px;
}

.li-post-body {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-main);
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

/* LinkedIn "...see more" truncation simulation */
.li-post-body.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.li-see-more-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  margin-top: 4px;
  padding: 2px 4px;
}

.li-see-more-btn:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Reaction Stats Bar */
.li-reactions-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-dim);
}

.li-reaction-icons {
  display: flex;
  align-items: center;
}

.reaction-bubble {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  margin-right: -4px;
  border: 1.5px solid var(--bg-surface);
}

.reaction-bubble.blue { background: #0A66C2; }
.reaction-bubble.green { background: #10B981; }
.reaction-bubble.red { background: #EF4444; }

.li-reaction-count {
  margin-left: 8px;
}

/* LinkedIn Action Bar */
.li-actions-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.li-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}

.li-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

/* =========================================================
   Hashtag Builder Section
   ========================================================= */

.hashtag-section {
  margin-bottom: 20px;
}

.hashtag-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
}

.hashtag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.hashtag-header h4 {
  font-size: 14.5px;
  font-weight: 700;
}

.hashtag-header p {
  font-size: 11.5px;
  color: var(--text-muted);
}

.popular-tag-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.quick-topic-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: 0.15s;
}

.quick-topic-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--bg-hover);
}

.hashtag-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.hashtag-input-row input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
}

.hashtag-input-row input:focus {
  border-color: var(--primary);
}

.hashtag-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
}

.hashtag-pill {
  background: rgba(10, 102, 194, 0.12);
  color: var(--primary);
  border: 1px solid rgba(10, 102, 194, 0.3);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.hashtag-pill:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

/* =========================================================
   Footer
   ========================================================= */

.app-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 10px;
}

.text-link {
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.text-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* =========================================================
   Toast & Modal Components
   ========================================================= */

.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent-gradient);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10000;
  pointer-events: none;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title-group h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-scroll-body {
  padding: 20px;
  overflow-y: auto;
}

.guide-intro {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.guide-table th, .guide-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  text-align: left;
}

.guide-table th {
  color: var(--text-dim);
  font-size: 11.5px;
  text-transform: uppercase;
}

.guide-table code {
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.unicode-sample {
  font-size: 14px;
  font-weight: 600;
}

.pro-tips-box {
  background: var(--bg-surface-elevated);
  border-left: 3px solid var(--primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

.pro-tips-box ul {
  margin-top: 8px;
  padding-left: 18px;
  line-height: 1.6;
}

/* =========================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================= */

@media (max-width: 1200px) {
  .main-layout {
    grid-template-columns: 1fr 1fr;
  }
  
  /* On medium screens, collapse preview underneath output or allow toggle */
  .main-layout #previewPane {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-nav-bar {
    display: flex;
  }

  .hide-mobile {
    display: none !important;
  }

  .main-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Default on mobile/narrow screen: BOTH Input and Output are on the SAME screen! */
  .editor-pane#inputPane,
  .editor-pane#outputPane {
    display: flex !important;
  }

  .editor-pane#previewPane {
    display: none;
  }

  /* When preview tab is selected on mobile */
  .main-layout.mobile-preview-active .editor-pane#inputPane,
  .main-layout.mobile-preview-active .editor-pane#outputPane {
    display: none !important;
  }

  .main-layout.mobile-preview-active .editor-pane#previewPane {
    display: flex !important;
  }

  textarea {
    min-height: 200px;
    height: 220px;
  }

  .app-container {
    padding: 10px 12px 24px 12px;
  }

  .toolbar-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .template-selector-wrap {
    min-width: 100%;
  }

  .styled-select {
    max-width: 100%;
  }

  .quick-helpers {
    justify-content: space-between;
  }

  .author-inputs-grid {
    grid-template-columns: 1fr;
  }

  .metrics-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}
