/* ===================================================
   FRIDAY WORKSPACE — style.css (v29)
   Fill-based SVG mask ikony · ico-* prefix · CSS Grid
   =================================================== */

/* ── Proměnné ── */

:root {
    --bg: #0b0e14;
    --panel: #111622;
    --panel-soft: #151b28;
    --panel-soft-2: #171f30;
    --line: #1c2333;
    --line-strong: #2a344b;
    --accent: #d4a748;
    --accent-strong: #e0b85d;
    --text: #f3f5f7;
    --text-muted: #98a2b3;
    --text-soft: #c8d0dc;
    --sidebar-w: 260px;
    --sidebar-collapsed-w: 95px;
    --success: #37c871;
    --danger: #d96b6b;
    --warning: #f0b454;
    --user-bubble: #182235;
    --user-bubble-line: #2e446a;
    --assistant-bubble: #111622;
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

/* ── Reset ── */

html,
body {
    height: 100%;
}

body.is-dragover::before {
    content: "Pusť soubory pro nahrání";
    position: fixed;
    inset: 12px;
    border: 2px dashed var(--accent);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.35);
    color: #f3f5f7;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    pointer-events: none;
}

* {
    box-sizing: border-box;
    min-width: 0;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
}

button,
input,
textarea,
select {
    font: inherit;
}

/* ── App Shell ── */

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    height: 100vh;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed {
    grid-template-columns: var(--sidebar-collapsed-w) 1fr;
}

/* ── Sidebar ── */

.sidebar {
    background: var(--panel);
    border: 1px solid var(--line);
    margin: 12px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
    overflow: hidden;
    height: calc(100vh - 24px);
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    margin-bottom: 15px;
}

.sidebar-brand-horizontal {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    transition: 0.2s;
}

.brand-mark {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000;
    overflow: hidden;
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.1;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    text-align: left;
    border-radius: 10px;
    transition: 0.2s;
    white-space: nowrap;
    text-decoration: none;
}

.nav-item:hover {
    background: #151b28;
    color: var(--text);
}

.nav-item.active {
    background: #1c2333;
    color: white;
}

/* ══════════════════════════════════════════════════════
   SVG IKONY — mask-image systém (ico-* prefix)
   ══════════════════════════════════════════════════════ */

.nav-icon,
.tool-icon,
.search-icon-mini {
    width: 20px;
    height: 20px;
    display: inline-block;
    flex: 0 0 auto;
    background-color: var(--text-muted);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
    transition: background-color 0.18s ease;
}

/* Hover / active stavy */

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    background-color: var(--text);
}

.nav-item.active .nav-icon {
    background-color: var(--accent);
}

.tool-chip:hover .tool-icon,
.message-tool-btn:hover .tool-icon,
.message-tool-btn.is-open .tool-icon,
.tool-chip.is-recording .tool-icon {
    background-color: var(--accent);
}

.tool-chip-send .tool-icon {
    background-color: #111;
}

