/* HIEX Portal — single-page modular workspace */
:root {
    --hx-primary: #1A73E8;
    --hx-primary-dark: #1157b8;
    --hx-accent: #E91E63;
    --hx-ink: #1f2a44;
    --hx-muted: #66728a;
    --hx-glass: rgba(255, 255, 255, .78);
    --hx-glass-strong: rgba(255, 255, 255, .94);
    --hx-border: rgba(31, 42, 68, .12);
    --hx-shadow: 0 18px 40px rgba(18, 38, 84, .22);
    --hx-shadow-sm: 0 6px 18px rgba(18, 38, 84, .16);
    --hx-radius: 14px;
    --hx-topbar-h: 64px;
    --hx-tabs-h: 42px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--hx-ink);
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    background: #bfe3ff;
}

/* ---------- dreamy background (changeable) ---------- */
.hx-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background-color: #bfe3ff;
    background-size: cover;
    background-position: center;
    transition: background-image .6s ease;
}

.hx-bg-drift, .hx-bg-sparkles, .hx-bg-glow, .hx-bg-orbs {
    position: absolute;
    inset: -10%;
    pointer-events: none;
}

/* The whole background moves: a slow pan and zoom of the scene, light that breathes, floating orbs */
.hx-bg-scene, .hx-bg-live {
    position: absolute;
    inset: -4%;
    background-size: cover;
    background-position: center;
    animation: hx-scene 60s ease-in-out infinite alternate;
    will-change: transform;
}
.hx-bg-live svg { width: 100%; height: 100%; display: block; }
.hx-bg-live[hidden], .hx-bg-scene[hidden] { display: none; }

@keyframes hx-scene {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.05) translate(-1.2%, .6%); }
    100% { transform: scale(1.03) translate(1.2%, -.6%); }
}

.hx-bg-glow {
    background: radial-gradient(circle at 75% 15%, rgba(255, 246, 210, .55), transparent 40%),
                radial-gradient(circle at 15% 85%, rgba(186, 225, 255, .35), transparent 45%);
    animation: hx-glow 14s ease-in-out infinite alternate;
}
@keyframes hx-glow { from { opacity: .35; } to { opacity: .9; } }

.hx-bg-orbs span {
    position: absolute;
    bottom: -60px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 70%);
    animation: hx-orb 26s linear infinite;
}
.hx-bg-orbs span:nth-child(1) { left: 18%; animation-delay: -2s; }
.hx-bg-orbs span:nth-child(2) { left: 36%; width: 12px; height: 12px; animation-duration: 32s; animation-delay: -12s; }
.hx-bg-orbs span:nth-child(3) { left: 58%; width: 24px; height: 24px; animation-duration: 38s; animation-delay: -20s; }
.hx-bg-orbs span:nth-child(4) { left: 74%; animation-duration: 30s; animation-delay: -7s; }
.hx-bg-orbs span:nth-child(5) { left: 88%; width: 10px; height: 10px; animation-duration: 24s; animation-delay: -16s; }
@keyframes hx-orb {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: .8; }
    50% { transform: translate(40px, -55vh); }
    90% { opacity: .6; }
    100% { transform: translate(-30px, -110vh); opacity: 0; }
}

/* Motion switched off in the background picker */
.hx-bg.is-still *, .hx-bg.is-still { animation-play-state: paused !important; }

/* ---------- intro: the scene first, press it to enter ---------- */
.hx-intro-enter { display: none; }
body.hx-intro .hx-portal { opacity: 0; transform: translateY(20px) scale(.98); pointer-events: none; visibility: hidden; }
body.hx-intro { overflow: hidden; }
body.hx-intro .hx-intro-enter {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 500;
    border: 0;
    background: transparent;
    cursor: pointer;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 6vh 6vw;
    font-family: inherit;
}
.hx-intro-mark {
    position: absolute;
    top: 7vh;
    right: 7vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    opacity: .85;
    animation: hx-float 7s ease-in-out infinite;
}
.hx-intro-logo {
    width: clamp(54px, 4.6vw, 78px);
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, .55));
}
.hx-intro-slogan {
    font-size: .8rem;
    font-weight: 400;
    font-style: italic;
    letter-spacing: .06em;
    color: #1f4e6b;
    text-shadow: 0 0 10px rgba(255, 255, 255, .9);
    white-space: nowrap;
}
@keyframes hx-float { 50% { transform: translateY(-6px); } }
.hx-intro-hint {
    position: absolute;
    left: 50%;
    bottom: 5vh;
    transform: translateX(-50%);
    font-size: .82rem;
    font-weight: 400;
    letter-spacing: .14em;
    color: rgba(255, 255, 255, .85);
    text-shadow: 0 1px 6px rgba(0, 30, 40, .45);
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, .45);
    animation: hx-hint 3.2s ease-in-out infinite;
    white-space: nowrap;
}
@keyframes hx-hint { 50% { opacity: .45; } }

/* ---------- launch: pressing the scene starts the engine ---------- */
/* The logo lifts off, the camera pushes into the scene, then the machine assembles:
   top bar, search, pipes, the cog spins up, the screen powers on, the pop-up area and tabs rise. */
