/* ── Onboarding Tour ── */
    .tour-overlay {
      position: fixed; inset: 0; z-index: 2000;
      pointer-events: none;
    }
    .tour-backdrop {
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.72);
      z-index: 2001;
      transition: opacity 0.3s;
    }
    .tour-spotlight {
      position: fixed;
      z-index: 2002;
      border-radius: 10px;
      box-shadow: 0 0 0 9999px rgba(0,0,0,0.0);
      pointer-events: none;
      transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
      outline: 3px solid #f59e0b;
      outline-offset: 4px;
    }
    .tour-card {
      position: fixed;
      z-index: 2003;
      background: #1a1a1a;
      border: 1px solid #f59e0b;
      border-radius: 14px;
      padding: 20px 22px 18px;
      max-width: 320px;
      width: calc(100vw - 40px);
      box-shadow: 0 24px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(245,158,11,0.2);
      pointer-events: all;
      transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    }
    .tour-step-label {
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 1.5px;
      color: #f59e0b;
      text-transform: uppercase;
      margin-bottom: 8px;
    }
    .tour-card h3 {
      font-size: 15px;
      font-weight: 700;
      color: #f5f5f5;
      margin-bottom: 7px;
    }
    .tour-card p {
      font-size: 13px;
      color: #aaa;
      line-height: 1.55;
      margin-bottom: 16px;
    }
    .tour-actions {
      display: flex;
      gap: 8px;
      justify-content: flex-end;
      align-items: center;
    }
    .tour-dots {
      display: flex;
      gap: 5px;
      margin-right: auto;
    }
    .tour-dot {
      width: 6px; height: 6px;
      border-radius: 50%;
      background: #444;
      transition: background 0.2s;
    }
    .tour-dot.active { background: #f59e0b; }
    .tour-btn-skip {
      background: none; border: none;
      color: #666; font-size: 12px;
      cursor: pointer; padding: 6px;
      border-radius: 6px;
      transition: color 0.15s;
    }
    .tour-btn-skip:hover { color: #aaa; }
    .tour-btn-next {
      background: #f59e0b; color: #000;
      border: none; border-radius: 8px;
      font-size: 13px; font-weight: 700;
      padding: 9px 18px; cursor: pointer;
      transition: background 0.15s, transform 0.1s;
    }
    .tour-btn-next:hover { background: #d97706; }
    .tour-btn-next:active { transform: scale(0.97); }

    /* ── Tooltips ── */
    [data-tip] { position: relative; }
    [data-tip]::after {
      content: attr(data-tip);
      position: absolute;
      bottom: calc(100% + 8px);
      left: 50%;
      transform: translateX(-50%) scale(0.9);
      background: #1a1a1a;
      border: 1px solid #333;
      color: #ddd;
      font-size: 11.5px;
      line-height: 1.45;
      padding: 7px 11px;
      border-radius: 8px;
      white-space: nowrap;
      max-width: 240px;
      white-space: normal;
      text-align: left;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.18s, transform 0.18s;
      z-index: 1500;
      box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    }
    [data-tip]:hover::after {
      opacity: 1;
      transform: translateX(-50%) scale(1);
    }
    /* Tooltip that opens downward */
    [data-tip-pos="below"]::after {
      bottom: auto;
      top: calc(100% + 8px);
    }
    /* Right-aligned tooltips */
    [data-tip-align="right"]::after {
      left: auto; right: 0;
      transform: scale(0.9);
    }
    [data-tip-align="right"]:hover::after {
      transform: scale(1);
    }

    /* ── Enhanced Toast ── */
    .toast-enhanced {
      position: fixed;
      bottom: 80px;
      left: 50%;
      transform: translateX(-50%) translateY(12px);
      background: #1a1a1a;
      border: 1px solid #333;
      border-radius: 10px;
      padding: 11px 18px;
      font-size: 13px;
      font-weight: 500;
      color: #f5f5f5;
      z-index: 3000;
      opacity: 0;
      pointer-events: none;
      transition: all 0.25s;
      display: flex;
      align-items: center;
      gap: 8px;
      max-width: min(380px, calc(100vw - 32px));
      box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    }
    .toast-enhanced.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
    .toast-enhanced.success { border-color: #22c55e; }
    .toast-enhanced.error   { border-color: #ef4444; }
    .toast-enhanced.info    { border-color: #3b82f6; }
    .toast-enhanced .toast-icon { font-size: 15px; flex-shrink: 0; }

    /* ── Inline validation ── */
    .field-error {
      font-size: 11.5px;
      color: #ef4444;
      margin-top: 4px;
      display: none;
    }
    .field-error.visible { display: block; }
    .form-input.invalid {
      border-color: #ef4444 !important;
    }

    /* ── Smart empty states ── */
    .empty-rich {
      text-align: center;
      padding: 56px 24px 48px;
    }
    .empty-rich-icon {
      font-size: 44px;
      margin-bottom: 14px;
      opacity: 0.65;
    }
    .empty-rich h3 {
      font-size: 17px;
      font-weight: 700;
      color: #f5f5f5;
      margin-bottom: 8px;
    }
    .empty-rich p {
      font-size: 13px;
      color: #888;
      line-height: 1.55;
      max-width: 340px;
      margin: 0 auto 20px;
    }
    .empty-rich-actions {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
    }
    .empty-cta-primary {
      background: #f59e0b; color: #000;
      border: none; border-radius: 9px;
      font-size: 13px; font-weight: 700;
      padding: 11px 24px; cursor: pointer;
      transition: background 0.15s, transform 0.1s;
    }
    .empty-cta-primary:hover { background: #d97706; }
    .empty-cta-primary:active { transform: scale(0.97); }
    .empty-cta-secondary {
      font-size: 12px;
      color: #f59e0b;
      background: none;
      border: none;
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 3px;
      padding: 4px;
    }
    .empty-cta-secondary:hover { color: #d97706; }

    /* ── Loading skeletons ── */
    .skeleton-wrap {
      padding: 12px 0;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .skeleton-card {
      background: #1a1a1a;
      border: 1px solid #2e2e2e;
      border-radius: 12px;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .skeleton-line {
      background: linear-gradient(90deg, #2e2e2e 25%, #3a3a3a 50%, #2e2e2e 75%);
      background-size: 200% 100%;
      animation: shimmer 1.4s infinite;
      border-radius: 6px;
    }
    @keyframes shimmer {
      0% { background-position: -200% 0; }
      100% { background-position: 200% 0; }
    }

    /* ── Help Drawer ── */
    .help-btn {
      position: fixed;
      right: 16px;
      bottom: 72px;
      width: 36px; height: 36px;
      background: #242424;
      border: 1px solid #3a3a3a;
      border-radius: 50%;
      color: #888;
      font-size: 16px;
      font-weight: 700;
      cursor: pointer;
      z-index: 500;
      display: flex; align-items: center; justify-content: center;
      transition: all 0.2s;
      box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    }
    .help-btn:hover { background: #f59e0b; color: #000; border-color: #f59e0b; }

    .help-drawer {
      position: fixed;
      right: 0; top: 56px; bottom: 60px;
      width: 300px;
      background: #1a1a1a;
      border-left: 1px solid #2e2e2e;
      z-index: 800;
      transform: translateX(100%);
      transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .help-drawer.open { transform: translateX(0); }
    .help-drawer-header {
      padding: 14px 16px;
      border-bottom: 1px solid #2e2e2e;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: #242424;
      flex-shrink: 0;
    }
    .help-drawer-title {
      font-size: 13px;
      font-weight: 700;
      color: #f59e0b;
    }
    .help-drawer-close {
      background: none; border: none;
      color: #666; font-size: 18px;
      cursor: pointer; padding: 2px 6px;
      border-radius: 6px;
    }
    .help-drawer-close:hover { color: #aaa; }
    .help-drawer-body {
      flex: 1;
      overflow-y: auto;
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .help-section {
      border-radius: 10px;
      overflow: hidden;
    }
    .help-section-toggle {
      width: 100%;
      background: #242424;
      border: none;
      padding: 11px 14px;
      text-align: left;
      color: #f5f5f5;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-radius: 10px;
      transition: background 0.15s;
    }
    .help-section-toggle:hover { background: #2e2e2e; }
    .help-section-toggle .chevron { transition: transform 0.2s; font-size: 12px; color: #666; }
    .help-section-toggle.open .chevron { transform: rotate(180deg); }
    .help-section-body {
      display: none;
      padding: 10px 14px 12px;
      background: #1e1e1e;
      border-radius: 0 0 10px 10px;
      border: 1px solid #2e2e2e;
      border-top: none;
    }
    .help-section-body.open { display: block; }
    .help-step {
      font-size: 12px;
      color: #aaa;
      line-height: 1.55;
      padding: 3px 0;
      display: flex;
      gap: 8px;
    }
    .help-step-num {
      font-size: 10px;
      font-weight: 700;
      color: #f59e0b;
      background: rgba(245,158,11,0.12);
      border-radius: 4px;
      padding: 2px 5px;
      flex-shrink: 0;
      margin-top: 1px;
    }
    .help-show-btn {
      margin-top: 10px;
      font-size: 11.5px;
      padding: 6px 12px;
      background: rgba(245,158,11,0.12);
      border: 1px solid rgba(245,158,11,0.3);
      border-radius: 7px;
      color: #f59e0b;
      cursor: pointer;
      font-weight: 600;
      width: 100%;
      transition: background 0.15s;
    }
    .help-show-btn:hover { background: rgba(245,158,11,0.22); }
    .help-restart-link {
      margin-top: 12px;
      padding: 12px 14px;
      border-top: 1px solid #2e2e2e;
      flex-shrink: 0;
    }
    .help-restart-btn {
      font-size: 12px;
      color: #888;
      background: none;
      border: none;
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 3px;
      padding: 4px;
    }
    .help-restart-btn:hover { color: #f59e0b; }

/* ── Mobile overrides ── */
@media (max-width: 480px) {
  /* Help drawer — full-screen on mobile */
  .help-drawer {
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    border-left: none !important;
    z-index: 820;
  }
  /* Close button large touch target */
  .help-drawer-close {
    font-size: 24px;
    padding: 6px 10px;
    min-width: 44px;
    min-height: 44px;
  }
  /* Help button — above safe-area */
  .help-btn {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }

  /* Tour card — stay within mobile viewport */
  .tour-card {
    max-width: calc(100vw - 24px);
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    transform: none !important;
  }

  /* Tooltip overflow guard — don't render off right edge */
  [data-tip]::after {
    max-width: calc(100vw - 32px);
    white-space: normal;
  }

  /* Toast — above bottom nav on mobile */
  .toast-enhanced {
    bottom: calc(80px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }
}