/* ── ico-chat-history ── */
.ico-chat-history {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

/* ── ico-learning ── */
.ico-learning {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 3L1 9l11 6 9-4.91V17h2V9M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 3L1 9l11 6 9-4.91V17h2V9M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82z'/%3E%3C/svg%3E");
}

/* ── ico-dashboard ── */
.ico-dashboard {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3 3h8v10H3V3zm0 12h8v6H3v-6zm10-12h8v6h-8V3zm0 8h8v10h-8V11z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3 3h8v10H3V3zm0 12h8v6H3v-6zm10-12h8v6h-8V3zm0 8h8v10h-8V11z'/%3E%3C/svg%3E");
}

/* ── ico-projects ── */
.ico-projects {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M20 6h-8l-2-2H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M20 6h-8l-2-2H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2z'/%3E%3C/svg%3E");
}

/* ── ico-templates ── */
.ico-templates {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M4 4h16v4H4V4zm0 6h8v10H4V10zm10 0h6v10h-6V10z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M4 4h16v4H4V4zm0 6h8v10H4V10zm10 0h6v10h-6V10z'/%3E%3C/svg%3E");
}

/* ── ico-voice ── */
.ico-voice {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath fill='%23fff' d='M19 10v2a7 7 0 0 1-14 0v-2H3v2a9 9 0 0 0 8 8.94V23h2v-2.06A9 9 0 0 0 21 12v-2h-2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath fill='%23fff' d='M19 10v2a7 7 0 0 1-14 0v-2H3v2a9 9 0 0 0 8 8.94V23h2v-2.06A9 9 0 0 0 21 12v-2h-2z'/%3E%3C/svg%3E");
}

/* ── ico-files ── */
.ico-files {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z'/%3E%3Cpath fill='%23fff' d='M14 2v6h6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z'/%3E%3Cpath fill='%23fff' d='M14 2v6h6'/%3E%3C/svg%3E");
}

/* ── ico-history ── */
.ico-history {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16z'/%3E%3Cpath fill='%23fff' d='M11 7h2v5.41l3.3 3.3-1.42 1.41L11 13.3V7z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16z'/%3E%3Cpath fill='%23fff' d='M11 7h2v5.41l3.3 3.3-1.42 1.41L11 13.3V7z'/%3E%3C/svg%3E");
}

/* ── ico-context ── */
.ico-context {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20V2H6.5A2.5 2.5 0 0 0 4 4.5v15zM4 19.5A2.5 2.5 0 0 0 6.5 22H20v-5H6.5A2.5 2.5 0 0 0 4 19.5z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20V2H6.5A2.5 2.5 0 0 0 4 4.5v15zM4 19.5A2.5 2.5 0 0 0 6.5 22H20v-5H6.5A2.5 2.5 0 0 0 4 19.5z'/%3E%3C/svg%3E");
}

/* ── ico-search ── */
.ico-search {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
}

/* ── ico-attach ── */
.ico-attach {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48 1.41 1.41-8.49 8.49a.5.5 0 0 0 0 .71.5.5 0 0 0 .71 0l9.19-9.19a2.5 2.5 0 0 0-3.54-3.54l-9.19 9.19a4.5 4.5 0 0 0 6.36 6.36l9.19-9.19 1.42 1.41z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48 1.41 1.41-8.49 8.49a.5.5 0 0 0 0 .71.5.5 0 0 0 .71 0l9.19-9.19a2.5 2.5 0 0 0-3.54-3.54l-9.19 9.19a4.5 4.5 0 0 0 6.36 6.36l9.19-9.19 1.42 1.41z'/%3E%3C/svg%3E");
}

/* ── ico-image ── */
.ico-image {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M21 19V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M21 19V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z'/%3E%3C/svg%3E");
}

/* ── ico-screenshot ── */
.ico-screenshot {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3 3h6v2H5v4H3V3zm12 0h6v6h-2V5h-4V3zM3 15h2v4h4v2H3v-6zm16 0h2v6h-6v-2h4v-4z'/%3E%3Crect fill='%23fff' x='7' y='7' width='10' height='10' rx='1'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3 3h6v2H5v4H3V3zm12 0h6v6h-2V5h-4V3zM3 15h2v4h4v2H3v-6zm16 0h2v6h-6v-2h4v-4z'/%3E%3Crect fill='%23fff' x='7' y='7' width='10' height='10' rx='1'/%3E%3C/svg%3E");
}

/* ── ico-audio ── */
.ico-audio {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath fill='%23fff' d='M19 10v2a7 7 0 0 1-14 0v-2H3v2a9 9 0 0 0 8 8.94V23h2v-2.06A9 9 0 0 0 21 12v-2h-2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath fill='%23fff' d='M19 10v2a7 7 0 0 1-14 0v-2H3v2a9 9 0 0 0 8 8.94V23h2v-2.06A9 9 0 0 0 21 12v-2h-2z'/%3E%3C/svg%3E");
}

/* ── ico-gdrive ── */
.ico-gdrive {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M7.71 3.5L1.15 15l2.86 5L10.57 8.5H7.71zM8.58 15l2.86 5h8.56l2.86-5H8.58zM16.29 3.5h-5.72l6.57 11.5h5.72L16.29 3.5z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M7.71 3.5L1.15 15l2.86 5L10.57 8.5H7.71zM8.58 15l2.86 5h8.56l2.86-5H8.58zM16.29 3.5h-5.72l6.57 11.5h5.72L16.29 3.5z'/%3E%3C/svg%3E");
}

/* ── ico-onedrive ── */
.ico-onedrive {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z'/%3E%3C/svg%3E");
}

/* ── ico-send ── */
.ico-send {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M2.01 21L23 12 2.01 3 2 10l15 2-15 2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M2.01 21L23 12 2.01 3 2 10l15 2-15 2z'/%3E%3C/svg%3E");
}

/* ── ico-copy ── */
.ico-copy {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M16 1H4a2 2 0 0 0-2 2v14h2V3h12V1zm3 4H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2zm0 16H8V7h11v14z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M16 1H4a2 2 0 0 0-2 2v14h2V3h12V1zm3 4H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2zm0 16H8V7h11v14z'/%3E%3C/svg%3E");
}

/* ── ico-export ── */
.ico-export {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z'/%3E%3C/svg%3E");
}

/* ── ico-folder-open ── */
.ico-folder-open {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M20 6h-8l-2-2H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zm0 12H4V8h16v10z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M20 6h-8l-2-2H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zm0 12H4V8h16v10z'/%3E%3C/svg%3E");
}

/* ══════════════════════════════════════════════════════
   KONEC IKON
   ══════════════════════════════════════════════════════ */

/* ── Sidebar collapsed ── */

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .bot-mode-select,
.sidebar-collapsed .bot-mode-label,
.sidebar-collapsed .bot-model-label {
    display: none !important;
}

.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
}

