/* ==========================================================================
   HxH Store · refine layer (loaded LAST)
   - compact sidebar + collapsible rail + slim scrollbar
   - readable APK card with Android icon
   - referral hero / reward cards contrast fix + new SVG
   - step-by-step register wizard
   - calmer page switching (no "reload" feel)
   ========================================================================== */
:root{
  --hx-sb-w:218px;
  --hx-sb-w-collapsed:72px;
  --hx-parrot:#b5eb63;
  --hx-green:#17a67a;
  --hx-deep:#0f5a43;
  --hx-deeper:#08382a;
}

/* ---------- 1. Sidebar: smaller, tidier, collapsible (desktop) ---------- */
@media (min-width:1001px){
  html body .sidebar{
    width:var(--hx-sb-w) !important;
    display:flex !important;
    flex-direction:column;
    padding:16px 10px 12px !important;
    gap:0;
    transition:width .24s cubic-bezier(.22,1,.36,1) !important;
    overflow-x:hidden;
  }
  html body .workspace{
    margin-left:var(--hx-sb-w) !important;
    transition:margin-left .24s cubic-bezier(.22,1,.36,1);
  }
  html.sb-collapsed body .sidebar{width:var(--hx-sb-w-collapsed) !important;padding-left:8px !important;padding-right:8px !important}
  html.sb-collapsed body .workspace{margin-left:var(--hx-sb-w-collapsed) !important}
}

html body .sidebar .brand{
  display:flex;align-items:center;gap:10px;
  padding:2px 34px 2px 4px !important;margin:0 0 8px !important;min-height:40px;
}
html body .sidebar .brand img{width:34px !important;height:34px !important;border-radius:11px !important;flex:0 0 34px}
html body .sidebar .brand strong{font-size:15px !important;line-height:1.1}
html body .sidebar .brand small{font-size:9.5px !important;letter-spacing:.6px !important;opacity:.7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px;display:block}

html body .sidebar .nav-label{
  font-size:10px !important;letter-spacing:1.2px !important;font-weight:700;
  margin:12px 8px 4px !important;padding:0 !important;opacity:.55;
}
html body .sidebar .nav-item{
  display:flex !important;align-items:center;gap:10px;
  padding:7px 10px !important;margin:1px 0 !important;
  min-height:36px;font-size:13px !important;font-weight:650;line-height:1.2;
  border-radius:11px !important;
}
html body .sidebar .nav-item svg{width:17px !important;height:17px !important;flex:0 0 17px}
html body .sidebar .nav-item .badge{margin-left:auto;font-size:9px !important;padding:2px 6px !important;border-radius:999px !important;line-height:1.3}
html body .sidebar .nav-item.active{box-shadow:0 6px 16px -10px var(--rx-glow,rgba(23,166,122,.55)) !important}

