/* Design Tokens */
:root {
  --bg-color: #05070f;
  --panel-bg: rgba(13, 20, 38, 0.65);
  --panel-border: rgba(255, 255, 255, 0.07);
  
  /* Vibrant Accent Colors */
  --accent-primary: #6366f1; /* Indigo */
  --accent-secondary: #8b5cf6; /* Violet */
  --accent-tertiary: #ec4899; /* Pink */
  --accent-gradient: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 50%, var(--accent-tertiary) 100%);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #4b5563;
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --card-glow: rgba(99, 102, 241, 0.12);
  
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Glowing Background Blobs */
.glow-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: -10;
  opacity: 0.45;
}
.glow-blob-1 {
  top: -5%;
  left: 25%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
}
.glow-blob-2 {
  bottom: 10%;
  right: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.12) 0%, transparent 70%);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ==========================================
   AdSense Ad Units
   ========================================== */
.ad-unit {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
}
.ad-unit-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
}
.ad-unit ins.adsbygoogle {
  border-radius: var(--radius-sm);
  overflow: hidden;
}
/* Minimal separator for ads in content flow */
.ad-unit-divider {
  width: 100%;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin: 0.5rem 0;
}

/* ==========================================
   Site Navigation Header
   ========================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: rgba(5, 7, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}
.site-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity var(--transition-fast);
}
.nav-logo-link:hover {
  opacity: 0.8;
}
.nav-logo-img {
  height: 34px;
  width: auto;
  object-fit: contain;
  display: block;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.nav-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--text-primary);
}
.nav-link-cta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
}
.nav-link-cta:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

/* Container Constraints */
.container {
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  z-index: 1;
}

/* Header */
.app-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.logo-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.35rem 0.8rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.brand-logo-img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}
.logo-badge span {
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.app-header h1 {
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}
.app-header p {
  color: var(--text-secondary);
  font-size: clamp(0.875rem, 3.5vw, 1rem);
  max-width: 500px;
  line-height: 1.5;
  font-weight: 500;
}

/* Workspace Layout (Minimal Centered Column) */
.minimal-workspace {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

/* Minimal Editor Panel Card */
.editor-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  position: relative;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}
.editor-panel:focus-within {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(99, 102, 241, 0.08);
}

/* Toolbar Buttons */
.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.75rem;
}
.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-tool {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition-fast);
  user-select: none;
}
.btn-tool:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}
.btn-tool:active {
  transform: translateY(1px);
}
.btn-tool.btn-accent {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}
.btn-tool.btn-accent:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--text-primary);
}
.btn-tool.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
.btn-tool.success-state {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}

/* Input Area */
.textarea-wrapper {
  position: relative;
  width: 100%;
}
#editor {
  width: 100%;
  min-height: 350px;
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.6;
  padding: 0.25rem 0;
  caret-color: var(--accent-primary);
}
#editor::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}
#editor::-webkit-scrollbar {
  width: 5px;
}
#editor::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
}

/* Editor Bottom Status Bar */
.editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.75rem;
  font-size: 0.775rem;
  color: var(--text-secondary);
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.status-msg {
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}

/* Auto-save Switch Toggle */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
}
.toggle-container input {
  display: none;
}
.toggle-slider {
  width: 26px;
  height: 14px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  position: relative;
  transition: var(--transition-fast);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-secondary);
  top: 2px;
  left: 2px;
  transition: var(--transition-fast);
}
.toggle-container input:checked + .toggle-slider {
  background-color: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.35);
}
.toggle-container input:checked + .toggle-slider::before {
  transform: translateX(12px);
  background-color: var(--accent-primary);
}

/* Compact Target Progress Tracker (Bottom Border Style) */
.inline-target-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}
.target-label {
  color: var(--text-muted);
}
.target-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.775rem;
  width: 42px;
  text-align: right;
  font-weight: 700;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
  -moz-appearance: textfield;
}
.target-input::-webkit-outer-spin-button,
.target-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.target-input:focus {
  border-bottom-color: var(--accent-primary);
  border-bottom-style: solid;
}
.target-progress-text {
  font-family: var(--font-mono);
  color: var(--accent-primary);
  font-weight: 700;
}
.target-progress-track-minimal {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}
.target-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  transition: width var(--transition-normal), background var(--transition-normal), box-shadow var(--transition-normal);
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.3);
}
.target-progress-fill.completed {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

/* Minimal Inline Stats Strip */
.minimal-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  text-align: center;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 1.15rem 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.stat-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  justify-content: center;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}
.stat-col:last-child {
  border-right: none;
}
.stat-num {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.15;
}
.stat-label {
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.25rem;
}
.speed-select {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.725rem;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
}
.speed-select option {
  background: #0d1426;
  color: var(--text-primary);
}

