/* ==========================================================
   Graspit — DASH Ecosystem Design System
   Dark glassmorphism theme with ambient glow
   ========================================================== */

/* --- Reset & Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-deep: #050510;
  --bg-surface: rgba(255, 255, 255, 0.03);
  --bg-surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --primary: #0ea5e9;
  --primary-glow: rgba(14, 165, 233, 0.25);
  --primary-dim: rgba(14, 165, 233, 0.12);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.2);
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.2);
  --text-primary: #f5f5f5;
  --text-secondary: #a1a1aa;
  --text-dim: #71717a;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --glass-blur: blur(20px);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

/* Ambient glow orbs */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(120px);
  opacity: 0.4;
}

body::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
  top: -200px;
  right: -150px;
}

body::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
  bottom: -150px;
  left: -100px;
}

/* --- Container --- */
.container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  border: 1px solid var(--border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1;
}

/* --- Header --- */
header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary) 0%, #38bdf8 50%, var(--success) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* Version Badge — hidden by default in new design, kept for compatibility */
.version-badge {
  display: none;
}

/* --- Steps --- */
.step {
  display: none;
}

.step.active {
  display: block;
  animation: fadeIn 0.5s ease-out;
}

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

h2 {
  color: var(--text-primary);
  margin-bottom: 20px;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- Textarea --- */
textarea {
  width: 100%;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--text-primary);
  resize: vertical;
  transition: border-color 0.3s, box-shadow 0.3s;
  line-height: 1.6;
}

textarea::placeholder {
  color: var(--text-dim);
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

/* --- Stats --- */
.stats {
  margin: 10px 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  display: flex;
  gap: 10px;
  align-items: center;
}

.stats .separator {
  color: rgba(255, 255, 255, 0.1);
  font-weight: 300;
}

/* --- Buttons --- */
.btn-primary,
.btn-secondary,
.btn-copy {
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 10px 5px;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #38bdf8 100%);
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-glow), 0 0 40px rgba(14, 165, 233, 0.15);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-copy {
  background: linear-gradient(135deg, var(--success), #34d399);
  color: #fff;
  display: block;
  margin: 15px auto 0;
  box-shadow: 0 4px 16px var(--success-glow);
}

.btn-copy:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--success-glow);
}

/* --- Quiz Intro --- */
.quiz-intro {
  background: var(--primary-dim);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border-left: 3px solid var(--primary);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* --- Quiz Container --- */
#quizContainer {
  margin: 20px 0;
}

.quiz-question {
  background: var(--bg-surface);
  padding: 24px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid var(--border);
  backdrop-filter: var(--glass-blur);
  transition: border-color 0.3s;
}

.quiz-question:hover {
  border-color: var(--border-hover);
}

.quiz-question h3 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.quiz-question p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 4px;
}

.quiz-question input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--text-primary);
  margin-top: 10px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.quiz-question input::placeholder {
  color: var(--text-dim);
}

.quiz-question input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.quiz-actions {
  text-align: center;
  margin-top: 24px;
}

/* --- Quiz Results --- */
#quizResults {
  background: var(--primary-dim);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

#quizResults.passed {
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--success);
}

#quizResults.failed {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--error);
}

/* --- Comparison (Results Side-by-Side) --- */
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}

@media (max-width: 768px) {
  .comparison {
    grid-template-columns: 1fr;
  }
}

.text-box {
  background: var(--bg-surface);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  backdrop-filter: var(--glass-blur);
  transition: border-color 0.3s;
}

.text-box:hover {
  border-color: var(--border-hover);
}

.text-box.success {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.2);
}

.text-box.success:hover {
  border-color: rgba(16, 185, 129, 0.35);
}

.text-box h3 {
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.text-box p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.92rem;
  max-height: 300px;
  overflow-y: auto;
}

/* Custom scrollbar for text boxes */
.text-box p::-webkit-scrollbar {
  width: 4px;
}

.text-box p::-webkit-scrollbar-track {
  background: transparent;
}

