:root {
    color-scheme: dark;
    --gb-ink: #f7fbff;
    --gb-muted: #aab7d4;
    --gb-line: rgba(128, 222, 255, 0.2);
    --gb-bg: #08091e;
    --gb-panel: rgba(9, 14, 34, 0.86);
    --gb-panel-strong: rgba(12, 20, 48, 0.96);
    --gb-field: rgba(255, 255, 255, 0.07);
    --gb-green: #28a745;
    --gb-mint: #34e89e;
    --gb-cyan: #68b6ff;
    --gb-purple: #b784ff;
    --gb-aqua: #00ffd1;
    --gb-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, Montserrat, Arial, sans-serif;
    color: var(--gb-ink);
    background:
        linear-gradient(rgba(104, 182, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(104, 182, 255, 0.05) 1px, transparent 1px),
        linear-gradient(135deg, #050712 0%, #08091e 44%, #10162d 100%);
    background-size: 34px 34px, 34px 34px, auto;
}

.gb-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.gb-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, transparent 0%, rgba(52, 232, 158, 0.08) 44%, transparent 58%),
        linear-gradient(245deg, transparent 0%, rgba(183, 132, 255, 0.08) 48%, transparent 64%);
    opacity: 0.8;
}

.gb-chat-panel {
    position: relative;
    z-index: 1;
    width: min(940px, 100%);
    height: min(760px, calc(100vh - 48px));
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035)), var(--gb-panel);
    border: 1px solid var(--gb-line);
    border-radius: 8px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    box-shadow: var(--gb-shadow), 0 0 42px rgba(52, 232, 158, 0.08);
    overflow: hidden;
    backdrop-filter: blur(18px) saturate(125%);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
}

.gb-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--gb-line);
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.16), rgba(104, 182, 255, 0.1), rgba(183, 132, 255, 0.1));
}

.gb-brand-lockup {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.gb-mark {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 0 26px rgba(52, 232, 158, 0.2);
}

.gb-mark img {
    width: 34px;
    height: 34px;
    display: block;
}

.gb-kicker {
    margin: 0 0 4px;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--gb-mint);
    font-weight: 700;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(26px, 3vw, 40px);
    line-height: 1.1;
    background: linear-gradient(90deg, #ffffff, var(--gb-mint) 48%, var(--gb-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gb-admin-link,
.gb-chat-form button,
.gb-admin button,
.gb-button {
    border: 0;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--gb-green), var(--gb-mint) 52%, var(--gb-cyan));
    color: #061419;
    font-weight: 700;
    text-decoration: none;
    padding: 10px 14px;
    cursor: pointer;
    box-shadow: 0 0 22px rgba(52, 232, 158, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.gb-admin-link:hover,
.gb-chat-form button:hover,
.gb-admin button:hover,
.gb-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(52, 232, 158, 0.32);
}

.gb-messages {
    overflow-y: auto;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gb-message {
    width: min(680px, 92%);
    border: 1px solid var(--gb-line);
    border-radius: 8px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.075);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.gb-message-user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.32), rgba(52, 232, 158, 0.16));
    border-color: rgba(52, 232, 158, 0.42);
}

.gb-message-bot {
    align-self: flex-start;
    border-color: rgba(104, 182, 255, 0.26);
}

.gb-message p {
    margin: 6px 0 0;
    line-height: 1.55;
    white-space: pre-line;
}

.gb-sources {
    margin: 10px 0 0;
    padding-left: 18px;
    font-size: 13px;
}

.gb-sources a,
.gb-table a {
    color: var(--gb-aqua);
}

.gb-link-previews {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.gb-link-card {
    min-height: 92px;
    display: grid;
    grid-template-columns: 92px 1fr;
    overflow: hidden;
    color: var(--gb-ink);
    text-decoration: none;
    border: 1px solid rgba(52, 232, 158, 0.26);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(104,182,255,0.06));
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.gb-link-card:hover {
    transform: translateY(-1px);
    border-color: rgba(52, 232, 158, 0.54);
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.18), rgba(104,182,255,0.1));
}