/* collapse button (inside the sidebar so overflow never clips it) */
.sb-collapse{
  position:absolute;top:19px;right:10px;z-index:3;
  width:26px;height:26px;display:grid;place-items:center;padding:0;
  border-radius:9px !important;cursor:pointer;
  border:1px solid var(--rx-line,rgba(0,0,0,.1)) !important;
  background:var(--rx-card,#fff) !important;color:var(--rx-ink-2,#4d5b53) !important;
  transition:transform .24s cubic-bezier(.22,1,.36,1),background .18s,color .18s !important;
}
.sb-collapse svg{width:14px;height:14px}
.sb-collapse:hover{background:var(--rx-soft,#edf6df) !important;color:var(--rx-accent,#17a67a) !important}
@media (max-width:1000px){.sb-collapse{display:none !important}}

@media (min-width:1001px){
  html.sb-collapsed .sidebar .sb-collapse{position:static;margin:2px auto 8px;transform:rotate(180deg)}
  html.sb-collapsed .sidebar .brand{justify-content:center;padding:2px !important}
  html.sb-collapsed .sidebar .brand>div{display:none}
  html.sb-collapsed .sidebar .nav-label{
    height:1px;margin:10px 12px !important;font-size:0 !important;opacity:1;
    background:var(--rx-line,rgba(0,0,0,.1));
  }
  html.sb-collapsed .sidebar .nav-item{justify-content:center;padding:9px 0 !important;position:relative}
  html.sb-collapsed .sidebar .nav-item>span:not(.badge){display:none}
  html.sb-collapsed .sidebar .nav-item .badge{
    position:absolute;top:3px;right:6px;margin:0;width:8px;height:8px;padding:0 !important;font-size:0 !important;
  }
  html.sb-collapsed .sidebar .help-card,
  html.sb-collapsed .sidebar .sidebar-bottom>small{display:none !important}
  html.sb-collapsed .sidebar .sidebar-install{justify-content:center;padding:9px 0 !important}
  html.sb-collapsed .sidebar .sidebar-install .install-copy,
  html.sb-collapsed .sidebar .sidebar-install .install-dl{display:none !important}
}

/* slim scrollbar that only shows while you hover the menu */
html body .sidebar{scrollbar-width:thin;scrollbar-color:transparent transparent}
html body .sidebar:hover{scrollbar-color:rgba(23,166,122,.45) transparent}
html body .sidebar::-webkit-scrollbar{width:6px}
html body .sidebar::-webkit-scrollbar-track{background:transparent;margin:10px 0}
html body .sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:999px;border:1px solid transparent;background-clip:padding-box;transition:background .2s}
html body .sidebar:hover::-webkit-scrollbar-thumb{background:rgba(23,166,122,.4);background-clip:padding-box}
html body .sidebar::-webkit-scrollbar-thumb:hover{background:var(--hx-green);background-clip:padding-box}

/* bottom block: smaller */
html body .sidebar .sidebar-bottom{margin-top:auto;padding:14px 4px 0 !important;display:flex;flex-direction:column;gap:8px}
html body .sidebar .sidebar-bottom>small{font-size:10px !important;text-align:center;opacity:.55;margin-top:2px}
html body .sidebar .help-card{
  padding:12px !important;border-radius:16px !important;gap:4px;text-align:left;
}
html body .sidebar .help-card>svg{width:18px;height:18px}
html body .sidebar .help-card strong{font-size:12px !important;line-height:1.25}
html body .sidebar .help-card p{font-size:11px !important;margin:0 0 6px !important;line-height:1.35;opacity:.8}
html body .sidebar .help-card .btn{font-size:11px !important;padding:7px 10px !important;min-height:0 !important;width:100%;justify-content:center}

/* ---------- 2. Download APK card (was pale-on-pale, unreadable) ---------- */
html body #app .sidebar a.sidebar-install{
  position:relative;display:flex !important;align-items:center;gap:10px;width:100%;
  padding:10px 11px !important;border-radius:16px !important;text-decoration:none;
  background:linear-gradient(135deg,#17a67a 0%,#0f6b4f 100%) !important;
  border:1px solid rgba(255,255,255,.18) !important;
  color:#fff !important;
  box-shadow:0 10px 22px -12px rgba(15,107,79,.8),inset 0 1px 0 rgba(255,255,255,.22) !important;
  overflow:hidden;
  transition:transform .22s cubic-bezier(.22,1,.36,1),box-shadow .22s !important;
}
html body #app .sidebar a.sidebar-install::before{
  content:"";position:absolute;right:-26px;top:-26px;width:90px;height:90px;border-radius:50%;
  background:radial-gradient(circle,rgba(181,235,99,.35),transparent 70%);pointer-events:none;display:block !important;
}
html body #app .sidebar a.sidebar-install:hover{transform:translateY(-1px);box-shadow:0 14px 26px -12px rgba(15,107,79,.9),inset 0 1px 0 rgba(255,255,255,.25) !important}
html body #app .sidebar a.sidebar-install .install-glyph{
  flex:0 0 34px;width:34px;height:34px;display:grid;place-items:center;border-radius:11px;
  background:rgba(255,255,255,.18) !important;color:var(--hx-parrot) !important;
}
html body #app .sidebar a.sidebar-install .install-glyph svg{width:20px;height:20px;color:inherit !important}
html body #app .sidebar a.sidebar-install .install-copy{display:flex;flex-direction:column;min-width:0;flex:1;position:relative}
html body #app .sidebar a.sidebar-install strong{color:#fff !important;font-size:12.5px !important;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body #app .sidebar a.sidebar-install small{color:rgba(255,255,255,.82) !important;font-size:10.5px !important;line-height:1.3;background:none !important}
html body #app .sidebar a.sidebar-install .install-dl{
  flex:0 0 26px;width:26px;height:26px;display:grid;place-items:center;border-radius:50%;
  background:var(--hx-parrot);color:var(--hx-deeper);position:relative;
}
html body #app .sidebar a.sidebar-install .install-dl svg{width:14px;height:14px;color:inherit !important}