.sidebar-collapsed .nav-icon {
    margin: 0;
    width: 24px;
    height: 24px;
}

.sidebar-collapsed .sidebar-brand-horizontal {
    justify-content: center;
}

.sidebar-collapsed .sidebar-toggle {
    margin: 0 auto 15px auto;
    display: block;
}

.sidebar-bottom {
    border-top: 1px solid var(--line);
    padding-top: 15px;
    margin-top: auto;
}

.bot-mode-container {
    display: flex;
    flex-direction: column;
}

.bot-mode-label {
    font-size: 10px;
    color: #586170;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.bot-model-label {
    margin-top: 12px;
}

.bot-mode-select {
    width: 100%;
    background: #1c2333;
    border: 1px solid var(--line);
    color: white;
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    outline: none;
}

.bot-mode-mini-icon {
    display: none;
    text-align: center;
    font-size: 20px;
    cursor: pointer;
    padding: 8px 0 2px;
    color: var(--accent);
}

.sidebar-collapsed .bot-mode-mini-icon {
    display: block;
}

/* ── Main Layout (CSS Grid) ── */

.main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    padding: 10px 24px 10px 0;
    gap: 6px;
    height: 100vh;
    min-width: 0;
    min-height: 0;
}

/* Full-screen workspace (Učení / paměť) — bez chatu */
.app-shell.layout-focus-workspace .main {
    grid-template-rows: auto minmax(0, 1fr);
}

.app-shell.layout-focus-workspace .chat-area,
.app-shell.layout-focus-workspace .composer,
.app-shell.layout-focus-workspace #composerResizeHandle {
    display: none !important;
}

.app-shell.layout-focus-workspace .workspace-section {
    max-height: none;
    min-height: 0;
    height: 100%;
    flex: 1;
}

.app-shell.layout-focus-workspace .workspace-section.is-collapsed {
    max-height: none;
    min-height: 0;
}

