:root {
    --homstir-ink: #10213d;
    --homstir-muted: #687b98;
    --homstir-blue: #4169f5;
    --homstir-blue-dark: #2d50d6;
    --homstir-cyan: #71d4e4;
    --homstir-line: #e4eaf3;
    --homstir-surface: #fff;
    --homstir-canvas: #f3f6fc;
    --homstir-shadow: 0 14px 36px rgba(18, 37, 72, .08);
}

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

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

body.user-app {
    min-height: 100vh;
    margin: 0;
    background: var(--homstir-canvas);
    color: var(--homstir-ink);
}

.user-app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
}

.user-sidebar {
    flex: 0 0 258px;
    width: 258px;
    min-width: 0;
    padding: 1.15rem .85rem;
    color: #fff;
    background:
        radial-gradient(ellipse at 5% 0%, rgba(67, 111, 255, .25), transparent 42%),
        linear-gradient(180deg, #10213e 0%, #0c1a32 100%);
}

.user-sidebar-header {
    margin: 0 .25rem 1.4rem;
}

.user-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.04em;
    text-decoration: none;
}

.user-brand:hover,
.user-brand:focus {
    color: #fff;
    text-decoration: none;
}

.user-brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    flex: 0 0 38px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(145deg, #597cff, #3157de);
    box-shadow: 0 8px 18px rgba(46, 84, 220, .28);
    font-size: 1.15rem;
    font-weight: 900;
}

.user-sidebar-caption {
    margin: 0 .75rem .55rem;
    color: rgba(222, 232, 251, .58);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.user-nav {
    display: grid;
    gap: .3rem;
    min-width: 0;
}

.user-nav-section {
    grid-column: 1 / -1;
    margin: 1rem .7rem .2rem;
    color: rgba(222, 232, 251, .58);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.user-nav a,
.user-nav .user-nav-disabled {
    display: flex;
    align-items: center;
    gap: .72rem;
    min-width: 0;
    min-height: 44px;
    padding: .62rem .7rem;
    border: 1px solid transparent;
    border-radius: 13px;
    color: rgba(239, 244, 255, .8);
    font-size: .87rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.user-nav a:hover {
    border-color: rgba(255, 255, 255, .1);
    color: #fff;
    background: rgba(255, 255, 255, .08);
    transform: translateX(2px);
}

.user-nav a.active {
    border-color: rgba(255, 255, 255, .15);
    color: #fff;
    background: linear-gradient(110deg, #496ff2, #3659d8);
    box-shadow: 0 8px 18px rgba(27, 59, 165, .3);
}

.user-nav svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.user-nav a:nth-of-type(2) svg {
    fill: currentColor;
    stroke: none;
}

.user-nav-disabled {
    color: rgba(218, 228, 246, .52) !important;
    cursor: default;
}

.user-nav-disabled > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    gap: .45rem;
    min-width: 0;
}

.user-nav-disabled small {
    flex: 0 0 auto;
    color: rgba(203, 217, 241, .45);
    font-size: .62rem;
    font-weight: 600;
    white-space: normal;
}

.user-mobile-menu {
    display: none;
}

.user-main {
    flex: 1 1 auto;
    min-width: 0;
    width: 0;
}

.user-topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 70px;
    padding: .75rem clamp(1rem, 3vw, 2.5rem);
    border-bottom: 1px solid rgba(222, 230, 242, .85);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(16px);
}

.user-topbar-profile,
.user-topbar-actions {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-width: 0;
}

.user-topbar-actions form {
    margin: 0;
}

.user-topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.user-account-name {
    overflow: hidden;
    color: #34445f;
    font-size: .88rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-version-menu {
    position: relative;
    min-width: 0;
}

.user-version-menu > summary {
    cursor: pointer;
    list-style: none;
}

.user-version-menu > summary::-webkit-details-marker {
    display: none;
}

.user-version-menu > summary:focus-visible {
    border-radius: 999px;
    outline: 3px solid rgba(71, 116, 237, .35);
    outline-offset: 3px;
}

.user-version-chevron {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: #76859d;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transition: transform .18s ease;
}

.user-version-menu[open] .user-version-chevron {
    transform: rotate(180deg);
}

.user-version-dropdown {
    position: absolute;
    z-index: 60;
    top: calc(100% + .75rem);
    left: 0;
    display: grid;
    width: min(280px, calc(100vw - 2rem));
    gap: .4rem;
    padding: .85rem;
    border: 1px solid #e2e9f4;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(24, 43, 77, .17);
}

.user-version-label {
    color: #7b8ba5;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .09em;
}

.user-version-dropdown > strong {
    padding: 0 0 .55rem;
    color: #132744;
    font-size: .95rem;
}

.user-version-dropdown > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem .75rem;
    border-radius: 9px;
    color: #234b9a;
    background: #f2f6ff;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
}

.user-version-dropdown > a:hover,
.user-version-dropdown > a:focus-visible {
    color: #173b83;
    background: #e7efff;
    text-decoration: none;
}

.user-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    flex: 0 0 36px;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, #79d8e5, #4774ed);
    box-shadow: 0 3px 10px rgba(40, 80, 160, .18);
    font-size: .8rem;
    font-weight: 800;
}

.user-content {
    width: 100%;
    max-width: 1520px;
    min-width: 0;
    margin: 0 auto;
    padding: clamp(1rem, 2.7vw, 2rem);
    overflow-x: clip;
}

.user-page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    margin-bottom: 1.25rem;
}