/* Minimalist Keyword Density Strip */
.density-strip {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.density-header-minimal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.density-title-minimal {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.density-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.density-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.density-pill:hover {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.25);
  color: var(--text-primary);
}
.density-pill strong {
  color: #a5b4fc;
  font-family: var(--font-mono);
  font-weight: 700;
}
.empty-pills {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Collapsible Accordion Panel for Advanced Utilities */
.advanced-tools-details {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.advanced-tools-summary {
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-primary);
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background var(--transition-fast);
}
.advanced-tools-summary:hover {
  background: rgba(255, 255, 255, 0.015);
}
.advanced-tools-details summary::marker,
.advanced-tools-details summary::-webkit-details-marker {
  display: none;
}
.summary-arrow {
  transition: transform var(--transition-normal);
  color: var(--text-secondary);
}
.advanced-tools-details[open] .summary-arrow {
  transform: rotate(180deg);
}
.advanced-tools-content {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.panel-section h5 {
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-left: 2px solid var(--accent-primary);
  padding-left: 0.4rem;
  margin-bottom: 0.25rem;
}

/* Case grid in advanced details */
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.btn-case {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: var(--transition-normal);
  font-family: var(--font-sans);
}
.btn-case:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.25);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.btn-case:active {
  transform: translateY(0);
}
.case-title {
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--text-primary);
}
.case-desc {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 500;
}

/* Detailed stats grid in advanced details */
.inspector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.inspector-item {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color var(--transition-fast);
}
.inspector-item:hover {
  border-color: rgba(255, 255, 255, 0.06);
}
.inspector-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.inspector-value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.85rem;
}

/* Lexical diversity in advanced details */
.diversity-box {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.15rem;
}
.diversity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.775rem;
  color: var(--text-secondary);
  font-weight: 700;
}
.diversity-badge {
  background: rgba(99, 102, 241, 0.08);
  color: #a5b4fc;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.725rem;
  border: 1px solid rgba(99, 102, 241, 0.15);
}
.diversity-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 2px;
  overflow: hidden;
}
.diversity-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width var(--transition-normal);
}
.diversity-desc {
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.35;
  font-weight: 500;
}

/* Toast Alert */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(10, 15, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--text-primary);
  padding: 0.6rem 1.25rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.2);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================
   SEO Content Copywriting & Articles
   ========================================== */
.seo-content-section {
  margin-top: 4.5rem;
  padding-top: 3.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: 0.925rem;
}
.seo-content-section section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.seo-content-section h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.015em;
  margin-top: 0.5rem;
}
.seo-content-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.25rem;
}
.seo-content-section p {
  margin-bottom: 0.5rem;
}
.seo-content-section ul, .seo-content-section ol {
  margin-left: 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.seo-content-section li::marker {
  color: var(--accent-primary);
}

/* SEO Data Table */
.seo-table-container {
  overflow-x: auto;
  margin: 0.5rem 0;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.seo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.01);
}
.seo-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.seo-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}
.seo-table tr:last-child td {
  border-bottom: none;
}
.seo-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.005);
}

/* FAQ Accordion Section */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.faq-item {
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.01);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.15rem;
}
.faq-question {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}
.faq-answer {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Footer styling */
.app-footer {
  margin-top: auto;
  padding: 3rem 1.5rem 1.5rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.app-footer a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition-fast);
  position: relative;
}
.app-footer a::after {
  content: "";
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 1px;
  bottom: -1px;
  left: 0;
  background-color: var(--accent-primary);
  transform-origin: bottom right;
  transition: transform var(--transition-fast) ease-out;
}
.app-footer a:hover {
  color: var(--accent-primary);
  text-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}
.app-footer a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* ==========================================
   Responsive Overrides
   ========================================== */

/* Tablets (max-width: 768px) */
@media (max-width: 768px) {
  .container {
    padding: 2rem 1.25rem;
    gap: 1.5rem;
  }
  .case-grid, .inspector-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .site-nav-inner {
    padding: 0 1rem;
  }
  .nav-logo-img {
    height: 28px;
  }
}