.app-shell.layout-focus-workspace .workspace-card {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

/* Project dashboard — workspace nahoře, malý chat dole (jde zvětšit) */
.app-shell.layout-focus-project .main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) minmax(96px, 18vh) auto;
    grid-template-areas:
        "topbar"
        "workspace"
        "chat"
        "composer";
}

.app-shell.layout-focus-project .topbar {
    grid-area: topbar;
    margin-bottom: 0;
}

.app-shell.layout-focus-project .workspace-section {
    grid-area: workspace;
    max-height: none;
    min-height: 0;
    height: 100%;
    flex: 1;
}

.app-shell.layout-focus-project .workspace-section.is-collapsed {
    max-height: none;
    min-height: 0;
}

.app-shell.layout-focus-project .workspace-card {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-shell.layout-focus-project .workspace-toggle {
    display: none;
}

.app-shell.layout-focus-project .chat-area {
    grid-area: chat;
}

.app-shell.layout-focus-project .composer {
    grid-area: composer;
}

.app-shell.layout-focus-project #composerResizeHandle {
    display: none;
}

.app-shell.layout-focus-project:not(.project-chat-expanded) .composer-inner {
    min-height: 52px;
    height: 52px;
}

.app-shell.layout-focus-project:not(.project-chat-expanded) .chat-messages {
    padding: 10px 14px;
}

.app-shell.layout-focus-project.project-chat-expanded .main {
    grid-template-rows: auto minmax(140px, 34vh) minmax(160px, 1fr) 8px auto;
    grid-template-areas:
        "topbar"
        "workspace"
        "chat"
        "resize"
        "composer";
}

.app-shell.layout-focus-project.project-chat-expanded #composerResizeHandle {
    display: flex;
    grid-area: resize;
}

.app-shell.layout-focus-project.project-chat-expanded .composer-inner {
    min-height: 110px;
    height: 110px;
}

.chat-dock-toggle {
    display: none;
}

.app-shell.layout-focus-project .chat-dock-toggle {
    display: inline-flex;
    align-items: center;
}

.chat-project-context {
    display: inline-block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--accent-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.chat-project-context[hidden] {
    display: none !important;
}

.projects-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 12px;
    height: 100%;
    min-height: 0;
    flex: 1;
}

.project-dashboard-pane {
    min-height: 0;
}

.project-dash-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.project-dash-hint {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

.project-dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.project-dash-span {
    grid-column: 1 / -1;
}

.project-dash-link {
    color: var(--accent-strong);
    text-decoration: none;
}

.project-dash-link:hover {
    text-decoration: underline;
}

@media (max-width: 1180px) {
    .projects-layout,
    .project-dash-grid {
        grid-template-columns: 1fr;
    }

    .app-shell.layout-focus-project .main {
        grid-template-rows: auto minmax(0, 1fr) minmax(88px, 22vh) auto;
    }
}

/* Learning progress */
.learn-progress {
    height: 4px;
    width: 100%;
    border-radius: 999px;
    background: var(--line-strong);
    overflow: hidden;
    margin: 0 0 8px;
    flex-shrink: 0;
}

.learn-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: var(--accent);
}

.learn-progress.is-active .learn-progress-bar {
    width: 40%;
    animation: learn-progress-slide 1.05s ease-in-out infinite;
}

.learn-progress.is-idle .learn-progress-bar {
    width: 0%;
    animation: none;
}

.learn-progress-label {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 12px;
    min-height: 1.2em;
}

.learn-progress-label.is-active {
    color: var(--accent-strong);
}

@keyframes learn-progress-slide {
    0% { transform: translateX(-130%); }
    100% { transform: translateX(350%); }
}

.learn-pipeline {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 0 0 12px;
    flex-shrink: 0;
}

.learn-step {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 12px;
    padding: 8px 10px;
    cursor: pointer;
}

