/* Добавь этот файл целиком вместо текущего operator.css */

:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --panel-soft: #f8fafb;
    --border: #e3e8ee;
    --text: #1e2934;
    --muted: #71808f;
    --accent: #0b84ff;
    --accent-soft: #eaf4ff;
    --success: #16884a;
    --danger: #d14a3c;
    --shadow: 0 10px 30px rgba(21, 38, 55, 0.06);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--text);
    background: var(--bg);
}

body {
    height: 100vh;
    overflow: hidden;
}

button,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
}

.app-shell {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 72px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: white;
    font-weight: 800;
    background: linear-gradient(135deg, #0b84ff, #7d5cff);
}

.brand-title {
    font-size: 17px;
    font-weight: 750;
}

.brand-subtitle {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sync-status {
    color: var(--muted);
    font-size: 13px;
}

.user-chip {
    height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--panel-soft);
    font-size: 12px;
    font-weight: 700;
}

.logout-button {
    height: 100%;
    padding: 0 11px;
    border-left: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.workspace {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: 330px minmax(380px, 1fr) 390px;
    gap: 12px;
    padding: 12px;
}

.chat-sidebar,
.conversation-panel,
.assistant-panel {
    min-height: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.chat-sidebar {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 18px 18px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h2,
h3,
p {
    margin: 0;
}

.panel-header h2,
.conversation-header h2 {
    font-size: 18px;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

.search-box {
    padding: 0 14px 12px;
}

.search-box input {
    width: 100%;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 0 13px;
    outline: none;
    background: var(--panel-soft);
    color: var(--text);
}

.search-box input:focus {
    border-color: var(--accent);
    background: white;
}

.chat-list {
    min-height: 0;
    overflow-y: auto;
    padding: 0 8px 10px;
}

.chat-row {
    width: 100%;
    padding: 12px;
    border-radius: 13px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    margin-bottom: 3px;
    transition: 0.15s ease;
}

.chat-row:hover {
    background: var(--panel-soft);
}

.chat-row.active {
    background: var(--accent-soft);
}

.chat-row-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: baseline;
}

.chat-name {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.chat-item-title {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-preview {
    margin-top: 6px;
    color: #44515d;
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chat-direction {
    font-weight: 700;
    color: var(--accent);
}

.conversation-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.conversation-header {
    flex: 0 0 auto;
    min-height: 72px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 20px;
    background:
        radial-gradient(
            circle at top left,
            rgba(11, 132, 255, 0.04),
            transparent 260px
        ),
        var(--panel-soft);
}

.message-row {
    display: flex;
    margin-bottom: 10px;
}

.message-row.in {
    justify-content: flex-start;
}

.message-row.out {
    justify-content: flex-end;
}

.message-bubble {
    max-width: min(80%, 720px);
    padding: 10px 13px 8px;
    border-radius: 15px;
    line-height: 1.45;
    font-size: 16px;
    word-break: break-word;
}

.message-row.in .message-bubble {
    background: white;
    border: 1px solid var(--border);
    border-bottom-left-radius: 5px;
}

.message-row.out .message-bubble {
    color: #0f334e;
    background: #dff0ff;
    border-bottom-right-radius: 5px;
}

.message-text {
    white-space: pre-wrap;
    margin: 0;
    padding: 0;
}

.message-meta {
    margin-top: 6px;
    padding-top: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.2;
}

.message-author,
.message-date {
    display: inline-flex;
    align-items: center;
}

.message-date {
    margin-left: auto;
    white-space: nowrap;
}

.ai-message-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    padding: 1px 6px;
    border-radius: 999px;
    color: #6e4ed8;
    background: #f0ebff;
    font-size: 9px;
    line-height: 1.5;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.system-message {
    margin: 10px auto;
    max-width: 70%;
    padding: 7px 11px;
    color: var(--muted);
    background: #edf1f4;
    border-radius: 10px;
    text-align: center;
    font-size: 12px;
}

.assistant-panel {
    overflow-y: auto;
    padding: 18px;
}

.side-section + .side-section {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.section-title-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title-row h3 {
    font-size: 15px;
}

.external-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 12px;
    font-weight: 650;
}

.item-card {
    border-radius: 14px;
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--panel-soft);
}

.item-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    background: #e8edf1;
}

.item-body {
    padding: 13px;
}

.item-title {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 750;
}

.item-price {
    margin-top: 7px;
    font-size: 17px;
    font-weight: 800;
}

.item-location {
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
}

.empty-card,
.empty-state {
    color: var(--muted);
    font-size: 13px;
    padding: 18px;
    text-align: center;
}

.suggestion-card {
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 12px;
    margin-bottom: 9px;
    cursor: pointer;
    transition: 0.15s ease;
    background: white;
}

.suggestion-card:hover {
    border-color: #b9d8f7;
}

.suggestion-card.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.suggestion-number {
    font-size: 11px;
    color: var(--accent);
    font-weight: 750;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.suggestion-text {
    line-height: 1.5;
    font-size: 14px;
}

.editor-wrap {
    margin-top: 14px;
}

.editor-wrap label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 7px;
}

.editor-wrap textarea {
    width: 100%;
    resize: vertical;
    min-height: 125px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 11px 12px;
    outline: none;
    line-height: 1.5;
    font-size: 14px;
}

.editor-wrap textarea:focus {
    border-color: var(--accent);
}

.answer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 9px;
}

.save-hint {
    margin-top: 9px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.small-status {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.button {
    height: 38px;
    border-radius: 11px;
    padding: 0 14px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.15s ease;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.button-primary {
    color: white;
    background: var(--accent);
}

.button-primary:hover:not(:disabled) {
    filter: brightness(0.95);
}

.button-secondary {
    color: var(--text);
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

.button-success {
    width: 100%;
    color: white;
    background: var(--success);
}

.button-send {
    width: 100%;
    color: white;
    background: var(--accent);
}

.button-small {
    height: 34px;
    padding: 0 11px;
    font-size: 12px;
}

.icon-button {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    cursor: pointer;
    color: var(--muted);
    background: var(--panel-soft);
    font-size: 17px;
}

.welcome-state {
    min-height: 100%;
    display: grid;
    place-content: center;
    text-align: center;
    color: var(--muted);
}

.welcome-state h3 {
    margin-top: 9px;
    color: var(--text);
}

.welcome-state p {
    margin-top: 5px;
    font-size: 13px;
}

.welcome-icon {
    font-size: 36px;
}

.hidden {
    display: none !important;
}

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    max-width: 360px;
    padding: 12px 15px;
    border-radius: 12px;
    color: white;
    background: #23313d;
    box-shadow: var(--shadow);
    font-size: 13px;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: var(--danger);
}

.toast.success {
    background: var(--success);
}

.login-body {
    min-height: 100vh;
    height: auto;
    overflow: auto;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(
            circle at 20% 20%,
            rgba(11, 132, 255, 0.14),
            transparent 320px
        ),
        radial-gradient(
            circle at 80% 80%,
            rgba(125, 92, 255, 0.12),
            transparent 320px
        ),
        var(--bg);
}

.login-card {
    width: min(100%, 410px);
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--panel);
    box-shadow: 0 24px 70px rgba(21, 38, 55, 0.1);
}

.login-brand {
    margin-bottom: 24px;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-form label {
    display: grid;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    background: var(--panel-soft);
}

.login-form input:focus {
    border-color: var(--accent);
    background: white;
}

.login-error {
    min-height: 18px;
    color: var(--danger);
    font-size: 12px;
}

.login-button {
    width: 100%;
    height: 44px;
}

@media (max-width: 1180px) {
    .workspace {
        grid-template-columns: 290px minmax(360px, 1fr) 340px;
    }
}

@media (max-width: 900px) {
    body {
        overflow: auto;
        height: auto;
    }

    .app-shell {
        height: auto;
        min-height: 100vh;
    }

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

    .chat-sidebar,
    .conversation-panel,
    .assistant-panel {
        min-height: 500px;
    }

    .chat-sidebar {
        max-height: 520px;
    }

    .conversation-panel {
        height: 650px;
    }

    .assistant-panel {
        min-height: auto;
    }

    .topbar {
        height: auto;
        padding: 14px;
        gap: 12px;
        align-items: flex-start;
    }

    .topbar-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .answer-actions {
        grid-template-columns: 1fr;
    }
}
