/* MagikRae "Agent Harness" redesign - mobile-app shell for the public + member area
   (PublicLayout.razor). Loaded after noir.css; everything is scoped under .hx-app so the Material
   admin theme is untouched. The old .cg-sidebar shell rules in noir.css are now unused by the
   public layout but left in place (chat/composer/message rules there are still what ChatBox uses).
   MUST be copied to MagikRae.Maui/wwwroot/css/ on every change. */

.theme-noir.hx-app {
    --bg: #111111;
    --surface: #232323;
    --surface-alt: #2c2c2c;
    --surface-hover: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.2);
    --text: #f2f2f2;
    --text-dim: #9a9a9a;
    --hx-accent: #8b6cf6;
    --hx-accent-tint: rgba(139, 108, 246, 0.2);
    --hx-ok: #4ad38a;
    --hx-warn: #f0706a;
    --hx-nav-bg: rgba(38, 38, 38, 0.92);
    --hx-nav-h: 6.3rem;
    --hx-safe-top: max(env(safe-area-inset-top, 0px), var(--app-inset-top, 0px)); /* --app-inset-* are pushed in by the Android shell (edge-to-edge) */
    --hx-safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--app-inset-bottom, 0px));

    display: block;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--bg);
}

.theme-noir.hx-app.light-mode {
    --bg: #f4f4f6;
    --surface: #ffffff;
    --surface-alt: #ececef;
    --surface-hover: rgba(0, 0, 0, 0.05);
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.18);
    --text: #17171a;
    --text-dim: #6c6c74;
    --hx-accent-tint: rgba(139, 108, 246, 0.14);
    --hx-nav-bg: rgba(255, 255, 255, 0.94);
}

.hx-app a { color: inherit; }

/* --- Shell --- */

.hx-main {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.hx-page {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: calc(var(--hx-safe-top) + 1.25rem) 1rem calc(var(--hx-nav-h) + var(--hx-safe-bottom) + 1.5rem);
}

.hx-nav-hidden .hx-page {
    padding-bottom: calc(var(--hx-safe-bottom) + 0.5rem);
}

/* Chat needs a bounded box so .cg-messages can scroll and the composer can pin to the bottom. */
.hx-page:has(.cg-chat-page) {
    height: 100%;
}

.hx-page:has(.hx-hero) {
    padding-top: 0;
}

/* Floating pill tab bar */
.hx-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--hx-safe-bottom) + 0.9rem);
    width: min(calc(100% - 2rem), 528px);
    height: 3.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.2rem;
    padding: 0 0.4rem;
    background: var(--hx-nav-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
    z-index: 40;
}

.hx-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    height: 4.4rem;
    border-radius: 999px;
    color: var(--text-dim) !important;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.hx-nav-item i { font-size: 2.2rem; }

.hx-nav-item.active {
    background: var(--surface-alt);
    color: var(--text) !important;
}

/* --- Shared bits --- */

.hx-title {
    font-size: 1.6rem;
    font-style: italic;
    font-weight: 500;
    text-align: center;
    margin: 0 0 1.4rem;
}

.hx-empty { text-align: center; margin: 2.5rem 0; }
.hx-section-note { font-size: 0.82rem; margin: 1rem 0.25rem; }

.hx-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 6px;
    background: rgba(214, 180, 90, 0.18);
    color: #d6b45a;
    font-size: 0.7rem;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 0.3rem;
}

.hx-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 600;
}

.hx-pill-accent { background: var(--hx-accent-tint); border-color: rgba(139, 108, 246, 0.5); color: #c9bbff; }
.hx-pill-ok { background: rgba(74, 211, 138, 0.14); border-color: rgba(74, 211, 138, 0.4); color: var(--hx-ok); }
.hx-pill-ok i { font-size: 0.5rem; }
.hx-pill-warn { background: #fbe4e2; border-color: #f3b8b3; color: #c0392b; }

.hx-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: none;
    border: none;
    color: var(--text) !important;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.hx-icon-btn:hover { background: var(--surface-hover); }

.hx-chip-btn {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff !important;
    font-size: 0.85rem;
    font-weight: 500;
}

.hx-link {
    display: block;
    margin: 1rem auto 0;
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 0.82rem;
    text-decoration: underline;
    cursor: pointer;
    text-align: center;
}

.hx-check {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hx-check.done { background: var(--text); border-color: var(--text); }
.hx-check.done::after { content: "\2713"; color: var(--bg); font-size: 0.85rem; font-weight: 700; }

.hx-dot {
    display: inline-block;
    min-width: 1.15rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--hx-warn);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.15rem;
    text-align: center;
    vertical-align: middle;
}

/* --- World feed --- */

.hx-tabs-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.hx-tabs-title { font-size: 1.6rem; font-style: italic; font-weight: 500; }

.hx-tabs { display: flex; gap: 1.4rem; }

.hx-tabs button {
    background: none;
    border: none;
    padding: 0 0 0.3rem;
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 1.05rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.hx-tabs button.active { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }

.hx-post { padding: 1.1rem 0.2rem 1.3rem; border-bottom: 1px solid var(--border); }
.hx-post-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.7rem; }
.hx-post-head strong { font-size: 1rem; }
.hx-post-meta { font-size: 0.78rem; }
.hx-post-avatar {
    width: 2.7rem; height: 2.7rem; border-radius: 12px;
    background: var(--surface-alt);
    display: flex; align-items: center; justify-content: center;
    color: var(--hx-accent); flex-shrink: 0;
}
.hx-post-body { margin: 0; color: var(--text-dim); line-height: 1.6; white-space: pre-wrap; }
.hx-post-image { width: 100%; border-radius: 18px; margin-top: 0.9rem; display: block; }

/* --- Home hero --- */

.hx-hero {
    position: relative;
    margin: 0 -1rem;
    height: 68vh;
    min-height: 430px;
    max-height: 600px;
    border-radius: 0 0 32px 32px;
    overflow: hidden;
    background: #2a2622;
    flex-shrink: 0;
}

.hx-hero-bg {
    position: absolute;
    inset: -20px;
    background-size: cover;
    background-position: center;
    filter: blur(28px) saturate(1.1) brightness(0.75);
}

.hx-hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 35%, rgba(17, 17, 17, 0.85) 100%);
}

.hx-hero-top {
    position: absolute;
    top: calc(var(--hx-safe-top) + 1rem);
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    z-index: 2;
}

