
        :root { --primary: #2563EB; --primary-dark: #1D4ED8; --success: #10B981; --warning: #F59E0B; --danger: #EF4444; --gray-50: #F8FAFC; --gray-100: #F1F5F9; --gray-200: #E2E8F0; --gray-500: #64748B; --gray-700: #334155; --gray-900: #0F172A; }
        * { margin: 0; padding: 0; box-sizing: border-box; }
        
        .header { padding: 1rem 2rem; color: white; }
        .header.free { background: linear-gradient(135deg, #2563EB, #1D4ED8); }
        .header.pro { background: linear-gradient(135deg, #F59E0B, #D97706); }
        .header.business { background: linear-gradient(135deg, #3B82F6, #1E40AF); }
        .header.agency { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
        .header-inner { max-width: 1400px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
        .logo { font-weight: 700; font-size: 1.25rem; text-decoration: none; color: white; }
        .nav a { color: rgba(255,255,255,0.85); text-decoration: none; padding: 0.5rem 1rem; margin-left: 0.5rem; border-radius: 8px; }
        .nav a:hover { background: rgba(255,255,255,0.15); }
        .welcome-banner { padding: 2rem 2rem 3rem; color: white; }
        .welcome-banner.free { background: linear-gradient(135deg, #1D4ED8, #1E40AF); }
        .welcome-banner.pro { background: linear-gradient(135deg, #D97706, #B45309); }
        .welcome-banner.business { background: linear-gradient(135deg, #3B82F6, #1E40AF); }
        .welcome-banner.agency { background: linear-gradient(135deg, #7C3AED, #6D28D9); }
        .welcome-inner { max-width: 1400px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
        .welcome-text h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
        .plan-badge-large { padding: 0.5rem 1.25rem; border-radius: 50px; font-weight: 700; background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3); }
        .container { max-width: 1400px; margin: -2rem auto 2rem; padding: 0 2rem; position: relative; z-index: 10; }
        .stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
        @media (max-width: 900px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
        .stat-card { background: white; border-radius: 16px; padding: 1.5rem; box-shadow: 0 4px 20px rgba(0,0,0,0.08); transition: all 0.2s; }
        .stat-card:hover { transform: translateY(-2px); }
        .stat-card .icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1rem; }
        .stat-card .icon.blue { background: #EFF6FF; }
        .stat-card .icon.green { background: #ECFDF5; }
        .stat-card .icon.orange { background: #FFF7ED; }
        .stat-card .icon.purple { background: #F5F3FF; }
        .stat-card .value { font-size: 2.5rem; font-weight: 800; }
        .stat-card .label { color: var(--gray-500); font-size: 0.9rem; margin-top: 0.5rem; }
        .main-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
        @media (max-width: 900px) { .main-grid { grid-template-columns: 1fr; } }
        .card { background: white; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); overflow: hidden; }
        .card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-100); display: flex; justify-content: space-between; align-items: center; }
        .card-header h2 { font-size: 1.1rem; font-weight: 700; }
        .card-body { padding: 1.5rem; }
        .quick-form { display: flex; gap: 1rem; }
        .quick-form input { flex: 1; padding: 1rem; border: 2px solid var(--gray-200); border-radius: 12px; font-size: 1rem; }
        .quick-form input:focus { outline: none; border-color: var(--primary); }
        .quick-form button { padding: 1rem 2rem; background: var(--primary); color: white; border: none; border-radius: 12px; font-weight: 700; cursor: pointer; }
        .quick-form button:disabled { background: var(--gray-500); }
        .history-item { display: flex; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--gray-100); gap: 1rem; }
        .history-item:last-child { border-bottom: none; }
        .history-score { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; color: white; }
        .history-score.good { background: linear-gradient(135deg, #10B981, #059669); }
        .history-score.medium { background: linear-gradient(135deg, #F59E0B, #D97706); }
        .history-score.poor { background: linear-gradient(135deg, #EF4444, #DC2626); }
        .history-info { flex: 1; min-width: 0; }
        .history-url { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .history-meta { font-size: 0.85rem; color: var(--gray-500); }
        .history-action a { padding: 0.5rem 1rem; background: var(--gray-100); color: var(--gray-700); text-decoration: none; border-radius: 8px; font-weight: 600; }
        .history-action a:hover { background: var(--primary); color: white; }
        .plan-card { padding: 1.5rem; }
        .plan-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--gray-100); }
        .plan-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.75rem; }
        .plan-icon.free { background: #EFF6FF; }
        .plan-icon.pro { background: linear-gradient(135deg, #FEF3C7, #FDE68A); }
        .plan-icon.business { background: linear-gradient(135deg, #DBEAFE, #93C5FD); }
        .plan-icon.agency { background: linear-gradient(135deg, #EDE9FE, #DDD6FE); }
        .plan-info h3 { font-size: 1.25rem; font-weight: 700; }
        .plan-info p { color: var(--gray-500); }
        .feature-list { list-style: none; }
        .feature-list li { padding: 0.6rem 0; display: flex; align-items: center; gap: 0.75rem; }
        .feature-check { width: 22px; height: 22px; background: #ECFDF5; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #1E40AF; font-size: 0.75rem; }
        .pro-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1.5rem; }
        .pro-feature { background: var(--gray-50); border-radius: 12px; padding: 1.25rem; text-align: center; cursor: pointer; border: 2px solid transparent; }
        .pro-feature:hover { border-color: var(--primary); background: white; }
        .pro-feature .icon { font-size: 2rem; margin-bottom: 0.5rem; }
        .pro-feature .title { font-weight: 700; font-size: 0.9rem; }
        .pro-feature .desc { font-size: 0.8rem; color: var(--gray-500); }
        .api-usage { margin-top: 1.5rem; padding: 1.25rem; background: var(--gray-50); border-radius: 12px; }
        .usage-bar { height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; margin: 0.5rem 0; }
        .usage-bar .fill { height: 100%; background: var(--success); }
        .usage-text { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--gray-500); }
        .team-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-100); }
        .team-avatars { display: flex; margin-top: 0.5rem; }
        .team-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; border: 2px solid white; margin-left: -8px; }
        .team-avatar:first-child { margin-left: 0; }
        .team-avatar.add { background: var(--gray-100); color: var(--gray-500); cursor: pointer; }
        .btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.75rem 1.5rem; border-radius: 10px; text-decoration: none; font-weight: 600; cursor: pointer; border: none; }
        .btn-primary { background: var(--primary); color: white; }
        .btn-outline { background: white; border: 2px solid var(--gray-200); color: var(--gray-700); }
        .btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
        .empty-state { text-align: center; padding: 2rem; color: var(--gray-500); }
        .empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
        .loading { text-align: center; padding: 2rem; color: var(--gray-500); }
        .upgrade-banner { background: linear-gradient(135deg, #F59E0B, #D97706); border-radius: 16px; padding: 2rem; color: white; margin-bottom: 2rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
        .upgrade-banner h2 { margin-bottom: 0.5rem; }
        .upgrade-banner .btn { background: white; color: #D97706; }
    
    /* Dashboard Mobile Optimizations */
    @media (max-width: 767px) {
        /* Header compact */
        .header {
            padding: 0.75rem 1rem !important;
        }
        
        .header-inner {
            flex-direction: row;
            justify-content: space-between;
        }
        
        .logo {
            font-size: 1.1rem !important;
        }
        
        /* Welcome banner */
        .welcome-banner {
            padding: 1.5rem 1rem 2rem !important;
        }
        
        .welcome-text h1 {
            font-size: 1.5rem !important;
            margin-bottom: 0.5rem;
        }
        
        .welcome-text p {
            font-size: 0.9rem;
        }
        
        .plan-badge-large {
            padding: 0.5rem 1rem;
            font-size: 0.85rem;
        }
        
        /* Container spacing */
        .container {
            margin-top: -1.5rem !important;
            padding: 0 1rem !important;
        }
        
        /* Stats grid 2x2 */
        .stats-row {
            grid-template-columns: 1fr 1fr !important;
            gap: 0.75rem;
            margin-bottom: 1.5rem;
        }
        
        .stat-card {
            padding: 1rem;
        }
        
        .stat-card .icon {
            width: 40px;
            height: 40px;
            font-size: 1.25rem;
            margin-bottom: 0.75rem;
        }
        
        .stat-card .value {
            font-size: 1.75rem !important;
        }
        
        .stat-card .label {
            font-size: 0.75rem;
        }
        
        /* Main grid stack */
        .main-grid {
            grid-template-columns: 1fr !important;
        }
        
        /* Quick diagnosis */
        .quick-form {
            flex-direction: column;
            gap: 0.75rem;
        }
        
        .quick-form input {
            width: 100%;
            font-size: 16px;
            padding: 0.875rem;
        }
        
        .quick-form button {
            width: 100%;
            padding: 0.875rem 1.5rem;
        }
        
        /* History items */
        .history-item {
            flex-direction: column;
            align-items: flex-start;
            gap: 0.75rem;
            padding: 1rem;
        }
        
        .history-score {
            width: 100%;
            height: 48px;
            border-radius: 8px;
        }
        
        .history-info {
            width: 100%;
        }
        
        .history-action {
            width: 100%;
        }
        
        .history-action a {
            display: block;
            text-align: center;
            padding: 0.75rem;
        }
        
        /* Plan card */
        .plan-card {
            padding: 1.25rem;
        }
        
        .plan-icon {
            width: 48px;
            height: 48px;
        }
        
        .pro-features {
            grid-template-columns: 1fr !important;
        }
        
        .pro-feature {
            padding: 1rem;
        }
    }

        
        /* ===== SITE HEALTH CHECK WIDGET ===== */
        
        /* -- Competitor Summary Widget -- */
        .comp-summary-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
        .comp-summary-table th { text-align: left; padding: 0.4rem 0.6rem; color: var(--gray-500); font-weight: 600; border-bottom: 1px solid var(--gray-200); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
        .comp-summary-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
        .comp-summary-table tr:last-child td { border-bottom: none; }
        .comp-own-row td { font-weight: 600; background: var(--gray-50); }
        .comp-site-label { font-size: 0.78rem; color: var(--gray-500); }
        .comp-score-pill { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
        .comp-score-ok { background: #ECFDF5; color: #059669; }
        .comp-score-warn { background: #FFFBEB; color: #D97706; }
        .comp-score-bad { background: #FEF2F2; color: #DC2626; }
        .comp-score-none { background: var(--gray-100); color: var(--gray-500); }
        .comp-trend-up { color: #059669; font-size: 0.8rem; }
        .comp-trend-down { color: #DC2626; font-size: 0.8rem; }
        .comp-trend-flat { color: var(--gray-400); font-size: 0.8rem; }
        .comp-locked-msg { text-align: center; padding: 1.5rem; color: var(--gray-500); font-size: 0.9rem; }
        
        /* -- SEO Weekly Tasks Widget -- */
        .seo-tasks-list { display: flex; flex-direction: column; gap: 0.6rem; }
        .seo-task-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.65rem 0.75rem; border-radius: 8px; background: var(--gray-50); border: 1px solid var(--gray-100); transition: background 0.15s; }
        .seo-task-item:hover { background: white; border-color: var(--gray-200); }
        .seo-task-done { background: #F0FDF4; border-color: #BBF7D0; }
        .seo-task-done:hover { background: #F0FDF4; }
        .seo-task-check { flex-shrink: 0; cursor: pointer; padding: 2px; }
        .seo-task-checkbox { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 2px solid var(--gray-300); border-radius: 4px; font-size: 0.8rem; color: #16A34A; transition: all 0.15s; cursor: pointer; }
        .seo-task-checkbox:hover { border-color: var(--primary); }
        .seo-task-checkbox.checked { background: #16A34A; border-color: #16A34A; color: white; }
        .seo-task-body { flex: 1; min-width: 0; }
        .seo-task-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
        .seo-priority-badge { font-size: 0.7rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
        .seo-task-text { font-size: 0.87rem; color: var(--gray-700); }
        .seo-task-done .seo-task-text { text-decoration: line-through; color: var(--gray-400); }
        .seo-task-meta { display: flex; align-items: center; gap: 1rem; margin-top: 0.3rem; flex-wrap: wrap; }
        .seo-task-impact { font-size: 0.78rem; color: var(--primary); font-weight: 600; }
        .seo-task-done-label { font-size: 0.78rem; color: #16A34A; }
        .seo-tasks-hint { margin-top: 1rem; font-size: 0.8rem; color: var(--gray-500); padding: 0.5rem 0.75rem; background: var(--gray-50); border-radius: 6px; }
        .seo-tasks-blur-wrap { position: relative; margin-top: 0.6rem; }
        .seo-tasks-blur-items { filter: blur(4px); pointer-events: none; display: flex; flex-direction: column; gap: 0.6rem; }
        .seo-tasks-blur-overlay { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; background: rgba(255,255,255,0.75); border-radius: 8px; }
        .seo-task-blurred { opacity: 0.6; }
        .seo-task-blur-text { font-size: 0.87rem; color: var(--gray-500); }
        .health-widget { margin-bottom: 24px; }
        .health-site-list { display: flex; flex-direction: column; gap: 12px; }
        .health-site-row {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 14px 16px;
            background: var(--gray-50);
            border-radius: 10px;
            border: 1px solid var(--gray-200);
            transition: box-shadow 0.15s;
        }
        .health-site-row:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
        .health-favicon {
            width: 28px; height: 28px;
            border-radius: 6px;
            background: var(--gray-200);
            flex-shrink: 0;
            overflow: hidden;
            display: flex; align-items: center; justify-content: center;
        }
        .health-favicon img { width: 28px; height: 28px; object-fit: contain; }
        .health-site-info { flex: 1; min-width: 0; }
        .health-site-name {
            font-size: 13px; font-weight: 600; color: var(--gray-800);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .health-site-name a { color: inherit; text-decoration: none; }
        .health-site-name a:hover { color: var(--primary); }
        .health-site-meta { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
        .health-metrics {
            display: flex; gap: 16px; align-items: flex-start;
            flex-shrink: 0;
        }
        .health-metric { text-align: center; }
        .health-metric-label { font-size: 10px; color: var(--gray-500); margin-top: 4px; }
        .health-badge {
            display: inline-flex; align-items: center; gap: 3px;
            padding: 4px 8px; border-radius: 20px;
            font-size: 11px; font-weight: 600; white-space: nowrap;
        }
        .health-badge-ok       { background: #ECFDF5; color: #059669; }
        .health-badge-warn     { background: #FFFBEB; color: #D97706; }
        .health-badge-critical { background: #FEF2F2; color: #DC2626; }
        .health-trend-up   { color: #059669; font-weight: 700; font-size: 16px; }
        .health-trend-down { color: #DC2626; font-weight: 700; font-size: 16px; }
        .health-trend-flat { color: var(--gray-400); font-weight: 700; font-size: 16px; }
        .health-score { font-size: 20px; font-weight: 800; line-height: 1; }
        .health-score-ok   { color: #059669; }
        .health-score-warn { color: #D97706; }
        .health-score-bad  { color: #DC2626; }
        .health-summary-bar {
            display: flex; gap: 8px; align-items: center;
            padding: 0 0 14px;
            border-bottom: 1px solid var(--gray-100);
            margin-bottom: 12px;
        }
        .health-summary-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
        .health-overall-ok       { background: #059669; }
        .health-overall-warn     { background: #D97706; }
        .health-overall-critical { background: #DC2626; }
        .health-empty-state { text-align: center; padding: 32px 20px; }
        .health-empty-icon  { font-size: 40px; margin-bottom: 12px; }
        .health-empty-text  { color: var(--gray-500); font-size: 14px; margin-bottom: 16px; line-height: 1.6; }
        @media (max-width: 640px) {
            .health-metrics { gap: 8px; }
            .health-site-row { flex-wrap: wrap; }
            .health-metrics { width: 100%; justify-content: space-around; padding-top: 8px; }
            .health-badge { font-size: 10px; padding: 3px 6px; }
        }

/* Screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
        
/* === Phase D1: User Nav Dropdown === */
.pro-nav-user { position: relative; cursor: pointer; }
.pro-nav-user-dropdown {
  display: none; position: absolute; top: 100%; right: 0;
  background: white; border: 1px solid #e2e8f0;
  border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 200px; padding: 8px 0; z-index: 1001;
}
.pro-nav-user-dropdown.open { display: block; }
.pro-nav-user-dropdown a {
  display: block; padding: 10px 16px; color: #334155;
  text-decoration: none; font-size: 14px; transition: background 0.15s;
}
.pro-nav-user-dropdown a:hover { background: #f1f5f9; }
.pro-nav-user-dropdown hr { border: none; border-top: 1px solid #e2e8f0; margin: 4px 0; }
.pro-nav-user-dropdown .logout-link { color: #dc2626; }
/* Phase D1: Priority badge font-size fix (WCAG) */
.seo-priority-badge { font-size: 12px; }


/* === Phase D2 Task D: SEO Checkbox Tap Targets === */
.seo-task-checkbox,
.seo-task-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  cursor: pointer;
}
.seo-task-item {
  min-height: 48px;
}
.seo-task-item label {
  cursor: pointer;
  flex: 1;
  padding: 4px 0;
}


/* === Phase D3: Billing Page === */
.billing-container { max-width: 820px; margin: 0 auto; padding: 32px 20px; }
.billing-section { margin-bottom: 40px; }
.billing-section-title { font-size: 18px; font-weight: 700; color: #111827; margin: 0 0 16px; }
.billing-card { background: #fff; border: 1px solid #E5E7EB; border-radius: 12px; padding: 24px; }
.page-header { background: linear-gradient(135deg, #2563EB, #1D4ED8); color: white; padding: 2rem; }
.page-header-inner { max-width: 820px; margin: 0 auto; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-header p { font-size: 0.9rem; color: rgba(255,255,255,0.8); margin: 0.25rem 0 0; }

/* Current plan card */
.current-plan-row {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
}
.current-plan-info { display: flex; align-items: center; gap: 1rem; }
.current-plan-badge {
  font-size: 1.5rem; font-weight: 800; padding: 0.4rem 1rem;
  border-radius: 8px; letter-spacing: 0.05em;
}
.plan-badge-free { background: #F3F4F6; color: #374151; }
.plan-badge-pro { background: #EFF6FF; color: #1D4ED8; }
.plan-badge-business { background: #ECFDF5; color: #065F46; }
.plan-badge-agency { background: #F5F3FF; color: #5B21B6; }
.current-plan-detail { font-size: 14px; color: #6B7280; }
.current-plan-detail strong { color: #111827; font-size: 16px; display: block; margin-bottom: 2px; }
.billing-renew-date { font-size: 13px; color: #6B7280; margin-top: 4px; }
.btn-upgrade {
  background: #2563EB; color: #fff; border: none; border-radius: 8px;
  padding: 10px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-block; transition: background 0.2s;
}
.btn-upgrade:hover { background: #1D4ED8; }
.btn-cancel-plan {
  background: #fff; border: 1px solid #D1D5DB; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; color: #6B7280; cursor: pointer;
}
.btn-cancel-plan:hover { border-color: #EF4444; color: #EF4444; }

/* Plan comparison */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.plan-card {
  border: 2px solid #E5E7EB; border-radius: 12px; padding: 20px;
  text-align: center; position: relative; transition: border-color 0.2s;
}
.plan-card.current { border-color: #2563EB; }
.plan-card.recommended { border-color: #F59E0B; }
.plan-card-tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: #F59E0B; color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: 20px; white-space: nowrap;
}
.plan-card-current-tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: #2563EB; color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: 20px; white-space: nowrap;
}
.plan-card-name { font-size: 16px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.plan-card-price { font-size: 26px; font-weight: 800; color: #2563EB; }
.plan-card-price span { font-size: 13px; font-weight: 400; color: #6B7280; }
.plan-card-features { text-align: left; margin: 16px 0; font-size: 13px; color: #374151; }
.plan-card-features li {
  list-style: none; padding: 4px 0;
  display: flex; align-items: flex-start; gap: 6px;
}
.plan-card-features li::before { content: "✓"; color: #059669; font-weight: 700; flex-shrink: 0; }
.plan-card-features li.no::before { content: "✕"; color: #D1D5DB; }
.plan-card-features li.no { color: #9CA3AF; }
.btn-plan {
  width: 100%; padding: 8px 0; border-radius: 8px; font-size: 13px;
  font-weight: 600; cursor: pointer; border: none; transition: all 0.2s;
}
.btn-plan-current { background: #EFF6FF; color: #2563EB; cursor: default; }
.btn-plan-upgrade { background: #2563EB; color: #fff; }
.btn-plan-upgrade:hover { background: #1D4ED8; }
.btn-plan-downgrade { background: #fff; border: 1px solid #D1D5DB; color: #374151; }
.btn-plan-downgrade:hover { border-color: #9CA3AF; }

/* Payment method */
.payment-method-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.payment-card-icon {
  display: flex; align-items: center; gap: 12px;
}
.payment-card-logo {
  width: 48px; height: 30px; background: #1A1F71; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff; letter-spacing: 0.5px;
}
.payment-card-details { font-size: 14px; color: #374151; }
.payment-card-details span { display: block; font-size: 12px; color: #9CA3AF; margin-top: 2px; }
.btn-update-payment {
  background: #fff; border: 1px solid #D1D5DB; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; color: #374151; cursor: pointer; font-weight: 500;
}
.btn-update-payment:hover { background: #F9FAFB; }

.invoice-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  overflow: hidden;
}
.invoice-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}
.invoice-table thead {
  background: #F9FAFB;
}
.invoice-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid #E5E7EB;
}
.invoice-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: #374151;
  border-bottom: 1px solid #F3F4F6;
  vertical-align: middle;
}
.invoice-table tbody tr:last-child td {
  border-bottom: none;
}
.invoice-table tbody tr:hover {
  background: #FAFBFC;
}
.invoice-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}
.invoice-status-paid {
  background: #DCFCE7;
  color: #166534;
}
.invoice-status-pending {
  background: #FEF3C7;
  color: #92400E;
}
.invoice-actions {
  display: flex;
  gap: 6px;
}
.invoice-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.invoice-dl-btn:hover {
  background: #F3F4F6;
  border-color: #9CA3AF;
}
.invoice-dl-btn svg {
  width: 14px;
  height: 14px;
}
.invoice-empty {
  text-align: center;
  padding: 40px 20px;
  color: #9CA3AF;
  font-size: 14px;
}
.invoice-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.invoice-preview-overlay[hidden] {
  display: none !important;
}
.invoice-preview-modal {
  background: #fff;
  border-radius: 14px;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.invoice-preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #E5E7EB;
  flex-shrink: 0;
}
.invoice-preview-toolbar h3 {
  margin: 0;
  font-size: 16px;
  color: #111827;
}
.invoice-preview-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.invoice-preview-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #6B7280;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.invoice-preview-close:hover {
  background: #F3F4F6;
  color: #111827;
}
.invoice-preview-content {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.invoice-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}


/* === Phase D4 Task A: Mobile Responsive === */
@media (max-width: 767px) {
  .pro-nav-links { display: none; }
  .pro-navbar { padding: 10px 16px; }
  .pro-nav-user-name { display: none; }
  .pro-nav-user-plan { font-size: 10px; }
  .main-content, .dashboard-content, .settings-container, .billing-container { padding: 16px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .stat-number { font-size: 22px; }
  .main-grid { grid-template-columns: 1fr; gap: 16px; }
  .welcome-banner { padding: 20px 16px; border-radius: 12px; }
  .welcome-banner h2 { font-size: 18px; }
  .card { border-radius: 10px; }
  .card-header { padding: 14px 16px; }
  .card-body { padding: 16px; }
  .history-card { padding: 14px; }
  .history-url, .history-card a[href] { font-size: 12px; }
  .detail-panel-inner { padding: 12px; }
  .detail-actions { flex-direction: column; }
  .plan-badge-large { font-size: 12px; padding: 4px 10px; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .seo-task-item { font-size: 13px; padding: 10px; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat-card .stat-number { font-size: 20px; }
}

/* === Phase D4 Task A: Billing Mobile === */
@media (max-width: 767px) {
  .billing-container { padding: 20px 16px; }
  .current-plan-row { flex-direction: column; align-items: flex-start; }
  .billing-plan-actions { flex-direction: column; }
  .payment-method-row { flex-direction: column; gap: 12px; }
  .plans-grid { grid-template-columns: 1fr !important; gap: 16px; }
  .plan-card { max-width: 100%; }
  .invoice-table th,
  .invoice-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
  .invoice-dl-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  .invoice-preview-modal {
    max-height: 90vh;
    border-radius: 10px;
  }
  .invoice-preview-toolbar {
    padding: 12px 16px;
  }
  .invoice-preview-content {
    padding: 16px;
  }
}

/* === Phase D4 Task B: Dashboard Hamburger === */
.dashboard-hamburger {
  display: none; background: none; border: none; cursor: pointer;
  padding: 8px; flex-direction: column; gap: 5px; margin-left: auto;
}
.dashboard-hamburger span {
  display: block; width: 22px; height: 2px;
  background: #374151; border-radius: 2px; transition: all 0.3s;
}
.dashboard-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.dashboard-hamburger.active span:nth-child(2) { opacity: 0; }
.dashboard-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
@media (max-width: 767px) {
  .dashboard-hamburger { display: flex; }
}
.dashboard-mobile-menu { background: #fff; border-bottom: 1px solid #E5E7EB; box-shadow: 0 4px 12px rgba(0,0,0,0.08); padding: 8px 0; }
.dashboard-mobile-menu[hidden] { display: none; }
.dash-mobile-link { display: block; padding: 12px 20px; font-size: 15px; color: #374151; text-decoration: none; transition: background 0.15s; }
.dash-mobile-link:hover, .dash-mobile-link:active { background: #F3F4F6; }
.dash-mobile-divider { border: none; border-top: 1px solid #E5E7EB; margin: 4px 16px; }
.dash-mobile-logout { color: #DC2626; }

/* === Phase D4 Task C: Toast === */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 10000;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: #1F2937; color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  pointer-events: auto; opacity: 0; transform: translateY(16px);
  transition: opacity 0.3s, transform 0.3s; max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-success { background: #059669; }
.toast.toast-error { background: #DC2626; }
.toast.toast-warning { background: #D97706; }
@media (max-width: 767px) {
  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { max-width: 100%; }
}

/* === Phase D4 Task D: Skeleton === */
.skeleton {
  background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px;
}
.skeleton-text { height: 16px; margin-bottom: 8px; width: 80%; }
.skeleton-text-short { height: 16px; width: 40%; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.cancel-plan-section { text-align: center; margin-top: 40px; padding-top: 24px; border-top: 1px solid #f1f5f9; }
.cancel-plan-note { font-size: 13px; color: #94a3b8; margin-bottom: 8px; }
.btn-cancel-subtle { background: transparent; border: 1px solid #cbd5e1; color: #94a3b8; padding: 8px 20px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.btn-cancel-subtle:hover { border-color: #ef4444; color: #ef4444; }