.hx-launch-logo {
    position: fixed;
    z-index: 600;
    pointer-events: none;
    filter: drop-shadow(0 10px 18px rgba(20, 40, 60, .25));
    animation: hx-liftoff 1.1s cubic-bezier(.5, 0, .75, 0) forwards;
}
@keyframes hx-liftoff {
    15% { transform: translateY(8px) scale(1.02); }
    to { transform: translateY(-80vh) scale(.35) rotate(-8deg); opacity: 0; }
}
body.hx-launching .hx-bg-live { animation: hx-push 2.6s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes hx-push { from { transform: scale(1); } 40% { transform: scale(1.05); } to { transform: scale(1); } }
body.hx-launching .hx-portal { transition: none; }
body.hx-launching .hx-topbar { animation: hx-drop .55s .25s cubic-bezier(.2, .8, .2, 1) both; }
body.hx-launching .hx-searchbar { transform-origin: 50% 0; animation: hx-unfold .5s .5s cubic-bezier(.2, .8, .2, 1) both; }
body.hx-launching .hx-pipe-shell, body.hx-launching .hx-pipe-core { stroke-dasharray: 1600; animation: hx-draw .7s .75s ease-out both; }
body.hx-launching .hx-pipe-flow, body.hx-launching .hx-pipe-flange { animation: hx-fadein .3s 1.4s both; }
body.hx-launching .hx-wheel { animation: hx-cog-in .6s .8s cubic-bezier(.2, 1.3, .4, 1) both; }
body.hx-launching .hx-gear { animation: hx-spin-up 1.5s .8s cubic-bezier(.15, .7, .25, 1) both; }
body.hx-launching .hx-gear-small { animation: hx-spin-up-rev 1.5s .8s cubic-bezier(.15, .7, .25, 1) both; }
body.hx-launching .hx-wheel-ring { animation: hx-fadein .4s 1.3s both; }
body.hx-launching .hx-stage { animation: hx-power-on .6s 1.5s ease-out both; }
body.hx-launching .hx-popups-head, body.hx-launching .hx-desktop { animation: hx-rise .6s 1.9s cubic-bezier(.2, .8, .2, 1) both; }
body.hx-launching .hx-tabs { animation: hx-rise .5s 2s cubic-bezier(.2, .8, .2, 1) both; }
body.hx-launching .hx-art-rail { animation: hx-fadein .6s 2.1s both; }
@keyframes hx-fadein { from { opacity: 0; } }
@keyframes hx-drop { from { transform: translateY(-110%); opacity: 0; } }
@keyframes hx-unfold { from { transform: scaleY(0); opacity: 0; } }
@keyframes hx-draw { from { stroke-dashoffset: 1600; } to { stroke-dashoffset: 0; } }
@keyframes hx-cog-in { from { transform: scale(.2); opacity: 0; } }
@keyframes hx-spin-up { from { rotate: -720deg; } to { rotate: 0deg; } }
@keyframes hx-spin-up-rev { from { rotate: 1440deg; } to { rotate: 0deg; } }
@keyframes hx-rise { from { transform: translateY(60px); opacity: 0; } }
@keyframes hx-power-on {
    0% { clip-path: inset(49% 0 49% 0); opacity: 0; }
    12% { clip-path: inset(49% 0 49% 0); filter: brightness(3) saturate(0); opacity: .9; }
    50% { clip-path: inset(0 0 0 0); filter: brightness(1.8) saturate(.4); }
    100% { clip-path: inset(0 0 0 0); filter: none; }
}

/* Soft clouds drifting slowly across */
.hx-bg-drift {
    background:
        radial-gradient(ellipse 18% 7% at 12% 22%, rgba(255, 255, 255, .75), transparent 70%),
        radial-gradient(ellipse 24% 8% at 48% 14%, rgba(255, 255, 255, .6), transparent 70%),
        radial-gradient(ellipse 16% 6% at 82% 30%, rgba(255, 255, 255, .7), transparent 70%),
        radial-gradient(ellipse 20% 7% at 30% 42%, rgba(255, 255, 255, .35), transparent 70%);
    filter: blur(6px);
    animation: hx-drift 140s linear infinite alternate;
}

/* Tiny glowing specks for a dreamy feel */
.hx-bg-sparkles {
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, .9) 0 1.5px, transparent 2.5px),
        radial-gradient(circle, rgba(255, 255, 255, .6) 0 1px, transparent 2px);
    background-size: 220px 220px, 140px 140px;
    background-position: 0 0, 70px 90px;
    opacity: .45;
    animation: hx-twinkle 9s ease-in-out infinite alternate;
}

.hx-bg[data-preset=aurora] .hx-bg-drift { opacity: .25; }
.hx-bg[data-preset=aurora] .hx-bg-sparkles { opacity: .9; }
.hx-bg[data-preset=custom] .hx-bg-sparkles { opacity: .2; }

@keyframes hx-drift {
    from { transform: translateX(-6%); }
    to { transform: translateX(6%); }
}

@keyframes hx-twinkle {
    from { opacity: .25; }
    to { opacity: .6; }
}

@media (prefers-reduced-motion: reduce) {
    .hx-bg-drift, .hx-bg-sparkles, .hx-bg-scene, .hx-bg-live, .hx-bg-glow, .hx-bg-orbs span, .hx-intro-mark, .hx-intro-hint { animation: none; }
    body.hx-launching *, .hx-launch-logo { animation: none !important; }
}


button { font-family: inherit; }

kbd {
    background: #fff;
    border: 1px solid var(--hx-border);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 0 5px;
    font-size: .8em;
}

.hx-portal {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    transition: opacity .6s ease, transform .6s ease;
    display: flex;
    flex-direction: column;
}

/* ---------- top bar ---------- */
.hx-topbar {
    height: var(--hx-topbar-h);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 18px;
    background: linear-gradient(90deg, rgba(43, 29, 160, .72), rgba(26, 115, 232, .62));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    box-shadow: 0 4px 18px rgba(20, 20, 80, .18);
    z-index: 50;
    flex-shrink: 0;
    position: sticky;
    top: 0;
}

.hx-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
}

.hx-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 700;
    letter-spacing: .5px;
    background: #fff;
    color: #2b1da0;
    box-shadow: inset 0 -3px 0 rgba(43, 29, 160, .25);
}

.hx-brand-mark img {
    width: 84%;
    height: 84%;
    object-fit: contain;
    display: block;
}

.hx-brand-text {
    font-weight: 600;
    font-size: 1.15rem;
    line-height: 1.05;
    display: flex;
    flex-direction: column;
}

