  :root {
    --green: #0a7c41;
    --green-light: #12a356;
    --yellow: #f5c518;
    --red: #e53935;
    --blue: #1a73e8;
    --bg: #ffffff;
    --card: rgba(255, 255, 255, 0.7);
    --text: #1e293b;
    --muted: #64748b;
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  }

  ::-webkit-scrollbar {
    width: 8px;
  }

  ::-webkit-scrollbar-track {
    background: #f8fafc;
  }

  ::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
  }

  html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
  }

  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  body {
    font-family: 'Outfit', 'Noto Sans Bengali', sans-serif;
    background: var(--bg);
    background-image:
      radial-gradient(at 0% 0%, rgba(10, 124, 65, 0.05) 0px, transparent 50%),
      radial-gradient(at 100% 0%, rgba(26, 115, 232, 0.05) 0px, transparent 50%),
      radial-gradient(at 100% 100%, rgba(245, 197, 24, 0.05) 0px, transparent 50%),
      radial-gradient(at 0% 100%, rgba(229, 57, 53, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text);
    line-height: 1.5;
  }

  /* ===== HOME PAGE ===== */
  #home-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
  }

  #home-page::before {
    content: '';
    position: absolute;
    top: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(10, 124, 65, 0.08), transparent 70%);
    pointer-events: none;
  }

  .logo-area {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeDown 0.6s ease;
  }

  .logo-leaf {
    font-size: 60px;
    display: block;
    animation: sway 3s ease-in-out infinite;
  }

  @keyframes sway {

    0%,
    100% {
      transform: rotate(-5deg);
    }

    50% {
      transform: rotate(5deg);
    }
  }

  .logo-text {
    font-family: 'Tiro Bangla', serif;
    font-size: 52px;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1;
  }

  .logo-text span:nth-child(1) {
    color: #1a73e8;
  }

  .logo-text span:nth-child(2) {
    color: #ea4335;
  }

  .logo-text span:nth-child(3) {
    color: #fbbc04;
  }

  .logo-text span:nth-child(4) {
    color: var(--green);
  }

  .logo-text span:nth-child(5) {
    color: #1a73e8;
  }

  .logo-text span:nth-child(6) {
    color: #ea4335;
  }

  .logo-text span {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s;
    cursor: default;
  }

  .logo-text span:hover {
    transform: translateY(-8px) scale(1.2) rotate(4deg);
    filter: brightness(1.2);
  }

  .logo-text span:nth-child(7) {
    color: var(--green);
  }

  .logo-sub {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
    font-style: italic;
  }

  .search-box-wrapper {
    width: 100%;
    max-width: 580px;
    position: relative;
    animation: fadeUp 0.6s ease 0.2s both;
  }

  .search-input {
    width: 100%;
    padding: 14px 54px 14px 24px;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text);
  }

  .search-input:focus {
    border-color: var(--green);
    background: #fff;
    box-shadow: 0 20px 25px -5px rgba(10, 124, 65, 0.1), 0 8px 10px -6px rgba(10, 124, 65, 0.1);
    transform: translateY(-2px);
  }

  @keyframes searchPulse {
    0% {
      box-shadow: 0 20px 25px -5px rgba(10, 124, 65, 0.1);
    }

    50% {
      box-shadow: 0 25px 35px -5px rgba(10, 124, 65, 0.15);
    }

    100% {
      box-shadow: 0 20px 25px -5px rgba(10, 124, 65, 0.1);
    }
  }

  .search-input:focus-within {
    animation: searchPulse 2s infinite ease-in-out;
  }

  .search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    cursor: pointer;
    transition: transform 0.2s;
  }

  .search-icon:hover {
    transform: translateY(-50%) scale(1.2);
  }

  .search-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
    animation: fadeUp 0.6s ease 0.35s both;
  }

  .search-btns button {
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
  }

  .search-btns button:hover {
    background: var(--green);
    color: white;
    border-color: var(--green);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 124, 65, 0.2);
  }

  .lucky-msg {
    display: none;
    margin-top: 14px;
    padding: 12px 20px;
    background: #fff9e6;
    border: 1px solid var(--yellow);
    border-radius: 12px;
    font-size: 15px;
    color: #7a5c00;
    text-align: center;
    max-width: 500px;
    animation: pop 0.3s ease;
  }

  @keyframes pop {
    0% {
      transform: scale(0.9);
      opacity: 0;
    }

    100% {
      transform: scale(1);
      opacity: 1;
    }
  }

  .trending {
    margin-top: 35px;
    text-align: center;
    animation: fadeUp 0.6s ease 0.5s both;
  }

  .trending-title {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
  }

  .trending-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 500px;
  }

  .tag {
    padding: 6px 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
  }

  .tag:hover {
    background: var(--green);
    color: white;
    border-color: var(--green);
  }

  /* ===== RESULTS PAGE ===== */
  #results-page {
    display: none;
    min-height: 100vh;
  }

  /* ===== RESULTS HEADER ===== */
  .results-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    transition: backdrop-filter 0.3s, box-shadow 0.3s;
  }

  /* Desktop: single row */
  .header-top-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
  }

  .header-logo {
    font-family: 'Tiro Bangla', serif;
    font-size: 26px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
  }

  .header-logo span:nth-child(1) {
    color: #1a73e8;
  }

  .header-logo span:nth-child(2) {
    color: #ea4335;
  }

  .header-logo span:nth-child(3) {
    color: #fbbc04;
  }

  .header-logo span:nth-child(4) {
    color: var(--green);
  }

  .header-logo span:nth-child(5) {
    color: #1a73e8;
  }

  .header-logo span:nth-child(6) {
    color: #ea4335;
  }

  .header-logo span:nth-child(7) {
    color: var(--green);
  }

  .header-search {
    flex: 1;
    max-width: 600px;
    position: relative;
  }

  .header-search input {
    width: 100%;
    padding: 10px 44px 10px 18px;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 16px;
    font-family: 'Noto Sans Bengali', sans-serif;
    outline: none;
    transition: all 0.3s;
  }

  .header-search input:focus {
    border-color: var(--green);
    box-shadow: 0 2px 10px rgba(10, 124, 65, 0.12);
  }

  .header-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
  }

  /* Desktop-only icons */
  .header-icons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
  }

  .header-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
  }

  .header-icon-btn:hover {
    background: #f1f3f4;
  }

  .header-avatar {
    width: 32px;
    height: 32px;
    background: var(--green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
  }

  /* ===== MOBILE HEADER (Google style) ===== */
  @media (max-width: 640px) {
    .header-top-row {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      padding: 10px 14px 6px;
      gap: 0;
    }

    /* On mobile, hide the inline search — show row 2 instead */
    .header-search {
      display: none;
    }

    .header-logo {
      font-size: 22px;
      grid-column: 2;
      justify-self: center;
    }

    .header-left-icons {
      grid-column: 1;
      display: flex;
      justify-content: flex-start;
    }

    .header-right-icons {
      grid-column: 3;
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 6px;
    }

    /* Mobile search row below logo row */
    .header-search-row {
      display: flex !important;
      align-items: center;
      margin: 4px 14px 10px;
      border: 1px solid var(--border);
      border-radius: 50px;
      background: #f1f3f4;
      padding: 8px 14px;
      gap: 10px;
    }

    .header-search-row input {
      flex: 1;
      border: none;
      background: transparent;
      font-size: 16px;
      font-family: 'Noto Sans Bengali', sans-serif;
      outline: none;
      color: var(--text);
    }

    .header-search-row .sr-icon {
      font-size: 17px;
      flex-shrink: 0;
      cursor: pointer;
    }
  }

  /* Desktop: hide mobile-only elements */
  .header-left-icons,
  .header-right-icons,
  .header-search-row {
    display: none;
  }


  .results-body {
    max-width: 720px;
    margin: 0 auto;
    padding: 12px 20px 40px;
  }

  .results-stats {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 16px;
    padding-left: 2px;
  }

  .result-card {
    margin-bottom: 16px;
    animation: fadeUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) both;
    padding: 12px;
    border-radius: 12px;
    background: var(--card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform, opacity;
  }

  .result-card:hover {
    transform: translateY(-2px) translateX(4px);
    background: #fff;
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.08);
    border-color: rgba(10, 124, 65, 0.3);
  }

  /* Staggered Entrance */
  .result-card:nth-child(1) {
    animation-delay: 0.05s;
  }

  .result-card:nth-child(2) {
    animation-delay: 0.1s;
  }

  .result-card:nth-child(3) {
    animation-delay: 0.15s;
  }

  .result-card:nth-child(4) {
    animation-delay: 0.2s;
  }

  .result-card:nth-child(5) {
    animation-delay: 0.25s;
  }

  .result-card:nth-child(6) {
    animation-delay: 0.3s;
  }

  .result-url {
    font-size: 13px;
    color: #475569;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .url-text {
    opacity: 0.8;
  }

  .badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .badge-ai {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #e0e7ff;
  }

  .badge-web {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid var(--border);
  }

  .result-card-ai {
    border-left: 2px solid #6366f1;
  }

  .result-favicon {
    width: 24px;
    height: 24px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }

  .result-title {
    font-size: 18px;
    color: #1a0dab;
    cursor: pointer;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    display: block;
    width: fit-content;
    margin-bottom: 2px;
  }

  .result-title:hover {
    text-decoration: underline;
  }

  .result-desc {
    font-size: 13.5px;
    color: #475569;
    line-height: 1.5;
    margin-top: 2px;
    max-width: 640px;
  }

  .result-desc .highlight {
    color: var(--text);
    font-weight: 600;
  }

  /* Special featured box */
  .featured-box {
    background: white;
    border: 1px solid var(--border);
    border-left: 4px solid var(--green);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 28px;
    animation: fadeUp 0.4s ease;
  }

  .featured-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--green);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
  }

  .featured-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
  }

  /* No results */
  .no-results {
    text-align: center;
    padding: 60px 20px;
  }

  .no-results .emoji {
    font-size: 64px;
    margin-bottom: 16px;
  }

  .no-results h3 {
    font-size: 22px;
    color: var(--text);
    margin-bottom: 8px;
  }

  .no-results p {
    color: var(--muted);
    font-size: 15px;
  }

  /* Loading animation */
  .loading-dots {
    display: none;
    justify-content: center;
    padding: 40px;
    gap: 8px;
  }

  .loading-dots.active {
    display: flex;
  }

  .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: bounce 0.8s ease infinite;
  }

  .dot:nth-child(1) {
    background: #1a73e8;
    animation-delay: 0s;
  }

  .dot:nth-child(2) {
    background: #ea4335;
    animation-delay: 0.15s;
  }

  .dot:nth-child(3) {
    background: #fbbc04;
    animation-delay: 0.3s;
  }

  .dot:nth-child(4) {
    background: var(--green);
    animation-delay: 0.45s;
  }

  @keyframes bounce {

    0%,
    100% {
      transform: translateY(0);
    }

    50% {
      transform: translateY(-14px);
    }
  }

  @keyframes fadeDown {
    from {
      opacity: 0;
      transform: translateY(-20px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes fadeUp {
    from {
      opacity: 0;
      transform: translateY(16px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* AI Status and Error states */
  .ai-status-container {
    text-align: center;
    padding: 60px 20px;
  }

  .ai-status-emoji {
    font-size: 64px;
    margin-bottom: 16px;
  }

  .ai-status-title {
    font-size: 22px;
    color: var(--text);
    margin-bottom: 10px;
  }

  .ai-status-msg {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 8px;
  }

  .ai-status-hint {
    color: var(--muted);
    font-size: 13px;
  }

  /* Did you mean section */
  .did-you-mean {
    margin-top: 20px;
    font-size: 14px;
    color: var(--muted);
  }

  .did-you-mean a {
    color: var(--blue);
    text-decoration: none;
  }

  @media (max-width: 480px) {
    .ai-status-container {
      padding: 40px 15px;
    }

    .ai-status-emoji {
      font-size: 48px;
    }

    .ai-status-title {
      font-size: 18px;
    }
  }

  /* Footer */
  .site-footer {
    position: relative;
    margin-top: 30px;
    background: #f2f2f2;
    border-top: 1px solid var(--border);
    padding: 10px 20px;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
  }

  /* Responsive */
  @media (max-width: 600px) {
    .logo-text {
      font-size: 36px;
    }

    .logo-leaf {
      font-size: 44px;
    }
  }

  /* ===== CUSTOM POPUP / TOAST ===== */

  /* Overlay modal */
  .pata-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }

  .pata-overlay.show {
    display: flex;
  }

  .pata-modal {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
      inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    animation: modalEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
  }

  @keyframes modalEntrance {
    0% {
      transform: scale(0.9) translateY(20px);
      opacity: 0;
    }

    100% {
      transform: scale(1) translateY(0);
      opacity: 1;
    }
  }

  .pata-modal .modal-emoji {
    font-size: 56px;
    margin-bottom: 16px;
    display: block;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
  }

  .pata-modal h3 {
    font-size: 22px;
    color: #1e293b;
    margin-bottom: 8px;
    font-family: 'Noto Sans Bengali', sans-serif;
    font-weight: 700;
  }

  .pata-modal p {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 24px;
  }

  /* Professional Inputs */
  .pata-modal input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid #f1f5f9;
    margin-bottom: 20px !important;
    font-family: 'Noto Sans Bengali', sans-serif;
    font-size: 14px;
    transition: all 0.2s;
    background: #f8fafc;
    color: #1e293b;
  }

  .pata-modal input[type="text"]:focus {
    border-color: var(--green);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(10, 124, 65, 0.1);
  }

  .modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
  }

  .pata-modal .modal-close {
    background: #1e293b;
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 14px 28px;
    font-size: 15px;
    font-family: 'Noto Sans Bengali', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
  }

  .pata-modal .modal-close.primary {
    background: var(--green);
  }

  .pata-modal .modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  }

  .pata-modal .modal-close:active {
    transform: translateY(0);
  }

  /* Mobile optimized modal */
  @media (max-width: 480px) {
    .pata-modal {
      padding: 24px 20px;
      border-radius: 16px;
    }

    .pata-modal .modal-emoji {
      font-size: 48px;
      margin-bottom: 12px;
    }

    .pata-modal h3 {
      font-size: 20px;
      margin-bottom: 6px;
    }

    .pata-modal p {
      font-size: 14px;
      line-height: 1.5;
      margin-bottom: 20px;
    }

    .pata-modal .modal-close {
      padding: 12px 20px;
      font-size: 14px;
    }
  }

  /* Toast notification */
  .pata-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Noto Sans Bengali', sans-serif;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
  }

  .pata-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }