/* preecode – Custom styles (Tailwind handles the rest) */

/* ══════════════════════════════════════
   THEME-AWARE LOGO – Auto-switch dark/light
══════════════════════════════════════ */
.preecode-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.preecode-logo img {
  display: block;
  width: auto;
  max-width: none;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.preecode-logo img:hover {
  transform: scale(1.05);
}
/* Dark theme (default): show dark logo, hide light logo */
.logo-dark  { display: block; }
.logo-light { display: none; }
/* Light theme: swap visibility */
html.light .logo-dark  { display: none; }
html.light .logo-light { display: block; }

/* Logo sizes */
.preecode-logo.logo-nav img   { height: 48px; }
.preecode-logo.logo-auth img  { height: 30px; }
.preecode-logo.logo-footer img { height: 22px; }
@media (min-width: 768px) {
  .preecode-logo.logo-nav img   { height: 56px; }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ── Difficulty bar fills ── */
.diff-bar-fill { height: 100%; border-radius: 9999px; width: 0; transition: width 1s ease; }
.diff-bar-fill.easy   { background: #00af9b; }
.diff-bar-fill.medium { background: #ffb800; }
.diff-bar-fill.hard   { background: #ff375f; }

/* ── Activity bars ── */
.activity-bar { transition: height 0.6s cubic-bezier(0.4,0,0.2,1); }

/* ── Select chevron ── */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px !important;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

/* ── Focus ring ── */
input:focus, select:focus { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Heatmap grid for mockup ── */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: rgba(255,255,255,0.05);
}
.heatmap-cell.l1 { background: rgba(255,161,22,0.15); }
.heatmap-cell.l2 { background: rgba(255,161,22,0.35); }
.heatmap-cell.l3 { background: rgba(255,161,22,0.55); }
.heatmap-cell.l4 { background: rgba(255,161,22,0.8); }

/* ── Activity bar hover ── */
.activity-bar:hover { background-color: rgba(255,107,0,0.5) !important; }

/* ── Mini chart bars ── */
.chart-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: rgba(255,161,22,0.6);
  transition: height 0.6s ease;
}

/* ── System workflow flow diagram ── */
.workflow-flow {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}
.workflow-step {
  flex: 1;
  max-width: 220px;
  text-align: center;
  padding: 0 12px;
}
.workflow-icon-wrapper {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 16px;
  background: rgba(255,107,0,0.08);
  border: 1px solid rgba(255,107,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.workflow-step:hover .workflow-icon-wrapper {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(255,107,0,0.15);
}
.workflow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 16px;
  flex-shrink: 0;
}
.workflow-arrow svg {
  filter: drop-shadow(0 0 6px rgba(255,107,0,0.3));
}

/* ── Workflow responsive: stack on mobile ── */
@media (max-width: 768px) {
  .workflow-flow {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .workflow-step {
    max-width: 320px;
  }
  .workflow-arrow {
    padding-top: 0;
    transform: rotate(90deg);
  }
}

/* ══════════════════════════════════════
   AI MENTOR – Clean Minimal Widget
══════════════════════════════════════ */

/* ── FAB ── */
.ai-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b00, #ff8c00);
  border: none;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 107, 0, 0.35);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.25s ease;
  overflow: hidden;
  animation: fabPulse 3s ease-in-out infinite;
}
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(255, 107, 0, 0.35); }
  50%      { box-shadow: 0 4px 28px rgba(255, 107, 0, 0.5), 0 0 40px rgba(255, 107, 0, 0.12); }
}
.ai-chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(255, 107, 0, 0.5);
  animation: none;
}
.ai-chat-fab:active { transform: scale(0.95); }

/* Ripple */
.ai-fab-ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}
.ai-fab-ripple.active {
  animation: fabRipple 0.5s ease-out;
}
@keyframes fabRipple {
  0%   { transform: scale(0); opacity: 0.4; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ── Panel ── */
.ai-chat-panel {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 380px;
  max-height: 540px;
  background: var(--card-bg);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  display: none;
  flex-direction: column;
  z-index: 1002;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
.ai-chat-panel.open {
  display: flex;
  animation: panelOpen 0.25s cubic-bezier(0.16,1,0.3,1) forwards;
}
@keyframes panelOpen {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ai-chat-panel.closing {
  display: flex;
  animation: panelClose 0.25s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes panelClose {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(10px) scale(0.96); }
}

/* ── Header ── */
.ai-chat-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ai-chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-header-avatar {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.14), rgba(255, 140, 0, 0.06));
  border: 1px solid rgba(255, 107, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff6b00;
  flex-shrink: 0;
}
.ai-header-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ai-header-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.ai-header-accent {
  color: #ff6b00;
  font-weight: 800;
}
.ai-status-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 500;
}
.ai-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.45);
  animation: statusPulse 2.5s ease-in-out infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.ai-chat-header-actions {
  display: flex;
  gap: 2px;
}
.ai-header-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.ai-header-btn:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

/* ── Messages ── */
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  scroll-behavior: smooth;
}
.ai-msg-wrapper {
  display: flex;
  gap: 8px;
  animation: msgFadeIn 0.3s cubic-bezier(0.16,1,0.3,1);
}
.ai-msg-wrapper.user {
  flex-direction: row-reverse;
}
@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ai-msg-avatar {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.1), rgba(255, 107, 0, 0.04));
  border: 1px solid rgba(255, 107, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff6b00;
  margin-top: 2px;
  flex-shrink: 0;
}
.ai-msg-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 84%;
  position: relative;
}
.ai-msg-wrapper.user .ai-msg-content {
  align-items: flex-end;
}
.ai-msg {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.ai-msg.user {
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.16), rgba(255, 107, 0, 0.08));
  color: #ffd4a8;
  border: 1px solid rgba(255, 107, 0, 0.1);
  border-bottom-right-radius: 4px;
}
.ai-msg.bot {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 4px;
}
.ai-msg.bot.error {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.06);
  border-color: rgba(248, 113, 113, 0.1);
}
.ai-msg-time {
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 500;
  padding: 0 4px;
}
.ai-msg-copy {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  color: var(--text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.ai-msg-content:hover .ai-msg-copy { opacity: 1; }
.ai-msg-copy:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.ai-msg-wrapper.user .ai-msg-copy {
  right: auto;
  left: 4px;
}

/* ── Typing indicator ── */
.typing-indicator {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 2px 0;
}
.typing-indicator span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ff6b00;
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.32s; }
@keyframes typingBounce {
  0%, 60%, 100% { opacity: 0.2; transform: translateY(0); }
  30%            { opacity: 1; transform: translateY(-5px); }
}

/* ── Suggestion chips ── */
.ai-prompt-chips {
  display: flex;
  gap: 6px;
  padding: 4px 16px 8px;
  flex-wrap: wrap;
  transition: opacity 0.25s ease, max-height 0.25s ease;
}
.ai-prompt-chips.hidden {
  opacity: 0;
  max-height: 0;
  padding: 0 16px;
  overflow: hidden;
  pointer-events: none;
}
.ai-chip {
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  animation: chipFadeIn 0.4s ease backwards;
}
.ai-chip:nth-child(1) { animation-delay: 0.05s; }
.ai-chip:nth-child(2) { animation-delay: 0.1s; }
.ai-chip:nth-child(3) { animation-delay: 0.15s; }
.ai-chip:nth-child(4) { animation-delay: 0.2s; }
@keyframes chipFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ai-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ── Footer (trust + input) ── */
.ai-chat-footer {
  border-top: 1px solid var(--border-subtle);
}
.ai-trust-text {
  display: block;
  text-align: center;
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 500;
  padding: 6px 16px 0;
  letter-spacing: 0.01em;
}
.ai-chat-input-row {
  padding: 8px 12px 12px;
  display: flex;
  gap: 8px;
}
.ai-chat-input-row input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 13px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-input);
}
.ai-chat-input-row input:focus {
  background: var(--bg-input);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-input), 0 0 0 3px var(--focus-ring);
  outline: none;
}
.ai-chat-input-row input::placeholder {
  color: var(--text-faint);
}
.ai-chat-input-row button {
  background: linear-gradient(135deg, #ff6b00, #ff9000);
  border: none;
  border-radius: 12px;
  width: 42px;
  height: 42px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 2px 8px rgba(255, 107, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ai-chat-input-row button:hover:not(:disabled) {
  box-shadow: 0 4px 14px rgba(255, 107, 0, 0.3), 0 0 20px rgba(255, 107, 0, 0.08);
  transform: translateY(-2px);
}
.ai-chat-input-row button:active:not(:disabled) {
  transform: translateY(0);
}
.ai-chat-input-row button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ai-send-label {
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ai-send-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .ai-chat-fab {
    bottom: 16px;
    right: 16px;
    width: 46px;
    height: 46px;
  }
  .ai-chat-fab svg { width: 18px; height: 18px; }
  .ai-chat-panel {
    width: 100vw;
    right: 0;
    left: 0;
    bottom: 0;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
  }
  .ai-chat-header { padding: 10px 12px; }
  .ai-chat-messages { padding: 12px; gap: 8px; max-height: 220px; }
  .ai-prompt-chips { padding: 4px 12px 6px; gap: 4px; }
  .ai-chip { padding: 5px 10px; font-size: 10px; }
  .ai-chat-input-row { padding: 6px 10px 10px; gap: 6px; }
  .ai-chat-input-row input { padding: 10px 12px; font-size: 13px; }
  .ai-chat-input-row button { width: 38px; height: 38px; }
  .ai-msg { padding: 8px 12px; font-size: 13px; }
  .ai-msg-content { max-width: 88%; }
  .ai-trust-text { padding: 5px 12px 0; }
}

@media (max-width: 320px) {
  .ai-chat-panel {
    max-height: 90vh;
  }
  .ai-chat-header { padding: 8px 10px; }
  .ai-header-avatar { width: 26px; height: 26px; }
  .ai-header-title { font-size: 13px; }
  .ai-chat-messages { padding: 10px; max-height: 180px; }
  .ai-prompt-chips { padding: 2px 10px 4px; }
  .ai-chat-input-row {
    padding: 6px 8px 8px;
    gap: 6px;
  }
  .ai-chat-input-row input { min-width: 0; }
}

/* ── Social Proof: Metrics + Testimonials ── */
.proof-section {
  padding: 96px 0;
  border-top: 1px solid var(--border-subtle);
}
.metrics-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 32px 24px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-card);
}
.metric-item {
  text-align: center;
  padding: 0 16px;
}
.metric-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0 0 4px;
}
.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.metric-divider {
  width: 1px;
  height: 40px;
  background: var(--border-subtle);
  justify-self: center;
}
.metric-accent {
  color: var(--accent);
}
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.testimonial-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
}
.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.testimonial-quote-icon {
  color: var(--accent);
  opacity: 0.2;
  margin-bottom: 16px;
}
.testimonial-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 0 0 auto;
  padding-bottom: 24px;
  font-style: italic;
}
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}
.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--avatar-bg, var(--accent-soft));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.testimonial-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.testimonial-role {
  font-size: 11px;
  color: var(--text-muted);
  margin: 2px 0 0;
}
@media (max-width: 767px) {
  .metrics-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 0;
  }
  .metric-divider {
    display: none;
  }
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ── Landing Page Components ── */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  padding: 12px 28px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  box-shadow: 0 4px 16px rgba(255, 161, 22, 0.25);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(255, 161, 22, 0.35);
}
.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