.hx-brand-text small {
    font-weight: 400;
    font-size: .62rem;
    opacity: .8;
}

.hx-search-btn {
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    min-width: 220px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-size: .9rem;
    cursor: pointer;
    justify-content: center;
    transition: background .15s ease;
}

.hx-search-btn:hover { background: rgba(255, 255, 255, .3); }
.hx-search-caret { transition: transform .2s ease; }
.hx-search-btn[aria-expanded=true] .hx-search-caret { transform: rotate(180deg); }

/* Search dropdown: semi-transparent glass under the top bar, can be hidden.
   It sits in the page flow, so the boxes move down instead of being covered. */
.hx-searchbar {
    position: relative;
    flex-shrink: 0;
    margin: 8px auto 4px;
    width: min(980px, calc(100% - 24px));
    padding: 12px 56px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, .28);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(18, 38, 84, .18);
    z-index: 45;
    animation: hx-drop .18s ease;
}

.hx-searchbar.is-hidden { display: none; }

@keyframes hx-drop {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: none; }
}

.hx-searchbar-hide {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .45);
    color: var(--hx-ink);
    cursor: pointer;
}

.hx-searchbar-hide:hover { background: rgba(255, 255, 255, .75); }

#hx-search-form { display: flex; flex-direction: column; gap: 8px; margin: 0; }

.hx-search-modes { display: flex; gap: 4px; flex-shrink: 0; }

.hx-mode {
    border: 1px solid rgba(255, 255, 255, .8);
    background: rgba(255, 255, 255, .45);
    color: var(--hx-ink);
    border-radius: 999px;
    padding: 0 14px;
    height: 36px;
    font: inherit;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
}