.text-box p::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.text-box p {
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- Improvement Banner --- */
.improvement {
  text-align: center;
  font-size: 1.2rem;
  color: var(--success);
  margin: 24px 0;
  padding: 20px;
  background: rgba(16, 185, 129, 0.06);
  border-radius: var(--radius-md);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.improvement .word-diff {
  font-size: 1rem;
  color: var(--primary);
  margin-top: 8px;
}

.word-stats {
  text-align: center;
  padding: 8px;
  font-size: 0.82rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

/* --- Loading Overlay --- */
.loading {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 16, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  flex-direction: column;
  color: var(--text-primary);
}

.loading.active {
  display: flex;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(14, 165, 233, 0.15);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 24px var(--primary-glow);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading p {
  margin-top: 20px;
  font-size: 1rem;
  color: var(--text-secondary);
  animation: fadeInOut 1.5s ease-in-out infinite;
  letter-spacing: 0.02em;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* --- Error --- */
.error {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  display: none;
  border-left: 3px solid var(--error);
  font-size: 0.95rem;
}

.error.active {
  display: block;
}

/* --- Footer --- */
footer {
  text-align: center;
  color: var(--text-dim);
  margin-top: 30px;
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

footer p {
  opacity: 0.7;
}

footer a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: #38bdf8;
}

/* --- Flash Summary --- */
.flash-summary {
  background: var(--primary-dim);
  padding: 24px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary);
  margin: 20px 0;
}

.flash-summary h3 {
  color: var(--primary);
  margin-bottom: 16px;
  font-size: 1.05rem;
  font-weight: 700;
}

.flash-summary ul {
  list-style: none;
  padding: 0;
}

.flash-summary li {
  padding: 8px 0 8px 24px;
  position: relative;
  line-height: 1.6;
  color: var(--text-secondary);
}

.flash-summary li:before {
  content: '';
  position: absolute;
  left: 4px;
  top: 15px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.flash-summary .keywords {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* --- Payment Section --- */
.payment-section {
  background: var(--bg-surface);
  padding: 32px;
  border-radius: var(--radius-lg);
  margin: 30px 0;
  border: 1px solid rgba(245, 158, 11, 0.2);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.08);
}

.payment-section h2 {
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 10px;
  font-size: 1.4rem;
}

#countdown {
  color: var(--error);
  font-weight: 700;
  font-size: 1.3em;
  font-variant-numeric: tabular-nums;
}

.payment-warning {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 15px 0 25px 0;
  line-height: 1.7;
}

.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

@media (max-width: 768px) {
  .payment-options {
    grid-template-columns: 1fr;
  }
}

.payment-option {
  background: rgba(255, 255, 255, 0.03);
  padding: 24px;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border);
  transition: border-color 0.3s;
}

.payment-option:hover {
  border-color: rgba(245, 158, 11, 0.3);
}

.payment-option h3 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1rem;
  font-weight: 700;
}

.payment-option p {
  color: var(--text-dim);
  margin: 10px 0;
  font-size: 0.9rem;
}

.btn-instagram {
  display: inline-block;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-family: var(--font);
  margin: 10px 0;
  transition: transform 0.3s, box-shadow 0.3s;
  font-size: 0.9rem;
}

.btn-instagram:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(220, 39, 67, 0.3);
}

.qr-container {
  text-align: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  margin: 15px 0;
}

.qr-image {
  max-width: 180px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* --- Header Actions --- */
.header-actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s;
  margin: 0 5px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--primary-dim);
  border-color: var(--primary);
  transform: scale(1.08);
}

/* --- Action Buttons --- */
.action-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* --- Modal Styles --- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 16, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: rgba(20, 20, 35, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.modal-content.modal-large {
  max-width: 800px;
}

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

.modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-dim);
  line-height: 1;
  transition: color 0.2s;
  padding: 4px;
}

.modal-close:hover {
  color: var(--error);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  padding: 8px 16px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  font-family: var(--font);
  font-weight: 500;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}

/* --- History List --- */
.history-list {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.history-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s;
}

.history-item:hover {
  border-color: var(--primary);
  background: var(--primary-dim);
  transform: translateX(4px);
}

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