/* Section Layout */
.section {
  padding: 96px 0;
  border-top: 1px solid var(--border-subtle);
}
.section-header {
  text-align: center;
  margin-bottom: 56px;
}
.section-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}
.section-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 16px;
  line-height: 1.2;
}
.section-desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
}
.section-alt {
  background: var(--bg-section);
}
@media (min-width: 768px) {
  .section-title {
    font-size: 40px;
  }
}

/* Landing Cards */
.landing-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 28px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.landing-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.landing-card-compact {
  padding: 20px;
  text-align: center;
}
.landing-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.landing-card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

/* Icon Box */
.icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-box svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}
.icon-box-sm {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.icon-box-sm svg {
  width: 18px;
  height: 18px;
}
.icon-box.danger {
  background: rgba(244, 63, 94, 0.08);
}
.icon-box.danger svg {
  color: var(--danger);
}

/* Step Label */
.step-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  opacity: 0.6;
  margin: 0 0 16px;
}

/* Feature Item */
.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.feature-item .icon-box {
  margin-top: 2px;
}
.feature-item h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
}
.feature-item p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

/* Check Item */
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.check-item svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}
.check-item span {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Landing Highlight Box */
.landing-highlight {
  display: inline-block;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 20px 32px;
}
.landing-highlight p {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

/* Mockup Card (Dashboard + Editor) */
.mockup-card {
  animation: subtleFloat 6s ease-in-out infinite;
}
@keyframes subtleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.editor-mockup {
  background: #111318;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}
.editor-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.editor-dots {
  display: flex;
  gap: 6px;
}
.editor-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.editor-filename {
  font-size: 11px;
  color: #6b7280;
  font-family: monospace;
  margin-left: 4px;
}
.editor-code {
  padding: 16px;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.7;
}
.editor-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.editor-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
}
.editor-status-text {
  font-size: 10px;
  color: #6b7280;
}

/* Hero Credibility */
.hero-credibility {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin: 0 0 24px;
}

/* CTA Section */
.cta-section {
  padding: 128px 0;
}

/* Landing card grid helpers */
.landing-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.landing-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 640px) {
  .landing-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 767px) {
  .landing-grid-3 {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 640px) and (max-width: 767px) {
  .landing-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── FAQ Accordion ── */
.faq-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.faq-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  padding: 0;
}
.faq-item:last-child {
  border-bottom: none;
}
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease;
  gap: 12px;
}
.faq-question span:first-child {
  flex: 1;
}
.faq-question:hover {
  color: var(--accent);
}
.faq-question:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.faq-icon {
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
  user-select: none;
}
.faq-item.open .faq-icon {
  transform: rotate(45deg);
}
.faq-answer {
  overflow: hidden;
  height: 0;
  transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.faq-answer p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
  padding-bottom: 16px;
}

/* ── Security Badge Row ── */
.security-badges {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 768px) {
  .security-badges { grid-template-columns: repeat(4, 1fr); }
}
.security-badge {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}
.security-badge svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.security-badge-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin: 0 0 2px; }
.security-badge-desc { font-size: 12px; color: var(--text-muted); margin: 0; line-height: 1.4; }

/* ── Footer ── */
.footer-main {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 64px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px 48px;
  padding-bottom: 48px;
}
@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
  }
}
.footer-brand {
  max-width: 280px;
}
.preecode-logo.logo-footer {
  transition: opacity 0.2s ease;
}
.preecode-logo.logo-footer:hover {
  opacity: 0.8;
}
.footer-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}
.footer-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 0 0 16px;
}
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
  display: inline-block;
}
.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.footer-links a:hover {
  color: var(--text-primary);
}
.footer-links a:hover::after {
  width: 100%;
}
.footer-social {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.footer-social a svg {
  width: 16px;
  height: 16px;
}
.footer-social a:hover {
  color: var(--accent);
  transform: scale(1.1);
  background: var(--accent-soft);
}
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-top: 1px solid var(--border-subtle);
}
@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
  }
}
.footer-bottom p {
  font-size: 11px;
  color: var(--text-faint);
  margin: 0;
}
.footer-tagline {
  font-style: italic;
  letter-spacing: 0.02em;
}

/* ══════════════════════════════════════
   AUTH PAGES – Login & Register
══════════════════════════════════════ */

/* Fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}
.animate-fade-in-2 {
  animation: fadeIn 0.8s ease 0.2s forwards;
}

/* Grid pattern for left panel */
.auth-grid-pattern {
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Card container */
.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 44px 40px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-lg);
}

/* Labels */
.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

/* Inputs */
.auth-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.auth-input::placeholder {
  color: var(--text-faint);
}
.auth-input:hover {
  border-color: var(--border-strong);
}
.auth-input:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.auth-input.border-red-500 {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Primary CTA button */
.auth-btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 4px 16px rgba(255, 161, 22, 0.25);
}
.auth-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 161, 22, 0.35);
  filter: brightness(1.08);
}
.auth-btn-primary:active {
  transform: translateY(0);
}
.auth-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Social login buttons */
.auth-btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.auth-btn-social:hover {
  border-color: var(--accent-border);
  transform: translateY(-1px);
}
.auth-btn-social:active {
  transform: translateY(0);
}

/* Password toggle */
.pw-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}
.pw-toggle:hover {
  color: var(--text-secondary);
}
.pw-toggle:focus {
  outline: none;
  box-shadow: none;
}

/* ══════════════════════════════════════
   APP PAGES – Global Polish System
══════════════════════════════════════ */

/* ── Reusable Card ── */
.app-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.25s ease;
}
.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
  border-radius: 16px 16px 0 0;
  pointer-events: none;
}
.app-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-border);
}