.user-page-heading h1 {
    color: var(--homstir-ink);
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    font-weight: 800;
    letter-spacing: -.045em;
    line-height: 1.15;
}

.user-page-heading p {
    max-width: 58ch;
    color: var(--homstir-muted);
    line-height: 1.55;
}

.user-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    min-width: 0;
}

.user-dashboard-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    min-width: 0;
    margin-bottom: 1.15rem;
    padding: clamp(1.25rem, 3.3vw, 2.35rem);
    overflow: hidden;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(circle at 87% 20%, rgba(115, 220, 234, .32), transparent 25%),
        radial-gradient(circle at 75% 115%, rgba(70, 113, 244, .55), transparent 42%),
        linear-gradient(118deg, #102442 0%, #173c76 62%, #25669a 100%);
    box-shadow: 0 18px 42px rgba(16, 43, 88, .18);
}

.user-dashboard-hero::after {
    position: absolute;
    top: -58px;
    right: 7%;
    width: 220px;
    height: 220px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 50%;
    box-shadow: 0 0 0 22px rgba(255, 255, 255, .035), 0 0 0 48px rgba(255, 255, 255, .025);
    content: "";
    pointer-events: none;
}

.user-dashboard-hero-content,
.user-dashboard-hero .user-page-actions {
    position: relative;
    z-index: 1;
}

.user-dashboard-hero .eyebrow {
    margin-bottom: .7rem;
    color: #a8e9ef;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.user-dashboard-hero h1 {
    max-width: 20ch;
    margin: 0 0 .6rem;
    color: #fff;
    font-size: clamp(1.75rem, 4vw, 2.65rem);
    font-weight: 800;
    letter-spacing: -.05em;
    line-height: 1.05;
}

.user-dashboard-hero p {
    max-width: 55ch;
    margin: 0;
    color: rgba(239, 247, 255, .8);
    line-height: 1.6;
}

.user-dashboard-hero .btn {
    min-height: 44px;
    padding: .7rem 1rem;
    border-radius: 12px;
    font-weight: 700;
}

.user-dashboard-hero .btn-primary {
    border-color: #fff;
    color: #163260;
    background: #fff;
}

.user-dashboard-hero .btn-outline-light {
    border-color: rgba(255, 255, 255, .48);
}

.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .9rem;
    min-width: 0;
    margin-bottom: 1rem;
}

.user-stat-card,
.user-panel {
    min-width: 0;
    border: 1px solid rgba(223, 231, 243, .9);
    border-radius: 18px;
    background: var(--homstir-surface);
    box-shadow: var(--homstir-shadow);
}

.user-stat-card {
    position: relative;
    min-height: 126px;
    padding: 1.15rem 1.2rem;
    overflow: hidden;
}

.user-stat-card::after {
    position: absolute;
    right: -22px;
    bottom: -42px;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(112, 218, 228, .15), rgba(65, 105, 245, .08));
    content: "";
}

.user-stat-label {
    position: relative;
    z-index: 1;
    margin-bottom: .6rem;
    color: var(--homstir-muted);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.4;
}

.user-stat-value {
    position: relative;
    z-index: 1;
    overflow-wrap: anywhere;
    color: var(--homstir-ink);
    font-size: clamp(1.55rem, 2.4vw, 2rem);
    font-weight: 800;
    letter-spacing: -.05em;
    line-height: 1.12;
}