.hx-mode.is-active { background: #EC407A; border-color: #EC407A; color: #fff; }
.hx-mode:not(.is-active):hover { background: rgba(255, 255, 255, .75); }

.hx-search-row { display: flex; gap: 8px; align-items: center; }

.hx-go, .hx-clear, .hx-detect {
    height: 42px;
    border: 0;
    border-radius: 12px;
    padding: 0 18px;
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.hx-go { background: #43A047; color: #fff; }
.hx-go:hover { background: #388E3C; }
.hx-clear { background: rgba(255, 255, 255, .55); color: var(--hx-ink); }
.hx-clear:hover { background: rgba(255, 255, 255, .85); }
.hx-detect { height: 38px; padding: 0 12px; background: var(--hx-primary); color: #fff; }

.hx-search-filters {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
}

.hx-search-filters[hidden] { display: none; }

.hx-field-location { display: flex; gap: 6px; grid-column: span 2; }

.hx-search-filters select,
.hx-search-filters input[type=text] {
    width: 100%;
    min-width: 0;
    height: 38px;
    font: inherit;
    font-size: .84rem;
    color: var(--hx-ink);
    background: rgba(255, 255, 255, .62);
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 10px;
    padding: 0 12px;
    outline-color: var(--hx-primary);
}

.hx-search-filters select:disabled { opacity: .6; }

.hx-range { grid-column: span 2; display: flex; flex-direction: column; gap: 2px; font-size: .74rem; color: var(--hx-ink); }
.hx-range label { font-weight: 600; letter-spacing: .03em; text-transform: uppercase; display: flex; justify-content: space-between; }
.hx-range output { font-weight: 500; text-transform: none; color: var(--hx-primary-dark); }
.hx-range input[type=range] { width: 100%; accent-color: var(--hx-primary); }
.hx-dual { position: relative; height: 22px; }
.hx-dual input[type=range] { position: absolute; inset: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; height: 22px; }
.hx-dual input[type=range]::-webkit-slider-thumb { pointer-events: auto; }
.hx-dual input[type=range]::-moz-range-thumb { pointer-events: auto; }
.hx-dual::before { content: ''; position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 4px; background: rgba(31, 42, 68, .18); }
.hx-check { grid-column: span 2; font-size: .8rem; display: flex; align-items: center; gap: 8px; color: var(--hx-ink); }
.hx-check input { accent-color: var(--hx-primary); }
.hx-search-filters [data-modes][hidden] { display: none !important; }
/* Four search types: let the keyword box shrink so the row never runs under the hide button. */
.hx-search-row > .hx-search, .hx-search-row > .hx-search input[type=search] { min-width: 0; }

.hx-search {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 999px;
    padding: 0 6px 0 16px;
    height: 42px;
    color: var(--hx-muted);
}

.hx-search input[type=search] {
    flex: 1;
    border: 0;
    outline: 0;
    font: inherit;
    font-size: .92rem;
    padding: 0 10px;
    color: var(--hx-ink);
    background: transparent;
    min-width: 0;
}

.hx-search-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .72rem;
    background: #eef3fd;
    color: var(--hx-primary-dark);
    border-radius: 999px;
    padding: 5px 10px;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.hx-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.hx-btn {
    border: 0;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    height: 36px;
    min-width: 36px;
    padding: 0 10px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: .85rem;
    text-decoration: none;
    transition: background .15s ease;
}

.hx-btn:hover { background: rgba(255, 255, 255, .28); }
.hx-btn-ghost { border: 1px solid rgba(255, 255, 255, .55); background: transparent; }
.hx-btn-primary { background: #fff; color: #2b1da0; font-weight: 600; }
.hx-btn-primary:hover { background: #eef0ff; }

.hx-user { position: relative; display: flex; gap: 6px; }

.hx-menu {
    position: absolute;
    right: 0;
    top: 44px;
    min-width: 200px;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--hx-shadow);
    padding: 6px;
    z-index: 100;
}

.hx-menu a, .hx-menu button {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    background: none;
    color: var(--hx-ink);
    text-decoration: none;
    font-size: .86rem;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
}

.hx-menu a:hover, .hx-menu button:hover { background: #f1f4fb; }
.hx-menu form { margin: 0; }

.hx-save-state {
    font-size: .72rem;
    opacity: .8;
    min-width: 56px;
    text-align: right;
}

/* ---------- tabs ---------- */
/* Workspace tabs sit at the bottom like a taskbar */
.hx-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--hx-tabs-h);
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 0 14px;
    background: rgba(255, 255, 255, .32);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, .6);
    overflow-x: auto;
    flex-shrink: 0;
    z-index: 40;
    scrollbar-width: thin;
}

.hx-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 8px 0 14px;
    border-radius: 0 0 10px 10px;
    background: rgba(255, 255, 255, .55);
    color: var(--hx-ink);
    font-size: .84rem;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
    border-top: 0;
    user-select: none;
}

.hx-tab.is-active {
    background: #fff;
    border-color: rgba(31, 42, 68, .08);
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
}

.hx-tab.is-drop { outline: 2px dashed var(--hx-primary); }

.hx-tab-count {
    font-size: .68rem;
    background: #e8eefc;
    color: var(--hx-primary-dark);
    border-radius: 999px;
    padding: 1px 7px;
    font-weight: 600;
}

.hx-tab-close {
    border: 0;
    background: none;
    color: var(--hx-muted);
    width: 20px;
    height: 20px;
    border-radius: 6px;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: .75rem;
}

.hx-tab-close:hover { background: rgba(0, 0, 0, .08); color: var(--hx-ink); }

.hx-tab-rename {
    font: inherit;
    width: 120px;
    border: 1px solid var(--hx-primary);
    border-radius: 6px;
    padding: 2px 6px;
}

.hx-tab-add {
    height: 30px;
    width: 30px;
    margin-top: 2px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
    color: var(--hx-primary-dark);
}

.hx-tab-add:hover { background: #fff; }

/* ---------- desktop & boxes ---------- */
/* Pop-up pages live below the screen */
.hx-popups-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 22px 14px 8px;
    color: var(--hx-ink);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, .7);
}
.hx-popups-head small { font-weight: 400; color: rgba(31, 42, 68, .75); }

.hx-desktop {
    position: relative;
    flex: none;
    min-height: 78vh;
    margin: 0 14px calc(var(--hx-tabs-h) + 60px);
    border: 2px dashed rgba(255, 255, 255, .7);
    border-radius: 18px;
    background: rgba(255, 255, 255, .14);
    overflow: hidden;
}

.hx-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(31, 42, 68, .7);
    text-align: center;
    pointer-events: none;
    padding: 20px;
}

.hx-empty[hidden] { display: none; }

.hx-empty i { font-size: 3rem; opacity: .5; }

.hx-box {
    position: absolute;
    display: flex;
    flex-direction: column;
    background: var(--hx-glass-strong);
    border-radius: var(--hx-radius);
    box-shadow: var(--hx-shadow-sm);
    border: 1px solid rgba(255, 255, 255, .8);
    overflow: hidden;
    min-width: 220px;
    min-height: 120px;
    transition: box-shadow .15s ease;
}

.hx-box.is-focused { box-shadow: var(--hx-shadow); border-color: rgba(26, 115, 232, .45); }
.hx-box.is-maximized { border-radius: 0; }
.hx-box.is-hidden { display: none; }

.hx-box-head {
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 6px 0 10px;
    background: linear-gradient(180deg, #fff, #f3f6fc);
    border-bottom: 1px solid var(--hx-border);
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.hx-box-head:active { cursor: grabbing; }

.hx-box-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: .72rem;
    flex-shrink: 0;
}

.hx-box-title {
    font-size: .84rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.hx-box-title small { font-weight: 400; color: var(--hx-muted); margin-left: 6px; }

.hx-box-business {
    font: inherit;
    font-size: .74rem;
    max-width: 150px;
    border: 1px solid var(--hx-border);
    border-radius: 7px;
    padding: 2px 4px;
    background: #fff;
    cursor: pointer;
}

.hx-box-hits {
    font-size: .68rem;
    font-weight: 600;
    color: #8a5a00;
    background: #ffe9a8;
    border-radius: 999px;
    padding: 1px 8px;
    white-space: nowrap;
}

.hx-box-tools { display: flex; gap: 2px; flex-shrink: 0; }

.hx-icon-btn {
    border: 0;
    background: none;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    color: var(--hx-muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: .8rem;
}

.hx-icon-btn:hover { background: rgba(31, 42, 68, .08); color: var(--hx-ink); }
.hx-icon-btn.is-on { color: var(--hx-primary); background: #e8f0fe; }
.hx-icon-btn[data-act=close]:hover { background: #fde2e7; color: #d81b60; }

.hx-box-body {
    position: relative;
    flex: 1;
    background: #f0f2f5;
}

.hx-box-body iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.hx-box-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--hx-muted);
    font-size: .85rem;
    background: rgba(255, 255, 255, .8);
    pointer-events: none;
    transition: opacity .2s ease;
}

.hx-box-loading.is-done { opacity: 0; }

/* While dragging/resizing, iframes must not swallow pointer events */
.hx-portal.is-busy iframe { pointer-events: none; }
.hx-portal.is-busy { user-select: none; }

.hx-resize { position: absolute; z-index: 3; }
.hx-resize[data-dir=n], .hx-resize[data-dir=s] { left: 10px; right: 10px; height: 8px; cursor: ns-resize; }
.hx-resize[data-dir=e], .hx-resize[data-dir=w] { top: 10px; bottom: 10px; width: 8px; cursor: ew-resize; }
.hx-resize[data-dir=n] { top: -3px; }
.hx-resize[data-dir=s] { bottom: -3px; }
.hx-resize[data-dir=e] { right: -3px; }
.hx-resize[data-dir=w] { left: -3px; }
.hx-resize[data-dir=ne], .hx-resize[data-dir=nw], .hx-resize[data-dir=se], .hx-resize[data-dir=sw] { width: 16px; height: 16px; }
.hx-resize[data-dir=ne] { top: -3px; right: -3px; cursor: nesw-resize; }
.hx-resize[data-dir=nw] { top: -3px; left: -3px; cursor: nwse-resize; }
.hx-resize[data-dir=se] { bottom: -3px; right: -3px; cursor: nwse-resize; }
.hx-resize[data-dir=sw] { bottom: -3px; left: -3px; cursor: nesw-resize; }

.hx-resize[data-dir=se]::after {
    content: '';
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(31, 42, 68, .35);
    border-bottom: 2px solid rgba(31, 42, 68, .35);
    border-radius: 0 0 3px 0;
}

.hx-snap-preview {
    position: absolute;
    border: 2px dashed rgba(26, 115, 232, .7);
    background: rgba(26, 115, 232, .08);
    border-radius: var(--hx-radius);
    pointer-events: none;
    z-index: 9998;
}

/* ---------- dock (minimized boxes) ---------- */
.hx-dock {
    position: fixed;
    left: 14px;
    bottom: calc(var(--hx-tabs-h) + 10px);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    max-width: calc(100% - 300px);
    z-index: 60;
}

.hx-dock-item {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: var(--hx-glass-strong);
    box-shadow: var(--hx-shadow-sm);
    border-radius: 10px;
    padding: 6px 12px 6px 6px;
    font-size: .8rem;
    cursor: pointer;
    color: var(--hx-ink);
}

/* ---------- module wheel ---------- */
/* ---------- wheel + screen ---------- */
.hx-stage-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2px 14px 0;
}

.hx-wheel {
    position: relative;
    width: 250px;
    height: 250px;
    z-index: 70;
    touch-action: none;
    margin-bottom: 0;
    flex-shrink: 0;
    outline: 0;
}

/* Marks the slot that feeds the screen */
.hx-wheel-pointer {
    position: absolute;
    left: 50%;
    bottom: -2px;
    width: 0;
    height: 0;
    margin-left: -9px;
    border: 9px solid transparent;
    border-top-color: #fff;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2));
    pointer-events: none;
}

.hx-wheel-item.is-selected {
    width: 62px;
    height: 62px;
    margin: -31px 0 0 -31px;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, .85), 0 10px 24px rgba(0, 0, 0, .35);
}
.hx-wheel-ring.is-crowded .hx-wheel-item { width: 40px; height: 40px; margin: -20px 0 0 -20px; font-size: .9rem; border-width: 2px; }
.hx-wheel-ring.is-crowded .hx-wheel-item.is-selected { width: 50px; height: 50px; margin: -25px 0 0 -25px; }

.hx-stage {
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    background: var(--hx-glass-strong);
    border-radius: 18px;
    box-shadow: var(--hx-shadow);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .8);
}

.hx-stage-head {
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px 0 12px;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--hx-border);
}