/* ── Metric Card (KPI) ── */
.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.25s ease;
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
  pointer-events: none;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.metric-card .accent-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #ff6b00;
  opacity: 0.8;
}
.metric-card .metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.metric-card .metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.metric-card .metric-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-faint);
  margin-left: 4px;
}
.metric-card .metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 500;
}
.metric-card .metric-trend.up { color: #34d399; }
.metric-card .metric-trend.down { color: #f87171; }
.metric-card .sparkline {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100px;
  height: 40px;
  opacity: 0.3;
}
.metric-card .sparkline polyline {
  stroke: var(--accent);
}

/* ── App Table ── */
.app-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.app-table thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border-subtle);
}
.app-table tbody tr {
  transition: background-color 0.15s ease;
  border-bottom: 1px solid var(--border-subtle);
}
.app-table tbody tr:last-child {
  border-bottom: none;
}
.app-table tbody tr:hover {
  background-color: var(--bg-hover);
}
.app-table tbody td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  vertical-align: middle;
}
.app-table tbody td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Difficulty Badges ── */
.diff-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.diff-badge.easy   { background: rgba(52, 211, 153, 0.12); color: #34d399; }
.diff-badge.medium { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.diff-badge.hard   { background: rgba(248, 113, 113, 0.12); color: #f87171; }
.diff-badge.accepted { background: rgba(52, 211, 153, 0.12); color: #34d399; }
.diff-badge.wrong    { background: rgba(248, 113, 113, 0.12); color: #f87171; }

/* ── Skeleton Loading ── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    var(--skeleton-from) 25%,
    var(--skeleton-to) 50%,
    var(--skeleton-from) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 8px;
}
.skeleton-line {
  height: 12px;
  margin-bottom: 8px;
  border-radius: 6px;
}
.skeleton-value {
  height: 32px;
  width: 80px;
  border-radius: 8px;
}
.skeleton-bar {
  border-radius: 4px 4px 0 0;
}
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

/* ── Filter Controls ── */
.filter-control {
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.filter-control:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}
.filter-control:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
  background: var(--bg-hover);
}
.filter-control.active {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

/* ── Search Input with Icon ── */
.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-wrapper .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
  transition: color 0.18s ease;
}
.search-wrapper input:focus ~ .search-icon {
  color: var(--text-secondary);
}
.search-wrapper .search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.search-wrapper .search-clear:hover {
  background: var(--border-strong);
  color: var(--text-primary);
}
.search-wrapper input:not(:placeholder-shown) ~ .search-clear {
  display: flex;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 0 4px;
}
.pagination button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pagination button:hover:not(:disabled):not(.active) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.pagination button.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}
.pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Stats Row ── */
.stats-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.stats-row .stat-item {
  flex: 1;
  min-width: 120px;
  padding: 14px 18px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: border-color 0.18s ease;
}
.stats-row .stat-item:hover {
  border-color: var(--border-strong);
}
.stats-row .stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.stats-row .stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* ── Badge Component ── */
.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  min-width: 110px;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
}
.badge-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.badge-card.locked {
  opacity: 0.45;
}
.badge-card.locked .badge-icon {
  filter: blur(1px) grayscale(0.3);
}
.badge-card.unlocked {
  border-color: var(--accent-border);
}
.badge-card.unlocked::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 0%, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.badge-icon {
  font-size: 24px;
  line-height: 1;
  transition: filter 0.2s ease;
}
.badge-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}
.badge-progress {
  width: 100%;
  height: 3px;
  background: var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 2px;
}
.badge-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.badge-meta {
  font-size: 10px;
  color: var(--text-faint);
}

/* ── Tooltip ── */
.tooltip-wrap {
  position: relative;
}
.tooltip-wrap .tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 100;
}
.tooltip-wrap .tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--card-bg);
}
.tooltip-wrap:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Difficulty Bars (Profile) – Increased height ── */
.diff-bar-track {
  height: 8px;
  background: var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}
.diff-bar-track .diff-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Section Header ── */
.section-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
}
.empty-state .empty-icon {
  font-size: 36px;
  opacity: 1;
}
.empty-state .empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}
.empty-state .empty-desc {
  font-size: 12px;
  color: var(--text-faint);
  max-width: 260px;
  line-height: 1.5;
}
.empty-state .empty-cta {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 18px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.15s ease;
}
.empty-state .empty-cta:hover {
  background: var(--accent-glow);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════
   EARLY ACCESS – Modals, Banners, Badges
══════════════════════════════════════ */

/* ── Modal Overlay ── */
.ea-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.ea-overlay.open {
  opacity: 1;
}

/* ── Modal Panel ── */
.ea-modal {
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 40px 36px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s ease;
  position: relative;
  overflow: hidden;
}
.ea-overlay.open .ea-modal {
  transform: translateY(0) scale(1);
}
.ea-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ff6b00, transparent);
}
.ea-modal-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 16px;
}
.ea-modal h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.ea-modal p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 8px;
}
.ea-modal .ea-tag {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin: 16px 0 4px;
}
.ea-modal .ea-tag-sub {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 24px;
}

/* ── Modal CTA Button ── */
.ea-btn {
  display: inline-block;
  padding: 12px 32px;
  background: #ff6b00;
  color: #0a0a0b;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  text-decoration: none;
}
.ea-btn:hover {
  background: #e86000;
  transform: translateY(-1px);
}

/* ── Early Access Banner ── */
.ea-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 14px;
  margin-bottom: 20px;
}
.ea-banner-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}
.ea-banner-btn {
  padding: 8px 18px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.15s ease;
}
.ea-banner-btn:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* ── Share Modal Rewards List ── */
.ea-rewards {
  text-align: left;
  margin: 20px 0 24px;
}
.ea-rewards li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}
.ea-rewards li:last-child {
  border-bottom: none;
}
.ea-rewards .ea-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

/* ── Share Buttons ── */
.ea-share-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}
.ea-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}
.ea-share-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.ea-share-btn svg {
  width: 16px;
  height: 16px;
}

/* ── Confetti ── */
@keyframes confettiFall {
  0%   { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
.confetti-piece {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  z-index: 3000;
  pointer-events: none;
  animation: confettiFall 2.5s ease-out forwards;
}

/* ── Founding Badge (Profile) ── */
.founding-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.founding-badge.basic {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.founding-badge.elite {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}
.founding-badge.elite:hover {
  box-shadow: 0 0 24px rgba(255, 107, 0, 0.15);
  transform: translateY(-1px);
}

/* ── Certificate ── */
.cert-card {
  background: var(--card-bg);
  border: 2px solid var(--accent-border);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}
.cert-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ff6b00, transparent);
}
.cert-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ff6b00, transparent);
}
.cert-title {
  font-size: 24px;
  font-weight: 700;
  color: #ff6b00;
  margin-bottom: 8px;
}
.cert-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.cert-name {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 24px;
}
.cert-meta {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.cert-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
}

@media (max-width: 480px) {
  .ea-modal {
    padding: 28px 24px;
  }
  .ea-banner {
    flex-direction: column;
    text-align: center;
  }
  .cert-card {
    padding: 32px 24px;
  }
}

/* ══════════════════════════════════════
   THEME SELECTOR – Profile Settings
══════════════════════════════════════ */
.theme-option {
  background: transparent;
}
.theme-option.active {
  border-color: var(--accent) !important;
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.theme-option:focus {
  outline: none;
}

/* ══════════════════════════════════════
   PROFILE PAGE – Premium Layout V2
══════════════════════════════════════ */

/* ── Profile Header Card ── */
.profile-header-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease, background 0.25s ease;
}

/* ── Profile Avatar ── */
.profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-inverse);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.15), 0 0 24px rgba(249,115,22,0.12);
  flex-shrink: 0;
  cursor: default;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.profile-avatar:hover {
  box-shadow: 0 0 0 3px rgba(249,115,22,0.25), 0 0 32px rgba(249,115,22,0.2);
  transform: scale(1.03);
}

/* ── Micro Stats ── */
.profile-micro-stat {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.profile-micro-val {
  font-weight: 700;
  color: var(--text-primary);
}
.profile-micro-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
  display: inline-block;
}

/* ── Edit Profile Button ── */
.profile-edit-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.profile-edit-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ── Pro Access Card ── */
.pro-access-card {
  background: var(--card-bg);
  border: 1px solid var(--accent-border);
  border-left: 4px solid var(--accent);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(249,115,22,0.06);
  transition: background 0.25s ease;
}

.pro-progress-track {
  height: 6px;
  background: var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}
.pro-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* ── Profile Grid (Two Column) ── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 1024px) {
  .profile-grid {
    grid-template-columns: 1fr 340px;
    gap: 24px;
  }
}

/* ── Profile Stat Value (larger) ── */
.profile-stat-value {
  font-size: 32px !important;
  font-weight: 800 !important;
}

/* ── Badge Grid ── */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

/* ── Profile Completion Ring ── */
.profile-completion-ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-completion-pct {
  position: absolute;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}

/* ── Completion Checklist ── */
.completion-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.completion-item.done {
  color: var(--text-secondary);
}
.completion-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  flex-shrink: 0;
}
.completion-check.done {
  background: rgba(52,211,153,0.15);
  color: #34d399;
}
.completion-check.pending {
  background: var(--border-subtle);
  color: var(--text-faint);
}

/* ── Rank Icon ── */
.rank-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}

.rank-progress-track {
  height: 6px;
  background: var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}
.rank-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* ── Danger Zone Card ── */
.danger-zone-card {
  background: var(--card-bg);
  border: 1px solid rgba(239,68,68,0.2);
  border-left: 4px solid rgba(239,68,68,0.5);
  border-radius: 16px;
  padding: 20px 24px;
  transition: background 0.25s ease;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 10px;
  color: #f87171;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.logout-btn:hover {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.4);
  transform: translateY(-1px);
}

/* ── Modal Overlay & Panel ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.hidden {
  display: none;
}
.modal-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s cubic-bezier(0.16,1,0.3,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Activity Heatmap (7-day) ── */
.activity-heatmap {
  display: flex;
  gap: 8px;
}
.activity-heatmap-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.activity-heatmap-cell {
  width: 100%;
  height: 36px;
  border-radius: 6px;
  background: var(--border-subtle);
  transition: background 0.3s ease;
}
.activity-heatmap-cell.l1 { background: rgba(249,115,22,0.15); }
.activity-heatmap-cell.l2 { background: rgba(249,115,22,0.35); }
.activity-heatmap-cell.l3 { background: rgba(249,115,22,0.55); }
.activity-heatmap-cell.l4 { background: rgba(249,115,22,0.8); }
.activity-heatmap-label {
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 500;
}

