:root {
    --bg: #f3f3f3;
    --panel: #ffffff;
    --border: #e4e4e4;
    --ink: #2a363f;
    --muted: #727272;
    --brand: #20a461;
    --brand-dark: #17804b;
    --accent: #f97316;
    --danger: #be123c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 28%),
        linear-gradient(180deg, #fafafa 0%, var(--bg) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid rgba(219, 228, 240, 0.9);
}

.site-header__inner,
.page-shell {
    width: min(1120px, calc(100vw - 32px));
    margin: 0 auto;
}

.site-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 72px;
}

.page-shell {
    padding: 32px 0 60px;
}

.brand {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
}

.brand img {
    height: 30px;
    width: auto;
    display: block;
}

.site-nav,
.inline-actions,
.hero-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-pill,
.button-primary,
.button-secondary,
.button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 11px 18px;
    font-weight: 700;
    border: 1px solid transparent;
}

.button-primary,
.nav-pill {
    background: var(--brand);
    color: #fff;
}

.button-primary:hover,
.nav-pill:hover {
    background: var(--brand-dark);
}

.button-secondary {
    background: transparent;
    border-color: var(--border);
    color: var(--ink);
}

.button-danger {
    background: var(--danger);
    color: #fff;
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--brand);
    font: inherit;
    cursor: pointer;
}

.logout-form {
    margin: 0;
}

.hero,
.grid-two,
.dashboard-grid {
    display: grid;
    gap: 20px;
}

.hero,
.grid-two {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 20px;
}

.hero {
    align-items: stretch;
    margin-bottom: 20px;
}

.hero-copy,
.panel,
.stat-card,
.hero-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 16px 40px rgba(15, 35, 70, 0.06);
}

.hero-copy h1,
.panel h1,
.panel h2 {
    margin-top: 0;
}

.hero-card {
    background: linear-gradient(160deg, #20a461, #17804b);
    color: #fff;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.14);
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 0.85rem;
}

.feature-list {
    margin: 0;
    padding-left: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.table-muted {
    color: var(--muted);
    font-size: 0.92rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.82rem;
    font-weight: 700;
}

.badge-live {
    background: rgba(15, 118, 110, 0.12);
    color: var(--brand-dark);
}

.badge-muted {
    background: #f0f0f0;
    color: var(--muted);
}

.form-stack {
    display: grid;
    gap: 16px;
}

.form-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-grid__submit {
    width: fit-content;
}

label,
.target-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 12px 14px;
    font: inherit;
    color: inherit;
    background: #fff;
}

.checkbox-row {
    flex-direction: row;
    align-items: center;
}

.checkbox-row input {
    width: auto;
}

.field-validation {
    color: var(--danger);
    font-size: 0.85rem;
}

.alert {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(249, 115, 22, 0.12);
    color: #9a3412;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.auth-panel,
.narrow-panel {
    width: min(760px, 100%);
    margin: 0 auto;
}

.option-builder {
    border-top: 1px solid var(--border);
    padding-top: 18px;
}

.option-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    align-items: end;
    padding: 14px 0;
    border-bottom: 1px dashed var(--border);
}

.admin-chat {
    display: grid;
    gap: 16px;
}

.admin-chat__messages {
    min-height: 420px;
    max-height: 60vh;
    overflow-y: auto;
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
    background: #f7fafc;
}

.chat-bubble {
    max-width: 80%;
    padding: 14px 16px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--border);
}

.chat-bubble--agent {
    justify-self: end;
    background: rgba(15, 118, 110, 0.12);
    border-color: rgba(15, 118, 110, 0.18);
}

.chat-bubble header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.84rem;
    color: var(--muted);
}

.chat-bubble p,
pre {
    margin: 0;
    white-space: pre-wrap;
}

pre {
    overflow-x: auto;
    padding: 16px;
    border-radius: 18px;
    background: #1c2329;
    color: #f8fafc;
}

@media (max-width: 720px) {
    .site-header__inner {
        min-height: auto;
        padding: 14px 0;
        flex-direction: column;
        align-items: flex-start;
    }
}
