/* POCOTASK design system - shared look for every page.
   Tokens first; pages and components reference these via var(--pt-*).
   This file loads after each page's own <style>, so rules here win ties. */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300..500&family=Geist+Mono:wght@400;500&display=swap');

:root {
    /* Color */
    --pt-bg: #F5F6F7;          /* page background (very light grey) */
    --pt-surface: #FFFFFF;     /* cards */
    --pt-surface-2: #F0F1F3;   /* subtle fills, inputs */
    --pt-border: #E2E5E8;
    --pt-ink: #18191B;         /* primary text, dark buttons */
    --pt-graphite: #1F2326;    /* dark panels */
    --pt-muted: #6B7178;       /* secondary text */

    /* ===== Brand accent: fresh green. Change the accent here and the whole site follows. =====
       For a dark accent, also set --pt-on-lime to white and --pt-lime-light to a light tint. */
    --pt-lime: #BDF0B8;        /* accent fill: buttons, chips, reward pills */
    --pt-lime-deep: #AAEAA4;   /* accent hover / pressed */
    --pt-on-lime: #1F6E22;     /* green accent text: on tints, links, amounts (stays light in dark mode) */
    --pt-on-lime-fill: #1F6E22; /* text and icons sitting ON a solid accent fill (buttons, chips) */
    --pt-lime-light: #8CF08C;  /* accent text and icons on DARK panels */
    --pt-lime-rgb: 91, 227, 91; /* soft tints and glows: rgba(var(--pt-lime-rgb), 0.2) */
    --pt-lime-soft: #EAFBE6;   /* pale accent panels */
    --pt-lime-grad: linear-gradient(180deg, #F0FCEC 0%, #D9F8D2 50%, #BDF2B3 100%);  /* pale accent cards */
    /* Feature cards: three soft single-colour cards (green, peach, blue). Each has its own text colours. */
    --pt-card-green: linear-gradient(160deg, #DDFBD8 0%, #B4F4AC 55%, #9DEF95 100%);
    --pt-card-green-ink: #173A1A;     /* headings on the green card */
    --pt-card-green-label: #3E9A43;   /* labels, icons, accents on the green card */
    --pt-card-peach: linear-gradient(160deg, #FFF3EC 0%, #FFE4D4 55%, #FFD8C2 100%);
    --pt-card-peach-ink: #7A1E0A;
    --pt-card-peach-label: #E08A5F;
    --pt-card-blue: linear-gradient(160deg, #F2F6FF 0%, #E2EBFF 55%, #D3E1FF 100%);
    --pt-card-blue-ink: #1B3C8C;
    --pt-card-blue-label: #7F9BDF;
    /* soft green glow behind cards */
    --pt-glow: radial-gradient(closest-side, rgba(132, 236, 128, 0.85), rgba(132, 236, 128, 0));
    /* Previous accent (soft pale lemon), to switch back paste these over the lines above:
       --pt-lime: #F2F5A9; --pt-lime-deep: #E9EE8A; --pt-on-lime: #18191B; --pt-lime-light: #F2F5A9;
       --pt-lime-rgb: 240, 246, 90; --pt-lime-soft: #F8F9E2;
       --pt-lime-grad: linear-gradient(180deg, #F1F2DC 0%, #F2F4C4 45%, #F3F6B2 100%);
       --pt-activity-grad: linear-gradient(180deg, #F1F2DC 0px, #F2F4C4 72px, #F3F6B2 160px); */
    /* ===== end brand accent ===== */

    --pt-green: #22874D;       /* accent text on light backgrounds, charts, success */
    --pt-slate: #7E9CA2;       /* muted teal-grey secondary accent */
    --pt-slate-grad: linear-gradient(135deg, #6F8E95 0%, #8FAAB0 55%, #B9CACD 100%);

    /* Shape */
    --pt-radius: 22px;         /* cards, panels */
    --pt-radius-sm: 14px;      /* inputs, list rows */
    --pt-radius-pill: 999px;   /* buttons, tabs, badges */
    --pt-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);

    /* Type */
    --pt-font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --pt-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Dark buttons and badges: separate from text ink so dark mode can keep them dark */
    --pt-ink-bg: #18191B;
    /* short top fade used by the dashboard Recent Activity panel */
    --pt-activity-grad: linear-gradient(180deg, #F0FCEC 0px, #D9F8D2 72px, #BDF2B3 160px);
}

/* ---------- Dark mode: same tokens, dark values. Toggled by data-theme="dark" on <html>. ---------- */
html[data-theme="dark"] {
    --pt-bg: #111315;
    --pt-surface: #1A1D20;
    --pt-surface-2: #23272B;
    --pt-border: #2E3338;
    --pt-ink: #EEF0F2;
    --pt-ink-bg: #343A40;
    --pt-graphite: #0B0C0E;
    --pt-muted: #9AA0A6;
    /* brand accent, dark-mode values */
    --pt-lime: #BDF0B8;          /* same soft green fill as light mode */
    --pt-lime-deep: #AAEAA4;
    --pt-on-lime-fill: #1F6E22;  /* same green text on that fill as light mode */
    --pt-on-lime: #F2FFF0;       /* accent text on dark tints/backgrounds: must stay light */
    --pt-lime-light: #8CF08C;
    --pt-lime-rgb: 91, 227, 91;
    --pt-lime-soft: #17261A;
    --pt-lime-grad: linear-gradient(180deg, #17241A 0%, #1C3320 55%, #214026 100%);
    --pt-card-green: linear-gradient(160deg, #1A2B1C 0%, #1E3A21 55%, #224526 100%);
    --pt-card-green-ink: #E3F9E0;
    --pt-card-green-label: #8CF08C;
    --pt-card-peach: linear-gradient(160deg, #2B211C 0%, #3A2920 55%, #453024 100%);
    --pt-card-peach-ink: #FFE1D2;
    --pt-card-peach-label: #F2A47E;
    --pt-card-blue: linear-gradient(160deg, #1C2230 0%, #212B42 55%, #25324F 100%);
    --pt-card-blue-ink: #DCE6FF;
    --pt-card-blue-label: #9DB5F0;
    --pt-glow: radial-gradient(closest-side, rgba(91, 227, 91, 0.3), rgba(91, 227, 91, 0));
    --pt-green: #4CC07A;
    --pt-slate: #6D8A90;
    --pt-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.4);
    --pt-activity-grad: linear-gradient(180deg, #17241A 0px, #1A2C1D 72px, #1C3320 160px);
    color-scheme: dark;
}
html[data-theme="dark"] body, html[data-theme="dark"] .main-content { background: var(--pt-bg) !important; color: var(--pt-ink); }
/* Tailwind light utilities used across pages */
html[data-theme="dark"] .bg-white { background-color: var(--pt-surface) !important; }
html[data-theme="dark"] .bg-gray-50, html[data-theme="dark"] .bg-gray-100, html[data-theme="dark"] .bg-gray-200 { background-color: var(--pt-surface-2) !important; }
html[data-theme="dark"] .text-black, html[data-theme="dark"] .text-gray-900, html[data-theme="dark"] .text-gray-800, html[data-theme="dark"] .text-gray-700 { color: var(--pt-ink) !important; }
html[data-theme="dark"] .text-gray-600, html[data-theme="dark"] .text-gray-500 { color: var(--pt-muted) !important; }
html[data-theme="dark"] .border-gray-100, html[data-theme="dark"] .border-gray-200, html[data-theme="dark"] .border-gray-300, html[data-theme="dark"] .border-black { border-color: var(--pt-border) !important; }
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), html[data-theme="dark"] select, html[data-theme="dark"] textarea { background-color: var(--pt-surface-2) !important; color: var(--pt-ink) !important; border-color: var(--pt-border) !important; }
html[data-theme="dark"] .navbar { background: rgba(17, 19, 21, 0.88) !important; }
html[data-theme="dark"] .gradient-text { color: var(--pt-ink); }

/* ---------- Base ---------- */
body:not(.dark-mode), body:not(.dark-mode) .main-content {
    background: var(--pt-bg);
    color: var(--pt-ink);
}

body, body *:not(i):not([class*="fa-"]):not(.fa):not(.fas):not(.far):not(.fab) {
    font-family: var(--pt-font) !important;
}
/* Thin, crisp text on Mac like the Intercom pages */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-synthesis: none;   /* Geist loads up to 500, so "bold" stays 500 instead of a faked heavy bold */
}
/* Small mono caps label, e.g. "KEY FEATURES" */
body .pt-caps.pt-label {
    font-family: var(--pt-mono) !important;
    font-size: 13px; font-weight: 400 !important;
    letter-spacing: 0.12em; text-transform: uppercase !important;
    color: var(--pt-ink);
}

/* Sentence case instead of shouting caps; tighter headings */
body *:not(.pt-caps) {
    text-transform: none !important;
}
h1, h2, h3, h4 {
    letter-spacing: -0.02em !important;
}

/* Lime gradient text was unreadable on light backgrounds */
body:not(.dark-mode) .gradient-text {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--pt-ink);
}

/* ---------- Tailwind utilities remapped ---------- */
.border-black { border-color: var(--pt-border) !important; }
.border-2, .border-4 { border-width: 1px !important; }
.border-b-2, .border-b-4 { border-bottom-width: 1px !important; }
.border-t-2, .border-t-4 { border-top-width: 1px !important; }
.divide-black > * + * { border-color: var(--pt-border) !important; }
.divide-y-2 > * + *, .divide-y-4 > * + * { border-top-width: 1px !important; border-bottom-width: 0 !important; }
.bg-lime-400 { background-color: var(--pt-lime) !important; color: var(--pt-on-lime-fill) !important; }
.text-lime-400 { color: var(--pt-green) !important; }
.bg-indigo-500, .bg-purple-500 { background-color: var(--pt-slate) !important; }
.text-indigo-400, .text-purple-400 { color: var(--pt-slate) !important; }
body:not(.dark-mode) .text-green-400, body:not(.dark-mode) .text-green-500 { color: var(--pt-green) !important; }

/* ---------- Form controls ---------- */
body:not(.dark-mode) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
body:not(.dark-mode) select,
body:not(.dark-mode) textarea {
    border-radius: var(--pt-radius-sm) !important;
    border: 1px solid var(--pt-border) !important;
    background-color: var(--pt-surface) !important;
}
body:not(.dark-mode) input:focus, body:not(.dark-mode) select:focus, body:not(.dark-mode) textarea:focus {
    outline: none !important;
    border-color: var(--pt-ink) !important;
    box-shadow: 0 0 0 3px rgba(var(--pt-lime-rgb), 0.5) !important;
}
/* Chat composer: the wrapper draws the border, so the textarea stays bare */
body:not(.dark-mode) textarea.message-input,
body:not(.dark-mode) textarea.message-input:focus {
    border: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
}
button, .btn, [class*="-btn"] {
    border-radius: var(--pt-radius-pill) !important;
}

/* ---------- Sidebar: always below the fixed navbar so its collapse toggle shows ---------- */
@media (min-width: 769px) {
    body .sidebar {
        top: 80px !important;
        height: calc(var(--app-vh, 100vh) - 80px) !important;
        z-index: 900 !important;
        overflow-y: auto;
    }
}
/* ---------- App pages render at 90% on desktop. Full-height things use var(--app-vh), which undoes the zoom. ---------- */
@media (min-width: 1025px) {
    html:has(#sidebar) {
        zoom: 0.9;
        --app-vh: calc(100vh / 0.9);
        --app-dvh: calc(100dvh / 0.9);
    }
}

/* ---------- App pages: one plain surface; header, sidebar and page share the page colour ---------- */
body:has(#sidebar),
body:has(#sidebar) .main-content,
body:has(#sidebar) .sidebar { background: var(--pt-bg) !important; }
body:has(#sidebar) .navbar { background: var(--pt-bg) !important; border: none !important; box-shadow: none !important; }
body:has(#sidebar) .sidebar { border: none !important; box-shadow: none !important; }
@media (min-width: 1025px) {
    body .main-content.expanded {
        margin-left: 80px !important;
    }
}

/* ---------- Top navbar (light, floating) ---------- */
body .navbar {
    background: rgba(245, 246, 247, 0.9) !important;
    color: var(--pt-ink) !important;
    border-bottom: none !important;
    box-shadow: none !important;
}
body .navbar-brand { color: var(--pt-ink) !important; }
/* Logo: dark-lettered version on light backgrounds, white-lettered version in dark mode (no badge) */
.logo-for-dark { display: none !important; }
html[data-theme="dark"] .logo-for-light { display: none !important; }
html[data-theme="dark"] .logo-for-dark { display: block !important; }
body .navbar-brand img {
    height: 30px !important;
    margin-right: 0 !important;
}
body .navbar-brand span {
    background: none !important;
    -webkit-text-fill-color: var(--pt-ink) !important;
    color: var(--pt-ink) !important;
}
body .navbar-nav { gap: 0.25rem !important; }
body .navbar-nav a, body .navbar-nav-item {
    white-space: nowrap !important;
}
body .navbar-nav a {
    padding: 0.6rem 0.85rem !important;
    color: var(--pt-muted) !important;
    font-weight: 500 !important;
    border: 1px solid transparent !important;
    border-radius: var(--pt-radius-pill) !important;
    transform: none !important;
}
body .navbar-nav a:hover { background: rgba(255, 255, 255, 0.7) !important; color: var(--pt-ink) !important; }
body .navbar-nav a.active {
    background: var(--pt-surface) !important;
    color: var(--pt-ink) !important;
    box-shadow: var(--pt-shadow) !important;
}
body .navbar-nav .join-btn a, body .navbar-nav-item {
    background: var(--pt-lime) !important;
    color: var(--pt-on-lime-fill) !important;
    border: none !important;
    border-radius: var(--pt-radius-pill) !important;
    transform: none !important;
}
body .navbar-nav-item:hover, body .navbar-nav .join-btn a:hover { background: var(--pt-lime-deep) !important; color: var(--pt-on-lime-fill) !important; }
body .navbar-gold-balance {
    background: var(--pt-surface) !important;
    border: none !important;
    border-radius: var(--pt-radius-pill) !important;
    color: var(--pt-ink) !important;
    box-shadow: var(--pt-shadow);
}
body .navbar-gold-balance i { color: #D4A017; }
body .navbar-avatar {
    background: var(--pt-ink-bg) !important;
    color: var(--pt-lime-light) !important;
    border: none !important;
}
body .navbar-dropdown-content {
    background: var(--pt-surface) !important;
    border: none !important;
    border-radius: var(--pt-radius-sm) !important;
    box-shadow: var(--pt-shadow) !important;
    overflow: hidden;
}
body .navbar-dropdown-content a {
    color: var(--pt-ink) !important;
    font-weight: 500 !important;
    border-bottom: 1px solid var(--pt-border) !important;
}
body .navbar-dropdown-content a:hover { background: var(--pt-surface-2) !important; color: var(--pt-ink) !important; }
body .unread-badge, body .notification-badge { border-color: var(--pt-bg) !important; }

/* ---------- Footer placed at page level: clear the fixed sidebar ---------- */
@media (min-width: 769px) {
    body #sidebar ~ footer {
        margin-left: 280px;
        transition: margin-left 0.3s ease;
    }
    body #sidebar.collapsed ~ footer {
        margin-left: 80px;
    }
}

/* ---------- Modals: dim backdrop + light rounded panel everywhere ----------
   Every modal on the site is a fixed overlay whose id ends in "Modal"; several
   were built for the old dark design (bg-gray-800 panels, white text). */
body [id$="Modal"].fixed {
    background-color: rgba(24, 25, 27, 0.45) !important;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
body [id$="Modal"].fixed > div {
    background: var(--pt-surface) !important;
    color: var(--pt-ink) !important;
    border: none !important;
    border-radius: var(--pt-radius) !important;
    box-shadow: 0 24px 60px rgba(16, 24, 40, 0.25) !important;
}
body [id$="Modal"] .bg-gray-800, body [id$="Modal"] .bg-gray-900 { background-color: var(--pt-surface) !important; }
body [id$="Modal"] .bg-gray-700, body [id$="Modal"] .bg-gray-600 { background-color: var(--pt-surface-2) !important; }
body [id$="Modal"] .text-white:not([class*="bg-black"]):not([class*="bg-red"]):not([class*="bg-green"]):not([class*="bg-indigo"]):not([class*="bg-blue"]) { color: var(--pt-ink) !important; }
body [id$="Modal"] .text-gray-300, body [id$="Modal"] .text-gray-400 { color: var(--pt-muted) !important; }
body [id$="Modal"] .border-gray-600, body [id$="Modal"] .border-gray-700 { border-color: var(--pt-border) !important; }
body [id$="Modal"] .hover\:text-white:hover { color: var(--pt-ink) !important; }

/* landing page nav in dark mode */
html[data-theme="dark"] .nav { background: rgba(17, 19, 21, 0.8) !important; border-bottom-color: var(--pt-border) !important; }
html[data-theme="dark"] .nav-links a:hover { background: var(--pt-surface-2) !important; }

/* ---------- App pages: shared typography and cards (same look as the main dashboard) ---------- */
body:has(#sidebar) .main-content h1, body:has(#sidebar) .main-content h2, body:has(#sidebar) .main-content h3 { font-weight: 400 !important; }
body:has(#sidebar) .main-content .gradient-text { color: var(--pt-ink); background: none; -webkit-text-fill-color: currentColor; }
body:has(#sidebar) .main-content .font-bold, body:has(#sidebar) .main-content .font-semibold, body:has(#sidebar) .main-content b, body:has(#sidebar) .main-content strong { font-weight: 500 !important; }
body:has(#sidebar) .main-content .text-2xl.font-bold, body:has(#sidebar) .main-content .text-3xl.font-bold, body:has(#sidebar) .main-content .text-xl.font-bold { font-weight: 400 !important; }
    .dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
    .dash-hello, .dash-sub { margin: 0; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.25; letter-spacing: -0.02em; }
    .dash-hello { font-weight: 400; color: var(--pt-ink); }
    .dash-sub { font-weight: 300; color: var(--pt-muted); }
    .dash-date { margin: 12px 0 0; font-size: 15px; color: var(--pt-muted); }
    .dash-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
    .dash-host { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: none; cursor: pointer; font: inherit; font-weight: 500; font-size: 15px; background: var(--pt-lime); color: var(--pt-on-lime-fill); box-shadow: none; transition: background 0.2s ease, transform 0.2s ease; }
    .dash-host:hover { background: var(--pt-lime-deep); transform: translateY(-1px); }
    .dash-stats { display: flex; flex-wrap: wrap; gap: 28px 40px; margin-top: 44px; }
    @media (max-width: 760px) { .dash-stats { gap: 24px 32px; margin-top: 28px; } }
    .dash-stat b { display: block; font-size: clamp(28px, 2.9vw, 44px); font-weight: 400; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--pt-ink); white-space: nowrap; }
    .dash-stat span { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin-top: 12px; font-size: 14px; color: var(--pt-ink); }
    .dash-stat em { font-style: normal; color: var(--pt-muted); }
    .dash-link { border: none; background: none; padding: 0; cursor: pointer; font: inherit; font-weight: 500; color: var(--pt-green); }
    .dash-link i { font-size: 11px; }
    /* white cards, calmer titles */
    .main-content .card, .chart-card, .activity-card { background: var(--pt-surface) !important; border: none !important; border-radius: 24px !important; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 14px 36px rgba(16, 24, 40, 0.06) !important; }
    .main-content .card h2, .chart-card h2 { font-size: 22px; font-weight: 400; letter-spacing: -0.02em; }
    /* activity lists: thin divider rows instead of stacked pills */
    .main-content .activity-row { background: transparent !important; border-radius: 0 !important; padding: 14px 4px !important; border-bottom: 1px solid var(--pt-border); box-shadow: none !important; }
    .main-content .space-y-4 > .activity-row { margin-top: 0 !important; }
    .main-content .activity-row:last-child { border-bottom: none; }
    .main-content .activity-row { transition: background 0.15s ease !important; }
    .main-content .activity-row:hover { background: rgba(var(--pt-lime-rgb), 0.08) !important; border-radius: var(--pt-radius-sm) !important; transform: none !important; }
    .main-content .activity-row .h-10.w-10 { background: rgba(var(--pt-lime-rgb), 0.24) !important; }
    .main-content .activity-row .h-10.w-10 i { color: var(--pt-on-lime) !important; }
    .main-content .activity-row .text-white { color: var(--pt-ink) !important; }
    .main-content .activity-row .text-lg { font-weight: 500; }

/* ---------- Loading spinner: the AI Chat ring, used everywhere something is loading ---------- */
.pt-spinner {
    display: inline-block; flex-shrink: 0;
    width: 1em; height: 1em; vertical-align: -0.15em;
    border: 0.17em solid currentColor; border-top: 0.05em solid var(--pt-border);
    border-radius: 50%; opacity: 0.85;
    animation: pt-spin 1s linear infinite;
}
.pt-spinner-lg { width: 2rem; height: 2rem; border-width: 4px; border-top-width: 1px; color: #666666; opacity: 1; }
[data-theme="dark"] .pt-spinner-lg { color: var(--pt-muted); }
@keyframes pt-spin { to { transform: rotate(360deg); } }

/* No focus ring when a button or link is clicked with a mouse or finger (Tailwind's base styles add one).
   Keyboard users still get a soft green ring so they can see where they are. */
button:focus:not(:focus-visible), a:focus:not(:focus-visible), [role="tab"]:focus:not(:focus-visible), [tabindex]:focus:not(:focus-visible) { outline: none; }
button:focus-visible, a:focus-visible, [role="tab"]:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--pt-on-lime); outline-offset: 2px; }

/* ================= Phones and tablets only (desktop is untouched) ================= */
@media (max-width: 1024px) {
    /* the navbar ☰ menu replaces the sidebar, so it never sits over the page */
    body:has(#navbarMobileBtn) .sidebar:not(.mobile-open) { display: none !important; }
    body:has(#navbarMobileBtn) .main-content { margin-left: 0 !important; width: 100% !important; }
}

@media (max-width: 768px) {
    /* page headings with actions (dashboard, earnings, settings): heading on top, actions below */
    .dash-head { flex-direction: column; gap: 14px; }
    .dash-hello, .dash-sub { font-size: 22px; }
    .dash-actions { width: 100%; justify-content: space-between; }

    /* Top earners: rank, photo, name and amount fit on one row */
    .earner-progress { display: none !important; }
    .earner-item .share-earnings-icon { width: 32px !important; height: 32px !important; flex-shrink: 0; }
}

@media (max-width: 768px) {
    /* page content never grows wider than the screen (flex items default to their content's width) */
    body:has(#navbarMobileBtn) .main-content > * { min-width: 0; max-width: 100%; }
}
@media (max-width: 768px) {
    /* decorative pieces that poke past the edge (the stacked level cards) don't widen the page */
    body:has(#navbarMobileBtn) .main-content { overflow-x: clip; }
}

/* ---------- Our dropdown (js/pt-select.js) in place of the browser's select menu ---------- */
.pt-select { position: relative; display: inline-block; vertical-align: middle; max-width: 100%; }
.pt-select.pt-select-block { display: block; width: 100%; }
.pt-select > select { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; opacity: 0 !important; pointer-events: none !important; }
/* Default look; a page's own classes on the select (copied to the button) win over this */
button:where(.pt-select-btn) { padding: 10px 14px; border: 1px solid var(--pt-border); border-radius: 12px; background: var(--pt-surface); color: var(--pt-ink); }
.pt-select-btn { display: inline-flex !important; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-width: 0; text-align: left; font: inherit; cursor: pointer; }
.pt-select-btn:disabled { cursor: not-allowed; opacity: 0.6; }
.pt-select-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-select-btn.pt-select-placeholder .pt-select-text { color: var(--pt-muted); }
.pt-select-btn > i { flex-shrink: 0; font-size: 16px; color: var(--pt-muted); transition: transform 0.15s ease; }
.pt-select.open .pt-select-btn > i { transform: rotate(180deg); }
.pt-select.open .pt-select-btn { border-color: var(--pt-lime); box-shadow: 0 0 0 3px rgba(var(--pt-lime-rgb), 0.25); }
.pt-select-panel { position: fixed; z-index: 4000; display: flex; flex-direction: column; max-width: calc(100vw - 16px); padding: 6px; background: var(--pt-surface); color: var(--pt-ink); border-radius: 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 16px 40px rgba(16, 24, 40, 0.16); animation: ptSelectIn 0.12s ease-out; }
@keyframes ptSelectIn { from { opacity: 0; transform: translateY(-4px); } }
.pt-select-search { margin: 0 0 6px; padding: 10px 12px; border: 1px solid var(--pt-border); border-radius: 10px; background: var(--pt-surface); color: var(--pt-ink); font: inherit; font-size: 15px; }
.pt-select-search:focus { outline: none; border-color: var(--pt-lime); }
.pt-select-list { margin: 0; padding: 0; list-style: none; overflow-y: auto; min-height: 0; }
.pt-select-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 15px; white-space: nowrap; }
.pt-select-list li.active { background: var(--pt-surface-2); }
.pt-select-list li[aria-selected="true"] { color: var(--pt-on-lime); background: rgba(var(--pt-lime-rgb), 0.24); }
.pt-select-list li[aria-selected="true"]::after { content: "\2713"; }
.pt-select-list li.disabled { opacity: 0.45; cursor: not-allowed; }
.pt-select-list li.pt-select-none { color: var(--pt-muted); cursor: default; }

/* ---------- Notification bell (src/components/navbar.php) ---------- */
.nb-wrap { position: relative; }
.nb-bell { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border: none; border-radius: 50%; background: var(--pt-surface); color: var(--pt-ink); box-shadow: var(--pt-shadow); cursor: pointer; }
.nb-bell > i { font-size: 21px; }
.nb-bell:hover { background: var(--pt-surface-2); }
.nb-count { position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px; border: 2px solid var(--pt-bg); background: #ef4444; color: #fff; font-size: 11px; font-weight: 500; line-height: 1; }
.nb-count[hidden] { display: none; }
.nb-bell.ring > i { animation: nbRing 0.9s ease; transform-origin: 50% 10%; }
@keyframes nbRing { 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
.nb-panel { position: absolute; right: 0; top: calc(100% + 10px); z-index: 3000; width: min(380px, calc(100vw - 24px)); background: var(--pt-surface); color: var(--pt-ink); border-radius: 18px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 18px 48px rgba(16, 24, 40, 0.18); overflow: hidden; animation: ptSelectIn 0.14s ease-out; }
.nb-panel[hidden] { display: none; }
.nb-head { padding: 14px 18px; font-size: 16px; font-weight: 500; border-bottom: 1px solid var(--pt-border); }
.nb-list { margin: 0; padding: 6px; list-style: none; max-height: min(440px, calc(100vh - 140px)); overflow-y: auto; }
.nb-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; color: inherit; text-decoration: none; }
a.nb-item:hover { background: var(--pt-surface-2); }
.nb-item { position: relative; padding-right: 26px; }
.nb-item.unread::after { content: ''; position: absolute; right: 12px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--pt-on-lime); }   /* unread: small dot, no fill */
.nb-pic { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-weight: 500; background: rgba(var(--pt-lime-rgb), 0.24); color: var(--pt-on-lime); }
.nb-body { min-width: 0; }
.nb-body p { margin: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.nb-body span { font-size: 12px; color: var(--pt-muted); }
.nb-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 12px; color: var(--pt-muted); font-size: 14px; }
.nb-empty i { font-size: 28px; }
/* Phones/tablets: the user section is hidden, but keep the bell next to the ☰ button */
@media (max-width: 1024px) {
    body .navbar-user:has(.nb-wrap) { display: flex !important; gap: 0; }
    body .navbar-user:has(.nb-wrap) > :not(.nb-wrap) { display: none !important; }
    .nb-bell { width: 40px; height: 40px; }
}

/* ---------- Withdraw popup (dashboard + earnings): same look as the settings modals ---------- */
.wd-overlay:not([hidden]) { position: fixed; inset: 0; z-index: 2500; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(17, 19, 21, 0.55); }
.wd-modal { width: min(460px, 100%); max-height: calc(var(--app-vh, 100vh) - 40px); overflow-y: auto; background: var(--pt-surface); color: var(--pt-ink); border-radius: 22px; padding: 22px 24px 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3); }
.wd-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.wd-head h3 { margin: 0; font-size: 19px; font-weight: 500; }
.wd-head button { border: none; background: none; font-size: 26px; line-height: 1; color: var(--pt-muted); cursor: pointer; }
.wd-form { display: grid; gap: 10px; }
.wd-label { display: block; font-weight: 500; font-size: 14px; margin-top: 6px; }
.wd-balance { font-size: 32px; font-weight: 400; letter-spacing: -0.02em; }
.wd-input { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--pt-border); background: var(--pt-surface); color: var(--pt-ink); font: inherit; }
.wd-input:focus { outline: none; border-color: var(--pt-lime); box-shadow: 0 0 0 3px rgba(var(--pt-lime-rgb), 0.25); }
.wd-hint { margin: 0; font-size: 13px; color: var(--pt-muted); }
.wd-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.wd-submit { border: none; cursor: pointer; padding: 12px 22px; border-radius: var(--pt-radius-pill); font: inherit; font-weight: 500; background: var(--pt-lime); color: var(--pt-on-lime-fill); }
.wd-submit:hover { filter: brightness(0.95); }
.wd-cancel { border: none; background: none; font: inherit; font-weight: 500; cursor: pointer; color: var(--pt-muted); }
.wd-method { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--pt-bg); font-weight: 500; }
.wd-method i { font-size: 20px; color: var(--pt-muted); }
.wd-overlay[hidden] { display: none; }
@keyframes wdSheetUp { from { transform: translateY(100%); } to { transform: none; } }
/* phones: withdraw opens as a bottom sheet with full-width buttons */
@media (max-width: 768px) {
    .wd-overlay:not([hidden]) { align-items: flex-end; padding: 0; z-index: 3000; }
    .wd-modal { width: 100%; max-height: calc(var(--app-dvh, 100dvh) - 40px); border-radius: 22px 22px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); animation: wdSheetUp 0.25s ease-out; }
    .wd-modal::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--pt-border); margin: 0 auto 12px; }
    .wd-balance { font-size: 28px; }
    .wd-buttons { flex-direction: column; align-items: stretch; gap: 6px; }
    .wd-submit { width: 100%; padding: 14px; }
    .wd-cancel { width: 100%; padding: 10px; }
}

/* Toasts always sit above popups and their dimmed background (popups use z-index 2500–4000) */
#toast, .toast, .set-toast, .dh-toast { z-index: 6000 !important; }
a.wd-submit { display: inline-flex; justify-content: center; align-items: center; }

/* Popups: lock the page behind (js/pt-modal-lock.js adds the class) and keep scrolling inside the popup */
html.pt-modal-open, html.pt-modal-open body { overflow: hidden !important; }
[id$="Modal"], [id$="Modal"] *, .set-panel, .set-panel *, .dh-overlay *, .wd-overlay *, .ht-overlay *, .sub-overlay *, .share-modal *, .dv-overlay *, .pt-select-panel, .pt-select-list, .nb-list { overscroll-behavior: contain; }

/* ---------- Confirm popup (js/pt-confirm.js), in place of the browser's confirm() ---------- */
.pc-overlay:not([hidden]) { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(17, 19, 21, 0.55); }
.pc-overlay[hidden] { display: none; }
.pc-modal { width: min(400px, 100%); background: var(--pt-surface); color: var(--pt-ink); border-radius: 22px; padding: 26px 24px 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3); text-align: center; animation: pcIn 0.16s ease-out; }
@keyframes pcIn { from { opacity: 0; transform: scale(0.96); } }
.pc-icon { width: 52px; height: 52px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: rgba(var(--pt-lime-rgb), 0.24); color: var(--pt-on-lime); }
.pc-icon i { font-size: 26px; }
.pc-modal.danger .pc-icon { background: #FEE2E2; color: #DC2626; }
.pc-modal h3 { margin: 0; font-size: 19px; font-weight: 500; }
.pc-modal p { margin: 8px 0 0; font-size: 15px; color: var(--pt-muted); line-height: 1.5; }
.pc-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.pc-buttons button { padding: 12px 16px; border-radius: 999px; border: none; font: inherit; font-weight: 500; cursor: pointer; }
.pc-cancel { background: var(--pt-surface-2); color: var(--pt-ink); }
.pc-cancel:hover { background: var(--pt-border); }
.pc-ok { background: var(--pt-lime); color: var(--pt-on-lime-fill); }
.pc-ok:hover { background: var(--pt-lime-deep); }
.pc-modal.danger .pc-ok { background: #DC2626; color: #fff; }
.pc-modal.danger .pc-ok:hover { background: #B91C1C; }

/* Footer always at the bottom of the screen: on short pages the body fills the screen and the footer
   sits at the end instead of floating up into the middle (it is a direct child of <body> on every page) */
body:has(> footer.foot) { min-height: var(--app-vh, 100vh); min-height: var(--app-dvh, 100dvh); display: flex; flex-direction: column; }   /* --app-vh undoes the 90% desktop zoom */
body:has(> footer.foot) > footer.foot { margin-top: auto; }

/* Earnings still clearing (EARNINGS_CLEARING_DAYS) under the Available balance, and in the transactions table */
.clearing-note { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-style: normal; font-size: 12.5px; color: var(--pt-muted); }
.clearing-note i { font-size: 14px; }
.tx-pill.tx-clearing { background: #fff4d6; color: #8a5a00; }