/* ── Heatmap Legend ── */
.heatmap-legend-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--border-subtle);
}
.heatmap-legend-cell.l0 { background: var(--border-subtle); }
.heatmap-legend-cell.l1 { background: rgba(249,115,22,0.15); }
.heatmap-legend-cell.l2 { background: rgba(249,115,22,0.35); }
.heatmap-legend-cell.l3 { background: rgba(249,115,22,0.55); }
.heatmap-legend-cell.l4 { background: rgba(249,115,22,0.8); }

/* ══════════════════════════════════════
   TOP NAVIGATION – Unified Layout
══════════════════════════════════════ */
.topbar {
  min-height: 64px;
  background: var(--bg-topbar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background 0.25s ease;
}
@media (min-width: 768px) {
  .topbar {
    padding: 8px 36px;
  }
}

/* ── Left: Logo + Nav ── */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 36px;
  min-width: 0;
}
.topbar-left .preecode-logo {
  flex-shrink: 0;
}

/* ── Inline Nav Links (desktop) ── */
.topbar-nav {
  display: none;
  align-items: center;
  gap: 8px;
}
@media (min-width: 768px) {
  .topbar-nav {
    display: flex;
  }
}
.topbar-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.18s ease, background 0.18s ease;
}
.topbar-nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.topbar-nav-link.active {
  color: var(--accent);
  font-weight: 600;
}
.topbar-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
@media (min-width: 768px) {
  .topbar-nav-link.active::after {
    bottom: -21px;
  }
}

/* ── Right: Badges + Profile ── */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

/* ── Plan Badge ── */
.topbar-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
  cursor: default;
}
.topbar-plan-badge:hover {
  background: rgba(249,115,22,0.12);
  box-shadow: 0 2px 8px var(--accent-glow);
  transform: translateY(-1px);
}

/* ── Streak Badge ── */
.topbar-streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
  cursor: default;
}
.topbar-streak-badge:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* ── Badge Icons (star, flame) ── */
.topbar-badge-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── Profile Trigger (avatar-only) ── */
.topbar-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.18s ease;
  position: relative;
  user-select: none;
}
.topbar-profile:hover {
  background: var(--bg-hover);
}
.topbar-profile.active {
  background: var(--bg-hover);
}

/* ── Avatar ── */
.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-inverse);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(249,115,22,0.12);
  transition: box-shadow 0.2s ease;
}
.topbar-profile:hover .topbar-avatar {
  box-shadow: 0 0 0 2px rgba(249,115,22,0.25);
}

/* ── Hamburger (mobile only) ── */
.topbar-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.18s ease, color 0.18s ease;
  padding: 0;
}
.topbar-hamburger:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.hamburger-icon {
  width: 20px;
  height: 20px;
}
@media (min-width: 768px) {
  .topbar-hamburger {
    display: none;
  }
}

/* ── Mobile Dropdown Menu ── */
.topbar-mobile-menu {
  background: var(--bg-topbar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16,1,0.3,1);
  position: sticky;
  top: 64px;
  z-index: 49;
}
.topbar-mobile-menu.hidden {
  display: none;
}
.topbar-mobile-menu.open {
  opacity: 1;
  transform: translateY(0);
}
.topbar-mobile-menu .topbar-nav-link {
  display: flex;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
}
.topbar-mobile-menu .topbar-nav-link.active::after {
  display: none;
}
.topbar-mobile-menu .topbar-nav-link.active {
  background: var(--accent-soft);
}
@media (min-width: 768px) {
  .topbar-mobile-menu {
    display: none !important;
  }
}

/* ── Profile Dropdown ── */
.topbar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px) scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16,1,0.3,1);
  pointer-events: none;
}
.topbar-dropdown.hidden {
  display: none;
}
.topbar-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Dropdown Header ── */
.topbar-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}
.topbar-dropdown-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-inverse);
  flex-shrink: 0;
}
.topbar-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.topbar-dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-dropdown-plan {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
}

/* ── Dropdown Divider ── */
.topbar-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0;
}

/* ── Dropdown Items ── */
.topbar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.topbar-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.topbar-dropdown-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-faint);
  transition: color 0.15s ease;
}
.topbar-dropdown-item:hover .topbar-dropdown-icon {
  color: var(--text-secondary);
}

/* ── Logout Item ── */
.topbar-dropdown-logout {
  color: var(--danger);
}
.topbar-dropdown-logout:hover {
  background: rgba(248,113,113,0.06);
  color: var(--danger);
}
.topbar-dropdown-logout .topbar-dropdown-icon {
  color: var(--danger);
}

/* ── Responsive: Hide badges on very small screens ── */
@media (max-width: 480px) {
  .topbar-plan-badge,
  .topbar-streak-badge {
    display: none;
  }
  .topbar {
    padding: 8px 12px;
  }
}

/* ══════════════════════════════════════
   DASHBOARD – Premium V2
══════════════════════════════════════ */

/* ── Quick Actions ── */
.dash-quick-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.dash-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}
.dash-quick-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* ── Metric Cards ── */
.dash-metric-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.25s ease;
}
.dash-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-border);
}
.dash-accent-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover), transparent);
  opacity: 0.8;
}
.dash-metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.dash-metric-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.025em;
}
.dash-metric-accent {
  color: var(--accent);
}
.dash-metric-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-faint);
  margin-left: 4px;
}
.dash-metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
}
.dash-metric-trend.up { color: #34d399; }
.dash-metric-trend.down { color: #f87171; }
.dash-sparkline {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100px;
  height: 40px;
  opacity: 0.25;
}

/* ── KPI Metric Tints ── */
.dash-metric-card.tint-blue {
  background: linear-gradient(135deg, var(--card-bg) 60%, rgba(59,130,246,0.06));
}
.dash-metric-card.tint-blue .dash-accent-line {
  background: linear-gradient(90deg, #3b82f6, #60a5fa, transparent);
}
.dash-metric-card.tint-green {
  background: linear-gradient(135deg, var(--card-bg) 60%, rgba(34,197,94,0.06));
}
.dash-metric-card.tint-green .dash-accent-line {
  background: linear-gradient(90deg, #22c55e, #4ade80, transparent);
}
.dash-metric-card.tint-purple {
  background: linear-gradient(135deg, var(--card-bg) 60%, rgba(139,92,246,0.06));
}
.dash-metric-card.tint-purple .dash-accent-line {
  background: linear-gradient(90deg, #8b5cf6, #a78bfa, transparent);
}
.dash-metric-card.tint-orange {
  background: linear-gradient(135deg, var(--card-bg) 60%, rgba(249,115,22,0.06));
}
.dash-metric-card.tint-orange .dash-accent-line {
  background: linear-gradient(90deg, var(--accent), var(--accent-hover), transparent);
}

/* ── Dashboard Hero Section ── */
.dash-hero {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.25s ease;
}
.dash-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover), transparent);
  opacity: 0.8;
}
.dash-hero:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.dash-hero-greeting {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.dash-hero-wave {
  display: inline-block;
  animation: heroWave 2.5s ease-in-out infinite;
  transform-origin: 70% 70%;
}
@keyframes heroWave {
  0%, 100% { transform: rotate(0deg); }
  10%      { transform: rotate(14deg); }
  20%      { transform: rotate(-8deg); }
  30%      { transform: rotate(14deg); }
  40%      { transform: rotate(-4deg); }
  50%      { transform: rotate(10deg); }
  60%, 100% { transform: rotate(0deg); }
}
.dash-hero-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}
.dash-hero-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.dash-hero-streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(249,115,22,0.1);
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: 24px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.dash-hero-level-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 24px;
  font-size: 12px;
  font-weight: 600;
  color: #a78bfa;
}
.dash-hero-progress {
  margin-top: 16px;
}
.dash-hero-progress-track {
  height: 6px;
  background: var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}
.dash-hero-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 6px;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}
.dash-hero-milestone {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 6px;
  font-weight: 500;
}

@media (max-width: 640px) {
  .dash-hero {
    padding: 20px;
  }
  .dash-hero-greeting {
    font-size: 17px;
  }
  .dash-hero-badges {
    gap: 8px;
  }
}

/* ── Section Title ── */
.dash-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

/* ── Chart Card ── */
.dash-chart-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dash-chart-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* ── Activity Bars ── */
.dash-bar {
  width: 100%;
  max-width: 28px;
  border-radius: 4px 4px 0 0;
  background: rgba(249,115,22,0.25);
  transition: height 0.6s cubic-bezier(0.4,0,0.2,1), background 0.2s ease;
}
.dash-bar:hover {
  background: rgba(249,115,22,0.5);
}
.dash-bar.today {
  background: rgba(249,115,22,0.45);
}
.dash-bar.best {
  background: var(--accent);
}
.dash-bar-tooltip {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.15s ease;
  box-shadow: var(--shadow-card);
}
.group:hover .dash-bar-tooltip {
  opacity: 1;
}
.dash-bar-label {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 8px;
  font-weight: 500;
}
.dash-bar-label.today {
  color: var(--accent);
  font-weight: 700;
}