.learn-step-join {
    width: 8px;
    flex-shrink: 0;
    align-self: center;
    height: 2px;
    background: var(--line-strong);
}

.learn-step:hover {
    border-color: #3d5a87;
}

.learn-step.active {
    border-color: var(--accent);
    background: #1a2231;
}

.learn-step-num {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-strong);
}

.learn-step-title {
    font-size: 12px;
    font-weight: 700;
}

.learn-step-count {
    font-size: 11px;
    color: var(--text-muted);
}

.learn-layout {
    display: grid;
    grid-template-columns: 1.5fr 0.9fr;
    gap: 12px;
    min-height: 0;
    flex: 1;
}

.learn-topic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.learn-collect-text {
    width: 100%;
    min-height: 140px;
    resize: vertical;
    background: #121b2a;
    border: 1px solid #22314d;
    color: var(--text);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    font-size: 13px;
    line-height: 1.45;
}

.learn-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.learn-quota-input {
    width: 88px;
    background: #121b2a;
    border: 1px solid #22314d;
    color: var(--text);
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
}

.learn-verdict {
    font-size: 13px;
    font-weight: 700;
    margin: 6px 0;
}

.learn-verdict-passed { color: #7dffa6; }
.learn-verdict-revise { color: var(--accent-strong); }
.learn-verdict-needs_learning { color: #ff8b8b; }
.learn-verdict-pending { color: var(--text-soft); }

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.library-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #121b2a;
    border: 1px solid #22314d;
    border-radius: 10px;
    padding: 6px;
    cursor: pointer;
    color: var(--text-soft);
    font-size: 11px;
}
.library-card.is-selected {
    border-color: var(--accent);
}
.library-card img,
.library-thumb-fallback {
    width: 100%;
    height: 78px;
    object-fit: cover;
    border-radius: 8px;
    background: #0b0e14;
}
.library-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.library-card-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
    white-space: pre-wrap;
    font: inherit;
    font-size: 13px;
    line-height: 1.45;
    background: #121b2a;
    border: 1px solid #22314d;
    border-radius: 12px;
    padding: 12px;
    max-height: 280px;
    overflow: auto;
    color: var(--text);
}

@media (max-width: 980px) {
    .learn-layout,
    .learn-topic-grid {
        grid-template-columns: 1fr;
    }
    .learn-pipeline {
        flex-wrap: wrap;
        gap: 8px;
    }
    .learn-step {
        flex: 1 1 140px;
    }
    .learn-step-join {
        display: none;
    }
}

/* Chat focus — workspace sbalený, chat vyplní prostor */
.app-shell.layout-focus-chat .workspace-section {
    display: none !important;
}

.app-shell.layout-focus-chat .main {
    grid-template-rows: auto minmax(0, 1fr) auto auto;
}

/* ── Topbar ── */

.topbar {
    display: grid;
    grid-template-columns: 220px 1fr 160px;
    align-items: end;
    padding: 2px 0 6px 0;
    margin-bottom: 8px;
    column-gap: 14px;
    min-height: 0;
}

.topbar-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
}

.page-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.1;
    font-weight: 700;
    color: var(--text);
}

.page-subtitle {
    margin: 0;
    font-size: 10px;
    line-height: 1.15;
    color: var(--text-muted);
    font-weight: 500;
}

.topbar-center {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 0 6px;
    transform: translateY(8px);
}

.search-container {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.search-input-top {
    background: transparent;
    border: none;
    color: white;
    padding: 0 8px;
    width: 100%;
    height: 100%;
    outline: none;
    font-size: 13px;
}

.topbar-right {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #23283a;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 11px;
}

.user-name {
    font-size: 11px;
    color: #f3f5f7;
}

.user-avatar {
    width: 22px;
    height: 22px;
    background: var(--accent);
    color: black;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
}

/* ── Chat Area ── */

.chat-area {
    min-height: 0;
    height: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.chat-thread-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-soft);
    flex-shrink: 0;
}