/* ---------- 3. Referral page: dark hero keeps light text ---------- */
html body #app .referral-hero{
  background:
    radial-gradient(ellipse 60% 90% at 88% 10%,rgba(181,235,99,.22),transparent 62%),
    radial-gradient(ellipse 50% 70% at 0% 100%,rgba(23,166,122,.35),transparent 70%),
    linear-gradient(125deg,#0f5a43 0%,#0a3f30 55%,#082c22 100%) !important;
  border:1px solid rgba(181,235,99,.28) !important;
  border-radius:28px !important;
  box-shadow:0 24px 50px -28px rgba(8,56,42,.9) !important;
  padding:34px 38px !important;
  color:#fff !important;
}
html body #app .referral-hero .eyebrow{
  background:rgba(181,235,99,.14) !important;border:1px solid rgba(181,235,99,.4) !important;color:var(--hx-parrot) !important;
  font-size:10px !important;letter-spacing:1.6px !important;
}
html body #app .referral-hero h2{
  color:#fff !important;-webkit-text-fill-color:#fff !important;background:none !important;
  font-size:clamp(28px,3.6vw,40px) !important;line-height:1.12 !important;letter-spacing:-.02em;margin:14px 0 12px !important;
}
html body #app .referral-hero h2 em{
  font-style:normal;color:var(--hx-parrot) !important;-webkit-text-fill-color:var(--hx-parrot) !important;background:none !important;
}
html body #app .referral-hero p{color:rgba(255,255,255,.84) !important;font-size:14.5px !important;line-height:1.65 !important;max-width:520px}
html body #app .referral-program-status{
  display:inline-flex;align-items:center;gap:8px;margin-top:16px;padding:7px 13px;border-radius:999px;
  background:rgba(255,255,255,.12) !important;border:1px solid rgba(255,255,255,.22) !important;
  color:#fff !important;font-size:12px !important;font-weight:700;
}
html body #app .referral-program-status i{width:8px;height:8px;border-radius:50%;background:var(--hx-parrot);box-shadow:0 0 0 4px rgba(181,235,99,.25)}
html body #app .referral-program-status.paused i{background:#f5a524;box-shadow:0 0 0 4px rgba(245,165,36,.25)}
html body #app .reward-network{flex:0 0 auto;width:260px;height:auto;max-width:42%;position:relative;z-index:1;filter:drop-shadow(0 18px 24px rgba(0,0,0,.25))}
.reward-network .rn-ring-a{transform-origin:130px 112px;animation:rnSpin 40s linear infinite}
.reward-network .rn-links{animation:rnDash 2.4s linear infinite}
.reward-network .rn-coin{animation:rnFloat 3.6s ease-in-out infinite}
@keyframes rnSpin{to{transform:rotate(360deg)}}
@keyframes rnDash{to{stroke-dashoffset:-18}}
@keyframes rnFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}