/* ── Weak Topics ── */
.dash-weak-topic {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-weak-bar-track {
  height: 5px;
  background: var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
}
.dash-weak-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.7s ease;
}

/* ── Streak Card ── */
.dash-streak-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dash-streak-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.dash-streak-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.dash-streak-icon.active {
  background: rgba(249,115,22,0.12);
  border-color: var(--accent-border);
  color: var(--accent);
  animation: flameGlow 2s ease-in-out infinite;
}
@keyframes flameGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,0.15); }
  50%      { box-shadow: 0 0 12px rgba(249,115,22,0.25); }
}
.dash-streak-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Level Card ── */
.dash-level-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dash-level-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* ── Count Badge ── */
.dash-count-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  padding: 2px 10px;
  border-radius: 20px;
}

/* ── VS Code Extension Badge ── */
.dash-ext-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  color: #60a5fa;
}

/* ── Table Card ── */
.dash-table-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dash-table-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* ── Error Banner ── */
.dash-error-banner {
  background: rgba(248,113,113,0.06);
  border: 1px solid rgba(248,113,113,0.15);
  color: var(--danger);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── Improved Table Header ── */
.app-table thead th {
  color: var(--text-muted);
  font-weight: 700;
}

/* ══════════════════════════════════════
   PROBLEMS PAGE – Premium V2
══════════════════════════════════════ */

/* ── Search Bar ── */
.prob-search-row {
  margin-bottom: 12px;
}
.prob-search-wrapper {
  position: relative;
  width: 100%;
}
.prob-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-faint);
  pointer-events: none;
  transition: color 0.18s ease;
}
.prob-search-input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.prob-search-input::placeholder {
  color: var(--text-faint);
}
.prob-search-input:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.prob-search-input:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--focus-ring), 0 2px 12px rgba(0,0,0,0.06);
}
.prob-search-input:focus ~ .prob-search-icon {
  color: var(--accent);
}
.prob-search-shortcut {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px 8px;
  pointer-events: none;
  letter-spacing: 0.03em;
}
.prob-search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.prob-search-clear:hover {
  background: var(--border-strong);
  color: var(--text-primary);
}
.prob-search-input:not(:placeholder-shown) ~ .prob-search-shortcut {
  display: none;
}
.prob-search-input:not(:placeholder-shown) ~ .prob-search-clear {
  display: flex;
}

/* ── Filter Bar ── */
.prob-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

/* ── Difficulty Chips ── */
.prob-chip-group {
  display: flex;
  gap: 6px;
}
.prob-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.prob-chip:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.prob-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}
.prob-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.prob-chip-dot.easy { background: #34d399; }
.prob-chip-dot.medium { background: #fbbf24; }
.prob-chip-dot.hard { background: #f87171; }

/* ── Table Card ── */
.prob-table-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
}

/* ── Table Rows ── */
.prob-table tbody tr {
  transition: background-color 0.15s ease;
}
.prob-table tbody tr:hover {
  background-color: var(--bg-hover);
}
.prob-row.solved {
  background-color: rgba(52,211,153,0.03);
}
.prob-row.solved:hover {
  background-color: rgba(52,211,153,0.06);
}
.prob-td-num {
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 600;
  width: 48px;
}
.prob-td-title {
  font-weight: 500;
  color: var(--text-primary);
}
.prob-td-status {
  text-align: center;
  width: 60px;
}
.prob-th-num {
  width: 48px;
}
.prob-th-status {
  text-align: center;
  width: 60px;
}

/* ── Status Indicators ── */
.prob-status-solved {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(52,211,153,0.12);
  color: #34d399;
}
.prob-status-unsolved {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
}

/* ── Tags ── */
.prob-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Empty State (Problems) ── */
.prob-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 24px;
  text-align: center;
}
.prob-empty-icon {
  margin-bottom: 4px;
  opacity: 0.9;
}
.prob-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.prob-empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}
.prob-empty-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.prob-empty-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(255,161,22,0.25);
}
.prob-empty-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,161,22,0.35);
}
.prob-empty-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.prob-empty-btn-secondary:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* ── Problems Responsive ── */
@media (max-width: 640px) {
  .prob-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .prob-chip-group {
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .prob-table-card {
    border-radius: 12px;
  }
  .prob-empty-actions {
    flex-direction: column;
  }
}


/* ══════════════════════════════════════
   SETTINGS PAGE
══════════════════════════════════════ */

/* ── Layout: sidebar + content grid ── */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}

/* ── Sidebar nav ── */
.settings-nav {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}
.settings-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.settings-nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.settings-nav-item.danger {
  color: #f87171;
}
.settings-nav-item.danger:hover {
  background: rgba(248, 113, 113, 0.08);
}
.settings-nav-item.danger.active {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

.settings-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Section switching ── */
.settings-section {
  display: none;
}
.settings-section.active {
  display: block;
}

/* ── Settings avatar ── */
.settings-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-inverse);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

/* ── Toggle switch ── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-subtle);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ── Toggle rows ── */
.settings-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.settings-toggle-row:last-child {
  border-bottom: none;
}
.settings-toggle-info {
  flex: 1;
  min-width: 0;
}
.settings-toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.settings-toggle-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── 2FA Placeholder ── */
.settings-2fa-placeholder {
  border: 2px dashed var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
}

/* ── Toast notification ── */
.settings-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.settings-toast.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.settings-toast.success {
  background: #059669;
  color: white;
}
.settings-toast.error {
  background: #dc2626;
  color: white;
}
.settings-toast.info {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

/* ── Settings Responsive ── */
@media (max-width: 768px) {
  .settings-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .settings-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .settings-nav-item {
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .settings-nav-icon {
    width: 16px;
    height: 16px;
  }
}

/* ══════════════════════════════════════
   BRAND LOGO – Text-based logo
══════════════════════════════════════ */
.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  flex-shrink: 0;
}
.brand-logo.logo-auth {
  font-size: 24px;
}
.brand-logo.logo-nav {
  font-size: 22px;
}
.brand-logo.logo-footer {
  font-size: 18px;
}
.brand-dark {
  color: var(--text-primary);
}
.brand-accent {
  color: var(--accent);
}

/* ══════════════════════════════════════
   LOGIN / REGISTER PAGES
══════════════════════════════════════ */

/* ── Left panel headline ── */
.login-headline-wrap {
  max-width: 420px;
}
.login-headline {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0;
}
.login-subtext {
  font-size: 16px;
  color: var(--text-muted);
  margin-top: 16px;
  font-weight: 500;
  line-height: 1.5;
}

/* ── Card ── */
.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 44px 40px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-lg);
}
.login-card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 28px;
  letter-spacing: -0.01em;
}

/* ── Form ── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Labels ── */
.login-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

/* ── Inputs ── */
.login-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.login-input::placeholder {
  color: var(--text-faint);
}
.login-input:hover {
  border-color: var(--border-strong);
}
.login-input:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ── Forgot link ── */
.login-forgot {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
.login-forgot:hover {
  color: var(--accent-hover);
}

/* ── Error message ── */
.login-error {
  font-size: 13px;
  color: var(--danger);
  font-weight: 500;
  min-height: 0;
  transition: min-height 0.2s ease;
}
.login-error:empty {
  display: none;
}

/* ── Primary button ── */
.login-btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(255, 161, 22, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 161, 22, 0.35);
}
.login-btn-primary:active {
  transform: translateY(0);
}
.login-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── Divider ── */
.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}
.login-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}
.login-divider-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Social buttons ── */
.login-social-row {
  display: flex;
  gap: 12px;
}
.login-btn-social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.login-btn-social:hover {
  border-color: var(--accent-border);
  transform: translateY(-1px);
}
.login-btn-social:active {
  transform: translateY(0);
}

/* ── Register / Sign-in link ── */
.login-register-link {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 24px;
}
.login-register-link a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}
.login-register-link a:hover {
  color: var(--accent-hover);
}

/* ── Login responsive ── */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
  }
  .login-headline {
    font-size: 28px;
  }
}

/* ══════════════════════════════════════
   NOTIFICATION DROPDOWN
══════════════════════════════════════ */
.notif-container {
  position: relative;
}
.topbar-notif-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  position: relative;
}
.topbar-notif-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px) scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16,1,0.3,1);
  pointer-events: none;
}
.notif-dropdown.hidden {
  display: none;
}
.notif-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.notif-dropdown-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.notif-dropdown-body {
  max-height: 320px;
  overflow-y: auto;
}
.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 24px;
  text-align: center;
  color: var(--text-faint);
}
.notif-empty svg {
  opacity: 0.4;
}
.notif-empty p {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
}

/* ══════════════════════════════════════
   DASHBOARD V3
══════════════════════════════════════ */