.user-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(250px, .85fr);
    align-items: stretch;
    gap: 1rem;
    min-width: 0;
}

.user-content-column {
    display: grid;
    align-content: start;
    gap: 1rem;
    min-width: 0;
}

.user-panel {
    padding: clamp(1rem, 2vw, 1.4rem);
}

.user-panel h2,
.user-panel h3 {
    color: var(--homstir-ink);
    font-weight: 800;
    letter-spacing: -.025em;
}

.user-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    min-width: 0;
    margin-bottom: 1.1rem;
}

.user-panel-heading > * {
    min-width: 0;
}

.user-panel-heading small,
.user-panel .text-muted {
    color: var(--homstir-muted) !important;
}

.user-metric-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
    min-width: 0;
}

.user-metric-item {
    min-width: 0;
    padding: .9rem;
    border: 1px solid #e8eef7;
    border-radius: 14px;
    background: #f8faff;
}

.user-metric-item strong {
    display: block;
    margin-top: .2rem;
    overflow-wrap: anywhere;
    color: var(--homstir-ink);
    font-size: 1.25rem;
    font-weight: 800;
}

.user-connect-panel {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 100% 0%, rgba(111, 216, 228, .16), transparent 35%),
        #fff;
}

.user-connect-badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .4rem .7rem;
    border: 1px solid #c7f0e0;
    border-radius: 999px;
    color: #087b5b;
    background: #effcf6;
    font-size: .76rem;
    font-weight: 800;
}

.user-record-list {
    display: grid;
    gap: .7rem;
    min-width: 0;
}

.user-record-card {
    min-width: 0;
    padding: .95rem;
    border: 1px solid var(--homstir-line);
    border-radius: 14px;
    background: #fbfcff;
}

.user-record-card h3,
.user-record-card strong {
    display: block;
    margin: 0 0 .35rem;
    overflow-wrap: anywhere;
    color: var(--homstir-ink);
    font-size: .96rem;
    font-weight: 800;
}

.user-record-card p {
    margin: .25rem 0 0;
    overflow-wrap: anywhere;
    color: var(--homstir-muted);
    font-size: .82rem;
    line-height: 1.45;
}

.user-record-label {
    display: block;
    margin-top: .65rem;
    color: #8796ad;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.user-record-facts {
    display: grid;
    gap: .55rem;
    min-width: 0;
    margin-top: .65rem;
}

.user-record-fact {
    display: grid;
    gap: .12rem;
    min-width: 0;
    padding-top: .5rem;
    border-top: 1px solid #edf1f7;
}

.user-record-fact span {
    color: #8796ad;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.user-record-fact strong {
    overflow-wrap: anywhere;
    color: var(--homstir-ink);
    font-size: .88rem;
}

.user-connected-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
}

.user-connect-actions .btn {
    min-height: 48px;
    padding: .7rem 1rem;
    border-radius: 13px;
    font-weight: 800;
}

.user-table-wrap {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.user-table-wrap table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}

.user-table-wrap th,
.user-table-wrap td {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.user-mobile-data {
    display: none;
}

.connection-value {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: .8rem;
    overflow-wrap: anywhere;
    word-break: break-word;
    border: 1px solid #dce6f3;
    border-radius: 12px;
    color: #28466f;
    background: #f6f9ff;
}

.user-app .btn,
.auth-page .btn {
    max-width: 100%;
    white-space: normal;
}

.user-app .alert,
.user-app p,
.user-app h1,
.user-app h2,
.user-app h3 {
    overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
    .user-sidebar {
        flex-basis: 232px;
        width: 232px;
    }

    .user-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .user-app-shell {
        display: block;
    }

    .user-sidebar {
        position: sticky;
        z-index: 40;
        top: 0;
        width: 100%;
        padding: .75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
    }

    .user-sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .8rem;
        margin: 0;
    }

    .user-sidebar-caption,
    .user-sidebar > .user-nav {
        display: none;
    }

    .user-mobile-menu {
        position: relative;
        display: block;
        flex: 0 0 auto;
    }

    .user-mobile-menu > summary {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: .5rem;
        min-height: 42px;
        padding: .55rem .8rem;
        border: 1px solid rgba(255, 255, 255, .2);
        border-radius: 12px;
        color: #fff;
        background: rgba(255, 255, 255, .09);
        cursor: pointer;
        font-size: .83rem;
        font-weight: 700;
        list-style: none;
    }

    .user-mobile-menu > summary::-webkit-details-marker {
        display: none;
    }

    .user-mobile-menu > summary svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-width: 2;
    }

    .user-mobile-menu[open] > .user-nav {
        position: absolute;
        top: calc(100% + .75rem);
        right: 0;
        display: grid;
        width: min(88vw, 360px);
        max-height: calc(100dvh - 100px);
        padding: .85rem;
        overflow-y: auto;
        border: 1px solid rgba(255, 255, 255, .12);
        border-radius: 18px;
        background: #0f2240;
        box-shadow: 0 18px 45px rgba(7, 19, 40, .38);
    }

    .user-mobile-menu .user-nav-section:first-child {
        margin-top: .2rem;
    }

    .user-topbar {
        position: relative;
        min-height: 62px;
        padding: .65rem 1rem;
    }

    .user-content-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .user-desktop-data {
        display: none;
    }

    .user-mobile-data {
        display: grid;
    }
}

