html.app-loading body {
    visibility: hidden;
}

html.app-ready body {
    visibility: visible;
}

:root {
    --brand-blue: #0058bc;
    --brand-blue-dark: #004a9f;
    --header-height: 72px;
    --side-widget-width: 320px;
    --side-widget-gap: 24px;
    --side-widget-bottom-gap: 24px;
    --bottom-nav-height: 5rem;
    --side-widget-top-offset: var(--header-height);
    --side-widget-height: calc(100vh - var(--header-height) - 24px);
    --surface: #ffffff;
    --surface-soft: #f6f8fc;
    --text-strong: #111827;
    --text-muted: #64748b;
    --line-soft: rgba(15, 23, 42, 0.1);
    --border-soft: rgba(15, 23, 42, 0.1);
    --shadow-card: 0 12px 32px rgba(15, 23, 42, 0.06);
    --radius-card: 18px;
    --space-1: 8px;
    --space-2: 12px;
    --space-3: 16px;
    --space-4: 24px;
    --space-5: 32px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--surface-soft);
    color: var(--text-strong);
    overflow-y: scroll;
    scrollbar-gutter: stable;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--surface-soft);
    color: var(--text-strong);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

img,
svg {
    display: block;
    max-width: 100%;
}

#app-shell {
    min-height: 100vh;
}

#app-main {
    min-height: calc(100vh - var(--header-height));
}

.hookie-header {
    height: var(--header-height);
    min-height: var(--header-height);
    max-height: var(--header-height);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-strong);
    box-sizing: border-box;
}

.hookie-header > div:first-child {
    height: calc(var(--header-height) - 2px);
    min-height: calc(var(--header-height) - 2px);
    max-height: calc(var(--header-height) - 2px);
}

.hookie-header a,
.hookie-header button,
.hookie-bottom-nav a {
    text-decoration: none;
}

.hookie-header button,
.hookie-header a,
.hookie-bottom-nav a {
    min-height: 2.5rem;
}

#hookie-mobile-menu {
    background: rgba(255, 255, 255, 0.98);
}

.hookie-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    min-height: 5rem;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.94);
}

.hookie-bottom-nav a {
    min-width: 0;
}

.app-page-layout {
    display: grid;
    grid-template-columns: var(--side-widget-width) minmax(0, 1fr);
    gap: var(--side-widget-gap);
    align-items: start;
    min-height: calc(100vh - var(--header-height));
}

.app-content-panel {
    min-width: 0;
}

.discover-layout {
    display: grid;
    grid-template-columns: var(--side-widget-width) minmax(420px, 520px) minmax(260px, 320px);
    gap: var(--side-widget-gap);
    align-items: start;
}

.hookie-blue-side-widget {
    width: var(--side-widget-width);
    min-width: var(--side-widget-width);
    max-width: var(--side-widget-width);
    height: var(--side-widget-height);
    min-height: var(--side-widget-height);
    max-height: var(--side-widget-height);
    display: flex;
    flex-direction: column;
    background:
        repeating-linear-gradient(
            0deg,
            rgba(255,255,255,0.018) 0px,
            rgba(255,255,255,0.018) 1px,
            transparent 1px,
            transparent 4px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255,255,255,0.010) 0px,
            rgba(255,255,255,0.010) 1px,
            transparent 1px,
            transparent 40px
        ),
        radial-gradient(ellipse at 30% 0%, rgba(255,255,255,0.06) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 100%, rgba(0,60,130,0.18) 0%, transparent 50%),
        linear-gradient(170deg, #1a1a1f 0%, #0d0d10 40%, #070708 100%);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.07);
    border-top: none;
    border-radius: 0 0 18px 18px;
    padding: 28px;
    position: sticky;
    top: var(--side-widget-top-offset);
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 18px 40px rgba(0, 91, 187, 0.18), inset 0 1px 0 rgba(255,255,255,0.07), inset 1px 0 0 rgba(255,255,255,0.04);
    scrollbar-color: rgba(255, 255, 255, 0.6) transparent;
}

.hookie-blue-side-widget a,
.hookie-blue-side-widget button {
    color: inherit;
}

.hookie-blue-list-item {
    color: #ffffff;
    border: 1px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    padding: 14px 12px;
    border-radius: 14px;
    cursor: pointer;
    background: transparent;
}

.hookie-blue-list-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.hookie-blue-list-item.active,
.hookie-blue-list-item[aria-current="true"],
.hookie-blue-list-item.is-selected {
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: inset 4px 0 0 #ffffff;
}

.hookie-blue-list-item small,
.hookie-blue-list-item .meta {
    color: rgba(255, 255, 255, 0.78);
}

.hookie-skeleton {
    border-radius: 12px;
    background: linear-gradient(90deg, #eef2ff 25%, #e5e7eb 37%, #eef2ff 63%);
    background-size: 400% 100%;
    animation: hookie-skeleton 1.2s ease-in-out infinite;
}

@keyframes hookie-skeleton {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.hookie-empty-state,
.hookie-error-state {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: #fff;
    padding: 20px;
    text-align: center;
}

.hookie-route-loader {
    position: fixed;
    left: 50%;
    top: calc(var(--header-height) + 16px);
    z-index: 190;
    width: min(28rem, calc(100vw - 2rem));
    transform: translateX(-50%);
    border: 1px solid rgba(0, 88, 188, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    padding: 12px;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.12);
    pointer-events: none;
}

.hookie-route-loader-grid {
    display: grid;
    gap: 8px;
}

#spa-progress-bar {
    position: fixed;
    left: 0;
    top: 0;
    height: 3px;
    width: 0;
    z-index: 220;
    background: var(--hk-primary, #0058bc);
    opacity: 0;
    transition: width 220ms ease, opacity 180ms ease;
}

#spa-progress-bar.visible {
    width: 70%;
    opacity: 1;
}

.hookie-toast,
#global-toast-container {
    z-index: 240;
}

.hookie-offline-banner {
    position: fixed;
    left: 50%;
    top: calc(var(--header-height) + 8px);
    transform: translateX(-50%);
    z-index: 230;
    background: #fef3c7;
    color: #78350f;
    border: 1px solid #f59e0b;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.card,
.hookie-card {
    background: var(--hk-surface, #ffffff);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 20px;
}

.btn,
.hookie-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    padding: 0 18px;
    font-weight: 700;
    line-height: 1;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.btn:hover,
.hookie-button:hover {
    transform: translateY(-1px);
}

.btn:active,
.hookie-button:active {
    transform: translateY(0);
}

.form-control,
.form-select,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]):not(.sr-only),
select,
textarea {
    min-height: 44px;
    border-radius: 12px;
    border-color: var(--border-soft);
}

input::placeholder,
textarea::placeholder {
    color: var(--hk-text-muted, #94a3b8);
}

@media (max-width: 1023px) {
    :root {
        --side-widget-width: 280px;
    }
}

@media (max-width: 860px) {
    .app-page-layout,
    .discover-layout {
        display: block;
        min-height: auto;
    }

    .hookie-blue-side-widget {
        position: relative;
        top: 0;
        width: 100%;
        min-width: 0;
        max-width: none;
        height: auto;
        min-height: min(720px, calc(100vh - var(--header-height) - var(--bottom-nav-height) - 24px));
        max-height: calc(100vh - var(--header-height) - var(--bottom-nav-height) - 24px);
        padding: 22px;
    }
}