.hx-stage-title { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 80px; }
.hx-stage-head .hx-box-tools { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.hx-stage-head .hx-icon-btn.is-on { background: #e8eefc; color: var(--hx-primary-dark); }

.hx-stage-pop {
    margin-left: 8px;
    border: 0;
    border-radius: 999px;
    padding: 6px 14px;
    background: linear-gradient(90deg, #2b1da0, var(--hx-primary));
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--hx-shadow-sm);
}
.hx-stage-pop:hover { filter: brightness(1.1); }

.hx-stage-body { position: relative; flex: 1; background: #fff; }
.hx-stage-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.hx-stage-body iframe[hidden] { display: none; }

.hx-stage-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--hx-muted);
    text-align: center;
    padding: 20px;
    z-index: 1;
}
.hx-stage-empty[hidden] { display: none; }
.hx-stage-empty i { font-size: 2.6rem; opacity: .45; }

.hx-wheel-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .0) 38%, rgba(255, 255, 255, .45) 39%, rgba(255, 255, 255, .25) 70%, rgba(255, 255, 255, 0) 71%);
    transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}

.hx-wheel-item {
    position: absolute;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border-radius: 50%;
    border: 3px solid #fff;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .15s ease;
}

.hx-wheel-item:hover, .hx-wheel-item:focus-visible { box-shadow: 0 0 0 4px rgba(255, 255, 255, .7), 0 8px 20px rgba(0, 0, 0, .3); outline: 0; }
.hx-wheel-item.is-open::after {
    content: '';
    position: absolute;
    bottom: -7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
}

