/* HandsOn site-wide palette overrides. Default (warm-charcoal) = page's native styling. */

/* ---------- Floating picker ---------- */
#hs-palette-btn{position:fixed;bottom:84px;right:16px;z-index:2147483000;width:44px;height:44px;border-radius:50%;
  border:1px solid var(--border-subtle,#3a3d42);background:var(--bg-surface-elevated,#26292d);color:var(--text-primary,#e4e2de);
  font-size:20px;line-height:1;cursor:pointer;box-shadow:0 2px 10px rgba(0,0,0,.35);}
#hs-palette-btn:hover{border-color:var(--accent-main,#f59e0b);}
#hs-palette-menu{position:fixed;bottom:136px;right:16px;z-index:2147483001;display:none;min-width:230px;padding:6px;
  border-radius:12px;border:1px solid var(--border-subtle,#3a3d42);background:var(--bg-surface,#1f2124);color:var(--text-primary,#e4e2de);
  box-shadow:0 8px 30px rgba(0,0,0,.45);font-family:ui-sans-serif,system-ui,sans-serif;}
#hs-palette-menu.hs-open{display:block;}
#hs-palette-menu .hs-pm-head{font-size:10px;letter-spacing:.08em;opacity:.7;padding:8px 10px 4px;}
#hs-palette-menu .hs-pm-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:9px 10px;border:0;
  background:transparent;color:inherit;font-size:13px;border-radius:8px;cursor:pointer;}