@media (max-width: 767.98px) {
    .user-topbar {
        gap: .5rem;
    }

    .user-account-name {
        max-width: 38vw;
        font-size: .8rem;
    }

    .user-topbar-actions {
        gap: .4rem;
    }

    .user-topbar-actions .btn {
        padding: .4rem .58rem;
        font-size: .74rem;
    }

    .user-content {
        padding: 1rem .85rem 1.5rem;
    }

    .user-page-heading {
        display: block;
        margin-bottom: 1rem;
    }

    .user-page-heading > a,
    .user-page-actions {
        margin-top: .85rem;
    }

    .user-page-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .user-page-actions .btn,
    .user-page-heading > a.btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 46px;
        margin-right: 0;
        margin-left: 0;
        border-radius: 13px;
    }

    .user-dashboard-hero {
        display: block;
        padding: 1.35rem;
        border-radius: 20px;
    }

    .user-dashboard-hero .user-page-actions {
        margin-top: 1.1rem;
    }

    .user-dashboard-hero::after {
        top: -90px;
        right: -68px;
        width: 185px;
        height: 185px;
    }

    .user-stats-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: .7rem;
    }

    .user-stat-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        min-height: 92px;
        padding: .95rem 1rem;
    }

    .user-stat-label {
        max-width: 65%;
        margin: 0;
    }

    .user-stat-value {
        flex: 0 1 auto;
        text-align: right;
        font-size: 1.5rem;
    }

    .user-panel {
        padding: 1rem;
        border-radius: 16px;
    }

    .user-panel-heading {
        align-items: flex-start;
    }

    .user-connected-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .user-connected-summary form,
    .user-connect-actions .btn {
        width: 100%;
    }

    .user-panel-heading .btn {
        flex: 0 0 auto;
        padding: .42rem .58rem;
    }

    .user-metric-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .user-topbar-actions form {
        display: inline-flex;
    }
}

@media (max-width: 380px) {
    .user-sidebar {
        padding-right: .7rem;
        padding-left: .7rem;
    }

    .user-brand {
        font-size: 1.18rem;
    }

    .user-brand-mark {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        border-radius: 11px;
    }

    .user-topbar {
        padding-right: .7rem;
        padding-left: .7rem;
    }

    .user-avatar {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
    }

    .user-account-name {
        max-width: 32vw;
    }

    .user-topbar-actions .btn {
        padding: .36rem .45rem;
        font-size: .7rem;
    }

    .user-content {
        padding-right: .7rem;
        padding-left: .7rem;
    }
}

/* Sign-in is part of the same mobile account experience. */
body.auth-page {
    min-height: 100vh;
    width: 100%;
    overflow-x: clip;
    background:
        radial-gradient(circle at 15% 8%, rgba(113, 212, 228, .2), transparent 27%),
        radial-gradient(circle at 95% 100%, rgba(65, 105, 245, .25), transparent 34%),
        linear-gradient(145deg, #10213e 0%, #173d71 53%, #eaf2fb 53%, #f6f8fc 100%) !important;
}

.auth-page .app-content,
.auth-page .content-wrapper,
.auth-page .content-body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

#auth-login {
    min-height: calc(100vh - 88px);
    width: 100%;
    margin: 0;
    padding: clamp(1rem, 6vw, 3rem) .75rem;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    overflow: hidden;
    border: 1px solid rgba(226, 234, 246, .9);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(9, 25, 54, .22);
}