/* ── Layout ── */
.dash-layout-v3 {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
@media (min-width: 768px) {
  .dash-layout-v3 {
    padding: 32px 36px 56px;
  }
}

/* ── Stats Grid ── */
.stats-grid-v3 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 768px) {
  .stats-grid-v3 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── Stat Card ── */
.stat-card-v3 {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.25s ease;
}
.stat-card-v3:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-border);
}
.stat-card-v3 .accent-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover), transparent);
  opacity: 0.8;
}
.stat-card-v3.tint-blue {
  background: linear-gradient(135deg, var(--card-bg) 60%, rgba(59,130,246,0.06));
}
.stat-card-v3.tint-blue .accent-line {
  background: linear-gradient(90deg, #3b82f6, #60a5fa, transparent);
}
.stat-card-v3.tint-green {
  background: linear-gradient(135deg, var(--card-bg) 60%, rgba(34,197,94,0.06));
}
.stat-card-v3.tint-green .accent-line {
  background: linear-gradient(90deg, #22c55e, #4ade80, transparent);
}
.stat-card-v3.tint-purple {
  background: linear-gradient(135deg, var(--card-bg) 60%, rgba(139,92,246,0.06));
}
.stat-card-v3.tint-purple .accent-line {
  background: linear-gradient(90deg, #8b5cf6, #a78bfa, transparent);
}
.stat-card-v3.tint-orange {
  background: linear-gradient(135deg, var(--card-bg) 60%, rgba(249,115,22,0.06));
}
.stat-card-v3.tint-orange .accent-line {
  background: linear-gradient(90deg, var(--accent), var(--accent-hover), transparent);
}

/* ── Stat labels / values ── */
.stat-card-v3 .stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.stat-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.025em;
}
.stat-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-faint);
}
.stat-trend-v3 {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
}
.stat-trend-v3.up { color: #34d399; }
.stat-trend-v3.down { color: #f87171; }
.stat-trend-v3.neutral { color: var(--text-faint); }

/* ── Stat progress bar ── */
.stat-progress-bar {
  height: 4px;
  background: var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 14px;
}
.stat-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* ── App Card V3 ── */
.app-card-v3 {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.25s ease;
}
.app-card-v3:hover {
  box-shadow: var(--shadow-lg);
}

/* ── Section headers ── */
.dash-section-header-v3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dash-section-label-v3 {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.dash-section-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  padding: 2px 10px;
  border-radius: 20px;
}

/* ── Two column layout ── */
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) {
  .dash-two-col {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

/* ── Rank Section ── */
.rank-section {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  transition: background 0.25s ease;
}

/* ── Streak Stats Row ── */
.streak-stats-row {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}
.streak-stat-item {
  text-align: center;
}
.streak-stat-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.streak-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 6px;
}

/* ── Streak Milestones ── */
.streak-milestones {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.streak-milestone {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.streak-milestone.reached {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.streak-milestone-icon {
  font-size: 16px;
  line-height: 1;
}
.streak-milestone-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Submissions Table V3 ── */
.sub-table-v3 {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.sub-table-v3 thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}
.sub-table-v3 thead th:hover {
  color: var(--text-primary);
}
.sub-table-v3 tbody tr {
  transition: background-color 0.15s ease;
  border-bottom: 1px solid var(--border-subtle);
}
.sub-table-v3 tbody tr:last-child {
  border-bottom: none;
}
.sub-table-v3 tbody tr:hover {
  background-color: var(--bg-hover);
}
.sub-table-v3 tbody td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  vertical-align: middle;
}
.sub-table-v3 tbody td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}
.sort-icon {
  font-size: 10px;
  opacity: 0.4;
  margin-left: 4px;
}

/* ── Practice Panel V3 ── */
.practice-panel-v3 {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  transition: background 0.25s ease;
}
.practice-stats-row {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.practice-stat {
  text-align: center;
  min-width: 80px;
}
.practice-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.practice-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 6px;
}
.dash-practice-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(255, 161, 22, 0.25);
}
.dash-practice-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 161, 22, 0.35);
}

/* ── Dashboard Animation ── */
.dash-animate {
  opacity: 0;
  transform: translateY(16px);
  animation: dashFadeIn 0.5s ease forwards;
}
.dash-animate-d1 { animation-delay: 0s; }
.dash-animate-d2 { animation-delay: 0.1s; }
.dash-animate-d3 { animation-delay: 0.2s; }
.dash-animate-d4 { animation-delay: 0.3s; }
@keyframes dashFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════
   PROFILE PAGE – Minimal overrides on dash-v4 system
══════════════════════════════════════════════════════ */

/* ── Profile header card ── */
.prof-header-card {
  padding: 28px;
}
.prof-header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}
.prof-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-inverse);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.15), 0 0 24px rgba(249,115,22,0.12);
  background-size: cover;
  background-position: center;
}
.prof-header-info {
  flex: 1;
  min-width: 0;
}
.prof-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}
.prof-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0;
  font-weight: 500;
}
.prof-edit-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.prof-edit-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ── Stats grid: 3 columns on desktop ── */
.prof-stats-grid {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .prof-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Level / XP ── */
.prof-level-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.prof-level-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.prof-level-xp {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 8px;
}
.prof-level-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}
.prof-level-track {
  height: 8px;
  background: var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}
.prof-level-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* ── Difficulty Breakdown ── */
.prof-diff-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.prof-diff-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.prof-diff-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 52px;
  flex-shrink: 0;
}
.prof-diff-track {
  flex: 1;
  height: 8px;
  background: var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}
.prof-diff-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}
.prof-diff-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Badges ── */
.prof-view-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
}
.prof-view-all:hover {
  color: var(--accent-hover);
}
.prof-badges-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.prof-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: border-color 0.18s ease, opacity 0.18s ease;
}
.prof-badge.locked {
  opacity: 0.5;
}
.prof-badge.unlocked {
  opacity: 1;
  border-color: var(--accent-border);
  background: var(--accent-soft);
}
.prof-badge-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.prof-badge-info {
  flex: 1;
  min-width: 0;
}
.prof-badge-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 6px;
}
.prof-badge-bar {
  height: 4px;
  background: var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
}
.prof-badge-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

/* ── Profile Responsive ── */
@media (max-width: 640px) {
  .prof-header-inner {
    flex-direction: column;
    text-align: center;
  }
  .prof-edit-btn {
    align-self: center;
  }
  .prof-avatar {
    width: 56px;
    height: 56px;
    font-size: 20px;
  }
}

/* ══════════════════════════════════════════════════════
   DASHBOARD V4 – Modern Competitive Coding Platform
   LeetCode x Linear x Notion aesthetic
══════════════════════════════════════════════════════ */

/* ── Layout: Dense 12-col inspired, 90vh fill ── */
.dash-v4 {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(90vh - 64px);
}
@media (min-width: 768px) {
  .dash-v4 {
    padding: 24px 32px 40px;
    gap: 18px;
  }
}

/* ── Animation System ── */
.dash-v4-anim {
  opacity: 0;
  transform: translateY(12px);
  animation: dashV4In 0.45s cubic-bezier(0.16,1,0.3,1) forwards;
}
.dash-v4-anim-1 { animation-delay: 0s; }
.dash-v4-anim-2 { animation-delay: 0.08s; }
.dash-v4-anim-3 { animation-delay: 0.16s; }
.dash-v4-anim-4 { animation-delay: 0.24s; }
@keyframes dashV4In {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Stats Grid (4-col KPI) ── */
.dash-v4-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 768px) {
  .dash-v4-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

/* ── Stat Card ── */
.dash-v4-stat {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16,1,0.3,1), box-shadow 0.22s ease, border-color 0.22s ease;
}
.dash-v4-stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: var(--border-strong);
}
html.dark .dash-v4-stat:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* Primary stat (Total Solved) – visually dominant */
.dash-v4-stat--primary {
  border-width: 1.5px;
}
.dash-v4-stat--primary .dash-v4-stat__num {
  font-size: 36px;
}

/* Accent top border per tint */
.dash-v4-stat__accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  border-radius: 14px 14px 0 0;
}
.dash-v4-stat.tint-blue .dash-v4-stat__accent {
  background: linear-gradient(90deg, #3b82f6, #60a5fa, transparent);
}
.dash-v4-stat.tint-green .dash-v4-stat__accent {
  background: linear-gradient(90deg, #22c55e, #4ade80, transparent);
}
.dash-v4-stat.tint-purple .dash-v4-stat__accent {
  background: linear-gradient(90deg, #8b5cf6, #a78bfa, transparent);
}
.dash-v4-stat.tint-orange .dash-v4-stat__accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-hover), transparent);
}

/* Subtle tint backgrounds */
.dash-v4-stat.tint-blue {
  background: linear-gradient(135deg, var(--card-bg) 60%, rgba(59,130,246,0.05));
}
.dash-v4-stat.tint-green {
  background: linear-gradient(135deg, var(--card-bg) 60%, rgba(34,197,94,0.05));
}
.dash-v4-stat.tint-purple {
  background: linear-gradient(135deg, var(--card-bg) 60%, rgba(139,92,246,0.05));
}
.dash-v4-stat.tint-orange {
  background: linear-gradient(135deg, var(--card-bg) 60%, rgba(249,115,22,0.05));
}

