:root {
    --aide-blue: #2481cc;
    --aide-blue-ios: #007aff;
    --aide-text: #111827;
    --aide-muted: #8a8f98;
    --aide-line: rgba(17, 24, 39, 0.1);
}

html,
body {
    background: #eef2f7;
    overflow-x: hidden;
}

.content {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
}

.chat-shell {
    height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 62px);
    background: #eef2f7;
}

.messages {
    padding: 14px 12px 12px;
}

.message-row > div {
    max-width: 78%;
}

.bubble {
    border-radius: 18px;
    padding: 10px 14px;
    color: var(--aide-text);
    font-size: 15.5px;
    line-height: 1.55;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.message-row.assistant .bubble,
.message-row.system .bubble {
    background: #ffffff;
    border-bottom-left-radius: 7px;
}

.message-row.user .bubble {
    color: #ffffff;
    background: var(--aide-blue);
    border-bottom-right-radius: 7px;
}

.time {
    color: #9ca3af;
    font-size: 11.5px;
}

.chat-form {
    min-height: 62px;
    padding: 10px 12px;
}

.chat-form .chat-input {
    min-height: 44px;
    max-height: 118px;
    border-radius: 22px;
    padding: 10px 14px;
}

.chat-input::placeholder,
input::placeholder,
textarea::placeholder {
    color: #a5adba;
}

.chat-form .button {
    min-width: 54px;
    min-height: 44px;
    border-radius: 22px;
    background: var(--aide-blue);
    font-weight: 700;
}

.bottom-tabs {
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.tab-link {
    gap: 4px;
    border-radius: 0;
    color: #8a8f98;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
}

.tab-link.active {
    color: #2481cc;
}

.tab-icon {
    width: 23px;
    height: 23px;
    border-radius: 0;
    display: block;
    visibility: visible;
    opacity: 1;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    background: transparent;
}

.bottom-nav-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 28px;
    border-radius: 999px;
    background: transparent;
}

.tab-link.active .bottom-nav-icon-wrap {
    background: rgba(36, 129, 204, 0.12);
}

.tab-link.active .tab-icon {
    background: transparent;
}

.bottom-nav-label {
    color: currentColor;
    font-size: 11px;
    line-height: 1;
}

.tab-link.active .bottom-nav-label {
    color: #2481cc;
    font-weight: 600;
}

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100dvh;
    padding: calc(20px + env(safe-area-inset-top)) 18px calc(20px + env(safe-area-inset-bottom));
    background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.16), transparent 38%), #eef2f7;
}

.auth-card {
    width: min(100%, 390px);
    padding: 24px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.auth-title {
    margin: 0;
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: 0;
}

.auth-subtitle {
    margin: 8px 0 22px;
    color: #64748b;
    font-size: 14px;
}

.auth-error {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 14px;
    color: #991b1b;
    background: #fee2e2;
    font-size: 13px;
}

.auth-card .button {
    width: 100%;
    margin-top: 12px;
    min-height: 44px;
    border-radius: 16px;
}

.backup-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.standalone-note {
    display: none;
}

body.standalone .standalone-note {
    display: block;
}

@media (min-width: 860px) {
    .bottom-tabs {
        right: calc((100vw - min(1040px, 100vw)) / 2);
        left: calc((100vw - min(1040px, 100vw)) / 2);
        border-right: 1px solid var(--aide-line);
        border-left: 1px solid var(--aide-line);
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
    }
}