.auth-brand {
    color: var(--homstir-ink);
    font-size: 1.85rem;
    font-weight: 900;
    letter-spacing: -.05em;
}

.auth-brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
}

.auth-card .btn-login {
    width: 100%;
    min-height: 48px;
    border-radius: 13px;
    font-weight: 800;
}

.auth-card input.form-control {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    border-radius: 12px;
}

.auth-footer {
    color: #687b98;
    font-size: .82rem;
    padding: 1rem;
    text-align: center;
}

.field-error {
    display: block;
    margin-top: .35rem;
    color: #b42318;
    font-size: .84rem;
}

@media (max-width: 480px) {
    #auth-login {
        min-height: calc(100dvh - 70px);
        padding: 1rem .55rem;
    }

    #auth-login > div {
        width: 100%;
        max-width: 440px;
        padding-right: .35rem;
        padding-left: .35rem;
    }

    .auth-card .card-body {
        padding: 1.3rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

.user-nav-group {
    min-width: 0;
}

.user-nav-group > summary {
    display: flex;
    align-items: center;
    gap: .72rem;
    min-width: 0;
    min-height: 44px;
    padding: .62rem .7rem;
    border: 1px solid transparent;
    border-radius: 13px;
    color: rgba(239, 244, 255, .8);
    cursor: pointer;
    font-size: .87rem;
    font-weight: 600;
    line-height: 1.25;
    list-style: none;
    transition: color .18s ease, background .18s ease, border-color .18s ease;
}

.user-nav-group > summary::-webkit-details-marker {
    display: none;
}

.user-nav-group > summary:hover {
    border-color: rgba(255, 255, 255, .1);
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.user-nav-group > summary.active {
    border-color: rgba(255, 255, 255, .15);
    color: #fff;
    background: linear-gradient(110deg, #496ff2, #3659d8);
    box-shadow: 0 8px 18px rgba(27, 59, 165, .3);
}

.user-nav-group > summary > span {
    flex: 1 1 auto;
    min-width: 0;
}

.user-nav-group > summary .user-nav-chevron {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    transition: transform .18s ease;
}

.user-nav-group[open] > summary .user-nav-chevron {
    transform: rotate(180deg);
}

.user-nav-subitems {
    display: grid;
    gap: .2rem;
    margin: .2rem .3rem .45rem 1.75rem;
    padding-left: .7rem;
    border-left: 1px solid rgba(223, 234, 255, .25);
}

.user-nav .user-nav-subitems a {
    min-height: 38px;
    padding: .45rem .65rem;
    border-radius: 10px;
    font-size: .82rem;
}

.user-template-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, .9fr);
    gap: 1.25rem;
    align-items: center;
    min-width: 0;
    margin: 1.15rem 0;
    padding: clamp(1rem, 2.5vw, 1.6rem);
    border: 1px solid var(--homstir-line);
    border-radius: 20px;
    background: var(--homstir-surface);
    box-shadow: var(--homstir-shadow);
}

.user-template-entry-copy,
.user-template-entry-links {
    min-width: 0;
}

.user-template-entry-copy .eyebrow {
    margin-bottom: .35rem;
    color: var(--homstir-blue);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.user-template-entry-copy h2 {
    margin: 0 0 .4rem;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 800;
}

.user-template-entry-copy p {
    margin: 0;
    color: var(--homstir-muted);
}

.user-template-entry-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.user-template-entry-links a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    min-height: 76px;
    padding: .85rem;
    border: 1px solid var(--homstir-line);
    border-radius: 14px;
    color: var(--homstir-ink);
    background: #f8faff;
    text-decoration: none;
}

.user-template-entry-links a:hover {
    border-color: #aebfff;
    background: #f0f4ff;
}

.user-template-entry-links a > span:first-child {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

.user-template-entry-links strong {
    font-size: .92rem;
}

.user-template-entry-links small {
    color: var(--homstir-muted);
    font-size: .77rem;
}

.user-template-hero {
    align-items: center;
}

.user-template-hero-count {
    display: grid;
    justify-items: center;
    min-width: 120px;
    padding: .85rem 1rem;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 16px;
    background: rgba(10, 28, 62, .18);
}

.user-template-hero-count strong {
    font-size: 1.7rem;
    line-height: 1.1;
}

.user-template-hero-count span {
    margin-top: .25rem;
    color: rgba(255, 255, 255, .78);
    font-size: .78rem;
    text-align: center;
}

.user-template-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin: 1.1rem 0;
}

.user-template-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: .6rem 1rem;
    border: 1px solid var(--homstir-line);
    border-radius: 12px;
    color: var(--homstir-ink);
    background: #fff;
    font-weight: 700;
    text-decoration: none;
}