.dash-v4-stat__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.dash-v4-stat__row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.dash-v4-stat__num {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
}
.dash-v4-stat__num--xl {
  font-size: 36px;
}
.dash-v4-stat__unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-faint);
}
.dash-v4-stat__trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
}
.dash-v4-stat__trend.up { color: #34d399; }
.dash-v4-stat__trend.down { color: #f87171; }
.dash-v4-stat__trend.neutral { color: var(--text-faint); }

/* Micro progress bar */
.dash-v4-stat__bar {
  height: 4px;
  background: var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 12px;
}
.dash-v4-stat__fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}
.dash-v4-stat.tint-blue .dash-v4-stat__fill { background: #3b82f6; }
.dash-v4-stat.tint-green .dash-v4-stat__fill { background: #22c55e; }
.dash-v4-stat.tint-purple .dash-v4-stat__fill { background: #8b5cf6; }
.dash-v4-stat.tint-orange .dash-v4-stat__fill { background: var(--accent); }

/* ── Generic Card ── */
.dash-v4-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px 22px;
  transition: box-shadow 0.2s ease, background 0.25s ease;
}
.dash-v4-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
html.dark .dash-v4-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.dash-v4-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.dash-v4-card__title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

/* ── Two Column Grid ── */
.dash-v4-twocol {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) {
  .dash-v4-twocol {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
}

/* ═══ RANK SECTION – Blurred leaderboard preview ═══ */

/* Locked state */
.dash-v4-rank-locked {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}
.dash-v4-rank-locked__preview {
  filter: blur(4px);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}
.dash-v4-rank-locked__preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.dash-v4-rank-locked__preview-row:last-child {
  border-bottom: none;
}
.dash-v4-rank-ghost-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border-subtle);
  flex-shrink: 0;
}
.dash-v4-rank-ghost-name {
  height: 10px;
  width: 80px;
  background: var(--border-subtle);
  border-radius: 4px;
}
.dash-v4-rank-ghost-score {
  height: 10px;
  width: 40px;
  background: var(--border-subtle);
  border-radius: 4px;
  margin-left: auto;
}
.dash-v4-rank-ghost-medal {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

/* Overlay on locked */
.dash-v4-rank-locked__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(var(--card-bg-rgb, 17,24,39), 0.3), rgba(var(--card-bg-rgb, 17,24,39), 0.8));
  z-index: 2;
}
.dash-v4-rank-locked__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.dash-v4-rank-locked__progress {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.dash-v4-rank-locked__dots {
  display: flex;
  gap: 6px;
}
.dash-v4-rank-locked__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.dash-v4-rank-locked__dot.filled {
  background: var(--accent);
  border-color: var(--accent);
}

/* Unlocked state */
.dash-v4-rank-unlocked {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.dash-v4-rank-metric {
  text-align: center;
}
.dash-v4-rank-metric__val {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.dash-v4-rank-metric__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 6px;
}
.dash-v4-rank-bar {
  height: 4px;
  background: var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}
.dash-v4-rank-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* ═══ PRACTICE SECTION – Highlighted block ═══ */
.dash-v4-practice {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--accent-border);
  border-radius: 14px;
  padding: 24px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, background 0.25s ease;
}
.dash-v4-practice:hover {
  box-shadow: 0 6px 24px rgba(249,115,22,0.08);
}
html.dark .dash-v4-practice:hover {
  box-shadow: 0 6px 24px rgba(249,115,22,0.12);
}
.dash-v4-practice__glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(180deg, rgba(249,115,22,0.04) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}
.dash-v4-practice > * {
  position: relative;
  z-index: 1;
}
.dash-v4-ext-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  color: #60a5fa;
}
.dash-v4-practice__stats {
  display: flex;
  gap: 32px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  justify-content: center;
}
.dash-v4-practice__stat {
  text-align: center;
  min-width: 80px;
}
.dash-v4-practice__val {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.dash-v4-practice__lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 6px;
}
.dash-v4-practice__header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.dash-v4-open-vscode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid rgba(59,130,246,0.28);
  background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(37,99,235,0.08));
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: transform 0.2s cubic-bezier(0.16,1,0.3,1), border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.dash-v4-open-vscode-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(37,99,235,0.42);
  box-shadow: 0 8px 20px rgba(37,99,235,0.14);
  background: linear-gradient(135deg, rgba(59,130,246,0.14), rgba(37,99,235,0.12));
}
.dash-v4-open-vscode-btn:active,
.dash-v4-open-vscode-btn.is-launching {
  transform: translateY(0);
}
.dash-v4-open-vscode-btn.is-disabled {
  opacity: 0.6;
  pointer-events: none;
  border-color: var(--border-subtle);
  color: var(--text-faint);
  background: var(--bg-tertiary);
}
.dash-v4-practice__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--text-inverse);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16,1,0.3,1), box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 4px 20px rgba(249,115,22,0.25);
}
.dash-v4-practice__cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 28px rgba(249,115,22,0.35);
  filter: brightness(1.08);
}
.dash-v4-practice__cta:active {
  transform: translateY(0) scale(0.99);
}
@media (max-width: 767px) {
  .dash-v4-practice__header-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: 10px;
  }
  .dash-v4-open-vscode-btn {
    padding: 8px 12px;
  }
}

.dash-v4-error-banner {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: 12px;
  padding: 12px 16px;
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
html.dark .dash-v4-error-banner {
  color: #f87171;
}

/* ═══ SKILL HEATMAP – Horizontal progress bars ═══ */
.dash-v4-skill-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dash-v4-skill-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-v4-skill-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 110px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-v4-skill-track {
  flex: 1;
  height: 8px;
  background: var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.dash-v4-skill-fill {
  height: 100%;
  border-radius: 6px;
  width: 0%;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}
.dash-v4-skill-fill.high { background: linear-gradient(90deg, #22c55e, #4ade80); }
.dash-v4-skill-fill.mid { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.dash-v4-skill-fill.low { background: linear-gradient(90deg, #ef4444, #f87171); }
.dash-v4-skill-fill.none { background: var(--border-subtle); }

.dash-v4-skill-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* Locked skill overlay */
.dash-v4-skill-locked {
  position: relative;
}
.dash-v4-skill-locked__bars {
  filter: blur(3px);
  opacity: 0.45;
  pointer-events: none;
}
.dash-v4-skill-locked__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}
.dash-v4-skill-locked__icon {
  color: var(--text-faint);
}
.dash-v4-skill-locked__text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  max-width: 200px;
  line-height: 1.4;
}

/* Skill tooltip */
.dash-v4-skill-row[data-tooltip] {
  position: relative;
  cursor: default;
}
.dash-v4-skill-row[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 4px 10px;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}
.dash-v4-skill-row[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══ STREAK TRACKER – Circular ring ═══ */
.dash-v4-streak__ring-row {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 18px;
  justify-content: center;
}
.dash-v4-streak__ring {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}
.dash-v4-streak__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.dash-v4-streak__track {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 6;
}
.dash-v4-streak__progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4,0,0.2,1);
  filter: drop-shadow(0 0 6px rgba(249,115,22,0.3));
}
.dash-v4-streak__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.dash-v4-streak__flame {
  font-size: 20px;
  line-height: 1;
  opacity: 0.3;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.dash-v4-streak__flame.active {
  opacity: 1;
  animation: streakFlameAnim 1.5s ease-in-out infinite;
}
@keyframes streakFlameAnim {
  0%, 100% { transform: scale(1) translateY(0); }
  25%      { transform: scale(1.1) translateY(-2px); }
  50%      { transform: scale(1.05) translateY(-1px); }
  75%      { transform: scale(1.15) translateY(-3px); }
}
.dash-v4-streak__val {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.dash-v4-streak__lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dash-v4-streak__best {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.dash-v4-streak__best-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dash-v4-streak__best-val {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.dash-v4-streak__milestones {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.streak-milestone {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  transition: all 0.2s ease;
}
.streak-milestone.reached {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}
.streak-milestone-icon {
  font-size: 14px;
  line-height: 1;
}
.streak-milestone-label {
  line-height: 1;
}

/* ── Section badge ── */
.dash-section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

/* ── Sort icon ── */
.sort-icon {
  font-size: 10px;
  opacity: 0.4;
  margin-left: 4px;
}

/* ═══ SUBMISSIONS TABLE ═══ */
.dash-v4-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.dash-v4-table thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, background 0.15s ease;
}
.dash-v4-table thead th:first-child {
  border-radius: 8px 0 0 0;
}
.dash-v4-table thead th:last-child {
  border-radius: 0 8px 0 0;
}
.dash-v4-table thead th:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.dash-v4-table tbody tr {
  transition: background-color 0.12s ease;
  border-bottom: 1px solid var(--border-subtle);
}
.dash-v4-table tbody tr:last-child {
  border-bottom: none;
}
.dash-v4-table tbody tr:hover {
  background-color: var(--bg-hover);
}
.dash-v4-table tbody td {
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  vertical-align: middle;
}
.dash-v4-table tbody td:first-child {
  color: var(--text-primary);
  font-weight: 600;
}

/* Status badges in table */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.status-badge.accepted { background: rgba(52,211,153,0.12); color: #34d399; }
.status-badge.wrong    { background: rgba(248,113,113,0.12); color: #f87171; }
.status-badge.tle      { background: rgba(251,191,36,0.12); color: #fbbf24; }

/* ── Empty State V4 ── */
.dash-v4-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 24px;
  text-align: center;
}
.dash-v4-empty__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.dash-v4-empty__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.dash-v4-empty__desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.5;
}
.dash-v4-empty__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(249,115,22,0.25);
}
.dash-v4-empty__cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249,115,22,0.35);
}

/* ── Chat FAB adjustments for dashboard ── */
.ai-chat-fab {
  width: 48px;
  height: 48px;
  bottom: 20px;
  right: 20px;
}
.ai-chat-fab[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 10px;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.ai-chat-fab[data-tooltip]:hover::before {
  opacity: 1;
}

/* ══════════════════════════════════════
   LANDING PAGE V5 – Hero, Steps, Features, CTA
══════════════════════════════════════ */

/* ── Hero V5 ── */
.hero-v5 {
  position: relative;
  padding: 140px 0 80px;
  overflow: hidden;
}
.hero-v5__glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(255,161,22,0.08) 0%, rgba(255,107,0,0.03) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero-v5 > .max-w-6xl {
  position: relative;
  z-index: 1;
}
.hero-v5__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 24px;
}
.hero-v5__pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pillDotPulse 2s ease-in-out infinite;
}
@keyframes pillDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.8); }
}
.hero-v5__heading {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0 0 20px;
}
@media (min-width: 768px) {
  .hero-v5__heading {
    font-size: 52px;
  }
}
.hero-v5__gradient {
  background: linear-gradient(135deg, #ff6b00, #ff9500, #ffb347);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-v5__sub {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 440px;
  margin: 0 0 32px;
}
.hero-v5__ctas {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.hero-v5__btn-primary {
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(255,161,22,0.3);
}
.hero-v5__btn-primary:hover {
  box-shadow: 0 8px 32px rgba(255,161,22,0.4);
}
.hero-v5__trust {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-v5__trust-avatars {
  display: flex;
}
.hero-v5__trust-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  border: 2px solid var(--bg-primary);
  margin-left: -8px;
}
.hero-v5__trust-avatar:first-child {
  margin-left: 0;
}
.hero-v5__trust-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.hero-v5__live-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #34d399;
}
.hero-v5__live-dot span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  display: inline-block;
  animation: liveDotPulse 2s ease-in-out infinite;
}
@keyframes liveDotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52,211,153,0.4); }
  50%      { opacity: 0.6; box-shadow: 0 0 0 6px rgba(52,211,153,0); }
}

