:root {
    font-family: Inter, system-ui, sans-serif;
    color: #172033;
    background: #f5f7fb;
}

body {
    margin: 0;
}

.shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}

aside {
    background: #172033;
    color: white;
    padding: 28px 20px;
}

aside h2 {
    margin: 0 0 28px;
}

aside a {
    display: block;
    color: #dbe4ff;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    margin: 4px 0;
}

aside a.active {
    background: #2f6fed;
    color: white;
}

main {
    padding: 36px;
    max-width: 1200px;
}

.muted,
small {
    color: #687086;
}

.status-error {
    color: #b42318;
    font-weight: 600;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 22px;
}

.page-heading h1 {
    margin: 0 0 6px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 24px 0;
}

.card,
.panel {
    background: white;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 4px 18px rgba(17, 32, 51, .07);
}

.card span {
    display: block;
    color: #687086;
}

.card strong {
    font-size: 30px;
}

.budget-row {
    padding: 15px 0;
    border-bottom: 1px solid #edf0f5;
}

.row-title,
.list-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.bar {
    height: 10px;
    background: #e8edf6;
    border-radius: 10px;
    overflow: hidden;
    margin: 8px 0;
}

.bar div {
    height: 100%;
    background: #2f6fed;
}

.list-row {
    padding: 15px 0;
    border-bottom: 1px solid #edf0f5;
}

.list-row small {
    display: block;
}

.form-grid {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

input,
button,
select {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ccd4e0;
}

button {
    background: #2f6fed;
    color: white;
    border: 0;
    cursor: pointer;
}

button:disabled {
    opacity: .6;
    cursor: wait;
}

.secondary {
    background: #e8edf6;
    color: #172033;
}

.dev-header,
.actions,
.composer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.dev-header {
    margin-bottom: 20px;
}

.dev-header h1 {
    margin: 0 0 6px;
}

.developer-tools {
    min-width: 280px;
}

.developer-tools summary {
    cursor: pointer;
    color: #2f6fed;
    font-weight: 600;
}

.developer-tools .actions {
    justify-content: flex-start;
    margin-top: 12px;
    flex-wrap: wrap;
}

.conversation-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(320px, 420px)) !important;
    gap: 28px !important;
    align-items: start;
}

.phone-panel {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
    max-width: 420px;
    height: 680px;
    background: #0f1728;
    border: 10px solid #0f1728;
    border-radius: 36px;
    padding: 0;
    box-shadow: 0 18px 40px rgba(15, 23, 40, .28);
    overflow: hidden;
}

.phone-panel header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: #ffffff;
    padding: 14px 16px;
    border-bottom: 1px solid #e4e9f2;
}

.start-badger {
    width: 100%;
    font-size: 12px;
    padding: 8px 10px;
}

.phone-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badger {
    font-size: 20px;
}

.phone-panel header small {
    display: block;
    font-size: 12px;
    color: #687086;
}

.messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 16px 12px 8px;
    background: #e8eef8;
}

.empty-conversation {
    color: #8b95a8;
    text-align: center;
    margin-top: 70px;
}

.message-row {
    display: flex !important;
    flex-direction: column !important;
    margin: 10px 0;
}

.from-user {
    align-items: flex-end !important;
}

.from-badgers {
    align-items: flex-start !important;
}

.bubble {
    max-width: 78%;
    padding: 11px 14px;
    border-radius: 18px;
    white-space: pre-wrap;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(17, 32, 51, .08);
    word-break: break-word;
}

.from-user .bubble {
    background: #2f6fed;
    color: #ffffff;
    border-bottom-right-radius: 5px;
}

.from-badgers .bubble {
    background: #ffffff;
    color: #172033;
    border-bottom-left-radius: 5px;
}

.message-avatar {
    font-size: 18px;
    line-height: 1;
    margin: 0 0 6px 4px;
}

.bubble small {
    display: block;
    font-size: 10px;
    margin-top: 6px;
    opacity: .7;
}

.from-user .bubble small {
    color: #dbe4ff;
}

.quick-replies {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    padding: 7px 0 0;
    max-width: 90%;
}

.quick {
    font-size: 12px;
    padding: 8px 11px;
    background: #ffffff;
    color: #172033;
    border: 1px solid #ccd4e0;
    border-radius: 14px;
}

.quick:hover {
    background: #dbe7ff;
    border-color: #2f6fed;
}

.phone-panel .composer {
    padding: 10px 12px 14px;
    background: #ffffff;
    border-top: 1px solid #e4e9f2;
    position: sticky;
    bottom: 0;
    align-items: stretch;
}

.composer-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    border-radius: 18px;
    background: #f5f7fb;
    resize: none;
    min-height: 72px;
    max-height: 160px;
    padding: 12px 14px;
    line-height: 1.45;
    align-self: stretch;
}

.send-button {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
}

.debug-details {
    margin-top: 18px;
    color: #687086;
}

.debug-details summary {
    cursor: pointer;
}

.typing-row .bubble {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.typing-bubble {
    min-height: 42px;
}

.typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #687086;
    animation: typingPulse 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes typingPulse {
    0%, 80%, 100% { opacity: .35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: #17203399;
    display: grid;
    place-items: center;
}

.modal {
    background: white;
    padding: 24px;
    border-radius: 14px;
    display: grid;
    gap: 12px;
    min-width: 300px;
}

.modal form {
    display: grid;
    gap: 12px;
}

@media (max-width: 980px) {
    .conversation-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 760px) {
    .shell {
        grid-template-columns: 1fr;
    }

    aside {
        display: flex;
        gap: 8px;
        overflow: auto;
    }

    aside h2 {
        display: none;
    }

    aside a {
        white-space: nowrap;
    }

    main {
        padding: 20px;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .dev-header {
        display: block;
    }

    .developer-tools {
        margin-top: 16px;
    }

    .phone-panel {
        height: 620px;
        max-width: none;
    }

    .page-heading {
        display: block;
    }

    .page-heading .button {
        margin-top: 12px;
    }
}