.gb-link-image {
    min-height: 92px;
    background:
        linear-gradient(135deg, rgba(40, 167, 69, 0.26), rgba(104,182,255,0.18)),
        rgba(255, 255, 255, 0.08);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 54px 54px, cover;
    border-right: 1px solid rgba(128, 222, 255, 0.18);
}

.gb-link-body {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 11px 13px;
}

.gb-link-site,
.gb-link-snippet {
    display: block;
    color: var(--gb-muted);
    font-size: 12px;
    line-height: 1.35;
}

.gb-link-body strong {
    overflow: hidden;
    color: var(--gb-ink);
    font-size: 15px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gb-link-snippet {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gb-quick-questions {
    width: min(680px, 92%);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-self: flex-start;
    padding: 2px 0 8px;
}

.gb-quick-questions span {
    width: 100%;
    color: var(--gb-muted);
    font-size: 12px;
    font-weight: 700;
}

.gb-quick-questions button {
    border: 1px solid rgba(52, 232, 158, 0.28);
    border-radius: 999px;
    padding: 9px 12px;
    color: var(--gb-ink);
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.18), rgba(104, 182, 255, 0.12));
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.gb-quick-questions button:hover {
    transform: translateY(-1px);
    border-color: rgba(52, 232, 158, 0.56);
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.32), rgba(104, 182, 255, 0.2));
}

.gb-choice-buttons {
    width: min(680px, 92%);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-self: flex-start;
}

.gb-choice-buttons button {
    border: 1px solid rgba(52, 232, 158, 0.34);
    border-radius: 999px;
    padding: 9px 12px;
    color: var(--gb-ink);
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.24), rgba(104, 182, 255, 0.14));
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}

.gb-chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--gb-line);
    background: rgba(5, 8, 22, 0.82);
}

.gb-chat-form input,
.gb-admin input,
.gb-admin textarea,
.gb-admin select {
    width: 100%;
    border: 1px solid var(--gb-line);
    border-radius: 8px;
    padding: 12px;
    font: inherit;
    background: var(--gb-field);
    color: var(--gb-ink);
}

.gb-chat-form input::placeholder,
.gb-admin input::placeholder,
.gb-admin textarea::placeholder {
    color: rgba(170, 183, 212, 0.76);
}

.gb-chat-form input:focus,
.gb-admin input:focus,
.gb-admin textarea:focus,
.gb-admin select:focus {
    outline: none;
    border-color: var(--gb-mint);
    box-shadow: 0 0 0 3px rgba(52, 232, 158, 0.18);
}

