    /* ==========================================
       BQ24 HISTORY (ТАРИХ) & PROFILE STYLESHEET
       css/profile.css - REDESIGNED TO MATCH REFERENCE
    ========================================== */

    .history-page-view {
      width: 100%;
      max-width: 1240px;
      margin: 0 auto;
      box-sizing: border-box;
      padding: 0 4px 48px;
    }

    /* ------------------------------------------
       1. HISTORY HEADER & BREADCRUMB
    ------------------------------------------ */
    .history-header-wrap {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      flex-wrap: wrap;
      gap: 16px;
      margin-bottom: 24px;
    }

    .history-header-left {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .history-breadcrumb {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 13px;
      font-weight: 600;
      color: var(--muted);
      margin-bottom: 2px;
    }

    .history-breadcrumb .breadcrumb-sep {
      width: 14px;
      height: 14px;
      opacity: 0.6;
    }

    .history-breadcrumb span.active {
      color: var(--ink);
      font-weight: 700;
    }

    .history-page-title {
      font-family: 'Rubik', 'Inter', -apple-system, sans-serif;
      font-size: 28px;
      font-weight: 900;
      color: var(--ink);
      margin: 0;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      letter-spacing: -0.02em;
      line-height: 1.2;
    }

    .history-title-icon-box {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border-radius: 10px;
      background: rgba(59, 130, 246, 0.12);
      color: var(--brand-blue);
    }

    .history-title-icon-box svg {
      width: 22px;
      height: 22px;
    }

    .history-page-subtitle {
      font-size: 14px;
      color: var(--muted);
      margin: 2px 0 0 0;
      font-weight: 500;
    }

    .history-header-right {
      display: flex;
      align-items: center;
    }

    .history-date-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: 999px;
      padding: 8px 16px;
      font-size: 13px;
      font-weight: 700;
      color: var(--ink);
      box-shadow: var(--shadow-sm);
    }

    .history-date-pill .date-pill-icon {
      width: 16px;
      height: 16px;
      color: var(--brand-blue);
    }

    /* ------------------------------------------
       2. SUMMARY ANALYTICS CARDS (3 CARDS)
    ------------------------------------------ */
    .history-summary-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 16px;
      margin-bottom: 24px;
    }

    .history-summary-card {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-lg, 16px);
      padding: 18px 22px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      box-shadow: var(--shadow-sm);
      min-width: 0;
      transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .history-summary-card:hover {
      border-color: rgba(59, 130, 246, 0.4);
      transform: translateY(-2px);
      box-shadow: var(--shadow-md);
    }

    .history-summary-left {
      display: flex;
      align-items: center;
      gap: 14px;
      min-width: 0;
    }

    .history-summary-icon {
      width: 48px;
      height: 48px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .history-summary-icon svg {
      width: 24px;
      height: 24px;
    }

    .history-summary-content {
      min-width: 0;
    }

    .history-summary-num {
      font-family: 'Rubik', 'Inter', -apple-system, sans-serif;
      font-size: 28px;
      font-weight: 900;
      line-height: 1.1;
      color: var(--ink);
      letter-spacing: -0.01em;
    }

    .history-summary-label {
      font-size: 13px;
      font-weight: 700;
      color: var(--muted);
      margin-top: 3px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .history-summary-right {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      flex-shrink: 0;
      gap: 2px;
    }

    .history-summary-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 8px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 800;
    }

    .history-summary-badge.badge-green {
      background: rgba(16, 185, 129, 0.12);
      color: #10b981;
    }

    .history-summary-badge.badge-blue {
      background: rgba(59, 130, 246, 0.12);
      color: #3b82f6;
    }

    .history-summary-badge.badge-purple {
      background: rgba(139, 92, 246, 0.12);
      color: #8b5cf6;
    }

    .history-summary-subtext {
      font-size: 11px;
      font-weight: 600;
      color: var(--muted);
      white-space: nowrap;
    }

    /* ------------------------------------------
       3. ANALYTICS VISUALIZATION ROW
    ------------------------------------------ */
    .history-analytics-row {
      display: grid;
      grid-template-columns: 1.55fr 1fr;
      gap: 16px;
      margin-bottom: 24px;
    }

    .history-analytics-card {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-lg, 16px);
      padding: 20px 22px;
      box-shadow: var(--shadow-sm);
      display: flex;
      flex-direction: column;
      min-width: 0;
    }

    .history-card-top-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;
      gap: 8px;
    }

    .history-analytics-title {
      font-size: 16px;
      font-weight: 800;
      color: var(--ink);
      margin: 0;
      letter-spacing: -0.01em;
    }

    .history-chart-pill {
      background: #2563eb;
      color: #ffffff;
      padding: 3px 9px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 900;
      letter-spacing: 0.02em;
    }

    .history-chart-wrapper {
      position: relative;
      width: 100%;
      height: 200px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .history-chart-svg {
      width: 100%;
      height: 100%;
      overflow: visible;
    }

    .history-distribution-content {
      display: flex;
      align-items: center;
      justify-content: space-around;
      gap: 20px;
      flex: 1;
      min-height: 200px;
    }

    .history-donut-box {
      position: relative;
      width: 136px;
      height: 136px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .history-donut-svg {
      width: 100%;
      height: 100%;
      transform: rotate(-90deg);
    }

    .history-donut-center {
      position: absolute;
      text-align: center;
      pointer-events: none;
    }

    .history-donut-num {
      font-family: 'Rubik', 'Inter', -apple-system, sans-serif;
      font-size: 24px;
      font-weight: 900;
      line-height: 1;
      color: var(--ink);
    }

    .history-donut-label {
      font-size: 11px;
      font-weight: 700;
      color: var(--muted);
      margin-top: 3px;
    }

    .history-legend-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      flex: 1;
      min-width: 0;
    }

    .history-legend-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      font-size: 13px;
    }

    .legend-left {
      display: flex;
      align-items: center;
      gap: 8px;
      font-weight: 700;
      color: var(--ink);
    }

    .legend-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    .legend-right {
      font-weight: 700;
      color: var(--muted);
      font-size: 12.5px;
      white-space: nowrap;
    }

    .legend-right strong {
      color: var(--ink);
    }

    /* ------------------------------------------
       4. TOOLBAR: FILTERS, SORT & VIEW TOGGLES
    ------------------------------------------ */
    .history-toolbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 14px;
      margin-bottom: 20px;
    }

    .archive-filters {
      display: flex;
      gap: 8px;
      overflow-x: auto;
      white-space: nowrap;
      padding: 2px 0 4px;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }

    .archive-filters::-webkit-scrollbar {
      display: none;
    }

    .archive-filter-btn {
      padding: 8px 16px;
      min-height: 38px;
      border-radius: 999px;
      background: var(--card-bg);
      border: 1.5px solid var(--card-border);
      color: var(--muted);
      font-size: 13px;
      font-weight: 800;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
      box-shadow: var(--shadow-sm);
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .archive-filter-btn:hover {
      border-color: var(--brand-blue);
      color: var(--ink);
      transform: translateY(-1px);
    }

    .archive-filter-btn.active {
      background: #2563eb;
      border-color: #2563eb;
      color: #ffffff;
      box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
    }

    .filter-count {
      font-size: 11px;
      font-weight: 800;
      opacity: 0.85;
    }

    .history-toolbar-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-left: auto;
    }

    .history-sort-wrap {
      position: relative;
    }

    .history-sort-select {
      height: 38px;
      padding: 0 14px;
      border-radius: 10px;
      background: var(--card-bg);
      border: 1.5px solid var(--card-border);
      color: var(--ink);
      font-size: 13px;
      font-weight: 700;
      outline: none;
      cursor: pointer;
      box-shadow: var(--shadow-sm);
      transition: border-color 0.2s ease;
    }

    .history-sort-select:hover,
    .history-sort-select:focus {
      border-color: var(--brand-blue);
    }

    .history-view-toggles {
      display: flex;
      background: var(--card-bg);
      border: 1.5px solid var(--card-border);
      border-radius: 10px;
      overflow: hidden;
      height: 38px;
      box-shadow: var(--shadow-sm);
    }

    .view-toggle-btn {
      width: 38px;
      height: 100%;
      border: none;
      background: transparent;
      color: var(--muted);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .view-toggle-btn:hover {
      color: var(--ink);
    }

    .view-toggle-btn.active {
      background: rgba(59, 130, 246, 0.12);
      color: var(--brand-blue);
    }

    .view-toggle-btn svg {
      width: 17px;
      height: 17px;
    }

    /* ------------------------------------------
       5. RESULT CARDS GRID
    ------------------------------------------ */
    .archive-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 16px;
      width: 100%;
      box-sizing: border-box;
      margin-bottom: 24px;
    }

    .archive-card,
    .history-card {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-lg, 16px);
      padding: 18px 20px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      width: 100%;
      min-width: 0;
      box-sizing: border-box;
      box-shadow: var(--shadow-sm);
      transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .archive-card:hover,
    .history-card:hover {
      border-color: rgba(59, 130, 246, 0.4);
      transform: translateY(-2px);
      box-shadow: var(--shadow-md);
    }

    .history-card-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      min-width: 0;
    }

    .history-card-header-left {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      flex: 1;
      min-width: 0;
    }

    .history-card-topic-num {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: rgba(100, 116, 139, 0.12);
      color: var(--ink);
      font-family: 'Rubik', 'Inter', -apple-system, sans-serif;
      font-size: 13.5px;
      font-weight: 900;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .history-card-title {
      margin: 0;
      font-size: 13.5px;
      font-weight: 800;
      color: var(--ink);
      line-height: 1.35;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      text-transform: uppercase;
      letter-spacing: -0.01em;
      word-break: break-word;
    }

    .history-card-score-badge {
      font-family: 'Rubik', 'Inter', -apple-system, sans-serif;
      font-size: 18px;
      font-weight: 900;
      padding: 4px 10px;
      border-radius: 8px;
      line-height: 1;
      flex-shrink: 0;
    }

    .score-tier-green {
      background: rgba(16, 185, 129, 0.12);
      color: #059669;
    }

    .score-tier-blue {
      background: rgba(59, 130, 246, 0.12);
      color: #2563eb;
    }

    .score-tier-amber {
      background: rgba(245, 158, 11, 0.12);
      color: #d97706;
    }

    .score-tier-red {
      background: rgba(239, 68, 68, 0.12);
      color: #dc2626;
    }

    [data-theme="dark"] .score-tier-green {
      color: #34d399;
      background: rgba(16, 185, 129, 0.2);
    }

    [data-theme="dark"] .score-tier-blue {
      color: #60a5fa;
      background: rgba(59, 130, 246, 0.2);
    }

    [data-theme="dark"] .score-tier-amber {
      color: #fbbf24;
      background: rgba(245, 158, 11, 0.2);
    }

    [data-theme="dark"] .score-tier-red {
      color: #f87171;
      background: rgba(239, 68, 68, 0.2);
    }

    .history-card-accent-bar {
      height: 4px;
      background: var(--card-border);
      border-radius: 999px;
      overflow: hidden;
      width: 100%;
      margin: 2px 0;
    }

    .history-card-accent-bar i {
      display: block;
      height: 100%;
      border-radius: 999px;
      transition: width 0.4s ease;
    }

    .history-card-stats-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      font-size: 12.5px;
      font-weight: 700;
      color: var(--muted);
      padding-top: 4px;
    }

    .history-card-stats-row .stat-item {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      white-space: nowrap;
    }

    .history-card-stats-row .icon-inline {
      width: 14px;
      height: 14px;
    }

    .stat-correct {
      color: #10b981;
    }

    .stat-wrong {
      color: #ef4444;
    }

    .stat-points {
      color: var(--brand-blue);
    }

    .history-card-footer-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding-top: 8px;
      border-top: 1px solid var(--card-border);
      margin-top: auto;
    }

    .history-card-footer-left {
      display: flex;
      align-items: center;
    }

    .history-card-tag {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 10px;
      border-radius: 999px;
      font-size: 11.5px;
      font-weight: 800;
      white-space: nowrap;
    }

    .history-card-tag svg {
      width: 12px;
      height: 12px;
    }

    .tag-success {
      background: rgba(16, 185, 129, 0.12);
      color: #059669;
    }

    .tag-good {
      background: rgba(59, 130, 246, 0.12);
      color: #2563eb;
    }

    .tag-mid {
      background: rgba(245, 158, 11, 0.12);
      color: #d97706;
    }

    .tag-low {
      background: rgba(239, 68, 68, 0.12);
      color: #dc2626;
    }

    [data-theme="dark"] .tag-success {
      color: #34d399;
      background: rgba(16, 185, 129, 0.2);
    }

    [data-theme="dark"] .tag-good {
      color: #60a5fa;
      background: rgba(59, 130, 246, 0.2);
    }

    [data-theme="dark"] .tag-mid {
      color: #fbbf24;
      background: rgba(245, 158, 11, 0.2);
    }

    [data-theme="dark"] .tag-low {
      color: #f87171;
      background: rgba(239, 68, 68, 0.2);
    }

    .history-card-footer-right {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .history-card-date {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 12px;
      font-weight: 600;
      color: var(--muted);
      white-space: nowrap;
    }

    .history-card-date svg {
      width: 13px;
      height: 13px;
    }

    .history-card-action-btn {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: rgba(59, 130, 246, 0.08);
      border: 1px solid rgba(59, 130, 246, 0.15);
      color: var(--brand-blue);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
      padding: 0;
    }

    .history-card-action-btn:hover {
      background: #2563eb;
      color: #ffffff;
      transform: scale(1.08);
    }

    .history-card-action-btn svg {
      width: 14px;
      height: 14px;
    }

    /* List View Modifier */
    .archive-grid.list-view {
      grid-template-columns: 1fr;
    }

    /* ------------------------------------------
       6. LOAD MORE BUTTON
    ------------------------------------------ */
    .history-load-more-wrap {
      display: flex;
      justify-content: center;
      margin: 20px 0 32px;
    }

    .btn-history-load-more {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 10px 24px;
      border-radius: 999px;
      background: rgba(59, 130, 246, 0.08);
      border: 1.5px solid rgba(59, 130, 246, 0.2);
      color: var(--brand-blue);
      font-size: 13.5px;
      font-weight: 800;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .btn-history-load-more:hover {
      background: #2563eb;
      border-color: #2563eb;
      color: #ffffff;
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    }


    /* ==========================================
       4. PROFILE REDESIGN LAYOUT
    ========================================== */
    .profile-layout {
      display: flex;
      flex-direction: column;
      gap: 16px;
      max-width: 680px;
      width: 100%;
    }

    /* Top User Summary Hero Card */
    .profile-summary-card {
      display: flex;
      align-items: center;
      gap: 20px;
      padding: 24px 26px;
      background: var(--card-bg);
      border: 1.5px solid var(--card-border);
      border-radius: var(--radius-xl, 20px);
      box-shadow: var(--shadow-sm);
      min-width: 0;
    }

    .profile-summary-avatar,
    .profile-avatar-big {
      width: 76px;
      height: 76px;
      border-radius: 20px;
      background: linear-gradient(135deg, #6366f1, #38bdf8);
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: 'Rubik', 'Inter', -apple-system, sans-serif;
      font-weight: 900;
      font-size: 28px;
      color: #ffffff;
      flex-shrink: 0;
      box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
      text-transform: uppercase;
    }

    .profile-summary-info {
      flex: 1;
      min-width: 0;
    }

    .profile-summary-name {
      font-family: 'Rubik', 'Inter', -apple-system, sans-serif;
      font-size: 22px;
      font-weight: 900;
      color: var(--ink);
      margin: 0 0 4px;
      line-height: 1.25;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    .profile-summary-email {
      margin: 0 0 10px;
      color: var(--muted);
      font-size: 13.5px;
      font-weight: 600;
      overflow-wrap: anywhere;
      word-break: break-all;
    }

    .profile-summary-badges {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
    }

    .profile-badge-pill {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 10px;
      border-radius: var(--radius-full);
      font-size: 12px;
      font-weight: 800;
    }

    .profile-badge-pill.role {
      background: rgba(99, 102, 241, 0.12);
      border: 1px solid rgba(99, 102, 241, 0.3);
      color: var(--brand-indigo);
    }

    .profile-badge-pill.group {
      background: rgba(56, 189, 248, 0.12);
      border: 1px solid rgba(56, 189, 248, 0.3);
      color: var(--brand-cyan);
    }

    /* Profile Section Cards */
    .profile-section-card {
      padding: 22px 24px;
      background: var(--card-bg);
      border: 1.5px solid var(--card-border);
      border-radius: var(--radius-lg, 16px);
      box-shadow: var(--shadow-sm);
      min-width: 0;
    }

    .profile-section-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 18px;
    }

    .profile-section-icon {
      width: 38px;
      height: 38px;
      border-radius: 10px;
      background: rgba(99, 102, 241, 0.12);
      color: var(--brand-indigo);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .profile-section-icon svg {
      width: 18px;
      height: 18px;
    }

    .profile-section-title {
      margin: 0;
      font-size: 16px;
      font-weight: 800;
      color: var(--ink);
      line-height: 1.2;
    }

    .profile-section-subtitle {
      margin: 2px 0 0;
      font-size: 12.5px;
      color: var(--muted);
      font-weight: 500;
    }

    .profile-form .field label {
      display: block;
      font-size: 12.5px;
      font-weight: 700;
      color: var(--ink);
      margin-bottom: 6px;
    }

    .profile-form .input-field {
      width: 100%;
      min-height: 48px;
      padding: 12px 14px;
      font-size: 14px;
      box-sizing: border-box;
      border-radius: var(--radius-md, 10px);
    }

    .profile-save-btn {
      width: 100%;
      min-height: 48px;
      font-size: 14px;
      font-weight: 800;
      margin-top: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      cursor: pointer;
      border-radius: var(--radius-md, 10px);
      transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    }

    .profile-save-btn:hover {
      transform: translateY(-1px);
    }

    .profile-status-message {
      margin-top: 12px;
      font-size: 13px;
      font-weight: 700;
      color: var(--muted);
      min-height: 20px;
    }

    /* Readonly Account Email */
    .profile-readonly-field {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 12px 14px;
      min-height: 48px;
      border-radius: var(--radius-md, 10px);
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.03));
      border: 1.5px dashed var(--card-border);
      color: var(--ink);
      font-size: 14px;
      font-weight: 600;
      overflow-wrap: anywhere;
      word-break: break-all;
      box-sizing: border-box;
    }

    .readonly-lock-icon {
      width: 16px;
      height: 16px;
      color: var(--muted);
      flex-shrink: 0;
    }

    .profile-security-hint {
      margin: 8px 0 0;
      font-size: 12px;
      color: var(--muted);
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 6px;
      line-height: 1.4;
    }

    /* Settings Theme Switch Item */
    .profile-setting-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding: 10px 0 4px;
      min-width: 0;
    }

    .profile-setting-info {
      min-width: 0;
    }

    .profile-setting-name {
      font-size: 14px;
      font-weight: 800;
      color: var(--ink);
    }

    .profile-setting-desc {
      font-size: 12px;
      color: var(--muted);
      margin-top: 2px;
    }

    .profile-theme-btn {
      padding: 10px 18px;
      min-height: 48px;
      font-size: 13px;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
      border-radius: var(--radius-md, 10px);
      cursor: pointer;
      transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    }

    .profile-theme-btn:hover {
      transform: translateY(-1px);
    }

    /* Legacy compatibility classes */
    .profile-card {
      background: var(--card-bg);
      border: 1.5px solid var(--card-border);
      border-radius: var(--radius-xl, 20px);
      padding: 24px;
      max-width: 680px;
    }

    .profile-avatar-row {
      display: flex;
      align-items: center;
      gap: 20px;
      margin-bottom: 24px;
    }

    .profile-avatar-info h2 {
      font-family: 'Rubik', 'Inter', -apple-system, sans-serif;
      font-size: 22px;
      font-weight: 900;
      margin-bottom: 4px;
    }

    .profile-avatar-info p {
      color: var(--muted);
      font-size: 14px;
      font-weight: 700;
    }


    /* ==========================================
       5. RESPONSIVE MEDIA QUERIES (MOBILE FIRST)
    ========================================== */
    @media (max-width: 1024px) {
      .archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .history-analytics-row {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 768px) {
      .history-summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
      }
      .history-toolbar {
        flex-direction: column;
        align-items: stretch;
      }
      .history-toolbar-actions {
        width: 100%;
        justify-content: space-between;
      }
      .history-sort-select {
        flex: 1;
      }
      .archive-grid {
        grid-template-columns: 1fr;
        gap: 12px;
      }
      .profile-layout {
        max-width: 100%;
        gap: 12px;
      }
      .profile-summary-card {
        padding: 18px 16px;
        gap: 14px;
      }
      .profile-summary-avatar,
      .profile-avatar-big {
        width: 64px;
        height: 64px;
        font-size: 24px;
        border-radius: 16px;
      }
      .profile-summary-name {
        font-size: 18px;
      }
      .profile-summary-email {
        font-size: 12.5px;
      }
      .profile-section-card {
        padding: 18px 16px;
      }
    }

    /* 320px, 360px, 390px, 430px smartphone layout */
    @media (max-width: 480px) {
      .history-page-title {
        font-size: 22px;
      }
      .history-date-pill {
        display: none;
      }
      .history-summary-card {
        padding: 14px 16px;
      }
      .history-card {
        padding: 14px 16px;
      }
      .history-card-stats-row {
        font-size: 11.5px;
      }
      .history-distribution-content {
        flex-direction: column;
        align-items: center;
      }
      .history-legend-list {
        width: 100%;
      }

      .profile-summary-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 16px;
      }

      .profile-summary-badges {
        justify-content: center;
      }

      .profile-setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
      }

      .profile-theme-btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
      }
    }