.hookie-desktop-navigation, .hookie-desktop-support { display: none; }
.hookie-profile-hero-photo { display: none; }
.hookie-background-options { display:flex; flex-wrap:wrap; gap:16px; margin-top:16px; }
.hookie-background-option { display:flex; align-items:center; gap:8px; min-height:48px; cursor:pointer; }
.hookie-background-option input { accent-color:var(--hk-primary,#78b7ff); }
.hookie-background-swatch { display:grid; place-items:center; width:40px; height:40px; border-radius:50%; border:2px solid #bfc9d4; color:#fff; }
.hookie-profile-backdrop { position:relative; isolation:isolate; background:var(--profile-background,#17334a) !important; }
.hookie-profile-backdrop-photo { position:absolute; z-index:-1; inset:0; width:100%; height:100%; object-fit:cover; opacity:.12; pointer-events:none; }
.hookie-profile-backdrop .hookie-profile-hero-photo { box-sizing:border-box; padding:16px; }
@font-face { font-family: HookieCupertino; src: url('/assets/fonts/CupertinoIcons.ttf') format('truetype'); font-display: block; }
.hookie-app-icon { display: inline-grid; position: relative; place-items: center; width: 24px; height: 24px; font-size: 0; flex: 0 0 24px; }
.hookie-app-icon::before { font-family: HookieCupertino; font-size: 24px; line-height: 1; font-weight: normal; }
.hookie-app-icon[data-app-icon="sparkles"]::before { content: '\f7e8'; }
.hookie-app-icon[data-app-icon="chat_bubble"]::before { content: '\f8bc'; }
[aria-current="page"] .hookie-app-icon[data-app-icon="chat_bubble"]::before { content: '\f8bd'; }
.hookie-app-icon[data-app-icon="person"]::before { content: '\f419'; }
[aria-current="page"] .hookie-app-icon[data-app-icon="person"]::before { content: '\f74d'; }
.hookie-app-icon[data-app-icon="calendar"]::before { content: '\f5b0'; }
.hookie-app-icon[data-app-icon="connect"]::before { content: '\f78d'; }
.hookie-app-icon[data-app-icon="heart"]::before { content: '\f442'; }
.hookie-app-icon[data-app-icon="settings"]::before { content: '\f43c'; }
.hookie-app-icon[data-app-icon="bell"]::before { content: '\f3e1'; }
.hookie-app-icon[data-app-icon="moon"]::before { content: '\f716'; }
.hookie-app-icon[data-app-icon="cards"]::before { content: '\f815'; }
.hookie-app-icon[data-app-icon="browse"]::before { content: '\f804'; }
.hookie-app-icon[data-app-icon="filters"]::before { content: '\f7dc'; }
/* Desktop owns its shell; phone and tablet rules remain independent. */
@media (min-width: 1024px) {
    body[data-page="discover"]:not(.admin-theme) .discover-modes button[aria-pressed="true"] { background: var(--hk-surface-highest, #303030); color: var(--hk-text, #fff); }
    main[data-discover-spa][data-discover-mode="browse"] [data-discover-card-region] { scrollbar-width: none; }
    main[data-discover-spa][data-discover-mode="browse"] [data-discover-card-region]::-webkit-scrollbar { display: none; }
    html:has(body.theme-connected:not(.admin-theme)) { scrollbar-gutter: stable; }
    body[data-page="profile"] .hookie-route-outlet,
    body[data-page="profile"] .hookie-route-entering { animation: none !important; transition: none !important; transform: none !important; opacity: 1 !important; }
    .hookie-profile-grid .hookie-profile-hero:has(.hookie-profile-hero-photo[src$="icon-512.svg"]) { height: 180px; }
    .hookie-profile-hero-photo[src$="icon-512.svg"] { width: 96px; height: 96px; margin: 42px auto; }
    .hookie-profile-grid > div { border-radius: 8px; }
    body.theme-connected:not(.admin-theme) { --desktop-left: 224px; --desktop-right: 264px; --desktop-gap: 24px; --desktop-padding: 24px; --hookie-box-max: 1280px; --desktop-inset: max(24px, calc((100% - var(--hookie-box-max)) / 2)); --header-height: 64px; --bottom-nav-height: 0px; padding-bottom: 0 !important; }
    body.theme-connected:not(.admin-theme) #app-shell { position: relative; width: calc(100% - 48px); max-width: var(--hookie-box-max); margin-inline: auto; box-shadow: 0 0 24px #0002; }
    /* Continue the header's boundaries through the entire page. */
    body.theme-connected:not(.admin-theme) #app-shell::after { display: block; content: ""; position: absolute; inset: 0; border-inline: 1px solid var(--hookie-frame-edge, var(--hk-border, #c9cdd2)); pointer-events: none; z-index: 60; }
    body.theme-connected:not(.admin-theme) #app-header,
    body.theme-connected:not(.admin-theme) [data-app-page-bar] { left: var(--desktop-inset); right: var(--desktop-inset); width: auto; max-width: var(--hookie-box-max); }
    body.theme-connected:not(.admin-theme) #app-header { display: block !important; border-inline: 1px solid var(--hookie-frame-edge, var(--hk-border, #c9cdd2)); }
    body.theme-connected:not(.admin-theme) #app-header > div:first-child { max-width: none; padding-inline: 24px; }
    body.theme-connected:not(.admin-theme) #app-header .hookie-header-actions { margin-left: auto; display: flex !important; gap: 12px; }
    .hookie-header-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; overflow: hidden; border: 1px solid var(--hk-border); }
    .hookie-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
    body.theme-connected:not(.admin-theme) #app-header [aria-label="Primary navigation"] { display: none !important; }
    body.theme-connected:not(.admin-theme) #hookie-mobile-menu { position: absolute; top: 64px; right: 16px; width: 280px; border: 1px solid #8884; border-radius: 8px; box-shadow: 0 12px 32px #0004; }
    #hookie-mobile-menu [aria-label="Mobile navigation"] { grid-template-columns: 1fr; padding: 8px; }
    body.theme-connected:not(.admin-theme) #mobile-nav { display: none !important; }
    body.theme-connected:not(.admin-theme) #app-shell main { max-width: none !important; min-width: 0; }
    body.theme-connected:not(.admin-theme) #app-shell footer { max-width: none !important; }
    body.theme-connected:not(.admin-theme):has(#app-header[data-authenticated="1"]) #app-shell main {
        width: 100%; margin-inline: 0; padding-inline: 0;
    }
    body.theme-connected:not(.admin-theme):has(#app-header[data-authenticated="1"]) .hookie-desktop-navigation {
        display: flex; flex-direction: column; position: sticky; top: 80px; width: 100%; height: calc(100dvh - 100px); padding: 8px 0; z-index: 30; overflow-y: auto;
    }
    .hookie-desktop-navigation a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 12px; border-radius: 8px; font-size: 15px; color: inherit; text-decoration: none; }
    .hookie-desktop-navigation nav a:hover, .hookie-desktop-identity:hover { background: #8881; }
    .hookie-desktop-navigation nav a[aria-current="page"] { color: var(--hk-on-selected, #a5ceff); background: var(--hk-selected, #263b51); font-weight: 700; }
    html.dark .hookie-desktop-navigation nav a[aria-current="page"] { color: var(--hk-on-selected, #a5ceff); background: var(--hk-selected, #263b51); }
    .hookie-desktop-identity { margin-bottom: 24px; font-weight: 600; }
    .hookie-desktop-identity img { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; }
    .hookie-desktop-identity > span:last-child { overflow-wrap: anywhere; min-width: 0; }
    .hookie-desktop-secondary { margin-top: auto; padding-top: 24px; border-top: 1px solid #8883; }
    .hookie-desktop-secondary a { font-size: 13px; min-height: 36px; opacity: .75; }
    .hookie-desktop-support { position: sticky; top: 104px; width: 100%; min-width: 0; font-size: 14px; }
    .hookie-desktop-support h2 { font-size: 18px; font-weight: 600; margin-bottom: 20px; }
    .hookie-desktop-support li { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
    .hookie-desktop-support .material-symbols-outlined { font-size: 20px; color: var(--hk-text-muted, #777); }
    .hookie-desktop-support .is-complete { color: var(--hk-success, #38b77e); }
    .hookie-desktop-support a { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
    .hookie-desktop-edit { color: var(--hk-primary, #0058bc); }
    html.dark .hookie-desktop-edit { color: var(--hk-primary, #8dc1ff); }
    .hookie-desktop-support-links { margin-top: 24px; padding-top: 16px; border-top: 1px solid #8883; }
    body[data-page="discover"]:not(.admin-theme):has(#app-header[data-authenticated="1"]) .hookie-desktop-support,
    body[data-page="connections"]:not(.admin-theme):has(#app-header[data-authenticated="1"]) .hookie-desktop-support { display: block; }
    body[data-page="discover"].theme-connected:not(.admin-theme) main.discover-main-layout[data-discover-spa] { height: 100dvh; padding: 84px 0 20px !important; }
    main[data-discover-spa] [data-discover-content] { max-width: 560px !important; }
    main[data-discover-spa] #discoverMainPhoto { object-fit: cover; object-position: center top; }
    main[data-discover-spa] #discoverMainCard { max-height: 780px; }
    main[data-discover-spa][data-discover-mode="browse"] [data-discover-content] { max-width: 560px !important; }
    main[data-discover-spa] .discover-browse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    main[data-discover-spa] .discover-browse-card img { aspect-ratio: 3 / 4; height: auto; object-fit: cover; object-position: center top; }
    main[data-discover-spa] .discover-browse-details strong { display: flex; align-items: center; height: 28px; min-height: 28px; }
    body[data-page="messages"].theme-connected:not(.admin-theme) #app-shell main.hookie-messages-page.app-page-layout { display: grid !important; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr) !important; height: calc(100dvh - 88px) !important; min-height: 0 !important; margin-top: 80px !important; padding: 0 !important; width: 100% !important; border: 1px solid var(--hk-divider, #303030); border-radius: 8px; }
    .hookie-messages-page .hookie-blue-side-widget { position: static !important; top: auto !important; height: 100% !important; }
    .hookie-messages-page.messages-thread-open .hookie-blue-side-widget { display: flex !important; }
    .hookie-messages-page [data-direct-chat] { display: flex !important; }
    .messages-thread-back { display: none; }
    .messages-thread-header { min-height: 72px; padding: 14px 24px; }
    .hookie-messages-page [data-direct-messages] { padding: 24px; }
    .hookie-messages-page [data-direct-message-form] { padding: 16px 24px; }
    .hookie-profile-grid { grid-template-columns: minmax(0, 1fr) !important; align-items: start; gap: 24px; max-width: 720px; margin-inline: auto; }
    .hookie-profile-grid > div { grid-column: auto !important; min-width: 0; background: transparent !important; box-shadow: none !important; border-radius: 0; }
    .hookie-profile-grid > div + div { border-top: 1px solid var(--hk-border, #363636); padding-top: 24px; }
    .hookie-profile-grid > div:last-child { grid-column: 1 / -1 !important; }
    .hookie-profile-grid > div:last-child img { object-fit: contain; object-position: center top; }
    .hookie-profile-grid > div:last-child > .grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
    .hookie-profile-grid > div:last-child > .grid > div { height: 360px; aspect-ratio: auto !important; }
    .hookie-profile-summary { flex-direction: row; gap: 24px; }
    .hookie-profile-grid .hookie-profile-hero { height: min(66dvh, 620px); background-image: none !important; background-color: var(--hk-bg); }
    .hookie-profile-hero-photo { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center top; }
    .hookie-profile-hero > .absolute.inset-0 { display: none; }
    .hookie-profile-summary { margin-top: 0; padding-top: 24px; }
    .hookie-profile-summary > div:first-child { display: none; }
    .hookie-profile-summary .hookie-profile-identity { margin-top: 0; }
    .hookie-profile-identity { margin-top: 100px; min-width: 0; }
    .hookie-profile-identity h1 { font-size: 28px; line-height: 1.3; }
    .hookie-profile-actions { flex-wrap: wrap; width: auto; }
    .hookie-profile-grid [style*="background-image"]:not(.hookie-profile-hero) { height: 280px; background-position: center 25% !important; }
    body[data-page="profile"].theme-connected:not(.admin-theme) #app-shell main { padding-top: 88px; }
    body.theme-connected:not(.admin-theme) .hookie-chat-widget { right: calc(var(--desktop-inset) + 24px) !important; }
    .hookie-desktop-navigation a:focus-visible, .hookie-desktop-support a:focus-visible { outline: 2px solid var(--hk-primary, #8dc1ff); outline-offset: 2px; }
    /* One grid owns column spacing for both direct loads and SPA navigation. */
    body.theme-connected:not(.admin-theme):has(#app-header[data-authenticated="1"]) #app-shell {
        display: grid;
        grid-template-columns: var(--desktop-left) minmax(0, 1fr);
        column-gap: var(--desktop-gap);
        padding-inline: var(--desktop-padding);
        align-items: start;
    }
    body.theme-connected:not(.admin-theme):is([data-page="discover"], [data-page="connections"]):has(#app-header[data-authenticated="1"]) #app-shell {
        grid-template-columns: var(--desktop-left) minmax(0, 1fr) var(--desktop-right);
    }
    body.theme-connected:not(.admin-theme) #app-shell > .hookie-desktop-navigation {
        grid-column: 1; grid-row: 1; margin-top: 80px;
    }
    body.theme-connected:not(.admin-theme) #app-shell > .hookie-desktop-support {
        grid-column: 3; grid-row: 1; margin-top: 104px;
    }
    body.theme-connected:not(.admin-theme):has(#app-header[data-authenticated="1"]) #app-shell > main {
        grid-column: 2; grid-row: 1; width: 100% !important; margin-inline: 0 !important; padding-inline: 0 !important;
    }
    body.theme-connected:not(.admin-theme):has(#app-header[data-authenticated="1"]) #app-shell > footer {
        grid-column: 2; min-width: 0;
    }
    body.theme-connected:not(.admin-theme) #app-shell > main > * { min-width: 0; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
    body.theme-connected:not(.admin-theme) { --desktop-left: 184px; --desktop-right: 200px; --desktop-gap: 16px; --desktop-padding: 16px; }
}