.gb-admin {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.gb-admin-grid {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 18px;
    align-items: start;
}

.gb-box,
.gb-table-wrap {
    background: linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.035)), var(--gb-panel-strong);
    border: 1px solid var(--gb-line);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--gb-shadow);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.gb-row {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.gb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.gb-table th,
.gb-table td {
    border-bottom: 1px solid var(--gb-line);
    text-align: left;
    vertical-align: top;
    padding: 10px;
}

.gb-table th {
    color: var(--gb-mint);
    background: rgba(255, 255, 255, 0.04);
}

.gb-table tr:hover td {
    background: rgba(104, 182, 255, 0.05);
}

.gb-muted {
    color: var(--gb-muted);
}

.gb-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.gb-admin-callout,
.gb-enrollment-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.gb-stat-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gb-stat-strip span {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-width: 112px;
    padding: 10px 12px;
    border: 1px solid var(--gb-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--gb-muted);
}

.gb-stat-strip strong {
    color: var(--gb-mint);
    font-size: 18px;
}

.gb-filter-form {
    min-width: 220px;
}

.gb-filter-form .gb-row {
    margin-bottom: 0;
}

.gb-manual-followup-form {
    display: grid;
    grid-template-columns: minmax(280px, 1.5fr) minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.gb-manual-followup-form .gb-row {
    margin-bottom: 0;
}

.gb-whatsapp-link {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid rgba(52, 232, 158, 0.28);
    border-radius: 8px;
    background: rgba(37, 211, 102, 0.1);
    color: #eafff5 !important;
    text-decoration: none;
}

.gb-whatsapp-link span {
    color: var(--gb-mint);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.gb-whatsapp-link:hover {
    border-color: rgba(52, 232, 158, 0.65);
    background: rgba(37, 211, 102, 0.16);
}

.gb-quick-admin-form {
    margin-bottom: 16px;
}

.gb-quick-admin-grid {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 110px 140px;
    gap: 10px;
}

.gb-compact-table {
    font-size: 13px;
}

.gb-danger-button {
    background: linear-gradient(135deg, #e11d48, #fb7185) !important;
    color: #ffffff !important;
    box-shadow: 0 0 22px rgba(225, 29, 72, 0.2) !important;
}

.gb-secondary-button {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--gb-ink) !important;
    box-shadow: none !important;
    border: 1px solid var(--gb-line) !important;
}

.gb-status-good,
.gb-status-bad {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 800;
}

.gb-status-good {
    color: #061419;
    background: linear-gradient(135deg, var(--gb-green), var(--gb-mint));
}

.gb-status-bad {
    color: #ffffff;
    background: linear-gradient(135deg, #e11d48, #fb7185);
}

@media (max-width: 780px) {
    .gb-shell {
        padding: 0;
    }

    .gb-chat-panel {
        height: 100vh;
        border-radius: 0;
    }

    .gb-chat-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .gb-admin-grid,
    .gb-chat-form,
    .gb-quick-admin-grid {
        grid-template-columns: 1fr;
    }

    .gb-admin-callout,
    .gb-enrollment-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .gb-filter-form {
        min-width: 0;
    }

    .gb-manual-followup-form {
        grid-template-columns: 1fr;
    }

    .gb-quick-questions {
        width: 100%;
    }

    .gb-link-card {
        grid-template-columns: 72px 1fr;
    }

    .gb-link-image {
        min-height: 82px;
        background-size: 42px 42px, cover;
    }
}

/* Modern chat refresh */
body {
    background:
        linear-gradient(rgba(104, 182, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(104, 182, 255, 0.045) 1px, transparent 1px),
        linear-gradient(135deg, #050712 0%, #0a1020 48%, #08091e 100%);
}

.gb-chat-panel {
    width: min(920px, 100%);
    height: min(820px, calc(100dvh - 32px));
    border-radius: 14px;
    background: rgba(9, 14, 34, 0.9);
}

.gb-chat-header {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 14px 16px;
    background: linear-gradient(90deg, rgba(12, 25, 34, 0.96), rgba(20, 26, 52, 0.96));
}

.gb-brand-lockup {
    gap: 10px;
}

.gb-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 50%;
}

.gb-mark img {
    width: 30px;
    height: 30px;
}

.gb-kicker {
    margin-bottom: 2px;
    font-size: 11px;
    letter-spacing: 0.06em;
}

h1 {
    font-size: 28px;
}

.gb-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 999px;
}

.gb-admin-link svg,
.gb-send-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex: 0 0 18px;
}

.gb-messages {
    gap: 8px;
    padding: 18px;
    background:
        linear-gradient(rgba(104, 182, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(104, 182, 255, 0.035) 1px, transparent 1px);
    background-size: 32px 32px;
}

.gb-message {
    position: relative;
    width: fit-content;
    max-width: min(720px, 78%);
    padding: 10px 13px;
    border-radius: 18px 18px 18px 5px;
    border: 1px solid rgba(128, 222, 255, 0.18);
    background: rgba(32, 39, 62, 0.92);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.gb-message-user {
    border-radius: 18px 18px 5px 18px;
    background: linear-gradient(135deg, rgba(31, 140, 82, 0.92), rgba(35, 186, 134, 0.86));
    border-color: rgba(52, 232, 158, 0.34);
}

.gb-message strong {
    display: block;
    margin-bottom: 3px;
    color: var(--gb-mint);
    font-size: 11px;
    line-height: 1;
    text-transform: uppercase;
}

.gb-message-user strong {
    color: rgba(255, 255, 255, 0.9);
}

.gb-message p {
    margin: 0;
    font-size: 15px;
    line-height: 1.48;
}

.gb-message p strong {
    display: inline;
    margin: 0;
    color: #ffffff;
    font-size: inherit;
    line-height: inherit;
    text-transform: none;
}

.gb-quick-questions,
.gb-choice-buttons {
    width: min(720px, 100%);
    gap: 7px;
}

.gb-quick-questions span {
    font-size: 11px;
    text-transform: uppercase;
}

.gb-quick-questions button,
.gb-choice-buttons button {
    min-height: 36px;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.075);
}

.gb-chat-form {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 9px;
    padding: 12px;
    background: rgba(5, 8, 22, 0.94);
}

.gb-chat-form input {
    min-height: 48px;
    border-radius: 999px;
    padding: 0 16px;
}

.gb-send-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 999px;
    padding: 0 16px;
}

.gb-verify-card {
    width: min(760px, 100%);
    padding: 34px 36px 32px;
    border-color: rgba(104, 182, 255, 0.28);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035)),
        rgba(14, 23, 50, 0.94);
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.46),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 42px rgba(52, 232, 158, 0.08);
}