.chat-thread-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-thread-label {
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.chat-thread-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-thread-new {
    flex-shrink: 0;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text-soft);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.chat-thread-new:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.chat-thread-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 20px;
    flex: 1;
    min-height: 0;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message.assistant {
    align-items: flex-start;
}

.message.user {
    align-items: flex-end;
}

.message-bubble {
    background: var(--assistant-bubble);
    padding: 12px 14px;
    border-radius: 12px;
    max-width: 85%;
    border: 1px solid var(--line);
    font-size: 14px;
    line-height: 1.45;
}

.message.user .message-bubble {
    background: var(--user-bubble);
    border-color: var(--user-bubble-line);
    color: #e8f1ff;
}

.message.is-status .message-bubble {
    color: #d9c185;
    border-style: dashed;
    background: #0f1520;
}

.image-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px;
}

.image-preview img {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid var(--line);
    object-fit: cover;
}

.image-info {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Message Footer ── */

.message-footer {
    width: min(85%, 100%);
    padding-left: 4px;
}

.message-footer-main {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 30px;
}

.message-date,
.message-time,
.message-meta-separator {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.message-meta-separator {
    opacity: 0.72;
    margin: 0 2px;
}

.message-tool-group {
    position: relative;
}

.message-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid #263047;
    border-radius: 999px;
    cursor: pointer;
    transition: 0.18s ease;
    color: var(--text-muted);
    flex: 0 0 auto;
}

.message-tool-btn:hover,
.message-tool-btn.is-open,
.reward-btn.is-active {
    background: #151b28;
    border-color: #40506f;
    color: var(--text);
}

.reward-btn {
    font-size: 14px;
}

.reward-emoji {
    line-height: 1;
    transform: translateY(0.5px);
}

.message-tool-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 190px;
    background: #111622;
    border: 1px solid #263047;
    border-radius: 12px;
    padding: 6px;
    display: none;
    z-index: 40;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.message-tool-group.is-open .message-tool-menu {
    display: block;
}

.message-tool-menu-item {
    width: 100%;
    border: none;
    background: transparent;
    color: #f3f5f7;
    font-size: 12px;
    text-align: left;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.message-tool-menu-item:hover {
    background: #1a2233;
}

/* ── Resize Handle ── */

.resize-handle {
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: row-resize;
    user-select: none;
    flex: 0 0 12px;
}

.resize-handle span {
    width: 72px;
    height: 4px;
    border-radius: 999px;
    background: #2a3145;
}

.resize-handle:hover span {
    background: var(--accent);
}

/* ── Composer ── */

.composer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
    min-height: 0;
    max-height: none;
}

.composer-inner {
    display: block;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    min-height: 110px;
    height: 110px;
    flex: 0 0 auto;
}

.composer-input {
    background: transparent;
    border: none;
    color: white;
    padding: 14px 12px;
    min-height: 0;
    height: 100%;
    width: 100%;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.45;
}

/* ── Integration Toolbar ── */

.integration-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
    color: #f3f5f7;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s ease;
    min-height: 38px;
}

.tool-chip:hover {
    border-color: #3a455f;
    background: #151b28;
}

.tool-chip-send {
    background: var(--accent);
    border-color: #c89530;
    color: #111;
    font-weight: 700;
    margin-left: auto;
    justify-content: center;
    min-width: 108px;
}

.tool-chip-send:hover {
    background: #ddb45b;
    border-color: #ddb45b;
    color: #111;
}

.tool-chip.is-recording {
    border-color: #7a2b2b;
    background: #2a1414;
    color: #ffe5e5;
}

/* ── Tooltips ── */

.has-tooltip {
    position: relative;
}

.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #151b28;
    color: #f3f5f7;
    border: 1px solid #2c3550;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 30;
}

.has-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
}

/* ── Attachments ── */