.hx-wheel-hub {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 74px;
    height: 74px;
    margin: -37px 0 0 -37px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: radial-gradient(circle at 35% 30%, #3a3a3a, #000);
    color: #fff;
    font-size: 1.9rem;
    cursor: grab;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
    z-index: 2;
    transition: transform .35s ease;
}

.hx-wheel-hub:active { cursor: grabbing; }

.hx-wheel-expand {
    position: absolute;
    left: 50%;
    top: -18px;
    transform: translateX(-50%);
    border: 0;
    background: rgba(255, 255, 255, .9);
    color: var(--hx-ink);
    width: 34px;
    height: 24px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: var(--hx-shadow-sm);
}

.hx-wheel-label {
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translate(-100%, -50%);
    background: rgba(31, 42, 68, .88);
    color: #fff;
    font-size: .74rem;
    border-radius: 999px;
    padding: 3px 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
}

.hx-wheel-label.is-visible { opacity: 1; }

/* ---------- messaging popup ---------- */
.hx-messenger {
    position: fixed;
    right: 14px;
    bottom: 0;
    z-index: 120;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.hx-msg-launcher {
    height: calc(var(--hx-tabs-h) - 6px);
    margin-bottom: 3px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 10px;
    padding: 0 16px;
    background: linear-gradient(135deg, #E91E63, #7B1FA2);
    color: #fff;
    font: inherit;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(123, 31, 162, .3);
}

.hx-msg-badge {
    background: #fff;
    color: #E91E63;
    border-radius: 999px;
    font-size: .7rem;
    padding: 1px 7px;
}

.hx-msg-badge[hidden] { display: none; }

.hx-msg-panel {
    width: min(440px, calc(100vw - 28px));
    height: min(580px, calc(100vh - 160px));
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 16px;
    box-shadow: var(--hx-shadow);
    overflow: hidden;
    resize: both;
    min-width: 300px;
    min-height: 320px;
    animation: hx-drop .18s ease;
}

.hx-msg-panel[hidden] { display: none; }

.hx-msg-head {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border-bottom: 1px solid var(--hx-border);
}

.hx-msg-tab {
    border: 0;
    background: none;
    border-radius: 8px;
    padding: 7px 12px;
    font: inherit;
    font-size: .8rem;
    color: var(--hx-muted);
    cursor: pointer;
}

.hx-msg-tab.is-active { background: #fde4ee; color: #C2185B; font-weight: 600; }
.hx-msg-spacer { flex: 1; }
.hx-msg-panel iframe { flex: 1; width: 100%; border: 0; background: #fff; }

.hx-tabs { padding-right: 190px; }

/* ---------- background picker ---------- */
.hx-bg-picker {
    position: fixed;
    top: calc(var(--hx-topbar-h) + 8px);
    right: 14px;
    width: min(380px, calc(100% - 28px));
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 16px;
    box-shadow: var(--hx-shadow);
    padding: 12px 14px 14px;
    z-index: 190;
}

.hx-bg-picker[hidden] { display: none; }
.hx-bg-picker-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: .9rem; }

.hx-bg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.hx-bg-swatch {
    position: relative;
    height: 68px;
    border-radius: 10px;
    border: 2px solid transparent;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
}

.hx-bg-swatch span {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    font-size: .68rem;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, .55));
    padding: 10px 6px 4px;
    text-align: left;
}

.hx-bg-swatch.is-active { border-color: var(--hx-primary); box-shadow: 0 0 0 3px rgba(26, 115, 232, .25); }

.hx-bg-upload {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    border: 1px dashed rgba(31, 42, 68, .35);
    border-radius: 10px;
    font-size: .82rem;
    cursor: pointer;
    color: var(--hx-ink);
}

.hx-bg-upload:hover { border-color: var(--hx-primary); color: var(--hx-primary); }
.hx-bg-upload input { display: none; }
.hx-bg-note { margin: 8px 0 0; font-size: .72rem; color: var(--hx-muted); }

/* ---------- launcher ---------- */
.hx-launcher {
    position: fixed;
    inset: 0;
    background: rgba(17, 25, 45, .38);
    backdrop-filter: blur(3px);
    display: grid;
    place-items: center;
    z-index: 200;
    padding: 20px;
}

.hx-launcher[hidden] { display: none; }

.hx-launcher-card {
    width: min(920px, 100%);
    max-height: 86vh;
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--hx-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hx-launcher-head { display: flex; gap: 8px; padding: 16px 16px 0; }

.hx-launcher-head input {
    flex: 1;
    font: inherit;
    border: 1px solid var(--hx-border);
    border-radius: 10px;
    padding: 10px 14px;
    outline-color: var(--hx-primary);
}

.hx-launcher-hint { margin: 8px 18px 0; font-size: .76rem; color: var(--hx-muted); }

.hx-launcher-body { overflow-y: auto; padding: 8px 16px 18px; }

.hx-launcher-group h4 {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--hx-muted);
    margin: 16px 2px 8px;
}

.hx-launcher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.hx-launcher-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--hx-border);
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    text-align: left;
    font-size: .82rem;
    color: var(--hx-ink);
}

.hx-launcher-item:hover { border-color: var(--hx-primary); background: #f6f9ff; }

.hx-launcher-item .hx-box-icon { width: 30px; height: 30px; border-radius: 9px; font-size: .85rem; }

.hx-launcher-star {
    position: absolute;
    top: 4px;
    right: 4px;
    border: 0;
    background: none;
    color: #c5cad6;
    cursor: pointer;
    font-size: .78rem;
    padding: 2px;
}

.hx-launcher-star.is-on { color: #f5a623; }

/* ---------- search results ---------- */
.hx-results {
    position: absolute;
    top: calc(var(--hx-topbar-h) + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: min(720px, calc(100% - 24px));
    max-height: calc(100vh - var(--hx-topbar-h) - 40px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--hx-shadow);
    z-index: 150;
    overflow: hidden;
}

.hx-results[hidden] { display: none; }

.hx-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 10px 18px;
    border-bottom: 1px solid var(--hx-border);
    font-size: .86rem;
}

.hx-results-body { overflow-y: auto; padding: 6px 10px 12px; }

.hx-results-group h5 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 8px 6px;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--hx-muted);
}

.hx-results-group h5 .hx-pill {
    font-size: .66rem;
    background: #eef3fd;
    color: var(--hx-primary-dark);
    border-radius: 999px;
    padding: 1px 7px;
    text-transform: none;
    letter-spacing: 0;
}

.hx-result {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    border: 0;
    background: none;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--hx-ink);
}

