/* AIHook Customer Portal */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #f5f6fa;
    --surface:   #ffffff;
    --border:    #e2e8f0;
    --primary:   #4f46e5;
    --primary-h: #4338ca;
    --danger:    #ef4444;
    --success:   #22c55e;
    --warning:   #f59e0b;
    --text:      #1e293b;
    --muted:     #64748b;
    --sidebar-w: 220px;
    --radius:    10px;
}

body { font-family: system-ui, -apple-system, sans-serif; font-size: 15px;
       background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border);
           display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { padding: 1.25rem 1.5rem; font-size: 1.2rem; font-weight: 700; letter-spacing: -.5px;
                 border-bottom: 1px solid var(--border); }
.sidebar-brand strong { color: var(--primary); }
.sidebar-brand span { color: var(--muted); font-weight: 400; font-size: .85rem; }
.nav-list { list-style: none; padding: .75rem 0; flex: 1; }
.nav-list li a { display: flex; align-items: center; gap: .6rem; padding: .6rem 1.5rem;
                 color: var(--muted); text-decoration: none; border-radius: 0; transition: all .15s; font-size: .9rem; }
.nav-list li a:hover, .nav-list li.active a { background: #f0f0ff; color: var(--primary); }
.nav-list li.active a { font-weight: 600; }
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); font-size: .82rem; color: var(--muted); }
.sidebar-footer .user-name { font-weight: 600; color: var(--text); margin-bottom: .3rem;
                              overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer a { color: var(--muted); text-decoration: none; }
.sidebar-footer a:hover { color: var(--danger); }
.lang-switch { display: flex; gap: .5rem; margin-top: .5rem; }
.lang-switch a { font-size: .78rem; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border);
                 color: var(--muted); text-decoration: none; }
.lang-switch a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Main ── */
.content { flex: 1; padding: 2rem; max-width: 1000px; }
h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text); }
h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; color: var(--text); }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
        padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
             padding: 1.25rem 1.5rem; }
.stat-card .label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-card .value { font-size: 1.8rem; font-weight: 700; margin-top: .2rem; }
.stat-card .value.green { color: var(--success); }
.stat-card .value.red   { color: var(--danger); }
.stat-card .value.blue  { color: var(--primary); }

/* ── Alerts ── */
.alert { padding: .85rem 1.25rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: .9rem; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert code { background: rgba(0,0,0,.06); padding: 2px 6px; border-radius: 4px;
              font-family: monospace; word-break: break-all; display: block; margin-top: .4rem; font-size: .9em; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .35rem; color: var(--text); }
.form-group input, .form-group select {
    width: 100%; padding: .55rem .85rem; border: 1px solid var(--border); border-radius: 7px;
    font-size: .95rem; background: var(--bg); color: var(--text); transition: border .15s; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: .6rem .85rem; margin-top: .35rem; }
.checkbox-group label { display: flex; align-items: center; gap: .35rem; font-size: .88rem;
                        cursor: pointer; color: var(--text); font-weight: 400; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1.1rem;
       border: none; border-radius: 7px; font-size: .9rem; font-weight: 500; cursor: pointer;
       text-decoration: none; transition: all .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: .35rem .75rem; font-size: .82rem; }
.btn-full { width: 100%; justify-content: center; padding: .65rem; font-size: 1rem; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; padding: .65rem 1rem; font-size: .78rem; font-weight: 600; text-transform: uppercase;
     letter-spacing: .04em; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--border); }
td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.revoked td { opacity: .5; }

/* ── Badges ── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .76rem; font-weight: 600; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-gray   { background: #f1f5f9; color: var(--muted); }
.badge-blue   { background: #eff6ff; color: #1d4ed8; }

/* ── Auth pages ── */
.auth-wrap { width: 100%; min-height: 100vh; display: flex; align-items: center; justify-content: center;
             background: var(--bg); padding: 1rem; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
             padding: 2.5rem; width: 100%; max-width: 420px; }
.auth-card .brand { text-align: center; font-size: 1.4rem; font-weight: 700; margin-bottom: 1.75rem; }
.auth-card .brand strong { color: var(--primary); }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: .88rem; color: var(--muted); }
.auth-footer a { color: var(--primary); text-decoration: none; }