html body #app .reward-rule-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:0 0 20px}
html body #app .reward-rule{
  position:relative;display:flex !important;align-items:flex-start;gap:16px;padding:22px 22px 20px !important;border-radius:22px !important;
  background:var(--rx-card,#fff) !important;border:1px solid var(--rx-line,#e7e2d5) !important;color:var(--rx-ink,#15211b) !important;
  box-shadow:0 10px 26px -20px rgba(15,90,67,.45) !important;
}
html body #app .reward-rule small{color:var(--rx-muted,#6b7a70) !important;font-size:10.5px !important;letter-spacing:1.1px;font-weight:700;display:block;margin-bottom:8px}
html body #app .reward-rule strong{
  display:block;color:var(--hx-deep) !important;font-size:34px !important;line-height:1.05;letter-spacing:-.02em;margin-bottom:8px;
}
html[data-theme="black"] body #app .reward-rule strong,html[data-theme="midnight"] body #app .reward-rule strong{color:var(--hx-parrot) !important}
html body #app .reward-rule strong em{font-style:normal;color:var(--hx-green) !important;font-size:.7em}
html body #app .reward-rule p{color:var(--rx-ink-2,#4d5b53) !important;font-size:13px !important;line-height:1.55;margin:0 !important}
html body #app .reward-rule-icon{
  flex:0 0 46px;width:46px;height:46px;display:grid;place-items:center;border-radius:15px !important;
  background:linear-gradient(135deg,#e9f9d1,#c9f08f) !important;border:1px solid #b5eb63 !important;color:var(--hx-deep) !important;
}
html body #app .reward-rule-icon.green{background:linear-gradient(135deg,#d6f5e8,#a8e7cb) !important;border-color:#7fd6b2 !important}
html body #app .reward-rule-icon svg{width:22px;height:22px}
html body #app .rule-label{
  position:absolute;top:16px;right:16px;font-size:9.5px !important;letter-spacing:1.2px;font-weight:800;
  padding:4px 9px;border-radius:999px;background:var(--rx-soft,#edf6df) !important;color:var(--hx-deep) !important;
}
@media (max-width:1000px){
  html body #app .referral-hero{flex-direction:column;align-items:flex-start;padding:26px 22px !important}
  html body #app .reward-network{width:200px;max-width:70%;align-self:center}
}
@media (max-width:700px){html body #app .reward-rule-grid{grid-template-columns:1fr}}

/* ---------- 4. Step-by-step register ---------- */
.reg-progress{
  --reg-n:0;
  display:flex;justify-content:space-between;list-style:none;margin:4px 0 20px;padding:0;position:relative;
}
.reg-progress::before,.reg-progress::after{
  content:"";position:absolute;left:18px;top:17px;height:3px;border-radius:3px;
}
.reg-progress::before{right:18px;background:var(--rx-line,#dbe5d0)}
.reg-progress::after{width:calc((100% - 36px) * var(--reg-n));background:linear-gradient(90deg,var(--hx-green),var(--hx-parrot));transition:width .35s cubic-bezier(.22,1,.36,1)}
.reg-progress li{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:6px;flex:0 0 auto;min-width:56px}
.reg-progress li span{
  width:36px;height:36px;border-radius:50%;display:grid;place-items:center;font-weight:800;font-size:13px;
  background:var(--rx-card,#fff);border:2px solid var(--rx-line,#dbe5d0);color:var(--rx-muted,#6b7a70);
  transition:background .25s,border-color .25s,color .25s,transform .25s cubic-bezier(.34,1.56,.64,1);
}
.reg-progress li em{font-style:normal;font-size:11px;font-weight:700;color:var(--rx-muted,#6b7a70);transition:color .2s}
.reg-progress li.is-current span{background:var(--hx-parrot);border-color:#97ce47;color:var(--hx-deeper);transform:scale(1.08);box-shadow:0 0 0 5px rgba(181,235,99,.28)}
.reg-progress li.is-current em{color:var(--rx-ink,#15211b)}
.reg-progress li.is-done span{background:var(--hx-green);border-color:var(--hx-green);color:#fff;font-size:0}
.reg-progress li.is-done span::after{content:"✓";font-size:15px}
.reg-progress li.is-done em{color:var(--hx-green)}

.reg-step{display:none}
.reg-step.is-active{display:block;animation:regIn .24s cubic-bezier(.22,1,.36,1)}
@keyframes regIn{from{opacity:0;transform:translate3d(10px,0,0)}to{opacity:1;transform:none}}
.reg-step-head{margin:0 0 14px}
.reg-step-head h3{margin:0 0 4px;font-size:18px;letter-spacing:-.01em}
.reg-step-head p{margin:0;font-size:13px;opacity:.75;line-height:1.5}
.reg-two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.reg-hint{display:block;margin:-4px 0 6px}
.reg-nav{display:flex;gap:10px;margin-top:18px}
.reg-nav .btn{flex:1;justify-content:center}
.reg-nav .reg-back{flex:0 0 auto;min-width:96px}
.reg-nav .reg-back svg{transform:rotate(180deg)}
.reg-nav [hidden]{display:none !important}
.reg-error{display:block;margin-top:6px;font-size:12px;font-weight:600;color:#d1342f}
.field.has-error input,.field.has-error .password-wrap input{border-color:#e5484d !important;box-shadow:0 0 0 3px rgba(229,72,77,.14) !important}
@media (max-width:520px){.reg-two{grid-template-columns:1fr}.reg-progress li{min-width:48px}.reg-progress li em{font-size:10px}}

/* ---------- 5. Page switch: calm, no "reload" feeling ---------- */
html{scroll-behavior:auto !important}
#app[data-enter],#app[data-enter] *{animation:none !important}
html:not(.hx-lowfx) .content>.page-heading,
html:not(.hx-lowfx) .content>.auth-panel,
html:not(.hx-lowfx) .content>.apk-download-showcase,
html:not(.hx-lowfx) .product,
html:not(.hx-lowfx) .notification-item,
html:not(.hx-lowfx) .badge{animation:none !important}
html body .sidebar,html body .topbar{animation:none !important}
.page-enter>*,.page-enter>.admin-workspace>.page-heading,
.hxh-page-enter>*,.hxh-page-enter>*:nth-child(n),
.content>section,.content>div,.content>.panel{animation-delay:0s !important}
.page-enter>*,.page-enter>.admin-workspace>.page-heading,.hxh-page-enter>*{animation:none !important}
.reveal-item,.reveal-item.revealed{opacity:1 !important;transform:none !important;transition:none !important}
.content{overflow-anchor:none}
@media (prefers-reduced-motion:reduce){
  html body .content,.reg-step.is-active,.reward-network *{animation:none !important}
  .sidebar,.workspace{transition:none !important}
}

/* ---------- 6. Register page: compact header so the wizard sits above the fold ---------- */
html body #app .register-art-panel .auth-header-block{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-bottom:14px !important}
html body #app .register-art-panel .auth-art{display:none !important}
html body #app .register-art-panel .auth-brand-emblem{margin:0 !important}
html body #app .register-art-panel .auth-header-block h2{font-size:clamp(24px,3vw,30px) !important;line-height:1.15 !important;margin:2px 0 0 !important}
html body #app .register-art-panel .auth-header-block p{font-size:13px !important;line-height:1.55 !important;margin:0 !important;max-width:460px}
html body #app .register-art-panel .auth-footer-card{margin-top:18px}

/* ---------- 7. Top bar: one tidy row when the sidebar is visible ---------- */
@media (min-width:1001px){
  html body #app .topbar{flex-wrap:nowrap !important;gap:12px}
  html body #app .topbar .top-brand,html body #app .topbar .breadcrumb{display:none !important}
  html body #app .topbar .top-nav{flex:1 1 auto !important;min-width:0;gap:2px !important;flex-wrap:nowrap !important;overflow:hidden;justify-content:flex-start}
  html body #app .topbar .top-nav a{padding-left:11px !important;padding-right:11px !important;white-space:nowrap;flex:0 0 auto}
  html body #app .topbar .header-search{flex:0 1 230px !important;min-width:150px;width:auto !important}
  html body #app .topbar .top-actions{flex:0 0 auto}
}
@media (min-width:1001px) and (max-width:1240px){
  html body #app .topbar .top-nav a[href="/about"],html body #app .topbar .top-nav a[href="/contact"]{display:none !important}
  html body #app .topbar .header-search kbd{display:none}
}
/* Top menu: a link that does not fully fit wraps into a hidden second row instead of showing half-cut ("Cont") */
@media (min-width:1001px){
  html body #app .topbar .top-nav{flex-wrap:wrap !important;height:38px;max-height:38px;align-content:flex-start;row-gap:48px;overflow:hidden}
}
/* APK card: keep the title on one line */
html body #app .sidebar a.sidebar-install{padding:9px 10px !important;gap:9px}
html body #app .sidebar a.sidebar-install .install-glyph{flex-basis:32px;width:32px;height:32px}
html body #app .sidebar a.sidebar-install .install-dl{flex-basis:24px;width:24px;height:24px}
html body #app .sidebar a.sidebar-install strong{font-size:12px !important;overflow:visible;text-overflow:clip}