.hx-result:hover, .hx-result.is-active { background: #f1f5fe; }
.hx-result .hx-box-icon { width: 30px; height: 30px; border-radius: 9px; }
.hx-result-text { min-width: 0; display: flex; flex-direction: column; }
.hx-result-title { font-size: .86rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-result-sub { font-size: .74rem; color: var(--hx-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-result mark { background: #ffe066; color: inherit; border-radius: 2px; }
.hx-results-empty, .hx-results-loading { padding: 18px; font-size: .86rem; color: var(--hx-muted); text-align: center; }

.hx-toast {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    background: rgba(31, 42, 68, .92);
    color: #fff;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: .82rem;
    z-index: 300;
    box-shadow: var(--hx-shadow-sm);
}

/* ---------- small screens: boxes stack, wheel shrinks ---------- */
@media (max-width: 767.98px) {
    .hx-stage { height: 55vh; }
    .hx-wheel { transform: scale(.8); margin: -20px 0 -40px; }
    .hx-popups-head small { display: none; }
    .hx-stage-head [data-stage=back], .hx-stage-head [data-stage=page], .hx-stage-head [data-stage=menu] { display: none; }
    .hx-topbar { flex-wrap: wrap; height: auto; padding: 10px 12px; gap: 10px; }
    .hx-search-btn { min-width: 0; padding: 0 12px; }
    .hx-search-btn span { display: none; }
    .hx-searchbar { padding-right: 50px; }
    .hx-search-filters { grid-template-columns: 1fr 1fr; }
    .hx-search-filters > select, .hx-search-filters > input { grid-column: span 1; }
    .hx-field-location, .hx-range, .hx-check { grid-column: span 2; }
    .hx-search-row { flex-wrap: wrap; }
    .hx-search { flex-basis: 100%; }
    .hx-tabs { padding-right: 130px; }
    .hx-messenger { right: 8px; }
    .hx-msg-launcher span:not(.hx-msg-badge) { display: none; }
    .hx-brand-text small, .hx-user-btn span, .hx-actions [data-action=tile], .hx-actions [data-action=cascade], .hx-save-state { display: none; }
    .hx-desktop { overflow: visible; padding: 10px; min-height: 200px; }
    .hx-box { position: relative !important; left: auto !important; top: auto !important; width: 100% !important; height: 70vh !important; margin-bottom: 12px; }
    .hx-box.is-minimized { display: none; }
    .hx-resize { display: none; }
    .hx-box-head { cursor: default; }
    .hx-box-tools [data-act=back], .hx-box-tools [data-act=popout], .hx-box-tools [data-act=max], .hx-box-tools [data-act=menu] { display: none; }
    .hx-box-business { max-width: 110px; }
    .hx-box-title { min-width: 60px; }
    .hx-dock { position: fixed; max-width: calc(100% - 160px); }
    .hx-results { position: fixed; }
}

.hx-bg-motion { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .84rem; }

/* ---------- gear drive: the wheel is a cog that powers the screen ---------- */
.hx-gear, .hx-gear-small { position: absolute; overflow: visible; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.hx-gear { inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 10px 18px rgba(20, 20, 80, .3)); }
.hx-wheel-ring { background: none !important; }
.hx-drive {
    position: relative;
    width: 90px;
    height: 58px;
    margin-top: -26px;
    z-index: 69;
    flex-shrink: 0;
}
.hx-gear-small { left: 0; top: 0; width: 90px; height: 90px; filter: drop-shadow(0 6px 10px rgba(20, 20, 80, .3)); }
.hx-drive-shaft {
    position: absolute;
    left: 50%;
    top: 45px;
    width: 18px;
    height: 30px;
    margin-left: -9px;
    border-radius: 4px;
    background: linear-gradient(90deg, #8d8fb8, #e6e8ff 45%, #8d8fb8);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
    z-index: -1;
}
.hx-wheel-hub {
    width: 104px !important;
    height: 104px !important;
    margin: -52px 0 0 -52px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 1.7rem !important;
    cursor: pointer !important;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, .35), 0 12px 28px rgba(0, 0, 0, .35), inset 0 -8px 16px rgba(0, 0, 0, .25) !important;
}
.hx-wheel-hub-label {
    font-size: .66rem;
    font-weight: 600;
    line-height: 1.1;
    max-width: 84px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
/* The wheel was turned but not clicked: the hub offers the module at the bottom slot. */
.hx-wheel-hub.is-pending,
.hx-wheel-item.is-selected.is-pending { animation: hx-hub-pending 1s ease-in-out infinite; }
@keyframes hx-hub-pending {
    0%, 100% { box-shadow: 0 0 0 6px rgba(255, 255, 255, .35), 0 12px 28px rgba(0, 0, 0, .35); }
    50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, .8), 0 12px 28px rgba(0, 0, 0, .35); }
}
@media (prefers-reduced-motion: reduce) {
    .hx-wheel-hub.is-pending, .hx-wheel-item.is-selected.is-pending { animation: none; }
}
.hx-wheel-expand { top: auto !important; bottom: 6px; left: auto !important; right: -6px; transform: none !important; width: 30px !important; height: 30px !important; border-radius: 50% !important; }
.hx-stage { margin-top: -2px; border-top: 4px solid #b7bbe6; }
.hx-stage-resize {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 120px;
    height: 16px;
    margin-left: -60px;
    display: grid;
    place-items: center;
    cursor: ns-resize;
    border-radius: 8px 8px 0 0;
    background: rgba(31, 42, 68, .14);
    color: rgba(31, 42, 68, .6);
    font-size: .75rem;
    z-index: 3;
}
.hx-stage-resize:hover { background: rgba(26, 115, 232, .25); color: var(--hx-primary-dark); }

/* ---------- pipes: search -> wheel -> screen ---------- */
.hx-pipes { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; z-index: 44; overflow: visible; }
.hx-pipe-shell { fill: none; stroke: url(#hx-pipe-metal); stroke-width: 20; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 6px 8px rgba(20, 20, 80, .25)); }
.hx-pipe-core { fill: none; stroke: rgba(40, 50, 110, .35); stroke-width: 9; stroke-linecap: round; }
.hx-pipe-flow { fill: none; stroke: #8ff3ff; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 10 22; animation: hx-pipe 1.6s linear infinite; filter: drop-shadow(0 0 4px #6ff0ff); opacity: .65; }
.hx-pipes.is-flowing .hx-pipe-flow { stroke: #fff6a0; opacity: 1; animation-duration: .45s; filter: drop-shadow(0 0 8px #fff27a); }
.hx-pipe-flange { fill: #c9cdf2; stroke: rgba(60, 60, 120, .45); stroke-width: 2; }
@keyframes hx-pipe { to { stroke-dashoffset: -32; } }
@media (prefers-reduced-motion: reduce) { .hx-pipe-flow { animation: none; } }
@media (max-width: 767.98px) { .hx-pipes { display: none; } }

/* ---------- featured artists: canvases on both sides ---------- */
.hx-art-rail {
    position: fixed;
    top: calc(var(--hx-topbar-h) + 18px);
    bottom: calc(var(--hx-tabs-h) + 16px);
    width: 112px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
    overflow-y: auto;
    scrollbar-width: none;
    z-index: 40;
}
.hx-art-rail::-webkit-scrollbar { display: none; }
.hx-art-rail.is-left { left: 10px; }
.hx-art-rail.is-right { right: 10px; }
.hx-art-rail h6 {
    margin: 0;
    font-size: .64rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(43, 29, 160, .55);
    padding: 3px 10px;
    border-radius: 999px;
    text-align: center;
}
.hx-canvas {
    position: relative;
    flex-shrink: 0;
    width: 96px;
    border: 0;
    padding: 6px 6px 22px;
    background: linear-gradient(145deg, #f7e7c6, #caa66a);
    border-radius: 6px;
    box-shadow: 0 8px 18px rgba(20, 20, 60, .3), inset 0 0 0 2px rgba(255, 255, 255, .5);
    cursor: zoom-in;
    transform: rotate(var(--tilt, 0deg));
    transition: transform .25s ease, box-shadow .25s ease;
    animation: hx-canvas-float 6s ease-in-out infinite alternate;
    animation-delay: var(--delay, 0s);
}
.hx-canvas:hover, .hx-canvas:focus-visible { transform: rotate(0) scale(1.08); box-shadow: 0 14px 28px rgba(20, 20, 60, .4); outline: 0; }
.hx-canvas img { display: block; width: 84px; height: 84px; object-fit: cover; border-radius: 2px; background: #fff; }
.hx-canvas span { position: absolute; left: 6px; right: 6px; bottom: 4px; font-size: .6rem; font-weight: 600; color: #4a3517; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.hx-canvas.is-featured::after { content: '\2605'; position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; background: #ffcf3f; color: #6b4b00; font-size: .7rem; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
@keyframes hx-canvas-float { from { translate: 0 -3px; } to { translate: 0 3px; } }
.hx-canvas.is-empty { cursor: default; display: flex; align-items: center; justify-content: center; height: 118px; color: rgba(74, 53, 23, .55); font-size: 1.8rem; animation: none; opacity: .85; }
.hx-canvas.is-empty:hover { transform: rotate(var(--tilt, 0deg)); box-shadow: 0 8px 18px rgba(20, 20, 60, .3), inset 0 0 0 2px rgba(255, 255, 255, .5); }
.hx-launcher-star.is-full { animation: hx-star-shake .3s 2; }
@keyframes hx-star-shake { 25% { translate: -3px 0; } 75% { translate: 3px 0; } }
.hx-art-post { flex-shrink: 0; border: 1px dashed rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .35); color: #2b1da0; border-radius: 10px; width: 96px; padding: 8px 4px; font-size: .66rem; font-weight: 600; cursor: pointer; }

.hx-art-view {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(10, 10, 30, .82);
    backdrop-filter: blur(6px);
    padding: 30px 70px;
}
.hx-art-view[hidden] { display: none; }
.hx-art-view figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; }
.hx-art-view img { max-width: min(1200px, 100%); max-height: calc(100vh - 170px); border-radius: 6px; border: 10px solid #f7e7c6; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); background: #fff; }
.hx-art-view figcaption { color: #fff; text-align: center; max-width: 720px; }
.hx-art-view figcaption strong { font-size: 1.1rem; }
.hx-art-view figcaption p { margin: 6px 0 0; opacity: .8; font-size: .86rem; }
.hx-art-nav, .hx-art-close { border: 0; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer; font-size: 1.1rem; flex-shrink: 0; }
.hx-art-nav[hidden] { display: none; }
.hx-art-nav:hover, .hx-art-close:hover { background: rgba(255, 255, 255, .3); }
.hx-art-close { position: absolute; top: 18px; right: 18px; }

@media (min-width: 1360px) {
    body.has-art .hx-art-rail { display: flex; }
    body.has-art .hx-stage-wrap { padding-left: 132px; padding-right: 132px; }
    body.has-art .hx-popups-head, body.has-art .hx-desktop { margin-left: 132px; margin-right: 132px; }
}
@media (max-width: 767.98px) {
    .hx-art-view { padding: 20px 10px; }
    .hx-art-nav { position: absolute; bottom: 20px; }
    .hx-art-nav.is-prev { left: 20px; }
    .hx-art-nav.is-next { right: 20px; }
}

/* The page menu is opened and closed from the handle on its own sidebar (inside the page) */
.hx-icon-btn[data-act="menu"], .hx-icon-btn[data-stage="menu"] { display: none; }

/* ---------- screen: full screen mode ---------- */
/* The portal wrapper makes its own layer (z-index 1), so it is lifted above the top bar and pop-ups while
   the screen is full; a wide shadow dims everything around the screen. */
body.hx-stage-full { overflow: hidden; }
body.hx-stage-full .hx-portal { z-index: 2500 !important; transform: none !important; }
.hx-stage.is-full {
    position: fixed !important;
    inset: 10px;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    z-index: 2500;
    border-radius: 14px;
    animation: none !important;
    box-shadow: 0 0 0 100vmax rgba(15, 20, 40, .55), var(--hx-shadow);
}
.hx-stage.is-full .hx-stage-resize { display: none; }
.hx-stage-head [data-stage=full].is-on { background: #e8eefc; color: var(--hx-primary-dark); }