/* Mobile Screens (max-width: 580px) */
@media (max-width: 580px) {
  .site-nav-inner {
    padding: 0 0.75rem;
    height: 52px;
  }
  .nav-logo-img {
    height: 24px;
  }
  .nav-link {
    display: none;
  }
  .container {
    padding: 1.5rem 0.75rem;
    gap: 1.25rem;
  }
  
  /* Header adjustments */
  .app-header {
    gap: 0.45rem;
  }
  .app-header h1 {
    font-size: 1.75rem;
  }
  .app-header p {
    font-size: 0.85rem;
  }
  
  /* Text Editor Adjustments */
  .editor-panel {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
  }
  #editor {
    min-height: 260px;
    font-size: 0.95rem;
  }
  
  /* Swipeable scrollable editor toolbar on mobile */
  .editor-toolbar {
    overflow-x: auto;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0.35rem;
    padding-bottom: 0.65rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .editor-toolbar::-webkit-scrollbar {
    display: none;
  }
  .toolbar-left, .toolbar-right {
    flex-shrink: 0;
    gap: 0.35rem;
  }
  .btn-tool {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }
  .editor-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .inline-target-wrap {
    width: 100%;
    justify-content: space-between;
    border-top: 1px dashed rgba(255, 255, 255, 0.03);
    padding-top: 0.5rem;
  }
  
  /* Inline Stats strip adjustments */
  .minimal-stats-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1rem 0.5rem;
  }
  .stat-col {
    border-right: none;
  }
  .stat-col:nth-child(odd) {
    border-right: 1px solid rgba(255, 255, 255, 0.04);
  }
  .stat-num {
    font-size: 1.45rem;
  }
  .stat-label {
    font-size: 0.675rem;
  }
  
  /* Advanced Tools Adjustments */
  .advanced-tools-summary {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
  }
  .advanced-tools-content {
    padding: 1rem;
  }
  .case-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .inspector-grid {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  
  /* Glow Blobs reduction */
  .glow-blob-1 {
    width: 250px;
    height: 250px;
    filter: blur(80px);
  }
  .glow-blob-2 {
    width: 300px;
    height: 300px;
    filter: blur(90px);
  }
  
  /* SEO content text spacing */
  .seo-content-section {
    margin-top: 3rem;
    padding-top: 2.25rem;
    gap: 1.5rem;
    font-size: 0.875rem;
  }
  .seo-content-section h2 {
    font-size: 1.25rem;
  }
  .seo-content-section h3 {
    font-size: 1.05rem;
  }
}

/* Micro screens optimization */
@media (max-width: 360px) {
  .minimal-stats-strip, .case-grid {
    grid-template-columns: 1fr;
  }
  .stat-col:nth-child(odd) {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 0.4rem;
  }
}

/* ==========================================
   LIGHT MODE — prefers-color-scheme: light
   ========================================== */