.attachment-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 18px;
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #151d2b;
    border: 1px solid #27324a;
    color: #f3f5f7;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.attachment-chip.cloud {
    border-color: #31476e;
    background: #132033;
}

.attachment-type {
    color: var(--accent);
    font-weight: 700;
    font-size: 11px;
}

.attachment-remove {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

/* ── Workspace Section ── */

.workspace-section {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 15px 15px 15px;
    display: flex;
    flex-direction: column;
    min-height: 270px;
    max-height: 320px;
    overflow: hidden;
    transition: min-height 0.25s ease, padding 0.25s ease;
}

.workspace-section.is-collapsed {
    min-height: 72px;
    max-height: 72px;
    padding-bottom: 12px;
}

.workspace-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.workspace-header-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
}

.workspace-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.workspace-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.1;
    font-weight: 700;
    color: #f3f5f7;
}

.workspace-summary {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.workspace-primary-btn,
.workspace-toggle,
.secondary-btn,
.inline-btn,
.context-chip,
.mode-card,
.audience-option,
.option-toggle,
.item-action-btn {
    transition: 0.18s ease;
}

.workspace-primary-btn {
    border: 1px solid #c89530;
    background: var(--accent);
    color: #111;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.workspace-primary-btn:hover {
    background: var(--accent-strong);
}

.workspace-toggle {
    font-size: 12px;
    line-height: 1;
    color: #f3f5f7;
    background: #2a3145;
    border: 1px solid #343d57;
    padding: 7px 11px;
    border-radius: 10px;
    white-space: nowrap;
    cursor: pointer;
}

.workspace-card {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.workspace-section.is-collapsed .workspace-card {
    display: none;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 1.05fr 1.2fr 0.95fr;
    gap: 12px;
    height: 100%;
    min-height: 180px;
}

.workspace-pane {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
    min-height: 0;
}

.pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pane-title {
    font-size: 12px;
    font-weight: 700;
    color: #f3f5f7;
}

.pane-body {
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-muted);
}

.pane-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.workspace-projects-toolbar {
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.workspace-projects-toolbar-center {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

.workspace-projects-toolbar-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.workspace-projects-count {
    min-height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #24304a;
    border-radius: 10px;
    background: #0f1520;
}

.workspace-sort-select {
    width: 150px;
    height: 36px;
    min-height: 36px;
    line-height: 1;
    font-size: 12px;
    padding: 0 10px;
}

.workspace-projects-toolbar .secondary-btn {
    height: 36px;
    min-height: 36px;
    width: auto;
    line-height: 1;
    padding: 0 14px;
    white-space: nowrap;
    flex: 0 0 auto;
}

.project-line-main {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.project-line-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
}

.project-line-separator {
    opacity: 0.7;
}

.pane-search,
.field-input,
.field-textarea,
.field-select {
    width: 100%;
    background: #0f1520;
    border: 1px solid #24304a;
    color: var(--text);
    border-radius: 10px;
    padding: 10px 12px;
    outline: none;
}

.field-textarea {
    min-height: 110px;
    resize: vertical;
}

.pane-search {
    font-size: 12px;
}

/* ── List Items ── */

.list-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-item-card {
    border: 1px solid #202a40;
    background: #101724;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: 0.18s ease;
}

.list-item-card:hover {
    border-color: #35507a;
    background: #141d2c;
}

.list-item-card.active {
    border-color: var(--accent);
    background: #1a2231;
}

.list-item-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.list-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.voice-meta-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ── Detail / Info / Control Cards ── */

.detail-card,
.info-card,
.control-card {
    background: #101724;
    border: 1px solid #202a40;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.detail-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Form Fields ── */

.field-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-row-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.field-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.range-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.range-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
}

.field-range {
    width: 100%;
}

/* ── Audience / Mode Cards ── */

.audience-grid,
.mode-grid {
    display: grid;
    gap: 8px;
}

.audience-option,
.mode-card {
    background: #121b2a;
    border: 1px solid #22314d;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    text-align: left;
    color: var(--text);
}

.audience-option:hover,
.mode-card:hover {
    border-color: #3d5a87;
}

.audience-option.active,
.mode-card.active {
    border-color: var(--accent);
    background: #1a2231;
}

.mode-card-title {
    font-size: 13px;
    font-weight: 700;
}

.mode-card-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* ── Tags & Badges ── */

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag,
.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.tag {
    background: #172131;
    border: 1px solid #283850;
    color: var(--text-soft);
}

.status-badge {
    background: #162334;
    border: 1px solid #334766;
    color: #dce9ff;
}

.status-badge.success {
    background: rgba(55, 200, 113, 0.12);
    border-color: rgba(55, 200, 113, 0.35);
    color: #9ef0be;
}

.status-badge.warning {
    background: rgba(240, 180, 84, 0.12);
    border-color: rgba(240, 180, 84, 0.35);
    color: #ffd58b;
}

.status-badge.danger {
    background: rgba(217, 107, 107, 0.12);
    border-color: rgba(217, 107, 107, 0.35);
    color: #ffb3b3;
}

/* ── Action Buttons ── */

.action-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.secondary-btn,
.item-action-btn,
.inline-btn {
    border: 1px solid #2d3b57;
    background: #151d2b;
    color: var(--text);
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 12px;
    cursor: pointer;
    text-align: left;
}

.secondary-btn:hover,
.item-action-btn:hover,
.inline-btn:hover {
    background: #1a2233;
    border-color: #42557d;
}

.secondary-btn.danger {
    border-color: #5a2a2a;
    color: #ffcbcb;
    background: #241515;
}

.context-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid #2b3a55;
    background: #141c2a;
    color: var(--text-soft);
    padding: 7px 10px;
    font-size: 11px;
    cursor: pointer;
}

.context-chip.active {
    border-color: var(--accent);
    color: #111;
    background: var(--accent);
    font-weight: 700;
}

/* ── Switch Row ── */

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #202a40;
    background: #101724;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 12px;
}

.switch-row input {
    accent-color: var(--accent);
}

.empty-state {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
    padding: 8px 0;
}

/* ── Modal ── */

.modal-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
}