.history-item-date {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.history-item-score {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.history-item-preview {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}

/* --- Detector Results --- */
.detector-results {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.detector-score {
  text-align: center;
  padding: 30px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.detector-score-number {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.detector-score-label {
  font-size: 1rem;
  margin-top: 10px;
  font-weight: 600;
  color: var(--text-secondary);
}

.detector-flags {
  margin-top: 20px;
}

.detector-flags h3 {
  color: var(--text-primary);
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 700;
}

.detector-flag {
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  border-left: 3px solid var(--warning);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
}

.detector-flag.high {
  border-left-color: var(--error);
  background: rgba(239, 68, 68, 0.06);
}

.detector-flag.medium {
  border-left-color: var(--warning);
  background: rgba(245, 158, 11, 0.06);
}

.detector-flag.low {
  border-left-color: var(--primary);
  background: rgba(14, 165, 233, 0.06);
}

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

.detector-flag-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.92rem;
}

.detector-flag-score {
  font-size: 0.82rem;
  padding: 2px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

.detector-flag-issues {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.detector-flag-issues li {
  margin: 4px 0;
}

.detector-suggestions {
  background: rgba(16, 185, 129, 0.08);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-top: 20px;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.detector-suggestions h3 {
  color: var(--success);
  margin-bottom: 15px;
  font-size: 1rem;
  font-weight: 700;
}

.detector-suggestions ul {
  padding-left: 20px;
}

.detector-suggestions li {
  margin: 8px 0;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* New LLM detector styles */
.detector-flag-severity {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.detector-flag.high .detector-flag-severity {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.detector-flag.medium .detector-flag-severity {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.detector-flag.low .detector-flag-severity {
  background: rgba(14, 165, 233, 0.15);
  color: #7dd3fc;
}

.detector-flag-excerpt {
  font-style: italic;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin: 10px 0;
  font-size: 0.88rem;
  border-left: 2px solid var(--primary);
}

.detector-flag-suggestion {
  color: var(--success);
  font-size: 0.85rem;
  margin-top: 8px;
}

.detector-clean {
  text-align: center;
  padding: 40px 20px;
  background: rgba(16, 185, 129, 0.08);
  border-radius: var(--radius-md);
  margin-top: 20px;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.detector-clean p {
  color: var(--success);
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0;
}

/* Enhanced Detector Styles */
.detector-dual-score {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
}

.detector-score-box {
  flex: 1;
  max-width: 160px;
  padding: 24px 20px;
  border-radius: var(--radius-md);
  border: 2px solid;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: var(--glass-blur);
}

.detector-verdict {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1rem;
  color: var(--text-secondary);
}

.confidence-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  margin-left: 10px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.confidence-badge.high {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.confidence-badge.medium {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}

.confidence-badge.low {
  background: rgba(239, 68, 68, 0.12);
  color: var(--error);
}

.detector-summary {
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-style: italic;
  color: var(--text-dim);
  text-align: center;
  border: 1px solid var(--border);
}

.detector-quickwins {
  background: var(--primary-dim);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border-left: 3px solid var(--primary);
}

.detector-quickwins h3 {
  color: var(--primary);
  margin-bottom: 15px;
  font-size: 0.95rem;
  font-weight: 700;
}

.detector-quickwins ol {
  padding-left: 20px;
  margin: 0;
}

.detector-quickwins li {
  margin: 8px 0;
  line-height: 1.5;
  color: var(--text-secondary);
}

.detector-flag-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.priority-badge {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
}

.detector-flag.missing-signal {
  border-left: 3px solid var(--warning);
}

.detector-flag.ai-pattern {
  border-left: 3px solid var(--error);
}

.detector-positives {
  background: rgba(16, 185, 129, 0.06);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-top: 20px;
  border: 1px solid rgba(16, 185, 129, 0.12);
}

.detector-positives h3 {
  color: var(--success);
  margin-bottom: 15px;
  font-size: 0.95rem;
  font-weight: 700;
}

.positive-item {
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.positive-item strong {
  color: var(--success);
}

.positive-excerpt {
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-top: 5px;
}

/* --- Tone Selector --- */
.tone-selector {
  margin: 24px 0;
  padding: 24px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  backdrop-filter: var(--glass-blur);
}

.tone-label {
  display: block;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tone-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 500px) {
  .tone-options {
    grid-template-columns: 1fr;
  }
}

.tone-option {
  cursor: pointer;
}

.tone-option input[type="radio"] {
  display: none;
}

.tone-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  text-align: center;
}

.tone-option:hover .tone-card {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.tone-option.selected .tone-card,
.tone-option input:checked + .tone-card {
  border-color: var(--primary);
  background: var(--primary-dim);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.tone-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
}

.tone-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tone-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* APEX Badge — hidden in new design */
.apex-badge {
  display: none;
}

/* Pulse animation */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--primary-glow); }
  70% { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.new-feature {
  animation: pulse 2s infinite;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .container {
    padding: 24px 18px;
    border-radius: 16px;
  }

  header h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .payment-section {
    padding: 24px 18px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

/* --- Selection color --- */
::selection {
  background: rgba(14, 165, 233, 0.3);
  color: #fff;
}

/* --- Scrollbar (global) --- */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}
