* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: #dfe3e8;
    font-family: Arial, Helvetica, sans-serif;
    color: #23384d;
    height: 100%;
}

body {
    display: flex;
    justify-content: center;
}

.app-shell {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    background: #e9edf1;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.08);
}

.topbar {
    height: 78px;
    background: #ffffff;
    border-bottom: 1px solid #edf0f2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    flex-shrink: 0;
}

.topbar-title {
    font-size: 26px;
    font-weight: 700;
}

.topbar-user {
    font-size: 14px;
    color: #8ca0af;
    font-weight: 700;
}

.main-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    padding-bottom: 88px;
}

.screen {
    display: none;
    height: 100%;
    overflow-y: auto;
}

.screen-active {
    display: block;
}

.screen-inner {
    padding: 20px 16px 24px;
}

.welcome-title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
}

.welcome-subtitle,
.section-subtitle {
    margin: 0 0 20px;
    color: #8398a8;
    font-size: 16px;
}

.section-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.service-card,
.bot-card {
    border: 1px solid #d8dde2;
    background: #fff;
    border-radius: 22px;
    min-height: 150px;
    padding: 18px;
    cursor: pointer;
    text-align: center;
    transition: 0.15s ease;
}

.service-card:hover,
.bot-card:hover {
    transform: translateY(-1px);
}

.service-card-muted {
    opacity: 0.65;
}

.service-icon,
.bot-icon {
    font-size: 42px;
    margin-top: 16px;
    margin-bottom: 20px;
}

.service-title,
.bot-title {
    font-size: 17px;
    font-weight: 700;
}

.bot-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bot-card {
    min-height: auto;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 14px;
}

.bot-card .bot-icon {
    margin: 0;
    font-size: 32px;
}

.bot-meta {
    flex: 1;
}

.bot-desc {
    margin-top: 4px;
    color: #8398a8;
    font-size: 14px;
}

.chat-screen {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 166px);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.chat-title {
    font-size: 22px;
    font-weight: 700;
}

.chat-subtitle {
    color: #8ca0af;
    font-size: 14px;
    margin-top: 2px;
}

.ghost-btn {
    border: 1px solid #cdd6de;
    background: #fff;
    color: #35506b;
    border-radius: 14px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 700;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 14px;
}

.msg {
    max-width: 88%;
    border-radius: 18px;
    padding: 12px 14px;
    line-height: 1.45;
    font-size: 15px;
    word-wrap: break-word;
}

.msg-bot {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid #d9dee4;
}

.msg-user {
    align-self: flex-end;
    background: #d8e9ff;
    border: 1px solid #c3ddfb;
}

.quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.quick-btn {
    border: 1px solid #ccd5dd;
    background: #fff;
    color: #304d67;
    border-radius: 14px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.composer {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #fff;
    border: 1px solid #d9dee4;
    border-radius: 18px;
    padding: 8px;
}

.composer-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    padding: 10px 12px;
    background: transparent;
    color: #23384d;
}

.file-btn,
.send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 18px;
}

.file-btn {
    background: #eef3f7;
}

.send-btn {
    background: #29496a;
    color: #fff;
}

.composer-hint {
    margin-top: 8px;
    color: #8798a5;
    font-size: 13px;
    padding-left: 4px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 430px;
    height: 78px;
    background: #fff;
    border-top: 1px solid #e5eaef;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    z-index: 20;
}

.nav-btn {
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #91a1ad;
    cursor: pointer;
    font-size: 12px;
    gap: 3px;
}

.nav-btn-active {
    color: #304d67;
    font-weight: 700;
}

.nav-icon {
    font-size: 22px;
}

a {
    color: #2f5d96;
    text-decoration: none;
}

@media (max-width: 420px) {
    .cards-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .service-card {
        min-height: 136px;
        padding: 14px;
    }

    .topbar-title {
        font-size: 23px;
    }
}