.user-template-tabs a.active {
    border-color: var(--homstir-blue);
    color: #fff;
    background: var(--homstir-blue);
}

.user-template-library {
    min-width: 0;
}

.user-template-filters {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(170px, .7fr) auto auto;
    gap: .7rem;
    align-items: end;
    margin-bottom: 1.1rem;
}

.user-template-filters label {
    display: grid;
    gap: .35rem;
    min-width: 0;
    color: var(--homstir-muted);
    font-size: .78rem;
    font-weight: 700;
}

.user-template-filters input,
.user-template-filters select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: .6rem .72rem;
    border: 1px solid var(--homstir-line);
    border-radius: 10px;
    color: var(--homstir-ink);
    background: #fff;
    font: inherit;
}

.user-template-reset {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: .5rem .4rem;
    color: var(--homstir-blue-dark);
    font-weight: 700;
    text-decoration: none;
}

.user-template-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    min-width: 0;
}

.user-template-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--homstir-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(18, 37, 72, .05);
    transition: transform .18s ease, box-shadow .18s ease;
}

.user-template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(18, 37, 72, .1);
}

.user-template-card-image {
    display: grid;
    aspect-ratio: 1.45;
    place-items: center;
    overflow: hidden;
    color: var(--homstir-muted);
    background: #edf2fa;
    text-decoration: none;
}

.user-template-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-template-no-image {
    display: grid;
    min-height: 180px;
    place-items: center;
    padding: 1rem;
    color: var(--homstir-muted);
    background: #edf2fa;
    text-align: center;
}

.user-template-card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .55rem;
    min-width: 0;
    padding: 1rem;
}

.user-template-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    min-width: 0;
}

.user-template-card-meta span {
    max-width: 100%;
    padding: .25rem .55rem;
    overflow-wrap: anywhere;
    border-radius: 999px;
    color: #3154c6;
    background: #edf2ff;
    font-size: .69rem;
    font-weight: 800;
}

.user-template-card h2 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 1.05rem;
    font-weight: 800;
}

.user-template-card p {
    margin: 0;
    color: var(--homstir-muted);
    font-size: .87rem;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.user-template-card .user-template-card-headline {
    color: var(--homstir-ink);
    font-weight: 700;
}

.user-template-preview-link {
    display: inline-flex;
    gap: .45rem;
    align-items: center;
    margin-top: auto;
    padding-top: .25rem;
    color: var(--homstir-blue-dark);
    font-size: .86rem;
    font-weight: 800;
    text-decoration: none;
}

.user-template-empty {
    display: grid;
    justify-items: start;
    gap: .6rem;
    padding: clamp(1.2rem, 4vw, 2.5rem);
    border: 1px dashed #cbd6e7;
    border-radius: 16px;
    background: #f8faff;
}

.user-template-empty h2,
.user-template-empty p {
    margin: 0;
}

.user-template-empty p {
    color: var(--homstir-muted);
}

.user-template-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .8rem;
    margin-top: 1.2rem;
    color: var(--homstir-muted);
    font-size: .86rem;
}

.user-template-pagination a,
.user-template-pagination span[aria-disabled="true"] {
    padding: .5rem .75rem;
    border: 1px solid var(--homstir-line);
    border-radius: 10px;
    color: var(--homstir-blue-dark);
    background: #fff;
    font-weight: 700;
    text-decoration: none;
}

.user-template-pagination span[aria-disabled="true"] {
    color: #96a2b5;
}

.user-template-phase-note {
    margin: .9rem 0 0;
    padding: .8rem 1rem;
    border: 1px solid #dce6f5;
    border-radius: 12px;
    color: #526985;
    background: #f3f7fd;
    font-size: .84rem;
}

.user-template-back-row {
    margin: 0 0 .9rem;
}

.user-template-back-link {
    color: var(--homstir-blue-dark);
    font-weight: 700;
    text-decoration: none;
}