.modal-layer.is-open {
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 10, 18, 0.72);
}

.modal {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(720px, calc(100vw - 32px));
    transform: translate(-50%, -50%);
    background: #0f1520;
    border: 1px solid #263047;
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.modal-header,
.modal-footer {
    padding: 16px 18px;
    border-bottom: 1px solid #202a40;
}

.modal-footer {
    border-bottom: none;
    border-top: 1px solid #202a40;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 65vh;
    overflow: auto;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
}

.modal-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Toast ── */

.toast-layer {
    position: fixed;
    right: 18px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 120;
}

.toast {
    min-width: 240px;
    max-width: 340px;
    background: #101724;
    border: 1px solid #2a3855;
    color: var(--text);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
    font-size: 12px;
}

.toast.success {
    border-color: rgba(55, 200, 113, 0.35);
}

.toast.info {
    border-color: rgba(212, 167, 72, 0.35);
}

/* ── Responsive ── */

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

    .workspace-pane {
        min-height: 180px;
    }

    .workspace-section {
        max-height: 380px;
    }
}

@media (max-width: 880px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .main {
        padding: 10px 12px;
        grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    }

    .topbar {
        grid-template-columns: 1fr;
        row-gap: 10px;
    }

    .topbar-center {
        transform: none;
        padding: 0;
    }

    .field-row-inline {
        grid-template-columns: 1fr;
    }

    .workspace-header {
        flex-direction: column;
        align-items: stretch;
    }

    .workspace-header-actions {
        justify-content: space-between;
    }

    .message-footer {
        width: 100%;
    }

    .message-footer-main {
        row-gap: 8px;
    }

    .workspace-section {
        min-height: 220px;
        max-height: 320px;
    }
}