/* ── Tabs ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tabs button { padding: .65rem 1.25rem; border: none; background: none; cursor: pointer;
               font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent;
               margin-bottom: -1px; transition: all .15s; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ── Misc ── */
code { font-family: 'Courier New', monospace; font-size: .88em; background: var(--bg);
       padding: 2px 6px; border-radius: 4px; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.flex { display: flex; } .gap-1 { gap: .5rem; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; }

@media (max-width: 640px) {
    body { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; }
    .nav-list { display: flex; padding: 0; }
    .nav-list li a { padding: .5rem .75rem; }
    .sidebar-footer { display: none; }
    .content { padding: 1rem; }
}

/* ── Sidebar footer gear + logout ─────────────────────────────────────────── */
.sidebar-footer-actions { display: flex; align-items: center; gap: .5rem; margin-top: .6rem; }
.sidebar-gear { background: none; border: 1px solid var(--border); border-radius: 6px;
                padding: 3px 8px; cursor: pointer; font-size: .82rem; color: var(--muted);
                text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; transition: all .15s; }
.sidebar-gear:hover { background: var(--bg); color: var(--primary); border-color: var(--primary); }

/* ════════════════════════════════════════════════════════════════════════════
   CHAT LAYOUT — full-screen two-column
   ════════════════════════════════════════════════════════════════════════════ */
body.chat-page { overflow: hidden; height: 100vh; }

.chat-layout { display: flex; height: 100vh; width: 100%; overflow: hidden; }

/* ── Chat Sidebar ── */
.chat-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}
.chat-sidebar-top {
    padding: 1rem .75rem .5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-brand {
    font-size: 1.1rem; font-weight: 700; letter-spacing: -.4px;
    padding: 0 .5rem .75rem;
}
.chat-brand strong { color: var(--primary); }
.chat-brand small { color: var(--muted); font-weight: 400; font-size: .78rem; margin-left: 4px; }
.btn-new-chat {
    display: flex; align-items: center; gap: .5rem; width: 100%;
    padding: .6rem .85rem; border: 1px dashed var(--border); border-radius: 8px;
    background: none; cursor: pointer; font-size: .88rem; color: var(--muted);
    transition: all .15s;
}
.btn-new-chat:hover { border-color: var(--primary); color: var(--primary); background: #f0f0ff; }

/* ── Conversation / Project list ── */
.chat-conv-list {
    flex: 1; overflow-y: auto; padding: .5rem .5rem;
}
.chat-conv-list::-webkit-scrollbar { width: 4px; }
.chat-conv-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.chat-section-label {
    font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); padding: .6rem .5rem .2rem; opacity: .7;
}
.chat-project-header {
    display: flex; align-items: center; gap: .4rem;
    padding: .4rem .5rem; border-radius: 6px; cursor: pointer;
    font-size: .85rem; font-weight: 600; color: var(--text);
    transition: background .12s;
}
.chat-project-header:hover { background: var(--bg); }
.chat-project-emoji { font-size: 1rem; }
.chat-project-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-project-toggle { font-size: .7rem; color: var(--muted); transition: transform .2s; }
.chat-project-toggle.open { transform: rotate(90deg); }
.chat-project-convs { padding-left: 1.4rem; }
.chat-project-convs.hidden { display: none; }

.chat-conv-item {
    display: flex; align-items: center; gap: .4rem;
    padding: .38rem .5rem; border-radius: 6px; cursor: pointer;
    font-size: .84rem; color: var(--muted); transition: all .12s;
    position: relative;
}
.chat-conv-item:hover { background: var(--bg); color: var(--text); }
.chat-conv-item.active { background: #ededff; color: var(--primary); font-weight: 500; }
.chat-conv-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conv-del {
    display: none; background: none; border: none; cursor: pointer;
    font-size: .8rem; color: var(--muted); padding: 0 2px; line-height: 1;
}
.chat-conv-item:hover .chat-conv-del { display: block; }
.chat-conv-del:hover { color: var(--danger); }

/* ── Chat Sidebar Bottom ── */
.chat-sidebar-bottom {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    padding: .75rem;
}
.chat-user-info { font-size: .8rem; color: var(--muted); margin-bottom: .5rem;
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-user-name { font-weight: 600; color: var(--text); }
.chat-bottom-actions { display: flex; gap: .5rem; }
.chat-btn-action {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: .35rem;
    padding: .45rem .5rem; border: 1px solid var(--border); border-radius: 7px;
    background: none; cursor: pointer; font-size: .8rem; color: var(--muted);
    text-decoration: none; transition: all .15s;
}
.chat-btn-action:hover { border-color: var(--primary); color: var(--primary); background: #f0f0ff; }
.chat-btn-action.danger:hover { border-color: var(--danger); color: var(--danger); background: #fff5f5; }

/* ── Chat Main Area ── */
.chat-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-header {
    display: flex; align-items: center; gap: 1rem;
    padding: .85rem 1.25rem; border-bottom: 1px solid var(--border);
    background: var(--surface); flex-shrink: 0;
}
.chat-title {
    flex: 1; font-size: .95rem; font-weight: 600; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    cursor: pointer; border-radius: 5px; padding: 2px 6px; margin-left: -6px;
    transition: background .12s;
}
.chat-title:hover { background: var(--bg); }
.chat-title[contenteditable=true]:focus { outline: none; background: var(--bg); }
.model-select {
    padding: .35rem .75rem; border: 1px solid var(--border); border-radius: 7px;
    font-size: .85rem; background: var(--bg); color: var(--text); cursor: pointer;
    max-width: 240px;
}
.model-select:focus { outline: none; border-color: var(--primary); }

/* ── Messages Area ── */
.chat-messages {
    flex: 1; overflow-y: auto; padding: 1.5rem 2rem; display: flex; flex-direction: column; gap: 1.25rem;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.chat-empty {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center; color: var(--muted); gap: .75rem;
}
.chat-empty-icon { font-size: 2.5rem; opacity: .4; }
.chat-empty-text { font-size: .9rem; }

.msg { display: flex; gap: .75rem; max-width: 100%; }
.msg.user { justify-content: flex-end; }
.msg-bubble {
    max-width: 72%; padding: .75rem 1rem; border-radius: 12px;
    font-size: .9rem; line-height: 1.6;
}
.msg.user .msg-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant .msg-bubble {
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); border-bottom-left-radius: 4px;
}
.msg-bubble p { margin: 0 0 .6em; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble pre {
    background: rgba(0,0,0,.06); border-radius: 6px; padding: .75rem;
    overflow-x: auto; font-size: .82em; margin: .5em 0; line-height: 1.5;
}
.msg.user .msg-bubble pre { background: rgba(255,255,255,.15); }
.msg-bubble code { font-family: 'Courier New', monospace; font-size: .88em;
                   background: rgba(0,0,0,.06); padding: 2px 5px; border-radius: 3px; }
.msg-bubble pre code { background: none; padding: 0; }
.msg-bubble strong { font-weight: 600; }
.msg-bubble h3 { font-size: 1em; font-weight: 600; margin: .4em 0 .2em; }

.msg-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700; margin-top: 2px;
}
.msg.assistant .msg-avatar { background: #f0f0ff; color: var(--primary); border: 1px solid var(--border); }
.msg.user .msg-avatar { background: var(--primary); color: #fff; order: 1; }

.msg-typing { display: flex; gap: 4px; align-items: center; padding: 4px 0; }
.msg-typing span {
    width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
    animation: blink 1.2s infinite;
}
.msg-typing span:nth-child(2) { animation-delay: .2s; }
.msg-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity:.2; } 40% { opacity:1; } }

/* ── Input Bar ── */
.chat-input-bar {
    padding: 1rem 1.25rem; border-top: 1px solid var(--border);
    background: var(--surface); flex-shrink: 0;
}
.chat-input-wrap {
    display: flex; gap: .75rem; align-items: flex-end;
    background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
    padding: .5rem .5rem .5rem .9rem; transition: border .15s;
}
.chat-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.chat-textarea {
    flex: 1; border: none; background: none; resize: none; font-size: .92rem;
    font-family: inherit; color: var(--text); outline: none; min-height: 24px; max-height: 200px;
    line-height: 1.5;
}
.chat-textarea::placeholder { color: var(--muted); }
.btn-send {
    width: 36px; height: 36px; border-radius: 8px; border: none; flex-shrink: 0;
    background: var(--primary); color: #fff; cursor: pointer; font-size: 1rem;
    display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.btn-send:hover { background: var(--primary-h); }
.btn-send:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }
.chat-hint { font-size: .75rem; color: var(--muted); margin-top: .4rem; text-align: right; }

/* ── File attach button ── */
.btn-attach {
    width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--border); flex-shrink: 0;
    background: none; color: var(--text); cursor: pointer; font-size: 1.2rem; font-weight: 300;
    display: flex; align-items: center; justify-content: center; transition: color .15s, background .15s;
    padding: 0; line-height: 1;
}
.btn-attach:hover { background: var(--hover); color: var(--text); }
.btn-attach:disabled { opacity: .35; cursor: not-allowed; }

/* ── File chips ── */
.chat-attachments {
    display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem;
}
.file-chip {
    display: flex; align-items: center; gap: .3rem;
    background: var(--bg); border: 1px solid var(--border); border-radius: 20px;
    padding: .25rem .55rem .25rem .45rem; font-size: .8rem; max-width: 260px;
    animation: chipIn .15s ease;
}
.file-chip.loading { opacity: .8; }
.file-chip-spinner {
    width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
    border: 2px solid var(--border); border-top-color: var(--primary);
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes chipIn { from { opacity:0; transform:scale(.92); } to { opacity:1; transform:scale(1); } }
.file-chip-icon { font-size: .88rem; flex-shrink: 0; }
.file-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.file-chip-size { color: var(--muted); font-size: .73rem; flex-shrink: 0; white-space: nowrap; }
.file-chip-del {
    border: none; background: none; cursor: pointer; color: var(--muted); font-size: .9rem;
    padding: 0; line-height: 1; flex-shrink: 0; margin-left: .1rem;
}
.file-chip-del:hover { color: var(--danger); }

/* ── Drag over overlay ── */
.chat-main.drag-over::after {
    content: 'Pusti súbor sem';
    position: absolute; inset: 0; background: rgba(79,70,229,.08);
    border: 2px dashed var(--primary); border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: var(--primary); font-weight: 600;
    pointer-events: none; z-index: 10;
}
.chat-main { position: relative; }

/* ── Settings Modal ── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-box {
    background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px;
    max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-header {
    display: flex; align-items: center; padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-header h2 { flex: 1; font-size: 1.05rem; font-weight: 700; }
.modal-close {
    background: none; border: none; cursor: pointer; font-size: 1.4rem;
    color: var(--muted); line-height: 1; padding: 0; transition: color .15s;
}
.modal-close:hover { color: var(--text); }
.modal-body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; }
.modal-alert { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .88rem; }
.modal-alert.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.modal-alert.error   { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.modal-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.modal-tab {
    padding: .55rem 1rem; border: none; background: none; cursor: pointer;
    font-size: .88rem; color: var(--muted); border-bottom: 2px solid transparent;
    margin-bottom: -1px; transition: all .15s;
}
.modal-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.modal-tab-panel { display: none; }
.modal-tab-panel.active { display: block; }

/* ── Custom model dropdown ── */
.model-picker { position: relative; }
.model-picker-btn {
    display: flex; align-items: center; gap: .5rem;
    padding: .35rem .75rem; border: 1px solid var(--border); border-radius: 7px;
    background: var(--bg); cursor: pointer; font-size: .85rem; color: var(--text);
    max-width: 390px; min-width: 160px; transition: border .15s;
}
.model-picker-btn:hover { border-color: var(--primary); }
.model-picker-btn.open { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.model-picker-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.model-picker-arrow { font-size: .65rem; color: var(--muted); flex-shrink: 0; transition: transform .2s; }
.model-picker-btn.open .model-picker-arrow { transform: rotate(180deg); }

.model-picker-panel {
    position: absolute; top: calc(100% + 6px); right: 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18); z-index: 200;
    min-width: 380px; max-width: 520px; max-height: 440px;
    overflow-y: auto; display: none; padding-bottom: .4rem;
}
.model-search-wrap {
    position: sticky; top: 0; background: var(--surface);
    padding: .55rem .6rem .4rem; border-bottom: 1px solid var(--border); z-index: 1;
}
.model-search-input {
    width: 100%; box-sizing: border-box;
    padding: .35rem .65rem; border: 1px solid var(--border); border-radius: 7px;
    font-size: .83rem; background: var(--bg); color: var(--text); outline: none;
    transition: border .15s;
}
.model-search-input:focus { border-color: var(--primary); }
.model-show-more {
    padding: .3rem .85rem .4rem;
    font-size: .78rem; color: var(--primary); cursor: pointer;
}
.model-show-more:hover { text-decoration: underline; }
.model-picker-panel.open { display: block; }
.model-picker-panel::-webkit-scrollbar { width: 4px; }
.model-picker-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.model-cat-label {
    padding: .45rem .85rem .2rem;
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted); opacity: .7;
}
.model-opt {
    display: flex; align-items: center; gap: .5rem;
    padding: .42rem .85rem; cursor: pointer; font-size: .84rem;
    color: var(--text); transition: background .1s;
}
.model-opt:hover { background: var(--bg); }
.model-opt.selected { background: #ededff; color: var(--primary); font-weight: 500; }
.model-opt-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-aihook {
    flex-shrink: 0; font-size: .65rem; font-weight: 700; letter-spacing: .03em;
    padding: 1px 6px; border-radius: 4px;
    background: rgba(79,70,229,.12); color: var(--primary);
}
.badge-free {
    flex-shrink: 0; font-size: .65rem; font-weight: 700; letter-spacing: .03em;
    padding: 1px 6px; border-radius: 4px;
    background: rgba(34,197,94,.15); color: #16a34a;
    border: 1px solid rgba(34,197,94,.35);
}

/* ── Model presets ── */
.model-preset-list { padding: 6px 8px 2px; }
.model-preset-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    border-radius: 8px; cursor: pointer; border: 1px solid var(--border);
    background: linear-gradient(135deg, #f0f0ff 0%, #fff 100%);
    margin-bottom: 4px; transition: border-color .15s, box-shadow .15s;
}
.model-preset-item:hover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,70,229,.08); }
.model-preset-icon { font-size: 1.1rem; flex-shrink: 0; }
.model-preset-name { flex: 1; font-size: .85rem; font-weight: 600; color: var(--text); }
.model-preset-badge {
    font-size: .65rem; font-weight: 700; padding: 1px 6px; border-radius: 4px;
    background: rgba(34,197,94,.15); color: #16a34a; border: 1px solid rgba(34,197,94,.35);
}
.model-preset-badge--eu {
    background: rgba(59,130,246,.15); color: #1d4ed8; border-color: rgba(59,130,246,.35);
}
.model-picker-sep {
    text-align: center; font-size: .72rem; color: var(--muted);
    padding: 4px 0 2px; border-top: 1px solid var(--border); margin: 0 8px 2px;
}
@media (prefers-color-scheme: dark) {
    .model-preset-item { background: linear-gradient(135deg, #1e1e3a 0%, #1a1a2e 100%); }
}

/* ── Copy XML button ── */
.copy-xml-btn {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
    padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font-size: .8rem;
    cursor: pointer; transition: border-color .15s, background .15s;
}
.copy-xml-btn:hover { border-color: var(--primary); background: #f0f0ff; }

/* ── Project create button in sidebar ── */
.btn-new-project {
    display: flex; align-items: center; gap: .4rem; width: 100%;
    padding: .3rem .5rem; border: none; border-radius: 5px;
    background: none; cursor: pointer; font-size: .8rem; color: var(--muted);
    transition: all .12s;
}
.btn-new-project:hover { background: var(--bg); color: var(--primary); }