/* ── Logos / Language Bar ── */
.logos-bar {
  padding: 48px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.logos-bar__label {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 24px 0;
}
.logos-bar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.logos-bar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  cursor: default;
  transition: all 0.25s ease;
}
.logos-bar__item span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 0.25s ease;
}
.logos-bar__item:hover {
  border-color: var(--lang-color, var(--border-strong));
  background: var(--hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.logos-bar__item:hover span {
  color: var(--text-primary);
}
.logos-bar__icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lang-color, var(--text-muted));
  flex-shrink: 0;
}
.logos-bar__icon svg {
  width: 100%;
  height: 100%;
}
.logos-bar__sep {
  display: none;
}
@media (max-width: 640px) {
  .logos-bar {
    padding: 32px 0;
  }
  .logos-bar__inner {
    gap: 8px;
  }
  .logos-bar__item {
    padding: 8px 14px;
    border-radius: 10px;
  }
  .logos-bar__item span {
    font-size: 12px;
  }
  .logos-bar__icon {
    width: 18px;
    height: 18px;
  }
}

/* ── Landing Highlight V5 ── */
.landing-highlight-v5 {
  display: inline-block;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-border);
  border-radius: 14px;
  padding: 24px 36px;
  box-shadow: 0 4px 16px rgba(255,161,22,0.06);
}
.landing-highlight-v5 p {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.5;
}
.landing-highlight-v5__accent {
  color: var(--accent);
  font-weight: 700;
}

/* ── Steps V6 (How It Works) ── */
.steps-v6 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.step-v6 {
  position: relative;
  padding: 32px 24px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  text-align: center;
  transition: all 0.3s ease;
}
.step-v6:hover {
  border-color: var(--step-color, var(--border-strong));
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}
.step-v6__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.step-v6__num {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--step-color, var(--accent));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-v6__line-h {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--step-color, var(--accent)) 0%, transparent 100%);
  border-radius: 2px;
  opacity: 0.3;
}
.step-v6__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--step-color, var(--accent)) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--step-color, var(--accent)) 20%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.step-v6__icon svg {
  width: 26px;
  height: 26px;
  color: var(--step-color, var(--accent));
}
.step-v6:hover .step-v6__icon {
  transform: scale(1.08);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--step-color, var(--accent)) 25%, transparent);
}
.step-v6 h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.step-v6 p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}
@media (max-width: 768px) {
  .steps-v6 {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}
@media (max-width: 480px) {
  .steps-v6 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .step-v6 {
    padding: 24px 20px;
  }
}

/* ── Feature Items V5 ── */
.feature-item-v5 {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.feature-item-v5__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: transform 0.2s ease;
}
.feature-item-v5__icon svg {
  width: 20px;
  height: 20px;
}
.feature-item-v5:hover .feature-item-v5__icon {
  transform: scale(1.08);
}
.feature-item-v5__icon.tint-blue {
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.15);
}
.feature-item-v5__icon.tint-blue svg { color: #3b82f6; }
.feature-item-v5__icon.tint-green {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.15);
}
.feature-item-v5__icon.tint-green svg { color: #22c55e; }
.feature-item-v5__icon.tint-purple {
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.15);
}
.feature-item-v5__icon.tint-purple svg { color: #8b5cf6; }
.feature-item-v5__icon.tint-orange {
  background: rgba(249,115,22,0.1);
  border: 1px solid rgba(249,115,22,0.15);
}
.feature-item-v5__icon.tint-orange svg { color: #f97316; }
.feature-item-v5 h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.feature-item-v5 p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

/* ── Metrics Strip V5 ── */
.metrics-strip-v5 {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 32px 24px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-card);
}
.metric-v5 {
  text-align: center;
  padding: 0 16px;
}
.metric-v5__value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0 0 4px;
}
.metric-v5__label {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.metric-v5__divider {
  width: 1px;
  height: 40px;
  background: var(--border-subtle);
  justify-self: center;
}
.metric-v5__accent {
  color: var(--accent);
}
@media (max-width: 767px) {
  .metrics-strip-v5 {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 0;
  }
  .metric-v5__divider {
    display: none;
  }
}

/* ── Problem → Solution ── */
.probsol-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.probsol-col {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 36px 30px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.probsol-col:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}
.probsol-col--solution {
  border-color: var(--accent-border);
}
.probsol-col--solution:hover {
  border-color: #34d399;
  box-shadow: 0 12px 40px rgba(52, 211, 153, 0.08);
}
.probsol-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 28px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.probsol-heading::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.probsol-heading--problem { color: #f87171; }
.probsol-heading--problem::before { background: #f87171; }
.probsol-heading--solution { color: #34d399; }
.probsol-heading--solution::before { background: #34d399; }
.probsol-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.probsol-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.probsol-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 3px;
  padding: 3px;
  border-radius: 6px;
  width: 22px;
  height: 22px;
}
.probsol-item--problem svg {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}
.probsol-item--solution svg {
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
}
@media (max-width: 640px) {
  .probsol-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Testimonial Stars ── */
.testimonial-stars {
  display: flex;
  gap: 2px;
  margin-bottom: 4px;
}
.testimonial-stars svg {
  width: 14px;
  height: 14px;
  color: #fbbf24;
}

/* ── Minimal Testimonials ── */
.testi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: stretch;
}
.testi-item {
  margin: 0;
  padding: 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
}
.testi-quote {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 0;
  padding: 0;
  border: none;
  flex: 1;
}
.testi-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}
.testi-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--dot, var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.testi-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.testi-role {
  font-size: 11px;
  color: var(--text-muted);
  margin: 2px 0 0;
}
@media (max-width: 767px) {
  .testi-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ── Testimonials V6 ── */
.testimonials-v6 {
  margin-top: 48px;
}
.testimonials-v6__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.testimonial-v6 {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px 28px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  transition: all 0.3s ease;
}
.testimonial-v6:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}
.testimonial-v6__quote {
  margin-bottom: 8px;
  color: var(--accent);
}
.testimonial-v6__body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 auto;
  padding-bottom: 24px;
  font-style: italic;
}
.testimonial-v6__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}
.testimonial-v6__avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--avatar-color, var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.testimonial-v6__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.testimonial-v6__role {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0;
}
.testimonial-v6__stars {
  display: flex;
  gap: 2px;
  margin-left: auto;
}
.testimonial-v6__stars svg {
  width: 14px;
  height: 14px;
  color: #fbbf24;
}
@media (max-width: 768px) {
  .testimonials-v6__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .testimonial-v6 {
    padding: 24px 20px;
  }
}

/* ── CTA V5 ── */
.cta-v5 {
  position: relative;
  padding: 96px 0;
  overflow: hidden;
}
.cta-v5__glow {
  position: absolute;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(255,161,22,0.08) 0%, rgba(255,107,0,0.03) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.cta-v5__title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
@media (min-width: 768px) {
  .cta-v5__title {
    font-size: 40px;
  }
}
.cta-v5__desc {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0 0 32px;
}
