* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    background: #f5f5f5 !important;
    color: #1d1d1f !important;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

#root {
    width: 100%;
    max-width: 900px;
    height: 100vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    background: #ffffff !important;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* Хедер */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
    background: #ffffff !important;
}

.logo {
    font-size: 16px;
    font-weight: 500;
    color: #1d1d1f !important;
}

.status {
    font-size: 12px;
    color: #34c759 !important;
}

/* Окно вывода */
.output {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    background: #fafafa !important;
    font-size: 14px;
    line-height: 1.7;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
}

.output .line {
    padding: 2px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.output .line.user {
    color: #3964fe !important;
}

.output .line.bot {
    color: #1d1d1f !important;  /* ЧЁРНЫЙ */
}

.output .line.system {
    color: #8e8e93 !important;
    font-size: 13px;
}

.output .line.error {
    color: #ff3b30 !important;
}

/* Строка ввода */
.input-area {
    padding: 12px 20px 16px;
    border-top: 1px solid #e8e8e8;
    flex-shrink: 0;
    background: #ffffff !important;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.prompt {
    color: #3964fe !important;
    font-size: 16px;
    font-weight: 600;
    user-select: none;
}

.input-row input {
    flex: 1;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid #d0d0d0;
    background: transparent !important;
    color: #1d1d1f !important;
    font-size: 15px;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    outline: none;
    transition: border-color 0.2s;
}

.input-row input:focus {
    border-bottom-color: #3964fe;
}

.input-row input::placeholder {
    color: #b0b0b0 !important;
}

.input-row button {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #d0d0d0;
    background: #ffffff !important;
    color: #8e8e93 !important;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-row button:hover:not(:disabled) {
    background: #f0f0f0 !important;
    color: #1d1d1f !important;
    border-color: #3964fe;
}

.input-row button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.stack-info {
    margin-top: 8px;
    font-size: 12px;
    color: #8e8e93 !important;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

#stackDisplay {
    color: #1d1d1f !important;
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}