* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}
.container { max-width: 900px; margin: 0 auto; padding: 20px; }
header { text-align: center; padding: 30px 0; }
header h1 { font-size: 2rem; color: #38bdf8; }
.subtitle { color: #94a3b8; margin-top: 5px; }
.card {
    background: #1e293b;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid #334155;
}
.card h2 { font-size: 1.2rem; margin-bottom: 16px; color: #38bdf8; }
.input-group { display: flex; gap: 10px; }
.input-group input, .select-full {
    flex: 1; padding: 12px; border-radius: 8px; border: 1px solid #475569;
    background: #0f172a; color: #e2e8f0; font-size: 1rem;
}
.input-group input:focus, .select-full:focus { outline: none; border-color: #38bdf8; }
.select-full { width: 100%; }
.btn {
    padding: 12px 24px; border: none; border-radius: 8px; font-size: 1rem;
    cursor: pointer; transition: all .2s; font-weight: 500;
}
.btn-primary { background: #38bdf8; color: #0f172a; }
.btn-primary:hover { background: #7dd3fc; }
.btn-secondary { background: #475569; color: #e2e8f0; }
.btn-secondary:hover { background: #64748b; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #f87171; }
.btn-small { padding: 6px 12px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.key-managed-bar {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: #0f172a; border-radius: 8px; flex-wrap: wrap;
}
.key-badge { background: #064e3b; color: #6ee7b7; padding: 4px 10px; border-radius: 20px; font-size: .8rem; font-weight: 500; }
.key-preview { font-family: 'Cascadia Code', 'Fira Code', monospace; color: #7dd3fc; font-size: .85rem; flex: 1; }
.key-actions { display: flex; gap: 6px; margin-left: auto; }

.confirm-dialog {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; z-index: 2000;
}
.confirm-box {
    background: #1e293b; border-radius: 12px; padding: 30px; max-width: 450px;
    border: 1px solid #334155; text-align: center;
}
.confirm-icon { font-size: 3rem; margin-bottom: 10px; }
.confirm-text { color: #e2e8f0; font-size: 1.05rem; line-height: 1.5; margin-bottom: 20px; }
.confirm-text strong { color: #fca5a5; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.status-msg { margin-top: 10px; padding: 8px; border-radius: 6px; display: none; }
.status-msg.success { display: block; background: #064e3b; color: #6ee7b7; }
.status-msg.error { display: block; background: #7f1d1d; color: #fca5a5; }
.status-msg .endpoint { margin-top: 10px; font-size: .9rem; }
.status-msg .endpoint code {
    display: inline-block; padding: 6px 12px; background: #0f172a; border-radius: 6px;
    color: #7dd3fc; font-family: 'Cascadia Code', 'Fira Code', monospace; user-select: all; margin-top: 4px;
}
.agent-info { margin-top: 10px; padding: 12px; background: #0f172a; border-radius: 8px; font-size: .9rem; color: #94a3b8; }

.chat-messages {
    height: 350px; overflow-y: auto; padding: 12px; background: #0f172a;
    border-radius: 8px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px;
}
.chat-messages .msg {
    padding: 10px 14px; border-radius: 12px; max-width: 80%; line-height: 1.4;
}
.chat-messages .msg.user { align-self: flex-end; background: #38bdf8; color: #0f172a; }
.chat-messages .msg.assistant { align-self: flex-start; background: #334155; color: #e2e8f0; }
.chat-messages .msg.error { align-self: center; background: #7f1d1d; color: #fca5a5; }
.chat-messages .loading { align-self: center; color: #94a3b8; font-style: italic; }
.chat-input { margin-top: 0; }

.drop-zone {
    border: 2px dashed #475569; border-radius: 12px; padding: 40px 20px;
    text-align: center; cursor: pointer; transition: all .3s;
}
.drop-zone.dragover { border-color: #38bdf8; background: rgba(56,189,248,.1); }
.drop-zone p { color: #94a3b8; margin-bottom: 12px; }

.skill-list { margin-top: 16px; }
.skill-item {
    display: flex; align-items: center; gap: 10px; padding: 12px;
    background: #0f172a; border-radius: 8px; margin-bottom: 8px;
}
.skill-name { flex: 1; font-weight: 500; }
.skill-model { color: #94a3b8; font-size: .85rem; }

.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal {
    background: #1e293b; border-radius: 12px; padding: 30px; width: 90%; max-width: 500px;
    border: 1px solid #334155;
}
.modal h3 { margin-bottom: 20px; color: #38bdf8; }
.modal label { display: block; margin-top: 12px; margin-bottom: 4px; color: #94a3b8; font-size: .9rem; }
.modal input, .modal select {
    width: 100%; padding: 10px; border-radius: 6px; border: 1px solid #475569;
    background: #0f172a; color: #e2e8f0; font-size: 1rem;
}
.modal select optgroup { color: #38bdf8; font-weight: 600; font-style: normal; }
.modal select optgroup option { color: #e2e8f0; font-weight: normal; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

.modal-wide { max-width: 700px; }
.secret-box { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.secret-code {
    flex: 1; padding: 12px; background: #0f172a; border-radius: 8px; border: 1px solid #475569;
    font-family: 'Cascadia Code', 'Fira Code', monospace; font-size: .8rem; color: #7dd3fc;
    word-break: break-all; user-select: all; line-height: 1.5;
}
.btn-copy {
    padding: 8px 14px; border: none; border-radius: 6px; cursor: pointer;
    background: #0ea5e9; color: #fff; font-size: .8rem; font-weight: 500; white-space: nowrap;
}
.btn-copy:hover { background: #38bdf8; }
.btn-secret { padding: 6px 12px; border: none; border-radius: 6px; cursor: pointer; font-size: .8rem; background: #0ea5e9; color: #fff; }
.btn-secret:hover { background: #38bdf8; }
.secret-warning {
    background: #78350f; color: #fcd34d; padding: 12px; border-radius: 8px;
    font-size: .85rem; margin-bottom: 16px; line-height: 1.5;
}
.secret-howto { margin-bottom: 10px; }
.secret-howto strong { color: #94a3b8; font-size: .9rem; display: block; margin-bottom: 8px; }
.secret-howto pre {
    background: #0f172a; padding: 12px; border-radius: 8px; border: 1px solid #334155;
    font-family: 'Cascadia Code', 'Fira Code', monospace; font-size: .8rem; color: #94a3b8;
    overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}

.usage-total { font-size: 2.2rem; font-weight: 700; color: #38bdf8; margin-bottom: 4px; }
.usage-meta { color: #94a3b8; font-size: .85rem; margin-bottom: 16px; }
.period-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.period-tab {
    padding: 8px 20px; border: 1px solid #475569; border-radius: 8px;
    background: #0f172a; color: #94a3b8; cursor: pointer; font-size: .9rem; transition: all .2s;
}
.period-tab:hover { border-color: #38bdf8; color: #e2e8f0; }
.period-tab.active { background: #38bdf8; color: #0f172a; border-color: #38bdf8; font-weight: 600; }
.chart-container { margin-bottom: 20px; background: #0f172a; border-radius: 8px; padding: 12px; }

@media (max-width: 600px) {
    .container { padding: 10px; }
    .input-group { flex-direction: column; }
    .modal { padding: 20px; }
}