/* LLM Studio - modal and history refinements */

.settings-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.settings-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(4px);
}

.settings-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(720px, calc(100vw - 32px));
    max-height: min(88vh, 820px);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.settings-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--border-color);
}

.settings-dialog-header h2 {
    font-size: 18px;
    color: var(--text-main);
}

.settings-dialog-header p {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

.settings-dialog-body {
    min-height: 0;
    overflow-y: auto;
    padding: 22px 24px;
}

.modal-settings-section {
    gap: 16px;
    border: 0;
    padding: 0;
}

.modal-settings-section .setting-item textarea {
    min-height: 180px;
    resize: vertical;
    line-height: 1.5;
}

.settings-dialog-footer {
    display: flex;
    justify-content: flex-end;
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
}

.setting-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    color: var(--text-main);
    font: inherit;
}

.context-meter-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
}

.context-meter-track {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--border-subtle);
}

.context-meter-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-teal), var(--primary));
    transition: width 0.25s ease, background 0.25s ease;
}

.context-meter-fill.warning { background: #f59e0b; }
.context-meter-fill.danger { background: #ef4444; }

.context-meter-sub {
    color: var(--text-subtle);
    font-size: 10px;
    line-height: 1.35;
}

.history-item { align-items: flex-start; }

.history-content {
    min-width: 0;
    flex: 1;
}

.history-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-meta {
    margin-top: 3px;
    color: var(--text-subtle);
    font-size: 11px;
    font-weight: 400;
}

.history-delete {
    flex: 0 0 auto;
    border: 0;
    padding: 2px 4px;
    background: transparent;
    color: var(--text-subtle);
    cursor: pointer;
}

.history-delete:hover { color: #ef4444; }
