:root {
    --bot-ink: #0f172a;
    --bot-muted: #5b6475;
    --bot-line: rgba(15, 23, 42, 0.12);
    --bot-blue: #1d4ed8;
    --bot-teal: #0891b2;
    --bot-bg: #f6f8fb;
}

.bot-login-page,
.bot-portal-page {
    min-height: 100vh;
    background: var(--bot-bg);
    color: var(--bot-ink);
}

.bot-login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.bot-login-panel {
    width: min(100%, 440px);
    padding: 34px;
    border: 1px solid var(--bot-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.13);
}

.bot-login-logo {
    width: 210px;
    max-width: 70%;
    margin-bottom: 24px;
}

.bot-login-panel h1 {
    margin-bottom: 20px;
    font-size: 31px;
    line-height: 1.14;
}

.bot-login-help {
    margin: 18px 0 0;
    color: var(--bot-muted);
    font-size: 13px;
}

.bot-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px clamp(18px, 4vw, 54px);
    border-bottom: 1px solid var(--bot-line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
}

.bot-brand img {
    width: 210px;
    max-width: 48vw;
}

.bot-topbar nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bot-topbar a {
    color: var(--bot-ink);
    font-weight: 800;
}

.bot-topbar nav a {
    padding: 10px 12px;
    border-radius: 8px;
}

.bot-topbar nav a:hover {
    background: #eef6ff;
    color: var(--bot-blue);
}

.bot-layout {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 56px;
}

.bot-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
    gap: 24px;
    align-items: end;
    margin-bottom: 26px;
}

.bot-hero h1 {
    margin: 8px 0 12px;
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1;
}

.bot-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--bot-muted);
    font-size: 17px;
}

.bot-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.bot-stats article,
.bot-panel {
    border: 1px solid var(--bot-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 54px rgba(15, 23, 42, 0.08);
}

.bot-stats article {
    padding: 18px;
}

.bot-stats strong {
    display: block;
    color: var(--bot-blue);
    font-size: 30px;
    line-height: 1;
}

.bot-stats span {
    color: var(--bot-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.bot-workspace {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.bot-panel {
    padding: 24px;
}

.bot-panel-header {
    margin-bottom: 18px;
}

.bot-panel h2 {
    margin: 6px 0 0;
    font-size: 25px;
}

.bot-panel form {
    display: grid;
    gap: 12px;
}

.bot-panel label {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
}

.bot-panel input,
.bot-panel textarea {
    width: 100%;
    border: 1px solid var(--bot-line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--bot-ink);
    outline: none;
}

.bot-panel input {
    height: 48px;
    padding: 0 14px;
}

.bot-panel textarea {
    min-height: 118px;
    padding: 14px;
    resize: vertical;
}

.bot-panel select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--bot-line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--bot-ink);
    outline: none;
}

.bot-panel input:focus,
.bot-panel textarea:focus {
    border-color: rgba(29, 78, 216, 0.48);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.10);
}

.bot-answer {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(8, 145, 178, 0.18);
    border-radius: 8px;
    background: #ecfeff;
}

.bot-answer strong {
    display: block;
    margin-bottom: 8px;
}

.bot-answer p {
    margin: 0 0 8px;
    color: var(--bot-ink);
}

.bot-answer small {
    color: var(--bot-muted);
}

.bot-file-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--bot-line);
}

.bot-file-form .ghost-btn {
    color: var(--bot-blue);
}

.bot-form-message {
    margin: 14px 0 0;
    color: var(--bot-teal);
    font-weight: 800;
}

.bot-form-message.is-error {
    color: #b91c1c;
}

.bot-history {
    margin-top: 22px;
}

.bot-client-panel {
    margin-bottom: 22px;
}

.bot-client-grid {
    display: grid;
    grid-template-columns: minmax(180px, 260px) 1fr;
    gap: 12px;
    align-items: end;
}

.bot-client-grid label {
    grid-column: 1 / -1;
}

.bot-client-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 12px;
}

.bot-endpoint-box {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid rgba(8, 145, 178, 0.18);
    border-radius: 8px;
    background: #ecfeff;
}

.bot-endpoint-box strong,
.bot-endpoint-box code,
.bot-endpoint-box small {
    display: block;
}

.bot-endpoint-box code {
    margin: 8px 0;
    white-space: normal;
    overflow-wrap: anywhere;
    color: var(--bot-blue);
    font-weight: 800;
}

.bot-history-list {
    display: grid;
    gap: 12px;
}

.bot-history-list article {
    padding: 14px;
    border: 1px solid var(--bot-line);
    border-radius: 8px;
    background: #f8fafc;
}

.bot-history-list strong {
    display: block;
    margin-bottom: 6px;
}

.bot-history-list p {
    margin: 0;
    color: var(--bot-muted);
}

@media (max-width: 900px) {
    .bot-hero,
    .bot-workspace,
    .bot-client-grid,
    .bot-client-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .bot-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .bot-topbar nav {
        flex-wrap: wrap;
    }

    .bot-stats {
        grid-template-columns: 1fr;
    }
}