.hx-hero-id { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.hx-hero-name { color: #fff; font-size: 1.15rem; font-weight: 600; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); margin-bottom: 0.25rem; }

.hx-hero-status {
    position: absolute;
    top: calc(var(--hx-safe-top) + 5.4rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.hx-hero-figure {
    position: absolute;
    top: calc(var(--hx-safe-top) + 8.2rem);
    bottom: 4.6rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(70%, 320px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.hx-hero-figure img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    aspect-ratio: 1;
    border-radius: 28px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.hx-live {
    position: absolute;
    left: 50%;
    bottom: 1.1rem;
    transform: translateX(-50%);
    width: min(88%, 420px);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1.1rem;
    border-radius: 999px;
    background: rgba(18, 18, 18, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff !important;
    z-index: 2;
}

.hx-live-tag {
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: #e5322d;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.hx-live-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }

.hx-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-top: 1rem; }
.hx-col { display: flex; flex-direction: column; gap: 0.8rem; min-width: 0; }

.hx-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.1rem 1.2rem;
    background: var(--surface);
    border-radius: 28px;
    min-width: 0;
}

.hx-card-tall { flex: 1; min-height: 11rem; }
.hx-card-row { flex-direction: row; align-items: center; gap: 0.9rem; padding: 0.9rem 1.1rem; }
.hx-card-label { display: block; color: var(--text-dim); font-size: 0.85rem; }
.hx-card-title { font-size: 1.35rem; font-weight: 500; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hx-card-value { display: block; font-size: 1.5rem; font-weight: 500; }
.hx-card-foot { margin-top: auto; display: flex; gap: 0.6rem; align-items: center; color: var(--text-dim); font-size: 0.85rem; line-height: 1.3; }
.hx-card-foot > span:last-child { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hx-card-icon { font-size: 1.6rem; color: var(--hx-accent); width: 2.4rem; text-align: center; flex-shrink: 0; }

.hx-tiles { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
.hx-tile {
    background: var(--surface-alt);
    border-radius: 16px;
    padding: 0.55rem 0.2rem;
    text-align: center;
    display: flex; flex-direction: column;
}
.hx-tile b { font-size: 1.15rem; font-weight: 600; }
.hx-tile small { color: var(--text-dim); font-size: 0.62rem; }

.hx-composer-bar {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: 1.1rem;
    padding: 0.42rem 0.5rem 0.42rem 0.55rem;
    border-radius: 999px;
    background: var(--bg);
    border: 1.5px solid transparent;
    background-image: linear-gradient(var(--bg), var(--bg)), linear-gradient(90deg, var(--hx-accent), var(--hx-accent-2));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    /* Lift + brand glow so the Home chat entry reads as the main action. Dark-mode values;
       .light-mode overrides below (a violet halo washes out on white, so it leans on the drop). */
    box-shadow: 0 0 0 5px rgba(139, 108, 246, 0.16), 0 14px 34px rgba(0, 0, 0, 0.55), 0 0 34px rgba(139, 108, 246, 0.55);
}

/* Small "CHAT" label above the bar. */
.hx-composer-caption {
    position: absolute;
    left: 16px;
    top: -1.35rem;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--hx-accent);
}

/* The agent's picture, instead of a "+" that read as attach. */
.hx-composer-av { flex: none; display: flex; }

.hx-composer-send {
    width: 2.6rem; height: 2.6rem; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.02rem; color: #04121a;
    background: linear-gradient(135deg, var(--hx-accent), var(--hx-accent-2));
    box-shadow: 0 6px 16px rgba(139, 108, 246, 0.5);
}

.hx-composer-hint { flex: 1; color: var(--text); opacity: 0.95; font-size: 1.03rem; }

/* --- Hub (Member/Hub.razor) --- */

.hx-hub-header { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.6rem; }
.hx-hub-header h1 { margin: 0; font-size: 1.4rem; }
.hx-hub-header .muted { margin: 0.15rem 0 0; font-size: 0.9rem; }

/* Phone-home-screen style icons: colored rounded-square glyph + label underneath, not a list. */
.hx-hub-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem 0.5rem; }
.hx-app-tile {
    display: flex; flex-direction: column; align-items: center; gap: 0.45rem;
    background: none; border: none; color: var(--text); font-family: var(--font-body);
    font-size: 0.8rem; text-align: center; cursor: pointer;
}
.hx-app-tile:disabled { opacity: 0.45; cursor: default; }
.hx-app-icon {
    position: relative; width: 3.6rem; height: 3.6rem; border-radius: 22%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}
.hx-app-icon-gallery { background: linear-gradient(135deg, #f472b6, #a855f7); }
.hx-app-icon-docs { background: linear-gradient(135deg, #64748b, #475569); }
.hx-app-icon-mail { background: linear-gradient(135deg, #34d399, #059669); }
.hx-app-icon-notes { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.hx-app-badge {
    position: absolute; top: -0.35rem; right: -0.35rem; min-width: 1.15rem; padding: 0 0.3rem;
    border-radius: 999px; background: var(--hx-warn); color: #fff; font-size: 0.65rem; font-weight: 700;
    line-height: 1.1rem; text-align: center; box-shadow: 0 0 0 2px var(--bg);
}

/* --- Gallery (Member/Gallery.razor) --- */

.hx-gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: 0.5rem; }
.hx-gallery-tile { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface); border: none; padding: 0; cursor: pointer; display: block; }
.hx-gallery-tile img, .hx-gallery-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hx-gallery-tile-badge { position: absolute; top: 0.35rem; right: 0.35rem; color: #fff; font-size: 0.85rem; text-shadow: 0 1px 4px rgba(0,0,0,0.7); }
.hx-gallery-date { margin: 1.2rem 0 0.4rem; color: var(--text-dim); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.hx-gallery-date:first-child { margin-top: 0.3rem; }

/* --- Inbox --- */

.hx-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1.5rem; }

.hx-quick-item {
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    background: none; border: none; color: var(--text);
    font-family: var(--font-body); font-size: 0.95rem; text-align: center; cursor: pointer;
}

.hx-quick-icon {
    width: 4.2rem; height: 4.2rem; border-radius: 22px;
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    border: 1.5px solid transparent;
}

.hx-quick-item.active .hx-quick-icon { border-color: var(--hx-accent); }

.hx-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 0.2rem;
    min-width: 0;
}

.hx-row-icon {
    width: 3.4rem; height: 3.4rem; border-radius: 50%;
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; flex-shrink: 0;
}

.hx-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.hx-row-main strong { font-size: 1.05rem; font-weight: 600; }
.hx-row-main small { color: var(--text-dim); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-row-time { color: var(--text-dim); font-size: 0.75rem; align-self: flex-start; white-space: nowrap; padding-top: 0.3rem; }
.hx-row-chev { color: var(--text-dim); }
.hx-row-mail { border-top: 1px solid var(--border); align-items: flex-start; }
.hx-row-mail.unread .hx-row-main strong::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; margin-right: 0.4rem; border-radius: 50%; background: var(--hx-warn); }
.hx-row-mail .hx-row-icon { width: 2.6rem; height: 2.6rem; font-size: 1rem; }
.hx-mail-body { color: var(--text-dim); font-size: 0.85rem; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hx-mail-body.expanded { -webkit-line-clamp: unset; overflow: visible; }

/* --- Mail (Member/Mail.razor) --- */
.hx-mail-list { display: flex; flex-direction: column; }
.hx-mail-item { background: none; border: none; border-top: 1px solid var(--border); font: inherit; color: inherit; text-align: left; width: 100%; cursor: pointer; }
.hx-mail-item:first-child { border-top: none; }
.hx-mail-item.expanded .hx-row-main small { white-space: normal; }
.hx-mail-item.unread .hx-row-icon { color: var(--hx-accent); }

/* --- Me --- */

.hx-me-top { display: flex; justify-content: flex-start; }

.hx-me-avatar { position: relative; width: 8.5rem; margin: 0.5rem auto 0; }
.hx-me-avatar .avatar-circle { border-radius: 28px; }

.hx-edit-btn {
    position: absolute;
    left: 50%; bottom: -0.6rem; transform: translateX(-50%);
    padding: 0.45rem 1rem;
    border-radius: 999px;
    background: #fff; color: #111;
    font-size: 0.9rem; font-weight: 500;
    white-space: nowrap; cursor: pointer; overflow: hidden;
    text-transform: none; letter-spacing: 0;
}

.hx-edit-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.hx-me-name { text-align: center; font-size: 1.7rem; margin: 1.6rem 0 0.5rem; }
.hx-me-sub { display: flex; align-items: center; justify-content: center; gap: 0.6rem; color: var(--text-dim); font-size: 0.95rem; }

.hx-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin: 1.4rem 0; }
.hx-stats b { display: block; font-size: 1.5rem; font-weight: 500; }
.hx-stats small { color: var(--text-dim); font-size: 0.95rem; }

.hx-banner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.3rem; border-radius: 22px;
    background: linear-gradient(90deg, #ff6f9c, #ffb4c8);
    color: #fff !important; margin-bottom: 1rem;
}
.hx-banner em { display: block; font-size: 1.25rem; }
.hx-banner small { font-size: 0.85rem; opacity: 0.95; }
.hx-banner > i { font-size: 2.2rem; opacity: 0.9; }

.hx-me-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 1rem; }

.hx-wallet {
    display: flex; flex-direction: column; justify-content: flex-end; gap: 0.15rem;
    min-height: 11rem; padding: 1.1rem 1.2rem; border-radius: 28px;
    background: linear-gradient(160deg, #6a90c9 0%, #8fb1dc 38%, #2a2626 39%, #211e1e 100%);
    position: relative;
}
.hx-wallet small { color: rgba(255, 255, 255, 0.75); }
.hx-wallet b { font-size: 2rem; color: #fff; font-weight: 600; }
.hx-wallet-btn { position: absolute; right: 1rem; top: 46%; padding: 0.3rem 1rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.4); color: #fff; font-size: 0.85rem; }

.hx-daily { background: var(--surface); border-radius: 28px; padding: 0.9rem; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.hx-daily > em { text-align: center; font-size: 1.05rem; }
.hx-daily-item { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.55rem 0.7rem; background: var(--surface-alt); border-radius: 16px; min-width: 0; }
.hx-daily-item span:first-child { min-width: 0; display: flex; flex-direction: column; }
.hx-daily-item b { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-daily-item.done b { text-decoration: line-through; }
.hx-daily-item small { color: var(--text-dim); font-size: 0.72rem; text-transform: capitalize; }

.hx-menu { background: var(--surface); border-radius: 24px; overflow: hidden; }
.hx-menu a, .hx-menu button {
    display: flex; align-items: center; gap: 0.8rem; width: 100%;
    padding: 1rem 1.2rem; background: none; border: none; border-bottom: 1px solid var(--border);
    color: var(--text); font-family: var(--font-body); font-size: 0.95rem; text-align: left; cursor: pointer;
}
.hx-menu > :last-child { border-bottom: none; }
.hx-menu a > i:first-child, .hx-menu button > i:first-child { width: 1.2rem; text-align: center; color: var(--text-dim); }
.hx-menu a > i:last-child { margin-left: auto; color: var(--text-dim); font-size: 0.75rem; }

.hx-copyright { text-align: center; color: var(--text-dim); font-size: 0.72rem; opacity: 0.7; margin: 1.2rem 0 0; }

.hx-me-guest { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.8rem; padding: 2rem 0; }
.hx-me-guest-icon { width: 5rem; height: 5rem; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 2.2rem; color: var(--hx-accent); }

/* --- Chat (ChatBox keeps its own markup; this restyles it as bubbles) --- */

.hx-app .cg-chat-header {
    padding: 0.6rem 0 0.7rem;
    margin: 0;
    gap: 0.6rem;
}

.hx-chat-actions { margin-left: auto; display: flex; }

.hx-app .cg-messages { margin: 0 -1rem; padding: 0.5rem 1rem 10.6rem; }

.hx-app .cg-message-row,
.hx-app .cg-message-row.assistant {
    background: none;
    margin: 0 auto;
    padding: 0.45rem 0;
    gap: 0.6rem;
    align-items: flex-end;
}

.hx-app .cg-message-row.user { flex-direction: row-reverse; }

.hx-app .cg-message-body {
    flex: 0 1 auto;
    max-width: 82%;
    padding: 0.7rem 1rem;
    border-radius: 22px;
    background: var(--surface);
    border-bottom-left-radius: 8px;
}

.hx-app .cg-message-row.user .cg-message-body {
    background: var(--hx-accent);
    color: #fff;
    border-bottom-left-radius: 22px;
    border-bottom-right-radius: 8px;
}

.hx-app .cg-message-row.user .cg-message-body .who { display: none; }

/* The nav-bar/gesture inset is already applied once by `.hx-nav-hidden .hx-page` (chat pages hide the tab bar), which
   is the box this wrapper is positioned in - adding it here again doubled the gap above the Android nav bar. */
.hx-app .cg-composer-wrap { padding-bottom: 0.5rem; }
.hx-app .cg-composer-box { border-radius: 28px; }

.hx-sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 60; }

.hx-sheet {
    position: fixed;
    left: 50%; transform: translateX(-50%);
    bottom: 0;
    width: min(100%, 560px);
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem 1rem calc(var(--hx-safe-bottom) + 1rem);
    background: var(--surface);
    border-radius: 28px 28px 0 0;
    z-index: 61;
}

/* --- Legacy content pages (Pricing, Tasks, Usage, Settings, Login, agent settings) --- */

.hx-app h1 { font-size: 1.5rem; }
.hx-app .cg-agent-grid { grid-template-columns: 1fr; }
.hx-app .cg-task-board { grid-template-columns: 1fr; }
.hx-app .card, .hx-app .cg-agent-card { border-radius: 24px; background: var(--surface); border-color: var(--border); }
.hx-app .stat-tile { border-radius: 22px; }
.hx-app .btn { border-radius: 999px; }
.hx-app .input, .hx-app textarea.input, .hx-app select.input { border-radius: 16px; }

/* Hero avatar via <Avatar> so an agent with no picture shows a big initial instead of a blank hero. */
.hx-hero { height: 52vh; min-height: 360px; max-height: 520px; }
.hx-hero-figure .avatar-circle {
    width: 100% !important;
    height: auto !important;
    max-height: 100%;
    aspect-ratio: 1;
    border-radius: 28px;
    font-size: 5rem !important;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
.hx-hero-figure .avatar-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 28px; }

.theme-noir.hx-app label.hx-edit-btn { text-transform: none; letter-spacing: 0; font-size: 0.9rem; color: #111; }

/* ==========================================================================
   Aurora glass (final look). Overrides the earlier blocks: navy/teal gradient
   canvas, frosted panels, one cyan->blue accent, a raised Home orb, and a
   pulsing "presence" ring instead of a hero photo.
   ========================================================================== */

.theme-noir.hx-app {
    --bg: #0a1024;
    --surface: rgba(255, 255, 255, 0.06);
    --surface-alt: rgba(255, 255, 255, 0.1);
    --surface-hover: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.22);
    --text: #eaf2ff;
    --text-dim: #93a4c4;
    --hx-accent: #3fe0d0;
    --hx-accent-2: #5b8cff;
    --hx-accent-tint: rgba(63, 224, 208, 0.16);
    --hx-ok: #3fe0d0;
    --hx-nav-bg: rgba(14, 22, 48, 0.72);
    background:
        radial-gradient(ellipse 80% 50% at 15% 0%, rgba(63, 224, 208, 0.16), transparent 60%),
        radial-gradient(ellipse 70% 45% at 95% 10%, rgba(91, 140, 255, 0.2), transparent 60%),
        #070b1a;
}

.theme-noir.hx-app.light-mode {
    --bg: #eef6fb;
    --surface: rgba(255, 255, 255, 0.7);
    --surface-alt: rgba(255, 255, 255, 0.95);
    --surface-hover: rgba(10, 30, 60, 0.06);
    --border: rgba(10, 40, 80, 0.1);
    --border-strong: rgba(10, 40, 80, 0.2);
    --text: #0d1b33;
    --text-dim: #566a88;
    --hx-accent: #0d9fa0;
    --hx-accent-2: #3f6fe0;
    --hx-accent-tint: rgba(13, 159, 160, 0.14);
    --hx-ok: #0d9fa0;
    --hx-nav-bg: rgba(255, 255, 255, 0.8);
    background:
        radial-gradient(ellipse 80% 50% at 15% 0%, rgba(63, 224, 208, 0.28), transparent 60%),
        radial-gradient(ellipse 70% 45% at 95% 10%, rgba(91, 140, 255, 0.24), transparent 60%),
        #eef6fb;
}

/* Frosted panels */
.hx-card, .hx-daily, .hx-menu, .hx-sheet, .hx-quick-icon, .hx-row-icon, .hx-post-avatar, .hx-stats {
    background: var(--surface);
    border: 1px solid var(--border);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}
.hx-stats { border-radius: 22px; padding: 0.9rem 0; }
.hx-tile, .hx-daily-item { background: var(--surface-alt); }

/* Titles: upright, tracked, no italics */
.hx-title, .hx-tabs-title { font-style: normal; font-weight: 700; letter-spacing: 0.02em; }
.hx-tabs button.active { border-bottom-color: var(--hx-accent); }
.hx-badge { background: var(--hx-accent-tint); color: var(--hx-accent); }
.hx-pill-accent { background: var(--hx-accent-tint); border-color: rgba(63, 224, 208, 0.45); color: var(--hx-accent); }
.hx-pill-warn { background: rgba(240, 112, 106, 0.16); border-color: rgba(240, 112, 106, 0.5); color: #ff9a94; }
.hx-check.done { background: var(--hx-accent); border-color: var(--hx-accent); }
.hx-check.done::after { color: #04121a; }
.hx-card-icon { color: var(--hx-accent); position: relative; }
.hx-quick-item.active .hx-quick-icon { border-color: var(--hx-accent); box-shadow: 0 0 18px var(--hx-accent-tint); }
.hx-icon-btn { color: var(--text) !important; }

/* Tab bar with a raised centre Home orb */
.hx-nav {
    border-radius: 32px;
    height: 5.4rem;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    overflow: visible;
}
.hx-nav-item { border-radius: 22px; }
.hx-nav-item.active { background: rgba(148, 148, 163, 0.24); color: var(--text) !important; }

/* Icon glyphs: white fill + purple outline glow in light mode, purple fill + white outline glow
   in dark mode. Excludes the Home orb, which already sits on its own purple disc. Light mode uses a gray outline/glow. */
.hx-nav-item:not(.hx-orb) i {
    color: #4c1d95;
    -webkit-text-stroke: 1.4px #ffffff;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8)) drop-shadow(0 0 10px rgba(255, 255, 255, 0.45));
}
.light-mode .hx-nav-item:not(.hx-orb) i {
    color: #ffffff;
    -webkit-text-stroke: 1.4px #8a8a99;
    filter: drop-shadow(0 0 4px rgba(120, 120, 135, 0.85)) drop-shadow(0 0 10px rgba(120, 120, 135, 0.5));
}
.hx-nav-item.active:not(.hx-orb) i { filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 14px rgba(255, 255, 255, 0.6)); }
.light-mode .hx-nav-item.active:not(.hx-orb) i { filter: drop-shadow(0 0 6px rgba(110, 110, 125, 1)) drop-shadow(0 0 14px rgba(110, 110, 125, 0.65)); }

.hx-nav-item.hx-orb {
    flex: 0 0 5.6rem;
    width: 5.6rem;
    height: 5.6rem;
    margin-top: -2.4rem;
    border-radius: 50%;
    /* Dark purple aurora disc: layered violet/magenta glows over a deep indigo base, with a
       border in the same violet so the glow reads as one object in both light and dark mode. */
    background:
        radial-gradient(circle at 28% 22%, rgba(196, 130, 255, 0.85), transparent 56%),
        radial-gradient(circle at 80% 84%, rgba(84, 56, 224, 0.95), transparent 60%),
        radial-gradient(circle at 66% 30%, rgba(222, 92, 224, 0.4), transparent 52%),
        #1b0a44;
    border: 1.5px solid #9866ff;
    color: #fff !important;
    box-shadow: 0 0 14px rgba(152, 102, 255, 0.75), 0 0 34px rgba(112, 64, 232, 0.5), inset 0 0 12px rgba(206, 160, 255, 0.35);
    animation: hx-orb-glow 3.6s ease-in-out infinite;
}
.hx-nav-item.hx-orb.active { color: #fff !important; border-color: #b58cff; box-shadow: 0 0 18px rgba(170, 120, 255, 0.95), 0 0 46px rgba(118, 70, 240, 0.65), inset 0 0 14px rgba(214, 170, 255, 0.45); }
.hx-nav-item.hx-orb i { font-size: 2.6rem; }
.hx-nav-item.hx-orb span { font-weight: 700; }
@keyframes hx-orb-glow { 50% { box-shadow: 0 0 20px rgba(152, 102, 255, 0.95), 0 0 44px rgba(112, 64, 232, 0.65), inset 0 0 12px rgba(206, 160, 255, 0.4); } }
@media (prefers-reduced-motion: reduce) { .hx-nav-item.hx-orb { animation: none; } }

/* Home: presence ring instead of a hero photo */
.hx-hero {
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0 -1rem;
    padding: calc(var(--hx-safe-top) + 1rem) 1rem 1.3rem;
    background: none;
    border-radius: 0 0 40px 40px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.hx-aurora {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 70% at 25% 20%, rgba(63, 224, 208, 0.3), transparent 65%),
        radial-gradient(ellipse 60% 70% at 80% 10%, rgba(91, 140, 255, 0.32), transparent 65%);
    border-bottom: 1px solid var(--border);
    border-radius: inherit;
}
.hx-hero > *:not(.hx-aurora) { position: relative; z-index: 1; }
.hx-hero .hx-hero-top { position: relative; top: auto; left: auto; right: auto; width: 100%; align-items: center; margin-top: 0.6rem; }
.hx-presence { position: relative; width: 11rem; height: 11rem; display: flex; align-items: center; justify-content: center; margin-top: 0.4rem; }
.hx-presence .avatar-circle { border-radius: 50%; box-shadow: 0 0 46px rgba(63, 224, 208, 0.45); border: 2px solid rgba(255, 255, 255, 0.25); }
.hx-ring {
    position: absolute; inset: 1.2rem; border-radius: 50%;
    border: 1.5px solid var(--hx-accent);
    animation: hx-ring 3.2s ease-out infinite;
    pointer-events: none;
}
.hx-ring.r2 { animation-delay: 1.6s; }
@keyframes hx-ring { from { transform: scale(1); opacity: 0.7; } to { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hx-ring { animation: none; opacity: 0.35; } }

.hx-hero-title { margin: 0; font-size: 1.9rem; letter-spacing: 0.01em; }

.hx-pulse {
    display: flex; align-items: center; gap: 0.7rem;
    width: min(100%, 420px); margin-top: 0.4rem;
    padding: 0.7rem 1.1rem; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    color: var(--text) !important;
}
.hx-pulse .hx-live-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.95rem; }
.hx-pulse > i { color: var(--text-dim); font-size: 0.85rem; }
.hx-pulse-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--hx-accent); box-shadow: 0 0 10px var(--hx-accent); animation: hx-blink 1.8s ease-in-out infinite; }
.hx-pulse-dot.alert { background: var(--hx-warn); box-shadow: 0 0 10px var(--hx-warn); }
@keyframes hx-blink { 50% { opacity: 0.35; } }

.hx-goal { margin-top: 1rem; gap: 0.5rem; min-height: 8.5rem; }
.hx-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; margin-top: 0.8rem; }
.hx-trio .hx-card { align-items: center; text-align: center; padding: 1rem 0.4rem; gap: 0.2rem; }
.hx-trio .hx-card-icon { width: auto; font-size: 1.3rem; }
.hx-trio .hx-dot { position: absolute; top: -0.5rem; right: -0.9rem; }
.hx-trio .hx-card-value { font-size: 1.4rem; }

/* Me */
.hx-banner { background: linear-gradient(100deg, var(--hx-accent-2), var(--hx-accent)); color: #04121a !important; }
.hx-wallet { background: linear-gradient(160deg, rgba(91, 140, 255, 0.55), rgba(63, 224, 208, 0.25) 60%, rgba(255, 255, 255, 0.05)); border: 1px solid var(--border); }
.theme-noir.hx-app label.hx-edit-btn { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border-strong); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.hx-me-avatar .avatar-circle { border-radius: 50%; }

/* Chat */
.hx-app .cg-message-row.user .cg-message-body { background: linear-gradient(135deg, var(--hx-accent-2), var(--hx-accent)); color: #04121a; border-color: transparent; }
.hx-app .cg-message-body { border: 1px solid var(--border); }
.hx-app .cg-composer-box { background: var(--surface); border: 1px solid var(--border-strong); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }

.hx-banner em, .hx-daily > em { font-style: normal; font-weight: 700; }

/* Light mode: the pale canvas washes panels out, so give every surface a firm dark outline. */
.theme-noir.hx-app.light-mode {
    --border: rgba(13, 27, 51, 0.7);
    --border-strong: #0d1b33;
    --hx-outline: 1px solid #0d1b33;
}

.light-mode .hx-card,
.light-mode .hx-daily,
.light-mode .hx-menu,
.light-mode .hx-sheet,
.light-mode .hx-stats,
.light-mode .hx-pulse,
.light-mode .hx-nav,
.light-mode .hx-wallet,
.light-mode .hx-banner,
.light-mode .hx-quick-icon,
.light-mode .hx-row-icon,
.light-mode .hx-post-avatar,
.light-mode .hx-tile,
.light-mode .hx-daily-item,
.light-mode .hx-pill,
.light-mode .hx-chip-btn,
.light-mode .hx-wallet-btn,
.light-mode label.hx-edit-btn,
.light-mode .cg-composer-box,
.light-mode .cg-message-body,
.light-mode .card,
.light-mode .cg-agent-card,
.light-mode .stat-tile,
.light-mode .input,
.light-mode .btn {
    border: var(--hx-outline);
}

.light-mode .hx-composer-bar {
    border-width: 1px;
    background-image: linear-gradient(var(--bg), var(--bg)), linear-gradient(#0d1b33, #0d1b33);
    /* L2: a real navy drop reads as elevation on white; the violet glow stays soft. */
    box-shadow: 0 14px 30px rgba(13, 27, 51, 0.18), 0 0 30px rgba(139, 108, 246, 0.38);
}

/* Hero glass edge, dividers and list rows */
.light-mode .hx-aurora { border-bottom: none; }
.light-mode .hx-hero { border-bottom: none; }
.light-mode .hx-post, .light-mode .hx-row-mail, .light-mode .hx-menu a, .light-mode .hx-menu button { border-bottom-width: 1px; border-color: rgba(13, 27, 51, 0.7); }
.light-mode .hx-menu > :last-child { border-bottom: none; }
.light-mode .hx-check { border: 1px solid #0d1b33; }
.light-mode .hx-check.done { background: #0d1b33; }
.light-mode .hx-check.done::after { color: #fff; }
.light-mode .hx-presence .avatar-circle { border: 2px solid #0d1b33; box-shadow: 0 0 0 4px rgba(13, 159, 160, 0.25); }
.light-mode .hx-me-avatar .avatar-circle { border: 2px solid #0d1b33; }
.light-mode .hx-quick-item.active .hx-quick-icon { box-shadow: 0 0 14px rgba(13, 159, 160, 0.35); }
.light-mode .hx-tabs button.active { border-bottom: 2px solid #0d1b33; }
.light-mode .hx-app .cg-message-row.user .cg-message-body,
.light-mode.hx-app .cg-message-row.user .cg-message-body { border: var(--hx-outline); }

/* ==========================================================================
   Living scene (Home hero). Dashboard.razor derives .scene-{sleeping|working|mail|done|night|standby}
   and .tod-{morning|day|evening|night} from real data; everything here is CSS-only animation.
   ========================================================================== */

/* Top pad is deliberately small: the top row (pills + settings) sits just above the avatar. It used to
   be 2.8rem, which left a dead gap (and reserved room for the tap speech bubble, which now overlaps the
   avatar top a little when it pops). */
.hx-stage { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 0.8rem; width: 100%; }

button.hx-presence {
    background: none; border: none; padding: 0; margin: 0.4rem 0 0; color: inherit; cursor: pointer;
    -webkit-tap-highlight-color: transparent; font: inherit;
}
button.hx-presence:active .avatar-circle { transform: scale(0.96); }
.hx-presence .avatar-circle { transition: transform 0.15s ease, filter 0.6s ease; }

/* Speech bubble (tap-the-agent line) */
.hx-bubble {
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    max-width: min(88%, 320px); padding: 0.55rem 0.95rem;
    background: var(--surface-alt); border: 1px solid var(--border-strong); border-radius: 18px;
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    font-size: 0.85rem; line-height: 1.3; text-align: center; color: var(--text);
    animation: hx-pop 0.25s ease-out; z-index: 3;
}
.hx-bubble::after {
    content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px;
    background: inherit; border-right: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong);
    transform: translateX(-50%) rotate(45deg);
}
@keyframes hx-pop { from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.95); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }

/* Mood badge on the avatar */
.hx-mood {
    position: absolute; right: 0.9rem; bottom: 1rem; width: 2.3rem; height: 2.3rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-alt); border: 1px solid var(--border-strong); color: var(--hx-accent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 1rem; z-index: 2;
}

/* Scene pill dot follows the state colour */
.hx-scene-pill i { font-size: 0.5rem; color: var(--hx-accent); }
.scene-working .hx-scene-pill i { color: #ffb454; }
.scene-mail .hx-scene-pill i { color: #ff8a7a; }
.scene-done .hx-scene-pill i { color: #7dffb0; }
.scene-sleeping .hx-scene-pill i, .scene-night .hx-scene-pill i { color: #8b93b8; }

/* standby: slow breathing */
.scene-standby .hx-presence .avatar-circle { animation: hx-breathe 4.5s ease-in-out infinite; }
@keyframes hx-breathe { 50% { transform: scale(1.035); } }

/* working: dashed orbiting ring, spinning gear, warm ring colour */
.scene-working .hx-ring { border-style: dashed; border-color: #ffb454; animation: hx-spin 7s linear infinite; }
.scene-working .hx-ring.r2 { animation-duration: 11s; animation-direction: reverse; inset: 0.4rem; opacity: 0.6; }
.scene-working .hx-mood { color: #ffb454; }
.scene-working .hx-mood i { animation: hx-spin 3s linear infinite; }
@keyframes hx-spin { to { transform: rotate(360deg); } }

/* mail: bouncing envelope, warm ring */
.scene-mail .hx-ring { border-color: #ff8a7a; }
.scene-mail .hx-mood { color: #ff8a7a; animation: hx-bounce 1.4s ease-in-out infinite; }
@keyframes hx-bounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-7px); } }

/* done: green ring, star pop, sparks */
.scene-done .hx-ring { border-color: #7dffb0; }
.scene-done .hx-mood { color: #7dffb0; animation: hx-star 0.9s ease-out; }
@keyframes hx-star { from { transform: scale(0) rotate(-90deg); } 60% { transform: scale(1.35) rotate(10deg); } to { transform: scale(1) rotate(0); } }
.hx-sparks b { position: absolute; top: 50%; left: 50%; width: 7px; height: 7px; border-radius: 50%; background: #7dffb0; box-shadow: 0 0 8px #7dffb0; opacity: 0; animation: hx-spark 2.4s ease-out infinite; }
.hx-sparks b:nth-child(1) { --dx: -78px; --dy: -70px; }
.hx-sparks b:nth-child(2) { --dx: 82px; --dy: -60px; animation-delay: 0.3s; }
.hx-sparks b:nth-child(3) { --dx: -70px; --dy: 66px; animation-delay: 0.6s; }
.hx-sparks b:nth-child(4) { --dx: 74px; --dy: 72px; animation-delay: 0.9s; }
@keyframes hx-spark { 0% { opacity: 0; transform: translate(0, 0) scale(0.4); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); } }

/* sleeping / late night: dimmed avatar, slow faint rings, floating z's */
.scene-sleeping .hx-presence .avatar-circle, .scene-night .hx-presence .avatar-circle { filter: brightness(0.6) saturate(0.6); }
.scene-sleeping .hx-ring, .scene-night .hx-ring { border-color: #8b93b8; animation-duration: 7s; }
.scene-sleeping .hx-mood, .scene-night .hx-mood { color: #b8c0e8; }
.scene-sleeping .hx-aurora { opacity: 0.45; }
.hx-zzz { position: absolute; top: 0.6rem; right: 0.6rem; width: 3rem; height: 3rem; pointer-events: none; }
.hx-zzz b { position: absolute; left: 0; bottom: 0; font-size: 1rem; color: var(--text-dim); opacity: 0; animation: hx-z 3.6s ease-in infinite; }
.hx-zzz b:nth-child(2) { animation-delay: 1.2s; font-size: 1.25rem; }
.hx-zzz b:nth-child(3) { animation-delay: 2.4s; font-size: 1.55rem; }
@keyframes hx-z { 0% { opacity: 0; transform: translate(0, 0); } 25% { opacity: 0.9; } 100% { opacity: 0; transform: translate(1.6rem, -2.4rem); } }

/* time of day: the aurora backdrop shifts colour */
.tod-morning .hx-aurora {
    background:
        radial-gradient(ellipse 60% 70% at 25% 20%, rgba(255, 196, 140, 0.34), transparent 65%),
        radial-gradient(ellipse 60% 70% at 80% 10%, rgba(63, 224, 208, 0.3), transparent 65%);
}
.tod-evening .hx-aurora {
    background:
        radial-gradient(ellipse 60% 70% at 25% 20%, rgba(255, 128, 110, 0.34), transparent 65%),
        radial-gradient(ellipse 60% 70% at 80% 10%, rgba(150, 100, 255, 0.34), transparent 65%);
}
.tod-night .hx-aurora {
    background:
        radial-gradient(ellipse 60% 70% at 25% 20%, rgba(70, 90, 200, 0.34), transparent 65%),
        radial-gradient(ellipse 60% 70% at 80% 10%, rgba(120, 70, 200, 0.3), transparent 65%);
}

@media (prefers-reduced-motion: reduce) {
    .scene-standby .hx-presence .avatar-circle, .scene-working .hx-ring, .scene-working .hx-mood i,
    .scene-mail .hx-mood, .hx-zzz b, .hx-sparks b, .hx-pulse-dot { animation: none; }
    .hx-zzz b { opacity: 0.6; }
}

/* ==========================================================================
   Readability pass (dark + light): native controls, buttons, alerts.
   ========================================================================== */

/* Tell the browser which scheme we're in so native <select> popups, scrollbars and date pickers
   render dark-on-dark / light-on-light - without it a dark theme gets a white, unreadable dropdown
   list. Options are also styled explicitly since some engines ignore color-scheme there. */
.theme-noir.hx-app { color-scheme: dark; }
.theme-noir.hx-app.light-mode { color-scheme: light; }
.hx-app select option, .hx-app select optgroup { background-color: #141c3a; color: #eaf2ff; }
.light-mode.hx-app select option, .light-mode.hx-app select optgroup { background-color: #ffffff; color: #0d1b33; }

/* Primary button: the base rule fills with --text and uses near-black text, which in light mode is
   dark navy on dark navy. Aurora accent with dark text works in both modes. */
.hx-app .btn-primary {
    background: linear-gradient(135deg, var(--hx-accent), var(--hx-accent-2));
    color: #04121a;
    border-color: transparent;
}
.hx-app .btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--hx-accent), var(--hx-accent-2)); box-shadow: 0 0 16px var(--hx-accent-tint); filter: brightness(1.06); }

/* Send arrow: same dark-on-dark problem as the primary button in light mode. */
.hx-app .cg-send-btn { background: linear-gradient(135deg, var(--hx-accent), var(--hx-accent-2)); color: #04121a; }
.hx-app .cg-send-btn:disabled { opacity: 0.45; }

/* Pale-pink error/warn text vanishes on the light canvas. */
.light-mode.hx-app .alert { color: #9d1f17; }
.light-mode.hx-app .hx-pill-warn { color: #a3261f; }
.light-mode.hx-app .hx-badge { color: #0a7778; }
.light-mode.hx-app .btn-danger { color: #b3261e; border-color: #b3261e; }
.light-mode.hx-app .btn-ghost { color: var(--text); }

/* Home: chat bar pinned above the tab bar so it's always reachable without scrolling. The tab bar's
   raised orb pokes ~1.7rem above the bar, so sit clear of it. */
.hx-composer-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--hx-safe-bottom) + 9.1rem);
    width: min(calc(100% - 2rem), 528px);
    margin-top: 0;
    z-index: 39;
}
.hx-page:has(.hx-composer-bar) { padding-bottom: calc(var(--hx-safe-bottom) + 14rem); }

/* Loading placeholder for the Home/Rae landing (Member/Dashboard.razor). */
.hx-skeleton { display: block; background: var(--surface-alt); animation: hx-skel 1.4s ease-in-out infinite; }
.hx-skeleton-avatar { width: 56px; height: 56px; border-radius: 50%; }
.hx-skeleton-line { width: 12rem; height: 1.2rem; border-radius: 999px; }
.hx-skeleton-heading { animation: none; }
@keyframes hx-skel { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .hx-skeleton { animation: none; } }

/* Admin "Log in as member" banner (PublicLayout.razor) */
.hx-impersonation {
    position: fixed; top: 0; left: 0; right: 0; z-index: 70;
    display: flex; align-items: center; justify-content: center; gap: 0.8rem;
    padding: calc(var(--hx-safe-top) + 0.4rem) 1rem 0.4rem;
    background: linear-gradient(90deg, #5b2fd6, #8a4dff);
    color: #fff; font-size: 0.85rem;
}
.hx-impersonation button {
    border: 1px solid rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.15); color: #fff;
    border-radius: 999px; padding: 0.2rem 0.8rem; font-size: 0.8rem; cursor: pointer; font-family: inherit;
}

/* --- Typing indicator (ChatBox): three bouncing dots, like a real messenger --- */
.cg-typing .cg-dots { display: inline-flex; align-items: center; gap: 5px; height: 1.3rem; }
.cg-dots i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); animation: cg-dot 1.2s ease-in-out infinite; }
.cg-dots i:nth-child(2) { animation-delay: 0.18s; }
.cg-dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes cg-dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.35; } 30% { transform: translateY(-4px); opacity: 1; } }
.cg-typing { animation: hx-pop-in 0.2s ease-out; }
@keyframes hx-pop-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cg-dots i { animation: none; opacity: 0.7; } .cg-typing { animation: none; } }

/* --- Mail tab badge --- */
.hx-nav-item { position: relative; }
.hx-nav-badge {
    position: absolute; top: -0.3rem; left: calc(50% + 0.7rem);
    min-width: 1.3rem; height: 1.3rem; padding: 0 0.3rem; border-radius: 999px;
    background: var(--hx-warn); color: #fff; font-size: 0.75rem; font-weight: 700; line-height: 1.3rem; text-align: center;
    box-shadow: 0 0 8px rgba(240, 112, 106, 0.6);
}

/* --- Home without an agent: hooded figure waiting in the mist --- */
.scene-mystery .hx-aurora {
    background:
        radial-gradient(ellipse 60% 70% at 30% 20%, rgba(120, 70, 220, 0.4), transparent 65%),
        radial-gradient(ellipse 60% 70% at 80% 10%, rgba(60, 40, 160, 0.4), transparent 65%);
}
.hx-figure { width: 9.5rem; height: 11rem; margin-top: 1.2rem; filter: drop-shadow(0 0 22px rgba(152, 102, 255, 0.55)); animation: hx-float 5s ease-in-out infinite; }
.hx-figure-svg { display: block; width: 100%; height: 100%; }
.hx-eye { filter: drop-shadow(0 0 4px #6fe6ff); transform-box: fill-box; transform-origin: center; animation: hx-eye 5s ease-in-out infinite; }
.hx-spark { transform-box: fill-box; transform-origin: center; animation: hx-twinkle 3.2s ease-in-out infinite; }
.hx-spark.s2 { animation-delay: 1.1s; }
.hx-spark.s3 { animation-delay: 2.2s; }
.scene-mystery .hx-stage::after {
    content: ""; position: absolute; left: -10%; right: -10%; bottom: -0.5rem; height: 4.5rem; pointer-events: none;
    background: radial-gradient(ellipse at 50% 100%, rgba(150, 110, 255, 0.35), transparent 70%);
    animation: hx-mist 6s ease-in-out infinite;
}
.scene-mystery .hx-scene-pill i { color: #9866ff; }
.scene-mystery .hx-hero-title { letter-spacing: 0.35em; }
@keyframes hx-float { 50% { transform: translateY(-6px); } }
@keyframes hx-eye { 0%, 88%, 100% { transform: scaleY(1); } 92% { transform: scaleY(0.1); } }
@keyframes hx-twinkle { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes hx-mist { 50% { opacity: 0.55; transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .hx-figure, .hx-eye, .hx-spark, .scene-mystery .hx-stage::after { animation: none; } }

/* The generic .alert box style also matched .hx-pulse-dot.alert (unread state) and turned the 0.6rem
   dot into a big red block; reset it back to a dot. */
.hx-pulse-dot.alert { padding: 0; margin: 0; border: none; border-radius: 50%; width: 0.6rem; height: 0.6rem; font-size: 0; background: var(--hx-warn); box-shadow: 0 0 10px var(--hx-warn); }

/* --- Mail filters: make the active filter and its result obvious --- */
.hx-quick-item { border-radius: 18px; padding: 0.5rem 0.2rem; transition: background-color 0.15s ease; }
.hx-quick-item.active { background: var(--hx-accent-tint); }
.hx-quick-item.active > span:last-child { font-weight: 700; color: var(--hx-accent); }
.hx-count { display: inline-block; margin-left: 0.15rem; font-size: 0.75rem; color: var(--text-dim); }
.hx-filter-note { display: flex; align-items: center; gap: 0.5rem; margin: 0.9rem 0.25rem 0.3rem; font-size: 0.85rem; }
.hx-link-btn { background: none; border: none; padding: 0; margin-left: auto; color: var(--hx-accent); font: inherit; font-size: 0.8rem; text-decoration: underline; cursor: pointer; }

/* --- Me page --- */

/* Balance card: the gradient is pale in light mode, so the fixed white text disappeared. */
.light-mode .hx-wallet small { color: var(--text-dim); }
.light-mode .hx-wallet b, .light-mode .hx-wallet-btn { color: var(--text); }
.light-mode .hx-wallet-btn { border-color: var(--text); }

/* "+" upload button, left of the avatar (an <InputFile> inside a label: the whole circle is the target). */
.theme-noir.hx-app label.hx-avatar-plus {
    position: absolute; left: -3.3rem; bottom: 0.6rem;
    width: 2.6rem; height: 2.6rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--hx-accent), var(--hx-accent-2)); color: #04121a;
    font-size: 1.15rem; cursor: pointer; overflow: hidden; color: #04121a; margin: 0;
    box-shadow: 0 4px 14px rgba(63, 224, 208, 0.35);
    text-transform: none; letter-spacing: 0; margin: 0;
}
.hx-avatar-plus input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* Wallet activity explainer (Usage page) */
.hx-explain { margin: 0 0 1rem; font-size: 0.85rem; color: var(--text-dim); }
.hx-explain summary { cursor: pointer; color: var(--hx-accent); }
.hx-explain ul { margin: 0.5rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; }
.hx-explain b { color: var(--text); }

/* --- Lightbox for avatars and Gallery items (ImageViewer.razor) --- */
.hx-viewer {
    position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem;
    padding: calc(var(--hx-safe-top) + 1rem) 1rem calc(var(--hx-safe-bottom) + 1rem);
    background: rgba(4, 3, 16, 0.86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    animation: hx-pop-in 0.2s ease-out;
}
.hx-viewer img, .hx-viewer video { max-width: min(92vw, 720px); max-height: 78vh; object-fit: contain; border-radius: 24px; box-shadow: 0 0 60px rgba(152, 102, 255, 0.35); }
.hx-viewer-caption { margin: 0; color: #eaf2ff; font-weight: 600; letter-spacing: 0.02em; }
.hx-viewer-empty { margin: 0; color: #93a4c4; }
.hx-viewer-close {
    position: absolute; top: calc(var(--hx-safe-top) + 0.8rem); right: 0.9rem; width: 2.5rem; height: 2.5rem; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 1.1rem; cursor: pointer;
}
.avatar-circle.zoomable { cursor: zoom-in; }

/* Expand button on the Home hero avatar (bottom-left; the mood badge is bottom-right) */
.hx-zoom-btn {
    position: absolute; bottom: 1rem; left: calc(50% - 5.1rem); z-index: 3;
    width: 2rem; height: 2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--surface-alt); border: 1px solid var(--border-strong); color: var(--text); font-size: 0.85rem; cursor: pointer;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

/* Me: small "+" badge at the lower right of the avatar circle (overrides the earlier side-button). */
.hx-me-avatar { width: 7.5rem; margin: 0.5rem auto 0; }
.theme-noir.hx-app label.hx-avatar-plus {
    left: auto; right: 0.1rem; bottom: 0.1rem; width: 1.9rem; height: 1.9rem; font-size: 0.85rem;
    border: 2px solid var(--bg); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* --- Sign-in gate (SignInGate.razor): full-screen, over whatever layout the blocked page uses --- */
.theme-noir.hx-app.hx-gate {
    position: fixed; inset: 0; z-index: 80; height: auto; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.hx-gate-card { width: min(100%, 24rem); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.8rem; }
.hx-gate-card h1 { margin: 0.4rem 0 0; font-size: 1.6rem; }
.hx-gate-card p { margin: 0; max-width: 20rem; }
.hx-figure.hx-figure-sm { width: 6rem; height: 7rem; margin-top: 0; }

/* --- Public landing page (Home.razor) --- */
.hx-landing { padding-bottom: 1.6rem; }
.hx-landing-lead { max-width: 24rem; margin: 0.2rem 0 0; text-align: center; color: var(--text-dim); line-height: 1.55; font-size: 0.95rem; }
.hx-landing-cta { margin-top: 0.6rem; padding: 0.7rem 2rem; font-size: 1rem; }
.hx-section-title { font-size: 1.15rem; margin: 1.6rem 0.25rem 0.7rem; }
.hx-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.hx-steps li { display: flex; gap: 0.9rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 0.9rem 1rem; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.hx-steps li > span:last-child { display: grid; gap: 0.15rem; }
.hx-steps small { color: var(--text-dim); line-height: 1.45; }
.hx-step-icon { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--hx-accent-tint); color: var(--hx-accent); }
.hx-landing-features { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.hx-landing-features .hx-card { text-align: left; }
.hx-residents { display: flex; gap: 0.7rem; overflow-x: auto; padding-bottom: 0.3rem; }
.hx-resident { flex: none; width: 6.5rem; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.9rem 0.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; }
.hx-resident small { color: var(--hx-accent); }
.hx-landing-plans { margin-top: 1.4rem; }
.light-mode .hx-steps li, .light-mode .hx-resident { border: var(--hx-outline); }

/* Aurelia as an avatar (Avatar Mystery="true"): the figure fills the circle on a deep-violet backdrop.
   A real uploaded picture (the <img>) still covers it when one exists. */
.avatar-circle.avatar-figure { background: radial-gradient(circle at 50% 30%, #3a2280, #0b0620 75%); }
.avatar-circle.avatar-figure .hx-figure { position: absolute; inset: 6% 8% 0; width: auto; height: auto; margin: 0; filter: none; animation: none; }
.avatar-circle.avatar-figure .hx-eye, .avatar-circle.avatar-figure .hx-spark { animation: none; }

/* --- Enhancement pass: edge-to-edge app, glass tab bar, avatar "+" / upload spinner, update prompt --- */

/* Tab bar: see-through glass (content shows through, blurred) instead of a near-opaque slab. */
.theme-noir.hx-app { --hx-nav-bg: rgba(14, 22, 48, 0.38); }
.theme-noir.hx-app.light-mode { --hx-nav-bg: rgba(255, 255, 255, 0.45); }
.hx-nav {
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    backdrop-filter: blur(24px) saturate(1.4);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

/* "+" badge: above the avatar (the avatar is later in the DOM, so it painted over the badge) and smaller. */
.theme-noir.hx-app label.hx-avatar-plus {
    z-index: 5; width: 1.5rem; height: 1.5rem; font-size: 0.7rem; right: 0.15rem; bottom: 0.15rem;
    border-width: 2px;
}
.hx-me-avatar { position: relative; }
.hx-avatar-busy {
    position: absolute; inset: 0; z-index: 4; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: rgba(8, 6, 24, 0.55); color: #fff; font-size: 1.6rem; pointer-events: none;
}

/* App update prompt (UpdatePrompt.razor) */
.hx-update-backdrop {
    position: fixed; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center;
    padding: calc(var(--hx-safe-top) + 1rem) 1rem calc(var(--hx-safe-bottom) + 1rem);
    background: rgba(4, 3, 16, 0.7); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hx-update { width: min(100%, 22rem); text-align: center; display: flex; flex-direction: column; gap: 0.7rem; align-items: center; }
.hx-update h2 { margin: 0; font-size: 1.3rem; }
.hx-update p { margin: 0; }
.hx-update-icon { font-size: 2.2rem; color: var(--hx-accent); }
.hx-update-notes { white-space: pre-wrap; text-align: left; font-size: 0.9rem; background: var(--surface-alt); border-radius: 14px; padding: 0.7rem 0.9rem; width: 100%; }
.hx-update-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
.hx-update-hint { font-size: 0.75rem; }

/* Avatars: while a picture is expected (Src set) don't flash the initial / "?" behind it - the letter
   only appears if the image actually fails (onerror adds .no-img). Fade is short so cached pictures feel instant. */
.avatar-circle.has-src:not(.no-img) > span { visibility: hidden; }
.avatar-circle img { transition: opacity 0.15s ease; }

/* Chat attachments + Gallery tiles: fade in on load instead of popping in abruptly once the network
   fetch finishes (loading="lazy" images used to hard-cut from blank to loaded). */
.cg-fade-img { opacity: 0; transition: opacity 0.25s ease; }
.cg-fade-img.loaded { opacity: 1; }

/* In-app update download progress bar */
.hx-progress { width: 100%; height: 0.7rem; border-radius: 999px; background: var(--surface-alt); overflow: hidden; border: 1px solid var(--border); }
.hx-progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--hx-accent), var(--hx-accent-2, #8b6cf6)); transition: width 0.2s ease; }
.hx-progress-bar.indeterminate { animation: hx-indeterminate 1.1s ease-in-out infinite alternate; }
@keyframes hx-indeterminate { from { margin-left: 0; } to { margin-left: 60%; } }

/* Hidden avatar pre-downloads (PublicLayout): fetched into the device cache, never visible. */
.hx-prefetch { position: absolute; width: 0; height: 0; overflow: hidden; opacity: 0; pointer-events: none; }

/* --- Chat attachments: "+" button, picker panel, pending chips, in-bubble media/files --- */
.cg-plus-btn {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 0.95rem;
    background: var(--text); color: var(--bg); transition: transform 0.2s ease;
}
.cg-plus-btn.open { transform: rotate(45deg); }
.cg-plus-btn:disabled { opacity: 0.5; }
.hx-app .cg-composer-box { padding-left: 0.5rem; }

.cg-attach-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-top: 0.6rem; }
.cg-attach-tile {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.8rem 0.4rem;
    border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text); cursor: pointer; font-size: 0.85rem;
}
.cg-attach-tile i { font-size: 1.5rem; color: var(--hx-accent); }
.cg-attach-tile input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.cg-pending { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.cg-pending-chip {
    display: inline-flex; align-items: center; gap: 0.4rem; max-width: 100%; padding: 0.3rem 0.4rem 0.3rem 0.7rem;
    border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border-strong); font-size: 0.8rem;
}
.cg-pending-chip.failed { border-color: var(--hx-warn); }
.cg-pending-name { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-pending-chip button { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 0.1rem 0.3rem; }

.cg-attachments { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.cg-attach-img { padding: 0; border: none; background: none; cursor: zoom-in; display: block; }
.cg-attach-img img { display: block; max-width: 100%; max-height: 18rem; border-radius: 16px; }
.cg-attach-video { display: block; width: 100%; max-height: 18rem; border-radius: 16px; background: #000; }
.cg-attach-file {
    display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.8rem; border-radius: 14px; text-decoration: none;
    background: var(--surface-alt); border: 1px solid var(--border); color: var(--text) !important;
}
.cg-attach-file i { font-size: 1.4rem; color: var(--hx-accent); }
.cg-attach-file-text { display: flex; flex-direction: column; min-width: 0; }
.cg-attach-file-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cg-attach-file-text small { color: var(--text-dim); }

/* --- Voice: mic button (takes the send button's place), spoken-replies toggle --- */
.cg-mic-btn {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 0.95rem;
    background: var(--text); color: var(--bg);
}
.cg-mic-btn.recording { background: var(--hx-warn); color: #fff; animation: cg-rec-pulse 1.2s ease-in-out infinite; }
.cg-mic-btn:disabled { opacity: 0.55; }
@keyframes cg-rec-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(240, 112, 106, 0.55); } 50% { box-shadow: 0 0 0 9px rgba(240, 112, 106, 0); } }
.cg-voice-toggle {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer; background: transparent;
    color: var(--text-dim); display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.cg-voice-toggle.on { color: var(--hx-accent); background: var(--hx-accent-tint); }
@media (prefers-reduced-motion: reduce) { .cg-mic-btn.recording { animation: none; } }

/* --- First-run welcome guide (Welcome.razor) --- */
.theme-noir.hx-app.hx-welcome { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; overflow: hidden; height: auto; }
.hx-welcome .hx-aurora { opacity: 0.9; }
.hx-welcome-skip {
    position: absolute; z-index: 5; top: calc(var(--hx-safe-top) + 0.9rem); right: 1rem; background: none; border: none;
    color: var(--text-dim); font: inherit; font-size: 0.95rem; cursor: pointer; padding: 0.4rem 0.6rem;
}
.hx-welcome-track {
    position: relative; z-index: 2; flex: 1; display: flex; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
}
.hx-welcome-track::-webkit-scrollbar { display: none; }
.hx-welcome-slide {
    flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; box-sizing: border-box;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0.9rem;
    padding: calc(var(--hx-safe-top) + 3rem) 1.8rem 1rem;
}
.hx-welcome-slide h1 { margin: 0.4rem 0 0; font-size: 1.7rem; line-height: 1.2; }
.hx-welcome-slide p { margin: 0; max-width: 22rem; color: var(--text-dim); line-height: 1.55; }
.hx-figure-wrap { display: flex; justify-content: center; }
.hx-welcome-orb {
    width: 7.5rem; height: 7.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; color: #fff;
    background:
        radial-gradient(circle at 28% 22%, rgba(196, 130, 255, 0.85), transparent 56%),
        radial-gradient(circle at 80% 84%, rgba(84, 56, 224, 0.95), transparent 60%),
        #1b0a44;
    border: 1.5px solid #9866ff; box-shadow: 0 0 30px rgba(152, 102, 255, 0.6), 0 0 70px rgba(112, 64, 232, 0.4);
    animation: hx-orb-glow 3.6s ease-in-out infinite;
}

/* Language wheel: a short vertical scroll-snap list; the row nearest the middle is the choice, the rest fade out. */
.hx-wheel {
    position: relative; width: min(100%, 17rem); height: 14rem; margin-top: 0.4rem; overflow-y: auto; scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(transparent, #000 24%, #000 76%, transparent);
    mask-image: linear-gradient(transparent, #000 24%, #000 76%, transparent);
}
.hx-wheel::-webkit-scrollbar { display: none; }
.hx-wheel-pad { height: 5.45rem; }
.hx-wheel-item {
    display: block; width: 100%; height: 3.1rem; scroll-snap-align: center; background: none; border: none; cursor: pointer;
    color: var(--text-dim); font: inherit; font-size: 1.15rem; transition: color 0.15s ease, transform 0.15s ease;
}
.hx-wheel-item.active { color: var(--text); font-weight: 700; transform: scale(1.12); }

.hx-welcome-dots { position: relative; z-index: 3; display: flex; justify-content: center; gap: 0.45rem; padding: 0.4rem 0 0.8rem; }
.hx-welcome-dots span { width: 0.5rem; height: 0.5rem; border-radius: 999px; background: var(--border-strong); transition: width 0.2s ease, background-color 0.2s ease; }
.hx-welcome-dots span.on { width: 1.6rem; background: var(--hx-accent); }
.hx-welcome-actions {
    position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
    padding: 0 1.5rem calc(var(--hx-safe-bottom) + 1.4rem); min-height: 6.2rem;
}
.hx-welcome-actions .btn { width: min(100%, 20rem); }

/* --- Hands-free voice conversation overlay (ChatBox talk mode) --- */
.cg-talk {
    position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.7rem;
    padding: calc(var(--hx-safe-top) + 1.5rem) 1.5rem calc(var(--hx-safe-bottom) + 1.5rem); text-align: center;
    background:
        radial-gradient(ellipse 80% 50% at 15% 0%, rgba(63, 224, 208, 0.18), transparent 60%),
        radial-gradient(ellipse 70% 45% at 95% 10%, rgba(91, 140, 255, 0.22), transparent 60%),
        rgba(7, 11, 26, 0.94);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--text);
}
.light-mode .cg-talk { background: radial-gradient(ellipse 80% 50% at 15% 0%, rgba(63, 224, 208, 0.3), transparent 60%), rgba(238, 246, 251, 0.96); }
.cg-talk-orb { position: relative; width: 9rem; height: 9rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.cg-talk-orb::before, .cg-talk-orb::after { content: ""; position: absolute; inset: -0.6rem; border-radius: 50%; border: 2px solid var(--hx-accent); opacity: 0; }
.cg-talk-orb.listening::before { animation: cg-talk-breathe 2.4s ease-in-out infinite; }
.cg-talk-orb.hearing::before { opacity: 0.9; animation: cg-talk-ring 0.9s ease-out infinite; }
.cg-talk-orb.hearing::after { animation: cg-talk-ring 0.9s ease-out 0.45s infinite; }
.cg-talk-orb.thinking::before { opacity: 0.7; border-style: dashed; animation: cg-talk-spin 3s linear infinite; }
.cg-talk-orb.transcribing::before { opacity: 0.7; border-style: dashed; animation: cg-talk-spin 3s linear infinite; }
.cg-talk-orb.speaking::before { animation: cg-talk-ring 1.2s ease-out infinite; border-color: var(--hx-accent-2, #5b8cff); }
.cg-talk-orb.speaking::after { animation: cg-talk-ring 1.2s ease-out 0.6s infinite; border-color: var(--hx-accent-2, #5b8cff); }
@keyframes cg-talk-breathe { 0%, 100% { opacity: 0.15; transform: scale(0.98); } 50% { opacity: 0.6; transform: scale(1.04); } }
@keyframes cg-talk-ring { from { opacity: 0.85; transform: scale(1); } to { opacity: 0; transform: scale(1.35); } }
@keyframes cg-talk-spin { to { transform: rotate(360deg); } }
.cg-talk-name { margin: 0.4rem 0 0; font-size: 1.5rem; }
.cg-talk-state { margin: 0; color: var(--hx-accent); font-weight: 600; min-height: 1.4em; }
.cg-talk-heard { margin: 0.4rem 0 0; max-width: 24rem; color: var(--text-dim); font-style: italic; }
.cg-talk-reply { margin: 0; max-width: 26rem; max-height: 30vh; overflow-y: auto; line-height: 1.5; }
.cg-talk-actions { display: flex; gap: 0.8rem; margin-top: 1rem; flex-wrap: wrap; justify-content: center; }
.cg-talk-btn {
    display: flex; flex-direction: column; align-items: center; gap: 0.3rem; min-width: 5.2rem; padding: 0.7rem 0.9rem; border-radius: 20px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); font: inherit; font-size: 0.8rem;
}
.cg-talk-btn i { font-size: 1.2rem; }
.cg-talk-btn.on i { color: var(--hx-accent); }
.cg-talk-btn.end { background: var(--hx-warn); border-color: transparent; color: #fff; }
@media (prefers-reduced-motion: reduce) { .cg-talk-orb::before, .cg-talk-orb::after { animation: none !important; } }

/* Me tab: shimmer placeholders while member data loads, then a soft fade-in (Member/Profile.razor). */
.hx-skel-num { display: inline-block; width: 2.6rem; height: 1.3rem; border-radius: 999px; vertical-align: middle; }
.hx-skel-pill { display: inline-block; width: 9rem; height: 1.6rem; border-radius: 999px; }
.hx-skel-task { height: 2.6rem; border-radius: 12px; margin-top: 0.5rem; }
.hx-fade-in { animation: hx-pop-in 0.25s ease-out both; }
@media (prefers-reduced-motion: reduce) { .hx-fade-in { animation: none; } }
.hx-me-sub-fixed { min-height: 2.05rem; }

/* ---- AuraLoader: Aurelia's ghost as the loading indicator (Shared/AuraLoader.razor) ---- */
.aura-loader { display: flex; align-items: center; justify-content: center; position: relative; width: 100%; }
.aura-block { padding: 2rem 0; }
.aura-page { min-height: 60vh; }
.aura-chat { min-height: 60vh; padding: 1rem 0; }
.aura-core { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; position: relative; z-index: 1; }
.aura-ghost { width: 72px; animation: aura-bob 1.6s ease-in-out infinite; filter: drop-shadow(0 6px 14px rgba(140, 100, 255, 0.45)); }
.aura-ghost .hx-figure, .aura-ghost .hx-figure-svg { width: 100%; height: auto; display: block; }
.aura-shadow { width: 46px; height: 8px; border-radius: 50%; background: rgba(120, 90, 220, 0.35); animation: aura-shadow 1.6s ease-in-out infinite; }
.aura-label { margin: 0.4rem 0 0; font-size: 0.85rem; opacity: 0.75; }
.aura-dots i { font-style: normal; display: inline-block; animation: aura-dot 1.2s infinite; }
.aura-dots i:nth-child(2) { animation-delay: 0.2s; }
.aura-dots i:nth-child(3) { animation-delay: 0.4s; }
.aura-skeleton { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 0.9rem; padding: 0.5rem 0.25rem; overflow: hidden; }
.aura-bubble { height: 2.6rem; border-radius: 1.1rem; background: linear-gradient(100deg, rgba(150, 130, 220, 0.12) 30%, rgba(150, 130, 220, 0.28) 50%, rgba(150, 130, 220, 0.12) 70%); background-size: 200% 100%; animation: aura-shimmer 1.4s linear infinite; }
.aura-bubble.left { align-self: flex-start; border-bottom-left-radius: 0.3rem; }
.aura-bubble.right { align-self: flex-end; border-bottom-right-radius: 0.3rem; }
.aura-bubble.w35 { width: 35%; } .aura-bubble.w45 { width: 45%; } .aura-bubble.w50 { width: 50%; } .aura-bubble.w60 { width: 60%; } .aura-bubble.w75 { width: 75%; }
.aura-chat .aura-core { background: var(--hx-glass, rgba(20, 10, 58, 0.55)); backdrop-filter: blur(6px); padding: 1rem 1.6rem; border-radius: 1.4rem; }
@keyframes aura-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
@keyframes aura-shadow { 0%, 100% { transform: scaleX(1); opacity: 0.55; } 50% { transform: scaleX(0.6); opacity: 0.25; } }
@keyframes aura-dot { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
@keyframes aura-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .aura-ghost, .aura-shadow, .aura-dots i, .aura-bubble { animation: none; } }

/* ---- Recall (long-press a sent message) ---- */
.cg-message-body.recallable { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.cg-recall-row { display: block; margin-top: 0.4rem; }
.cg-recall-btn { display: inline-flex; align-items: center; gap: 0.4rem; border: 0; border-radius: 999px; padding: 0.35rem 0.9rem; font: inherit; font-size: 0.85rem; color: #fff; background: #e0524d; box-shadow: 0 4px 14px rgba(224, 82, 77, 0.4); cursor: pointer; }
.cg-recall-btn:active { transform: scale(0.96); }

/* ---- Gallery delete ---- */
.hx-gallery-tile { position: relative; }
.hx-gallery-tile.selecting { outline: 3px solid #e0524d; outline-offset: -3px; }
.hx-gallery-del { position: fixed; left: 50%; bottom: 6rem; transform: translateX(-50%); z-index: 40; display: flex; gap: 0.6rem; align-items: center; padding: 0.55rem 0.9rem; border-radius: 999px; background: rgba(20, 10, 58, 0.94); color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.hx-gallery-del button { border: 0; border-radius: 999px; padding: 0.4rem 0.9rem; font: inherit; font-size: 0.85rem; cursor: pointer; }
.hx-gallery-del .danger { background: #e0524d; color: #fff; }
.hx-gallery-del .ghost { background: rgba(255, 255, 255, 0.14); color: #fff; }

/* Gallery: long-press selection (Android Photos style) */
.hx-gallery-tile { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.hx-gallery-tile.selecting img, .hx-gallery-tile.selecting video { transform: scale(0.86); border-radius: 6px; transition: transform 0.12s; }
.hx-gallery-check { position: absolute; top: 0.35rem; left: 0.35rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,0.35); color: transparent; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; }
.hx-gallery-check.on { background: #e0524d; border-color: #e0524d; color: #fff; }
.hx-gallery-delete-btn { margin-left: auto; border: 0; border-radius: 999px; padding: 0.5rem 1.1rem; background: #e0524d; color: #fff; font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; gap: 0.4rem; align-items: center; box-shadow: 0 2px 10px rgba(224,82,77,0.5); }
.hx-gallery-delete-btn:disabled { opacity: 0.4; box-shadow: none; }
.hx-gallery-confirm-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.hx-gallery-confirm { background: #1b1245; color: #fff; border-radius: 1.2rem; padding: 1.3rem; max-width: 22rem; width: 100%; box-shadow: 0 12px 40px rgba(0,0,0,0.55); }
.hx-gallery-confirm p { margin: 0 0 1rem; }
.hx-gallery-confirm-actions { display: flex; gap: 0.6rem; justify-content: flex-end; }
.hx-gallery-confirm-actions button { border: 0; border-radius: 999px; padding: 0.55rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; }
.hx-gallery-confirm-actions .danger { background: #e0524d; color: #fff; }
.hx-gallery-confirm-actions .ghost { background: rgba(255,255,255,0.14); color: #fff; }
.hx-gallery-tile img, .hx-gallery-tile video { pointer-events: none; -webkit-user-drag: none; }

/* Plan message limit: Send stays visible but inert with a clock; tapping it shows the countdown. */
.cg-send-btn.limited {
    opacity: 0.45;
    cursor: pointer;
    font-size: 0.95rem;
}

.cg-limit-pop {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin: 0 auto 0.5rem;
    max-width: 30rem;
    padding: 0.7rem 0.9rem;
    border-radius: 14px;
    background: var(--surface, rgba(30, 30, 46, 0.95));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
    color: var(--text);
    font-size: 0.85rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.cg-limit-pop > i {
    margin-top: 0.15rem;
    color: #a78bfa;
    font-size: 1.1rem;
}

.cg-limit-pop > div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cg-limit-pop b {
    font-variant-numeric: tabular-nums;
    font-size: 1rem;
}

.cg-limit-pop small {
    color: var(--text-dim);
}

/* Token packs on the Usage page */
.hx-pack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.75rem;
    margin: 0.75rem 0 1.25rem;
}

.hx-pack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.9rem 0.6rem;
    border-radius: 16px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
    background: var(--surface, rgba(255, 255, 255, 0.05));
    color: var(--text);
    cursor: pointer;
    font: inherit;
}

.hx-pack:disabled {
    opacity: 0.6;
    cursor: default;
}

.hx-pack-name {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.hx-pack-tokens {
    font-weight: 700;
    font-size: 1.05rem;
}

.hx-pack-price {
    margin-top: 0.15rem;
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #22d3ee, #3b82f6);
    color: #04121f;
    font-weight: 700;
    font-size: 0.85rem;
}

/* --- Abilities (Member/Abilities.razor + the Home entry card) --- */
.hx-ab-pink   { --c1: #fbcfe8; --c2: #f472b6; --glow: rgba(244, 114, 182, 0.55); }
.hx-ab-orange { --c1: #fed7aa; --c2: #fb923c; --glow: rgba(251, 146, 60, 0.55); }
.hx-ab-purple { --c1: #ddd6fe; --c2: #a78bfa; --glow: rgba(167, 139, 250, 0.55); }
.hx-ab-amber  { --c1: #fef08a; --c2: #facc15; --glow: rgba(250, 204, 21, 0.5); }
.hx-ab-teal   { --c1: #99f6e4; --c2: #2dd4bf; --glow: rgba(45, 212, 191, 0.5); }
.hx-ab-blue   { --c1: #bae6fd; --c2: #38bdf8; --glow: rgba(56, 189, 248, 0.55); }
.hx-ab-green  { --c1: #bbf7d0; --c2: #4ade80; --glow: rgba(74, 222, 128, 0.5); }
.hx-ab-cyan   { --c1: #a5f3fc; --c2: #22d3ee; --glow: rgba(34, 211, 238, 0.5); }
.hx-ab-pink, .hx-ab-orange, .hx-ab-purple, .hx-ab-amber, .hx-ab-teal, .hx-ab-blue, .hx-ab-green, .hx-ab-cyan {
    background: linear-gradient(145deg, var(--c1), var(--c2));
}

/* Orbit: the companion in the middle, abilities circling it on two slow rings. Badges counter-rotate to stay upright. */
.hx-orbit { position: relative; width: min(100%, 22rem); aspect-ratio: 1; margin: 0 auto 2.6rem; }
.hx-orbit-glow {
    position: absolute; inset: 8%; border-radius: 50%;
    background: conic-gradient(from 0deg, #f472b6, #fb923c, #facc15, #4ade80, #38bdf8, #a78bfa, #f472b6);
    filter: blur(38px); opacity: 0.4; animation: hx-orbit-spin 24s linear infinite;
}
.hx-orbit-track { position: absolute; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, 0.18); }
.hx-orbit-t1 { inset: 30%; }
.hx-orbit-t2 { inset: 7%; }
.hx-orbit-core {
    position: absolute; inset: 0; margin: auto; width: 5.9rem; height: 5.9rem; border-radius: 50%; padding: 0.25rem;
    background: linear-gradient(145deg, #f472b6, #a78bfa, #38bdf8); display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 34px rgba(167, 139, 250, 0.7); animation: hx-orbit-pulse 3.5s ease-in-out infinite;
}
.hx-orbit-core > * { border-radius: 50%; }
.hx-orbit-ring { position: absolute; }
.hx-orbit-r1 { inset: 30%; animation: hx-orbit-spin 50s linear infinite; }
.hx-orbit-r2 { inset: 7%; animation: hx-orbit-spin 80s linear infinite reverse; }
.hx-orbit-slot { position: absolute; inset: 0; transform: rotate(var(--a)); }
.hx-orbit-badge {
    position: absolute; top: 0; left: 50%; margin: -1.55rem 0 0 -1.55rem; width: 3.1rem; height: 3.1rem; border-radius: 34%;
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.2rem;
    box-shadow: 0 0 18px var(--glow), inset 0 0 10px rgba(255, 255, 255, 0.5);
}
.hx-orbit-badge em {
    position: absolute; top: 100%; margin-top: 0.15rem; font-style: normal; font-size: 0.68rem; font-weight: 600;
    color: var(--text); white-space: nowrap; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.hx-orbit-r1 .hx-orbit-badge { animation: hx-orbit-up1 50s linear infinite; }
.hx-orbit-r2 .hx-orbit-badge { animation: hx-orbit-up2 80s linear infinite; }
.hx-orbit-count { position: absolute; left: 0; right: 0; bottom: -1.9rem; text-align: center; margin: 0; font-size: 0.8rem; color: var(--text-dim); }
.hx-orbit-count b { color: var(--text); font-size: 0.95rem; }
@keyframes hx-orbit-spin { to { transform: rotate(360deg); } }
@keyframes hx-orbit-up1 { from { transform: rotate(calc(var(--a) * -1)); } to { transform: rotate(calc(var(--a) * -1 - 360deg)); } }
@keyframes hx-orbit-up2 { from { transform: rotate(calc(var(--a) * -1)); } to { transform: rotate(calc(var(--a) * -1 + 360deg)); } }
@keyframes hx-orbit-pulse { 50% { box-shadow: 0 0 46px rgba(244, 114, 182, 0.75); } }
@media (prefers-reduced-motion: reduce) { .hx-orbit-glow, .hx-orbit-ring, .hx-orbit-badge, .hx-orbit-core { animation: none !important; } .hx-orbit-badge { transform: rotate(calc(var(--a) * -1)); } }

.hx-ab-title-h { margin: 0 0 0.8rem; font-size: 1.15rem; font-weight: 600; }
.hx-ab-list { border-radius: 1.6rem; background: rgba(255, 255, 255, 0.05); padding: 0.3rem 1rem; }
.hx-ab-card {
    display: flex; align-items: center; gap: 0.9rem; padding: 0.95rem 0; color: var(--text); text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); background: none;
}
.hx-ab-card:last-child { border-bottom: none; }
a.hx-ab-card:active { opacity: 0.7; }
.hx-ab-icon {
    flex-shrink: 0; width: 2.9rem; height: 2.9rem; border-radius: 32%; color: #fff; font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px var(--glow);
}
.hx-ab-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; flex: 1; }
.hx-ab-title { font-size: 1.05rem; font-weight: 600; }
.hx-ab-desc { color: var(--text-dim); font-size: 0.85rem; line-height: 1.35; }
.hx-ab-chev { color: var(--text-dim); font-size: 0.8rem; }

/* Home entry card */
.hx-ab-blob {
    width: 1.9rem; height: 1.9rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
    color: #fff; font-size: 0.8rem; margin-left: -0.45rem; box-shadow: 0 0 0 2px var(--bg), 0 0 12px var(--glow);
}
.hx-ab-entry { flex-direction: row; align-items: center; gap: 0.8rem; margin-top: 0.8rem; padding: 0.9rem 1.1rem; }
.hx-ab-entry-title { font-size: 1.15rem; font-weight: 600; }
.hx-ab-entry-chips { display: flex; margin-left: auto; padding-left: 0.45rem; }

/* --- Ability detail (Member/AbilityDetail.razor) + plan tags --- */
.hx-ab-tag {
    display: inline-block; margin-left: 0.4rem; padding: 0.08rem 0.5rem; border-radius: 999px; font-size: 0.68rem; font-weight: 700;
    vertical-align: middle; color: #1b1235; background: linear-gradient(135deg, #fde68a, #f59e0b);
}
.hx-ab-tag.lock { background: linear-gradient(135deg, #fda4af, #f43f5e); color: #fff; }
.hx-ab-tag.big { margin: 0.8rem 0 0; font-size: 0.8rem; padding: 0.25rem 0.8rem; }
.hx-ab-card.locked .hx-ab-icon { opacity: 0.55; filter: saturate(0.6); }
.hx-orbit-badge.locked { opacity: 0.5; filter: saturate(0.5); }

.hx-abd { display: flex; flex-direction: column; gap: 0.9rem; padding-bottom: 5.5rem; }
.hx-abd > .hx-icon-btn { align-self: flex-start; }
.hx-abd-hero {
    position: relative; overflow: hidden; text-align: center; padding: 1.8rem 1.2rem 1.5rem; border-radius: 1.8rem;
    background: linear-gradient(160deg, var(--glow), rgba(255, 255, 255, 0.03) 80%); border: 1px solid rgba(255, 255, 255, 0.1);
}
.hx-abd-hero h1 { margin: 0.9rem 0 0.3rem; font-size: 1.5rem; }
.hx-abd-hero p { margin: 0; color: var(--text-dim); font-size: 0.98rem; }
.hx-abd-icon {
    position: relative; z-index: 1; width: 4.6rem; height: 4.6rem; border-radius: 32%; margin: 0 auto; color: #fff; font-size: 2rem;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 0 30px var(--glow), inset 0 0 14px rgba(255, 255, 255, 0.5);
    animation: hx-ab-bob 4s ease-in-out infinite;
}
.hx-abd-orb { position: absolute; border-radius: 50%; background: var(--c2); filter: blur(30px); opacity: 0.35; }
.hx-abd-orb.o1 { width: 8rem; height: 8rem; left: -2rem; top: -2rem; }
.hx-abd-orb.o2 { width: 6rem; height: 6rem; right: -1.5rem; bottom: -1.5rem; }
@keyframes hx-ab-bob { 50% { transform: translateY(-5px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .hx-abd-icon { animation: none; } }
.hx-abd-card {
    padding: 1rem 1.1rem; border-radius: 1.4rem; background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08); border-left: 4px solid var(--c2);
}
.hx-abd-card h2 { margin: 0 0 0.5rem; font-size: 1.05rem; display: flex; align-items: center; gap: 0.5rem; }
.hx-abd-card h2 i { color: var(--c2); }
.hx-abd-card p { margin: 0; color: var(--text-dim); font-size: 0.93rem; line-height: 1.5; }
.hx-abd-card p.hx-abd-strong { color: var(--text); font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; }
.hx-abd-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hx-abd-chip { padding: 0.4rem 0.8rem; border-radius: 999px; font-size: 0.85rem; background: var(--glow); color: var(--text); }
.hx-abd-plans { display: flex; flex-direction: column; gap: 0.45rem; }
.hx-abd-plan {
    display: grid; grid-template-columns: 1.6rem 1fr; column-gap: 0.6rem; align-items: center; padding: 0.55rem 0.7rem;
    border-radius: 0.9rem; background: rgba(255, 255, 255, 0.05); border: 1px solid transparent;
}
.hx-abd-plan.current { border-color: var(--c2); background: var(--glow); }
.hx-abd-plan-mark { grid-row: span 2; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; color: #fff; background: linear-gradient(145deg, var(--c1), var(--c2)); }
.hx-abd-plan.off .hx-abd-plan-mark { background: rgba(255, 255, 255, 0.15); color: var(--text-dim); }
.hx-abd-plan-name { font-weight: 600; font-size: 0.95rem; }
.hx-abd-plan-name em { font-style: normal; font-size: 0.65rem; font-weight: 700; margin-left: 0.4rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--c2); color: #1b1235; }
.hx-abd-plan-text { color: var(--text-dim); font-size: 0.82rem; }
.hx-abd-plan.off .hx-abd-plan-name { opacity: 0.6; }
.hx-abd-upgrade { display: inline-block; margin-top: 0.7rem; font-weight: 600; font-size: 0.9rem; color: var(--c2); text-decoration: none; }
.hx-abd-cta {
    position: fixed; left: 1rem; right: 1rem; bottom: 1.1rem; z-index: 5; text-align: center; padding: 0.95rem 1rem;
    border-radius: 999px; font-weight: 700; color: #1b1235; text-decoration: none; box-shadow: 0 8px 24px var(--glow);
}
.hx-app .hx-abd-cta { color: #1b1235; }
.hx-app .hx-abd-upgrade { color: var(--c2); }
.hx-abd-plan.current.off .hx-abd-plan-name { opacity: 1; }

/* Ability detail: button flows at the end of the page (full width, above the floating tab bar). */
.hx-abd { padding-bottom: 0.5rem; }
.hx-abd-cta { position: static; display: block; width: 100%; box-sizing: border-box; margin-top: 0.3rem; font-size: 1.02rem; }

/* Home: Abilities entry card - big colorful icons */
.hx-ab-entry { flex-direction: column; align-items: stretch; gap: 0.9rem; margin-top: 1rem; padding: 1rem 1.1rem 1.1rem; }
.hx-ab-entry-head { display: flex; align-items: center; gap: 0.6rem; }
.hx-ab-entry-title { font-size: 1.2rem; font-weight: 600; }
.hx-ab-entry-sub { flex: 1; color: var(--text-dim); font-size: 0.82rem; text-align: right; }
.hx-ab-entry-chips { display: flex; justify-content: space-between; margin: 0; padding: 0; }
.hx-ab-entry-chips .hx-ab-blob { width: 3.7rem; height: 3.7rem; font-size: 1.5rem; margin-left: 0; border-radius: 32%; box-shadow: 0 6px 16px var(--glow), inset 0 0 10px rgba(255, 255, 255, 0.45); }
.hx-ab-entry + .hx-goal { margin-top: 0.8rem; }

/* --- Wallet (Member/Usage.razor) --- */
.hx-wal-card {
    position: relative; overflow: hidden; padding: 1.1rem 1.2rem 1.2rem; border-radius: 1.8rem; margin-bottom: 1rem; color: #1b1235;
    background: linear-gradient(135deg, #fce7f3 0%, #ddd6fe 45%, #bae6fd 100%); box-shadow: 0 10px 30px rgba(124, 58, 237, 0.35);
}
.hx-wal-glow { position: absolute; width: 11rem; height: 11rem; right: -3rem; top: -4rem; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.85), transparent 70%); }
.hx-wal-top { position: relative; display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; opacity: 0.75; margin-bottom: 1.6rem; }
.hx-wal-brand { font-weight: 700; }
.hx-wal-label { position: relative; display: block; font-size: 0.85rem; opacity: 0.7; }
.hx-wal-bottom { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 0.6rem; }
.hx-wal-amount { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.02em; }
.hx-wal-amount small { font-size: 0.95rem; font-weight: 600; opacity: 0.7; }
.hx-wal-buy { border: none; border-radius: 999px; padding: 0.55rem 1rem; font-weight: 700; font-family: inherit; color: #fff; background: linear-gradient(135deg, #7c3aed, #2563eb); cursor: pointer; }

.hx-wal-tabs, .hx-wal-seg { display: flex; padding: 0.25rem; border-radius: 999px; background: rgba(255, 255, 255, 0.07); }
.hx-wal-tabs { margin-bottom: 1rem; }
.hx-wal-tabs button, .hx-wal-seg button {
    flex: 1; border: none; background: none; color: var(--text-dim); font-family: inherit; font-weight: 600; font-size: 0.9rem;
    padding: 0.55rem 0.8rem; border-radius: 999px; cursor: pointer;
}
.hx-wal-tabs button.active, .hx-wal-seg button.active { background: linear-gradient(135deg, #a78bfa, #38bdf8); color: #1b1235; }
.hx-wal-period { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.hx-wal-nav { display: flex; align-items: center; gap: 0.5rem; font-size: 1.05rem; }
.hx-wal-nav button { border: none; background: rgba(255, 255, 255, 0.08); color: var(--text); width: 2rem; height: 2rem; border-radius: 50%; cursor: pointer; }
.hx-wal-nav button:disabled { opacity: 0.3; cursor: default; }
.hx-wal-seg button { padding: 0.4rem 0.75rem; font-size: 0.82rem; }

.hx-wal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-bottom: 1rem; }
.hx-wal-stat { padding: 0.9rem 1rem; border-radius: 1.3rem; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.07); display: flex; flex-direction: column; gap: 0.5rem; }
.hx-wal-stat-l { color: var(--text-dim); font-size: 0.85rem; }
.hx-wal-stat b { font-size: 1.6rem; }
.pos { color: #4ade80; }
.neg { color: #fb7185; }
.hx-wal-stat b.pos, .hx-wal-stat b.neg { font-size: 1.6rem; }

.hx-wal-panel { padding: 1rem 1.1rem; border-radius: 1.5rem; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.07); margin-bottom: 1rem; }
.hx-wal-panel h2 { margin: 0 0 0.7rem; font-size: 1.05rem; }
.hx-wal-cat { margin-bottom: 0.9rem; }
.hx-wal-cat-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.hx-wal-cat-name { flex: 1; font-weight: 500; }
.hx-wal-cat-pct { color: var(--text-dim); font-size: 0.8rem; }
.hx-wal-dot { width: 1.7rem; height: 1.7rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 0.75rem; flex-shrink: 0; }
.hx-wal-dot.big { width: 2.6rem; height: 2.6rem; border-radius: 32%; font-size: 1.05rem; }
.hx-wal-bar { height: 0.45rem; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.hx-wal-bar span { display: block; height: 100%; border-radius: 999px; }
.hx-wal-log { margin-top: 0.2rem; }

.hx-wal-h2 { margin: 1.2rem 0 0.5rem; font-size: 1.1rem; }
.hx-wal-day { display: flex; align-items: center; justify-content: space-between; margin: 1rem 0 0.5rem; }
.hx-wal-day-title { font-weight: 600; }
.hx-wal-chips { display: flex; gap: 0.4rem; }
.hx-wal-chips em { font-style: normal; font-size: 0.72rem; padding: 0.15rem 0.55rem; border-radius: 999px; background: rgba(255, 255, 255, 0.09); color: var(--text-dim); }
.hx-wal-none { margin: 0.2rem 0 0.6rem; }
.hx-wal-list { border-radius: 1.4rem; background: rgba(255, 255, 255, 0.05); padding: 0.2rem 0.9rem; }
.hx-wal-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.hx-wal-item:last-child { border-bottom: none; }
.hx-wal-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.hx-wal-item-text b { font-size: 0.98rem; font-weight: 600; }
.hx-wal-item-text small, .hx-wal-item-amt small { color: var(--text-dim); font-size: 0.75rem; }
.hx-wal-item-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; }
.hx-wal-item-amt b { font-size: 1.05rem; }
.hx-wal-more { min-height: 3.5rem; display: flex; align-items: center; justify-content: center; padding: 1rem 0; font-size: 0.85rem; }
.hx-wal-loadbtn { border: none; border-radius: 999px; padding: 0.55rem 1.1rem; background: rgba(255, 255, 255, 0.09); color: var(--text); font-family: inherit; cursor: pointer; }

/* --- Hub as a phone home screen (Member/Hub.razor) --- */
.hx-ab-slate { --c1: #cbd5e1; --c2: #64748b; --glow: rgba(100, 116, 139, 0.45); background: linear-gradient(145deg, var(--c1), var(--c2)); }
.hx-phone {
    position: relative; flex: 1; display: flex; flex-direction: column; gap: 1.3rem; padding: 1rem 0.9rem 0.9rem; border-radius: 2rem; overflow: hidden;
    min-height: calc(100dvh - var(--hx-nav-h) - var(--hx-safe-top) - var(--hx-safe-bottom) - 3.2rem);
    background:
        radial-gradient(70% 45% at 15% 0%, rgba(244, 114, 182, 0.35), transparent 70%),
        radial-gradient(70% 50% at 100% 30%, rgba(56, 189, 248, 0.3), transparent 70%),
        radial-gradient(80% 50% at 30% 100%, rgba(167, 139, 250, 0.35), transparent 70%),
        linear-gradient(180deg, #1c1740, #0d1030);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.hx-phone-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.hx-phone-who { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.hx-phone-chip { padding: 0.3rem 0.8rem; border-radius: 999px; background: rgba(255, 255, 255, 0.12); backdrop-filter: blur(8px); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-phone-clock { font-size: 0.85rem; font-weight: 600; opacity: 0.85; }

.hx-phone-widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.hx-widget {
    display: flex; flex-direction: column; align-items: center; gap: 0.45rem; padding: 0.55rem 0.55rem 0.5rem; border-radius: 1.6rem;
    background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text); text-decoration: none; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}
.hx-widget:active { transform: scale(0.98); }
.hx-widget-name { font-size: 0.78rem; color: var(--text-dim); }
.hx-widget-screen {
    position: relative; width: 100%; min-height: 8.2rem; box-sizing: border-box; padding: 0.7rem 0.7rem 0.6rem; border-radius: 1.2rem;
    background: linear-gradient(160deg, #0b0d1c, #1a1440); display: flex; flex-direction: column; gap: 0.35rem; overflow: hidden;
}
.hx-live-badge { align-self: flex-start; padding: 0.05rem 0.4rem; border-radius: 0.3rem; background: #ef4444; color: #fff; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em; animation: hx-live-blink 2s ease-in-out infinite; }
@keyframes hx-live-blink { 50% { opacity: 0.55; } }
.hx-widget-time { font-size: 0.72rem; color: rgba(255, 255, 255, 0.55); }
.hx-widget-text { font-size: 0.92rem; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hx-wallet-mini {
    width: 100%; min-height: 8.2rem; box-sizing: border-box; padding: 0.7rem; border-radius: 1.2rem; color: #1b1235; display: flex; flex-direction: column; gap: 0.4rem;
    background: linear-gradient(140deg, #fce7f3, #ddd6fe 55%, #bae6fd);
}
.hx-wallet-mini-dots { font-size: 0.7rem; opacity: 0.6; }
.hx-wallet-mini-row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; font-size: 0.8rem; }
.hx-wallet-mini-buy { padding: 0.1rem 0.7rem; border-radius: 999px; background: #fff; font-weight: 700; font-size: 0.75rem; }
.hx-wallet-mini b { font-size: 1.6rem; letter-spacing: -0.02em; }

.hx-phone .hx-hub-apps { gap: 1.3rem 0.4rem; }
.hx-phone .hx-app-icon { width: 3.7rem; height: 3.7rem; border-radius: 26%; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), inset 0 0 10px rgba(255, 255, 255, 0.35); }
.hx-phone .hx-app-tile { font-size: 0.76rem; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
.hx-phone .hx-app-badge { box-shadow: 0 0 0 2px #1c1740; }

.hx-phone-dots { display: flex; justify-content: center; gap: 0.4rem; margin-top: auto; }
.hx-phone-dots span { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: rgba(255, 255, 255, 0.3); }
.hx-phone-dots span.on { background: #fff; }
.hx-dock {
    display: flex; justify-content: space-around; align-items: center; padding: 0.7rem 0.6rem; border-radius: 1.9rem;
    background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.16);
}
.hx-dock a { display: block; text-decoration: none; }
.hx-dock { justify-content: space-between; gap: 0.4rem; padding: 0.7rem 0.6rem 0.55rem; }
.hx-dock .hx-app-tile { flex: 1; min-width: 0; font-size: 0.72rem; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
.hx-dock .hx-app-icon { width: 3.3rem; height: 3.3rem; }

/* Neon outline icons (Hub): near-black tile, thin glowing glyph in the app's own colour. */
.hx-phone .hx-app-icon.hx-neon {
    background: #050508; color: var(--neon, #fff); border-radius: 26%;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 6px 14px rgba(0, 0, 0, 0.4);
}
.hx-neon .neon-svg { width: 58%; height: 58%; filter: drop-shadow(0 0 3px var(--neon)) drop-shadow(0 0 9px var(--neon)); }

/* --- Status pill (same colours as Member Home's scene), Agent Live page, AuraCard --- */
.hx-status { display: inline-flex; align-items: center; gap: 0.35rem; align-self: flex-start; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; color: #fff; white-space: nowrap; }
.hx-status.st-standby { background: linear-gradient(135deg, #22c55e, #15803d); }
.hx-status.st-working { background: linear-gradient(135deg, #38bdf8, #2563eb); }
.hx-status.st-mail { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.hx-status.st-done { background: linear-gradient(135deg, #fbbf24, #d97706); }
.hx-status.st-night { background: linear-gradient(135deg, #6366f1, #3730a3); }
.hx-status.st-sleeping { background: linear-gradient(135deg, #94a3b8, #475569); }
.hx-widget-wallet { padding: 0.45rem; }
.hx-widget-wallet .aura-card { width: 100%; }

.hx-live-card { padding: 1rem; border-radius: 1.6rem; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); margin-bottom: 1rem; }
.hx-live-head { display: flex; align-items: center; gap: 0.8rem; padding-bottom: 0.9rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.hx-live-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.hx-live-who b { font-size: 1.15rem; }
.hx-live-who span { color: var(--text-dim); font-size: 0.85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hx-live-month { display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem; margin: 0.8rem 0 0.5rem; font-size: 0.8rem; letter-spacing: 0.05em; color: var(--text-dim); }
.hx-live-month button { border: none; background: rgba(255, 255, 255, 0.08); color: var(--text); width: 1.8rem; height: 1.8rem; border-radius: 50%; cursor: pointer; }
.hx-live-month button:disabled { opacity: 0.3; }
.hx-live-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.25rem; }
.hx-live-day { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; padding: 0.5rem 0; border: none; border-radius: 0.9rem; background: none; color: var(--text); font-family: inherit; cursor: pointer; }
.hx-live-day small { color: var(--text-dim); font-size: 0.68rem; }
.hx-live-day b { font-size: 1.05rem; }
.hx-live-day:disabled { opacity: 0.35; cursor: default; }
.hx-live-day.sel { background: rgba(255, 255, 255, 0.14); }
.hx-live-pip { width: 0.35rem; height: 0.35rem; border-radius: 1px; background: transparent; }
.hx-live-pip.on { background: #ef4444; }
.hx-live-log { padding: 0.9rem 1rem; border-radius: 1.6rem; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.85rem; }
.hx-live-line { display: grid; grid-template-columns: 2.8rem 1.4rem 1fr; gap: 0.3rem; padding: 0.5rem 0; line-height: 1.4; border-bottom: 1px dashed rgba(255, 255, 255, 0.07); }
.hx-live-line:last-child { border-bottom: none; }
.hx-live-line time { color: var(--text-dim); }
.hx-live-foot { text-align: center; font-size: 0.75rem; margin: 0.7rem 0 0; }

/* AuraCard: token wallet drawn as a bank card */
.aura-card {
    position: relative; overflow: hidden; box-sizing: border-box; width: 100%; aspect-ratio: 1.586; padding: 1.1rem 1.2rem; border-radius: 1.4rem; color: #fff;
    display: flex; flex-direction: column; justify-content: space-between; margin-bottom: 1rem;
    background: radial-gradient(90% 90% at 100% 0%, #38bdf8 0%, transparent 60%), radial-gradient(80% 90% at 0% 100%, #ec4899 0%, transparent 60%), linear-gradient(135deg, #4c1d95, #1e1b6b 60%, #0f172a);
    box-shadow: 0 14px 34px rgba(76, 29, 149, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.aura-card-shine { position: absolute; inset: -40% -20% auto auto; width: 70%; height: 180%; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.22) 50%, transparent 60%); transform: rotate(8deg); pointer-events: none; }
.aura-card-top, .aura-card-mid, .aura-card-bottom, .aura-card-bal { position: relative; }
.aura-card-top { display: flex; justify-content: space-between; align-items: center; }
.aura-card-brand { display: inline-flex; align-items: center; }
.aura-card-brand b { margin-left: 0.55rem; font-size: 1rem; font-weight: 800; letter-spacing: 0.03em; font-style: italic; }
.aura-card-brand .c1, .aura-card-brand .c2 { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-block; }
.aura-card-brand .c1 { background: #f472b6; }
.aura-card-brand .c2 { background: #38bdf8; margin-left: -0.7rem; mix-blend-mode: screen; opacity: 0.9; }
.aura-card-nfc { transform: rotate(90deg); opacity: 0.85; font-size: 1.1rem; }
.aura-card-mid { display: flex; align-items: center; gap: 1rem; }
.aura-card-chip { width: 2.6rem; height: 2rem; border-radius: 0.45rem; background: linear-gradient(135deg, #fde68a, #d97706); display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; padding: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }
.aura-card-chip i { border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 2px; }
.aura-card-number { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.12em; font-size: 0.95rem; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.aura-card-bal small { display: block; font-size: 0.68rem; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.08em; }
.aura-card-bal b { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.01em; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.aura-card-bal em { font-style: normal; font-size: 0.8rem; font-weight: 600; opacity: 0.8; margin-left: 0.35rem; }
.aura-card-bottom { display: flex; align-items: flex-end; gap: 1.2rem; }
.aura-card-bottom small { display: block; font-size: 0.55rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.08em; }
.aura-card-bottom b { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.aura-card-holder { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aura-card-buy { margin-left: auto; border: none; border-radius: 999px; padding: 0.4rem 0.9rem; font-family: inherit; font-weight: 700; font-size: 0.8rem; color: #1b1235; background: #fff; cursor: pointer; }
.aura-card-link { display: block; text-decoration: none; color: inherit; }
.hx-me-grid.single { grid-template-columns: 1fr; }

/* Mini (Hub widget): balance + holder only */
.aura-card.mini { aspect-ratio: auto; min-height: 8.6rem; padding: 0.7rem 0.75rem; margin-bottom: 0; border-radius: 1.1rem; gap: 0.3rem; }
.aura-card.mini .aura-card-brand b { font-size: 0.72rem; margin-left: 0.4rem; }
.aura-card.mini .aura-card-brand .c1, .aura-card.mini .aura-card-brand .c2 { width: 1.05rem; height: 1.05rem; }
.aura-card.mini .aura-card-brand .c2 { margin-left: -0.45rem; }
.aura-card.mini .aura-card-nfc { font-size: 0.8rem; }
.aura-card.mini .aura-card-chip { width: 1.7rem; height: 1.3rem; }
.aura-card.mini .aura-card-bal small { display: none; }
.aura-card.mini .aura-card-bal b { font-size: 1.25rem; }
.aura-card.mini .aura-card-bal em { display: none; }
.aura-card.mini .aura-card-bottom small { display: none; }
.aura-card.mini .aura-card-bottom b { font-size: 0.66rem; }

/* Agent Live: grouped chat rows + "on its own" tag */
.hx-live-line.group { cursor: pointer; }
.hx-live-line.sub { padding-left: 1rem; opacity: 0.8; font-size: 0.8rem; }
.hx-live-tag { display: inline-block; margin-left: 0.4rem; padding: 0 0.45rem; border-radius: 999px; font-style: normal; font-size: 0.62rem; font-family: var(--font-body, inherit); background: rgba(74, 222, 128, 0.18); color: #4ade80; vertical-align: middle; }
.hx-live-sub { display: block; color: var(--text-dim); font-size: 0.72rem; }

.hx-inline-badge { position: static; align-self: center; margin-right: 0.4rem; box-shadow: none; }

/* Message that could not be delivered: stays in the chat as "Not sent" with Retry / Delete. */
.cg-message-row.failed .cg-message-body { border: 1px solid rgba(224, 82, 77, 0.55); }
.cg-failed-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin-top: 0.5rem; font-size: 0.8rem; }
.cg-failed-label { color: #ff8a84; flex: 1 1 100%; }
.cg-failed-btn { display: inline-flex; align-items: center; gap: 0.35rem; border: 0; border-radius: 999px; padding: 0.3rem 0.8rem; font: inherit; font-size: 0.8rem; color: #fff; background: #e0524d; cursor: pointer; }
.cg-failed-btn.ghost { background: rgba(255, 255, 255, 0.12); }
.cg-failed-btn:disabled { opacity: 0.5; cursor: default; }

/* Call page: the orb pulses while the phone rings. */
.cg-talk-orb.dialing::before { animation: cg-talk-ring 1s ease-out infinite; }
.cg-talk-orb.dialing::after { animation: cg-talk-ring 1s ease-out 0.5s infinite; }
.cg-talk-orb.greeting::before { animation: cg-talk-ring 1.2s ease-out infinite; }
.cg-talk-btn.accept { background: #22c55e; border-color: transparent; color: #fff; }
.cg-talk-btn.accept i { color: #fff; }
.cg-talk-orb.incoming::before { animation: cg-talk-ring 1s ease-out infinite; }
.cg-talk-orb.incoming::after { animation: cg-talk-ring 1s ease-out 0.5s infinite; }

/* Bottom navigation: 1.5x the half-size version (so 0.75x of the original 5.4rem bar / 2.2rem icons). */
.hx-app, .theme-noir.hx-app { --hx-nav-h: 5.4rem; }
.hx-nav { width: min(calc(100% - 2rem), 480px); height: 4.05rem; border-radius: 30px; padding: 0 0.3rem; gap: 0.15rem; bottom: calc(var(--hx-safe-bottom) + 0.8rem); }
.hx-nav-item { height: 3.3rem; gap: 0.15rem; font-size: 0.85rem; border-radius: 22px; }
.hx-nav-item i { font-size: 1.65rem; }
.hx-nav-item:not(.hx-orb) i { -webkit-text-stroke-width: 1px; }
.hx-nav-item.hx-orb { flex: 0 0 4.2rem; width: 4.2rem; height: 4.2rem; margin-top: -1.8rem; }
.hx-nav-item.hx-orb i { font-size: 1.95rem; }
.hx-nav-badge { top: -0.25rem; left: calc(50% + 0.5rem); min-width: 1.15rem; height: 1.15rem; padding: 0 0.25rem; font-size: 0.7rem; line-height: 1.15rem; }
.hx-composer-bar { bottom: calc(var(--hx-safe-bottom) + 7.1rem); }
.hx-page:has(.hx-composer-bar) { padding-bottom: calc(var(--hx-safe-bottom) + 12rem); }

/* Approval: a compact banner in chat that links to the Tasks board, and the draft cards on that board */
.cg-approval-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 auto 0.5rem;
    max-width: 30rem;
    padding: 0.6rem 0.9rem;
    border-radius: 14px;
    background: #1d1740;
    border: 1px solid rgba(167, 139, 250, 0.6);
    color: #f1ecff;
    font-size: 0.85rem;
    text-decoration: none;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.cg-approval-banner > i {
    color: #a78bfa;
}

.cg-approval-banner > span {
    flex: 1;
}

.cg-approval-banner > b {
    white-space: nowrap;
    color: #c4b5fd;
}

.light-mode .cg-approval-banner {
    background: #f1ecff;
    color: #2a1b5e;
}

/* A picture the companion is drawing in the background (ChatBox): sits with the other banners above the composer. */
.cg-job {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0 auto 0.5rem;
    max-width: 30rem;
    padding: 0.6rem 0.9rem;
    border-radius: 14px;
    background: #1d1740;
    border: 1px solid rgba(94, 234, 212, 0.45);
    color: #f1ecff;
    font-size: 0.85rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.cg-job > i { color: #5eead4; }

.cg-job-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }

.cg-job-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cg-job-body small { opacity: 0.7; font-size: 0.72rem; }

.cg-job-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }

.cg-job-bar > i {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #5eead4, #818cf8);
    transition: width 1s linear;
}

.light-mode .cg-job { background: #eefbf8; color: #134e4a; border-color: rgba(13, 148, 136, 0.4); }
.light-mode .cg-job-bar { background: rgba(0, 0, 0, 0.1); }

.cg-approval-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.cg-approval-card {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(167, 139, 250, 0.55);
    background: var(--surface, rgba(30, 30, 46, 0.95));
}

.cg-approval-card h4 {
    margin: 0 0 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cg-approval-card h4 > i {
    color: #a78bfa;
}

.cg-approval-meta {
    margin: 0.15rem 0;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.cg-approval-body {
    margin: 0.6rem 0;
    padding: 0.6rem 0.7rem;
    max-height: 16rem;
    overflow-y: auto;
    white-space: pre-wrap;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}

.cg-approval-actions {
    display: flex;
    gap: 0.5rem;
}

.cg-approval-note {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Error / offline screen (AppErrorBoundary): a sad Aurelia and a Reconnect button */
.app-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
    padding: 2.5rem 1.5rem 3rem;
    max-width: 26rem;
    margin: 0 auto;
}

.app-error .hx-figure { animation: none; opacity: 0.95; margin-top: 0; }

.app-error h2 { margin: 0.4rem 0 0; font-size: 1.35rem; }

.app-error p { margin: 0; }

.app-error-note { color: #ffb4a8; font-size: 0.9rem; }

.app-error-actions { display: flex; gap: 0.6rem; margin-top: 0.8rem; flex-wrap: wrap; justify-content: center; }

.cg-call-log-missed { color: #ff9c8f; }

/* Studio: filter chips and text tiles (notes / documents / pages) in the media grid, plus the item page */
.hx-studio-sub { margin: 0 0 0.6rem; color: var(--text-dim); font-size: 0.85rem; }
.hx-studio-chips { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.4rem; margin-bottom: 0.4rem; scrollbar-width: none; }
.hx-studio-chips::-webkit-scrollbar { display: none; }
.hx-studio-chip { flex: 0 0 auto; padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.14); background: transparent; color: var(--text-dim); font: inherit; font-size: 0.8rem; cursor: pointer; }
.hx-studio-chip.on { background: linear-gradient(90deg, #3fd0d0, #4f7cff); color: #04101f; border-color: transparent; font-weight: 700; }
.hx-gallery-tile.hx-studio-text { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; padding: 0.55rem 0.6rem; text-align: left; color: var(--text); overflow: hidden; background: linear-gradient(160deg, rgba(79, 124, 255, 0.28), rgba(63, 208, 208, 0.12)); }
.hx-gallery-tile.hx-studio-text.kind-note { background: linear-gradient(160deg, rgba(63, 208, 208, 0.28), rgba(34, 197, 94, 0.12)); }
.hx-gallery-tile.hx-studio-text.kind-html { background: linear-gradient(160deg, rgba(167, 139, 250, 0.32), rgba(236, 72, 153, 0.14)); }
.hx-studio-kind { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-dim); }
.hx-studio-title { font-size: 0.78rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hx-studio-preview { font-size: 0.66rem; line-height: 1.35; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.hx-studio-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0 0.8rem; }
.hx-studio-meta span { font-size: 0.7rem; padding: 0.2rem 0.6rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.14); color: var(--text-dim); }
.hx-studio-paper { padding: 1rem; border-radius: 16px; background: rgba(255, 255, 255, 0.055); border: 1px solid rgba(255, 255, 255, 0.1); white-space: pre-wrap; word-break: break-word; line-height: 1.6; font-size: 0.92rem; }
.hx-studio-frame { width: 100%; height: 65vh; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 16px; background: #fff; }
.hx-studio-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.hx-studio-note { margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--text-dim); }

/* ---- Studio, mockup look (two-column grid, storage meter, making-now strip, song player) ---- */
.hx-studio-store { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.7rem; font-size: 0.72rem; color: var(--text-dim); }
.hx-studio-store .bar { flex: 1; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.hx-studio-store .bar i { display: block; height: 100%; background: linear-gradient(90deg, #3fd0d0, #4f7cff); border-radius: 9px; }
.hx-studio-store.warn .bar i { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.hx-studio-store a { color: #7cefff; font-weight: 700; text-decoration: none; }
.hx-studio-job { display: flex; gap: 0.7rem; align-items: center; padding: 0.6rem 0.7rem; border-radius: 14px; background: rgba(255, 255, 255, 0.055); border: 1px solid rgba(167, 139, 250, 0.45); margin-bottom: 0.7rem; }
.hx-studio-job .ic { width: 2.3rem; height: 2.3rem; border-radius: 0.7rem; background: linear-gradient(135deg, #8b5cf6, #ec4899); display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.hx-studio-job .ic.video { background: linear-gradient(135deg, #38bdf8, #6366f1); }
.hx-studio-job .body { flex: 1; min-width: 0; }
.hx-studio-job .t { font-size: 0.8rem; font-weight: 700; }
.hx-studio-job .s { font-size: 0.68rem; color: var(--text-dim); }
.hx-studio-job .pb { height: 4px; border-radius: 9px; background: rgba(255, 255, 255, 0.14); margin-top: 0.35rem; overflow: hidden; }
.hx-studio-job .pb i { display: block; height: 100%; background: linear-gradient(90deg, #8b5cf6, #ec4899); border-radius: 9px; transition: width 1s linear; }
.hx-st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; grid-auto-flow: dense; }
.hx-st-tile { position: relative; height: 120px; padding: 0; border-radius: 16px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.055); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.hx-st-tile.tall { grid-row: span 2; height: 249px; }
.hx-st-tile img, .hx-st-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hx-st-tile .lbl { position: absolute; left: 8px; right: 8px; bottom: 7px; display: flex; justify-content: space-between; align-items: center; gap: 0.3rem; font-size: 0.66rem; font-weight: 700; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.75); }
.hx-st-tile .lbl > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-st-tile .badge { flex: 0 0 auto; font-size: 0.56rem; font-weight: 600; padding: 2px 6px; border-radius: 99px; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(6px); }
.hx-st-tile.image::after, .hx-st-tile.video::after { content: ""; position: absolute; inset: auto 0 0 0; height: 46%; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.6)); pointer-events: none; }
.hx-st-tile .lbl { z-index: 2; }
.hx-st-tile .play { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; }
.hx-st-tile .play b { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: #111; display: grid; place-items: center; font-size: 0.8rem; }
.hx-st-tile .wave { position: absolute; left: 10px; right: 10px; top: 30px; height: 50px; display: flex; gap: 3px; align-items: center; }
.hx-st-tile .wave i { flex: 1; border-radius: 3px; background: linear-gradient(180deg, #ec4899, #8b5cf6); }
.hx-st-tile .note { display: block; padding: 10px; font-size: 0.62rem; line-height: 1.5; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.hx-st-tile .note b { display: block; color: var(--text); font-size: 0.74rem; margin-bottom: 4px; }
.hx-st-tile.doc { background: linear-gradient(180deg, rgba(79, 124, 255, 0.22), rgba(255, 255, 255, 0.03)); }
.hx-st-tile.note-tile { background: linear-gradient(180deg, rgba(63, 208, 208, 0.2), rgba(255, 255, 255, 0.03)); }
.hx-st-tile.html { background: linear-gradient(160deg, rgba(167, 139, 250, 0.3), rgba(236, 72, 153, 0.12)); }
.hx-st-tile .mini { position: absolute; left: 10px; right: 10px; top: 14px; height: 70px; border-radius: 9px; background: #0b1224; border: 1px solid rgba(255, 255, 255, 0.12); display: grid; place-items: center; font-size: 0.6rem; color: var(--text-dim); }
.hx-st-tile.selecting { outline: 2px solid #7cefff; }
.hx-st-cover { width: 10.6rem; height: 10.6rem; border-radius: 1.4rem; margin: 1rem auto 0.6rem; box-shadow: 0 12px 30px rgba(139, 92, 246, 0.4); }
.hx-st-song { margin: 0.4rem 0 0; text-align: center; font-size: 1.15rem; }
.hx-st-songmeta { margin: 0.2rem 0 0.9rem; text-align: center; font-size: 0.78rem; color: var(--text-dim); }
.hx-st-player { padding: 0 0.3rem; }
.hx-st-seek { width: 100%; height: 4px; accent-color: #ec4899; cursor: pointer; }
.hx-st-player .times { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--text-dim); margin-top: 0.25rem; }
.hx-st-player .ctrl { display: flex; justify-content: center; align-items: center; gap: 1.6rem; margin: 0.6rem 0 0.4rem; }
.hx-st-player .ctrl button { background: none; border: 0; color: var(--text); font-size: 1.2rem; cursor: pointer; }
.hx-st-player .ctrl button:disabled { opacity: 0.3; cursor: default; }
.hx-st-player .ctrl button.big { width: 3.1rem; height: 3.1rem; border-radius: 50%; background: #fff; color: #111; font-size: 1.05rem; }
.hx-st-video { width: 100%; border-radius: 16px; background: #000; max-height: 60vh; }
.hx-st-imgbtn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.hx-st-image { width: 100%; border-radius: 16px; display: block; }
.hx-st-prompt { margin-top: 0.8rem; font-size: 0.78rem; }
.hx-st-model { display: block; margin-top: 0.4rem; font-size: 0.66rem; color: var(--text-dim); }
.hx-st-menu { margin-top: 0.5rem; display: flex; }
.hx-st-menu button { background: none; border: 1px solid rgba(255, 255, 255, 0.16); color: var(--text); border-radius: 99px; padding: 0.45rem 0.9rem; font: inherit; font-size: 0.8rem; cursor: pointer; }
.hx-st-menu button.danger { border-color: #ef4444; color: #ff9c8f; }
.hx-md-h1 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.hx-md-h2 { margin: 0.9rem 0 0.35rem; font-size: 0.95rem; }
.hx-md-h3 { margin: 0.7rem 0 0.3rem; font-size: 0.88rem; }
.hx-md-p { margin: 0 0 0.6rem; }
.hx-md-list { margin: 0 0 0.6rem; padding-left: 1.2rem; }
.hx-md-list li { margin: 0.15rem 0; }
.hx-studio-paper { white-space: normal; }

.hx-studio-actions { flex-wrap: nowrap; }
.hx-studio-actions .btn { flex: 0 0 auto; padding: 0.55rem 0.9rem; font-size: 0.82rem; white-space: nowrap; }
.hx-studio-actions .btn-primary { flex: 1 1 auto; }
.hx-st-video { margin-top: 0.6rem; }

/* Video tiles use a poster picture (never a bare <video>), notes keep clear of the corner badge */
.hx-st-tile .vph { position: absolute; inset: 0; background: linear-gradient(145deg, #1a2350, #3b2390 60%, #0e3b46); }
.hx-st-tile .note { padding-bottom: 30px; max-height: 100%; }

/* Messages from Auralith (Mail -> From Auralith) */
.hx-notice-list { display: flex; flex-direction: column; gap: 0.6rem; }
.hx-notice { padding: 0.8rem 0.95rem; border-radius: 14px; background: rgba(255, 255, 255, 0.055); border: 1px solid rgba(255, 255, 255, 0.1); }
.hx-notice.unread { border-color: rgba(245, 192, 74, 0.6); }
.hx-notice-head { display: flex; justify-content: space-between; gap: 0.6rem; align-items: baseline; }
.hx-notice-head span { font-size: 0.68rem; color: var(--text-dim); white-space: nowrap; }
.hx-notice p { margin: 0.35rem 0 0; font-size: 0.9rem; line-height: 1.5; white-space: pre-wrap; }

/* --- Hub customize: wallpapers, icon styles, the sheet --- */
.hx-phone-right { display: flex; align-items: center; gap: 0.6rem; }
.hx-customize { width: 2rem; height: 2rem; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.14); color: #fff; cursor: pointer; }
.hx-phone.wp-sunset { background: radial-gradient(70% 45% at 80% 0%, rgba(255, 190, 120, 0.4), transparent 70%), linear-gradient(170deg, #3a0d5c, #b83d7a 60%, #ff6a88); }
.hx-phone.wp-ocean { background: radial-gradient(70% 45% at 20% 0%, rgba(80, 220, 255, 0.3), transparent 70%), linear-gradient(170deg, #001f3f, #0b5f8a 70%, #0b8fb0); }
.hx-phone.wp-forest { background: radial-gradient(70% 45% at 80% 0%, rgba(120, 255, 180, 0.22), transparent 70%), linear-gradient(170deg, #04241a, #0f5a3d 70%, #2f9e6b); }
.hx-phone.wp-midnight { background: linear-gradient(180deg, #000, #0a0a12); }
.hx-phone.wp-ember { background: radial-gradient(70% 45% at 75% 0%, rgba(255, 170, 60, 0.4), transparent 70%), linear-gradient(170deg, #2b0a05, #8a2a0a 62%, #e0561a); }
.hx-phone.wp-galaxy { background: radial-gradient(60% 40% at 20% 10%, rgba(190, 120, 255, 0.45), transparent 70%), radial-gradient(50% 35% at 85% 70%, rgba(70, 150, 255, 0.35), transparent 70%), linear-gradient(180deg, #05020f, #140a35); }

.hx-custom h3 { margin: 0.2rem 0 0.6rem; font-size: 1rem; }
.hx-custom h3:not(:first-child) { margin-top: 1.1rem; }
.hx-wp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.hx-wp-opt {
    position: relative; height: 4.2rem; border-radius: 0.9rem; border: 2px solid transparent; color: #fff; font-size: 0.75rem;
    display: flex; align-items: flex-end; padding: 0.35rem 0.5rem; cursor: pointer; font-family: inherit; overflow: hidden;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.hx-wp-opt.on { border-color: var(--text); }
.hx-wp-opt.wp-sunset { background: linear-gradient(160deg, #3a0d5c, #ff6a88); }
.hx-wp-opt.wp-aurora { background: linear-gradient(160deg, #1c1740, #0d1030); }
.hx-wp-opt.wp-ocean { background: linear-gradient(160deg, #001f3f, #0b8fb0); }
.hx-wp-opt.wp-forest { background: linear-gradient(160deg, #04241a, #2f9e6b); }
.hx-wp-opt.wp-midnight { background: #000; }
.hx-wp-opt.wp-ember { background: linear-gradient(160deg, #2b0a05, #e0561a); }
.hx-wp-opt.wp-galaxy { background: linear-gradient(160deg, #05020f, #7a4bd6); }
.hx-wp-photo { background: rgba(127, 127, 160, 0.3) center / cover; gap: 0.35rem; align-items: center; justify-content: center; }
.hx-wp-photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.hx-ic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.hx-ic-opt { background: rgba(127, 127, 160, 0.16); border: 2px solid transparent; border-radius: 0.9rem; padding: 0.55rem 0.2rem; color: var(--text); font-size: 0.72rem; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; cursor: pointer; font-family: inherit; }
.hx-ic-opt.on { border-color: var(--text); }
.hx-ic-opt .hx-app-icon { width: 2.6rem; height: 2.6rem; }
.hx-custom-error { color: #f87171; font-size: 0.8rem; margin: 0.5rem 0 0; }
.hx-custom-note { color: var(--text-dim); font-size: 0.75rem; margin: 0.9rem 0 0; }

/* Icon styles: the tile keeps --neon as its colour, each style decides how to use it. */
.hx-ic-opt.ic-neon .hx-app-icon { background: #050508; color: var(--neon); }
.hx-ic-opt.ic-candy .hx-app-icon, .hx-phone.ic-candy .hx-app-icon.hx-neon {
    background: linear-gradient(140deg, color-mix(in srgb, var(--neon) 40%, #fff), var(--neon)); color: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), inset 0 0 10px rgba(255, 255, 255, 0.4);
}
.hx-ic-opt.ic-clean .hx-app-icon, .hx-phone.ic-clean .hx-app-icon.hx-neon {
    background: #fff; color: var(--neon); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.hx-ic-opt.ic-glass .hx-app-icon, .hx-phone.ic-glass .hx-app-icon.hx-neon {
    background: rgba(255, 255, 255, 0.16); color: #fff; backdrop-filter: blur(10px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 6px 14px rgba(0, 0, 0, 0.25);
}
.hx-phone.ic-candy .hx-neon .neon-svg, .hx-phone.ic-clean .hx-neon .neon-svg, .hx-phone.ic-glass .hx-neon .neon-svg,
.hx-ic-opt.ic-candy .neon-svg, .hx-ic-opt.ic-clean .neon-svg, .hx-ic-opt.ic-glass .neon-svg { filter: none; }

/* --- World: posts, comments, people, direct messages --- */
.hx-tabs-scroll { max-width: 100%; overflow-x: auto; gap: 1.1rem; scrollbar-width: none; }
.hx-tabs-scroll::-webkit-scrollbar { display: none; }
.hx-tabs-scroll button { white-space: nowrap; }
.hx-tabs-header { position: relative; }
.hx-world-icons { position: absolute; top: 0.2rem; right: 0.1rem; display: flex; gap: 0.5rem; }
.hx-world-icon { position: relative; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(127, 127, 160, 0.16); color: var(--text); text-decoration: none; }
.hx-world-icon .hx-nav-badge { top: -0.3rem; left: auto; right: -0.3rem; }
.hx-back { color: var(--text-dim); text-decoration: none; margin-right: 0.4rem; font-size: 1.1rem; }

.hx-post-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.hx-post-name { color: var(--text); text-decoration: none; }
.hx-post-avatar-link { display: inline-flex; text-decoration: none; }
.hx-post-foot { display: flex; align-items: center; gap: 1.2rem; margin-top: 0.8rem; }
.hx-post .hx-link, .hx-comments .hx-link, .hx-compose .hx-link, .hx-report .hx-link { display: inline; margin: 0; text-decoration: none; color: var(--text-dim); font-size: 0.85rem; cursor: pointer; }
.hx-post-image { cursor: zoom-in; max-height: 26rem; object-fit: cover; }
.hx-more { display: block; margin: 1rem auto; }
.hx-note { font-size: 0.82rem; margin: 0.6rem 0; }

.hx-compose { padding: 0.8rem; margin-bottom: 1rem; border-radius: 1.2rem; background: rgba(127, 127, 160, 0.12); display: flex; flex-direction: column; gap: 0.6rem; }
.hx-compose textarea { resize: none; }
.hx-compose-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.hx-compose-row .btn-primary { margin-left: auto; }
.hx-compose-vis { width: auto; }
.hx-compose-note { font-size: 0.75rem; flex: 1; min-width: 8rem; }
.hx-compose-photo { display: flex; align-items: center; gap: 0.8rem; }
.hx-compose-photo img { width: 5rem; height: 5rem; object-fit: cover; border-radius: 0.8rem; }
.hx-file { position: relative; cursor: pointer; }
.hx-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.hx-comments { margin-top: 0.8rem; padding-top: 0.7rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.7rem; }
.hx-comment { display: flex; gap: 0.6rem; align-items: flex-start; }
.hx-comment-main { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.92rem; min-width: 0; }
.hx-comment-main a { color: var(--text); text-decoration: none; }
.hx-comment-actions { display: flex; gap: 0.9rem; }
.hx-comment-box { display: flex; gap: 0.5rem; }
.hx-comment-box .input { flex: 1; min-width: 0; }

.hx-report { position: relative; display: inline-block; }
.hx-report-pop { position: absolute; bottom: 130%; left: 0; z-index: 20; display: flex; gap: 0.4rem; align-items: center; padding: 0.5rem; border-radius: 0.9rem; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); white-space: nowrap; }
.hx-report-pop .input { width: auto; }

.hx-people-search { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.hx-people-search .input { flex: 1; min-width: 0; }
.hx-section-h { margin: 1.4rem 0 0.6rem; font-size: 1rem; }
.hx-person { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.hx-person-name { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); text-decoration: none; }
.hx-profile-card { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; text-align: center; padding: 1rem 0 1.4rem; }
.hx-profile-card h2 { margin: 0.3rem 0 0; }
.hx-profile-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 0.5rem; }

.hx-dm { display: flex; flex-direction: column; min-height: calc(100dvh - var(--hx-safe-top) - var(--hx-safe-bottom) - 3rem); }
.hx-dm-head { display: flex; align-items: center; gap: 0.6rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--border); }
.hx-dm-who { display: flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; }
.hx-dm-list { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; padding: 0.8rem 0; }
.hx-dm-msg { max-width: 82%; padding: 0.55rem 0.8rem; border-radius: 1.1rem; display: flex; flex-direction: column; gap: 0.15rem; }
.hx-dm-msg small { font-size: 0.7rem; opacity: 0.7; }
.hx-dm-msg.mine { align-self: flex-end; background: linear-gradient(135deg, #7c5cff, #3b82f6); color: #fff; }
.hx-dm-msg.theirs { align-self: flex-start; background: rgba(127, 127, 160, 0.2); }
.hx-dm-box { display: flex; gap: 0.5rem; position: sticky; bottom: calc(var(--hx-safe-bottom) + 0.5rem); }
.hx-dm-box .input { flex: 1; min-width: 0; }

/* --- Confirm dialog + toast in the member app (they are shared with Admin, whose styles are scoped to .theme-material) --- */
.hx-app .md-confirm-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(0, 0, 0, 0.6); }
.hx-app .md-confirm-dialog { width: 100%; max-width: 380px; padding: 1.3rem 1.3rem 1.1rem; border-radius: 1.4rem; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55); }
.hx-app .md-confirm-dialog p { margin: 0 0 1.1rem; color: var(--text); font-size: 1rem; line-height: 1.45; }
.hx-app .md-confirm-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.hx-app .md-confirm-actions .btn { padding: 0.5rem 1.1rem; }
.hx-app .md-confirm-actions .btn-danger { border-color: #ef4444; color: #fff; background: #dc2626; }
.hx-app .md-toast {
    position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--hx-safe-top) + 0.8rem); z-index: 210;
    display: flex; align-items: center; gap: 0.55rem; max-width: calc(100vw - 2rem); padding: 0.7rem 1.1rem; border-radius: 999px;
    font-size: 0.9rem; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); animation: hx-toast-in 0.15s ease;
}
.hx-app .md-toast-success { background: #0f3d2e; border: 1px solid #22c55e; color: #86efac; }
.hx-app .md-toast-error { background: #4a1616; border: 1px solid #ef4444; color: #fca5a5; }
.light-mode .md-toast-success { background: #dcfce7; color: #166534; }
.light-mode .md-toast-error { background: #fee2e2; color: #991b1b; }
@keyframes hx-toast-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Dock tiles: `.hx-dock a` (display:block) beat the tile layout, so icon and label sat off-centre. */
.hx-dock a.hx-app-tile { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }

/* --- Members list picture, post likes --- */
.member-cell { display: inline-flex; align-items: center; gap: 0.55rem; vertical-align: middle; }
.hx-post .hx-like.on, .hx-post .hx-like.on i { color: #ff5c7a; }
.hx-post .hx-like i { transition: transform 0.15s ease; }
.hx-post .hx-like.on i { transform: scale(1.15); }

.hx-post .hx-like { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.hx-likers h3 { margin: 0.2rem 0 0.7rem; font-size: 1rem; }
.hx-likers h3 .fa-heart { color: #ff5c7a; }
.hx-likers .hx-person { text-decoration: none; }

/* --- Direct messages: photos, hearts, hold menu --- */
.hx-dm-msg { position: relative; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.hx-dm-msg .hx-post-text { user-select: text; }
.hx-dm-photo { max-width: 100%; max-height: 16rem; border-radius: 0.8rem; display: block; object-fit: cover; cursor: zoom-in; }
.hx-dm-heart { position: absolute; bottom: -0.55rem; right: 0.6rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; color: #ff5c7a; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.hx-dm-list { padding-bottom: 1rem; }
.hx-dm-attach { position: relative; width: 2.4rem; height: 2.4rem; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(127, 127, 160, 0.18); color: var(--text); cursor: pointer; }
.hx-dm-attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.hx-dm-preview { padding: 0.4rem 0; }
.hx-dm-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.hx-dm-actions .btn { width: 100%; padding: 0.7rem; }

/* --- Hub: drag to rearrange the app icons --- */
.hx-hub-apps .hx-app-tile { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; transition: transform 0.15s ease; }
.hx-hub-apps .hx-app-tile.dragging { position: relative; z-index: 20; transition: none; filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.55)); }
.hx-hub-apps .hx-app-tile.drop-target .hx-app-icon { outline: 2px dashed rgba(255, 255, 255, 0.7); outline-offset: 3px; }

/* dock as a drop area */
.hx-dock { min-height: 5.4rem; }
.hx-dock .hx-app-tile { transition: transform 0.15s ease; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; }
.hx-dock .hx-app-tile.dragging { position: relative; z-index: 20; transition: none; filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.55)); }
.hx-dock .hx-app-tile.drop-target .hx-app-icon { outline: 2px dashed rgba(255, 255, 255, 0.7); outline-offset: 3px; }
.hx-dock.drop-zone, .hx-hub-apps.drop-zone { outline: 2px dashed rgba(255, 255, 255, 0.45); outline-offset: 4px; border-radius: 1.6rem; }
.hx-hub-apps { min-height: 6rem; }

/* Customize button: colourful so it reads as a button */
.hx-customize { width: 2.2rem; height: 2.2rem; font-size: 1rem; color: #fff; border: 2px solid rgba(255, 255, 255, 0.85); background: linear-gradient(135deg, #ff4fd8, #7c5cff 55%, #3df5ff); box-shadow: 0 0 14px rgba(124, 92, 255, 0.75), 0 4px 10px rgba(0, 0, 0, 0.35); animation: hx-customize-glow 2.6s ease-in-out infinite; }
.hx-customize:active { transform: scale(0.94); }
@keyframes hx-customize-glow { 50% { box-shadow: 0 0 22px rgba(255, 79, 216, 0.9), 0 4px 10px rgba(0, 0, 0, 0.35); } }

/* --- Hub weather widget --- */
.hx-weather { display: block; width: 100%; box-sizing: border-box; padding: 0.9rem 1rem 0.8rem; border-radius: 1.6rem; color: #fff; border: 1px solid rgba(255, 255, 255, 0.16); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25); text-align: left; font-family: inherit; }
.hx-weather.wx-clear { background: linear-gradient(155deg, #2d8cff, #62c4ff 60%, #ffcf6b); }
.hx-weather.wx-cloud { background: linear-gradient(155deg, #4b5d7a, #8496b3); }
.hx-weather.wx-rain { background: linear-gradient(155deg, #26344f, #4a6690); }
.hx-weather.wx-storm { background: linear-gradient(155deg, #1b1e33, #4a3f6b); }
.hx-weather.wx-snow { background: linear-gradient(155deg, #6f8fb3, #cfe0f2); color: #10233a; }
.hx-weather.wx-night { background: linear-gradient(155deg, #0c1230, #2a2f6b); }
.hx-wx-now { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.hx-wx-main { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.hx-wx-place { font-size: 0.85rem; opacity: 0.9; }
.hx-wx-temp { font-size: 2.6rem; font-weight: 300; line-height: 1.05; letter-spacing: -0.02em; }
.hx-wx-desc { font-size: 1rem; font-weight: 600; }
.hx-wx-sub { font-size: 0.78rem; opacity: 0.85; }
.hx-wx-icon { font-size: 3.4rem; opacity: 0.95; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25)); }
.hx-wx-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px solid rgba(255, 255, 255, 0.25); }
.hx-wx-day { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; font-size: 0.8rem; }
.hx-wx-day i { font-size: 1.1rem; }
.hx-wx-day small { opacity: 0.7; }
.hx-wx-empty { cursor: pointer; font-size: 0.85rem; }
.hx-wx-set { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.hx-wx-set .input { flex: 1; min-width: 0; }

/* --- Home / Me declutter: one token figure, compact goal + abilities rows --- */
.hx-hero-pills { display: flex; gap: 0.5rem; align-items: center; }
.hx-hero-pills .hx-pill { text-decoration: none; }
.hx-goal { min-height: 0; margin-top: 1rem; gap: 0.45rem; padding: 1rem 1.1rem; }
.hx-goal-more { float: right; color: var(--hx-accent); font-size: 0.78rem; }
.hx-ab-entry { flex-direction: row; align-items: center; gap: 0.9rem; margin-top: 0.8rem; padding: 0.8rem 1.1rem; }
.hx-ab-entry-chips { display: flex; flex-shrink: 0; justify-content: flex-start; }
.hx-ab-entry-chips .hx-ab-blob { width: 2.4rem; height: 2.4rem; font-size: 1rem; border-radius: 50%; margin-left: -0.55rem; box-shadow: 0 2px 8px var(--glow); }
.hx-ab-entry-chips .hx-ab-blob:first-child { margin-left: 0; }
.hx-ab-entry-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.hx-ab-entry-text .hx-ab-entry-title { font-size: 1.05rem; font-weight: 600; }
.hx-ab-entry-text .hx-ab-entry-sub { text-align: left; flex: none; font-size: 0.8rem; }
.hx-me-card { display: block; margin: 1.2rem 0; }
a.aura-card-buy, .hx-app a.aura-card-buy { text-decoration: none; display: inline-block; color: #1b1235 !important; }

/* Hub weather placeholder: same footprint as the real card so the widgets below don't jump */
.hx-wx-skel { min-height: 9.6rem; display: flex; flex-direction: column; gap: 0.6rem; justify-content: center; opacity: 0.8; }
.hx-wx-skel span { display: block; height: 0.9rem; width: 55%; border-radius: 999px; background: linear-gradient(90deg, rgba(255,255,255,0.12) 25%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.12) 75%); background-size: 200% 100%; animation: aura-shimmer 1.6s linear infinite; }
.hx-wx-skel span:nth-child(2) { width: 35%; height: 1.6rem; }
.hx-wx-skel span:nth-child(3) { width: 80%; }

/* Home: goal + abilities side by side so nothing needs scrolling */
.hx-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; margin-top: 1rem; }
.hx-duo > .hx-card { margin: 0; min-height: 9.5rem; }
.hx-duo .hx-card-title { font-size: 1.05rem; -webkit-line-clamp: 2; }
.hx-duo .hx-card-foot { font-size: 0.78rem; }
.hx-duo .hx-card-foot > span:last-child { -webkit-line-clamp: 2; }
.hx-duo .hx-ab-entry { flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 0.6rem; padding: 1rem 1.1rem; }
.hx-duo .hx-ab-entry-text { flex: none; width: 100%; }

/* Ability on/off switches (Abilities detail) */
.hx-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; color: var(--text); font-size: 0.95rem; font-weight: 600; }
.hx-abd-card .hx-switch-row + p, .hx-abd-card p + .hx-switch-row { margin-top: 0.3rem; }
.hx-switch { appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 2.7rem; height: 1.55rem; border-radius: 999px; background: var(--border-strong, rgba(255,255,255,0.25)); position: relative; cursor: pointer; transition: background 0.2s; border: none; }
.hx-switch::after { content: ""; position: absolute; top: 0.2rem; left: 0.2rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.hx-switch:checked { background: linear-gradient(135deg, var(--hx-accent), var(--hx-accent-2)); }
.hx-switch:checked::after { transform: translateX(1.15rem); }
.hx-switch:disabled { opacity: 0.6; }
.hx-ab-tag.off { background: var(--surface-alt); color: var(--text-dim); border: 1px solid var(--border); }

/* Release notes: bullets in the update prompt and the What's new history */
.hx-release-list { margin: 0; padding-left: 1.15rem; display: flex; flex-direction: column; gap: 0.3rem; text-align: left; }
.hx-update-notes { white-space: normal; }
.hx-release { padding: 0.75rem 0; border-top: 1px solid var(--border); }
.hx-release:first-of-type { border-top: none; padding-top: 0.25rem; }
.hx-release header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.hx-release header small { margin-left: auto; }
.hx-release p { margin: 0; }

/* Hub widgets: always two equal columns and the same height, whatever the Pulse text says */
.hx-phone-widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.hx-widget { min-width: 0; box-sizing: border-box; overflow: hidden; }
.hx-widget-screen, .hx-widget-wallet .aura-card.mini { height: 9.6rem; min-height: 0; }
.hx-widget-text { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.hx-widget-wallet .aura-card.mini { width: 100%; }

/* Auralink comment threads */
.hx-comment-reply { margin-left: 0; }
.hx-replies { margin-left: 2.1rem; padding-left: 0.6rem; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 0.4rem; }
.hx-replies-toggle { margin: 0.1rem 0 0.4rem 2.1rem; font-size: 0.8rem; }
.hx-replying { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; color: var(--text-dim); padding: 0.2rem 0.6rem; margin-top: 0.4rem; border-radius: 0.6rem; background: var(--surface-alt); }
.hx-comment-actions .hx-like.on { color: #f43f5e; }

/* Popups must be readable: the aurora theme's --surface is see-through, so dialogs and sheets get a solid panel. */
.theme-noir.hx-app { --pop-bg: #131a38; }
.theme-noir.hx-app.light-mode { --pop-bg: #ffffff; }
.hx-app .md-confirm-dialog, .hx-app .hx-sheet, .hx-app .hx-update.card { background: var(--pop-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
.hx-app .md-confirm-overlay { background: rgba(3, 5, 16, 0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* Earn free Tokens card (Shared/EarnCard.razor) on the Wallet page. */
.hx-earn { margin: 1rem 0; padding: 1rem; border-radius: 1.2rem; background: linear-gradient(160deg, rgba(139, 108, 246, 0.16), rgba(63, 224, 208, 0.08)); border: 1px solid var(--border); }
.hx-earn-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }
.hx-earn-head h2 { margin: 0; font-size: 1.05rem; }
.hx-earn-head h2 i { color: var(--hx-accent); margin-right: 0.35rem; }
.hx-earn-month { font-size: 0.8rem; color: var(--text-dim); white-space: nowrap; }
.hx-earn-checkin, .hx-earn-invite, .hx-earn-steps li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.hx-earn-checkin > div, .hx-earn-invite > div, .hx-earn-step-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.hx-earn-checkin .muted, .hx-earn-invite .muted, .hx-earn-step-text .muted { font-size: 0.8rem; }
.hx-earn-btn { border: none; border-radius: 999px; padding: 0.6rem 1rem; font-weight: 700; font-family: inherit; color: #04121a; background: linear-gradient(135deg, var(--hx-accent), var(--hx-accent-2, #5b8cff)); cursor: pointer; white-space: nowrap; }
.hx-earn-btn:disabled { opacity: 0.55; cursor: default; }
.hx-earn-btn.small { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.hx-earn-steps { list-style: none; margin: 0.9rem 0; padding: 0.4rem 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.6rem; }
.hx-earn-steps li.done .hx-earn-step-text { opacity: 0.55; }
.hx-earn-reward, .hx-earn-badge { font-size: 0.85rem; font-weight: 700; color: var(--text-dim); white-space: nowrap; }
.hx-earn-badge { color: var(--hx-ok, #4ad38a); }
.hx-earn-invite { padding-top: 0.75rem; border-top: 1px solid var(--border); }
.hx-earn-code { border: 1px dashed var(--border-strong); border-radius: 0.8rem; padding: 0.5rem 0.75rem; background: rgba(255, 255, 255, 0.06); color: var(--text); font-family: ui-monospace, monospace; font-weight: 700; letter-spacing: 0.08em; cursor: pointer; white-space: nowrap; }

/* Chat nudges: low-balance banner (reuses .cg-approval-banner) and the actions under an out-of-Tokens notice. */
.cg-lowbalance-banner i.fa-bolt { color: #ffd23f; }
.cg-nudge-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.cg-nudge-btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.85rem; border-radius: 999px; border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.07); color: var(--text); font-weight: 700; font-size: 0.85rem; text-decoration: none; }
.cg-nudge-btn.primary { border-color: transparent; color: #04121a; background: linear-gradient(135deg, var(--hx-accent), var(--hx-accent-2, #5b8cff)); }

/* Create page (image generation) + its entry points */
.cg-chip-row { position: absolute; left: 0; right: 0; top: -2.9rem; z-index: 5; display: flex; gap: 0.5rem; padding: 0 1rem; overflow-x: auto; scrollbar-width: none; }
.cg-chip-row::-webkit-scrollbar { display: none; }
.cg-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.95rem; border-radius: 999px; background: rgba(17, 26, 51, 0.88); border: 1px solid rgba(63, 224, 208, 0.45); color: #7ff0e3; font-weight: 700; font-size: 0.85rem; text-decoration: none; white-space: nowrap; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cg-chip i { font-size: 0.85rem; }
.light-mode .cg-chip { background: rgba(255, 255, 255, 0.94); color: #0a6f68; border-color: rgba(13, 159, 160, 0.6); }

.hx-cr { padding: 0.9rem 1rem calc(var(--hx-safe-bottom) + 8rem); max-width: 560px; width: 100%; min-width: 0; box-sizing: border-box; margin: 0 auto; overflow-x: clip; }
.hx-cr > * { min-width: 0; max-width: 100%; }
.hx-cr-bal { margin-left: auto; display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.65rem; border-radius: 999px; background: rgba(63, 224, 208, 0.12); border: 1px solid rgba(63, 224, 208, 0.4); color: #7ff0e3; font-size: 0.8rem; font-weight: 700; }
.hx-cr-seg { display: flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.hx-cr-seg button { flex: 1; border: 0; background: transparent; color: var(--text-dim); border-radius: 999px; padding: 0.55rem 0; font: inherit; font-size: 0.85rem; cursor: pointer; }
.hx-cr-seg button.on { background: rgba(91, 140, 255, 0.28); color: var(--text); font-weight: 700; }
.hx-cr-seg button:disabled { opacity: 0.75; cursor: default; }
.light-mode .hx-cr-seg button { color: #3d4f70; }
.light-mode .hx-cr-seg button.on { color: #0d1b33; background: rgba(91, 140, 255, 0.24); }
.hx-cr-seg small { font-size: 0.65rem; opacity: 0.8; }
.hx-cr-note { margin-top: 0.7rem; padding: 0.6rem 0.8rem; border-radius: 14px; background: rgba(255, 193, 7, 0.12); border: 1px solid rgba(255, 193, 7, 0.4); font-size: 0.85rem; }
.hx-cr-card { margin-top: 0.8rem; padding: 0.8rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.hx-cr-card textarea { width: 100%; resize: none; background: transparent; border: 0; outline: none; color: var(--text); font: inherit; font-size: 0.95rem; }
.hx-cr-row { display: flex; align-items: center; justify-content: space-between; margin-top: 0.3rem; }
.hx-cr-count { font-size: 0.7rem; color: var(--text-dim); }
.hx-cr-lbl { margin: 1rem 0.2rem 0.4rem; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }
.hx-cr-chips { display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.2rem; }
.hx-cr-chips::-webkit-scrollbar { display: none; }
.hx-cr-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 0.8rem; cursor: pointer; }
.hx-cr-chip.on { background: rgba(63, 224, 208, 0.18); border-color: #3fe0d0; color: #7ff0e3; font-weight: 700; }
.light-mode .hx-cr-chip.on { color: #0a6f68; }
.hx-cr-select { width: 100%; padding: 0.6rem 0.8rem; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; }
.hx-cr-err { margin-top: 0.8rem; padding: 0.55rem 0.8rem; border-radius: 12px; background: rgba(232, 105, 95, 0.14); border: 1px solid rgba(232, 105, 95, 0.45); font-size: 0.85rem; }
.hx-cr-go { width: 100%; margin-top: 1rem; padding: 0.85rem; border: 0; border-radius: 999px; background: linear-gradient(135deg, #3fe0d0, #5b8cff); color: #04121a; font: inherit; font-weight: 700; font-size: 0.95rem; cursor: pointer; }
.hx-cr-go:disabled { opacity: 0.5; cursor: default; }
.hx-cr-hint { margin-top: 0.5rem; text-align: center; font-size: 0.75rem; color: var(--text-dim); }
.hx-cr-fail { display: flex; gap: 0.6rem; align-items: flex-start; justify-content: space-between; margin-top: 0.8rem; padding: 0.55rem 0.8rem; border-radius: 12px; background: rgba(232, 105, 95, 0.12); border: 1px solid rgba(232, 105, 95, 0.4); font-size: 0.82rem; }
.hx-cr-fail button { background: transparent; border: 0; color: inherit; cursor: pointer; }
.hx-cr-headrow { display: flex; align-items: baseline; justify-content: space-between; }
.hx-cr-headrow a { font-size: 0.8rem; color: #7ff0e3; text-decoration: none; }
.hx-cr-recent { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.hx-cr-thumb { padding: 0; border: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 1 / 1; background: var(--surface); cursor: pointer; }
.hx-cr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Light mode: the Hub wallpaper and its widgets stay dark, so everything drawn on them keeps light text */
.light-mode .hx-phone { --text: #f4f7ff; --text-dim: #cbd5ef; color: #f4f7ff; }
.light-mode .hx-phone .hx-app-tile, .light-mode .hx-phone .hx-widget-name, .light-mode .hx-phone .hx-phone-chip, .light-mode .hx-phone .hx-phone-clock { color: #f4f7ff; }
.light-mode .hx-cr-bal { background: rgba(13, 159, 160, 0.14); border-color: rgba(13, 159, 160, 0.55); color: #0a6f68; }
.light-mode .hx-cr-headrow a { color: #0a6f68; font-weight: 700; }

.light-mode .hx-copyright { color: #4c5d7a; }

/* Recommended starter prompts in an empty chat */
.cg-suggest { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; padding: 0 1rem; margin-top: 1.4rem; }
.cg-suggest-label { align-self: center; font-size: 0.78rem; color: var(--text-dim); margin-bottom: 0.2rem; }
.cg-suggest-chip { max-width: 100%; text-align: left; padding: 0.6rem 0.95rem; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 0.9rem; cursor: pointer; }
.cg-suggest-chip:active { transform: scale(0.98); }
.cg-empty-state:has(+ .cg-suggest) { height: auto; padding-top: 12vh; }

/* Me: grouped menu (ChatGPT-style), Storage, Usage and limits, plan tabs */
.hx-menu-label { margin: 1.3rem 0.5rem 0.45rem; font-size: 0.78rem; color: var(--text-dim); font-weight: 600; }
.hx-menu + .hx-menu-label { margin-top: 1.3rem; }
.hx-menu + .hx-menu { margin-top: 1rem; }
.hx-menu-text { display: flex; flex-direction: column; min-width: 0; }
.hx-menu-text small { color: var(--text-dim); font-size: 0.75rem; margin-top: 0.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-menu a.hx-menu-accent, .hx-menu a.hx-menu-accent > i:first-child { color: #3fe0d0; }
.light-mode .hx-menu a.hx-menu-accent, .light-mode .hx-menu a.hx-menu-accent > i:first-child { color: #0a6f68; }
.hx-menu-danger button { color: #e8695f; }
.hx-menu-danger button > i:first-child { color: #e8695f; }

.hx-st, .hx-ul, .hx-pl-tabs, .hx-pl-card { max-width: 560px; margin-left: auto; margin-right: auto; }
.hx-st { padding: 0.6rem 1rem calc(var(--hx-safe-bottom) + 8rem); }
.hx-st-head { display: flex; flex-direction: column; gap: 0.15rem; margin-bottom: 0.7rem; }
.hx-st-head b { font-size: 1.6rem; }
.hx-st-head span { color: var(--text-dim); font-size: 0.9rem; }
.hx-st-bar { height: 0.55rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; margin: 0.4rem 0; }
.hx-st-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3fe0d0, #5b8cff); }
.hx-st-bar.warn i { background: linear-gradient(90deg, #f5b942, #e8695f); }
.hx-st-warn { font-size: 0.85rem; margin: 0.4rem 0 0; }
.hx-st-warn a { color: #7ff0e3; font-weight: 700; }
.light-mode .hx-st-warn a { color: #0a6f68; }
.hx-st-list { margin-top: 1.1rem; }
.hx-st-name { display: flex; flex-direction: column; min-width: 0; }
.hx-st-name small { color: var(--text-dim); font-size: 0.75rem; }
.hx-st-size { margin-left: auto; color: var(--text-dim); font-size: 0.85rem; }
.hx-menu a > .hx-st-size + i:last-child { margin-left: 0; }
.hx-st-note { margin: 1rem 0.4rem 0; font-size: 0.78rem; color: var(--text-dim); }

.hx-ul { padding: 0.4rem 1rem calc(var(--hx-safe-bottom) + 8rem); }
.hx-ul-lbl { margin: 1.1rem 0.4rem 0.45rem; font-size: 0.78rem; color: var(--text-dim); font-weight: 600; }
.hx-ul-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 0.4rem 1rem; }
.hx-ul-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.hx-ul-row:last-of-type { border-bottom: none; }
.hx-ul-row b { font-weight: 600; text-align: right; }
.hx-ul-sub { font-size: 0.78rem; color: var(--text-dim); padding-bottom: 0.5rem; }
.hx-ul-link { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0 0.6rem; color: #7ff0e3; font-size: 0.85rem; font-weight: 700; text-decoration: none; }
.light-mode .hx-ul-link { color: #0a6f68; }
.hx-ul-upgrade { display: block; text-align: center; text-decoration: none; margin-top: 1.3rem; }

.hx-pl-tabs { display: flex; padding: 3px; margin: 0.6rem 1rem 0; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.hx-pl-tabs::-webkit-scrollbar { display: none; }
.hx-pl-tab { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; border: 0; background: transparent; color: var(--text-dim); border-radius: 999px; padding: 0.6rem 1.1rem; font: inherit; font-size: 0.9rem; cursor: pointer; white-space: nowrap; }
.hx-pl-tab small { font-size: 0.62rem; padding: 0.05rem 0.4rem; border-radius: 999px; background: rgba(63, 224, 208, 0.18); color: #7ff0e3; }
.light-mode .hx-pl-tab small { color: #0a6f68; }
.hx-pl-tab.on { background: rgba(91, 140, 255, 0.28); color: var(--text); font-weight: 700; }
.hx-pl-card { margin-top: 0.9rem; padding: 1rem 1.1rem calc(var(--hx-safe-bottom) + 8rem); }
.hx-pl-title { display: flex; align-items: center; gap: 0.6rem; }
.hx-pl-title h2 { margin: 0; font-size: 1.6rem; }
.hx-pl-desc { color: var(--text-dim); font-size: 0.9rem; margin: 0.3rem 0 1rem; }
.hx-pl-table { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 0.3rem 0.9rem; }
.hx-pl-row { display: grid; grid-template-columns: 1.5fr 0.8fr 0.8fr; gap: 0.5rem; align-items: center; padding: 0.7rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.hx-pl-row:last-child { border-bottom: none; }
.hx-pl-row > span:not(:first-child) { text-align: center; color: var(--text-dim); }
.hx-pl-row > span.hl { color: #3fa6ff; font-weight: 700; }
.light-mode .hx-pl-row > span.hl { color: #1d5fd0; }
.hx-pl-row.head { font-size: 0.8rem; color: var(--text-dim); }
.hx-pl-extra { display: flex; align-items: flex-start; gap: 0.6rem; margin-top: 0.7rem; font-size: 0.88rem; }
.hx-pl-extra i { color: #3fe0d0; margin-top: 0.2rem; }
.hx-pl-price { margin-top: 1.2rem; text-align: center; font-size: 1.5rem; font-weight: 700; }
.hx-pl-price span { font-size: 0.85rem; font-weight: 400; color: var(--text-dim); margin-left: 0.25rem; }
.hx-pl-cta { margin-top: 0.8rem; text-align: center; }
.hx-pl-cta .hx-cr-go { display: block; text-decoration: none; margin-top: 0; }
.hx-pl-secondary { width: 100%; padding: 0.8rem; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); font: inherit; cursor: pointer; }

/* Me -> Notifications */
.hx-nt { max-width: 560px; margin: 0 auto; padding: 0.4rem 1rem calc(var(--hx-safe-bottom) + 8rem); }
.hx-nt .hx-cr-note { margin-top: 0.4rem; }
.hx-nt-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
.hx-nt-row:last-child { border-bottom: none; }
.hx-nt-row .hx-menu-text { flex: 1; min-width: 0; }
.hx-nt-row .hx-menu-text small { white-space: normal; }
.hx-nt .hx-nt-row, .hx-nt .hx-nt-row .hx-menu-text, .hx-nt .hx-nt-row .hx-menu-text small { text-transform: none; letter-spacing: 0; }
.hx-nt .hx-nt-row .hx-menu-text { color: var(--text); font-size: 0.95rem; font-weight: 600; }
.hx-nt .hx-nt-row .hx-menu-text small { color: var(--text-dim); font-size: 0.78rem; font-weight: 400; }

/* Levels: Home bar + Levels page */
.hx-level { display: block; box-sizing: border-box; width: min(100%, 420px); margin: 0.8rem 0 0; padding: 0.6rem 0.8rem; border-radius: 16px; background: rgba(17, 26, 51, 0.62); border: 1px solid rgba(255, 255, 255, 0.14); color: #eaf2ff; text-decoration: none; text-align: left; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.hx-level-row { display: flex; align-items: center; gap: 0.5rem; }
.hx-level-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 2.4rem; height: 1.4rem; padding: 0 0.5rem; border-radius: 999px; background: linear-gradient(135deg, #3fe0d0, #5b8cff); color: #04121a; font-weight: 700; font-size: 0.75rem; }
.hx-level-title { flex: 1; min-width: 0; font-size: 0.8rem; color: #c9d6f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-level-xp { font-size: 0.75rem; color: #9fb0d6; white-space: nowrap; }
.hx-level-bar { display: block; height: 0.45rem; margin: 0.5rem 0 0.35rem; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.hx-level-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3fe0d0, #5b8cff); }
.hx-level-next { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: #7ff0e3; }
.hx-level-next i:last-child { margin-left: auto; color: #9fb0d6; font-size: 0.65rem; }
.light-mode .hx-level { background: rgba(255, 255, 255, 0.85); border-color: rgba(13, 27, 51, 0.18); color: #0d1b33; }
.light-mode .hx-level-title { color: #2d3f60; }
.light-mode .hx-level-xp { color: #4c5d7a; }
.light-mode .hx-level-bar { background: rgba(13, 27, 51, 0.12); }
.light-mode .hx-level-next { color: #0a6f68; }

.hx-lv { max-width: 560px; margin: 0 auto; padding: 0.6rem 1rem calc(var(--hx-safe-bottom) + 8rem); }
.hx-lv-top { text-align: center; padding: 1rem; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.hx-lv-big { font-size: 2.2rem; font-weight: 700; }
.hx-lv-title { color: var(--text-dim); margin-top: -0.2rem; }
.hx-lv .hx-level-bar { background: var(--border); margin: 0.8rem 0.4rem 0.5rem; }
.hx-lv-sub { font-size: 0.8rem; color: var(--text-dim); }
.hx-lv-step { display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); opacity: 0.75; }
.hx-lv-step.reached { opacity: 1; }
.hx-lv-step:last-child { border-bottom: none; }
.hx-lv-dot { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; background: var(--border); color: var(--text-dim); }
.hx-lv-dot.done { background: #3fe0d0; color: #04121a; }
.hx-lv-dot.now { background: linear-gradient(135deg, #3fe0d0, #5b8cff); color: #04121a; }
.hx-lv-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hx-lv-text small { color: var(--text-dim); font-size: 0.78rem; }
.hx-lv-claim { flex: none; border: 0; border-radius: 999px; padding: 0.4rem 0.9rem; background: linear-gradient(135deg, #3fe0d0, #5b8cff); color: #04121a; font: inherit; font-weight: 700; font-size: 0.8rem; cursor: pointer; }
.hx-lv-claim:disabled { opacity: 0.5; }
.hx-lvl-chip { display: inline-flex; align-items: center; height: 1.2rem; padding: 0 0.5rem; margin-left: 0.3rem; border-radius: 999px; background: linear-gradient(135deg, #3fe0d0, #5b8cff); color: #04121a; font-size: 0.68rem; font-weight: 700; vertical-align: middle; }
.hx-wp-opt.locked { opacity: 0.55; cursor: default; }
.hx-wp-opt small { display: block; font-size: 0.65rem; opacity: 0.9; }

/* Founder badge: gold, shimmering */
@keyframes hx-gold-shimmer { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
.hx-level.gold { border-color: rgba(255, 215, 106, 0.7); box-shadow: 0 0 18px rgba(255, 190, 70, 0.28); }
.hx-level.gold .hx-level-badge, .hx-lvl-chip.gold { background: linear-gradient(100deg, #ffd76a, #ff9f43, #fff1b8, #ffd76a); background-size: 200% 100%; animation: hx-gold-shimmer 3.5s linear infinite; color: #3a2400; }
.hx-level.gold .hx-level-bar i { background: linear-gradient(90deg, #ffd76a, #ff9f43, #ffd76a); background-size: 200% 100%; animation: hx-gold-shimmer 3.5s linear infinite; }
.hx-level.gold .hx-level-title { color: #ffd76a; font-weight: 700; }
.light-mode .hx-level.gold .hx-level-title { color: #8a5a00; }
.hx-lv-top.gold { border-color: rgba(255, 215, 106, 0.7); background: radial-gradient(120% 90% at 50% 0%, rgba(255, 190, 70, 0.22), transparent 70%), var(--surface); box-shadow: 0 0 26px rgba(255, 190, 70, 0.22); }
.hx-lv-top.gold .hx-lv-big { background: linear-gradient(100deg, #ffd76a, #ff9f43, #fff1b8, #ffd76a); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: hx-gold-shimmer 3.5s linear infinite; }
.hx-lv-top.gold .hx-lv-title { color: #ffd76a; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.light-mode .hx-lv-top.gold .hx-lv-title { color: #8a5a00; }
.hx-lv-crown { font-size: 1.4rem; color: #ffd76a; }

/* Hub fits the phone without scrolling: on screens up to ~960 px tall (a Xiaomi 12 Pro is about 915) the panel was
   taller than the room above the floating tab bar, so the dock and its labels sat behind the bar until you scrolled.
   Tighter gaps, a shorter weather card and slightly smaller icons; taller screens keep the roomy layout above. */
@media (max-height: 960px) {
    .hx-phone { gap: 0.8rem; padding: 0.8rem 0.9rem 0.7rem; }
    .hx-phone-widgets { gap: 0.7rem; }
    .hx-widget-screen, .hx-widget-wallet .aura-card.mini { height: 7.6rem; }
    .hx-weather { padding: 0.7rem 0.9rem 0.6rem; }
    .hx-wx-temp { font-size: 2.2rem; }
    .hx-wx-icon { font-size: 2.8rem; }
    .hx-wx-days { margin-top: 0.5rem; padding-top: 0.45rem; }
    .hx-wx-skel { min-height: 7.4rem; }
    .hx-phone .hx-hub-apps { gap: 0.9rem 0.4rem; min-height: 0; }
    .hx-phone .hx-app-icon { width: 3.4rem; height: 3.4rem; }
    .hx-dock { min-height: 0; padding: 0.55rem 0.6rem 0.45rem; }
    .hx-dock .hx-app-icon { width: 3rem; height: 3rem; }
}
/* Short phones: drop the four-day forecast strip (today's temperature stays). */
@media (max-height: 800px) {
    .hx-wx-days { display: none; }
}

/* Tasks page: one list at a time (tabs), compact cards that open on tap, "Show more" past 8. */
.hx-task-tabs { display: flex; gap: 0.4rem; overflow-x: auto; margin: 0 0 0.9rem; padding-bottom: 0.2rem; scrollbar-width: none; }
.hx-task-tabs::-webkit-scrollbar { display: none; }
.hx-task-tabs button { flex: none; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.85rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); font: inherit; font-size: 0.88rem; cursor: pointer; white-space: nowrap; }
.hx-task-tabs button.active { color: var(--text); font-weight: 600; border-color: var(--hx-accent); background: var(--surface-alt); }
.hx-task-tabs .hx-count { min-width: 1.2rem; padding: 0 0.35rem; border-radius: 999px; background: var(--surface-alt); font-size: 0.72rem; text-align: center; }
.cg-task-card.compact { padding: 0.7rem 0.85rem; margin-bottom: 0.55rem; }
.cg-task-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cg-task-head:focus-visible { outline: 2px solid var(--hx-accent); outline-offset: 3px; border-radius: 6px; }
.cg-task-title { flex: 1; min-width: 0; font-size: 0.95rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-task-card.open .cg-task-title { white-space: normal; }
.cg-task-chev { flex: none; font-size: 0.7rem; color: var(--text-dim); transition: transform 0.2s; }
.cg-task-card.open .cg-task-chev { transform: rotate(180deg); }
.cg-task-meta { margin: 0.2rem 0 0; font-size: 0.74rem; color: var(--text-dim); }
.cg-task-peek { margin: 0.3rem 0 0; font-size: 0.8rem; font-style: italic; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-task-card.open .cg-task-description { margin-top: 0.6rem; }
.cg-task-actions { display: flex; gap: 0.5rem; margin-top: 0.7rem; }
.cg-task-more { display: block; margin: 0.4rem auto 0; }

/* ---- Calendar (Member/Calendar.razor): month grid + day panel + agenda ---- */
.hx-cal { --cal-mine: var(--hx-accent); --cal-device: #38bdf8; --cal-date: #f472b6; --cal-holiday: #34d399; padding-bottom: 7rem; }
.hx-cal-head { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.8rem; }
.hx-cal-title { flex: 1; margin: 0; font-size: 1.7rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.05; }
.hx-cal-title small { display: block; margin-top: 0.15rem; font-size: 0.8rem; font-weight: 500; color: var(--text-dim); letter-spacing: 0.06em; }
.hx-cal-nav { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; font-size: 0.85rem; }
.hx-cal-nav:active { transform: scale(0.94); }
.hx-cal-today { height: 2.4rem; padding: 0 0.9rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }

.hx-cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.9rem; }
.hx-cal-seg { display: inline-flex; padding: 0.2rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.hx-cal-seg button { border: none; background: transparent; color: var(--text-dim); font: inherit; font-size: 0.82rem; font-weight: 600; padding: 0.35rem 0.85rem; border-radius: 999px; cursor: pointer; display: inline-flex; gap: 0.4rem; align-items: center; }
.hx-cal-seg button.on { background: var(--hx-accent-tint); color: var(--hx-accent); }
.hx-cal-toggle { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--border); background: transparent; color: var(--text-dim); font: inherit; font-size: 0.8rem; padding: 0.35rem 0.75rem; border-radius: 999px; cursor: pointer; }
.hx-cal-toggle.on { color: var(--text); border-color: rgba(52, 211, 153, 0.5); background: rgba(52, 211, 153, 0.12); }

.hx-cal-week, .hx-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.3rem; }
.hx-cal-week span { text-align: center; font-size: 0.68rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; padding: 0 0 0.35rem; }
.hx-cal-day {
    position: relative; min-width: 0; aspect-ratio: 1 / 1.18; padding: 0.35rem 0.15rem 0.3rem; border-radius: 0.95rem;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
    display: flex; flex-direction: column; align-items: center; gap: 0.2rem; cursor: pointer; transition: transform 0.12s, box-shadow 0.12s;
}
.hx-cal-day:active { transform: scale(0.96); }
.hx-cal-day.out { opacity: 0.38; }
.hx-cal-day.holi { background: linear-gradient(180deg, rgba(52, 211, 153, 0.16), var(--surface) 70%); }
.hx-cal-day.sel { border-color: var(--hx-accent); box-shadow: 0 0 0 1px var(--hx-accent), 0 8px 20px var(--hx-accent-tint); }
.hx-cal-num { width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.92rem; font-weight: 600; }
.hx-cal-day.today .hx-cal-num { background: linear-gradient(135deg, var(--hx-accent), #38bdf8); color: #fff; box-shadow: 0 4px 12px var(--hx-accent-tint); }
.hx-cal-dots { display: flex; gap: 0.2rem; justify-content: center; margin-top: auto; min-height: 0.45rem; }
.hx-cal-dot { display: inline-block; width: 0.42rem; height: 0.42rem; border-radius: 50%; background: var(--cal-mine); }
.hx-cal-dot.k-device { background: var(--cal-device); }
.hx-cal-dot.k-date { background: var(--cal-date); }
.hx-cal-dot.k-holiday { background: var(--cal-holiday); }
.hx-cal-chips { display: none; }

.hx-cal-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0.7rem 0.1rem 0.2rem; font-size: 0.74rem; color: var(--text-dim); }
.hx-cal-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }

.hx-cal-panel, .hx-cal-agenda { margin-top: 0.9rem; }
.hx-cal-panel { padding: 1rem 1rem 0.6rem; border-radius: 1.3rem; border: 1px solid var(--border); background: var(--surface); }
.hx-cal-panel h2 { margin: 0 0 0.6rem; font-size: 1.02rem; font-weight: 700; }
.hx-cal-empty { margin: 0.2rem 0 0.5rem; color: var(--text-dim); font-size: 0.9rem; }
.hx-cal-agenda-day { margin: 1.1rem 0 0.4rem; font-size: 0.85rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.hx-cal-agenda-day.today { color: var(--hx-accent); }

.hx-cal-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.75rem; margin-bottom: 0.5rem; border-radius: 1rem; border: 1px solid var(--border); border-left: 3px solid var(--cal-mine); background: rgba(127, 127, 127, 0.07); min-width: 0; }
.hx-cal-item.k-device { border-left-color: var(--cal-device); }
.hx-cal-item.k-date { border-left-color: var(--cal-date); }
.hx-cal-item.k-holiday { border-left-color: var(--cal-holiday); }
.hx-cal-item-icon { width: 2.1rem; height: 2.1rem; border-radius: 0.75rem; display: grid; place-items: center; flex-shrink: 0; font-size: 0.95rem; color: var(--cal-mine); background: var(--hx-accent-tint); }
.hx-cal-item.k-device .hx-cal-item-icon { color: var(--cal-device); background: rgba(56, 189, 248, 0.16); }
.hx-cal-item.k-date .hx-cal-item-icon { color: var(--cal-date); background: rgba(244, 114, 182, 0.16); }
.hx-cal-item.k-holiday .hx-cal-item-icon { color: var(--cal-holiday); background: rgba(52, 211, 153, 0.16); }
.hx-cal-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.hx-cal-item-main strong { font-size: 0.98rem; font-weight: 600; overflow-wrap: anywhere; }
.hx-cal-item-main small { color: var(--text-dim); font-size: 0.8rem; overflow-wrap: anywhere; }
.hx-cal-item-btn { border: none; background: transparent; color: var(--text-dim); width: 2rem; height: 2rem; border-radius: 50%; cursor: pointer; flex-shrink: 0; }
.hx-cal-item-btn:active { background: rgba(127, 127, 127, 0.2); }

.hx-cal-sync { margin-top: 1.2rem; padding: 0.9rem 1rem; border-radius: 1.2rem; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 0.7rem; }
.hx-cal-sync-head { display: flex; gap: 0.75rem; align-items: flex-start; }
.hx-cal-sync-head > i { font-size: 1.3rem; color: var(--cal-device); margin-top: 0.15rem; }
.hx-cal-sync-head p { margin: 0.2rem 0 0; font-size: 0.82rem; color: var(--text-dim); }
.hx-cal-sync-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.hx-cal-note { margin: 0.8rem 0.1rem 0; font-size: 0.8rem; color: var(--text-dim); }

.hx-cal-fab {
    position: fixed; right: 1.1rem; bottom: calc(var(--hx-nav-h, 4.5rem) + var(--hx-safe-bottom, 0px) + 1rem); z-index: 30;
    width: 3.5rem; height: 3.5rem; border: none; border-radius: 1.2rem; color: #fff; font-size: 1.3rem; cursor: pointer;
    background: linear-gradient(135deg, var(--hx-accent), #38bdf8); box-shadow: 0 10px 26px var(--hx-accent-tint), 0 4px 10px rgba(0, 0, 0, 0.3);
}
.hx-cal-fab:active { transform: scale(0.94); }

@media (min-width: 720px) {
    .hx-cal-day { aspect-ratio: auto; min-height: 6.6rem; align-items: stretch; padding: 0.4rem 0.4rem 0.35rem; }
    .hx-cal-num { align-self: flex-start; }
    .hx-cal-dots { display: none; }
    .hx-cal-chips { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
    .hx-cal-chip { display: block; padding: 0.08rem 0.4rem; border-radius: 0.4rem; font-size: 0.7rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; background: var(--cal-mine); }
    .hx-cal-chip.k-device { background: var(--cal-device); }
    .hx-cal-chip.k-date { background: var(--cal-date); }
    .hx-cal-chip.k-holiday { background: var(--cal-holiday); color: #06281c; }
    .hx-cal-more { font-size: 0.68rem; color: var(--text-dim); }
}
.light-mode .hx-cal-day { border-color: rgba(40, 50, 90, 0.13); background: rgba(255, 255, 255, 0.85); }
.light-mode .hx-cal-day.sel { border-color: var(--hx-accent); }
.light-mode .hx-cal-panel, .light-mode .hx-cal-sync { border-color: rgba(40, 50, 90, 0.12); background: rgba(255, 255, 255, 0.8); }
@keyframes hx-cal-in-next { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes hx-cal-in-prev { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.hx-cal-slide-next { animation: hx-cal-in-next 0.22s ease-out; }
.hx-cal-slide-prev { animation: hx-cal-in-prev 0.22s ease-out; }
@media (prefers-reduced-motion: reduce) { .hx-cal-slide-next, .hx-cal-slide-prev { animation: none; } }

/* ---- Memory page + tool access (Member/Memory.razor, Abilities.razor) ---- */
.hx-mem-card { border: 1px solid var(--border); background: var(--surface); border-radius: 1.2rem; padding: 0.3rem 1rem; margin-bottom: 1.2rem; }
.hx-mem-switch { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; cursor: pointer; }
.hx-mem-switch + .hx-mem-switch { border-top: 1px solid var(--border); }
.hx-mem-switch span { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.hx-mem-switch small { color: var(--text-dim); font-size: 0.8rem; }
.hx-mem-switch input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 2.9rem; height: 1.7rem; border-radius: 999px; background: rgba(127, 127, 127, 0.35); position: relative; cursor: pointer; transition: background 0.15s; }
.hx-mem-switch input[type=checkbox]::after { content: ""; position: absolute; top: 0.2rem; left: 0.2rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.hx-mem-switch input[type=checkbox]:checked { background: var(--hx-accent); }
.hx-mem-switch input[type=checkbox]:checked::after { transform: translateX(1.2rem); }
.hx-mem-switch input[type=checkbox]:disabled { opacity: 0.5; cursor: default; }
.hx-mem-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin: 0.4rem 0 0.4rem; }
.hx-mem-head h2 { margin: 0; font-size: 1.05rem; }
.hx-tools-mode { margin: 1.2rem 0 0.4rem; }
.hx-tools-mode h2 { font-size: 1.05rem; margin: 0 0 0.2rem; }
.hx-tools-opt { display: flex; gap: 0.7rem; align-items: flex-start; width: 100%; text-align: left; margin-top: 0.5rem; padding: 0.8rem 0.9rem; border-radius: 1rem; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.hx-tools-opt.on { border-color: var(--hx-accent); background: var(--hx-accent-tint); }
.hx-tools-opt > i { margin-top: 0.15rem; color: var(--hx-accent); }
.hx-tools-opt strong { display: block; }
.hx-tools-opt small { color: var(--text-dim); font-size: 0.8rem; }

/* Daily quests extras: weekly chest, streak freeze, milestones */
.hx-earn-chest { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.8rem; }
.hx-earn-chest .muted { font-size: 0.8rem; }
.hx-earn-pips { display: flex; gap: 0.3rem; margin-top: 0.3rem; }
.hx-earn-pip { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: rgba(127, 127, 160, 0.3); }
.hx-earn-pip.on { background: var(--hx-accent, #22b8cf); box-shadow: 0 0 6px var(--hx-accent-tint, rgba(34, 184, 207, 0.5)); }

/* Auracodes (My Auracode page) and the Camera page */
.hx-qr-card, .hx-cam-card { margin: 1rem 0; padding: 1.1rem; border-radius: 1.2rem; background: linear-gradient(160deg, rgba(139, 108, 246, 0.16), rgba(63, 224, 208, 0.08)); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 0.8rem; text-align: center; }
.hx-qr-frame { width: min(72vw, 17rem); aspect-ratio: 1; background: #fff; border-radius: 1rem; padding: 0.5rem; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); }
.hx-qr-frame svg { width: 100%; height: 100%; display: block; }
.hx-qr-title { font-size: 1.05rem; }
.hx-qr-sub { margin: 0; font-size: 0.85rem; max-width: 24rem; }
.hx-qr-actions, .hx-cam-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.hx-qr-scan { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.8rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 600; }
.hx-cam-icon { width: 4.2rem; height: 4.2rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; color: #fff; background: linear-gradient(135deg, var(--hx-accent), var(--hx-accent-2)); }
.hx-cam-card .btn { min-width: 13rem; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; cursor: pointer; }
.hx-cam-card p { margin: 0; max-width: 26rem; }
.hx-cam-result { width: 100%; text-align: left; padding: 0.8rem; border-radius: 1rem; background: rgba(127, 127, 160, 0.14); display: flex; flex-direction: column; gap: 0.5rem; }
.hx-cam-result code { display: block; word-break: break-all; font-size: 0.85rem; padding: 0.5rem; border-radius: 0.6rem; background: rgba(0, 0, 0, 0.25); }
.hx-cam-reply { white-space: pre-wrap; max-width: none !important; }
.hx-cam-photo { width: 100%; max-height: 46vh; object-fit: contain; border-radius: 1rem; background: rgba(0, 0, 0, 0.3); }
.hx-cam-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.hx-cam-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 0.9rem; border-radius: 999px; border: 1px solid var(--border); background: rgba(127, 127, 160, 0.14); color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer; }
.hx-cam-chip:disabled { opacity: 0.5; cursor: default; }
.hx-cam-chip small { opacity: 0.7; }
.hx-cam-ask { display: flex; gap: 0.5rem; width: 100%; }
.hx-cam-ask .input { flex: 1; }
.hx-landing { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem; text-align: center; padding: 1.5rem; }
.hx-landing h1 { margin: 0; font-size: 1.3rem; }
.hx-landing p { margin: 0; max-width: 24rem; }

/* Camera menu (Hub): two rows, each opens the camera straight away */
.hx-qr-scan { background: none; font: inherit; cursor: pointer; width: 100%; }
.hx-cam-sheet { display: flex; flex-direction: column; gap: 0.7rem; max-height: 85vh; }
.hx-cam-sheet h3 { margin: 0.1rem 0 0.2rem; font-size: 1.05rem; text-align: center; }
.hx-cam-opt { display: flex; align-items: center; gap: 0.9rem; width: 100%; padding: 0.85rem; border-radius: 1.1rem; border: 1px solid var(--border); background: rgba(127, 127, 160, 0.12); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.hx-cam-opt b { display: block; font-size: 1rem; }
.hx-cam-opt small { display: block; color: var(--text-dim); font-size: 0.8rem; margin-top: 0.1rem; }
.hx-cam-opt-icon { flex: none; width: 3rem; height: 3rem; border-radius: 0.95rem; display: grid; place-items: center; font-size: 1.35rem; color: #fff; background: linear-gradient(135deg, #8b6cf6, #3fe0d0); }
.hx-cam-opt-icon.snap { background: linear-gradient(135deg, #ff7a59, #ff4fd8); }
.hx-cam-gallery { background: none; border: none; color: var(--text-dim); font: inherit; font-size: 0.85rem; cursor: pointer; padding: 0.3rem; }

/* Branded Auracode card */
.hx-qr-brand { background: radial-gradient(120% 90% at 20% 0%, #5b34c9 0%, #2a1572 45%, #0f0a33 100%); border: 1px solid rgba(168, 137, 255, 0.35); color: #fff; gap: 0.55rem; padding: 1.2rem 1.1rem 1.1rem; box-shadow: 0 10px 34px rgba(60, 30, 160, 0.35); }
.hx-qr-brandrow { display: flex; align-items: center; gap: 0.45rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.8rem; color: #d9ccff; }
.hx-qr-brandrow i { color: #ffe27a; }
.hx-qr-brand .hx-qr-frame { width: min(70vw, 16rem); padding: 0.55rem; border-radius: 1.4rem; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35); }
.hx-qr-brand .hx-qr-frame svg { border-radius: 1rem; }
.hx-qr-name { font-size: 1.25rem; margin-top: 0.3rem; }
.hx-qr-tag { font-size: 0.9rem; color: #cfc3ff; }
.hx-qr-host { font-size: 0.72rem; color: #9fb4ff; opacity: 0.85; letter-spacing: 0.04em; }

/* Hub loading skeleton: the saved wallpaper and icon style are already drawn; only the live widgets shimmer until their data arrives */
.hx-skel { display: block; background: linear-gradient(90deg, rgba(255,255,255,0.10) 25%, rgba(255,255,255,0.28) 50%, rgba(255,255,255,0.10) 75%); background-size: 200% 100%; animation: aura-shimmer 1.6s linear infinite; }
.hx-skel-chip { width: 8.5rem; height: 1.7rem; border-radius: 999px; padding: 0; }
.hx-skel-screen { justify-content: center; gap: 0.6rem; }
.hx-skel-bar { height: 0.8rem; width: 85%; border-radius: 999px; }
.hx-skel-bar.short { width: 45%; height: 1.2rem; }
.hx-skel-card { width: 100%; height: 9.6rem; border-radius: 1.1rem; }
@media (prefers-reduced-motion: reduce) { .hx-skel { animation: none; } }

/* Photo wallpaper: the photo itself is applied by JS (Hub.razor.js); until then a dark gradient, never the default look */
.hx-phone.wp-photo { background: linear-gradient(170deg, #0b0d1c, #1a1440); }

/* Update prompt: long release notes scroll inside the card; the buttons always stay on screen above the Android navigation bar */
.hx-update-backdrop { box-sizing: border-box; }
.hx-update { max-height: 100%; min-height: 0; overflow: hidden; box-sizing: border-box; }
.hx-update > * { flex-shrink: 0; }
.hx-update > .hx-update-notes { flex-shrink: 1; min-height: 0; max-height: 36vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.hx-update-actions { padding-bottom: 0.1rem; }

/* ==========================================================================
   Windows desktop head only (.hx-desktop). PublicLayout adds this class when
   the app runs on Windows; it is absent in the WASM web build and on Android,
   so those keep the phone-shaped shell untouched. Only the page background is
   affected - a full-bleed aurora fills the whole window instead of a flat
   canvas around the phone-width column. Layout, widths and the hero are left
   exactly as they are on the phone.
   ========================================================================== */
.theme-noir.hx-app.hx-desktop {
    background:
        radial-gradient(ellipse 70% 55% at 8% -10%, rgba(63, 224, 208, 0.16), transparent 62%),
        radial-gradient(ellipse 65% 60% at 96% -4%, rgba(139, 108, 246, 0.22), transparent 64%),
        radial-gradient(ellipse 90% 70% at 50% 116%, rgba(91, 140, 255, 0.15), transparent 66%),
        var(--bg);
}

.theme-noir.hx-app.hx-desktop.light-mode {
    background:
        radial-gradient(ellipse 70% 55% at 8% -10%, rgba(13, 159, 160, 0.10), transparent 62%),
        radial-gradient(ellipse 65% 60% at 96% -4%, rgba(139, 108, 246, 0.12), transparent 64%),
        radial-gradient(ellipse 90% 70% at 50% 116%, rgba(91, 140, 255, 0.09), transparent 66%),
        var(--bg);
}

/* Home fits one phone screen (a Xiaomi 12 Pro is 412x915): the hero, the two cards and the fixed chat
   bar all sit above the fold without scrolling. Measured against the real CSS chain at 412x915 with a
   30px status bar and 48px nav bar - 53px had to go. Taller screens keep the roomy layout. */
@media (max-height: 960px) {
    .hx-hero { padding-top: calc(var(--hx-safe-top) + 0.5rem); padding-bottom: 0.8rem; gap: 0.6rem; }
    .hx-hero .hx-hero-top { margin-top: 0.3rem; }
    .hx-stage { padding-top: 0.5rem; }
    .hx-presence { width: 9.5rem; height: 9.5rem; margin-top: 0.2rem; }
    /* The avatar carries its size as an inline style (Avatar's SizePx), so !important is the only way
       to shrink it per screen height. */
    .hx-presence .avatar-circle { width: 112px !important; height: 112px !important; }
    .hx-hero-title { font-size: 1.7rem; }
    .hx-level { padding: 0.55rem 0.8rem; margin-top: 0.6rem; }
    .hx-pulse { padding: 0.5rem 0.9rem; }
    .hx-duo { margin-top: 0.7rem; }
    .hx-duo > .hx-card { min-height: 8rem; }
}

/* --- Simple docked tab bar (Muse-style): flat, icons only, outline = idle, filled = active. Last in the file so it
   overrides the older floating-pill / Home-orb rules above. --- */
.hx-app, .theme-noir.hx-app { --hx-nav-h: 3.3rem; }
.hx-app .hx-nav {
    left: 0; right: 0; bottom: 0; transform: none; width: 100%;
    height: calc(var(--hx-nav-h) + var(--hx-safe-bottom));
    padding: 0 0.5rem var(--hx-safe-bottom);
    gap: 0; border-radius: 0; border: 0; border-top: 1px solid var(--border);
    box-shadow: none; overflow: visible;
    background: var(--hx-nav-bg);
    -webkit-backdrop-filter: blur(20px) saturate(1.3); backdrop-filter: blur(20px) saturate(1.3);
}
.theme-noir.hx-app { --hx-nav-bg: rgba(10, 14, 32, 0.86); }
.theme-noir.hx-app.light-mode { --hx-nav-bg: rgba(255, 255, 255, 0.9); }
.hx-app .hx-nav-item {
    flex: 1; height: var(--hx-nav-h); border-radius: 0; background: none !important;
    color: var(--text-dim) !important;
}
.hx-app .hx-nav-item i {
    font-size: 1.35rem; color: inherit; -webkit-text-stroke: 0; filter: none !important;
}
.hx-app .hx-nav-item i.on { display: none; }
.hx-app .hx-nav-item.active { color: var(--text) !important; }
.hx-app .hx-nav-item.active i.on { display: inline-block; }
.hx-app .hx-nav-item.active i.idle { display: none; }
.hx-app .hx-nav-badge { top: 0.55rem; left: calc(50% + 0.35rem); }
/* Keyboard open in a chat: give the space back to the conversation. */
.hx-app:has(.cg-chat-page textarea:focus) .hx-nav { display: none; }
.hx-app:has(.cg-chat-page textarea:focus) .hx-page { padding-bottom: calc(var(--hx-safe-bottom) + 0.5rem); }
/* Chat page sits right above the bar; the bar already carries the bottom inset. */
.hx-page:has(.cg-chat-page) { padding-bottom: calc(var(--hx-nav-h) + var(--hx-safe-bottom)); }
.hx-nav-hidden .hx-page:has(.cg-chat-page) { padding-bottom: calc(var(--hx-safe-bottom) + 0.5rem); }
.hx-composer-bar { bottom: calc(var(--hx-safe-bottom) + var(--hx-nav-h) + 0.8rem); }
.hx-page:has(.hx-composer-bar) { padding-bottom: calc(var(--hx-safe-bottom) + var(--hx-nav-h) + 6rem); }

/* Menus inside plain pages (Settings, Plan & wallet, Companion settings): breathing room around them. */
.hx-app .cg-chat-header + .hx-menu, .hx-app h1 + .hx-menu { margin-top: 0.9rem; }
.hx-app .hx-menu + :not(.hx-menu):not(.hx-menu-label) { margin-top: 1.2rem; }
.hx-app .hx-menu a, .hx-app .hx-menu button { padding: 1.05rem 1.3rem; }
.hx-app .hx-menu a > i:first-child, .hx-app .hx-menu button > i:first-child { flex: none; }
.hx-app .hx-menu .hx-menu-text { flex: 1; }
.hx-app .hx-menu .hx-menu-text small { white-space: normal; }
.hx-persona { color: var(--text-dim); margin: 0.3rem 0 0; font-size: 0.85rem; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hx-app .hx-settings-card .hx-menu { margin: 1rem 0 1.2rem; }

/* Colourful starter prompts (icon bubble + label). */
.cg-suggest-chip { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 1rem 0.5rem 0.5rem; border-radius: 999px; }
.cg-suggest-ico { flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.95rem; color: var(--chip, #a78bfa); background: color-mix(in srgb, var(--chip, #a78bfa) 20%, transparent); box-shadow: 0 0 12px color-mix(in srgb, var(--chip, #a78bfa) 35%, transparent); }

/* Colourful quick-action chips and tab icons. */
.cg-chip { padding: 0.35rem 0.95rem 0.35rem 0.35rem; color: var(--text); gap: 0.5rem; }
.cg-chip-ico { width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; color: var(--chip, #7ff0e3); background: color-mix(in srgb, var(--chip, #7ff0e3) 22%, transparent); box-shadow: 0 0 10px color-mix(in srgb, var(--chip, #7ff0e3) 35%, transparent); }
.cg-chip i { font-size: 0.8rem; }
.light-mode .cg-chip { color: #0d1b33; }
.hx-app .hx-nav-item { color: var(--tab, var(--text-dim)) !important; }
.hx-app .hx-nav-item i.idle { opacity: 0.8; }
.hx-app .hx-nav-item.active { color: var(--tab, var(--text)) !important; }
.hx-app .hx-nav-item.active i.on { filter: drop-shadow(0 0 7px var(--tab, transparent)) !important; }
.cg-chip-row { top: -3.2rem; }
/* Composer, Grok-inspired: text on top, tool row below (+, voice toggle ... mic, Speak / Send pill), each in its own colour. */
.hx-app .cg-composer-box { flex-direction: column; align-items: stretch; gap: 0.35rem; padding: 0.7rem 0.6rem 0.55rem 1rem; border-radius: 28px; }
.hx-app .cg-composer-box textarea { padding: 0.15rem 0.2rem 0.3rem 0; min-height: 1.6rem; font-size: 1rem; }
.cg-composer-tools { display: flex; align-items: center; gap: 0.45rem; }
.cg-tools-gap { flex: 1; }
.cg-composer-tools .cg-plus-btn, .cg-composer-tools .cg-mic-btn { width: 38px; height: 38px; }
.hx-app .cg-composer-tools .cg-plus-btn { --c: #a78bfa; background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 30%, transparent); }
.hx-app .cg-composer-tools .cg-mic-btn:not(.recording) { --c: #f472b6; background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 30%, transparent); }
.hx-app .cg-composer-tools .cg-voice-toggle { --c: #38bdf8; width: auto; height: 38px; border-radius: 999px; padding: 0 0.85rem; gap: 0.4rem; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); font-size: 0.85rem; font-weight: 600; }
.hx-app .cg-composer-tools .cg-voice-toggle.on { --c: #34d399; background: color-mix(in srgb, var(--c) 22%, transparent); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 30%, transparent); }
.cg-voice-toggle span { font-size: 0.82rem; }
.cg-speak-pill { display: inline-flex; align-items: center; gap: 0.5rem; height: 38px; padding: 0 1.05rem 0 0.9rem; border-radius: 999px; background: linear-gradient(135deg, #a78bfa, #38bdf8 55%, #34d399); color: #07101f; font-weight: 700; font-size: 0.95rem; text-decoration: none; box-shadow: 0 0 18px rgba(124, 140, 250, 0.45); }
.cg-speak-pill:active { transform: scale(0.97); }
.cg-wave { display: inline-flex; align-items: center; gap: 2px; height: 1.1rem; }
.cg-wave i { display: block; width: 2.5px; border-radius: 2px; background: currentColor; animation: cg-wave 1.1s ease-in-out infinite; }
.cg-wave i:nth-child(1) { height: 35%; } .cg-wave i:nth-child(2) { height: 75%; animation-delay: 0.1s; } .cg-wave i:nth-child(3) { height: 100%; animation-delay: 0.2s; } .cg-wave i:nth-child(4) { height: 60%; animation-delay: 0.3s; } .cg-wave i:nth-child(5) { height: 30%; animation-delay: 0.4s; }
@keyframes cg-wave { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.5); } }
@media (prefers-reduced-motion: reduce) { .cg-wave i { animation: none; } }
.cg-composer-tools .cg-send-btn { width: 46px; height: 38px; border-radius: 999px; }
/* The composer is taller now: lift the message area's bottom padding and the chip row with it. */
.hx-app .cg-messages { padding-bottom: 12.4rem; }
.cg-chip-row { top: -3.4rem; }

/* Attach menu: a popover above the + button (Camera / Gallery / Video / Files), each with its own colour. */
.hx-app .cg-composer { position: relative; }
.cg-attach-backdrop { position: fixed; inset: 0; z-index: 40; background: transparent; }
.cg-attach-menu { position: absolute; left: 0.2rem; bottom: calc(100% + 0.5rem); z-index: 41; min-width: 13.5rem; padding: 0.5rem; border-radius: 26px; background: var(--surface-alt, #1b1d29); border: 1px solid var(--border-strong); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); display: flex; flex-direction: column; animation: cg-pop 0.14s ease-out; transform-origin: bottom left; }
@keyframes cg-pop { from { opacity: 0; transform: scale(0.94) translateY(6px); } to { opacity: 1; transform: none; } }
.cg-attach-item { position: relative; display: flex; align-items: center; gap: 0.9rem; width: 100%; padding: 0.75rem 0.9rem; border: none; border-radius: 18px; background: none; color: var(--text); font: inherit; font-size: 1rem; cursor: pointer; text-align: left; }
.cg-attach-item:active { background: color-mix(in srgb, var(--c) 16%, transparent); }
.cg-attach-item i { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.95rem; color: var(--c); background: color-mix(in srgb, var(--c) 20%, transparent); }
.cg-attach-item input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.light-mode .cg-attach-menu { background: #fff; box-shadow: 0 14px 36px rgba(13, 27, 51, 0.2); }

/* Attach menu, compact and aligned (labels inherit global uppercase/stacked label styling, so reset it). */
.hx-app .cg-attach-menu { min-width: 0; width: 11.2rem; padding: 0.35rem; border-radius: 22px; gap: 0.1rem; }
.hx-app .cg-attach-menu .cg-attach-item { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 0.7rem; width: 100%; margin: 0; padding: 0.5rem 0.65rem; border-radius: 16px; text-transform: none; letter-spacing: 0; font-size: 0.95rem; font-weight: 500; line-height: 1.2; color: var(--text); }
.hx-app .cg-attach-menu .cg-attach-item span { text-transform: none; letter-spacing: 0; font-size: 0.95rem; color: inherit; }
.hx-app .cg-attach-menu .cg-attach-item i { flex: none; width: 1.9rem; height: 1.9rem; font-size: 0.85rem; }

/* Light mode: keep the per-tab colours (older white-fill/grey-stroke rules had higher specificity). */
.light-mode.hx-app .hx-nav-item:not(.hx-orb) i { color: inherit; -webkit-text-stroke: 0; }
.light-mode.hx-app .hx-nav-item { --tab-lm: color-mix(in srgb, var(--tab) 78%, #1a1030); color: var(--tab-lm, var(--text-dim)) !important; }
.light-mode.hx-app .hx-nav-item.active:not(.hx-orb) i { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--tab) 55%, transparent)) !important; }

/* ---- Buttons, direction B: solid + calm. Tonal secondary, ink-filled primary/active, segmented control. ---- */
.theme-noir.hx-app { --btn-bg: rgba(255, 255, 255, 0.1); --btn-bg-hover: rgba(255, 255, 255, 0.16); --btn-fill: #f2f3f8; --btn-on: #0b0e1a; --seg-bg: rgba(255, 255, 255, 0.1); --seg-thumb: rgba(255, 255, 255, 0.2); }
.theme-noir.hx-app.light-mode { --btn-bg: rgba(13, 27, 51, 0.07); --btn-bg-hover: rgba(13, 27, 51, 0.12); --btn-fill: #0d1b33; --btn-on: #ffffff; --seg-bg: rgba(13, 27, 51, 0.09); --seg-thumb: #ffffff; }
.theme-noir.hx-app .btn { border: 0; border-radius: 14px; background: var(--btn-bg); color: var(--text); font-weight: 600; box-shadow: none; transition: background 0.15s ease, transform 0.1s ease; }
.theme-noir.hx-app .btn:hover:not(:disabled) { background: var(--btn-bg-hover); box-shadow: none; filter: none; }
.theme-noir.hx-app .btn:active:not(:disabled) { transform: scale(0.98); }
.theme-noir.hx-app .btn.btn-primary { background: var(--btn-fill); color: var(--btn-on); }
.theme-noir.hx-app .btn.btn-primary:hover:not(:disabled) { background: var(--btn-fill); filter: brightness(1.12); }
.theme-noir.hx-app .btn-sm { border-radius: 999px; padding: 0.42rem 0.9rem; font-size: 0.85rem; }
.theme-noir.hx-app .btn.btn-danger { background: rgba(224, 62, 54, 0.14); color: #e8695f; border: 0; }
.theme-noir.hx-app.light-mode .btn.btn-danger { color: #b3261e; }
.theme-noir.hx-app .md-confirm-actions .btn-danger { background: #dc2626; color: #fff; }
.theme-noir.hx-app .btn:disabled { opacity: 0.5; }
/* Segmented control: add class hx-seg to a row of two or three .btn; the active one is .btn-primary. */
.hx-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: 14px; background: var(--seg-bg); }
.theme-noir.hx-app .hx-seg .btn { background: transparent; color: var(--text-dim); border-radius: 11px; padding: 0.6rem 0.5rem; font-size: 0.9rem; }
.theme-noir.hx-app .hx-seg .btn.btn-primary { background: var(--seg-thumb); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); }
.theme-noir.hx-app .hx-seg .btn.btn-primary:hover:not(:disabled) { background: var(--seg-thumb); filter: none; }

/* Main call-to-action (full width, rounded rectangle, taller) - matches mockup B. Chips stay pills. */
.theme-noir.hx-app .btn.btn-cta { display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; padding: 0.95rem 1rem; border-radius: 14px; font-size: 1rem; font-weight: 600; }
.theme-noir.hx-app .btn.btn-cta.btn-primary { box-shadow: 0 6px 18px rgba(13, 27, 51, 0.22); }
.theme-noir.hx-app:not(.light-mode) .btn.btn-cta.btn-primary { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); }
.theme-noir.hx-app .hx-seg .btn { padding: 0.5rem 0.5rem; }

/* ---- Buttons B, whole member app: one family. Actions = 14px rounded rectangles; filter chips = pills; tabs = segmented. ---- */
.theme-noir.hx-app .btn-sm { border-radius: 14px; padding: 0.55rem 1rem; font-size: 0.9rem; }
.theme-noir.hx-app .btn.btn-chip { border-radius: 999px; padding: 0.42rem 0.9rem; font-size: 0.85rem; }
.theme-noir.hx-app .btn.btn-ghost { background: transparent; }
.theme-noir.hx-app .btn.btn-secondary { background: var(--btn-bg); color: var(--text); }
.hx-btn-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.5rem; margin: 0.6rem 0 0.8rem; }
.hx-btn-row .btn { justify-content: center; }
.hx-btn-row .btn i, .theme-noir.hx-app .btn.btn-cta i { margin-right: 0.45rem; }
.theme-noir.hx-app .btn.btn-cta { margin: 0.2rem 0 0.2rem; }
.theme-noir.hx-app .hx-seg + .hx-qr-card, .theme-noir.hx-app .hx-seg + .hx-cam-card { margin-top: 1rem; }
/* Scan button under the code: tonal rectangle like any secondary action. */
.theme-noir.hx-app .hx-qr-scan { border: 0; border-radius: 14px; background: var(--btn-bg); font-weight: 600; padding: 0.85rem; }
/* Chips (studio, create, camera): tonal at rest, ink-filled when selected. */
.theme-noir.hx-app .hx-studio-chip, .theme-noir.hx-app .hx-cr-chip, .theme-noir.hx-app .hx-cam-chip { border: 0; background: var(--btn-bg); color: var(--text-dim); font-weight: 600; }
.theme-noir.hx-app .hx-studio-chip.on, .theme-noir.hx-app .hx-cr-chip.on { background: var(--btn-fill); color: var(--btn-on); }
.theme-noir.hx-app .hx-cam-chip { color: var(--text); }
/* Plan tabs: the segmented control. */
.theme-noir.hx-app .hx-pl-tabs { border: 0; border-radius: 14px; background: var(--seg-bg); }
.theme-noir.hx-app .hx-pl-tab { border-radius: 11px; font-weight: 600; }
.theme-noir.hx-app .hx-pl-tab.on { background: var(--seg-thumb); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); }
/* Remaining custom buttons. */
.theme-noir.hx-app .hx-earn-btn { background: var(--btn-fill); color: var(--btn-on); border-radius: 12px; font-weight: 600; }
.theme-noir.hx-app .cg-nudge-btn { border: 0; border-radius: 12px; background: var(--btn-bg); color: var(--text); font-weight: 600; }
.theme-noir.hx-app .cg-nudge-btn.primary { background: var(--btn-fill); color: var(--btn-on); }
.theme-noir.hx-app .hx-wal-loadbtn { border-radius: 12px; background: var(--btn-bg); font-weight: 600; }
.theme-noir.hx-app .hx-abd-cta { background: var(--btn-fill) !important; color: var(--btn-on) !important; border-radius: 14px; font-weight: 600; box-shadow: 0 6px 18px rgba(13, 27, 51, 0.22); }
