:root {
    --cwvl-navy: #0b2a66;
    --cwvl-blue: #2578ff;
    --cwvl-blue-deep: #3152d9;
    --cwvl-purple: #7447e8;
    --cwvl-pink: #ec4fa5;
    --cwvl-turquoise: #2ccdc7;
    --cwvl-ink: #16213b;
    --cwvl-muted: #63708d;
    --cwvl-border: #dbe3f3;
    --cwvl-soft: #f5f7ff;
    --cwvl-white: #ffffff;
    --cwvl-danger: #b42318;
    --cwvl-success: #176b4d;
    --cwvl-shadow: 0 18px 55px rgba(40, 56, 120, .14);
}

.cwvl-shell,
.cwvl-shell * {
    box-sizing: border-box;
}

.cwvl-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 36px auto;
    color: var(--cwvl-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cwvl-hero,
.cwvl-group-header,
.cwvl-profile-card,
.cwvl-message-panel,
.cwvl-report-shell .cwvl-form {
    background: var(--cwvl-white);
    border: 1px solid var(--cwvl-border);
    border-radius: 28px;
    box-shadow: var(--cwvl-shadow);
}

.cwvl-hero,
.cwvl-group-header {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 5vw, 54px);
    margin-bottom: 24px;
}

.cwvl-hero::before,
.cwvl-group-header::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 92% 12%, rgba(236, 79, 165, .18), transparent 28%),
        radial-gradient(circle at 78% 86%, rgba(44, 205, 199, .18), transparent 34%),
        linear-gradient(135deg, rgba(37, 120, 255, .08), rgba(116, 71, 232, .07));
}

.cwvl-hero > *,
.cwvl-group-header > * {
    position: relative;
    z-index: 1;
}

.cwvl-hero-row,
.cwvl-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.cwvl-kicker {
    display: block;
    margin-bottom: 10px;
    color: var(--cwvl-blue-deep);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.cwvl-shell h2,
.cwvl-shell h3,
.cwvl-chat-app h2 {
    margin-top: 0;
    color: var(--cwvl-navy);
    line-height: 1.12;
}

.cwvl-shell h2,
.cwvl-chat-app h2 {
    margin-bottom: 14px;
    font-size: clamp(30px, 5vw, 52px);
    letter-spacing: -.035em;
}

.cwvl-shell h3 {
    margin-bottom: 10px;
    font-size: 22px;
}

.cwvl-shell p {
    color: var(--cwvl-muted);
    line-height: 1.7;
}

.cwvl-safety-card {
    margin: 0 0 22px;
    padding: 18px 20px;
    color: #5e3a00;
    background: #fff8e8;
    border: 1px solid #f2d696;
    border-left: 5px solid #df9e14;
    border-radius: 18px;
    line-height: 1.6;
}

.cwvl-report-shell .cwvl-form,
.cwvl-message-panel {
    padding: clamp(22px, 4vw, 38px);
}

.cwvl-form {
    display: grid;
    gap: 18px;
}

.cwvl-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.cwvl-field {
    display: grid;
    gap: 8px;
    color: var(--cwvl-navy);
    font-weight: 700;
}

.cwvl-field span b {
    color: var(--cwvl-pink);
}

.cwvl-field input,
.cwvl-field select,
.cwvl-field textarea,
.cwvl-chat-form input,
.cwvl-chat-form textarea {
    width: 100%;
    min-height: 50px;
    padding: 13px 15px;
    color: var(--cwvl-ink) !important;
    background: var(--cwvl-white) !important;
    border: 1px solid #cbd6ed;
    border-radius: 14px;
    outline: none;
    font: inherit;
    font-weight: 500;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.cwvl-field textarea,
.cwvl-chat-form textarea {
    min-height: 110px;
    resize: vertical;
}

.cwvl-field input:focus,
.cwvl-field select:focus,
.cwvl-field textarea:focus,
.cwvl-chat-form input:focus,
.cwvl-chat-form textarea:focus {
    border-color: var(--cwvl-blue);
    box-shadow: 0 0 0 4px rgba(37, 120, 255, .12);
}

.cwvl-check {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    color: var(--cwvl-ink);
    line-height: 1.55;
}

.cwvl-check input {
    width: 19px;
    height: 19px;
    margin-top: 3px;
    accent-color: var(--cwvl-blue-deep);
    flex: 0 0 auto;
}

.cwvl-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: 0;
    border-radius: 14px;
    font: inherit;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.cwvl-button:hover,
.cwvl-button:focus-visible {
    transform: translateY(-1px);
}

.cwvl-primary {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--cwvl-blue), var(--cwvl-purple) 58%, var(--cwvl-pink));
    box-shadow: 0 12px 28px rgba(70, 88, 220, .26);
}

.cwvl-secondary {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--cwvl-navy), var(--cwvl-blue-deep));
}

.cwvl-ghost {
    color: var(--cwvl-navy) !important;
    background: #eef3ff;
    border: 1px solid #d1dcf4;
}

.cwvl-notice {
    margin: 0 0 20px;
    padding: 16px 18px;
    border-radius: 16px;
    font-weight: 700;
}