#hs-palette-menu .hs-pm-item:hover{background:var(--accent-subtle,rgba(245,158,11,.12));}
#hs-palette-menu .hs-pm-item.hs-on{color:var(--accent-main,#f59e0b);}
#hs-palette-menu .hs-check{margin-left:auto;}
.hs-dot{width:12px;height:12px;border-radius:50%;display:inline-block;border:1px solid rgba(128,128,128,.5);}
.hs-dot-warm-charcoal{background:#18191b;}
.hs-dot-warm-paper{background:#f6f3eb;}
.hs-dot-calm-sage{background:#34d399;}
.hs-dot-classic-web{background:#ffffff;}

/* ---------- App (React) — Classic Web variable override ---------- */
html[data-hs-palette="classic-web"] .theme-warm-paper,
html[data-hs-palette="classic-web"] .theme-warm-charcoal,
html[data-hs-palette="classic-web"] .theme-calm-sage{
  --bg-main:#ffffff;--bg-surface:#f5f6f7;--bg-surface-elevated:#eceef0;--bg-header:#ffffff;
  --border-subtle:#dcdfe4;--border-focus:#b9bec7;
  --text-primary:#111418;--text-secondary:#4b5563;--text-muted:#6b7280;
  --accent-main:#b45309;--accent-subtle:rgba(180,83,9,.10);--accent-border:rgba(180,83,9,.30);--accent-hover:#92400e;
  --status-success:#059669;--status-success-subtle:rgba(5,150,105,.15);--status-warning:#d97706;--status-alert:#dc2626;
}
html[data-hs-palette="classic-web"] body{background:#ffffff!important;color:#111418!important;}
html[data-hs-palette="classic-web"] [class*="bg-[#18191b]"],
html[data-hs-palette="classic-web"] [class*="bg-[#f6f3eb]"],
html[data-hs-palette="classic-web"] [class*="bg-[#141c19]"]{background-color:var(--bg-main)!important;}
html[data-hs-palette="classic-web"] [class*="text-[#e4e2de]"],
html[data-hs-palette="classic-web"] [class*="text-[#23201d]"],
html[data-hs-palette="classic-web"] [class*="text-[#e1ece7]"]{color:var(--text-primary)!important;}

/* ---------- Server-rendered hub & guide pages (coarse retheme) ---------- */
html[data-hs-palette="warm-paper"] body,
html[data-hs-palette="classic-web"] body{color:#111418!important;}
html[data-hs-palette="warm-paper"] [class*="text-neutral"],html[data-hs-palette="warm-paper"] [class*="text-gray"],
html[data-hs-palette="warm-paper"] [class*="text-zinc"],html[data-hs-palette="warm-paper"] [class*="text-stone"],
html[data-hs-palette="warm-paper"] .text-white,
html[data-hs-palette="classic-web"] [class*="text-neutral"],html[data-hs-palette="classic-web"] [class*="text-gray"],
html[data-hs-palette="classic-web"] [class*="text-zinc"],html[data-hs-palette="classic-web"] [class*="text-stone"],
html[data-hs-palette="classic-web"] .text-white{color:#374151!important;}
html[data-hs-palette="warm-paper"] h1,html[data-hs-palette="warm-paper"] h2,html[data-hs-palette="warm-paper"] h3,
html[data-hs-palette="classic-web"] h1,html[data-hs-palette="classic-web"] h2,html[data-hs-palette="classic-web"] h3{color:#111418!important;}
html[data-hs-palette="warm-paper"] [class*="border-neutral"],html[data-hs-palette="warm-paper"] [class*="border-zinc"],
html[data-hs-palette="warm-paper"] [class*="border-gray"],html[data-hs-palette="warm-paper"] [class*="border-white"],
html[data-hs-palette="classic-web"] [class*="border-neutral"],html[data-hs-palette="classic-web"] [class*="border-zinc"],
html[data-hs-palette="classic-web"] [class*="border-gray"],html[data-hs-palette="classic-web"] [class*="border-white"]{border-color:#d7dade!important;}
html[data-hs-palette="warm-paper"] [class*="text-amber"],
html[data-hs-palette="classic-web"] [class*="text-amber"]{color:#92400e!important;}

/* Warm Parchment page + surfaces */
html[data-hs-palette="warm-paper"] body{background:#f6f3eb!important;}
html[data-hs-palette="warm-paper"] [class*="bg-[#18191b]"]{background-color:#ece7dc!important;}
html[data-hs-palette="warm-paper"] [class*="bg-[#141517]"]{background-color:#ded7c7!important;}
html[data-hs-palette="warm-paper"] [class*="border-neutral"]{border-color:#d5ccba!important;}

/* Classic Web page + surfaces (white page, black text) */
html[data-hs-palette="classic-web"] body{background:#ffffff!important;}
html[data-hs-palette="classic-web"] [class*="bg-[#18191b]"]{background-color:#f5f6f7!important;}
html[data-hs-palette="classic-web"] [class*="bg-[#141517]"]{background-color:#ffffff!important;box-shadow:0 1px 0 #e5e7eb;}

/* Calm Sage page + surfaces */
html[data-hs-palette="calm-sage"] body{background:#141c19!important;color:#e1ece7!important;}
html[data-hs-palette="calm-sage"] [class*="bg-[#18191b]"]{background-color:#1b2522!important;}
html[data-hs-palette="calm-sage"] [class*="bg-[#141517]"]{background-color:#101715!important;}
html[data-hs-palette="calm-sage"] [class*="text-amber"]{color:#34d399!important;}
html[data-hs-palette="calm-sage"] [class*="bg-amber"]{background-color:#34d399!important;color:#0b1512!important;}
html[data-hs-palette="calm-sage"] [class*="border-neutral"]{border-color:#283933!important;}

/* Classic Web: lighten the camera standby stage (paper-branch text/buttons are designed for light) */
html[data-hs-palette="classic-web"] [class*="bg-[#23201d]"],
html[data-hs-palette="classic-web"] [class*="bg-[#121315]"],
html[data-hs-palette="classic-web"] [class*="bg-[#0f1412]"]{background-color:#eceef0!important;}

/* Light palettes: fix dark chips (Beginner badge, etc.) so text is readable */
html[data-hs-palette="warm-paper"] [class*="bg-neutral-7"],
html[data-hs-palette="warm-paper"] [class*="bg-neutral-8"],
html[data-hs-palette="warm-paper"] [class*="bg-neutral-9"]{background-color:#ded7c7!important;}
html[data-hs-palette="classic-web"] [class*="bg-neutral-7"],
html[data-hs-palette="classic-web"] [class*="bg-neutral-8"],
html[data-hs-palette="classic-web"] [class*="bg-neutral-9"]{background-color:#e5e7eb!important;}
/* badge + timing text: ensure a readable dark-enough tone on the light chip/bg */
html[data-hs-palette="warm-paper"] [class*="text-neutral-4"],html[data-hs-palette="warm-paper"] [class*="text-neutral-5"],
html[data-hs-palette="classic-web"] [class*="text-neutral-4"],html[data-hs-palette="classic-web"] [class*="text-neutral-5"]{color:#374151!important;}

/* Light palettes: green/emerald text was low-contrast (Live SEO, Earned, Cached, royalty) */
html[data-hs-palette="warm-paper"] [class*="text-emerald"],
html[data-hs-palette="classic-web"] [class*="text-emerald"],
html[data-hs-palette="warm-paper"] [class*="text-[#34d399]"],
html[data-hs-palette="classic-web"] [class*="text-[#34d399]"]{color:#047857!important;}
/* dark emerald chip backgrounds -> light green chip on light palettes */
html[data-hs-palette="warm-paper"] [class*="bg-emerald-9"],
html[data-hs-palette="warm-paper"] [class*="bg-emerald-8"],
html[data-hs-palette="classic-web"] [class*="bg-emerald-9"],
html[data-hs-palette="classic-web"] [class*="bg-emerald-8"]{background-color:#d1fae5!important;}
html[data-hs-palette="warm-paper"] [class*="border-emerald"],
html[data-hs-palette="classic-web"] [class*="border-emerald"]{border-color:#6ee7b7!important;}

/* Classic Web: remap the parchment surface hexes (hardcoded in components) to white/grey */
html[data-hs-palette="classic-web"] [class*="bg-[#ece7dc]"]{background-color:#f5f6f7!important;}
html[data-hs-palette="classic-web"] [class*="bg-[#e2dcce]"]{background-color:#eceef0!important;}
html[data-hs-palette="classic-web"] [class*="bg-[#ded7c7]"]{background-color:#ffffff!important;}
html[data-hs-palette="classic-web"] [class*="bg-[#f6f3eb]"]{background-color:#ffffff!important;}
html[data-hs-palette="classic-web"] [class*="border-[#d5ccba]"],
html[data-hs-palette="classic-web"] [class*="border-[#baae98]"],
html[data-hs-palette="classic-web"] [class*="border-[#baaE98]"]{border-color:#dcdfe4!important;}
html[data-hs-palette="classic-web"] [class*="text-[#23201d]"]{color:#111418!important;}
html[data-hs-palette="classic-web"] [class*="text-[#5c554e]"]{color:#4b5563!important;}
html[data-hs-palette="classic-web"] [class*="text-[#887e74]"]{color:#6b7280!important;}

/* Fix: "Ask Any Task" generator button clipping in narrow windows */
#open-generator-btn{white-space:normal!important;height:auto!important;min-height:2.2rem;overflow:visible!important;line-height:1.12;padding-top:5px!important;padding-bottom:5px!important;}
#open-generator-btn span{white-space:normal!important;}

/* Fix: sidebar "Ask Any Task" button clipping in narrow windows */
[aria-label="Generate a guide for any task"]{white-space:normal!important;height:auto!important;min-height:1.9rem;line-height:1.12;overflow:visible!important;text-align:center;}
[aria-label="Generate a guide for any task"] span{white-space:normal!important;}
div:has(> [aria-label="Generate a guide for any task"]){flex-wrap:wrap!important;row-gap:6px;}