.user-template-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: clamp(1rem, 3vw, 2rem);
    min-width: 0;
    padding: clamp(1rem, 3vw, 1.8rem);
}

.user-template-detail-art,
.user-template-detail-copy {
    min-width: 0;
}

.user-template-detail-art {
    overflow: hidden;
    border-radius: 14px;
    background: #edf2fa;
}

.user-template-detail-art img {
    display: block;
    width: 100%;
    max-height: 720px;
    object-fit: contain;
}

.user-template-detail-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .9rem;
}

.user-template-detail-copy h1 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 850;
}

.user-template-detail-field {
    display: grid;
    gap: .3rem;
    width: 100%;
    min-width: 0;
}

.user-template-detail-field > span {
    color: var(--homstir-muted);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.user-template-detail-field strong,
.user-template-detail-field p,
.user-template-copy {
    margin: 0;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.user-template-detail .user-template-phase-note {
    align-self: stretch;
}

@media (max-width: 900px) {
    .user-template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-template-filters {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .user-template-detail {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 620px) {
    .user-template-entry {
        grid-template-columns: minmax(0, 1fr);
    }

    .user-template-entry-links {
        grid-template-columns: minmax(0, 1fr);
    }

    .user-template-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-template-hero-count {
        align-self: flex-start;
        justify-items: start;
        min-width: 0;
    }

    .user-template-filters {
        grid-template-columns: minmax(0, 1fr);
    }

    .user-template-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.lead-page-heading {
    align-items: flex-end;
    gap: 1.25rem;
}

.lead-page-heading > div:first-child {
    min-width: 0;
}

.lead-page-heading p {
    max-width: 58rem;
}

.lead-list-panel,
.lead-detail-grid,
.lead-detail-grid > *,
.lead-detail-grid .user-panel {
    min-width: 0;
}

.lead-list-count {
    color: var(--homstir-muted);
    font-size: .82rem;
    font-weight: 700;
}

.lead-filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
    align-items: end;
    margin: 0 0 1.15rem;
    padding: 1rem;
    border: 1px solid var(--homstir-line);
    border-radius: 15px;
    background: #f8faff;
}

.lead-filter-form label,
.lead-edit-form label {
    display: grid;
    min-width: 0;
    gap: .35rem;
    margin: 0;
    color: #586b86;
    font-size: .76rem;
    font-weight: 750;
}

.lead-filter-form input,
.lead-filter-form select,
.lead-edit-form input,
.lead-stage-controls select,
.lead-note-form textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.lead-filter-search {
    grid-column: span 2;
}

.lead-filter-checkbox {
    display: flex !important;
    min-height: 40px;
    align-items: center;
    gap: .55rem !important;
    color: var(--homstir-ink) !important;
}

.lead-filter-checkbox input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.lead-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.lead-desktop-table,
.lead-desktop-table .user-table-wrap {
    min-width: 0;
    max-width: 100%;
}

.lead-table {
    table-layout: fixed;
}

.lead-table th,
.lead-table td {
    overflow-wrap: anywhere;
    vertical-align: middle;
}

.lead-table th {
    color: #71829b;
    font-size: .68rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.lead-name-link {
    display: block;
    color: var(--homstir-ink);
    font-weight: 800;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.lead-name-link:hover {
    color: var(--homstir-blue-dark);
    text-decoration: underline;
}

.lead-contact-line {
    display: block;
    max-width: 100%;
    margin-top: .22rem;
    color: var(--homstir-muted);
    font-size: .82rem;
    overflow-wrap: anywhere;
}

.lead-status-badge {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    margin: .1rem .15rem .1rem 0;
    padding: .28rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 750;
    line-height: 1.3;
}

.lead-status-badge.is-success {
    color: #136c4b;
    background: #e3f7ed;
}

.lead-status-badge.is-muted {
    color: #64748b;
    background: #eef2f7;
}

.lead-status-badge.is-warning {
    color: #8a4d0b;
    background: #fff0d7;
}

.lead-empty-cell {
    padding: 2.5rem 1rem !important;
    color: var(--homstir-muted);
    text-align: center;
}

.lead-mobile-cards {
    display: none;
}

.lead-mobile-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--homstir-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(18, 37, 72, .045);
}

.lead-mobile-card-top {
    display: flex;
    min-width: 0;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
}

.lead-mobile-card-top > div {
    min-width: 0;
}

.lead-mobile-kicker {
    display: block;
    margin-bottom: .25rem;
    color: var(--homstir-muted);
    font-size: .72rem;
    font-weight: 750;
    text-transform: uppercase;
}

.lead-appointment-time {
    display: block;
    margin-bottom: .45rem;
    color: var(--homstir-blue-dark);
    font-size: .88rem;
}

.lead-mobile-meta,
.lead-answer-list {
    display: grid;
    gap: .7rem;
    margin: .9rem 0 0;
}

.lead-mobile-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lead-mobile-meta > div,
.lead-answer-list > div {
    min-width: 0;
    padding-top: .65rem;
    border-top: 1px solid var(--homstir-line);
}

.lead-mobile-meta dt,
.lead-answer-list dt {
    margin: 0 0 .2rem;
    color: var(--homstir-muted);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.lead-mobile-meta dd,
.lead-answer-list dd {
    margin: 0;
    color: var(--homstir-ink);
    font-size: .86rem;
    overflow-wrap: anywhere;
}

.lead-pagination {
    margin-top: 1rem;
}

.lead-edit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.lead-edit-form .lead-edit-wide {
    grid-column: 1 / -1;
}

.lead-edit-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    padding-top: .35rem;
}

.lead-answer-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lead-stage-form > label {
    display: block;
    margin-bottom: .4rem;
    color: var(--homstir-muted);
    font-size: .76rem;
    font-weight: 750;
}

.lead-stage-controls {
    display: flex;
    min-width: 0;
    gap: .55rem;
}

.lead-stage-controls .btn {
    flex: 0 0 auto;
}

.lead-stage-history {
    display: grid;
    gap: .45rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.lead-stage-history li,
.lead-note-meta {
    display: flex;
    min-width: 0;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
}

.lead-stage-history li {
    padding-top: .55rem;
    border-top: 1px solid var(--homstir-line);
    color: var(--homstir-ink);
    font-size: .84rem;
}

.lead-stage-history strong {
    margin-left: .3rem;
    color: #16734f;
    font-size: .7rem;
}

.lead-stage-history time,
.lead-note-meta time {
    color: var(--homstir-muted);
    font-size: .75rem;
    white-space: nowrap;
}

.lead-note-form {
    display: grid;
    gap: .6rem;
}

.lead-note-form .btn {
    justify-self: start;
}

.lead-notes-list {
    display: grid;
    gap: .7rem;
    margin-top: 1rem;
}

.lead-note-card {
    min-width: 0;
    padding: .85rem;
    border: 1px solid var(--homstir-line);
    border-radius: 13px;
    background: #f8faff;
}

.lead-note-card p {
    margin: 0 0 .55rem;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.lead-note-meta {
    align-items: center;
}

.lead-note-meta form {
    margin: 0;
}

.lead-safety-panel {
    border-color: #f0e3d6;
}

@media (max-width: 900px) {
    .lead-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .lead-page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .lead-page-heading .user-page-actions {
        width: 100%;
    }

    .lead-filter-form {
        grid-template-columns: minmax(0, 1fr);
        padding: .85rem;
    }

    .lead-filter-search {
        grid-column: auto;
    }

    .lead-filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .lead-filter-actions .btn {
        width: 100%;
    }

    .lead-desktop-table {
        display: none;
    }

    .lead-mobile-cards {
        display: grid;
        gap: .7rem;
    }

    .lead-mobile-card-top .btn {
        flex: 0 0 auto;
    }

    .lead-edit-form,
    .lead-answer-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .lead-edit-form .lead-edit-wide,
    .lead-edit-actions {
        grid-column: auto;
    }

    .lead-edit-actions .btn,
    .lead-stage-controls .btn {
        width: 100%;
    }

    .lead-stage-controls {
        flex-direction: column;
    }

    .lead-detail-grid .user-panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .lead-detail-grid .lead-list-count {
        align-self: flex-start;
    }

    .lead-detail-grid,
    .lead-detail-grid > *,
    .lead-detail-grid .user-content-column {
        width: 100%;
        max-width: 100%;
    }

    .lead-safety-panel form .btn {
        max-width: 100%;
        white-space: normal;
    }
}

@media (max-width: 380px) {
    .lead-mobile-meta {
        grid-template-columns: minmax(0, 1fr);
    }

    .lead-mobile-card-top {
        flex-direction: column;
    }

    .lead-mobile-card-top .btn {
        align-self: flex-start;
    }
}