.cwvl-success {
    color: #0d5c40;
    background: #eafaf3;
    border: 1px solid #8fd7b8;
}

.cwvl-error {
    color: #8d1a15;
    background: #fff1f0;
    border: 1px solid #f0aaa5;
}

.cwvl-card-grid,
.cwvl-member-grid,
.cwvl-state-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.cwvl-group-card,
.cwvl-member-card,
.cwvl-state-button,
.cwvl-empty {
    background: var(--cwvl-white);
    border: 1px solid var(--cwvl-border);
    border-radius: 22px;
    box-shadow: 0 12px 35px rgba(40, 56, 120, .09);
}

.cwvl-group-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
}

.cwvl-group-card::after {
    content: "";
    position: absolute;
    right: -34px;
    bottom: -44px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(44, 205, 199, .18), rgba(236, 79, 165, .14));
}

.cwvl-group-card > * {
    position: relative;
    z-index: 1;
}

.cwvl-state-pill {
    display: inline-flex;
    margin-bottom: 16px;
    padding: 7px 11px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cwvl-turquoise), var(--cwvl-blue));
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
}

.cwvl-member-card {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 22px;
}

.cwvl-member-card-body {
    min-width: 0;
    flex: 1;
}

.cwvl-avatar {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(145deg, var(--cwvl-blue), var(--cwvl-purple), var(--cwvl-pink));
    border: 4px solid #ffffff;
    border-radius: 19px;
    box-shadow: 0 10px 24px rgba(85, 72, 216, .25);
    font-size: 24px;
    font-weight: 900;
}

.cwvl-avatar-large {
    width: 90px;
    height: 90px;
    flex-basis: 90px;
    border-radius: 26px;
    font-size: 38px;
}

.cwvl-location {
    margin-top: -4px;
    color: var(--cwvl-blue-deep) !important;
    font-weight: 800;
}

.cwvl-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.cwvl-back {
    display: inline-flex;
    margin-bottom: 18px;
    color: var(--cwvl-blue-deep) !important;
    font-weight: 800;
    text-decoration: none !important;
}

.cwvl-profile-card {
    padding: clamp(24px, 5vw, 48px);
}

.cwvl-profile-top {
    display: flex;
    align-items: center;
    gap: 22px;
}

.cwvl-profile-bio {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--cwvl-border);
}

.cwvl-message-panel {
    margin-top: 24px;
}

.cwvl-empty {
    grid-column: 1 / -1;
    padding: 38px;
    text-align: center;
}

.cwvl-state-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cwvl-state-button {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px;
    color: var(--cwvl-ink);
    text-align: left;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.cwvl-state-button:hover,
.cwvl-state-button:focus-visible {
    transform: translateY(-2px);
    border-color: var(--cwvl-blue);
    box-shadow: 0 16px 34px rgba(40, 56, 120, .14);
}

.cwvl-state-button strong {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cwvl-blue), var(--cwvl-purple));
    border-radius: 14px;
}

.cwvl-state-button span {
    color: var(--cwvl-navy);
    font-weight: 800;
}

.cwvl-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

body.cwvl-chat-open {
    overflow: hidden !important;
}

.cwvl-chat-modal {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: none;
    background: #eef3ff;
}

.cwvl-chat-modal.is-open {
    display: block;
}

.cwvl-chat-app {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    width: 100%;
    height: 100dvh;
    color: var(--cwvl-ink);
    background:
        radial-gradient(circle at 12% 0, rgba(44, 205, 199, .13), transparent 26%),
        radial-gradient(circle at 90% 5%, rgba(236, 79, 165, .12), transparent 24%),
        #f7f9ff;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cwvl-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px clamp(18px, 4vw, 42px);
    color: #ffffff;
    background: linear-gradient(120deg, var(--cwvl-navy), var(--cwvl-blue-deep) 48%, var(--cwvl-purple));
    box-shadow: 0 12px 30px rgba(35, 48, 112, .24);
}

.cwvl-chat-header .cwvl-kicker,
.cwvl-chat-header h2 {
    color: #ffffff;
}

.cwvl-chat-header h2 {
    margin: 0;
    font-size: clamp(25px, 4vw, 38px);
}

.cwvl-chat-close {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    color: var(--cwvl-navy);
    background: #ffffff;
    border: 0;
    border-radius: 16px;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

.cwvl-chat-guidance {
    padding: 11px clamp(18px, 4vw, 42px);
    color: #654600;
    background: #fff5d9;
    border-bottom: 1px solid #ecd48f;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.cwvl-chat-messages {
    overflow-y: auto;
    padding: 22px clamp(16px, 4vw, 42px);
    scroll-behavior: smooth;
}

.cwvl-chat-loading,
.cwvl-chat-empty {
    padding: 30px;
    color: var(--cwvl-muted);
    text-align: center;
}

.cwvl-chat-message {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 13px;
    max-width: 920px;
    margin: 0 auto 14px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--cwvl-border);
    border-radius: 19px;
    box-shadow: 0 9px 25px rgba(39, 55, 117, .07);
}

