/* 🎨 UI/UX: Enhanced Color Palette and Transitions */
    :root {
      --primary: #4f46e5;
      --primary-dark: #4338ca;
      --primary-light: #e0e7ff;
      --accent: #f59e0b;
      --green: #10b981;
      --red: #ef4444;
      --orange: #f97316;
      --bg: #f8fafc;
      --card: #ffffff;
      --card-border: #e2e8f0;
      --text: #0f172a;
      --text2: #1e293b;
      --muted: #64748b;
      --input-bg: #f1f5f9;
      --input-border: #cbd5e1;
      --divider: #f1f5f9;
      --code-bg: #0f172a;
      --navbar-bg: rgba(255, 255, 255, 0.85);
      --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
      --shadow-md: 0 10px 25px -5px rgba(79, 70, 229, 0.15), 0 8px 10px -6px rgba(79, 70, 229, 0.1);
      --shadow-hover: 0 20px 30px -10px rgba(79, 70, 229, 0.25);
      --r: 20px;
      transition: background-color 0.3s ease, color 0.3s ease;
    }

    [data-theme="dark"] {
      --primary: #6366f1;
      --primary-dark: #818cf8;
      --primary-light: #1e1b4b;
      --bg: #0f172a;
      --card: #1e293b;
      --card-border: #334155;
      --text: #f8fafc;
      --text2: #f1f5f9;
      --muted: #94a3b8;
      --input-bg: #0f172a;
      --input-border: #334155;
      --divider: #334155;
      --code-bg: #020617;
      --navbar-bg: rgba(15, 23, 42, 0.85);
      --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
      --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
      --shadow-hover: 0 20px 30px -10px rgba(0, 0, 0, 0.6);
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      -webkit-tap-highlight-color: transparent;
    }

    html {
      scroll-behavior: smooth;
    }

    body {
      font-family: 'Readex Pro', sans-serif;
      background: var(--bg);
      color: var(--text);
      line-height: 1.6;
      overflow-x: hidden;
      min-height: 100vh;
    }

    [data-theme="light"] body {
      background: radial-gradient(circle at top right, #e0e7ff 0%, #f8fafc 40%);
    }

    .container {
      max-width: 1120px;
      margin: 0 auto;
      padding: 0 20px;
      display: block;
    }

    ::-webkit-scrollbar {
      width: 8px;
      height: 8px;
    }

    ::-webkit-scrollbar-track {
      background: var(--bg);
    }

    ::-webkit-scrollbar-thumb {
      background: var(--primary);
      border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: var(--primary-dark);
    }

    /* ✅ AUTHENTICATION SCREEN CSS */
    #authScreen {
      position: fixed;
      inset: 0;
      background: var(--bg);
      z-index: 9999;
      display: flex;
      justify-content: center;
      align-items: center;
      background-image: radial-gradient(circle at 50% -20%, rgba(79, 70, 229, 0.15), transparent 70%);
      padding: 20px;
    }

    .auth-box {
      background: var(--card);
      border-radius: 30px;
      width: 100%;
      max-width: 420px;
      padding: 40px;
      box-shadow: var(--shadow-md);
      border: 1px solid var(--card-border);
      text-align: center;
      animation: slideDown 0.5s ease;
      max-height: 95dvh;
      overflow-y: auto;
    }

    .auth-logo {
      font-family: 'Tajawal';
      font-size: 2.2rem;
      font-weight: 800;
      color: var(--text2);
      margin-bottom: 10px;
    }

    .auth-logo span {
      color: var(--primary);
    }

    .auth-tabs {
      display: flex;
      background: var(--input-bg);
      border-radius: 16px;
      padding: 6px;
      margin: 20px 0 30px;
      border: 1px solid var(--card-border);
    }

    .auth-tab {
      flex: 1;
      padding: 12px;
      border-radius: 12px;
      cursor: pointer;
      font-weight: 700;
      font-size: 0.9rem;
      color: var(--muted);
      transition: all 0.3s;
    }

    .auth-tab.active {
      background: var(--card);
      color: var(--primary);
      box-shadow: var(--shadow-sm);
    }

    .auth-form {
      display: none;
      text-align: right;
    }

    .auth-form.active {
      display: block;
      animation: fadeIn 0.4s;
    }

    .auth-input-group {
      margin-bottom: 16px;
      text-align: right;
    }

    .auth-input-group label {
      display: block;
      margin-bottom: 8px;
      font-weight: 700;
      color: var(--text2);
      font-size: 0.85rem;
    }

    .auth-input-group input {
      width: 100%;
      padding: 14px 18px;
      border-radius: 14px;
      border: 1px solid var(--input-border);
      background: var(--input-bg);
      color: var(--text);
      font-family: 'Readex Pro';
      font-size: 0.95rem;
      outline: none;
      transition: all 0.3s;
      direction: rtl;
    }

    .auth-input-group input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-light);
      background: var(--card);
    }

    .btn-auth {
      width: 100%;
      padding: 16px;
      background: linear-gradient(135deg, var(--primary), var(--primary-dark));
      color: white;
      border: none;
      border-radius: 14px;
      font-family: 'Tajawal';
      font-weight: 800;
      font-size: 1.1rem;
      cursor: pointer;
      transition: all 0.3s;
      box-shadow: 0 8px 20px rgba(79, 70, 229, .3);
      margin-top: 10px;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 8px;
    }

    .btn-auth:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-hover);
    }

    .auth-error {
      color: var(--red);
      font-size: 0.8rem;
      margin-top: 10px;
      font-weight: 600;
      text-align: center;
      display: none;
      padding: 10px;
      background: #fee2e2;
      border-radius: 10px;
    }

    /* NAVBAR */
    .navbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 14px 28px;
      margin-top: 20px;
      background: var(--navbar-bg);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1px solid var(--card-border);
      border-radius: 50px;
      position: sticky;
      top: 20px;
      z-index: 1000;
      box-shadow: var(--shadow-sm);
      transition: all 0.3s ease;
    }

    .logo {
      font-family: 'Tajawal', sans-serif;
      font-size: 1.6rem;
      font-weight: 800;
      color: var(--text);
      letter-spacing: -0.5px;
    }

    .logo span {
      color: var(--primary);
    }

    .nav-links {
      display: flex;
      gap: 12px;
      align-items: center;
      flex-wrap: wrap;
    }

    .user-profile {
      display: flex;
      align-items: center;
      gap: 10px;
      background: var(--primary-light);
      padding: 6px 16px;
      border-radius: 30px;
      font-weight: 700;
      font-size: 0.85rem;
      color: var(--primary-dark);
      border: 1px solid rgba(79, 70, 229, 0.2);
    }

    .btn-nav {
      background: var(--bg);
      color: var(--red);
      border: 1px solid var(--card-border);
      padding: 8px 18px;
      border-radius: 30px;
      font-weight: 700;
      font-size: .8rem;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .btn-nav:hover {
      background: #fee2e2;
      border-color: var(--red);
    }

    .btn-dark {
      background: var(--input-bg);
      border: 1px solid var(--card-border);
      color: var(--text);
      width: 42px;
      height: 42px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
      font-size: 1rem;
    }

    .btn-dark:hover {
      background: var(--primary-light);
      color: var(--primary);
      transform: rotate(15deg);
    }

    /* HERO */
    .hero {
      text-align: center;
      padding: 100px 0 60px;
    }

    .hero-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: var(--card);
      border: 1px solid var(--card-border);
      color: var(--primary);
      padding: 8px 20px;
      border-radius: 30px;
      font-size: .85rem;
      font-weight: 700;
      margin-bottom: 28px;
      box-shadow: var(--shadow-sm);
      animation: fadeInDown 0.6s ease-out;
    }

    .hero h1 {
      font-family: 'Tajawal', sans-serif;
      font-size: clamp(2.4rem, 6vw, 4.2rem);
      line-height: 1.2;
      margin-bottom: 24px;
      color: var(--text2);
      font-weight: 800;
      letter-spacing: -1px;
    }

    .gradient-text {
      background: linear-gradient(135deg, #4f46e5 0%, #db2777 50%, #f59e0b 100%);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }

    .hero p {
      color: var(--muted);
      font-size: 1.15rem;
      max-width: 650px;
      margin: 0 auto 40px;
      line-height: 1.8;
    }

    .hero-stats {
      display: flex;
      justify-content: center;
      gap: 50px;
      flex-wrap: wrap;
    }

    .stat-item {
      text-align: center;
      animation: fadeInUp 0.8s ease;
    }

    .stat-num {
      font-family: 'Tajawal';
      font-weight: 800;
      font-size: 2.2rem;
      color: var(--primary);
      line-height: 1;
    }

    .stat-label {
      font-size: .85rem;
      color: var(--muted);
      font-weight: 600;
      margin-top: 6px;
    }

    /* TABS */
    .tabs-nav {
      display: flex;
      gap: 8px;
      background: var(--card);
      padding: 8px;
      border-radius: 24px;
      border: 1px solid var(--card-border);
      margin: 40px 0;
      flex-wrap: wrap;
      box-shadow: var(--shadow-sm);
      overflow-x: auto;
    }

    .tab-btn {
      flex: 1;
      min-width: 100px;
      padding: 12px 16px;
      border-radius: 16px;
      border: none;
      background: transparent;
      color: var(--muted);
      font-family: 'Readex Pro';
      font-weight: 700;
      font-size: .85rem;
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      white-space: nowrap;
    }

    .tab-btn:hover {
      background: var(--input-bg);
      color: var(--text);
    }

    .tab-btn.active {
      background: var(--primary);
      color: white;
      box-shadow: 0 6px 15px rgba(79, 70, 229, 0.3);
      transform: translateY(-1px);
    }

    .tab-panel {
      display: none;
      animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
      opacity: 0;
    }

    .tab-panel.active {
      display: block;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(15px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes fadeInDown {
      from {
        opacity: 0;
        transform: translateY(-20px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes slideDown {
      from {
        opacity: 0;
        transform: translateY(-30px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* SECTION TITLE */
    .sec-title {
      display: flex;
      align-items: center;
      gap: 16px;
      margin: 0 0 30px;
    }

    .sec-title h2 {
      font-family: 'Tajawal', sans-serif;
      font-size: 1.8rem;
      font-weight: 800;
      white-space: nowrap;
      color: var(--text2);
    }

    .sec-title .line {
      flex: 1;
      height: 2px;
      background: linear-gradient(to left, transparent, var(--card-border));
    }

    /* CARDS */
    .card {
      background: var(--card);
      padding: 30px;
      border-radius: var(--r);
      border: 1px solid var(--card-border);
      transition: all 0.3s ease;
      display: flex;
      flex-direction: column;
      position: relative;
      overflow: hidden;
      box-shadow: var(--shadow-sm);
    }

    .card:hover {
      transform: translateY(-6px);
      box-shadow: var(--shadow-hover);
      border-color: var(--primary-light);
    }

    .card-icon {
      width: 54px;
      height: 54px;
      border-radius: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 20px;
      font-size: 1.4rem;
      transition: transform 0.3s ease;
    }

    .card:hover .card-icon {
      transform: scale(1.1);
    }

    .ci-purple {
      background: #eef2ff;
      color: var(--primary);
    }

    .ci-green {
      background: #ecfdf5;
      color: #10b981;
    }

    .ci-orange {
      background: #fff7ed;
      color: #f59e0b;
    }

    .ci-blue {
      background: #eff6ff;
      color: #3b82f6;
    }

    .ci-pink {
      background: #fdf2f8;
      color: #ec4899;
    }

    .ci-teal {
      background: #f0fdfa;
      color: #14b8a6;
    }

    .ci-red {
      background: #fff1f2;
      color: #f43f5e;
    }

    [data-theme="dark"] .ci-purple {
      background: #1e1b4b;
      color: #818cf8;
    }

    [data-theme="dark"] .ci-green {
      background: #064e3b;
      color: #34d399;
    }

    [data-theme="dark"] .ci-orange {
      background: #78350f;
      color: #fbbf24;
    }

    [data-theme="dark"] .ci-blue {
      background: #1e3a8a;
      color: #60a5fa;
    }

    [data-theme="dark"] .ci-pink {
      background: #831843;
      color: #f472b6;
    }

    [data-theme="dark"] .ci-teal {
      background: #134e4a;
      color: #2dd4bf;
    }

    [data-theme="dark"] .ci-red {
      background: #7f1d1d;
      color: #f87171;
    }

    .card h3 {
      font-size: 1.2rem;
      margin-bottom: 10px;
      color: var(--text2);
      font-weight: 700;
      line-height: 1.4;
    }

    .card p {
      color: var(--muted);
      font-size: .9rem;
      line-height: 1.7;
      flex: 1;
      margin-bottom: 20px;
    }

    .copy-box {
      background: var(--input-bg);
      padding: 14px 18px;
      border-radius: 14px;
      font-size: .85rem;
      border: 1px solid var(--input-border);
      border-right: 4px solid var(--primary);
      color: var(--text);
      line-height: 1.6;
      margin-bottom: 15px;
      direction: rtl;
      text-align: right;
    }

    .copy-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 10px 20px;
      background: var(--bg);
      color: var(--text);
      border-radius: 12px;
      font-size: .85rem;
      font-weight: 700;
      cursor: pointer;
      border: 1px solid var(--card-border);
      font-family: 'Readex Pro';
      transition: all 0.2s;
    }

    .copy-btn:hover {
      background: var(--primary);
      color: white;
      border-color: var(--primary);
    }

    /* GENERATOR */
    .generator-box {
      background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
      color: white;
      padding: 50px 45px;
      border-radius: 32px;
      position: relative;
      overflow: hidden;
      box-shadow: 0 30px 60px rgba(15, 23, 42, .4);
      margin-bottom: 50px;
    }

    .glow-orb {
      position: absolute;
      border-radius: 50%;
      filter: blur(80px);
      animation: floatOrb 8s ease-in-out infinite alternate;
      pointer-events: none;
    }

    .glow-orb-1 {
      width: 300px;
      height: 300px;
      background: rgba(99, 102, 241, .25);
      top: -100px;
      right: -100px;
    }

    .glow-orb-2 {
      width: 250px;
      height: 250px;
      background: rgba(236, 72, 153, .2);
      bottom: -80px;
      left: -80px;
      animation-delay: 4s;
    }

    @keyframes floatOrb {
      0% {
        transform: scale(1) translate(0, 0);
      }

      100% {
        transform: scale(1.2) translate(20px, -20px);
      }
    }

    .gen-header {
      text-align: center;
      margin-bottom: 40px;
      position: relative;
      z-index: 2;
    }

    .gen-title {
      font-family: 'Tajawal';
      font-size: 2.2rem;
      font-weight: 800;
      margin-bottom: 12px;
      letter-spacing: -0.5px;
    }

    .gen-subtitle {
      color: #94a3b8;
      font-size: 1rem;
    }

    .form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 24px;
      position: relative;
      z-index: 2;
    }

    .form-group {
      margin-bottom: 20px;
      position: relative;
      z-index: 2;
    }

    .form-group.full {
      grid-column: 1/-1;
    }

    label {
      display: block;
      margin-bottom: 10px;
      font-weight: 700;
      color: #cbd5e1;
      font-size: .9rem;
    }

    .input-field {
      width: 100%;
      padding: 14px 20px;
      border-radius: 16px;
      border: 2px solid rgba(255, 255, 255, 0.1);
      background: rgba(15, 23, 42, .6);
      color: white;
      font-size: 1rem;
      outline: none;
      font-family: 'Readex Pro';
      transition: all 0.3s;
      backdrop-filter: blur(10px);
    }

    .input-field::placeholder {
      color: #64748b;
    }

    .input-field:focus {
      border-color: var(--primary);
      background: rgba(15, 23, 42, .8);
      box-shadow: 0 0 0 4px rgba(99, 102, 241, .2);
    }

    .input-with-icon {
      position: relative;
    }

    .input-with-icon i {
      position: absolute;
      right: 18px;
      top: 50%;
      transform: translateY(-50%);
      color: #64748b;
      pointer-events: none;
    }

    .input-with-icon .input-field {
      padding-right: 48px;
    }

    .type-selector {
      display: flex;
      gap: 8px;
      background: rgba(15, 23, 42, .5);
      padding: 6px;
      border-radius: 16px;
      border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .type-option {
      flex: 1;
      padding: 12px 10px;
      text-align: center;
      cursor: pointer;
      border-radius: 12px;
      font-weight: 700;
      font-size: .9rem;
      transition: all 0.3s;
      color: #94a3b8;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      user-select: none;
    }

    .type-option:hover {
      color: #f8fafc;
      background: rgba(255, 255, 255, .05);
    }

    .type-option.active {
      background: var(--primary);
      color: white;
      box-shadow: 0 4px 15px rgba(79, 70, 229, .4);
    }

    .lang-selector {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .lang-pill {
      padding: 8px 18px;
      border-radius: 30px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: rgba(15, 23, 42, .5);
      color: #cbd5e1;
      font-size: .85rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      font-family: 'Readex Pro';
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .lang-pill:hover {
      border-color: rgba(255, 255, 255, 0.3);
      color: white;
      background: rgba(255, 255, 255, 0.05);
    }

    .lang-pill.active {
      background: var(--primary);
      border-color: var(--primary);
      color: white;
    }

    .suggestions-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 12px;
      min-height: 28px;
    }

    .sugg-chip {
      background: rgba(99, 102, 241, .15);
      color: #a5b4fc;
      padding: 6px 14px;
      border-radius: 20px;
      font-size: .8rem;
      cursor: pointer;
      border: 1px solid rgba(99, 102, 241, .3);
      transition: all 0.2s;
      font-weight: 600;
    }

    .sugg-chip:hover {
      background: rgba(99, 102, 241, .3);
      color: white;
    }

    .result-area {
      margin-top: 40px;
      position: relative;
      z-index: 2;
      animation: fadeIn 0.5s ease;
    }

    .result-card {
      background: rgba(255, 255, 255, .03);
      border-radius: 24px;
      border: 1px solid rgba(255, 255, 255, .08);
      padding: 30px;
      backdrop-filter: blur(12px);
    }

    .result-top {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 15px;
      margin-bottom: 15px;
      flex-wrap: wrap;
    }

    .project-title {
      font-size: 1.4rem;
      color: var(--accent);
      font-family: 'Tajawal';
      font-weight: 800;
    }

    .project-badge {
      padding: 6px 14px;
      border-radius: 20px;
      font-size: .8rem;
      font-weight: 700;
      background: rgba(99, 102, 241, .2);
      color: #a5b4fc;
      border: 1px solid rgba(99, 102, 241, .4);
      white-space: nowrap;
    }

    .project-desc {
      font-size: .95rem;
      color: #cbd5e1;
      line-height: 1.7;
      margin-bottom: 24px;
    }

    .prompt-preview {
      background: #020617;
      border-radius: 16px;
      padding: 16px 20px;
      font-size: .85rem;
      color: #94a3b8;
      margin-bottom: 24px;
      font-family: 'JetBrains Mono', monospace;
      line-height: 1.6;
      max-height: 85px;
      overflow: hidden;
      position: relative;
      border: 1px solid rgba(255, 255, 255, .05);
    }

    .prompt-preview::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 35px;
      background: linear-gradient(transparent, #020617);
    }

    .ai-buttons {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
    }

    .ai-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 14px;
      border-radius: 14px;
      text-decoration: none;
      font-weight: 700;
      font-size: .9rem;
      transition: all 0.2s;
      border: none;
      cursor: pointer;
      font-family: 'Readex Pro';
      white-space: nowrap;
    }

    .ai-btn:hover {
      transform: translateY(-3px);
    }

    .ai-btn-gpt {
      background: #10a37f;
      color: white;
    }

    .ai-btn-gpt:hover {
      background: #0d8a6a;
      box-shadow: 0 8px 20px rgba(16, 163, 127, .4);
    }

    .ai-btn-claude {
      background: #cc785c;
      color: white;
    }

    .ai-btn-claude:hover {
      background: #b8644a;
      box-shadow: 0 8px 20px rgba(204, 120, 92, .4);
    }

    .ai-btn-gemini {
      background: #4285f4;
      color: white;
    }

    .ai-btn-gemini:hover {
      background: #3274d9;
      box-shadow: 0 8px 20px rgba(66, 133, 244, .4);
    }

    .ai-btn-copy {
      background: rgba(255, 255, 255, .1);
      color: #f8fafc;
      border: 1px solid rgba(255, 255, 255, .15);
    }

    .ai-btn-copy:hover {
      background: rgba(255, 255, 255, .2);
    }

    .empty-state {
      text-align: center;
      padding: 50px 20px;
      color: #475569;
      border: 2px dashed rgba(255, 255, 255, 0.1);
      border-radius: 24px;
      margin-top: 35px;
      position: relative;
      z-index: 2;
      background: rgba(0, 0, 0, 0.2);
    }

    .empty-state i {
      font-size: 3rem;
      margin-bottom: 15px;
      display: block;
      opacity: 0.7;
    }

    .empty-state p {
      font-size: 1rem;
      font-weight: 600;
    }

    /* POMODORO */
    .pomodoro-wrap {
      display: grid;
      grid-template-columns: 1.2fr 1fr;
      gap: 30px;
      align-items: start;
    }

    .pomo-card {
      background: var(--card);
      border-radius: var(--r);
      border: 1px solid var(--card-border);
      padding: 40px;
      text-align: center;
      box-shadow: var(--shadow-md);
    }

    .pomo-modes {
      display: flex;
      gap: 8px;
      justify-content: center;
      margin-bottom: 35px;
    }

    .pomo-mode-btn {
      flex: 1;
      padding: 10px;
      border-radius: 12px;
      border: 1px solid var(--card-border);
      background: var(--bg);
      color: var(--muted);
      font-family: 'Readex Pro';
      font-weight: 700;
      font-size: .85rem;
      cursor: pointer;
      transition: all 0.2s;
    }

    .pomo-mode-btn.active {
      background: var(--primary);
      color: white;
      border-color: var(--primary);
      box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
    }

    .pomo-ring {
      position: relative;
      width: 220px;
      height: 220px;
      margin: 0 auto 30px;
    }

    .pomo-ring svg {
      transform: rotate(-90deg);
    }

    .pomo-ring circle {
      fill: none;
      stroke-width: 12;
    }

    .pomo-ring .track {
      stroke: var(--input-bg);
    }

    .pomo-ring .progress {
      stroke: var(--primary);
      stroke-linecap: round;
      transition: stroke-dashoffset 1s linear;
    }

    .pomo-time {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-family: 'JetBrains Mono';
      font-size: 3.2rem;
      font-weight: 700;
      color: var(--text);
      letter-spacing: -2px;
    }

    .pomo-label {
      font-size: .9rem;
      color: var(--muted);
      margin-top: 5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1px;
    }

    .pomo-btns {
      display: flex;
      gap: 12px;
      justify-content: center;
      margin-top: 30px;
    }

    .pomo-btn {
      padding: 14px 30px;
      border-radius: 16px;
      border: none;
      font-family: 'Readex Pro';
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      font-size: 1rem;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .pomo-btn-start {
      background: var(--primary);
      color: white;
      box-shadow: 0 8px 20px rgba(79, 70, 229, .3);
    }

    .pomo-btn-start:hover {
      background: var(--primary-dark);
      transform: translateY(-2px);
    }

    .pomo-btn-reset {
      background: var(--bg);
      color: var(--text);
      border: 1px solid var(--card-border);
    }

    .pomo-btn-reset:hover {
      background: var(--input-border);
    }

    .pomo-sessions {
      margin-top: 25px;
      display: flex;
      justify-content: center;
      gap: 10px;
    }

    .pomo-dot {
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: var(--input-border);
      transition: all 0.3s;
    }

    .pomo-dot.done {
      background: var(--primary);
      box-shadow: 0 0 10px var(--primary);
    }

    .pomo-stats {
      background: var(--card);
      border-radius: var(--r);
      border: 1px solid var(--card-border);
      padding: 30px;
      box-shadow: var(--shadow-sm);
    }

    .pomo-stats h3 {
      font-family: 'Tajawal';
      font-size: 1.2rem;
      margin-bottom: 20px;
      color: var(--text2);
      font-weight: 800;
    }

    .stat-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 0;
      border-bottom: 1px solid var(--divider);
    }

    .stat-row:last-child {
      border-bottom: none;
      padding-bottom: 0;
    }

    .stat-row .label {
      color: var(--muted);
      font-size: .9rem;
      font-weight: 600;
    }

    .stat-row .val {
      font-weight: 800;
      color: var(--primary);
      font-size: 1.2rem;
      font-family: 'Tajawal';
    }

    .pomo-tasks {
      margin-top: 25px;
    }

    .pomo-tasks h4 {
      font-weight: 800;
      color: var(--text2);
      margin-bottom: 15px;
      font-size: 1rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .clear-tasks-btn {
      font-size: 0.75rem;
      color: var(--red);
      background: none;
      border: none;
      cursor: pointer;
      font-family: 'Readex Pro';
      opacity: 0.8;
    }

    .clear-tasks-btn:hover {
      opacity: 1;
      text-decoration: underline;
    }

    .task-input-row {
      display: flex;
      gap: 10px;
      margin-bottom: 15px;
    }

    .task-input {
      flex: 1;
      padding: 12px 16px;
      border-radius: 12px;
      border: 1px solid var(--input-border);
      background: var(--input-bg);
      color: var(--text);
      font-family: 'Readex Pro';
      font-size: .9rem;
      outline: none;
      transition: all 0.2s;
    }

    .task-input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-light);
    }

    .task-add-btn {
      padding: 12px 18px;
      background: var(--primary);
      color: white;
      border: none;
      border-radius: 12px;
      cursor: pointer;
      font-size: 1rem;
      transition: all 0.2s;
      box-shadow: 0 4px 10px rgba(79, 70, 229, .2);
    }

    .task-add-btn:hover {
      background: var(--primary-dark);
      transform: translateY(-1px);
    }

    .task-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-height: 250px;
      overflow-y: auto;
      padding-right: 4px;
    }

    .task-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      background: var(--bg);
      border-radius: 12px;
      border: 1px solid var(--card-border);
      cursor: pointer;
      transition: all 0.2s;
    }

    .task-item:hover {
      border-color: var(--primary-light);
      background: var(--input-bg);
    }

    .task-item.done-task {
      opacity: .6;
      background: var(--bg);
    }

    .task-item.done-task .task-text {
      text-decoration: line-through;
      color: var(--muted);
    }

    .task-check {
      width: 22px;
      height: 22px;
      border-radius: 6px;
      border: 2px solid var(--input-border);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      transition: all 0.2s;
    }

    .task-item.done-task .task-check {
      background: var(--green);
      border-color: var(--green);
      color: white;
      font-size: .8rem;
    }

    .task-text {
      font-size: .9rem;
      color: var(--text);
      flex: 1;
      font-weight: 600;
    }

    .task-del {
      color: var(--muted);
      font-size: .9rem;
      cursor: pointer;
      padding: 4px 8px;
      transition: all 0.2s;
      border-radius: 6px;
    }

    .task-del:hover {
      color: var(--red);
      background: #fee2e2;
    }

    /* BOLOGNA GPA */
    .bologna-layout {
      display: grid;
      grid-template-columns: 1fr 340px;
      gap: 30px;
      align-items: start;
    }

    .bologna-box {
      background: var(--card);
      border-radius: var(--r);
      border: 1px solid var(--card-border);
      padding: 30px;
      box-shadow: var(--shadow-md);
    }

    .bologna-top-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 25px;
      flex-wrap: wrap;
      gap: 15px;
    }

    .bologna-top-bar h3 {
      font-family: 'Tajawal';
      font-size: 1.3rem;
      color: var(--text2);
      font-weight: 800;
    }

    .bologna-mode-toggle {
      display: flex;
      gap: 8px;
      background: var(--bg);
      padding: 4px;
      border-radius: 24px;
      border: 1px solid var(--card-border);
    }

    .bm-btn {
      padding: 8px 16px;
      border-radius: 20px;
      border: none;
      background: transparent;
      color: var(--muted);
      font-family: 'Readex Pro';
      font-size: .8rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
    }

    .bm-btn.active {
      background: var(--primary);
      color: white;
      box-shadow: 0 2px 8px rgba(79, 70, 229, .3);
    }

    .gpa-grid {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-bottom: 20px;
      max-height: 400px;
      overflow-y: auto;
      padding-left: 4px;
      padding-right: 4px;
    }

    .gpa-course {
      display: grid;
      grid-template-columns: 1fr 100px 70px 50px 36px;
      gap: 10px;
      align-items: center;
      background: var(--bg);
      border-radius: 14px;
      padding: 12px 14px;
      border: 1px solid var(--card-border);
      animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .gpa-course:focus-within {
      border-color: var(--primary-light);
      box-shadow: 0 0 0 3px var(--primary-light);
    }

    .gpa-course input[type="text"] {
      border: none;
      background: transparent;
      font-family: 'Readex Pro';
      font-size: .9rem;
      color: var(--text);
      outline: none;
      min-width: 0;
      width: 100%;
      font-weight: 600;
    }

    .gpa-course input[type="number"] {
      border: none;
      background: var(--card);
      border-radius: 8px;
      padding: 6px 10px;
      font-family: 'JetBrains Mono', monospace;
      font-size: .9rem;
      color: var(--text);
      outline: none;
      width: 100%;
      border: 1px solid var(--input-border);
      text-align: center;
      font-weight: 700;
    }

    .gpa-course input[type="number"]:focus {
      border-color: var(--primary);
    }

    .gpa-course input::placeholder {
      color: var(--muted);
      font-weight: 400;
      font-family: 'Readex Pro';
    }

    .gpa-course select {
      border: none;
      background: var(--card);
      border-radius: 8px;
      padding: 6px;
      font-family: 'JetBrains Mono', monospace;
      font-size: .9rem;
      color: var(--text);
      outline: none;
      cursor: pointer;
      border: 1px solid var(--input-border);
      width: 100%;
      font-weight: 700;
    }

    .ects-badge {
      background: var(--input-bg);
      color: var(--muted);
      border-radius: 8px;
      font-size: .8rem;
      font-weight: 800;
      padding: 6px 0;
      text-align: center;
      font-family: 'JetBrains Mono';
    }

    .del-btn {
      background: none;
      border: none;
      cursor: pointer;
      color: var(--muted);
      font-size: 1rem;
      padding: 6px;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
    }

    .del-btn:hover {
      color: var(--red);
      background: #fee2e2;
    }

    .gpa-col-headers {
      display: grid;
      grid-template-columns: 1fr 100px 70px 50px 36px;
      gap: 10px;
      padding: 0 14px 10px;
      font-size: .8rem;
      color: var(--muted);
      font-weight: 700;
    }

    .gpa-actions {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      margin-top: 10px;
      padding-top: 20px;
      border-top: 1px solid var(--divider);
    }

    .btn-add-course {
      background: var(--bg);
      border: 1px dashed var(--muted);
      border-radius: 12px;
      padding: 12px 20px;
      font-family: 'Readex Pro';
      font-weight: 700;
      color: var(--text2);
      cursor: pointer;
      transition: all 0.2s;
      font-size: .9rem;
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 1;
      justify-content: center;
    }

    .btn-add-course:hover {
      border-color: var(--primary);
      color: var(--primary);
      background: var(--primary-light);
    }

    .btn-calc-gpa {
      background: linear-gradient(135deg, var(--primary), var(--primary-dark));
      color: white;
      border: none;
      border-radius: 12px;
      padding: 12px 24px;
      font-family: 'Readex Pro';
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      font-size: .9rem;
      box-shadow: 0 4px 15px rgba(79, 70, 229, .3);
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 2;
      justify-content: center;
    }

    .btn-calc-gpa:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-hover);
    }

    .btn-clear-gpa {
      background: var(--bg);
      border: 1px solid var(--card-border);
      border-radius: 12px;
      padding: 12px 20px;
      font-family: 'Readex Pro';
      font-weight: 700;
      color: var(--muted);
      cursor: pointer;
      transition: all 0.2s;
      font-size: .9rem;
    }

    .btn-clear-gpa:hover {
      border-color: var(--red);
      color: var(--red);
      background: #fff1f2;
    }

    .bologna-result {
      margin-top: 25px;
      border-radius: 20px;
      display: none;
      animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
      overflow: hidden;
      box-shadow: var(--shadow-md);
      border: 1px solid var(--card-border);
    }

    .bologna-result-header {
      padding: 25px 30px;
      display: flex;
      align-items: center;
      gap: 24px;
      flex-wrap: wrap;
    }

    .bologna-result.grade-a .bologna-result-header {
      background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    }

    .bologna-result.grade-b .bologna-result-header {
      background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    }

    .bologna-result.grade-c .bologna-result-header {
      background: linear-gradient(135deg, #fef9c3, #fef08a);
    }

    .bologna-result.grade-d .bologna-result-header {
      background: linear-gradient(135deg, #ffedd5, #fed7aa);
    }

    .bologna-result.grade-f .bologna-result-header {
      background: linear-gradient(135deg, #fee2e2, #fecaca);
    }

    .b-grade-circle {
      width: 90px;
      height: 90px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: 'JetBrains Mono';
      font-size: 3rem;
      font-weight: 800;
      flex-shrink: 0;
      box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    }

    .grade-a .b-grade-circle {
      background: #16a34a;
      color: white;
    }

    .grade-b .b-grade-circle {
      background: #2563eb;
      color: white;
    }

    .grade-c .b-grade-circle {
      background: #ca8a04;
      color: white;
    }

    .grade-d .b-grade-circle {
      background: #ea580c;
      color: white;
    }

    .grade-f .b-grade-circle {
      background: #dc2626;
      color: white;
    }

    .b-avg {
      font-size: 2.8rem;
      font-family: 'JetBrains Mono';
      font-weight: 800;
      color: #0f172a;
      line-height: 1;
      letter-spacing: -1px;
    }

    .b-label {
      font-size: .85rem;
      color: #475569;
      margin-top: 6px;
      font-weight: 700;
      text-transform: uppercase;
    }

    .b-status {
      font-weight: 800;
      font-size: 1.1rem;
      color: #0f172a;
      margin-top: 8px;
      background: rgba(255, 255, 255, 0.5);
      padding: 4px 12px;
      border-radius: 20px;
      display: inline-block;
    }

    .bologna-result-stats {
      padding: 20px 30px;
      background: var(--card);
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 20px;
      border-top: 1px solid var(--divider);
    }

    .b-stat {
      text-align: center;
      padding: 15px;
      background: var(--bg);
      border-radius: 16px;
      border: 1px solid var(--card-border);
    }

    .b-stat-val {
      font-family: 'JetBrains Mono';
      font-size: 1.8rem;
      font-weight: 800;
      color: var(--primary);
    }

    .b-stat-label {
      font-size: .8rem;
      color: var(--muted);
      margin-top: 4px;
      font-weight: 700;
    }

    .ects-progress-wrap {
      padding: 20px 30px 25px;
      background: var(--card);
      border-top: 1px solid var(--divider);
    }

    .ects-prog-label {
      display: flex;
      justify-content: space-between;
      font-size: .85rem;
      color: var(--text2);
      margin-bottom: 10px;
      font-weight: 700;
    }

    .ects-prog-bar-bg {
      height: 12px;
      background: var(--input-bg);
      border-radius: 10px;
      overflow: hidden;
      box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .ects-prog-bar {
      height: 100%;
      background: linear-gradient(90deg, var(--primary), #d946ef);
      border-radius: 10px;
      transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      overflow: hidden;
    }

    .ects-prog-bar::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 100%);
      animation: shimmer 2s infinite;
    }

    @keyframes shimmer {
      0% {
        transform: translateX(-100%);
      }

      100% {
        transform: translateX(100%);
      }
    }

    .quick-subjects {
      margin-bottom: 20px;
      padding: 15px;
      background: var(--bg);
      border-radius: 16px;
      border: 1px solid var(--card-border);
    }

    .quick-subjects h4 {
      font-size: .9rem;
      font-weight: 800;
      color: var(--text2);
      margin-bottom: 12px;
    }

    .year-group {
      margin-bottom: 15px;
    }

    .year-label {
      font-size: .8rem;
      font-weight: 800;
      color: var(--primary);
      margin-bottom: 8px;
      background: var(--primary-light);
      padding: 4px 12px;
      border-radius: 20px;
      display: inline-block;
    }

    .subj-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .subj-chip {
      padding: 6px 12px;
      background: var(--card);
      border: 1px solid var(--card-border);
      border-radius: 20px;
      font-size: .8rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      color: var(--text2);
      display: flex;
      align-items: center;
      gap: 6px;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    .subj-chip:hover {
      border-color: var(--primary);
      color: var(--primary);
      transform: translateY(-1px);
      box-shadow: 0 4px 6px rgba(79, 70, 229, 0.1);
    }

    .subj-chip .chip-ects {
      background: var(--input-bg);
      color: var(--muted);
      border-radius: 10px;
      padding: 2px 8px;
      font-weight: 800;
      font-size: .7rem;
      font-family: 'JetBrains Mono';
    }

    .gpa-scale {
      background: var(--card);
      border-radius: var(--r);
      border: 1px solid var(--card-border);
      padding: 25px;
      box-shadow: var(--shadow-sm);
    }

    .gpa-scale h3 {
      font-family: 'Tajawal';
      font-size: 1.1rem;
      margin-bottom: 18px;
      color: var(--text2);
      font-weight: 800;
    }

    .scale-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 0;
      border-bottom: 1px solid var(--divider);
      font-size: .85rem;
    }

    .scale-row:last-child {
      border-bottom: none;
      padding-bottom: 0;
    }

    .scale-grade {
      font-weight: 800;
      color: var(--text2);
    }

    .scale-letter {
      color: var(--muted);
      font-family: 'JetBrains Mono';
    }

    .scale-gpa {
      font-weight: 800;
      color: var(--primary);
      font-family: 'JetBrains Mono';
    }

    /* DEADLINES */
    .deadline-layout {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 30px;
      align-items: start;
    }

    .deadline-form {
      background: var(--card);
      border-radius: var(--r);
      border: 1px solid var(--card-border);
      padding: 30px;
      box-shadow: var(--shadow-md);
    }

    .deadline-form h3 {
      font-family: 'Tajawal';
      font-size: 1.3rem;
      margin-bottom: 24px;
      color: var(--text2);
      font-weight: 800;
    }

    .dl-input,
    .dl-select {
      width: 100%;
      padding: 14px 18px;
      border-radius: 14px;
      border: 1px solid var(--input-border);
      background: var(--input-bg);
      color: var(--text);
      font-family: 'Readex Pro';
      font-size: .9rem;
      outline: none;
      margin-bottom: 16px;
      transition: all 0.2s;
      font-weight: 600;
    }

    .dl-input:focus,
    .dl-select:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-light);
      background: var(--card);
    }

    .btn-add-dl {
      width: 100%;
      padding: 14px;
      background: linear-gradient(135deg, var(--primary), var(--primary-dark));
      color: white;
      border: none;
      border-radius: 14px;
      font-family: 'Readex Pro';
      font-weight: 800;
      cursor: pointer;
      transition: all 0.3s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      font-size: 1rem;
      box-shadow: 0 8px 20px rgba(79, 70, 229, .3);
    }

    .btn-add-dl:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-hover);
    }

    .deadline-list {
      background: var(--card);
      border-radius: var(--r);
      border: 1px solid var(--card-border);
      padding: 30px;
      box-shadow: var(--shadow-md);
    }

    .deadline-list h3 {
      font-family: 'Tajawal';
      font-size: 1.3rem;
      margin-bottom: 20px;
      color: var(--text2);
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-weight: 800;
    }

    .dl-count {
      background: var(--primary-light);
      color: var(--primary-dark);
      padding: 4px 12px;
      border-radius: 20px;
      font-size: .85rem;
      font-weight: 800;
    }

    .dl-items {
      display: flex;
      flex-direction: column;
      gap: 12px;
      max-height: 450px;
      overflow-y: auto;
      padding-right: 4px;
    }

    .dl-item {
      padding: 16px;
      border-radius: 16px;
      border: 1px solid var(--card-border);
      background: var(--bg);
      display: flex;
      align-items: center;
      gap: 14px;
      transition: all 0.3s;
      animation: fadeIn 0.3s ease;
    }

    .dl-item:hover {
      border-color: var(--primary-light);
      box-shadow: var(--shadow-sm);
      transform: translateX(-2px);
    }

    .dl-priority {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      border-radius: 12px;
      font-family: 'JetBrains Mono';
      font-size: .9rem;
      font-weight: 800;
      flex-shrink: 0;
    }

    .dl-priority.p-critical {
      background: #fee2e2;
      color: #dc2626;
      border: 2px solid #fca5a5;
    }

    .dl-priority.p-high {
      background: #ffedd5;
      color: #ea580c;
      border: 2px solid #fdba74;
    }

    .dl-priority.p-mid {
      background: #fef9c3;
      color: #ca8a04;
      border: 2px solid #fde047;
    }

    .dl-priority.p-low {
      background: #f0fdf4;
      color: #16a34a;
      border: 2px solid #86efac;
    }

    .dl-info {
      flex: 1;
      min-width: 0;
    }

    .dl-name {
      font-weight: 800;
      font-size: 1rem;
      color: var(--text2);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .dl-sub {
      font-size: .8rem;
      color: var(--muted);
      margin-top: 4px;
      font-weight: 600;
    }

    .dl-days {
      font-weight: 800;
      font-size: .85rem;
      padding: 6px 12px;
      border-radius: 20px;
      white-space: nowrap;
      font-family: 'JetBrains Mono';
    }

    .dl-days.urgent {
      background: #fee2e2;
      color: #dc2626;
    }

    .dl-days.soon {
      background: #ffedd5;
      color: #ea580c;
    }

    .dl-days.ok {
      background: #dcfce7;
      color: #16a34a;
    }

    .dl-del {
      color: var(--muted);
      cursor: pointer;
      font-size: 1rem;
      transition: all 0.2s;
      padding: 8px;
      border-radius: 8px;
      background: var(--input-bg);
    }

    .dl-del:hover {
      color: var(--red);
      background: #fee2e2;
    }

    .dl-empty {
      text-align: center;
      padding: 40px 20px;
      color: var(--muted);
      font-size: .9rem;
      font-weight: 600;
      background: var(--bg);
      border-radius: 16px;
      border: 2px dashed var(--card-border);
    }

    .dl-empty i {
      font-size: 2.5rem;
      margin-bottom: 12px;
      display: block;
      opacity: .5;
    }

    /* SNIPPETS */
    .snippet-filters {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 25px;
    }

    .filter-btn {
      padding: 10px 20px;
      border-radius: 30px;
      border: 1px solid var(--card-border);
      background: var(--card);
      color: var(--text2);
      font-family: 'Readex Pro';
      font-weight: 800;
      font-size: .85rem;
      cursor: pointer;
      transition: all 0.2s;
      box-shadow: var(--shadow-sm);
    }

    .filter-btn:hover {
      border-color: var(--primary);
      color: var(--primary);
      transform: translateY(-1px);
    }

    .filter-btn.active {
      background: var(--primary);
      color: white;
      border-color: var(--primary);
      box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    }

    .snippets-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
      gap: 24px;
    }

    .snippet-card {
      background: var(--card);
      border-radius: 24px;
      border: 1px solid var(--card-border);
      overflow: hidden;
      transition: all 0.3s;
      box-shadow: var(--shadow-sm);
      display: flex;
      flex-direction: column;
    }

    .snippet-card:hover {
      transform: translateY(-5px);
      box-shadow: var(--shadow-md);
      border-color: var(--primary-light);
    }

    .snippet-head {
      padding: 18px 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--divider);
      background: var(--bg);
    }

    .snippet-title {
      font-weight: 800;
      font-size: 1rem;
      color: var(--text2);
    }

    .snippet-lang-tag {
      padding: 6px 14px;
      border-radius: 20px;
      font-size: .75rem;
      font-weight: 800;
      font-family: 'JetBrains Mono';
    }

    .snippet-code {
      background: var(--code-bg);
      padding: 20px 24px;
      font-family: 'JetBrains Mono', monospace;
      font-size: .85rem;
      line-height: 1.7;
      color: #e2e8f0;
      overflow-x: auto;
      margin: 0;
      white-space: pre;
      display: block;
      flex: 1;
    }

    .snippet-footer {
      padding: 14px 24px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: var(--bg);
      border-top: 1px solid var(--divider);
    }

    .snippet-desc {
      font-size: .85rem;
      color: var(--muted);
      font-weight: 600;
    }

    .copy-snip-btn {
      padding: 8px 16px;
      background: var(--primary-light);
      color: var(--primary-dark);
      border-radius: 12px;
      font-size: .8rem;
      font-weight: 800;
      cursor: pointer;
      border: none;
      font-family: 'Readex Pro';
      transition: all 0.2s;
      display: flex;
      gap: 6px;
      align-items: center;
    }

    .copy-snip-btn:hover {
      background: var(--primary);
      color: white;
    }

    /* PROMPTS GRID */
    .grid-prompts {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      gap: 24px;
    }

    /* RANKING */
    .ranking-container {
      background: var(--card);
      border-radius: var(--r);
      padding: 35px;
      box-shadow: var(--shadow-md);
      border: 1px solid var(--card-border);
      margin-bottom: 50px;
    }

    .ranking-head {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 0 10px 25px;
      border-bottom: 2px solid var(--divider);
      font-family: 'Tajawal';
      font-weight: 800;
      font-size: 1.4rem;
      color: var(--text2);
    }

    .ranking-row {
      display: flex;
      gap: 20px;
      padding: 30px 10px;
      border-bottom: 1px solid var(--divider);
      align-items: flex-start;
      transition: all 0.3s;
    }

    .ranking-row:last-child {
      border-bottom: none;
      padding-bottom: 0;
    }

    .ranking-row:hover {
      background: var(--bg);
      border-radius: 16px;
      padding: 30px 20px;
      margin: 0 -10px;
    }

    .rank-number {
      font-size: 2.5rem;
      font-weight: 900;
      min-width: 45px;
      font-family: 'JetBrains Mono';
    }

    .rn1 {
      background: linear-gradient(135deg, #6366f1, #a855f7);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .rn2 {
      background: linear-gradient(135deg, #f59e0b, #ef4444);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .rn3 {
      background: linear-gradient(135deg, #10b981, #06b6d4);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .rn4 {
      color: #94a3b8;
      -webkit-text-fill-color: initial;
    }

    .rank-content {
      flex: 1;
    }

    .rank-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 14px;
      flex-wrap: wrap;
      gap: 10px;
    }

    .rank-category {
      font-weight: 800;
      font-size: 1.1rem;
      color: var(--text2);
      font-family: 'Tajawal';
    }

    .rank-tool {
      background: var(--primary-light);
      color: var(--primary-dark);
      padding: 8px 20px;
      border-radius: 50px;
      font-size: .85rem;
      font-weight: 800;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      text-decoration: none;
      transition: all 0.2s;
      border: 1px solid rgba(79, 70, 229, 0.2);
    }

    .rank-tool:hover {
      background: var(--primary);
      color: white;
      transform: translateY(-2px);
      box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
    }

    .rank-analysis {
      font-size: .95rem;
      color: var(--text);
      background: var(--input-bg);
      padding: 16px 20px;
      border-radius: 16px;
      border-right: 4px solid var(--primary);
      line-height: 1.7;
      font-weight: 600;
    }

    .analysis-label {
      font-weight: 800;
      color: var(--primary);
      font-size: .85rem;
      display: block;
      margin-bottom: 6px;
    }

    /* CTA */
    .instruction-text {
      text-align: center;
      background: #e0f2fe;
      color: #0369a1;
      padding: 14px 20px;
      border-radius: 16px;
      margin-bottom: 30px;
      font-size: .95rem;
      font-weight: 700;
      border: 1px solid #bae6fd;
      box-shadow: 0 4px 10px rgba(14, 165, 233, 0.1);
    }

    [data-theme="dark"] .instruction-text {
      background: #0c4a6e;
      color: #7dd3fc;
      border-color: #0284c7;
    }

    .cta-box {
      background: linear-gradient(135deg, #1e1b4b, #312e81);
      color: white;
      padding: 60px 40px;
      border-radius: 32px;
      margin: 40px 0;
      text-align: center;
      position: relative;
      overflow: hidden;
      box-shadow: 0 20px 40px rgba(30, 27, 75, 0.4);
    }

    .cta-box::before {
      content: '';
      position: absolute;
      top: -100px;
      left: 50%;
      transform: translateX(-50%);
      width: 500px;
      height: 500px;
      background: radial-gradient(circle, rgba(99, 102, 241, .3) 0%, transparent 70%);
      border-radius: 50%;
      filter: blur(40px);
      z-index: 0;
      pointer-events: none;
    }

    .cta-box h2 {
      font-family: 'Tajawal';
      font-size: 2.4rem;
      font-weight: 800;
      margin-bottom: 12px;
      position: relative;
      z-index: 1;
    }

    .cta-box p {
      color: #cbd5e1;
      margin-bottom: 30px;
      position: relative;
      font-size: 1.1rem;
      z-index: 1;
    }

    .input-group {
      display: flex;
      max-width: 500px;
      margin: 0 auto;
      background: rgba(255, 255, 255, .1);
      padding: 6px;
      border-radius: 50px;
      border: 1px solid rgba(255, 255, 255, .2);
      position: relative;
      backdrop-filter: blur(10px);
    }

    .input-group input {
      flex: 1;
      border: none;
      padding: 14px 24px;
      outline: none;
      border-radius: 50px;
      font-family: 'Readex Pro';
      background: transparent;
      color: white;
      font-size: 1rem;
      font-weight: 600;
    }

    .input-group input::placeholder {
      color: #94a3b8;
    }

    .btn-submit {
      background: var(--primary);
      color: white;
      border: none;
      padding: 14px 32px;
      border-radius: 50px;
      font-weight: 800;
      cursor: pointer;
      font-family: 'Readex Pro';
      transition: all 0.3s;
      white-space: nowrap;
      font-size: 1rem;
      box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    }

    .btn-submit:hover {
      background: var(--primary-dark);
      transform: scale(1.05);
    }

    #ctaEmail::placeholder {
      color: rgba(255, 255, 255, 0.5);
      -webkit-text-fill-color: rgba(255, 255, 255, 0.5);
    }
    #ctaEmail:focus {
      background: rgba(255, 255, 255, 0.2);
      outline: 2px solid rgba(255, 255, 255, 0.3);
    }

    /* TOAST */
    .toast {
      position: fixed;
      bottom: 30px;
      left: 50%;
      transform: translateX(-50%) translateY(100px);
      opacity: 0;
      display: none;
      background: #0f172a;
      color: white;
      padding: 14px 28px;
      border-radius: 50px;
      font-size: .95rem;
      font-weight: 700;
      box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
      z-index: 99999;
      align-items: center;
      gap: 12px;
      cursor: pointer;
      border: 1px solid #334155;
      max-width: 90vw;
    }

    .toast i {
      color: var(--green);
      font-size: 1.2rem;
    }

    @media(max-width: 768px) {
      .toast {
        bottom: 80px;
        font-size: .85rem;
        padding: 12px 20px;
        max-width: 85vw;
      }
    }

    /* SEARCH */
    .search-trigger {
      background: var(--input-bg);
      border: 1px solid var(--card-border);
      border-radius: 30px;
      padding: 8px 16px;
      display: flex;
      align-items: center;
      gap: 10px;
      cursor: pointer;
      font-family: 'Readex Pro';
      font-size: .85rem;
      color: var(--muted);
      transition: all 0.2s;
      min-width: 180px;
      font-weight: 600;
    }

    .search-trigger:hover {
      border-color: var(--primary);
      color: var(--primary);
      background: var(--primary-light);
    }

    .search-trigger kbd {
      background: var(--card);
      border: 1px solid var(--card-border);
      border-radius: 6px;
      padding: 2px 8px;
      font-size: .75rem;
      font-family: 'JetBrains Mono';
      color: var(--text2);
      box-shadow: 0 2px 0 var(--card-border);
    }

    .search-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, .7);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      z-index: 9990;
      display: none;
      align-items: flex-start;
      justify-content: center;
      padding-top: 10vh;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .search-overlay.open {
      display: flex;
      opacity: 1;
    }

    .search-modal {
      background: var(--card);
      border-radius: 24px;
      width: 90%;
      max-width: 650px;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .5);
      overflow: hidden;
      transform: scale(0.95);
      transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      border: 1px solid var(--card-border);
    }

    .search-overlay.open .search-modal {
      transform: scale(1);
    }

    .search-modal-header {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 20px 24px;
      border-bottom: 1px solid var(--divider);
      background: var(--bg);
    }

    .search-modal-header i {
      color: var(--primary);
      font-size: 1.4rem;
    }

    .search-big-input {
      flex: 1;
      border: none;
      background: transparent;
      font-family: 'Readex Pro';
      font-size: 1.1rem;
      color: var(--text);
      outline: none;
      font-weight: 600;
    }

    .search-big-input::placeholder {
      color: var(--muted);
      font-weight: 400;
    }

    .search-close-btn {
      background: var(--input-bg);
      border: 1px solid var(--card-border);
      border-radius: 10px;
      padding: 6px 12px;
      cursor: pointer;
      color: var(--text2);
      font-size: .8rem;
      font-family: 'JetBrains Mono';
      font-weight: 800;
      transition: all 0.2s;
    }

    .search-close-btn:hover {
      background: var(--red);
      color: white;
      border-color: var(--red);
    }

    .search-results {
      max-height: 60vh;
      overflow-y: auto;
      padding: 12px 0;
    }

    .search-cat-label {
      padding: 12px 24px 8px;
      font-size: .75rem;
      font-weight: 800;
      color: var(--primary);
      text-transform: uppercase;
      letter-spacing: 1px;
      background: var(--bg);
    }

    .search-item {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 12px 24px;
      cursor: pointer;
      transition: all 0.2s;
      border-radius: 0;
    }

    .search-item:hover {
      background: var(--input-bg);
      padding-right: 30px;
    }

    .search-item-icon {
      width: 40px;
      height: 40px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.1rem;
      flex-shrink: 0;
    }

    .search-item-text {
      flex: 1;
      min-width: 0;
    }

    .search-item-name {
      font-weight: 800;
      font-size: .95rem;
      color: var(--text2);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .search-item-sub {
      font-size: .8rem;
      color: var(--muted);
      font-weight: 600;
      margin-top: 2px;
    }

    .search-item-arrow {
      color: var(--muted);
      font-size: .9rem;
      opacity: 0;
      transform: translateX(-10px);
      transition: all 0.2s;
    }

    .search-item:hover .search-item-arrow {
      opacity: 1;
      transform: translateX(0);
      color: var(--primary);
    }

    .search-empty {
      text-align: center;
      padding: 50px 20px;
      color: var(--muted);
    }

    .search-empty i {
      font-size: 3rem;
      display: block;
      margin-bottom: 15px;
      opacity: .3;
    }

    .search-empty p {
      font-size: 1rem;
      font-weight: 600;
    }

    .search-hint-bar {
      display: flex;
      gap: 20px;
      padding: 14px 24px;
      border-top: 1px solid var(--divider);
      font-size: .8rem;
      color: var(--muted);
      background: var(--bg);
      font-weight: 600;
    }

    .search-hint-bar kbd {
      background: var(--card);
      border: 1px solid var(--card-border);
      border-radius: 6px;
      padding: 2px 8px;
      font-family: 'JetBrains Mono';
      font-size: .75rem;
      color: var(--text2);
      box-shadow: 0 2px 0 var(--card-border);
    }

    /* STUDY PLAN */
    .plan-layout {
      display: grid;
      grid-template-columns: 350px 1fr;
      gap: 30px;
      align-items: start;
    }

    .plan-config {
      background: var(--card);
      border-radius: var(--r);
      border: 1px solid var(--card-border);
      padding: 30px;
      box-shadow: var(--shadow-md);
    }

    .plan-config h3 {
      font-family: 'Tajawal';
      font-size: 1.2rem;
      color: var(--text2);
      margin-bottom: 20px;
      font-weight: 800;
    }

    .plan-field {
      margin-bottom: 18px;
    }

    .plan-field label {
      display: block;
      font-size: .85rem;
      font-weight: 800;
      color: var(--text2);
      margin-bottom: 8px;
    }

    .plan-field input,
    .plan-field select {
      width: 100%;
      padding: 12px 16px;
      border-radius: 14px;
      border: 1px solid var(--input-border);
      background: var(--input-bg);
      font-family: 'Readex Pro';
      font-size: .9rem;
      color: var(--text);
      outline: none;
      transition: all 0.2s;
      font-weight: 600;
    }

    .plan-field input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-light);
      background: var(--card);
    }

    .plan-subjects-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      max-height: 250px;
      overflow-y: auto;
      padding: 4px 0;
      align-content: flex-start;
    }

    .plan-chip {
      padding: 8px 14px;
      border-radius: 20px;
      font-size: .8rem;
      border: 1px solid var(--input-border);
      cursor: pointer;
      transition: all 0.2s;
      color: var(--text2);
      background: var(--bg);
      font-weight: 600;
    }

    .plan-chip.selected {
      background: var(--primary);
      color: white;
      border-color: var(--primary);
      box-shadow: 0 4px 10px rgba(79, 70, 229, .3);
      transform: translateY(-1px);
    }

    .plan-chip:hover:not(.selected) {
      border-color: var(--primary);
      color: var(--primary);
    }

    .btn-gen-plan {
      width: 100%;
      background: linear-gradient(135deg, var(--primary), var(--primary-dark));
      color: white;
      border: none;
      border-radius: 14px;
      padding: 14px;
      font-family: 'Tajawal';
      font-size: 1.1rem;
      font-weight: 800;
      cursor: pointer;
      margin-top: 10px;
      box-shadow: 0 8px 20px rgba(79, 70, 229, .3);
      transition: all 0.3s;
      display: flex;
      justify-content: center;
      gap: 8px;
      align-items: center;
    }

    .btn-gen-plan:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-hover);
    }

    .plan-output {
      display: none;
      animation: fadeIn 0.5s ease;
    }

    .plan-output.visible {
      display: block;
    }

    .plan-summary-row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      margin-bottom: 24px;
    }

    .plan-stat-card {
      background: var(--card);
      border-radius: 16px;
      border: 1px solid var(--card-border);
      padding: 16px 10px;
      text-align: center;
      box-shadow: var(--shadow-sm);
      min-width: 0;
    }

    .plan-stat-num {
      font-family: 'JetBrains Mono';
      font-size: clamp(1.4rem, 4vw, 2rem);
      font-weight: 800;
      color: var(--primary);
      line-height: 1;
    }

    .plan-stat-lbl {
      font-size: clamp(.7rem, 2.5vw, .85rem);
      color: var(--muted);
      margin-top: 6px;
      font-weight: 700;
    }

    .plan-bars {
      background: var(--card);
      border-radius: var(--r);
      border: 1px solid var(--card-border);
      padding: 30px;
      box-shadow: var(--shadow-sm);
      margin-bottom: 24px;
    }

    .plan-bars h3 {
      font-family: 'Tajawal';
      font-size: 1.2rem;
      margin-bottom: 20px;
      color: var(--text2);
      font-weight: 800;
    }

    .plan-bar-row {
      display: flex;
      align-items: center;
      gap: 15px;
      margin-bottom: 15px;
    }

    .plan-bar-name {
      font-size: .85rem;
      font-weight: 800;
      color: var(--text2);
      width: clamp(100px, 22%, 200px);
      flex-shrink: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .plan-bar-bg {
      flex: 1;
      height: 14px;
      background: var(--input-bg);
      border-radius: 10px;
      overflow: hidden;
      box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .plan-bar-fill {
      height: 100%;
      border-radius: 10px;
      transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .plan-bar-val {
      font-size: .85rem;
      color: var(--text2);
      font-family: 'JetBrains Mono';
      width: 70px;
      text-align: left;
      flex-shrink: 0;
      font-weight: 700;
    }

    .plan-week {
      background: var(--card);
      border-radius: var(--r);
      border: 1px solid var(--card-border);
      padding: 30px;
      box-shadow: var(--shadow-sm);
    }

    .plan-week h3 {
      font-family: 'Tajawal';
      font-size: 1.2rem;
      margin-bottom: 20px;
      color: var(--text2);
      font-weight: 800;
    }

    .plan-week-scroll {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      width: 100%;
    }

    .plan-week-grid {
      display: grid;
      grid-template-columns: 160px repeat(7, minmax(52px, 1fr));
      gap: 5px;
      min-width: 580px;
    }

    .pwg-header {
      font-size: .8rem;
      font-weight: 800;
      color: var(--muted);
      text-align: center;
      padding: 10px 4px;
      background: var(--bg);
      border-radius: 8px;
    }

    .pwg-label {
      font-size: .8rem;
      font-weight: 800;
      color: var(--text2);
      display: flex;
      align-items: center;
      padding: 8px;
      background: var(--bg);
      border-radius: 8px;
    }

    .pwg-cell {
      border-radius: 8px;
      padding: 8px 4px;
      text-align: center;
      font-size: .75rem;
      font-weight: 800;
      color: white;
      min-height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: 'JetBrains Mono';
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      transition: transform 0.2s;
    }

    .pwg-cell:hover {
      transform: scale(1.05);
    }

    .pwg-cell.empty {
      background: var(--input-bg);
      color: var(--muted);
      box-shadow: none;
      font-weight: 600;
    }

    .pwg-cell.empty:hover {
      transform: none;
    }

    /* HISTORY */
    .gen-history {
      margin-top: 30px;
      padding-top: 20px;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .gen-history-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 15px;
    }

    .gen-history-title {
      font-size: .9rem;
      font-weight: 700;
      color: #cbd5e1;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .gen-history-clear {
      background: none;
      border: none;
      cursor: pointer;
      font-size: .8rem;
      color: #94a3b8;
      font-family: 'Readex Pro';
      transition: all 0.2s;
      font-weight: 600;
      padding: 4px 8px;
      border-radius: 6px;
    }

    .gen-history-clear:hover {
      color: #f87171;
      background: rgba(248, 113, 113, 0.1);
    }

    .history-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .history-item {
      display: flex;
      align-items: center;
      gap: 14px;
      background: rgba(15, 23, 42, .4);
      border: 1px solid rgba(255, 255, 255, .05);
      border-radius: 14px;
      padding: 12px 16px;
      cursor: pointer;
      transition: all 0.2s;
      animation: fadeIn 0.3s ease;
    }

    .history-item:hover {
      border-color: var(--primary);
      background: rgba(79, 70, 229, .1);
      transform: translateX(-4px);
    }

    .history-badge {
      padding: 4px 10px;
      border-radius: 20px;
      font-size: .75rem;
      font-weight: 800;
      white-space: nowrap;
    }

    .hb-report {
      background: rgba(79, 70, 229, .2);
      color: #a5b4fc;
    }

    .hb-code {
      background: rgba(16, 185, 129, .2);
      color: #6ee7b7;
    }

    .hb-assignment {
      background: rgba(245, 158, 11, .2);
      color: #fcd34d;
    }

    .history-text {
      flex: 1;
      font-size: .85rem;
      color: #f8fafc;
      font-weight: 700;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .history-time {
      font-size: .75rem;
      color: #64748b;
      white-space: nowrap;
      font-family: 'JetBrains Mono';
    }

    .history-load {
      background: rgba(255, 255, 255, .1);
      color: white;
      border: none;
      border-radius: 8px;
      padding: 6px 12px;
      font-size: .8rem;
      font-weight: 700;
      cursor: pointer;
      font-family: 'Readex Pro';
      transition: all 0.2s;
      flex-shrink: 0;
    }

    .history-item:hover .history-load {
      background: var(--primary);
    }

    /* ═══════════════════════════════════════════════
       📱 التجاوب الاحترافي — Responsive (Mobile / Tablet / Laptop)
    ═══════════════════════════════════════════════ */

    /* ── لابتوب كبير 1200px+ ── */
    @media(min-width: 1200px) {
      .container {
        max-width: 1200px;
      }
    }

    /* ── تابلت / آيباد 768-950px ── */
    @media(max-width: 950px) {

      .form-row,
      .pomodoro-wrap,
      .bologna-layout,
      .deadline-layout,
      .plan-layout,
      .ai-buttons {
        grid-template-columns: 1fr !important;
        gap: 20px;
      }

      .container {
        padding: 0 16px;
      }

      .navbar {
        padding: 12px 20px;
      }

      .hero {
        padding: 70px 0 50px;
      }
    }

    /* ── آيباد عمودي 768px ── */
    @media(max-width: 768px) {
      .container {
        padding: 0 14px;
      }

      .navbar {
        padding: 10px 16px;
        border-radius: 20px;
        top: 12px;
      }

      .logo {
        font-size: 1.4rem;
      }

      .user-profile {
        font-size: .78rem;
        padding: 6px 12px;
        gap: 6px;
      }

      .auth-box {
        padding: 30px 24px;
        border-radius: 24px;
      }

      .hero {
        padding: 60px 0 40px;
      }

      .hero h1 {
        font-size: clamp(1.9rem, 5vw, 3rem);
      }

      .hero p {
        font-size: 1rem;
        margin-bottom: 30px;
      }

      .hero-stats {
        gap: 24px;
      }

      .stat-num {
        font-size: 1.8rem;
      }

      .tabs-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        border-radius: 18px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
      }

      .tabs-nav::-webkit-scrollbar {
        display: none;
      }

      .tab-btn {
        flex: 0 0 auto;
        font-size: .82rem;
        padding: 10px 14px;
        min-width: max-content;
      }

      .card,
      .pomo-card,
      .pomo-stats,
      .bologna-box,
      .gpa-scale,
      .deadline-form,
      .deadline-list,
      .plan-config,
      .plan-bars,
      .plan-week {
        padding: 22px 18px;
      }

      .sec-title h2 {
        font-size: 1.5rem;
      }

      /* Plan week grid overflow */
      .plan-week-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }
    }

    /* ── موبايل 650px ── */
    @media(max-width: 650px) {
      /* navbar handled by hamburger CSS */

      .badge-sub {
        display: none;
      }

      .search-trigger {
        min-width: 42px;
        width: 42px;
        height: 42px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
      }

      .search-trigger .search-trigger-text,
      .search-trigger kbd {
        display: none;
      }

      .user-profile {
        font-size: .72rem;
        padding: 7px 10px;
      }

      .btn-nav {
        font-size: .72rem;
        padding: 7px 10px;
      }

      .btn-dark {
        width: 38px;
        height: 38px;
        font-size: .9rem;
      }

      .container {
        padding: 0 10px;
      }

      .card,
      .pomo-card,
      .pomo-stats,
      .bologna-box,
      .gpa-scale,
      .deadline-form,
      .deadline-list,
      .plan-config,
      .plan-bars,
      .plan-week {
        padding: 18px 14px;
      }

      .hero {
        padding: 36px 0 26px;
      }

      .hero h1 {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
        margin-bottom: 14px;
        letter-spacing: -.5px;
      }

      .hero p {
        font-size: .9rem;
        margin-bottom: 24px;
        line-height: 1.7;
      }

      .hero-stats {
        gap: 14px;
        flex-wrap: wrap;
        justify-content: center;
      }

      .stat-num {
        font-size: 1.5rem;
      }

      .stat-label {
        font-size: .78rem;
      }

      .tabs-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 6px;
        border-radius: 14px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 24px 0;
        gap: 5px;
      }

      .tabs-nav::-webkit-scrollbar {
        display: none;
      }

      .tab-btn {
        flex: 0 0 auto;
        font-size: .77rem;
        padding: 9px 12px;
        min-width: max-content;
        border-radius: 12px;
        gap: 5px;
      }

      .generator-box {
        padding: 22px 14px;
        border-radius: 20px;
      }

      .gen-title {
        font-size: 1.4rem;
      }

      .ranking-container {
        padding: 20px 15px;
      }

      .ranking-row {
        flex-direction: column;
        gap: 10px;
        padding: 15px 0;
      }

      .ranking-row:hover {
        padding: 15px 0;
        margin: 0;
        background: transparent;
      }

      .rank-tool {
        width: 100%;
        justify-content: center;
      }

      .pomo-ring,
      .pomo-ring svg {
        width: 180px;
        height: 180px;
      }

      .pomo-time {
        font-size: 2.6rem;
      }

      .pomo-modes {
        flex-wrap: wrap;
      }

      .pomo-mode-btn {
        flex: 1;
        min-width: 30%;
        padding: 8px 4px;
        font-size: 0.75rem;
      }

      .gpa-course {
        grid-template-columns: 1fr 60px 45px 35px 25px;
        gap: 5px;
        padding: 10px 8px;
      }

      .gpa-col-headers {
        grid-template-columns: 1fr 60px 45px 35px 25px;
        gap: 5px;
        padding: 0 8px 8px;
        font-size: .65rem;
      }

      .gpa-course input[type="text"],
      .gpa-course input[type="number"],
      .gpa-course select {
        font-size: 0.8rem;
        padding: 6px;
      }

      .bologna-result-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
      }

      .b-grade-circle {
        width: 70px;
        height: 70px;
        font-size: 2.2rem;
      }

      .b-avg {
        font-size: 2rem;
      }

      .quick-subjects {
        display: none;
      }

      .input-group {
        flex-direction: column;
        gap: 10px;
        border-radius: 20px;
        padding: 10px;
        background: transparent;
        border: none;
      }

      .input-group input {
        text-align: center;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
      }

      .btn-submit {
        width: 100%;
      }

      .cta-box {
        padding: 40px 20px;
        border-radius: 24px;
      }

      /* Plan week grid on mobile */
      .plan-week-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }

      .plan-week {
        padding: 18px 14px;
      }

      .plan-bars {
        padding: 18px 14px;
      }

      .plan-summary-row {
        gap: 8px;
      }

      .plan-bar-row {
        gap: 8px;
      }

      .plan-bar-val {
        width: 55px;
        font-size: .78rem;
      }

      .plan-subjects-grid {
        gap: 6px !important;
      }

      .auth-box {
        padding: 24px 16px;
        border-radius: 20px;
      }
    }

    /* ── جوال صغير جداً 380px ── */
    @media(max-width: 380px) {
      .navbar {
        gap: 10px;
        padding: 12px 10px;
      }

      .hero h1 {
        font-size: 1.5rem;
      }

      .auth-box {
        padding: 20px 14px;
        max-width: 100%;
      }

      .tab-btn {
        font-size: .72rem;
        padding: 8px 10px;
      }

      .stat-num {
        font-size: 1.3rem;
      }

      .card {
        padding: 16px 12px;
      }
    }

    /* ── Viewport fix: prevent horizontal scroll on all sizes ── */
    html,
    body {
      max-width: 100vw;
      overflow-x: hidden;
    }

    /* ── Plan subject custom entry styles ── */
    .plan-add-subject {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-bottom: 14px;
    }

    .plan-add-subject-row1 {
      width: 100%;
    }

    .plan-add-subject-row2 {
      display: flex;
      gap: 8px;
      align-items: stretch;
    }

    .plan-add-subject input {
      width: 100%;
      padding: 11px 14px;
      border-radius: 12px;
      border: 1px solid var(--input-border);
      background: var(--input-bg);
      color: var(--text);
      font-family: 'Readex Pro';
      font-size: .88rem;
      outline: none;
      transition: all .25s;
      direction: rtl;
      box-sizing: border-box;
    }

    .plan-add-subject input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-light);
      background: var(--card);
    }

    .plan-add-subject .ects-inp {
      width: 90px;
      flex: none;
      text-align: center;
    }

    .btn-add-subject {
      padding: 10px 16px;
      background: var(--primary);
      color: #fff;
      border: none;
      border-radius: 12px;
      font-weight: 700;
      font-size: .88rem;
      cursor: pointer;
      transition: .2s;
      white-space: nowrap;
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .btn-add-subject:hover {
      background: var(--primary-dark);
      transform: translateY(-1px);
    }

    .plan-custom-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 6px;
      min-height: 36px;
    }

    .plan-custom-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 12px 7px 8px;
      border-radius: 30px;
      background: var(--primary-light);
      color: var(--primary);
      border: 1.5px solid var(--primary);
      font-size: .82rem;
      font-weight: 700;
      cursor: default;
      transition: .2s;
      animation: fadeInUp .2s ease;
    }

    .plan-custom-chip .chip-del {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: rgba(79, 70, 229, .15);
      color: var(--primary);
      border: none;
      cursor: pointer;
      font-size: .7rem;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: .15s;
      padding: 0;
    }

    .plan-custom-chip .chip-del:hover {
      background: var(--red);
      color: #fff;
    }

    .plan-empty-chips {
      font-size: .8rem;
      color: var(--muted);
      font-weight: 600;
      padding: 8px 0;
      text-align: center;
      width: 100%;
    }

    /* ── MOBILE TABS GRID (cards) ── */
    @media(max-width: 650px) {
      .tabs-nav {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 10px;
        border-radius: 20px;
        overflow-x: visible;
        margin: 20px 0;
      }
      .tab-btn {
        flex: unset;
        min-width: unset;
        padding: 14px 8px;
        border-radius: 14px;
        font-size: .78rem;
        flex-direction: column;
        gap: 4px;
        background: var(--bg);
        border: 1px solid var(--card-border);
        min-height: 60px;
      }
      .tab-btn i {
        font-size: 1.1rem;
      }
      .tab-btn.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
      }
      .tab-btn:not(.active):hover {
        background: var(--primary-light);
        border-color: var(--primary);
        color: var(--primary);
      }
    }
    @media(max-width: 380px) {
      .tabs-nav {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px;
        padding: 8px;
      }
      .tab-btn {
        padding: 12px 6px;
        font-size: .74rem;
        min-height: 54px;
      }
    }


    /* ── MOBILE HAMBURGER MENU ── */
    .hamburger-btn {
      display: none;
      background: var(--input-bg);
      border: 1px solid var(--card-border);
      color: var(--text);
      width: 42px;
      height: 42px;
      border-radius: 12px;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 1.1rem;
      transition: all 0.2s;
    }
    .hamburger-btn:hover { background: var(--primary-light); color: var(--primary); }
    
    .mobile-menu-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0);
      z-index: 1001;
      pointer-events: none;
      transition: background 0.35s ease;
    }
    .mobile-menu-overlay.open { 
      background: rgba(0,0,0,0.45);
      pointer-events: auto;
    }
    
    .mobile-menu {
      position: fixed;
      top: 0;
      right: 0;
      width: 280px;
      max-width: 85vw;
      height: 100dvh;
      background: var(--card);
      z-index: 1002;
      transform: translateX(100%);
      transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
      padding: 20px 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      box-shadow: -8px 0 30px rgba(0,0,0,0.15);
      overflow-y: auto;
      will-change: transform;
    }
    .mobile-menu.open { transform: translateX(0); }
    
    .mobile-menu-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-bottom: 14px;
      border-bottom: 1px solid var(--divider);
    }
    .mobile-menu-close {
      background: var(--input-bg);
      border: 1px solid var(--card-border);
      color: var(--text);
      width: 36px;
      height: 36px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 1rem;
      transition: all 0.2s;
    }
    .mobile-menu-close:hover { background: #fee2e2; color: #ef4444; }
    .mobile-menu-items { display: flex; flex-direction: column; gap: 6px; }
    .mobile-menu-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px 16px;
      border-radius: 14px;
      background: var(--bg);
      border: 1px solid var(--card-border);
      color: var(--text2);
      font-weight: 700;
      font-size: 0.9rem;
      cursor: pointer;
      transition: all 0.15s;
      text-decoration: none;
      font-family: 'Readex Pro';
    }
    .mobile-menu-item:active { transform: scale(0.97); }
    .mobile-menu-item:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
    .mobile-menu-item i { width: 20px; text-align: center; }
    
    @media(max-width: 650px) {
      .hamburger-btn { display: flex; }
      .nav-links { display: none; }
      .navbar {
        flex-direction: row;
        padding: 10px 16px;
        border-radius: 18px;
        top: 10px;
      }
    }


    /* ── 1. COMPACT HERO ON MOBILE ── */
    @media(max-width: 650px) {
      .hero { padding: 24px 0 12px; }
      .hero h1 { font-size: 1.4rem; margin-bottom: 10px; }
      .hero p { display: none; }
      .hero-badge { font-size: .75rem; padding: 6px 14px; margin-bottom: 10px; }
      .hero-stats { display: none; }
    }


    /* ── 3. QUICK ACTIONS ── */
    .quick-actions {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      margin-bottom: 24px;
    }
    .qa-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      padding: 18px 10px;
      border-radius: 16px;
      cursor: pointer;
      transition: all .25s;
      border: 1px solid var(--card-border);
      background: var(--card);
      text-align: center;
      box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    }
    .qa-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
    .qa-card:active { transform: scale(0.97); }
    .qa-icon {
      width: 44px; height: 44px;
      border-radius: 14px;
      display: flex; align-items: center; justify-content: center;
      font-size: 1.2rem;
    }
    .qa-label { font-size: .78rem; font-weight: 700; color: var(--text2); line-height: 1.3; }
    @media(max-width: 768px) {
      .quick-actions { grid-template-columns: repeat(2, 1fr); gap: 10px; }
      .qa-card { padding: 14px 8px; border-radius: 14px; }
      .qa-icon { width: 38px; height: 38px; font-size: 1rem; }
      .qa-label { font-size: .74rem; }
    }

    /* ── 4. GENERATOR BOX MOBILE ── */
    @media(max-width: 650px) {
      .ai-buttons {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
      }
      .ai-btn { font-size: .8rem; padding: 12px 8px; }
      .generator-box { padding: 24px 16px; border-radius: 20px; margin-bottom: 24px; }
      .gen-title { font-size: 1.3rem; }
      .gen-subtitle { font-size: .85rem; }
      .result-card { padding: 20px 16px; }
    }

    /* ── 5. SKELETON LOADING ── */
    @keyframes skeletonPulse {
      0%, 100% { opacity: 0.4; }
      50% { opacity: 0.8; }
    }
    .skeleton {
      background: var(--input-bg);
      border-radius: 12px;
      animation: skeletonPulse 1.5s ease-in-out infinite;
    }
    .skeleton-card {
      background: var(--card);
      border: 1px solid var(--card-border);
      border-radius: 20px;
      overflow: hidden;
    }
    .skeleton-card .sk-head { height: 50px; background: var(--input-bg); }
    .skeleton-card .sk-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
    .skeleton-card .sk-line { height: 12px; border-radius: 6px; }
    .skeleton-card .sk-line-long { width: 80%; }
    .skeleton-card .sk-line-short { width: 50%; }
    .skeleton-card .sk-line-full { width: 100%; height: 80px; }

    /* ── 6. SCROLL TO TOP + PROGRESS BAR ── */
    .scroll-progress {
      position: fixed;
      top: 0;
      left: 0;
      height: 3px;
      background: linear-gradient(90deg, var(--primary), #a855f7);
      z-index: 9999;
      transition: width .1s linear;
      border-radius: 0 2px 2px 0;
    }
    .scroll-top-btn {
      position: fixed;
      bottom: 24px;
      left: 24px;
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background: var(--primary);
      color: white;
      border: none;
      box-shadow: 0 4px 16px rgba(79,70,229,0.3);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.1rem;
      z-index: 998;
      opacity: 0;
      transform: translateY(20px);
      transition: opacity .3s, transform .3s;
      pointer-events: none;
    }
    .scroll-top-btn.visible {
      opacity: 1;
      transform: translateY(0);
      pointer-events: auto;
    }
    .scroll-top-btn:hover { background: var(--primary-dark); transform: translateY(-2px) !important; }
    @media(max-width: 650px) {
      .scroll-top-btn { bottom: 80px; left: 16px; width: 40px; height: 40px; font-size: 1rem; }
    }

    /* Injected styles (previously runtime) */
/* Priority circles */
        .dl-priority{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;font-size:.75rem;font-weight:800;flex-shrink:0;font-family:'JetBrains Mono',monospace}
        .p-critical{background:#fee2e2;color:#dc2626;box-shadow:0 0 0 2px #fca5a580}
        .p-high{background:#ffedd5;color:#ea580c}
        .p-mid{background:#fef9c3;color:#ca8a04}
        .p-low{background:#f0fdf4;color:#16a34a}
        /* Snippet cards */
        .snippet-card{background:var(--card);border:1px solid var(--card-border);border-radius:16px;overflow:hidden;transition:.25s}
        .snippet-head{display:flex;justify-content:space-between;align-items:center;padding:14px 16px 10px;gap:8px}
        .snippet-title{font-weight:700;font-size:.92rem;color:var(--text2)}
        .snippet-lang-tag{padding:3px 10px;border-radius:20px;font-size:.72rem;font-weight:700}
        .lang-py{background:#3b82f620;color:#2563eb}.lang-java{background:#f9731620;color:#ea580c}.lang-cpp{background:#6366f120;color:#6366f1}.lang-sql{background:#10b98120;color:#059669}.lang-js{background:#eab30820;color:#ca8a04}
        .snippet-code{margin:0;padding:14px 16px;background:var(--code-bg);color:#e2e8f0;font-family:'JetBrains Mono',monospace;font-size:.78rem;line-height:1.65;overflow-x:auto;white-space:pre}
        .snippet-footer{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;gap:8px}
        .snippet-desc{font-size:.8rem;color:var(--muted)}
        .copy-snip-btn{display:inline-flex;align-items:center;gap:5px;padding:6px 14px;background:var(--primary-light);color:var(--primary);border:none;border-radius:20px;font-size:.78rem;font-weight:700;cursor:pointer;transition:.2s}
        .copy-snip-btn:hover{background:var(--primary);color:#fff}
        /* Grade label badge */
        .grade-lbl{display:inline-flex;align-items:center;justify-content:center;min-width:32px;padding:4px 8px;border-radius:8px;font-size:.8rem;font-family:'JetBrains Mono',monospace;transition:.2s}
        /* Plan chip selected */
        .plan-chip.selected{background:var(--primary);color:#fff;border-color:var(--primary)}
        /* Search items */
        .search-item{display:flex;align-items:center;gap:12px;padding:11px 16px;border-radius:12px;cursor:pointer;transition:.15s}
        .search-item:hover{background:var(--primary-light)}
        .search-item-icon{width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:.9rem;flex-shrink:0}
        .si-subj{background:#e0e7ff;color:#4f46e5}.si-snip{background:#f0fdf4;color:#16a34a}.si-prompt{background:#fff7ed;color:#ea580c}
        .search-item-text{flex:1;min-width:0}
        .search-item-name{font-size:.88rem;font-weight:700;color:var(--text2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
        .search-item-sub{font-size:.75rem;color:var(--muted);margin-top:2px}
        .search-item-arrow{color:var(--muted);font-size:.75rem;flex-shrink:0}
        .search-cat-label{font-size:.72rem;font-weight:700;color:var(--muted);padding:8px 16px 4px;text-transform:uppercase;letter-spacing:.05em}
        /* Del btn for gpa */
        .del-btn{background:none;border:none;color:var(--muted);cursor:pointer;padding:4px 8px;border-radius:8px;transition:.2s}
        .del-btn:hover{color:var(--red);background:#fee2e2}
        /* dl-items wrapper */
        .dl-items{display:flex;flex-direction:column;gap:10px}
/* ═══════════════════════════════════════════════════════
   v2.1 — Points, Notifications, Leaderboard
═══════════════════════════════════════════════════════ */

/* ── POINTS BADGE (navbar) ── */
.points-badge {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e; padding: 6px 14px; border-radius: 30px;
  font-weight: 800; font-size: .8rem; border: 1px solid #fcd34d;
  font-family: 'JetBrains Mono'; cursor: default;
  transition: transform .2s;
}
.points-badge:hover { transform: scale(1.05); }
[data-theme="dark"] .points-badge { background: linear-gradient(135deg, #78350f, #92400e); color: #fde68a; border-color: #b45309; }

/* ── NOTIFICATION BELL ── */
.notif-btn {
  position: relative; background: var(--input-bg); border: 1px solid var(--card-border);
  color: var(--text); width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.1rem; transition: all .2s;
}
.notif-btn:hover { background: var(--primary-light); color: var(--primary); }
.notif-count {
  position: absolute; top: -4px; right: -4px; background: #ef4444; color: white;
  font-size: .65rem; font-weight: 800; min-width: 18px; height: 18px;
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid var(--card);
}
.notif-count:empty, .notif-count[data-count="0"] { display: none; }

/* ── NOTIFICATION DROPDOWN ── */
.notif-dropdown {
  position: absolute; top: calc(100% + 12px); left: 0; width: 320px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 20px; box-shadow: 0 15px 40px rgba(0,0,0,.15);
  z-index: 1001; display: none; max-height: 400px; overflow-y: auto;
}
[dir="rtl"] .notif-dropdown { left: auto; right: 0; }
.notif-dropdown.open { display: block; animation: fadeIn .25s ease; }
.notif-dropdown-header {
  padding: 16px 20px; border-bottom: 1px solid var(--divider);
  display: flex; justify-content: space-between; align-items: center;
}
.notif-dropdown-header h4 { font-weight: 800; font-size: .95rem; color: var(--text2); }
.notif-mark-all { background: none; border: none; color: var(--primary); font-weight: 700; font-size: .78rem; cursor: pointer; font-family: 'Readex Pro'; }
.notif-item {
  padding: 14px 20px; border-bottom: 1px solid var(--divider);
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer; transition: background .15s;
}
.notif-item:hover { background: var(--input-bg); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--primary-light); }
.notif-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0; }
.ni-info { background: #dbeafe; color: #2563eb; }
.ni-success { background: #dcfce7; color: #16a34a; }
.ni-warning { background: #fef3c7; color: #d97706; }
.ni-gift { background: #fce7f3; color: #db2777; }
.ni-announcement { background: #e0e7ff; color: #4f46e5; }
.notif-text { flex: 1; min-width: 0; }
.notif-title { font-weight: 700; font-size: .85rem; color: var(--text2); }
.notif-body { font-size: .78rem; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.notif-time { font-size: .7rem; color: var(--muted); margin-top: 4px; }
.notif-empty { text-align: center; padding: 30px; color: var(--muted); font-size: .85rem; }

/* ── LEADERBOARD ── */
.lb-container { background: var(--card); border-radius: var(--r); border: 1px solid var(--card-border); padding: 30px; box-shadow: var(--shadow-sm); margin-bottom: 30px; }
.lb-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; font-family: 'Tajawal'; font-weight: 800; font-size: 1.3rem; color: var(--text2); }
.lb-podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.lb-podium-card {
  text-align: center; padding: 20px 12px; border-radius: 16px; border: 1px solid var(--card-border);
  background: var(--bg); position: relative; transition: transform .2s;
}
.lb-podium-card:hover { transform: translateY(-4px); }
.lb-podium-card.gold { border-color: #fcd34d; background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.lb-podium-card.silver { border-color: #d1d5db; background: linear-gradient(135deg, #f9fafb, #f3f4f6); }
.lb-podium-card.bronze { border-color: #fdba74; background: linear-gradient(135deg, #fff7ed, #ffedd5); }
[data-theme="dark"] .lb-podium-card.gold { background: linear-gradient(135deg, #78350f, #451a03); }
[data-theme="dark"] .lb-podium-card.silver { background: linear-gradient(135deg, #374151, #1f2937); }
[data-theme="dark"] .lb-podium-card.bronze { background: linear-gradient(135deg, #7c2d12, #431407); }
.lb-rank-badge { font-size: 1.8rem; margin-bottom: 8px; }
.lb-name { font-weight: 800; font-size: .9rem; color: var(--text2); margin-bottom: 4px; }
.lb-points { font-family: 'JetBrains Mono'; font-weight: 800; font-size: 1.1rem; color: var(--primary); }
.lb-level { font-size: .75rem; color: var(--muted); font-weight: 700; margin-top: 4px; }
.lb-list { display: flex; flex-direction: column; gap: 6px; }
.lb-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  border-radius: 12px; background: var(--bg); border: 1px solid var(--card-border); transition: background .15s;
}
.lb-row:hover { background: var(--primary-light); }
.lb-row-rank { font-weight: 800; font-size: .9rem; color: var(--muted); min-width: 28px; text-align: center; font-family: 'JetBrains Mono'; }
.lb-row-name { flex: 1; font-weight: 700; font-size: .88rem; color: var(--text2); }
.lb-row-pts { font-family: 'JetBrains Mono'; font-weight: 800; font-size: .85rem; color: var(--primary); }
.lb-row-streak { font-size: .75rem; color: var(--muted); }
@media(max-width: 650px) {
  .lb-podium { grid-template-columns: 1fr; gap: 8px; }
  .lb-podium-card { display: flex; align-items: center; gap: 12px; text-align: right; padding: 14px 16px; }
  .lb-rank-badge { font-size: 1.3rem; margin-bottom: 0; }
  .points-badge { font-size: .72rem; padding: 5px 10px; }
  .notif-dropdown { width: 280px; }
}