@media (prefers-color-scheme: light) {

  /* ── Design Token Overrides ── */
  :root {
    --bg-color:       #f0f2f8;
    --panel-bg:       rgba(255, 255, 255, 0.78);
    --panel-border:   rgba(0, 0, 0, 0.07);
    --text-primary:   #111827;
    --text-secondary: #4b5563;
    --text-muted:     #9ca3af;
    --card-glow:      rgba(99, 102, 241, 0.05);
    --success-glow:   rgba(16, 185, 129, 0.12);
  }

  /* ── Base ── */
  body {
    background-color: var(--bg-color);
    color: var(--text-primary);
  }

  /* ── Scrollbars ── */
  ::-webkit-scrollbar-track  { background: #e8eaf2; }
  ::-webkit-scrollbar-thumb  { background: rgba(0, 0, 0, 0.12); }
  ::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

  /* ── Glow blobs — much lighter on white bg ── */
  .glow-blob-1 {
    opacity: 0.18;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 70%);
  }
  .glow-blob-2 {
    opacity: 0.12;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.25) 0%, transparent 70%);
  }

  /* ── Navigation ── */
  .site-nav {
    background: rgba(240, 242, 248, 0.9);
    border-bottom-color: rgba(0, 0, 0, 0.07);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  }

  /* Logo — in light mode show naturally, in dark we handle below */
  .nav-logo-img {
    filter: none;
  }

  /* ── Editor panel ── */
  .editor-panel {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.07);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  }
  .editor-panel:focus-within {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08), 0 0 18px rgba(99, 102, 241, 0.1);
  }

  /* Toolbar separator */
  .editor-toolbar {
    border-bottom-color: rgba(0, 0, 0, 0.06);
  }

  /* Toolbar buttons */
  .btn-tool {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
  }
  .btn-tool:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.14);
    color: var(--text-primary);
  }
  .btn-tool.btn-accent {
    background: rgba(99, 102, 241, 0.07);
    border-color: rgba(99, 102, 241, 0.22);
    color: #4f46e5;
  }
  .btn-tool.btn-accent:hover {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(99, 102, 241, 0.38);
    color: #3730a3;
  }
  .btn-tool.btn-danger:hover {
    background: rgba(220, 38, 38, 0.07);
    border-color: rgba(220, 38, 38, 0.2);
    color: #dc2626;
  }
  .btn-tool.success-state {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
    color: #059669;
  }

  /* Textarea */
  #editor {
    color: var(--text-primary);
    caret-color: var(--accent-primary);
  }
  #editor::placeholder { color: #adb5c7; opacity: 1; }
  #editor::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.08); }

  /* Editor footer */
  .editor-footer {
    border-top-color: rgba(0, 0, 0, 0.06);
  }

  /* Toggle slider */
  .toggle-slider {
    background-color: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.07);
  }
  .toggle-slider::before { background-color: var(--text-secondary); }
  .toggle-container input:checked + .toggle-slider {
    background-color: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.35);
  }

  /* Target word input */
  .target-input {
    color: var(--text-primary);
    border-bottom-color: rgba(0, 0, 0, 0.18);
  }
  .target-input:focus { border-bottom-color: var(--accent-primary); }

  /* Inline target mobile dashed border */
  .inline-target-wrap {
    border-top-color: rgba(0, 0, 0, 0.05) !important;
  }

  /* ── Stats strip ── */
  .minimal-stats-strip {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.07);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.07);
  }
  .stat-col { border-right-color: rgba(0, 0, 0, 0.06); }
  .stat-col:nth-child(odd) { border-right-color: rgba(0, 0, 0, 0.06); }

  /* Reading speed select */
  .speed-select {
    color: var(--text-primary);
    border-bottom-color: rgba(0, 0, 0, 0.2);
  }
  .speed-select option { background: #ffffff; color: var(--text-primary); }

  /* ── Density strip ── */
  .density-strip {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.07);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  }
  .density-pill {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.07);
    color: var(--text-secondary);
  }
  .density-pill:hover {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.25);
    color: var(--text-primary);
  }
  .density-pill strong { color: #4f46e5; }

  /* ── Advanced Tools accordion ── */
  .advanced-tools-details {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.07);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  }
  .advanced-tools-summary:hover { background: rgba(0, 0, 0, 0.015); }
  .advanced-tools-content { border-top-color: rgba(0, 0, 0, 0.05); }

  /* Case buttons */
  .btn-case {
    background: rgba(0, 0, 0, 0.01);
    border-color: rgba(0, 0, 0, 0.06);
  }
  .btn-case:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.07);
  }
  .case-desc { color: var(--text-muted); }

  /* Inspector items */
  .inspector-item {
    background: rgba(0, 0, 0, 0.01);
    border-color: rgba(0, 0, 0, 0.05);
  }
  .inspector-item:hover { border-color: rgba(0, 0, 0, 0.09); }

  /* Lexical diversity box */
  .diversity-box {
    background: rgba(0, 0, 0, 0.01);
    border-color: rgba(0, 0, 0, 0.05);
  }
  .diversity-badge {
    background: rgba(99, 102, 241, 0.07);
    color: #4f46e5;
    border-color: rgba(99, 102, 241, 0.15);
  }
  .diversity-track { background: rgba(0, 0, 0, 0.06); }

  /* ── Toast ── */
  .toast-notification {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(99, 102, 241, 0.35);
    color: var(--text-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 12px rgba(99, 102, 241, 0.12);
  }

  /* ── SEO content section ── */
  .seo-content-section { color: var(--text-secondary); }
  .seo-content-section h2 { color: var(--text-primary); }
  .seo-content-section h3 { color: var(--text-primary); }

  .seo-table-container { border-color: rgba(0, 0, 0, 0.07); }
  .seo-table { background: rgba(255, 255, 255, 0.7); }
  .seo-table th {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
    border-bottom-color: rgba(0, 0, 0, 0.07);
  }
  .seo-table td {
    color: var(--text-secondary);
    border-bottom-color: rgba(0, 0, 0, 0.04);
  }
  .seo-table tr:nth-child(even) { background: rgba(0, 0, 0, 0.01); }

  /* FAQ items */
  .faq-item {
    border-color: rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.6);
  }

  /* Footer */
  .app-footer {
    border-top-color: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
  }
  .app-footer a { color: var(--text-primary); }
  .app-footer a::after { background-color: var(--accent-primary); }

  /* AdSense ad labels */
  .ad-unit-label { color: #c0c4cc; }
  .ad-unit-divider { border-top-color: rgba(0, 0, 0, 0.05); }

  /* Mobile stat col border in light mode */
  @media (max-width: 360px) {
    .stat-col:nth-child(odd) {
      border-bottom-color: rgba(0, 0, 0, 0.05);
    }
  }
}

/* ==========================================
   DARK MODE — logo treatment
   Wrap logo in a subtle light pill so the
   logo's white/light background blends in.
   ========================================== */
@media (prefers-color-scheme: dark) {
  .nav-logo-link {
    background: rgba(255, 255, 255, 0.96);
    padding: 4px 10px;
    border-radius: 8px;
  }
  .nav-logo-img {
    filter: none;
  }
}