.cwvl-chat-avatar {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(145deg, var(--cwvl-blue), var(--cwvl-purple), var(--cwvl-pink));
    border-radius: 14px;
    font-weight: 900;
}

.cwvl-chat-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.cwvl-chat-meta a {
    color: var(--cwvl-navy) !important;
    font-weight: 900;
    text-decoration: none !important;
}

.cwvl-chat-meta time {
    color: var(--cwvl-muted);
    font-size: 12px;
}

.cwvl-chat-text {
    color: var(--cwvl-ink);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.cwvl-chat-form {
    padding: 14px clamp(16px, 4vw, 42px) max(14px, env(safe-area-inset-bottom));
    background: #ffffff;
    border-top: 1px solid var(--cwvl-border);
    box-shadow: 0 -12px 30px rgba(40, 56, 120, .08);
}

.cwvl-chat-identify,
.cwvl-chat-compose {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 1050px;
    margin: 0 auto 10px;
}

.cwvl-chat-compose {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 0;
}

.cwvl-chat-form textarea {
    min-height: 54px;
    max-height: 130px;
}

.cwvl-chat-status {
    min-height: 18px;
    max-width: 1050px;
    margin: 8px auto 0;
    color: var(--cwvl-muted);
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 960px) {
    .cwvl-card-grid,
    .cwvl-member-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cwvl-state-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .cwvl-shell {
        width: min(100% - 20px, 1180px);
        margin: 18px auto;
    }

    .cwvl-hero,
    .cwvl-group-header,
    .cwvl-profile-card,
    .cwvl-message-panel,
    .cwvl-report-shell .cwvl-form {
        border-radius: 20px;
    }

    .cwvl-hero-row,
    .cwvl-group-header,
    .cwvl-profile-top {
        align-items: stretch;
        flex-direction: column;
    }

    .cwvl-grid-2,
    .cwvl-card-grid,
    .cwvl-member-grid,
    .cwvl-state-grid {
        grid-template-columns: 1fr;
    }

    .cwvl-member-card {
        flex-direction: column;
    }

    .cwvl-chat-header {
        padding: 13px 14px;
    }

    .cwvl-chat-header h2 {
        font-size: 24px;
    }

    .cwvl-chat-guidance {
        max-height: 68px;
        overflow-y: auto;
        padding: 8px 14px;
        font-size: 11px;
    }

    .cwvl-chat-messages {
        padding: 12px 10px;
    }

    .cwvl-chat-message {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 10px;
        padding: 12px;
        border-radius: 16px;
    }

    .cwvl-chat-avatar {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .cwvl-chat-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .cwvl-chat-form {
        padding: 10px 10px max(10px, env(safe-area-inset-bottom));
    }

    .cwvl-chat-identify {
        grid-template-columns: 1fr 1fr;
    }

    .cwvl-chat-compose {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .cwvl-chat-compose .cwvl-button {
        min-width: 72px;
        padding-inline: 13px;
    }
}

@media (max-width: 470px) {
    .cwvl-chat-identify {
        grid-template-columns: 1fr;
    }

    .cwvl-chat-form input {
        min-height: 42px;
        padding: 9px 11px;
    }
}

.cwvl-group-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.cwvl-group-stats span {
    display: grid;
    gap: 2px;
    padding: 12px;
    color: var(--cwvl-muted);
    background: #f4f7ff;
    border: 1px solid #dce5f7;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.25;
}

.cwvl-group-stats b {
    color: var(--cwvl-navy);
    font-size: 22px;
}

.cwvl-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.cwvl-category-list span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    color: #30426d;
    background: #eef4ff;
    border: 1px solid #d7e3f7;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.cwvl-category-list span:nth-child(3n + 2) {
    background: #f6efff;
    border-color: #e1d1f6;
}

.cwvl-category-list span:nth-child(3n + 3) {
    background: #eafbf9;
    border-color: #bfe9e5;
}

.cwvl-hotzone-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
    gap: 24px;
    align-items: center;
    margin: 0 0 24px;
    padding: clamp(22px, 4vw, 34px);
    background: #ffffff;
    border: 1px solid var(--cwvl-border);
    border-left: 6px solid var(--cwvl-turquoise);
    border-radius: 22px;
    box-shadow: 0 12px 35px rgba(40, 56, 120, .09);
}

.cwvl-hotzone-summary h3 {
    margin-bottom: 8px;
}

.cwvl-hotzone-summary p {
    margin-bottom: 0;
}

.cwvl-category-list-large {
    justify-content: flex-end;
    margin: 0;
}

.cwvl-category-list-large span {
    padding: 10px 13px;
    font-size: 13px;
}

.cwvl-category-list-large b {
    display: inline-grid;
    min-width: 24px;
    min-height: 24px;
    place-items: center;
    color: #ffffff;
    background: var(--cwvl-blue-deep);
    border-radius: 999px;
    font-size: 12px;
}

@media (max-width: 720px) {
    .cwvl-hotzone-summary {
        grid-template-columns: 1fr;
    }

    .cwvl-category-list-large {
        justify-content: flex-start;
    }
}