.gb-verify-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 50%;
    color: #061419;
    background: linear-gradient(135deg, var(--gb-green), var(--gb-mint) 55%, var(--gb-cyan));
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 14px 32px rgba(52, 232, 158, 0.2);
}

.gb-verify-card .gb-kicker {
    margin-bottom: 8px;
}

.gb-verify-card h1 {
    max-width: 680px;
    margin-bottom: 18px;
    font-size: clamp(32px, 4vw, 44px);
    line-height: 1.08;
}

.gb-verify-message {
    max-width: 670px;
    margin: 0;
    color: #c4cee5;
    font-size: 18px;
    line-height: 1.68;
}

.gb-verify-actions {
    gap: 12px;
    margin-top: 28px;
}

.gb-verify-actions .gb-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
}

.gb-verify-status {
    margin: 18px 0 0;
    line-height: 1.6;
}

@media (max-width: 780px) {
    body {
        overflow: hidden;
    }

    .gb-chat-panel {
        height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .gb-chat-header {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: max(10px, env(safe-area-inset-top)) 12px 10px;
    }

    .gb-kicker {
        display: none;
    }

    h1 {
        font-size: 22px;
    }

    .gb-admin-link {
        width: 40px;
        min-width: 40px;
        padding: 0;
        justify-content: center;
    }

    .gb-admin-link span,
    .gb-send-button span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .gb-messages {
        padding: 12px;
    }

    .gb-message {
        max-width: 88%;
        padding: 9px 11px;
    }

    .gb-message p {
        font-size: 14px;
    }

    .gb-chat-form {
        grid-template-columns: 1fr 48px;
        padding: 10px 10px max(10px, env(safe-area-inset-bottom));
    }

    .gb-send-button {
        width: 48px;
        padding: 0;
    }

    .gb-verify-card {
        width: min(100%, calc(100vw - 24px));
        padding: 26px 22px 24px;
        border-radius: 14px;
    }

    .gb-verify-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 16px;
        font-size: 22px;
    }

    .gb-verify-card h1 {
        margin-bottom: 16px;
        font-size: 30px;
    }

    .gb-verify-message {
        font-size: 16px;
        line-height: 1.62;
    }

    .gb-verify-actions {
        display: grid;
        grid-template-columns: 1fr;
        margin-top: 24px;
    }
}
