/* ============================================================
   Filmshop — Aha.io-style Product Management Workspace
   FILMSHOPS: Finance · InfoTech · Legal · Marketing
   Sales · Human-Loop · Operations · Products · Strategy
   ============================================================ */

.topbar-actions .filmshops-header-account { position: relative; flex: 0 0 auto; margin-left: 4px; }
.topbar-actions .filmshops-header-account .fs-ava-menu { top: calc(100% + 8px); bottom: auto; right: 0; left: auto; max-width: min(320px, 90vw); z-index: 10000; }
.topbar:has(.filmshops-header-account) { z-index: 100; }
.topbar-actions #fsAvatarBtn { position: relative; overflow: visible; }
.topbar .fs-global-download { flex: 0 0 auto; align-self: center; }
.topbar .row .fs-global-download { margin-left: auto; }
.topbar > .fs-global-download { margin: 0 10px; }
.topbar-actions .filmshops-auth-badge { position: absolute; right: -4px; bottom: -3px; width: 15px; height: 15px; padding: 2px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--border); object-fit: contain; }
.topbar-actions span.filmshops-auth-badge { display: grid; place-items: center; padding: 0; font-size: 13px; }
.topbar .fs-load-workspace { display: none !important; }
@media (max-width: 640px) {
    .topbar:has(.filmshops-header-account) { flex-wrap: wrap; height: auto; min-height: 72px; gap: 8px; padding: 10px 12px; }
    .topbar:has(.filmshops-header-account) .topbar-actions { flex: 1 1 100%; min-width: 0; max-width: 100%; max-height: none; flex-wrap: wrap; justify-content: flex-end; gap: 4px; overflow: visible; }
    .topbar-actions .filmshops-header-account { order: 99; }
}

:root {
    color-scheme: light;
    --bg: #f5f6fa;
    --surface: #ffffff;
    --surface-2: #fafbfd;
    --border: #e6e8f0;
    --text: #1b1f3b;
    --text-muted: #6b7192;
    --text-soft: #9aa0bd;
    --primary: #5b34d6;
    --primary-soft: #efe9ff;
    --primary-2: #7b5cf0;
    --accent: #ff6b6b;
    --green: #16a34a;
    --green-soft: #dcfce7;
    --amber: #d97706;
    --amber-soft: #fef3c7;
    --red: #dc2626;
    --red-soft: #fee2e2;
    --blue: #2563eb;
    --blue-soft: #dbeafe;
    --shadow-sm: 0 1px 2px rgba(20, 24, 60, .06);
    --shadow: 0 4px 16px rgba(20, 24, 60, .08);
    --shadow-lg: 0 12px 40px rgba(20, 24, 60, .14);
    --radius: 14px;
    --radius-sm: 10px;
    --sidebar-w: 264px;
}

[data-theme="dark"],
:root:has(.theme-toggle-cb:checked) {
    color-scheme: dark;
    --bg: #0e1020;
    --surface: #171a2e;
    --surface-2: #1e2138;
    --border: #2a2e4a;
    --text: #eef0fb;
    --text-muted: #a7adcf;
    --text-soft: #757ba0;
    --primary: #8b6cf5;
    --primary-soft: #26224a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 4px 16px rgba(0, 0, 0, .4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
/* Match the sidebar nav's skinny scrollbar on the main page (document) scroll */
html::-webkit-scrollbar { width: 6px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; transition: background .2s ease; }
html:hover::-webkit-scrollbar-thumb { background: var(--text-soft); }
html::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---------------- Layout ---------------- */
.app { display: flex; min-height: 100vh; height: 100vh; overflow: hidden; }

/* ---------------- Sidebar ---------------- */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
}
/* Scrollable nav region — locks the brand header and sidebar footer in place */
.nav-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}
/* Modern skinny scrollbar (WebKit / Chromium) */
.nav-scroll::-webkit-scrollbar { width: 6px; }
.nav-scroll::-webkit-scrollbar-track { background: transparent; }
.nav-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
    transition: background .2s ease;
}
.nav-scroll:hover::-webkit-scrollbar-thumb { background: var(--text-soft); }
.nav-scroll::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 8px 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    box-sizing: border-box;
    min-height: 54px; /* = 72px chrome header - 18px sidebar top padding, so its bottom line aligns with the topbar + docked agent header */
}
.brand .mark {
    width: 40px; height: 40px;
    display: grid; place-items: end center;
    color: #fff; font-weight: 800; font-size: 18px;
    letter-spacing: -1px;
}
.brand a.mark { text-decoration: none; }
.brand .mark .mark-logo { width: 24px; height: 24px; display: block; }
.brand h1 { font-size: 16px; font-weight: 800; letter-spacing: -.3px; line-height: 1.15; color: var(--text); }
.brand-head .brand-home-link { display: contents; }
.brand-head .brand-home-link h1 { cursor: pointer; transition: color .15s; color: var(--text); }
.brand-head .brand-home-link:hover h1 { color: var(--primary); }
.brand span.sub { font-size: 11px; color: var(--text-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }
.brand .ver { font-size: 10px; font-weight: 700; color: var(--text-muted); letter-spacing: .4px; flex: 0 0 auto; white-space: nowrap; align-self: baseline; }
.rdm-sow-edit { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: 2px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text-muted); font-size: 12px; line-height: 1; cursor: pointer; padding: 0; }
.rdm-sow-edit:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
/* Draggable Gantt SoW bars — grab to move, grab an edge to resize/extend. */
.gnt-sow-bar { cursor: grab; }
.gnt-sow-bar::before, .gnt-sow-bar::after { content: ''; position: absolute; top: 0; bottom: 0; width: 7px; pointer-events: none; opacity: 0; background: rgba(255,255,255,0.7); transition: opacity .12s; }
.gnt-sow-bar::before { left: 0; border-radius: 4px 0 0 4px; }
.gnt-sow-bar::after { right: 0; border-radius: 0 4px 4px 0; }
.gnt-sow-bar:hover::before, .gnt-sow-bar:hover::after { opacity: 0.5; }
.gnt-sow-bar.rdm-dragging { cursor: grabbing; filter: brightness(1.06); box-shadow: 0 0 0 2px var(--primary), 0 2px 7px rgba(0,0,0,0.28); z-index: 5; }
/* Small (S) person-day size removed from views: hide any remaining S resourcing columns / overlay fills. */
.rc-c-s { display: none !important; }
.rc-track .rc-fill.rc-f-s { display: none !important; }
/* Shared ARB / CAB questionnaire + answer-set styles (used by scripts/informationtech/arb.js and change-review.js) */
.acc-btn { display:inline-flex; align-items:center; gap:6px; font-family:inherit; font-size:13px; font-weight:600; padding:8px 14px; border-radius:8px; cursor:pointer; border:1px solid var(--border); background:var(--surface); color:var(--text-muted); }
.acc-btn:hover { background:var(--surface-2); }
.acc-btn.primary { border:none; color:#fff; background:linear-gradient(135deg,var(--primary),var(--primary-2)); }
.acc-btn.ghost { background:var(--surface); }
.acc-btn .material-icons { font-size:17px; }
.acc-x { width:30px; height:30px; display:grid; place-items:center; border-radius:7px; border:1px solid var(--border); background:var(--surface); cursor:pointer; color:var(--text-muted); }
.acc-x .material-icons { font-size:16px; }
.acc-x.del:hover { border-color:var(--red); color:var(--red); background:var(--red-soft); }
.arb-board-chip { display:inline-flex; align-items:center; gap:5px; font-weight:600; font-size:12.5px; }
.arb-board-chip .material-icons { font-size:16px; color:var(--primary); }
.arb-empty { text-align:center; padding:24px; color:var(--text-soft); font-size:13.5px; }
.arb-none { color:var(--text-soft); }
.arb-form { display:flex; flex-direction:column; gap:10px; }
.arb-fgrid { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; }
.arb-field label { display:block; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--text-soft); margin-bottom:4px; }
.arb-field .req { color:var(--red); }
.arb-field input, .arb-field select { width:100%; box-sizing:border-box; padding:8px 10px; border:1px solid var(--border); border-radius:7px; font-family:inherit; font-size:13px; background:var(--surface); color:var(--text); }
.arb-field input:focus, .arb-field select:focus { outline:none; border-color:var(--primary); }
.arb-field input.invalid { border-color:var(--red); }
.arb-qlabel { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.4px; color:var(--text-soft); margin-top:4px; }
.arb-qrow { display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.arb-qrow .arb-qtext { flex:1; min-width:0; padding:8px 10px; border:1px solid var(--border); border-radius:7px; font-family:inherit; font-size:13px; background:var(--surface); color:var(--text); }
.arb-qrow .arb-qseltype { padding:8px 10px; border:1px solid var(--border); border-radius:7px; font-family:inherit; font-size:12.5px; background:var(--surface); color:var(--text); }
.arb-qreq { display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:600; color:var(--text-muted); white-space:nowrap; }
.arb-form-actions { display:flex; gap:8px; margin-top:6px; }
.arb-qwrap { align-items:start; }
.arb-qsaved { display:flex; flex-direction:column; gap:10px; }
.arb-qcard { border:1px solid var(--border); border-left:3px solid var(--primary); border-radius:10px; padding:12px; background:var(--surface-2); }
.arb-qcard-head { display:flex; align-items:center; justify-content:space-between; }
.arb-qcard-acts { display:flex; align-items:center; gap:6px; }
.arb-qcard h5 { margin:6px 0 8px; font-size:13.5px; font-weight:700; }
.arb-qlist { margin:0; padding-left:18px; display:flex; flex-direction:column; gap:5px; font-size:12.5px; color:var(--text); }
.arb-qtype { font-size:10px; font-weight:700; color:var(--primary); background:var(--primary-soft); border-radius:12px; padding:1px 7px; margin-left:5px; }
.arb-req { font-size:10px; font-weight:700; color:var(--red); margin-left:5px; }
.arb-mini { display:inline-flex; align-items:center; gap:4px; font-family:inherit; font-size:12px; font-weight:600; padding:5px 10px; border-radius:16px; border:1px solid var(--primary); color:var(--primary); background:var(--primary-soft); cursor:pointer; }
.arb-mini:hover { background:var(--primary); color:#fff; }
.arb-mini .material-icons { font-size:15px; }
/* Shared month calendar control (FS_CALENDAR) */
.fs-cal { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.fs-cal-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.fs-cal-title { font-weight: 700; font-size: 15px; margin-right: auto; }
.fs-cal-nav { display: inline-flex; align-items: center; gap: 4px; font-family: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text-muted); cursor: pointer; }
.fs-cal-nav:hover { background: var(--surface-2); }
.fs-cal-nav .material-icons { font-size: 18px; }
.fs-cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.fs-cal-dow span { padding: 6px 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-soft); }
.fs-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.fs-cal-cell { min-height: 88px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 5px 6px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.fs-cal-cell:nth-child(7n) { border-right: none; }
.fs-cal-cell.muted-cell { background: var(--surface-2); }
.fs-cal-cell.muted-cell .fs-cal-dnum { opacity: .45; }
.fs-cal-dnum { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.fs-cal-cell.is-today { background: var(--primary-soft); }
.fs-cal-cell.is-today .fs-cal-dnum { color: var(--primary); }
.fs-cal-ev { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--ec, var(--primary)); border-radius: 5px; padding: 2px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-cal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ec, var(--primary)); flex: none; }
.fs-cal-more { font-size: 10.5px; font-weight: 700; color: var(--text-soft); }
@media (max-width: 720px) { .fs-cal-cell { min-height: 62px; } .fs-cal-ev { font-size: 10px; } }
.brand { align-items: flex-start; }
.brand-body { flex: 1; min-width: 0; }
/* Version sits at the top and the filmshop name at the bottom, aligning the name
   with the bottom edge of the 40px logo tile. */
.brand-head { display: flex; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 8px; }
.brand-body h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: -8px; }
.brand-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 10.5px; font-weight: 600; color: var(--text-soft); white-space: normal; overflow: hidden; margin-left: -8px; margin-top: 1px; line-height: 1.2; }
.fs-brand-pick { display: flex; align-items: center; gap: 4px; margin-top: 7px; }
.fs-brand-select { flex: 1 1 auto; min-width: 0; font-family: inherit; font-size: 11px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text); }
.fs-brand-ic { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); display: grid; place-items: center; cursor: pointer; }
.fs-brand-ic:hover { color: var(--primary); border-color: var(--primary); }
.fs-brand-ic .material-icons { font-size: 15px; }

/* Hamburger relocated into the nav header (sidebar brand). */
.brand > .menu-btn { align-self: center; flex: 0 0 auto; }
@media (min-width: 861px) {
    .app.rail .sidebar .brand { justify-content: center; }
    .app.rail .sidebar .brand .mark { margin: 0 auto; }
}

/* Filmshop switcher in the content header (topbar) — title on top, then a row with
   the dropdown and the breadcrumb beside it. */
.fs-tp-row { display: flex; align-items: center; gap: 12px; margin-top: 7px; flex-wrap: wrap; flex-basis: 100%; }
.fs-tp-row .crumbs { padding-left: 6px; margin: 0; }
/* Filmshop switcher styled like the title status control (pill + dropdown). */
.fs-shop-wrap { margin-left: 0; }
.fs-shop-btn { min-width: 180px; max-width: 340px; }
.fs-shop-btn .caret { margin-left: auto; }
.fs-shop-btn > span:not(.material-icons) { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#fsBrandMenu { min-width: 240px; }
/* Whitelabel selector (left of the filmshop selector); hidden until whitelabels load. */
.fs-wl-wrap[hidden] { display: none; }
.fs-wl-btn { min-width: 140px; max-width: 240px; }
.fs-wl-btn .caret { margin-left: auto; }
.fs-wl-btn > span:not(.material-icons) { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#fsWlMenu { min-width: 200px; }
.fs-status-sep { height: 1px; margin: 5px 4px; background: var(--border); }
.fs-status-empty { opacity: .6; cursor: default; }
.fs-topbar-pick { display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.fs-topbar-pick .fs-tp-ic { font-size: 18px; color: var(--text-soft); }
.fs-topbar-pick .fs-brand-select { flex: 0 1 190px; background: var(--surface); }
.fs-topbar-pick .fs-brand-ic { background: var(--surface); }

/* Nav label — emphasized inline first letter with a slight space. */
.nav-fl { font-weight: 800; color: var(--primary); margin-right: 0; letter-spacing: -.3px; }
.nav-item.active .nav-fl { color: currentColor; }

/* Branded "Start · Filmshops · Ai" divider between the Intro group and the build
   sections — the dots are rendered as connecting divider lines. */
.nav-brand-div { display: flex; align-items: center; gap: 7px; margin: 4px 6px 12px; }
.nav-brand-div .nbd-w { font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--text-soft); white-space: nowrap; }
.nav-brand-div .nbd-fl { font-style: normal; color: var(--primary); }
.nav-brand-div .nbd-line { flex: 1 1 auto; min-width: 8px; height: 1px; background: linear-gradient(90deg, transparent, var(--border) 30%, var(--border) 70%, transparent); }
@media (min-width: 861px) {
    .app.rail .sidebar .nav-brand-div { margin: 4px 2px 10px; flex-direction: column; gap: 4px; }
    .app.rail .sidebar .nav-brand-div .nbd-w { display: none; }
    .app.rail .sidebar .nav-brand-div .nbd-line { width: 100%; min-width: 0; }
}

/* Release notes (Settings tab). */
.release-list { list-style: disc; padding-left: 20px; margin: 6px 0 2px; }
.release-list li { margin: 5px 0; font-size: 13.5px; color: var(--text); line-height: 1.5; }
.release-entry .panel-head h4 { font-size: 15px; }
.release-note { margin-top: 2px; }
.release-list code, .release-note code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

.nav-group { margin-bottom: 7px; }
.nav-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-soft);
    padding: 12px 10px 6px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-item .key {
    width: 22px; height: 22px;
    flex-shrink: 0;
    border-radius: 6px;
    display: grid; place-items: center;
    font-size: 11px; font-weight: 800;
    background: var(--surface-2);
    color: var(--text-soft);
}
.nav-item.active .key { background: var(--primary); color: #fff; }
.nav-item .material-icons { font-size: 19px; }

/* ---------------- Submenu (nested nav) ---------------- */
.nav-parent { display: flex; align-items: center; gap: 2px; }
.nav-parent .nav-item { flex: 1; }
.nav-toggle {
    border: none; background: none; cursor: pointer;
    color: var(--text-soft); width: 30px; height: 34px;
    border-radius: 8px; display: grid; place-items: center; flex-shrink: 0;
    transition: background .15s, color .15s;
}
.nav-toggle:hover { background: var(--surface-2); color: var(--text); }
.nav-toggle .material-icons { font-size: 20px; transition: transform .2s; }
.nav-parent.open .nav-toggle .material-icons { transform: rotate(180deg); }
.nav-sub { display: none; margin: 2px 0 4px 24px; padding-left: 8px; border-left: 2px solid var(--border); }
.nav-sub.open { display: block; }
.nav-item.sub { font-size: 12.5px; padding: 7px 10px; font-weight: 600; }
.nav-item.sub .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-soft); flex-shrink: 0; margin-left: 4px; }
.nav-item.sub.active .dot { background: var(--primary); }
.nav-item.sub .nav-sub-ico { font-size: 17px; flex-shrink: 0; color: var(--text-soft); }
.nav-item.sub:hover .nav-sub-ico { color: var(--text); }
.nav-item.sub.active .nav-sub-ico { color: var(--primary); }

/* Maturity + operational "heat" indicators (sidebar nav + page title) */
.heat-set { display: inline-flex; align-items: center; gap: 6px; }
.nav-item .heat-set { margin-left: auto; }
.heat { display: inline-flex; align-items: center; gap: 3px; line-height: 1; }
.nav-item .heat .material-icons { font-size: 14px; }
.heat.lvl-1 { color: #e03131; }
.heat.lvl-2 { color: #f76707; }
.heat.lvl-3 { color: #f2b705; }
.heat.lvl-4 { color: #2f9e44; }
.heat.lvl-5 { color: #1971c2; }
.title-heat { margin-top: 6px; }
.heat-set-lg { gap: 8px; flex-wrap: wrap; }
.heat-set-lg .heat { font-size: 0.72rem; font-weight: 700; padding: 2px 9px 2px 7px; border: 1px solid var(--border); border-radius: 999px; }
.heat-set-lg .heat .material-icons { font-size: 14px; }
.heat-txt { white-space: nowrap; }

/* Dot separator between nav groups (e.g. Services · Agents). */
.nav-sep { position: relative; height: 1px; background: var(--border); margin: 14px 12px; }
.nav-sep::before {
    content: ""; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-soft); border: 3px solid var(--surface);
}

/* ---------------- Collapsible sidebar ----------------
   Sizing is driven by script.js, which toggles `.app.rail` for the icon-rail
   look: full sidebar at >=1200px, rail at 861-1199px, and an off-canvas drawer
   (`.sidebar.open` + `.app.nav-open`) on mobile (<=860px). The menu button
   toggles rail<->full at any non-mobile width. Section open/closed state uses
   `.nav-parent.open` + `.nav-sub.open` (above). */
.sidebar { transition: width .18s ease, padding .18s ease; }

/* Draggable divider to resize the full sidebar (desktop only). Fixed to the
   sidebar's right edge via --sidebar-w; hidden in the icon rail and on mobile.
   Width persists to localStorage (filmshop.navWidth). */
.nav-resizer {
    position: fixed; top: 0; left: var(--sidebar-w); width: 8px; height: 100vh;
    margin-left: -4px; cursor: col-resize; z-index: 60; touch-action: none;
}
.nav-resizer::after {
    content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px;
    background: transparent; transition: background .15s ease;
}
.nav-resizer:hover::after, .nav-resizer.dragging::after { background: var(--primary); }
.app.rail .nav-resizer { display: none; }
@media (max-width: 860px) { .nav-resizer { display: none; } }
body.nav-resizing { cursor: col-resize; user-select: none; }
@media (min-width: 861px) {
    .app.rail .sidebar { width: 66px; padding-left: 8px; padding-right: 8px; }
    .app.rail .sidebar .nav-label,
    .app.rail .sidebar .nav-sub,
    .app.rail .sidebar .nav-toggle,
    .app.rail .sidebar .brand > div:last-child,
    .app.rail .sidebar .brand .mark,
    .app.rail .sidebar .footer-signin,
    .app.rail .sidebar .nav-item > .material-icons,
    .app.rail .sidebar .nav-item .heat-set,
    .app.rail .sidebar .nav-lbl .nav-rest { display: none; }
    .app.rail .sidebar .nav-item { justify-content: center; gap: 0; padding-left: 6px; padding-right: 6px; }
    .app.rail .sidebar .nav-lbl { display: inline-flex; justify-content: center; }
    .app.rail .sidebar .nav-lbl .nav-fl { margin: 0; font-size: 16px; }
    .app.rail .sidebar .nav-parent { gap: 0; }
    .app.rail .sidebar .brand { justify-content: center; padding-left: 0; padding-right: 0; }
    .app.rail .sidebar .sidebar-footer { padding-left: 4px; padding-right: 4px; }
    .app.rail .sidebar .sidebar-footer .fs-footer-persona { justify-content: center; }
    .app.rail .sidebar .sidebar-footer #fsBrandName,
    .app.rail .sidebar .sidebar-footer #fsWlName,
    .app.rail .sidebar .sidebar-footer .fs-title-status .caret,
    .app.rail .sidebar .sidebar-footer .fs-footer-persona > div:not(.avatar) { display: none; }
    .app.rail .sidebar .sidebar-footer .fs-shop-btn,
    .app.rail .sidebar .sidebar-footer .fs-wl-btn { justify-content: center; padding-left: 6px; padding-right: 6px; }
    .app.rail .sidebar .sidebar-footer .fs-status-menu { left: 0; right: auto; min-width: 230px; }
    .app.rail .sidebar .sidebar-footer .fs-storage-bar { justify-content: center; padding-left: 0; padding-right: 0; }
    .app.rail .sidebar .sidebar-footer .fs-storage-bar .fs-sb-meter,
    .app.rail .sidebar .sidebar-footer .fs-storage-bar .fs-sb-txt { display: none; }
}

/* Mobile drawer backdrop (created by script.js, shown when the drawer is open). */
.nav-overlay { display: none; }

/* Frozen Desktop launcher pinned to the bottom-left of the sidebar. It stays put
   when the sidebar footer is relocated into the agent panel. */
.sidebar .fs-desktop-pin {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 11px;
    padding: 12px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px; font-weight: 700;
}
.sidebar button.fs-desktop-pin { width:100%; border:0; background:transparent; font:inherit; text-align:left; cursor:pointer; }
.sidebar .fs-desktop-pin:hover { color: var(--primary); background: var(--primary-soft); }
.sidebar .fs-desktop-pin .material-icons { font-size: 20px; color: var(--primary); flex-shrink: 0; }
@media (min-width: 861px) {
    .app.rail .sidebar .fs-desktop-pin { justify-content: center; padding-left: 6px; padding-right: 6px; }
    .app.rail .sidebar .fs-desktop-pin .fs-pin-lbl { display: none; }
}

/* Pin toggle sits inline at the end of the row and reserves its space, so it never
   overlaps the count badge and the row doesn't shift on hover. */
.sidebar .nav-item { position: relative; }
.sidebar .nav-group > .nav-item .nav-lbl,
.sidebar .nav-item.sub .nav-sub-lbl { flex: 1 1 auto; min-width: 0; }
.nav-pin-btn {
    flex: 0 0 auto; margin-left: 4px;
    width: 20px; height: 20px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    visibility: hidden;
    color: var(--text-soft); cursor: pointer;
}
.sidebar .nav-item:hover .nav-pin-btn { visibility: visible; }
.nav-pin-btn.pinned { visibility: visible; color: var(--primary); }
.nav-pin-btn:hover { background: var(--primary-soft); color: var(--primary); }
.nav-pin-btn .material-icons { font-size: 14px; transform: rotate(45deg); }
.nav-pin-btn.pinned .material-icons { transform: none; }
.sidebar .nav-item:has(.nav-pin-btn.pinned) { box-shadow: inset 2px 0 0 var(--primary); }
.nav-group.nav-pinned { border-bottom: 1px solid var(--border); margin-bottom: 4px; padding-bottom: 4px; }
.nav-group.nav-pinned[hidden] { display: none; }
.nav-pinned-title { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--text-soft); padding: 6px 12px 4px; }
.nav-pinned-title .material-icons { font-size: 13px; transform: rotate(45deg); }
@media (min-width: 861px) {
    .app.rail .sidebar .nav-pin-btn { display: none !important; }
    .app.rail .sidebar .nav-pinned-title { justify-content: center; }
    .app.rail .sidebar .nav-pinned-title span:last-child { display: none; }
}

/* Pinned items in the Settings › Appearance list. */
.dsk-pins { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.dsk-pins-empty { font-size: 12.5px; color: var(--text-soft); }
.dsk-pin-row { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); font-size: 12.5px; }
.dsk-pin-row .material-icons { font-size: 17px; color: var(--primary); }
.dsk-pin-lbl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
.dsk-pin-x { flex: 0 0 auto; width: 24px; height: 24px; border: none; background: none; border-radius: 6px; color: var(--text-soft); font-size: 18px; line-height: 1; cursor: pointer; }
.dsk-pin-x:hover { background: var(--red-soft); color: var(--red); }

/* Desktop colour tint controls (Settings → Appearance): Leather tint + Battlestation RGB accent. */
.dsk-leather-ctl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.dsk-leather-swatches { display: flex; gap: 7px; }
.dsk-leather-swatch, .dsk-station-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.dsk-leather-swatch:hover, .dsk-station-swatch:hover { transform: scale(1.08); }
.dsk-leather-swatch.on, .dsk-station-swatch.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
#dsk-leather, #dsk-station { width: 42px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; padding: 2px; }

.sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 8px 8px;
}
.fs-footer-controls { display: flex; flex-direction: column; gap: 8px; }
.fs-footer-persona { display: flex; align-items: center; gap: 10px; }
/* Config + whitelabel controls relocated into the nav footer: full-width buttons
   whose dropdowns open upward. */
.sidebar-footer .fs-status-wrap { position: relative; display: block; width: 100%; margin: 0; }
.sidebar-footer .fs-wl-wrap[hidden] { display: none; }
.sidebar-footer .fs-shop-btn,
.sidebar-footer .fs-wl-btn {
    width: 100%; min-width: 0; max-width: none;
    justify-content: flex-start; gap: 8px;
    padding: 9px 12px; border-radius: 10px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); font-size: 13px; font-weight: 700;
}
.sidebar-footer .fs-shop-btn:hover,
.sidebar-footer .fs-wl-btn:hover { background: var(--surface-2); }
.sidebar-footer .fs-shop-btn > .material-icons:first-child { color: var(--blue); }
.sidebar-footer .fs-wl-btn > .material-icons:first-child { color: var(--primary); }
.sidebar-footer .fs-shop-btn > span:not(.material-icons),
.sidebar-footer .fs-wl-btn > span:not(.material-icons) { flex: 1; max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer .fs-shop-btn .caret,
.sidebar-footer .fs-wl-btn .caret { margin-left: auto; color: var(--text-muted); }
.sidebar-footer .fs-status-menu { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; min-width: 0; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #ff9a6b, #ff6b6b);
    display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px;
}
.sidebar-footer .who { font-size: 12.5px; font-weight: 700; }
.sidebar-footer .role { font-size: 11px; color: var(--text-soft); }

/* Thin storage status bar: disk space used by the loaded filmshops. */
.fs-storage-bar {
    display: flex; align-items: center; gap: 7px;
    padding: 6px 8px; margin-top: 2px;
    border-top: 1px solid var(--border);
    font-size: 10.5px; font-weight: 700; color: var(--text-soft);
    letter-spacing: .2px;
}
.fs-storage-bar > .material-icons:first-child { font-size: 14px; color: var(--text-muted); }
.fs-storage-bar .fs-sb-meter {
    flex: 1; min-width: 0; height: 5px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border); overflow: hidden;
}
.fs-storage-bar .fs-sb-meter > i {
    display: block; height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--blue), var(--primary));
    transition: width .25s ease;
}
.fs-storage-bar .fs-sb-meter > i.warn { background: linear-gradient(90deg, #f0a020, #e07b00); }
.fs-storage-bar .fs-sb-meter > i.over { background: linear-gradient(90deg, #e05555, #c62828); }
.fs-storage-bar .fs-sb-txt { flex-shrink: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Export Package action, mounted under the footer (empty on pages without the export module). */
.fs-export-footer:empty { display: none; }
.fs-export-footer { margin-top: 2px; display: flex; flex-direction: column; gap: 6px; }
.fs-export-footer button { width: 100%; justify-content: center; padding: 9px 12px !important; border-radius: 10px !important; }

/* ---------------- Main ---------------- */
.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 30px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
    flex-shrink: 0;
    box-sizing: border-box;
    min-height: 72px; /* shared chrome header height so its bottom line aligns with the sidebar brand + docked agent header */
}
.topbar .row { align-items: flex-start; flex: 1 1 auto; min-width: 0; }
.crumbs { font-size: 12.5px; color: var(--text-soft); font-weight: 600; }
.crumbs b { color: var(--text); }
.topbar h2.fs-crumb-title { font-size: 13px; font-weight: 600; color: var(--text-soft); letter-spacing: 0; margin: 0; }
.topbar h2.fs-crumb-title b { color: var(--text); font-weight: 700; }
.topbar h2 { font-size: 20px; font-weight: 800; letter-spacing: -.4px; margin-top: 2px; }
.topbar .row h2.fs-has-status { display: inline-block; }
.fs-status-wrap { position: relative; display: inline-flex; vertical-align: middle; margin-left: 10px; }
.fs-title-status { cursor: pointer; border: none; font-family: inherit; }
.fs-title-status .material-icons.caret { font-size: 16px; margin-left: 1px; }
.fs-status-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 230px; max-width: 380px; max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); padding: 6px; display: none; scrollbar-width: thin; scrollbar-color: var(--border) transparent; overscroll-behavior: contain; }
.fs-status-menu::-webkit-scrollbar { width: 8px; }
.fs-status-menu::-webkit-scrollbar-track { background: transparent; }
.fs-status-menu::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 2px solid var(--surface); background-clip: content-box; }
.fs-status-menu::-webkit-scrollbar-thumb:hover { background: var(--text-soft); background-clip: content-box; }
.fs-status-wrap.open .fs-status-menu { display: block; }
.fs-status-opt { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); }
.fs-status-opt:hover { background: var(--surface-2); }
.fs-status-opt.active { background: var(--primary-soft); color: var(--primary); }
.fs-status-opt.fs-status-danger { color: #d33; }
.fs-status-opt.fs-status-danger:hover { background: rgba(221, 51, 51, .12); }
.fs-status-opt .material-icons { font-size: 16px; }
.fs-tree-folder { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-soft); -webkit-user-select: none; user-select: none; }
.fs-tree-folder:hover { background: var(--surface-2); }
.fs-tree-folder .fs-tree-caret { font-size: 16px; transition: transform .15s ease; }
.fs-tree-folder.open .fs-tree-caret { transform: rotate(90deg); }
.fs-tree-folder .fs-tree-fico { font-size: 16px; color: var(--text-soft); }
.fs-tree-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-tree-children { display: none; }
.fs-tree-children.open { display: block; }
.fs-tree-file .fs-tree-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
/* Focus mode: hide the sidebar + topbar chrome for a full-bleed, distraction-free
   workspace. Toggled from the topbar button, persisted across navigation in
   sessionStorage (see script.js); a floating pill exits it. */
body.fs-focus .sidebar,
body.fs-focus .topbar { display: none; }
body.fs-focus .content { padding-top: 20px; }
.fs-focus-bar { position: fixed; top: 12px; right: 12px; z-index: 4000; display: inline-flex; align-items: center; gap: 6px; }
/* When the agent is docked on the right, keep the focus bar clear of the docked chat panel. */
html.fs-content-host .main > .content { display:flex; flex-direction:column; flex:1; min-height:0; padding:0; overflow:hidden; }
#fsFullscreenPage { display:block; width:100%; max-width:none; height:100%; min-height:400px; flex:1; border:0; background:var(--bg); }
.fs-content-toolbar { display:flex; flex-wrap:wrap; gap:6px; flex:none; padding:8px 12px; border-bottom:1px solid var(--border); background:var(--surface); }
body.fs-agent-docked-right .fs-focus-bar { right: calc(var(--fs-dock-w) + 12px); }
.fs-focus-nav { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.fs-focus-nav .material-icons { font-size: 18px; }
.fs-focus-nav:hover { border-color: var(--primary); color: var(--primary); }
.fs-focus-select { width: min(220px, 30vw); min-width: 110px; height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 12px; }
.fs-focus-select:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.fs-focus-exit { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12px; font-weight: 700; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 7px 13px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.fs-focus-exit .material-icons { font-size: 16px; }
.fs-focus-exit:hover { border-color: var(--primary); color: var(--primary); }
@media (max-width: 560px) {
    .fs-focus-bar { left: 12px; right: 12px; justify-content: flex-end; flex-wrap: wrap; }
    body.fs-agent-docked-right .fs-focus-bar { left: 12px; right: 12px; }
    .fs-focus-select { width: min(160px, 42vw); }
    .fs-focus-exit { padding: 7px 9px; }
}
.fs-sitemap-sel { font-family: inherit; font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.fs-sitemap-sel:focus { outline: none; border-color: var(--primary); }

.search {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    width: 240px;
}
.search input { border: none; background: none; outline: none; color: var(--text); font-size: 13px; width: 100%; }
.search .material-icons { font-size: 18px; color: var(--text-soft); }

.icon-btn {
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: grid; place-items: center;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.fs-load-workspace { width:auto; min-width:38px; padding:0 10px; display:inline-flex; align-items:center; justify-content:center; gap:6px; white-space:nowrap; color:var(--primary); }
.fs-load-workspace .material-icons { font-size:18px; }
.fs-kiosk-btn[aria-pressed="true"] { background:var(--primary-soft); border-color:var(--primary); color:var(--primary); }
.fs-kiosk-btn:disabled { opacity:.45; cursor:not-allowed; }

/* Menu / expand toggle — hidden on full desktop; shown only at responsive
   widths (rail / mobile drawer) once scripts are active. */
.menu-btn { display: none; }
@media (max-width: 1199px) { .fs-js .menu-btn { display: grid; } }

/* The header stays fixed and the content scrolls beneath it, so the page scrollbar starts at the
   header's bottom edge. Content is capped at 1400px (left-aligned) so the scrollbar sits at the far right. */
.content { padding: 28px 30px 60px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.content > * { max-width: 1400px; }
@media (max-width: 720px) { .app { height: auto; overflow: visible; } .main { overflow: visible; } .content { overflow-y: visible; } }
/* Match the sidebar nav's skinny scrollbar on the main content scroll area */
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; transition: background .2s ease; }
.content:hover::-webkit-scrollbar-thumb { background: var(--text-soft); }
.content::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---------------- Bing Image of the Day background (opt-in) ----------------
   A fixed photo layer sits behind the app with a theme-aware veil for
   readability; the sticky chrome turns frosted so the photo shows through. */
body.fs-bg-bing::before,
body.fs-bg-bing::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}
body.fs-bg-bing::before {
    background-image: var(--fs-bg-bing);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
body.fs-bg-bing::after { background: var(--bg); opacity: .45; }
/* Adaptive contrast: the veil + on-photo text follow the photo's sampled
   luminance, independent of the light/dark theme. */
body.fs-bg-bing.fs-bg-light::after { background: #ffffff; opacity: .42; }
body.fs-bg-bing.fs-bg-dark::after { background: #0a0c16; opacity: .5; }
body.fs-bg-bing.fs-bg-light .view-head h3 { color: #10142a; }
body.fs-bg-bing.fs-bg-light .view-head p,
body.fs-bg-bing.fs-bg-light .view-head .eyebrow { color: #3a4066; }
body.fs-bg-bing.fs-bg-dark .view-head h3 { color: #f5f7ff; }
body.fs-bg-bing.fs-bg-dark .view-head p,
body.fs-bg-bing.fs-bg-dark .view-head .eyebrow { color: rgba(245, 247, 255, .86); }
body.fs-bg-bing.fs-bg-light .settings-nav .tab:not(.active) { color: #24284a; }
body.fs-bg-bing.fs-bg-dark .settings-nav .tab:not(.active) { color: rgba(245, 247, 255, .9); }
body.fs-bg-bing .sidebar,
body.fs-bg-bing .topbar {
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* Background image gallery (Settings → Appearance). */
.bg-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; margin-top: 14px; }
.bg-gallery[hidden] { display: none; }
.bg-gallery-loading { grid-column: 1 / -1; color: var(--text-soft); font-size: 12px; font-weight: 600; }

/* Floating content panel — the content area sits as a rounded card on the
   appearance backdrop (Index/landing), matching the Desktop's floating desk.
   Composes with the docked/minimized agent (which insets .main). */
body.fs-float-content .content {
    margin: 12px;
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
body.fs-float-content.fs-bg-bing .content {
    background: color-mix(in srgb, var(--surface) 84%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}
@media (max-width: 720px) { body.fs-float-content .content { margin: 6px; border-radius: 12px; } }

/* ---------------- Full-viewport app views ----------------
   App-like pages (media studio, flow canvas, code/prototype editors) opt in with
   <body class="fs-fill-view"> and mark their primary app surface with class="fs-fill".
   The surface then fills the content area — no 1400px column cap, no magic-number
   height — flex-growing to the available height instead of overflowing the page. */
body.fs-fill-view .content { overflow: hidden; display: flex; flex-direction: column; padding-bottom: 24px; }
body.fs-fill-view .content > * { max-width: none; }
body.fs-fill-view .view.active { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
body.fs-fill-view .view-head { flex: 0 0 auto; margin-bottom: 14px; }
body.fs-fill-view .fs-fill { flex: 1 1 auto; min-height: 0; height: auto; }
@media (max-width: 720px) { body.fs-fill-view .content { overflow-y: auto; } }
.bg-tile {
    position: relative; height: 72px; border-radius: 10px; overflow: hidden;
    border: 1px solid var(--border); background-size: cover; background-position: center;
    cursor: pointer; padding: 0; color: #fff; display: flex; align-items: flex-end;
    font-family: inherit; transition: box-shadow .15s, border-color .15s;
}
.bg-tile:hover { border-color: var(--primary); }
.bg-tile.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.bg-tile-auto { background: var(--surface-2); color: var(--text-muted); align-items: center; justify-content: center; flex-direction: column; gap: 3px; }
.bg-tile-auto .material-icons { font-size: 22px; }
.bg-tile-cap {
    width: 100%; font-size: 10px; font-weight: 700; line-height: 1.25; padding: 4px 6px;
    background: linear-gradient(to top, rgba(0, 0, 0, .74), rgba(0, 0, 0, 0)); text-align: left;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bg-tile-auto .bg-tile-cap { background: none; color: inherit; text-align: center; padding-top: 0; }
.bg-tile-chk { position: absolute; top: 5px; right: 5px; font-size: 18px; color: var(--primary); background: #fff; border-radius: 50%; }

/* Loaded-record counters on nav items (RACI, Roadmaps, Journeys …). */
.nav-count {
    margin-left: auto; min-width: 18px; height: 17px; padding: 0 5px; border-radius: 9px;
    background: var(--primary-soft); color: var(--primary); font-size: 10px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center; line-height: 1; flex-shrink: 0;
}
.nav-item.sub.active .nav-count { background: var(--primary); color: #fff; }
.nav-count[hidden] { display: none; }
/* Nav search — filter the department navigation by name. */
/* Frozen filter section — search + Counts-only stay pinned while the dept list scrolls. */
.nav-sticky { position: sticky; top: 0; z-index: 3; background: var(--surface); padding-top: 2px; }
.app.rail .sidebar .nav-sticky { background: transparent; padding-top: 0; }
.nav-search-bar { display: flex; align-items: center; gap: 6px; margin: 0 4px 8px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--surface); border-radius: 9px; }
.nav-search-bar > .material-icons { font-size: 17px; color: var(--text-muted); flex-shrink: 0; }
.nav-search-input { flex: 1; min-width: 0; border: none; background: none; outline: none; font: inherit; font-size: 13px; color: var(--text); }
.nav-search-input::placeholder { color: var(--text-soft); }
.nav-search-clear { border: none; background: none; cursor: pointer; color: var(--text-muted); display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border-radius: 5px; flex-shrink: 0; }
.nav-search-clear:hover { background: var(--surface-2); color: var(--text); }
.nav-search-clear .material-icons { font-size: 15px; }
.app.rail .sidebar .nav-search-bar { display: none; }
/* "Counts only" nav filter toggle — shows sections with loaded records, sorted by count. */
.nav-filter-bar { padding: 2px 10px 6px; }
.nav-filter-btn {
    display: flex; align-items: center; gap: 6px; width: 100%;
    padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); color: var(--muted); cursor: pointer;
    font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.nav-filter-btn .material-icons { font-size: 15px; }
.nav-filter-btn .nfb-lbl { flex: 1; text-align: left; }
.nav-filter-btn .nfb-n {
    min-width: 16px; height: 15px; padding: 0 5px; border-radius: 9px;
    background: var(--primary-soft); color: var(--primary); font-size: 10px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
}
.nav-filter-btn:hover { border-color: var(--primary); color: var(--text); }
.nav-filter-btn.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.nav-filter-btn.active .nfb-n { background: var(--primary); color: #fff; }
.app.rail .sidebar .nav-filter-btn .nfb-lbl { display: none; }
.app.rail .sidebar .nav-filter-btn .material-icons { display: none; }
.app.rail .sidebar .nav-filter-btn { justify-content: center; padding-left: 0; padding-right: 0; gap: 0; }
.nav-sub-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Whitelabel manager (Settings → Whitelabel). */
.wl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.wl-card { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; font-family: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.wl-card:hover { border-color: var(--primary); }
.wl-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.wl-card-hd { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; }
.wl-card-hd .material-icons { font-size: 18px; color: var(--primary); }
.wl-card-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.wl-empty { grid-column: 1 / -1; padding: 14px; border: 1px dashed var(--border); border-radius: 10px; color: var(--text-muted); font-size: 12.5px; }
.settings-nav .tab .wl-tab-count { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.wl-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.wl-chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.wl-chip-src { font-style: normal; font-weight: 600; opacity: .7; font-size: 10.5px; margin-left: 4px; }
.wl-ov { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.wl-ov-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); }
.wl-ov-row .material-icons { font-size: 15px; color: var(--text-soft); }
.wl-ov-row b { color: var(--text); }
/* Whitelabel editor */
.wl-sub-h { margin: 16px 0 8px; font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.wl-sub-note { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-soft); font-size: 11px; }
.wl-depts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 16px; }
.wl-dept-row { display: flex; align-items: center; gap: 10px; }
.wl-dept-name { flex: 0 0 130px; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-dept-rename { flex: 1 1 auto; font-size: 12px; padding: 5px 8px; }
.btn-xs { padding: 2px 6px; min-width: 0; }
.btn-xs .material-icons { font-size: 15px; }
.wl-ov-edit { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.wl-ov-edit .material-icons { font-size: 16px; color: var(--text-soft); }
.wl-ov-edit .form-control { font-size: 12px; padding: 5px 8px; }
.mt-32 { margin-top: 32px; }

/* ---------------- Views ---------------- */
.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-head { margin-bottom: 22px; }
.view-head .eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 5px 11px; border-radius: 30px;
    margin-bottom: 12px;
}
.view-head h3 { font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
.view-head p { color: var(--text-muted); font-size: 14px; margin-top: 6px; max-width: 720px; }

/* ---------------- KPI strip ---------------- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 26px; }
.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}
.kpi .label { font-size: 12px; color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .label .material-icons { font-size: 16px; }
.kpi .value { font-size: 27px; font-weight: 800; letter-spacing: -1px; margin: 8px 0 4px; }
.kpi .trend { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.kpi .trend.up { color: var(--green); }
.kpi .trend.down { color: var(--red); }
.kpi .trend .material-icons { font-size: 15px; }

/* ---------------- Panels / grids ---------------- */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: 1.4fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h4 { font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.panel-head .material-icons { color: var(--text-soft); cursor: pointer; }
.panel-sub { font-size: 12px; color: var(--text-soft); font-weight: 600; }

/* ---------------- Modern Site Map ---------------- */
.sm-kpis { margin-bottom: 18px; }
.sm-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 11px 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    position: sticky;
    top: 12px;
    z-index: 5;
}
.sm-toolbar > .material-icons { color: var(--text-soft); font-size: 20px; }
.sm-search { flex: 1; border: none; background: transparent; outline: none; font-size: 14px; color: var(--text); font-family: inherit; }
.sm-search::placeholder { color: var(--text-soft); }
.sm-count { font-size: 12px; font-weight: 700; color: var(--text-soft); white-space: nowrap; }
.sm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.sm-card { transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.sm-card:hover { box-shadow: var(--shadow); border-color: var(--primary); transform: translateY(-2px); }
.sm-card-gs { border-top: 3px solid var(--primary); }
.sm-empty { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-soft); font-weight: 600; padding: 40px 0; }
.sm-empty .material-icons { font-size: 20px; }

/* ---------------- Services Selector (shared) ---------------- */
.cap-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.cap-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; transition: outline .1s, opacity .1s; }
.cap-chip .material-icons { font-size: 14px; }
.cap-ico { width: 14px; height: 14px; border-radius: 3px; object-fit: contain; flex: 0 0 auto; }
.cap-chip.saas { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.cap-chip.ai { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.cap-chip.off { opacity: .45; }
.cap-chip.selected { outline: 2px solid var(--primary); outline-offset: 1px; }
.cap-subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.cap-sub { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.cap-sub-name { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 7px; }
.cap-sub-name.svc-gap { margin-top: 12px; }
.cap-solutions .panel { margin-bottom: 16px; }
.cap-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 12px; }
.cap-search { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; flex: 1; min-width: 200px; max-width: 360px; }
.cap-search .material-icons { font-size: 18px; color: var(--text-muted); }
.cap-search input { border: none; background: transparent; outline: none; font: inherit; font-size: 13px; color: var(--text); width: 100%; }
.cap-seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; gap: 2px; }
.cap-seg-btn { display: inline-flex; align-items: center; gap: 5px; border: none; background: transparent; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--text-muted); padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.cap-seg-btn .material-icons { font-size: 15px; }
.cap-seg-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.cap-dept-tabs { margin-bottom: 16px; }
.cap-dept-tabs .tab { cursor: pointer; }
.cap-empty { display: none; color: var(--text-muted); font-size: 13px; padding: 12px 2px; }
.cap-empty.show { display: block; }
.cap-chip.hide, .cap-sub.hide, .cap-solutions .panel.hide, .svcx-main .panel.hide { display: none; }
.svc-onlyon { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.svc-switch { position: relative; width: 30px; height: 16px; border-radius: 20px; border: none; background: var(--border); cursor: pointer; padding: 0; flex: 0 0 auto; transition: background .15s; }
.svc-switch.on { background: var(--green); }
.svc-knob { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: left .15s; }
.svc-switch.on .svc-knob { left: 16px; }
.svcx-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.svcx-aside { position: sticky; top: 12px; }
.svc-meta .spread { padding: 7px 0; border-bottom: 1px solid var(--border); }
.svc-meta .spread:last-child { border-bottom: none; }
.svc-desc { font-size: 12.5px; line-height: 1.5; margin-bottom: 10px; }
@media (max-width: 900px) { .svcx-layout { grid-template-columns: 1fr; } .svcx-aside { position: static; } }

/* ---------------- Roadmap / board ---------------- */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.board-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.board-col-head span.name { font-size: 13px; font-weight: 800; }
.board-col-head .count { font-size: 11px; font-weight: 700; color: var(--text-soft); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1px 9px; }

.card2 {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: transform .12s, box-shadow .12s;
}
.card2:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card2 .code { font-size: 10.5px; font-weight: 800; color: var(--text-soft); letter-spacing: .5px; }
.card2 h5 { font-size: 13.5px; font-weight: 700; margin: 4px 0 8px; }
.card2 .meta { display: flex; align-items: center; justify-content: space-between; }
.card2 .assignees { display: flex; }
.card2 .assignees .a { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -7px; display: grid; place-items: center; font-size: 9px; font-weight: 800; color: #fff; }

/* ---------------- Badges / pills ---------------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.pill .material-icons { font-size: 13px; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.purple { background: var(--primary-soft); color: var(--primary); }
.pill.gray { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

/* ---------------- Progress ---------------- */
.progress { height: 7px; background: var(--surface-2); border-radius: 20px; overflow: hidden; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }

/* ---------------- Lists ---------------- */
.list { list-style: none; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: none; }
.list .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.list .ic .material-icons { font-size: 19px; }
.list .body { flex: 1; min-width: 0; }
.list .body .t { font-size: 13.5px; font-weight: 700; }
.list .body .d { font-size: 12px; color: var(--text-soft); }

/* ---------------- Table ---------------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-soft); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 12px; border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl .muted { color: var(--text-soft); }

/* ---------------- Timeline / initiatives ---------------- */
.gantt { display: flex; flex-direction: column; gap: 12px; }
.gantt-row { display: grid; grid-template-columns: 180px 1fr; gap: 14px; align-items: center; }
.gantt-row .label { font-size: 13px; font-weight: 700; }
.gantt-track { position: relative; height: 30px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--border); }
.gantt-bar { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; display: flex; align-items: center; padding: 0 10px; font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; }

/* ---------------- Idea cards ---------------- */
.idea { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; transition: box-shadow .15s; }
.idea:hover { box-shadow: var(--shadow); }
.vote { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 54px; flex-shrink: 0; }
.vote button { border: 1px solid var(--border); background: var(--surface-2); border-radius: 9px; width: 46px; padding: 6px 0; cursor: pointer; color: var(--text-muted); transition: all .15s; }
.vote button:hover { border-color: var(--primary); color: var(--primary); }
.vote .n { font-size: 16px; font-weight: 800; }
.vote .l { font-size: 10px; color: var(--text-soft); font-weight: 700; text-transform: uppercase; }
.idea .body { flex: 1; }
.idea .body h5 { font-size: 15px; font-weight: 700; }
.idea .body p { font-size: 13px; color: var(--text-muted); margin: 5px 0 10px; }
.idea .tags { display: flex; gap: 7px; flex-wrap: wrap; }

/* ---------------- Prototype gallery ---------------- */
.proto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.proto { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.proto:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.proto .thumb { height: 150px; display: grid; place-items: center; color: rgba(255,255,255,.85); }
.proto .thumb .material-icons { font-size: 44px; }
.proto .info { padding: 14px; }
.proto .info h5 { font-size: 14px; font-weight: 700; }
.proto .info .meta { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

/* ---------------- App cards ---------------- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.app-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.app-card .logo { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; margin-bottom: 12px; }
.app-card h5 { font-size: 15px; font-weight: 700; }
.app-card p { font-size: 12.5px; color: var(--text-muted); margin: 6px 0 12px; min-height: 34px; }
.app-card .foot { display: flex; align-items: center; justify-content: space-between; }

/* ---------------- AI Agent ---------------- */
.chat { display: flex; flex-direction: column; height: 560px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.chat-head .bot { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); display: grid; place-items: center; color: #fff; }
.chat-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 12px; max-width: 78%; }
.msg .bub { padding: 12px 15px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; }
.msg.bot .bub { background: var(--surface-2); border: 1px solid var(--border); border-top-left-radius: 4px; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bub { background: var(--primary); color: #fff; border-top-right-radius: 4px; }
.msg .ava { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; }
.chat-input { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 11px 15px; outline: none; color: var(--text); font-size: 13.5px; }
.chat-input button { border: none; background: var(--primary); color: #fff; border-radius: 12px; padding: 0 18px; font-weight: 700; cursor: pointer; display: grid; place-items: center; }
.suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { font-size: 12px; font-weight: 600; padding: 7px 13px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ---------------- Forms / Questionnaire ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 4px; }
.form-group > label { font-size: 13px; font-weight: 700; color: var(--text); }
.form-group .hint { font-size: 12px; color: var(--text-soft); }
.form-control { border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 11px 13px; font-size: 13.5px; color: var(--text); font-family: inherit; outline: none; transition: border-color .15s; width: 100%; }
.form-control:focus { border-color: var(--primary); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-group-wide { grid-column: 1 / -1; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 14px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.checkbox-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 9px 13px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.choice:hover { border-color: var(--primary); color: var(--primary); }
.choice input { accent-color: var(--primary); }
.rating { display: flex; gap: 6px; }
.rating .star { font-size: 26px; color: var(--border); cursor: pointer; transition: color .15s; -webkit-user-select: none; user-select: none; }
.rating .star.on { color: #f5a623; }
.form-done { display: none; align-items: center; gap: 10px; margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 13.5px; }
.form-done.show { display: flex; }
.form-done .material-icons { font-size: 20px; }
.fs-assess-row { padding: 5px 0; gap: 16px; }
.fs-assess-row b { font-size: 13.5px; font-weight: 600; }
.fs-assess-row .rating .star { font-size: 22px; }

/* ---------------- Assessment Wizard (assessment-wizard.html) ---------------- */
.aw-progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
.aw-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #00897b); border-radius: 999px; transition: width .35s ease; }
.aw-body { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.aw-steps { display: flex; flex-direction: column; gap: 4px; }
.aw-step-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); cursor: pointer; text-align: left; font-family: inherit; transition: background .15s, color .15s, border-color .15s; }
.aw-step-item:hover { background: var(--surface-2); color: var(--text); }
.aw-step-item.aw-step-active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.aw-step-item.aw-step-done .aw-step-num { background: var(--green); border-color: var(--green); color: #fff; }
.aw-step-num { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.aw-step-num .material-icons { font-size: 16px; }
.aw-step-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.aw-step-label .material-icons { font-size: 18px; }
.aw-panel { min-width: 0; }
.aw-step-head { margin-bottom: 14px; }
.aw-step-head h3 { margin: 6px 0 4px; }
.aw-step-head p { color: var(--text-muted); }
.aw-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.aw-nav-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.aw-count { font-size: 11px; font-weight: 800; color: var(--text-soft); text-transform: uppercase; letter-spacing: .5px; }
.aw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.aw-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.aw-chip .aw-chip-n { width: 20px; height: 20px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.aw-chip .material-icons { font-size: 16px; color: var(--primary); }
@media (max-width: 860px) {
    .aw-body { grid-template-columns: 1fr; }
    .aw-steps { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
    .aw-step-item { flex: 0 0 auto; }
}

/* ---------------- Misc ---------------- */
.btn { border: none; border-radius: 10px; padding: 9px 16px; font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: filter .15s, background .15s; text-decoration: none; }
.btn .material-icons { font-size: 17px; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.btn.ghost:hover { color: var(--text); }

/* ---------------- Filmshop edit / view page ---------------- */
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.fse-hint { font-size: 12px; font-weight: 600; color: var(--text-soft); margin-left: 6px; }
.fse-area-row { display: flex; gap: 8px; }
.fse-area-row .fse-mat { width: 78px; flex: 0 0 auto; }
.fse-area-row .fse-pri { flex: 1 1 auto; }
.fse-pri-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.fse-pri-row input { flex: 1 1 auto; }
.fse-del { color: var(--text-soft); cursor: pointer; }
.fse-del:hover { color: #c92a2a; }
.fse-json { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; line-height: 1.5; resize: vertical; white-space: pre; }
.fse-json-err { border-color: #c92a2a !important; }

/* Selected-filmshop labels in the page header */
.fs-meta-labels { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fs-meta-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px; text-decoration: none; }
.fs-meta-chip b { color: var(--text-soft); font-weight: 700; }
.fs-meta-chip .material-icons { font-size: 14px; }
.fs-meta-chip.badge { color: #fff; border-color: transparent; }
.fs-meta-chip.badge.green { background: #2f9e44; }
.fs-meta-chip.badge.amber { background: #e8590c; }
.fs-meta-chip.badge.blue { background: #1971c2; }
.fs-meta-chip.badge.grey { background: #868e96; }
.fs-meta-chip.badge.red { background: #c92a2a; }
a.fs-meta-chip.badge:hover { filter: brightness(1.08); }

/* Editor schema-validation panel */
.fse-issues { display: flex; flex-direction: column; gap: 8px; }
.fse-issue { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border-radius: 10px; font-size: 13px; border: 1px solid var(--border); background: var(--surface-2); }
.fse-issue .material-icons { font-size: 18px; flex-shrink: 0; }
.fse-issue.error { color: #c92a2a; border-color: rgba(201, 42, 42, .35); background: rgba(201, 42, 42, .06); }
.fse-issue.warn { color: #e8590c; border-color: rgba(232, 89, 12, .35); background: rgba(232, 89, 12, .06); }
.fse-issue .path { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; opacity: .8; }
.fse-ok { display: flex; align-items: center; gap: 9px; color: #2f9e44; font-weight: 700; font-size: 13.5px; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; }
.mt { margin-top: 16px; }
.donut { --v: 70; width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--v) * 1%), var(--surface-2) 0); display: grid; place-items: center; }
.donut .hole { width: 84px; height: 84px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.donut .hole b { font-size: 22px; font-weight: 800; }
.donut .hole span { font-size: 10px; color: var(--text-soft); font-weight: 700; }

.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 160px; padding-top: 10px; }
.bar-chart .bar { flex: 1; background: linear-gradient(180deg, var(--primary-2), var(--primary)); border-radius: 8px 8px 0 0; position: relative; min-height: 8px; transition: filter .15s; }
.bar-chart .bar:hover { filter: brightness(1.1); }
.bar-chart .bar span.v { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 700; }
.bar-chart .bar span.x { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--text-soft); font-weight: 600; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; scroll-behavior: smooth; -ms-overflow-style: none; scroll-padding-inline: 40px; }
.tabs::-webkit-scrollbar { height: 0; width: 0; display: none; }
.tab { border: none; background: transparent; color: var(--text-muted); font-family: inherit; font-size: 13.5px; font-weight: 700; padding: 12px 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; border-bottom: 2px solid transparent; white-space: nowrap; transition: color .15s, border-color .15s; text-decoration: none; }
.tab .material-icons { font-size: 18px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
/* Modernized scrollable tab bar — prev/next controls appear only when tabs overflow */
.tabs-wrap { position: relative; display: flex; align-items: stretch; margin-bottom: 22px; }
.tabs-wrap > .tabs { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.tabs-scroll-btn { flex: 0 0 auto; width: 32px; padding: 0; border: none; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer; display: none; align-items: center; justify-content: center; transition: color .15s, background .15s; }
.tabs-scroll-btn:hover { color: var(--primary); background: var(--surface-2); }
.tabs-scroll-btn .material-icons { font-size: 20px; }
.tabs-wrap.can-left .tabs-scroll-btn.prev { display: inline-flex; box-shadow: 8px 0 10px -8px rgba(15,23,42,.25); }
.tabs-wrap.can-right .tabs-scroll-btn.next { display: inline-flex; box-shadow: -8px 0 10px -8px rgba(15,23,42,.25); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: tabFade .2s ease; }
@keyframes tabFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------- Stepwise journey map (steps point to artifact tabs) ----------------
   A .journey is a .tabs bar whose .tab items are rendered as numbered journey
   steps with connectors. Steps keep the .tab class so the in-page tab engine
   still activates the matching .tab-panel. */
.tabs.journey { border-bottom: none; gap: 0; margin-bottom: 20px; padding-bottom: 4px; }
.journey .journey-step {
    position: relative;
    flex: 1 1 0;
    min-width: 128px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 9px;
    padding: 12px 10px;
    border-bottom: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}
.journey .journey-step::before {
    content: "";
    position: absolute;
    top: 34px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.journey .journey-step:first-child::before { display: none; }
.journey .journey-step .step-badge {
    position: relative;
    z-index: 1;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface);
    color: var(--text-soft);
    border: 2px solid var(--border);
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.journey .journey-step .step-badge .material-icons { font-size: 22px; }
.journey .journey-step .step-num { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--text-soft); }
.journey .journey-step .step-label { font-size: 12.5px; font-weight: 700; color: var(--text-muted); line-height: 1.25; }
.journey .journey-step:hover { color: var(--text); }
.journey .journey-step:hover .step-badge { border-color: var(--primary); color: var(--primary); }
.journey .journey-step.active { background: none; }
.journey .journey-step.active::before { background: var(--primary); }
.journey .journey-step.active .step-badge { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: var(--shadow); }
.journey .journey-step.active .step-num,
.journey .journey-step.active .step-label { color: var(--primary); }

/* ---------------- Org hierarchy tree ---------------- */
.org-tree, .org-children { list-style: none; }
.org-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 8px; }
.org-row .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.org-row .ic .material-icons { font-size: 18px; }
.org-row .body { flex: 1; min-width: 0; }
.org-children { margin: 0 0 8px 24px; padding-left: 16px; border-left: 1px dashed var(--border); }
.org-level { font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--text-soft); }
.org-name { font-size: 13.5px; font-weight: 700; }
.org-group { font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace; font-size: 11.5px; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 6px; }

/* ---------------- Capabilities selector / manager / descriptor ---------------- */
.cap-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; align-items: start; }
.cap-list { list-style: none; display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; padding-right: 4px; }
.cap-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.cap-item:hover { border-color: var(--primary); }
.cap-item.selected { border-color: var(--primary); background: var(--primary-soft); }
.cap-item .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.cap-item .body { flex: 1; min-width: 0; }
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--border); border-radius: 20px; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.desc-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 13px; margin: 0; }
.desc-grid dt { color: var(--text-soft); font-weight: 700; }
.desc-grid dd { font-weight: 600; margin: 0; }
.tag-row { display: flex; gap: 7px; flex-wrap: wrap; }

/* ---------------- Icon tones & descriptor helpers (no inline styles) ---------------- */
.eyebrow .material-icons { font-size: 14px; }
.tone-primary { background: var(--primary-soft); }
.tone-primary > .material-icons { color: var(--primary); }
.tone-blue { background: var(--blue-soft); }
.tone-blue > .material-icons { color: var(--blue); }
.tone-green { background: var(--green-soft); }
.tone-green > .material-icons { color: var(--green); }
.tone-amber { background: var(--amber-soft); }
.tone-amber > .material-icons { color: var(--amber); }
.tone-red { background: var(--red-soft); }
.tone-red > .material-icons { color: var(--red); }
.desc-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; }
.desc-title { font-weight: 800; font-size: 15px; }
.reasons-title { margin-bottom: 8px; color: var(--red); font-weight: 700; }
.card2-link { cursor: pointer; text-decoration: none; color: inherit; display: block; }
.redirect-note { font-family: 'Inter', system-ui, sans-serif; padding: 32px; color: #1b1f3b; }
.m-0 { margin: 0; }
.ic-lg { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; }
.mt-sm { margin-top: 6px; }
.progress > span.w-11 { width: 11%; }
.progress > span.w-18 { width: 18%; }
.progress > span.w-27 { width: 27%; }
.progress > span.w-44 { width: 44%; }
.progress > span.w-76 { width: 76%; }
.progress > span.w-84 { width: 84%; }
.progress > span.w-88 { width: 88%; }
.progress > span.w-92 { width: 92%; }

/* ---------------- Progress width & bar height utilities (no inline styles) ---------------- */
.progress > span.w-6 { width: 6%; }
.progress > span.w-14 { width: 14%; }
.progress > span.w-15 { width: 15%; }
.progress > span.w-17 { width: 17%; }
.progress > span.w-19 { width: 19%; }
.progress > span.w-20 { width: 20%; }
.progress > span.w-21 { width: 21%; }
.progress > span.w-25 { width: 25%; }
.progress > span.w-28 { width: 28%; }
.progress > span.w-30 { width: 30%; }
.progress > span.w-31 { width: 31%; }
.progress > span.w-33 { width: 33%; }
.progress > span.w-34 { width: 34%; }
.progress > span.w-38 { width: 38%; }
.progress > span.w-48 { width: 48%; }
.progress > span.w-52 { width: 52%; }
.progress > span.w-57 { width: 57%; }
.progress > span.w-60 { width: 60%; }
.progress > span.w-62 { width: 62%; }
.progress > span.w-63 { width: 63%; }
.progress > span.w-64 { width: 64%; }
.progress > span.w-66 { width: 66%; }
.progress > span.w-68 { width: 68%; }
.progress > span.w-70 { width: 70%; }
.progress > span.w-72 { width: 72%; }
.progress > span.w-78 { width: 78%; }
.progress > span.w-100 { width: 100%; }
.bar-chart .bar.h-28 { height: 28%; }
.bar-chart .bar.h-34 { height: 34%; }
.bar-chart .bar.h-41 { height: 41%; }
.bar-chart .bar.h-46 { height: 46%; }
.bar-chart .bar.h-50 { height: 50%; }
.bar-chart .bar.h-52 { height: 52%; }
.bar-chart .bar.h-55 { height: 55%; }
.bar-chart .bar.h-58 { height: 58%; }
.bar-chart .bar.h-60 { height: 60%; }
.bar-chart .bar.h-64 { height: 64%; }
.bar-chart .bar.h-66 { height: 66%; }
.bar-chart .bar.h-68 { height: 68%; }
.bar-chart .bar.h-69 { height: 69%; }
.bar-chart .bar.h-70 { height: 70%; }
.bar-chart .bar.h-72 { height: 72%; }
.bar-chart .bar.h-76 { height: 76%; }
.bar-chart .bar.h-80 { height: 80%; }
.bar-chart .bar.h-82 { height: 82%; }
.bar-chart .bar.h-84 { height: 84%; }
.bar-chart .bar.h-85 { height: 85%; }
.bar-chart .bar.h-86 { height: 86%; }
.bar-chart .bar.h-87 { height: 87%; }
.bar-chart .bar.h-88 { height: 88%; }
.bar-chart .bar.h-90 { height: 90%; }
.bar-chart .bar.h-92 { height: 92%; }
.bar-chart .bar.h-98 { height: 98%; }
.bar-chart .bar.h-99 { height: 99%; }
.bar-chart .bar.h-100 { height: 100%; }
.h4-tight { margin: 10px 0 6px; }
.h3-sm { font-size: 20px; }
.vh-sub { margin-bottom: 18px; }
.a.av-violet { background: #7b5cf0; }
.a.av-coral { background: #ff6b6b; }
.a.av-green { background: #16a34a; }
.a.av-blue { background: #2563eb; }
.a.av-amber { background: #d97706; }
.a.av-red { background: #dc2626; }
.a.av-indigo { background: #5b34d6; }
.progress > span.w-24 { width: 24%; }
.progress > span.w-55 { width: 55%; }
.progress > span.w-65 { width: 65%; }
.progress > span.w-82 { width: 82%; }
.bar-chart .bar.h-62 { height: 62%; }
.bar-chart .bar.h-78 { height: 78%; }
a.app-card { text-decoration: none; color: inherit; display: block; position: relative; transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
a.app-card:hover { box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.12)); transform: translateY(-2px); border-color: var(--primary); }
a.app-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
a.app-card .app-open { position: absolute; top: 12px; right: 12px; color: var(--text-muted); opacity: 0; transition: opacity .15s ease; }
a.app-card .app-open .material-icons { font-size: 18px; }
a.app-card:hover .app-open, a.app-card:focus-visible .app-open { opacity: 1; }
.logo.g-green, .thumb.g-green { background: linear-gradient(135deg, #16a34a, #43e97b); }
.logo.g-violet, .thumb.g-violet { background: linear-gradient(135deg, #5b34d6, #7b5cf0); }
.logo.g-blue, .thumb.g-blue { background: linear-gradient(135deg, #2563eb, #4facfe); }
.logo.g-teal, .thumb.g-teal { background: linear-gradient(135deg, #30cfd0, #330867); }
.logo.g-amber, .thumb.g-amber { background: linear-gradient(135deg, #d97706, #fee140); }
.logo.g-pink, .thumb.g-pink { background: linear-gradient(135deg, #fa709a, #fee140); }
.logo.g-red, .thumb.g-red { background: linear-gradient(135deg, #dc2626, #ff6b6b); }
.logo.g-mint, .thumb.g-mint { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.logo.g-indigo, .thumb.g-indigo { background: linear-gradient(135deg, #667eea, #764ba2); }
.logo.g-magenta, .thumb.g-magenta { background: linear-gradient(135deg, #f093fb, #f5576c); }
.logo.g-violetblue, .thumb.g-violetblue { background: linear-gradient(135deg, #7b5cf0, #2563eb); }
.logo.g-cyan, .thumb.g-cyan { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.gantt-bar.gb-1 { left: 0%; width: 22%; background: var(--primary); }
.gantt-bar.gb-2 { left: 20%; width: 35%; background: var(--blue); }
.gantt-bar.gb-3 { left: 52%; width: 28%; background: var(--amber); }
.gantt-bar.gb-4 { left: 78%; width: 22%; background: var(--green); }
.fw-800 { font-weight: 800; }
.pill-tight { padding: 1px 8px; }
.ava.ava-bot { background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.ava .material-icons { font-size: 18px; }
.mb-18 { margin-bottom: 18px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.cursor-default { cursor: default; }

@media (max-width: 1080px) {
    .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
    .cap-layout { grid-template-columns: 1fr; }
}

/* ---------------- Auth (Register / Login) ---------------- */
.auth { display: flex; min-height: 100vh; min-height: 100svh; }
.auth-hero { flex: 1; position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 44px; color: #fff; background: linear-gradient(150deg, var(--primary), var(--primary-2) 55%, #2563eb); overflow: hidden; }
.auth-hero .brand h1 { color: #fff; }
.auth-hero .brand span.sub { color: rgba(255, 255, 255, .78); }
.auth-hero-body { position: relative; z-index: 1; max-width: 440px; }
.auth-hero-body h2 { font-size: 30px; font-weight: 800; letter-spacing: -.5px; line-height: 1.2; margin-bottom: 14px; }
.auth-hero-body p { font-size: 15px; color: rgba(255, 255, 255, .85); }
.auth-points { list-style: none; margin-top: 26px; display: flex; flex-direction: column; gap: 14px; }
.auth-points li { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; }
.auth-points .material-icons { font-size: 20px; background: rgba(255, 255, 255, .16); border-radius: 8px; padding: 6px; }
.auth-hero-foot { position: relative; z-index: 1; font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.auth-badges { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.auth-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); }
.auth-badge .material-icons { font-size: 15px; }
.auth-blob { position: absolute; border-radius: 50%; }
.auth-blob.b1 { width: 340px; height: 340px; right: -90px; top: -70px; background: radial-gradient(circle, #fff, transparent 70%); opacity: .12; }
.auth-blob.b2 { width: 260px; height: 260px; right: 30px; bottom: -90px; background: radial-gradient(circle, #ff6b6b, transparent 70%); opacity: .2; }

.auth-panel { width: 500px; max-width: 100%; min-width: 0; min-height: 0; flex-shrink: 0; background: var(--surface); display: flex; flex-direction: column; }
.auth-topbar { display: flex; justify-content: flex-end; padding: 18px 24px; }
.auth-scroll { flex: 1 1 auto; min-height: 0; display: flex; align-items: safe center; justify-content: center; padding: 8px 44px 24px; overflow-y: auto; overscroll-behavior: contain; }
.auth-card { width: 100%; max-width: 384px; }
.auth-card .auth-brand { display: none; margin-bottom: 24px; }

.auth-head h3 { font-size: 23px; font-weight: 800; letter-spacing: -.3px; }
.auth-head p { font-size: 13.5px; color: var(--text-muted); margin-top: 5px; }

.auth-toggle { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin: 22px 0; }
.auth-toggle button { flex: 1; border: none; background: none; font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--text-muted); padding: 9px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s; }
.auth-toggle button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form.hidden { display: none; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .material-icons.lead { position: absolute; left: 12px; font-size: 19px; color: var(--text-soft); pointer-events: none; }
.input-wrap .form-control { padding-left: 40px; }
.input-wrap .toggle-eye { position: absolute; right: 8px; border: none; background: none; color: var(--text-soft); cursor: pointer; display: grid; place-items: center; padding: 6px; border-radius: 8px; }
.input-wrap .toggle-eye:hover { color: var(--text); }
.input-wrap .toggle-eye .material-icons { font-size: 19px; }
.auth-inline-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; }
.remember { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.remember input { accent-color: var(--primary); }
.auth-link { color: var(--primary); font-weight: 700; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.terms { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--text-muted); line-height: 1.5; cursor: pointer; }
.terms input { accent-color: var(--primary); margin-top: 2px; }
.btn.block { width: 100%; justify-content: center; padding: 12px; font-size: 14px; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--text-soft); font-size: 12px; font-weight: 600; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; padding: 7px 8px; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--text); cursor: pointer; transition: border-color .15s, background .15s; text-decoration: none; }
.social-btn:hover { border-color: var(--primary); background: var(--surface-2); }
.social-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.social-btn .material-icons { font-size: 15px; flex-shrink: 0; }

.sso-btn { margin-top: 10px; width: 100%; }
.sso-box { margin-top: 12px; border: 1px dashed var(--border); border-radius: 12px; padding: 14px; background: var(--surface-2); }

/* External login (OAuth / SSO) modal shown over the sign-in page while the popup is open. */
.oauth-modal { position: fixed; inset: 0; z-index: 5000; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 18, 32, .55); }
.oauth-modal.open { display: flex; }
.oauth-dialog { width: min(400px, 94vw); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 24px 70px rgba(0, 0, 0, .45); padding: 26px 24px; text-align: center; }
.oauth-ic { display: inline-grid; place-items: center; color: var(--primary); }
.oauth-ic svg { width: 34px; height: 34px; }
.oauth-ic .material-icons { font-size: 34px; }
.oauth-spinner { width: 34px; height: 34px; margin: 12px auto 4px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: oauthSpin .8s linear infinite; }
@keyframes oauthSpin { to { transform: rotate(360deg); } }
.oauth-dialog h3 { font-size: 17px; font-weight: 800; margin: 8px 0 4px; }
.oauth-dialog p { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0 0 18px; }
.oauth-actions { display: flex; gap: 10px; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .oauth-spinner { animation: none; } }

/* Settings → Identity & SSO provider configuration cards. */
.idp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.idp-callout { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0 0 14px; border: 1px solid var(--primary); background: var(--primary-soft); border-radius: 12px; flex-wrap: wrap; }
.idp-callout > .material-icons { color: var(--primary); font-size: 22px; }
.idp-callout-body { flex: 1 1 220px; min-width: 0; }
.idp-callout-t { font-weight: 800; font-size: 13px; color: var(--text); }
.idp-callout-d { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.idp-callout-copy { flex: 1 1 320px; }
.idp-callout-copy .form-control { background: var(--surface); }
.idp-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.identity-card > summary { cursor: pointer; list-style: none; }
.identity-card > summary.panel-head { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
.identity-card > summary.panel-head h4 { margin-right: auto; }
.identity-card > summary::-webkit-details-marker { display: none; }
.identity-card > summary::before { content: 'chevron_right'; font-family: 'Material Icons'; font-size: 20px; }
.identity-card[open] > summary::before { transform: rotate(90deg); }
.identity-card:not([open]) > summary { margin-bottom: 0; }
.identity-card > .azure-finops { border: 0; padding: 0; box-shadow: none; }
.idp-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; row-gap: 8px; margin-bottom: 10px; }
.idp-hd svg { width: 20px; height: 20px; flex-shrink: 0; }
.idp-hd-id { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.idp-hd-id b { font-size: 14px; white-space: nowrap; }
.idp-hd-act { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.idp-hd .idp-setup { padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.idp-hd .idp-setup .material-icons { font-size: 15px; }
.idp-status { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.idp-status.on { background: #2f9e44; color: #fff; }
.idp-status.set { background: var(--primary-soft); color: var(--primary); }
.idp-status.off { background: var(--surface); color: var(--text-soft); border: 1px solid var(--border); }
.idp-note { display: block; font-size: 10.5px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-soft); margin-top: 2px; }
.idp-grid { display: flex; flex-direction: column; gap: 8px; }
.idp-fld { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.idp-fld .form-control { font-size: 12.5px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.idp-sso-add { flex-direction: row; flex-wrap: wrap; margin-top: 6px; }
.idp-sso-add .idp-fld { flex: 1 1 180px; }
.idp-empty { color: var(--text-muted); font-size: 13px; padding: 8px 2px; }
.idp-group-t { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 2px 0 8px; }
.idp-group-t .material-icons { font-size: 15px; color: var(--primary); }
.idp-group-note { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text-soft); margin-left: 4px; }
.idp-note-row { margin-top: -3px; }
.idp-fld .form-control.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; }
.idp-adv { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.idp-adv > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.idp-adv > summary::-webkit-details-marker { display: none; }
.idp-adv > summary::before { content: 'chevron_right'; font-family: 'Material Icons'; font-size: 16px; font-weight: 400; text-transform: none; letter-spacing: normal; transition: transform .15s; }
.idp-adv[open] > summary::before { transform: rotate(90deg); }
.idp-adv > summary .material-icons { font-size: 15px; color: var(--primary); }
.idp-adv .idp-grid { margin-top: 8px; }

/* Settings → Identity & SSO per-vendor setup wizard. */
.wiz-backdrop { position: fixed; inset: 0; z-index: 4000; background: rgba(15, 18, 32, .5); display: none; align-items: center; justify-content: center; padding: 20px; }
.wiz-backdrop.open { display: flex; }
.wiz { width: min(560px, 96vw); max-height: 90vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 24px 70px rgba(0, 0, 0, .4); }
.wiz-hd { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.wiz-ic svg { width: 26px; height: 26px; display: block; }
.wiz-hd-txt { flex: 1; min-width: 0; }
.wiz-title { font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.wiz-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.wiz-x { border: none; background: none; color: var(--text-soft); cursor: pointer; display: grid; place-items: center; padding: 6px; border-radius: 8px; }
.wiz-x:hover { background: var(--surface-2); color: var(--text); }
.wiz-steps { display: flex; gap: 8px; padding: 14px 18px 0; flex-wrap: wrap; }
.wiz-dot { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--text-soft); }
.wiz-dot > span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.wiz-dot.on { color: var(--text); }
.wiz-dot.on > span { background: var(--primary); color: #fff; border-color: transparent; }
.wiz-dot.done > span { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.wiz-dot .material-icons { font-size: 14px; }
.wiz-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.wiz-p { font-size: 14px; color: var(--text); line-height: 1.55; margin: 0; }
.wiz-open { align-self: flex-start; }
.wiz-link { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 700; font-size: 13px; text-decoration: none; }
.wiz-link:hover { text-decoration: underline; }
.wiz-hint { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; line-height: 1.5; }
.wiz-hint .material-icons { font-size: 17px; color: var(--primary); flex-shrink: 0; }
.wiz-hint.warn .material-icons { color: #e8590c; }
.wiz-copy { display: flex; gap: 8px; }
.wiz-copy .form-control { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.wiz-copy .btn { flex-shrink: 0; }
.wiz-fields { display: flex; flex-direction: column; gap: 11px; }
.idp-fld.req > span::after { content: ' *'; color: #e8590c; }
.wiz-summary { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.wiz-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
.wiz-row:last-child { border-bottom: none; }
.wiz-row > span { color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.wiz-row > b { color: var(--text); font-weight: 700; word-break: break-all; text-align: right; }
.wiz-miss { color: #e8590c; }
.wiz-enable { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; cursor: pointer; }
.wiz-enable input { accent-color: var(--primary); width: 16px; height: 16px; }
.wiz-foot { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.wiz-spacer { flex: 1; }
.sso-box.hidden { display: none; }
.sso-box label { font-size: 12.5px; font-weight: 700; display: block; margin-bottom: 8px; }
.sso-inline { display: flex; gap: 8px; }
.sso-inline .form-control { flex: 1; }

.auth-foot { margin-top: 24px; font-size: 12px; color: var(--text-soft); text-align: center; line-height: 1.7; }
.auth-foot a { color: var(--text-muted); text-decoration: none; font-weight: 600; }
.auth-foot a:hover { color: var(--primary); }

@media (max-width: 900px) {
    .auth-hero { display: none; }
    .auth-panel { width: 100%; min-height: 100vh; min-height: 100svh; max-height: none; overflow: visible; }
    .auth-card .auth-brand { display: flex; }
    .auth-scroll { padding: 8px 24px 32px; }
}
@media (max-height: 700px) {
    .auth { height: 100dvh; min-height: 0; overflow: hidden; }
    .auth-panel { height: 100%; min-height: 0; max-height: 100dvh; overflow: hidden; }
    .auth-scroll { align-items: flex-start; padding-top: 16px; padding-bottom: 16px; }
    .auth-card .auth-brand { margin-bottom: 14px; }
    .provider-section { margin-top: 8px; }
    .auth-foot { margin-top: 12px; }
}
@media (max-height: 560px) and (min-width: 901px) {
    .auth-hero { gap: 16px; padding: 22px; }
    .auth-hero-body h2 { font-size: 23px; margin-bottom: 8px; }
    .auth-points, .auth-badges { display: none; }
}

/* ---------------- Topbar settings icon & footer sign-in ---------------- */
a.icon-btn { text-decoration: none; }
.icon-btn.active { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

/* Header casting control — lights up while a screencast is live. */
.icon-btn.fs-cast.on { background: var(--primary); color: #fff; border-color: var(--primary); animation: fsCastPulse 1.6s ease-in-out infinite; }
.icon-btn.fs-cast.fs-cast-off { opacity: .45; cursor: not-allowed; }
@keyframes fsCastPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(91, 52, 214, .45); } 50% { box-shadow: 0 0 0 6px rgba(91, 52, 214, 0); } }

/* Cast menu (choose TV vs screen share) + transient toast. */
.fs-cast-menu { position: fixed; z-index: 4000; min-width: 232px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 34px rgba(0, 0, 0, .18); padding: 6px; }
.fs-cast-menu[hidden] { display: none; }
.fs-cast-mi { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.fs-cast-mi:hover { background: var(--surface-2); color: var(--primary); }
.fs-cast-mi .material-icons { font-size: 19px; color: var(--text-soft); }
.fs-cast-mi:hover .material-icons { color: var(--primary); }
.fs-cast-mi:disabled { opacity: .5; cursor: default; }
.fs-cast-mi:disabled:hover { background: none; color: var(--text); }
.fs-cast-mi:disabled:hover .material-icons { color: var(--text-soft); }
.fs-cast-mi small { color: var(--text-soft); font-weight: 500; margin-left: auto; }
.fs-cast-note { padding: 7px 10px 9px; color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.fs-cast-toast { position: fixed; z-index: 4001; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--surface); font-size: 13px; font-weight: 600; padding: 10px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: 80vw; }
.footer-signin { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); display: grid; place-items: center; text-decoration: none; flex-shrink: 0; transition: background .15s, color .15s; }
.footer-signin:hover { background: var(--primary-soft); color: var(--primary); }
.footer-signin .material-icons { font-size: 18px; }
/* Global upload/save filmshop.json controls (beneath the Filmshop Assessment nav item) */
.nav-store-actions { display: flex; gap: 6px; padding: 4px 4px 6px; }
.nav-intro-row { display: flex; align-items: center; gap: 4px; }
.nav-intro-row .nav-item { flex: 1; min-width: 0; }
.nav-store-ic { flex: 0 0 auto; width: 30px; padding: 0; }
.nav-store-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.nav-store-btn:hover { background: var(--primary-soft); color: var(--primary); }
.nav-store-btn .material-icons { font-size: 16px; }
.nav-store-btn.ok { color: #16a34a; border-color: #16a34a; }
.nav-store-btn.err { color: #dc2626; border-color: #dc2626; }
@media (min-width: 861px) {
    .app.rail .sidebar .nav-store-btn > span:not(.material-icons) { display: none; }
    .app.rail .sidebar .nav-store-actions { flex-direction: column; padding-left: 6px; padding-right: 6px; }
}
.settings-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-grid > * { min-width: 0; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 92px; border-bottom: none; margin-bottom: 0; overflow: visible; }
.settings-nav .tab { justify-content: flex-start; border-bottom: none; border-radius: 10px; padding: 10px 12px; }
.settings-nav .tab.active { background: var(--primary-soft); border-bottom: none; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: none; }
.setting-row .meta .t { font-weight: 700; font-size: 13.5px; }
.setting-row .meta .d { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--border); border-radius: 24px; cursor: pointer; transition: background .15s; }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: var(--shadow-sm); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

@media (max-width: 1080px) {
    .settings-grid { grid-template-columns: 1fr; }
    .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}

/* ---------------- Filmshops.json data binding (Linked Assets) ---------------- */
.fs-refs-head { margin-top: 32px; }
.panel-head h4 .fs-cat-ic { font-size: 18px; vertical-align: -4px; margin-right: 6px; color: var(--text-muted); }

/* ---------------- Filmshop template picker (sidebar) ---------------- */
.fs-hidden-input { display: none; }
.nav-item.sub .fs-pick-ic { font-size: 17px; margin-left: 1px; color: var(--text-soft); }
.nav-parent.has-model > .nav-item .material-icons,
.nav-parent.has-model > .nav-item span { color: var(--primary); }
.fs-pick-status { cursor: default; color: var(--text-soft); font-weight: 500; }
.fs-pick-status:hover { background: none; color: var(--text-soft); }
.fs-pick-status span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- Scaled Agile flow diagrams ---------------- */
.flow-diagram { overflow-x: auto; padding: 8px 0; }
.flow-diagram .mermaid { min-width: 640px; margin: 0; text-align: center; }
.panel .list li a.pill { text-decoration: none; margin-left: auto; }

/* ---------------- Tab dropdown (navigation) ---------------- */
.tab-select-wrap { margin: 4px 0 20px; }
.tab-select { width: 100%; max-width: 360px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px; padding: 10px 13px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.tab-select:focus { outline: none; border-color: var(--primary); }

/* ---------------- Global Filmshop AI Agent (floating) ---------------- */
.fs-agent-fab {
    position: fixed; right: 22px; bottom: calc(22px + 10vh); z-index: 80;
    width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff; box-shadow: 0 10px 26px rgba(91, 60, 196, .42);
    display: grid; place-items: center; transition: transform .15s, box-shadow .15s;
}
.fs-agent-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(91, 60, 196, .5); }
.fs-agent-fab .material-icons { font-size: 26px; }
.fs-agent-badge { position: absolute; top: 0; right: 0; width: 13px; height: 13px; border-radius: 50%; background: #37c978; border: 2px solid #fff; animation: fsBadgePulse 2s ease-in-out infinite; }
.fs-agent-badge::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid #37c978; opacity: .6; animation: fsBadgeRing 2s ease-out infinite; }
@keyframes fsBadgePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes fsBadgeRing { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2.2); opacity: 0; } }

/* Idle help toast from the agent. */
.fs-agent-toast { position: fixed; z-index: 79; max-width: 230px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(20, 20, 50, .22); padding: 9px 8px 9px 12px; font-size: 12.5px; font-weight: 600; line-height: 1.35; display: none; align-items: flex-start; gap: 6px; cursor: pointer; }
.fs-agent-toast.show { display: flex; animation: fsToastIn .28s ease; }
.fs-agent-toast-msg { flex: 1; }
.fs-agent-toast-x { border: none; background: none; color: var(--text-soft); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; flex-shrink: 0; }
.fs-agent-toast-x:hover { color: var(--text); }
@keyframes fsToastIn { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .fs-agent-badge, .fs-agent-badge::after { animation: none; }
    .fs-agent-toast.show { animation: none; }
}

/* Global notification toast (announces unread notifications on filmshop load). */
.fs-toast-stage { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.fs-toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 12px 12px 14px; opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease; }
.fs-toast.in { opacity: 1; transform: none; }
.fs-toast.green { border-left-color: var(--green); }
.fs-toast.amber { border-left-color: var(--amber); }
.fs-toast.red { border-left-color: var(--red); }
.fs-toast-ic { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.fs-toast.green .fs-toast-ic { background: var(--green-soft); color: var(--green); }
.fs-toast-ic .material-icons { font-size: 18px; }
.fs-toast-body { flex: 1; min-width: 0; }
.fs-toast-title { font-size: 13px; font-weight: 700; }
.fs-toast-msg { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.fs-toast-action { margin-top: 9px; display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 7px; border: 1px solid var(--primary); background: var(--primary); color: #fff; cursor: pointer; }
.fs-toast-action:hover { filter: brightness(1.08); }
.fs-toast-action .material-icons { font-size: 15px; }
.fs-toast-x { border: none; background: none; color: var(--text-muted); cursor: pointer; line-height: 1; padding: 0 2px; flex-shrink: 0; }
.fs-toast-x .material-icons { font-size: 17px; }
.fs-toast-x:hover { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .fs-toast { transition: none; } }

.fs-agent-panel {
    position: fixed; right: 22px; bottom: calc(90px + 10vh); z-index: 80;
    width: var(--fs-dock-w); max-width: calc(100vw - 32px); max-height: min(640px, calc(90vh - 106px));
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
    box-shadow: 0 24px 60px rgba(20, 20, 50, .28);
    display: none; flex-direction: column; overflow: hidden;
}
.fs-agent-panel.open { display: flex; }
.fs-agent-panel--max { right: auto; bottom: auto; max-width: none; max-height: none; border-radius: 16px; }
/* Floating window: drag by the header, resize from any edge/corner. */
.fs-agent-panel--float { right: auto; bottom: auto; max-width: none; max-height: none; border-radius: 16px; box-shadow: 0 28px 70px rgba(20, 20, 50, .34); }
.fs-agent-panel--float .fs-cmp-toprow { cursor: move; }
.fs-agent-rs { display: none; }
.fs-agent-panel--float .fs-agent-rs { display: block; position: absolute; z-index: 40; }
.fs-agent-panel--float .fs-agent-rs-n { top: -3px; left: 10px; right: 10px; height: 8px; cursor: ns-resize; }
.fs-agent-panel--float .fs-agent-rs-s { bottom: -3px; left: 10px; right: 10px; height: 8px; cursor: ns-resize; }
.fs-agent-panel--float .fs-agent-rs-e { right: -3px; top: 10px; bottom: 10px; width: 8px; cursor: ew-resize; }
.fs-agent-panel--float .fs-agent-rs-w { left: -3px; top: 10px; bottom: 10px; width: 8px; cursor: ew-resize; }
.fs-agent-panel--float .fs-agent-rs-ne { top: -4px; right: -4px; width: 14px; height: 14px; cursor: nesw-resize; }
.fs-agent-panel--float .fs-agent-rs-nw { top: -4px; left: -4px; width: 14px; height: 14px; cursor: nwse-resize; }
.fs-agent-panel--float .fs-agent-rs-se { bottom: -4px; right: -4px; width: 14px; height: 14px; cursor: nwse-resize; }
.fs-agent-panel--float .fs-agent-rs-sw { bottom: -4px; left: -4px; width: 14px; height: 14px; cursor: nesw-resize; }
/* Docked panels stay below the app header; only the content reserves dock space. */
:root { --fs-dock-w: min(420px, 94vw); --fs-dock-h: min(46vh, 560px); }
.fs-agent-panel--dock-right { right: 0; top: var(--fs-header-bottom, 72px); bottom: 0; left: auto; width: var(--fs-dock-w); max-width: none; max-height: none; height: auto; border-radius: 0; border-width: 0 0 0 1px; box-shadow: -12px 0 40px rgba(20, 20, 50, .22); }
.fs-agent-panel--dock-bottom { left: var(--sidebar-w, 0); right: 0; bottom: 0; top: auto; width: auto; max-width: none; height: var(--fs-dock-h); max-height: calc(100dvh - var(--fs-header-bottom, 72px)); border-radius: 0; border-width: 1px 0 0 0; box-shadow: 0 -12px 40px rgba(20, 20, 50, .22); }
/* Docked right: scroll the content inside .main (scrollbar lands just left of the chat rail) instead of
   the whole document, so the browser's outer scrollbar doesn't sit to the right of the docked panel. */
body.fs-agent-docked-right { overflow: hidden; }
body.fs-agent-docked-right .app { height: 100vh; min-height: 0; }
/* Only reserve the dock space while the agent panel is actually open; if it's
   closed/minimized the content reclaims the full width even if the dock class lingers. */
body.fs-agent-docked-right:has(#fsAgentPanel.open) .main { height: 100vh; overflow: hidden; }
body.fs-agent-docked-right:has(#fsAgentPanel.open) .main > .content { margin-right: var(--fs-dock-w); }
body.fs-agent-docked-right .main > .topbar { flex-shrink: 0; }
body.fs-agent-docked-right .main > .content { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
body.fs-agent-docked-bottom:has(#fsAgentPanel.open) .main > .content { margin-bottom: min(var(--fs-dock-h), calc(100dvh - var(--fs-header-bottom, 72px))); }
@media (max-width: 720px) { .fs-agent-panel--dock-bottom { left: 0; } body.fs-agent-docked-right { overflow: auto; } body.fs-agent-docked-right .main, body.fs-agent-docked-right:has(#fsAgentPanel.open) .main { margin-right: 0; height: auto; overflow: visible; } body.fs-agent-docked-right .main > .content { margin-right: 0 !important; overflow-y: visible; flex: none; } }
@media (max-width: 720px) { .topbar .topbar-actions { min-width: 0; max-width: 100%; overflow-x: auto; flex-wrap: nowrap; } }
.fs-agent-ico.on { color: var(--primary); background: var(--primary-soft); }
/* Maximized: keep the readable columns centered so the wide panel doesn't leave a vast empty body */
.fs-agent-panel--max .fs-agent-body { align-items: center; }
.fs-agent-panel--max .fs-agent-body .msg { width: 100%; max-width: 760px; }
.fs-agent-panel--max .fs-agent-prompts,
.fs-agent-panel--max .fs-agent-a2a,
.fs-agent-panel--max .fs-agent-composer,
.fs-agent-panel--max .fs-agent-field { width: 100%; max-width: 792px; margin-left: auto; margin-right: auto; }
.fs-agent-panel--max .fs-agent-media { align-self: center; width: 100%; max-width: 792px; }
/* Playback figure/scope segments relocated next to the department dropdown in the composer */
.fs-media-opts--cmp { flex: 0 0 auto; justify-content: flex-start; gap: 6px; }
.fs-media-opts--cmp .fs-media-seg { padding: 2px; }
.fs-media-opts--cmp .fs-media-seg button { padding: 4px 8px; font-size: 10.5px; }
.fs-agent-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--border); }
/* Sidebar footer relocated into the agent panel + the no-files chat prompt. */
.fs-agent-foot { flex: none; position: relative; z-index: 12; }
/* Collapse the relocated sidebar footer while it has no visible content (removes empty gap above Organization). */
.fs-agent-foot .sidebar-footer { padding: 0; border-top: none; gap: 0; }
.fs-agent-foot .sidebar-footer:has(> * > *) { padding: 12px 8px 8px; border-top: 0.8px solid var(--border); gap: 10px; }
/* Inline tool view (rail tools render here instead of floating popups). Overlays the chat body at its current size so the composer/chat doesn't move. */
.fs-agent-body { position: relative; }
.fs-agent-body.fs-tv-active { overflow: hidden; }
.fs-agent-body.fs-agent-body--graph > :not(#fsAgentGraph) { display: none !important; }
.fs-agent-body > #fsAgentGraph { position: absolute; inset: 0; z-index: 8; min-height: 0; }
.fs-agent-toolview { position: absolute; inset: 0; background: var(--surface); display: none; flex-direction: column; z-index: 8; }
.fs-agent-toolview.open { display: flex; }
.fs-tv-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.fs-tv-ic { color: var(--primary); font-size: 20px; }
.fs-tv-title { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 800; color: var(--text); }
.fs-tv-close { width: 28px; height: 28px; border: none; background: none; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--text-muted); }
.fs-tv-close:hover { background: var(--surface-2); color: var(--text); }
.fs-tv-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
/* Modal pages loaded into the content window fill the whole tool view. */
.fs-tv-frame-wrap { flex: 1 1 auto; min-height: 0; position: relative; }
.fs-tv-frame { width: 100%; height: 100%; border: 0; display: block; background: var(--surface); }
.fs-tv-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--surface); color: var(--text-muted); font-size: 13px; font-weight: 600; z-index: 1; transition: opacity .3s ease; }
.fs-tv-loading.done { opacity: 0; pointer-events: none; }
.fs-tv-spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: fsTvSpin .8s linear infinite; }
@keyframes fsTvSpin { to { transform: rotate(360deg); } }
/* Drag handle removed: the tool view now fills the chat body's natural height. */
.fs-tv-resize { display: none; }
.fs-tv-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.fs-tv-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--primary); flex: 0 0 auto; }
.fs-tv-muted { color: var(--text-muted); font-size: 12px; }
.fs-tv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.fs-tv-list > li { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 10px; font-size: 13px; color: var(--text); }
.fs-tv-list > li:hover { background: var(--surface-2); }
.fs-tv-list .material-icons { font-size: 18px; color: var(--text-muted); }
.fs-tv-rows > li { flex-direction: column; align-items: stretch; gap: 2px; border: 1px solid var(--border); }
.fs-tv-rows > li b { font-size: 13px; }
.fs-tv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fs-tv-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); font-size: 12px; font-weight: 700; cursor: pointer; }
.fs-tv-tile:hover { border-color: var(--primary); color: var(--primary); }
.fs-tv-tile .material-icons { font-size: 22px; color: var(--primary); }
.fs-tv-fb { display: flex; flex-direction: column; gap: 8px; }
.fs-tv-fb-row { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 10px; font-size: 12px; }
.fs-tv-fb-row i { height: 10px; border-radius: 6px; display: block; }
.fs-tv-fb-row i.busy { background: var(--primary); }
.fs-tv-fb-row i.free { background: var(--border); }
.fs-tv-play { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 9px 14px; border: 1px solid var(--primary); background: var(--primary); color: #fff; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.fs-tv-play:hover { background: var(--primary-2); border-color: var(--primary-2); }
.fs-tv-play .material-icons { font-size: 18px; }
/* Agent-swarm / workflow status strip (modal footer). */
.fs-agent-swarm { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--text-muted); position: relative; z-index: 12; }
.fs-swarm-ic { font-size: 16px; color: var(--text-muted); }
.fs-swarm-stat b { color: var(--text); font-weight: 800; }
.fs-swarm-dot { opacity: .5; }
.fs-swarm-bar { flex: 1 1 auto; min-width: 40px; height: 6px; border-radius: 4px; background: var(--border); overflow: hidden; }
.fs-swarm-bar > i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--primary); }
/* Flow launcher pinned in the footer beside the workflows bar. */
.fs-swarm-flow { flex: 0 0 auto; width: 24px; height: 22px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); border-radius: 6px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.fs-swarm-flow:hover { color: var(--primary); border-color: var(--primary); }
.fs-swarm-flow .material-icons { font-size: 15px; }
.fs-swarm-status { flex: 0 0 auto; font-weight: 700; }
.fs-agent-swarm.fs-swarm-live { color: var(--text); }
.fs-agent-swarm.fs-swarm-live .fs-swarm-ic { color: var(--primary); animation: fsSwarmPulse 1s ease-in-out infinite; }
.fs-agent-swarm.fs-swarm-live .fs-swarm-status { color: var(--primary); }
/* Footer swarm strip is clickable: opens the Agent swarm app. */
.fs-agent-swarm.fs-swarm-click { cursor: pointer; transition: background .15s, color .15s; }
.fs-agent-swarm.fs-swarm-click:hover { background: var(--primary-soft); color: var(--text); }
.fs-agent-swarm.fs-swarm-click:hover .fs-swarm-ic { color: var(--primary); }
/* Async configuration-loading progress bar (top of page). */
.fs-load-prog { position: fixed; top: 0; left: 0; right: 0; z-index: 20000; opacity: 0; transform: translateY(-100%); transition: opacity .2s, transform .2s; pointer-events: none; }
.fs-load-prog.show { opacity: 1; transform: translateY(0); }
.fs-load-prog-track { height: 3px; background: var(--primary-soft, #eef2ff); overflow: hidden; }
.fs-load-prog-fill { display: block; height: 100%; width: 3%; background: var(--primary); border-radius: 0 3px 3px 0; transition: width .3s ease; }
.fs-load-prog.done .fs-load-prog-fill { transition: width .2s ease; }
.fs-load-prog-lbl { position: absolute; top: 8px; right: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb); box-shadow: 0 6px 20px rgba(20, 20, 50, .16); font-size: 11.5px; font-weight: 700; color: var(--text, #0f172a); }
.fs-load-prog-lbl .material-icons { font-size: 15px; color: var(--primary); animation: fsLoadSpin 1s linear infinite; }
.fs-load-prog.done .fs-load-prog-lbl .material-icons { animation: none; }
@keyframes fsLoadSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fs-load-prog-lbl .material-icons { animation: none; } }
@keyframes fsSwarmPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
/* Agent app overlays are positioned within .fs-agent-body, above the chat and below the composer. */
.fs-agent-foot .sidebar-footer { margin-top: 0; }
.fs-agent-nofiles { flex: none; padding: 8px 12px 2px; }
.fs-agent-nofiles[hidden] { display: none; }
.fs-nofiles-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 9px 12px; border: 1px dashed var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.fs-nofiles-btn:hover { background: var(--surface); border-color: var(--primary); color: var(--primary); }
.fs-nofiles-btn .material-icons { font-size: 18px; }
/* Storage bar relocated into the agent header, sign-in into the topbar, whitelabel next to the composer dept dropdown. */
.fs-agent-head .fs-agent-avrow { flex: 1 0 100%; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.fs-agent-head .fs-agent-avrow .avatar { width: 30px; height: 30px; font-size: 11px; cursor: pointer; }
/* Account menu anchored to the avatar. */
.fs-ava-wrap { position: relative; flex: 0 0 auto; }
.fs-ava-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; width: 224px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(15, 15, 45, .22); padding: 8px; }
.fs-ava-menu[hidden] { display: none; }
.fs-ava-hd { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; }
.fs-ava-lg { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: 0 0 auto; }
.fs-ava-meta { display: flex; flex-direction: column; min-width: 0; }
.fs-ava-meta b { font-size: 13px; }
.fs-ava-meta span { font-size: 11px; color: var(--text-muted); }
.fs-ava-status { padding: 2px 8px; color: var(--text-muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.fs-ava-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px; border: none; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); text-align: left; border-radius: 8px; cursor: pointer; }
.fs-ava-item:hover { background: var(--primary-soft, rgba(99, 102, 241, .12)); }
.fs-ava-item .material-icons { font-size: 17px; color: var(--text-muted); }
.fs-ava-div { height: 1px; background: var(--border); margin: 5px 4px; }
/* Storage ring pinned to the top-right of the chat text editor, with a storage menu. */
.fs-store-wrap { position: absolute; top: 11px; left: 9px; right: auto; z-index: 6; }
.fs-store-wrap .fs-storage-bar { width: 26px; height: 26px; padding: 0; margin: 0; gap: 0; border: 1px solid var(--border); border-top: 1px solid var(--border); background: var(--surface); border-radius: 50%; position: relative; display: grid; place-items: center; cursor: pointer; --track: var(--border); --fill: var(--primary); }
.fs-store-wrap .fs-storage-bar.warn { --fill: #e07b00; }
.fs-store-wrap .fs-storage-bar.over { --fill: #c62828; }
.fs-store-wrap .fs-storage-bar::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--fill) calc(var(--pct, 0) * 1%), var(--track) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px)); }
.fs-store-wrap .fs-storage-bar > .material-icons:first-child { position: relative; z-index: 1; font-size: 13px; color: var(--text-muted); }
.fs-store-wrap .fs-storage-bar .fs-sb-meter, .fs-store-wrap .fs-storage-bar .fs-sb-txt { display: none; }
.fs-store-menu { position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 50; width: 262px; max-width: 78vw; max-height: min(60vh, 420px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(15, 15, 45, .22); padding: 12px 14px; }
.fs-store-menu[hidden] { display: none; }
.fs-store-sec { padding: 8px 0; border-top: 1px solid var(--border); }
.fs-store-sec:first-child { border-top: none; padding-top: 0; }
.fs-store-h { font-size: 11px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.fs-store-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; padding: 2px 0; color: var(--text); }
.fs-store-row span:last-child, .fs-store-row b { font-variant-numeric: tabular-nums; }
.fs-store-row b { font-weight: 800; }
.fs-store-folder { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-store-folder .material-icons { font-size: 15px; color: var(--primary); }
.fs-store-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.fs-store-bar { position: relative; height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: 7px 0 5px; }
.fs-store-bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--primary); }
.fs-store-note { font-size: 11px; color: var(--text-muted); }
.fs-store-empty { font-size: 12px; color: var(--text-muted); }
.fs-store-btn { width: 100%; margin-top: 10px; padding: 7px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.fs-store-btn:hover { border-color: var(--primary); color: var(--primary); }
.fs-store-btn .material-icons { font-size: 15px; }
/* Agent toolbar relocated to the panel footer — kept in the DOM (so the composer tool launchers can proxy it) but hidden; the tools row above the editor replaces it. */
.fs-agent-foot .fs-agent-actions { display: none; }
.fs-cmp-cfg { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; min-width: 0; }
.fs-cmp-cfg > .fs-agent-foot-cfg { flex: 1 1 auto; width: 100%; padding: 8px 0; }
.fs-cmp-cfg > .fs-agent-getstarted { flex: 1 1 auto; width: 100%; margin: 0 0 4px; }
/* Get Started overlays the empty text editor when no filmshop is loaded. */
.fs-cmp-input > .fs-agent-getstarted { position: absolute; inset: 0; z-index: 5; margin: 0; border: none; border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; text-align: center; padding-bottom: 16px; }
.fs-cmp-input > .fs-agent-getstarted[hidden] { display: none; }
/* Keep the composer action buttons visible (above the Get Started overlay) while it is showing. */
.fs-cmp-input.fs-gs-active > .fs-agent-getstarted { justify-content: center; padding-bottom: 46px; }
.fs-cmp-input.fs-gs-active .fs-cmp-inrow { position: relative; z-index: 6; }
.fs-cmp-input.fs-gs-active .fs-cmp-toprow { position: relative; z-index: 6; }
.fs-agent-foot-cfg { display: flex; flex-direction: column; align-items: stretch; gap: 6px; flex-wrap: nowrap; min-width: 0; padding: 8px 14px; }
.fs-agent-foot-cfg.fs-cmp-hide { display: none !important; }
/* Collapsible setup section: toggle header + the dropdown row (body). */
.fs-cfg-toggle { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; padding: 2px 8px 2px 4px; border: none; background: none; color: var(--text-muted); font: inherit; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; border-radius: 7px; }
.fs-cfg-toggle:hover { color: var(--text); background: var(--surface-2); }
.fs-cfg-tgl-ic { font-size: 16px; transition: transform .15s ease; }
.fs-agent-foot-cfg.fs-cfg-collapsed .fs-cfg-tgl-ic { transform: rotate(-90deg); }
.fs-cfg-body { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; min-width: 0; }
.fs-agent-foot-cfg.fs-cfg-collapsed .fs-cfg-body { display: none; }
.fs-cmp-ctx:empty { display: none; }
.fs-cmp-cfg > * { margin: 0; }
/* Each footer control is a labeled field: caption (with icon) on top, dropdown below. */
.fs-cfg-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fs-cfg-field--shop { flex: 1 1 auto; min-width: 0; }
.fs-cfg-field--dept { flex: 1 1 0; min-width: 0; }
.fs-cfg-field--wl { flex: 1 1 0; min-width: 0; }
/* Hide a field (caption + control) until its control is loaded/visible. */
.fs-cfg-field:has(> .fs-cmp-hide), .fs-cfg-field:has(> [hidden]) { display: none; }
.fs-cfg-cap { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); padding-left: 3px; overflow: hidden; white-space: nowrap; }
.fs-cfg-cap-ic { font-size: 13px; color: var(--text-soft); flex: 0 0 auto; }
/* Configuration on its own line; Department + Whitelabel share the line below. */
.fs-cmp-env { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 10px; min-width: 0; margin-top: -8px; padding: 0 14px 4px 0; }
.fs-cmp-env.fs-cmp-hide { display: none !important; }
/* Department + Whitelabel live in one full-width sub-row (line 2) instead of a zero-height break,
   so every stacked env row keeps a single consistent 8px vertical gap. */
.fs-cmp-env-row2 { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: end; gap: 8px 10px; min-width: 0; }
.fs-cmp-env-row2:not(:has(> .fs-cfg-field:not(:has(> .fs-cmp-hide)):not(:has(> [hidden])))) { display: none; }
.fs-cmp-env > .fs-cmp-wrap.fs-cmp-env-mode { flex: 0 1 auto; min-width: 0; position: relative; }
.fs-cmp-env .fs-cmp-env-mode .fs-cmp-btn { height: 30px; border-radius: 999px; }
/* Right-align the configuration value so it sits beside the caret. */
.fs-cmp-env .fs-shop-btn > #fsBrandName { text-align: right; }
/* Drop the inherited status-wrap indent so the pills' left edge lines up with the Local pill / chat textbox. */
.fs-cmp-env .fs-status-wrap, .fs-cmp-env .fs-shop-wrap, .fs-cmp-env .fs-wl-wrap { margin-left: 0; }
/* Consistent 30px control height across the footer config row + the env row under the Local dropdown. */
.fs-agent-foot-cfg .fs-shop-btn, .fs-agent-foot-cfg .fs-wl-btn, .fs-agent-foot-cfg .fs-cmp-chip,
.fs-cmp-env .fs-shop-btn, .fs-cmp-env .fs-wl-btn, .fs-cmp-env .fs-cmp-chip { height: 30px; }
.fs-cmp-cfg .fs-shop-wrap, .fs-agent-foot-cfg .fs-shop-wrap, .fs-cmp-env .fs-shop-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.fs-cmp-cfg .fs-shop-btn, .fs-agent-foot-cfg .fs-shop-btn, .fs-cmp-env .fs-shop-btn { width: 100%; min-width: 0; max-width: none; justify-content: flex-start; gap: 6px; padding: 4px 10px; font-size: 12px; border-radius: 999px; }
.fs-cmp-cfg .fs-shop-btn > span:not(.material-icons), .fs-agent-foot-cfg .fs-shop-btn > span:not(.material-icons), .fs-cmp-env .fs-shop-btn > span:not(.material-icons) { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Push the dropdown caret to the far right edge (a more specific rule otherwise pins it to margin-left:1px). */
.fs-agent-foot-cfg .fs-shop-btn .caret, .fs-agent-foot-cfg .fs-wl-btn .caret,
.fs-cmp-env .fs-shop-btn .caret, .fs-cmp-env .fs-wl-btn .caret { margin-left: auto; }
/* Unify all three dropdowns to one neutral pill style (matching the popup menu surface). */
.fs-agent-foot-cfg .fs-shop-btn.pill, .fs-agent-foot-cfg .fs-wl-btn.pill,
.fs-cmp-env .fs-shop-btn.pill, .fs-cmp-env .fs-wl-btn.pill { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.fs-agent-foot-cfg .fs-shop-btn.pill:hover, .fs-agent-foot-cfg .fs-wl-btn.pill:hover,
.fs-cmp-env .fs-shop-btn.pill:hover, .fs-cmp-env .fs-wl-btn.pill:hover { background: var(--surface-2); color: var(--primary); border-color: var(--primary); }
.fs-cmp-cfg .fs-shop-wrap .fs-status-menu, .fs-agent-foot-cfg .fs-shop-wrap .fs-status-menu, .fs-cmp-env .fs-shop-wrap .fs-status-menu { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; }
/* Department chip mirrors the Configuration / Whitelabel pills: a styled button + custom popup menu. */
.fs-cmp-cfg .fs-cmp-chip, .fs-agent-foot-cfg .fs-cmp-chip, .fs-cmp-env .fs-cmp-chip { position: relative; flex: 1 1 auto; min-width: 0; width: 100%; padding: 4px 10px; }
.fs-agent-foot-cfg .fs-dept-btn, .fs-cmp-env .fs-dept-btn { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; border: none; background: none; color: var(--text); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding: 0; }
.fs-agent-foot-cfg .fs-dept-lbl, .fs-cmp-env .fs-dept-lbl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.fs-agent-foot-cfg .fs-dept-btn .caret, .fs-cmp-env .fs-dept-btn .caret { margin-left: auto; font-size: 16px; color: var(--text); opacity: .8; flex: 0 0 auto; }
.fs-dept-wrap .fs-dept-menu { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; min-width: 200px; max-width: 280px; }
.fs-dept-wrap.fs-dept-open .fs-dept-menu { display: block; }
/* Whitelabel pill sits to the right of the department chip in the footer config row. */
.fs-agent-foot-cfg .fs-wl-wrap, .fs-cmp-env .fs-wl-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.fs-agent-foot-cfg .fs-wl-btn { width: 100%; max-width: none; justify-content: flex-start; gap: 6px; padding: 4px 10px; font-size: 12px; border-radius: 999px; }
.fs-agent-foot-cfg .fs-wl-btn > span:not(.material-icons) { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-agent-foot-cfg .fs-wl-wrap .fs-status-menu { top: auto; bottom: calc(100% + 6px); left: auto; right: 0; }
/* Match the Local run dropdown: give the Configuration, Department, Whitelabel and Agent-mode
   controls the same rounded-rect (9px) shape instead of full pills. */
.fs-cmp-cfg .fs-shop-btn, .fs-agent-foot-cfg .fs-shop-btn, .fs-cmp-env .fs-shop-btn,
.fs-cmp-cfg .fs-wl-btn, .fs-agent-foot-cfg .fs-wl-btn, .fs-cmp-env .fs-wl-btn, .fs-agent-composer .fs-wl-btn,
.fs-cmp-cfg .fs-cmp-chip, .fs-agent-foot-cfg .fs-cmp-chip, .fs-cmp-env .fs-cmp-chip,
.fs-cmp-env .fs-cmp-env-mode .fs-cmp-btn { border-radius: 9px; }
.topbar-actions .footer-signin { margin-left: 0; }
.fs-agent-composer .fs-wl-wrap { position: relative; flex: 0 1 auto; min-width: 120px; }
.fs-agent-composer .fs-wl-btn { min-width: 120px; max-width: 200px; }
/* Left-justify the whitelabel with the textarea / Local dropdown (drop the inherited left margin). */
.fs-cmp-input .fs-wl-wrap { margin-left: 0; align-self: flex-start; justify-content: flex-start; }
/* Match the Local dropdown pill styling (neutral surface, not the purple pill). */
.fs-cmp-input .fs-wl-btn.pill.purple { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; font-weight: 700; padding: 6px 8px; border-radius: 9px; box-shadow: none; }
.fs-cmp-input .fs-wl-btn.pill.purple:hover { border-color: var(--primary); background: var(--surface-2); color: var(--primary); }
.fs-cmp-input .fs-wl-btn .material-icons { font-size: 16px; color: inherit; }
.fs-cmp-input .fs-wl-btn .caret { margin-left: auto; font-size: 16px; opacity: .7; color: var(--text-muted); }
.fs-agent-composer .fs-wl-wrap .fs-status-menu { top: auto; bottom: calc(100% + 6px); left: auto; right: 0; max-width: min(320px, 80vw); }
/* Hide the config dropdown / departments until a filmshop is created or loaded. */
.fs-cmp-hide { display: none !important; }
/* "Get Started" empty state above the composer. */
.fs-agent-getstarted { margin: 0 14px 10px; padding: 16px; border: 1px dashed var(--border); border-radius: 14px; background: var(--surface-2); text-align: center; }
.fs-agent-getstarted[hidden] { display: none; }
.fs-gs-title { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--text); }
.fs-gs-title .material-icons { font-size: 18px; color: var(--primary); }
.fs-gs-sub { margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.fs-gs-btns { margin-top: 12px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.fs-gs-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.fs-gs-btn .material-icons { font-size: 17px; }
.fs-gs-btn:hover { border-color: var(--primary); color: var(--primary); }
.fs-gs-create { background: var(--primary); color: #fff; border-color: var(--primary); }
.fs-gs-create:hover { filter: brightness(1.05); color: #fff; }
/* VS Code-style composer (v2): context chip row, input, toolbar row, status footer. */
.fs-agent-composer.fs-agent-composer--v2 { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; row-gap: 8px; padding: 10px 14px 12px 54px; min-width: 0; position: relative; }
/* Vertical tool rail floats in the left gutter (top-aligned) so it doesn't stretch the content rows. */
.fs-agent-composer--v2 > .fs-cmp-tools { position: absolute; left: 14px; top: 10px; }
.fs-cmp-ctx { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fs-cmp-ctx .fs-agent-attach { width: 28px; height: 28px; border-radius: 8px; }
.fs-cmp-ctx .fs-agent-attach .material-icons { font-size: 18px; }
.fs-cmp-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 2px 8px 2px 10px; }
.fs-cmp-chip-ic { font-size: 15px; color: var(--text-soft); flex-shrink: 0; }
.fs-cmp-chip .fs-dept-select { border: none; background: transparent; box-shadow: none; border-radius: 0; padding: 3px 2px; min-width: 0; width: auto; max-width: 200px; font-size: 12px; font-weight: 700; color: var(--text); cursor: pointer; }
.fs-cmp-chip .fs-dept-select:focus { outline: none; }
.fs-cmp-input { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; border: 1px solid var(--border); background: var(--surface-2); border-radius: 14px; padding: 8px 10px; }
.fs-cmp-input:focus-within { border-color: var(--primary); }
/* Animated line that traces the text box outline when a message is sent. */
@property --fs-trace-ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.fs-cmp-input.fs-cmp-sent::after {
    content: ''; position: absolute; inset: -2px; border-radius: 16px; padding: 2px; pointer-events: none; z-index: 6;
    background: conic-gradient(from var(--fs-trace-ang), transparent 0deg, transparent 265deg, color-mix(in srgb, var(--primary) 35%, transparent) 315deg, var(--primary) 352deg, #fff 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
    animation: fsCmpTrace .85s linear 2;
}
@keyframes fsCmpTrace { from { --fs-trace-ang: 0deg; } to { --fs-trace-ang: 360deg; } }
@media (prefers-reduced-motion: reduce) { .fs-cmp-input.fs-cmp-sent::after { animation: none; } }
.fs-cmp-input textarea { flex: 1 1 auto; width: 100%; min-width: 0; border: none; background: none; padding: 4px 4px 0; font: inherit; font-size: 14px; line-height: 1.45; color: var(--text); resize: none; overflow-y: auto; min-height: 130px; max-height: 210px; outline: none; scrollbar-width: thin; }
.fs-cmp-input > .fs-cmp-inbar-r { flex: 0 0 auto; align-self: flex-end; }
.fs-cmp-inbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; flex-wrap: wrap; }
.fs-cmp-inbar-l { display: flex; align-items: center; gap: 6px; flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; justify-content: flex-end; }
/* Keep all bottom-bar controls on one line; the model dropdown shrinks/truncates as needed. */
.fs-cmp-inbar-l .fs-cmp-wrap { min-width: 0; flex: 0 1 auto; }
.fs-cmp-inbar-l .fs-cmp-wrap:has(#fsModelBtn) { flex: 1 1 auto; }
/* Local run-target dropdown + permissions icon, docked bottom-left inside the text editor. */
.fs-cmp-toprow { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; }
/* Window controls sit at the right of the top row (storage icon now sits at the left). */
.fs-cmp-toprow .fs-cmp-winctl { margin-left: auto; margin-right: 0; }
.fs-cmp-toprow .fs-cmp-run { position: relative; flex: 0 0 auto; }
.fs-cmp-inrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; }
.fs-cmp-inrow .fs-cmp-inbar-r { margin-left: auto; flex: 0 1 auto; max-width: 100%; min-width: 0; }
.fs-cmp-inbar-l2 { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; }
/* Worktree button (left of the text editor, shown once a configuration is loaded). */
.fs-cmp-inbar-l2 .fs-cmp-wt { width: 26px; height: 26px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); border-radius: 8px; cursor: pointer; display: grid; place-items: center; box-sizing: border-box; flex: 0 0 auto; }
.fs-cmp-inbar-l2 .fs-cmp-wt:hover { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.fs-cmp-inbar-l2 .fs-cmp-wt .material-icons { font-size: 16px; }
/* Live webcam picture-in-picture in the chat text editor (video playback mode). */
.fs-cam-pip { position: absolute; top: 44px; right: 10px; width: 132px; height: 90px; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(20, 20, 50, .25); z-index: 7; }
.fs-cam-pip video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.fs-cam-pip .fs-cam-lbl { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 10px; font-weight: 700; }
.fs-cam-pip .fs-cam-lbl .material-icons { font-size: 12px; }
.fs-cam-pip .fs-cam-x { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border: none; border-radius: 6px; background: rgba(0, 0, 0, .5); color: #fff; cursor: pointer; display: grid; place-items: center; }
.fs-cam-pip .fs-cam-x .material-icons { font-size: 14px; }
.fs-cam-pip.fs-cam-denied { background: var(--surface-2); }
.fs-cam-pip.fs-cam-denied video { display: none; }
.fs-cam-pip.fs-cam-denied .fs-cam-lbl { position: static; margin: 34px auto 0; background: transparent; color: var(--text-muted); display: flex; justify-content: center; }
.fs-cmp-input .fs-cmp-runbtn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; font-weight: 700; padding: 6px 8px; border-radius: 9px; cursor: pointer; }
.fs-cmp-input .fs-cmp-runbtn:hover { border-color: var(--primary); color: var(--primary); }
.fs-cmp-input .fs-cmp-runbtn .material-icons { font-size: 16px; flex-shrink: 0; }
.fs-cmp-input .fs-cmp-runbtn .fs-cmp-runcaret { font-size: 16px; opacity: .7; flex-shrink: 0; }
.fs-cmp-inbar-l2 .fs-cmp-permico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--text-muted); }
.fs-cmp-inbar-l2 .fs-cmp-permico:hover { background: var(--surface); color: var(--primary); }
.fs-cmp-inbar-l2 .fs-cmp-permico .material-icons { font-size: 18px; color: inherit; }
.fs-cmp-toprow .fs-cmp-permico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--text-muted); flex: 0 0 auto; }
.fs-cmp-toprow .fs-cmp-permico:hover { background: var(--surface); color: var(--primary); }
.fs-cmp-toprow .fs-cmp-permico .material-icons { font-size: 18px; color: inherit; }
/* Local dropdown + permission icon relocated next to the Agent (mode) dropdown in the bottom bar. */
.fs-cmp-inbar-l .fs-cmp-permico { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-muted); flex: 0 0 auto; box-sizing: border-box; }
.fs-cmp-inbar-l .fs-cmp-permico:hover { border-color: var(--primary); color: var(--primary); }
.fs-cmp-inbar-l .fs-cmp-permico .material-icons { font-size: 17px; color: inherit; }
.fs-cmp-inbar-l .fs-cmp-run { position: relative; flex: 0 0 auto; }
/* Context-window ring button + Session Info menu, right-justified in the top button row. */
.fs-cmp-inbar-l .fs-cmp-progtop { margin-left: 0; flex: 0 0 auto; }
/* Consistent 30px height across the mode / model / context controls. */
.fs-cmp-inbar-l .fs-cmp-btn, .fs-cmp-inbar-l .fs-ctx-btn { height: 30px; }
/* Local run-target pill (relocated out of .fs-cmp-input, so restate its pill styling here for both themes). */
.fs-cmp-inbar-l .fs-cmp-runbtn { display: inline-flex; align-items: center; gap: 5px; height: 30px; box-sizing: border-box; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; font-weight: 700; padding: 6px 8px; border-radius: 9px; cursor: pointer; }
.fs-cmp-inbar-l .fs-cmp-runbtn:hover { border-color: var(--primary); color: var(--primary); }
.fs-cmp-inbar-l .fs-cmp-runbtn .material-icons { font-size: 16px; flex-shrink: 0; }
.fs-cmp-inbar-l .fs-cmp-runbtn .fs-cmp-runcaret { font-size: 16px; opacity: .7; flex-shrink: 0; }
.fs-ctx-wrap { position: relative; }
.fs-ctx-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 9px; cursor: pointer; }
.fs-ctx-btn:hover { border-color: var(--primary); color: var(--primary); }
.fs-ctx-ring { width: 16px; height: 16px; border-radius: 50%; position: relative; flex: 0 0 auto; background: conic-gradient(var(--primary) calc(var(--pct, 0) * 1%), var(--border) 0); }
.fs-ctx-ring::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface-2); }
.fs-ctx-btn:hover .fs-ctx-ring::before { background: var(--surface); }
.fs-ctx-pct { font-variant-numeric: tabular-nums; }
.fs-ctx-menu { position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 30; width: 264px; max-width: 78vw; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(15, 15, 45, .22); padding: 12px 14px; }
.fs-ctx-menu[hidden] { display: none; }
.fs-ctx-sec { padding: 9px 0; border-top: 1px solid var(--border); }
.fs-ctx-sec:first-child { border-top: none; padding-top: 0; }
.fs-ctx-h { font-size: 11px; font-weight: 800; color: var(--text-muted); margin-bottom: 6px; }
.fs-ctx-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; padding: 2px 0; color: var(--text); }
.fs-ctx-row b { font-weight: 800; }
.fs-ctx-row span:last-child { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.fs-ctx-bar { position: relative; height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: 7px 0 6px; }
.fs-ctx-bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--primary); transition: width .2s; }
.fs-ctx-note { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-muted); }
.fs-ctx-swatch { width: 24px; height: 8px; border-radius: 4px; flex: 0 0 auto; background: repeating-linear-gradient(45deg, var(--primary-soft), var(--primary-soft) 3px, transparent 3px, transparent 6px); }
.fs-ctx-compact { width: 100%; margin-top: 11px; padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.fs-ctx-compact:hover { border-color: var(--primary); color: var(--primary); }
.fs-cmp-inbar-r { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; margin-left: auto; }
.fs-cmp-inbar .fs-agent-attach { width: 30px; height: 30px; border-radius: 8px; }
.fs-cmp-inbar .fs-agent-attach .material-icons { font-size: 18px; }
.fs-cmp-inbar .fs-cmp-btn { min-width: 0; }
.fs-cmp-inbar .fs-agent-modes { flex: 0 0 auto; }
.fs-cmp-inbar .fs-agent-progress { width: 32px; height: 30px; }
/* Text-editor button row: uniform compact buttons with consistent borders + smaller icons. */
.fs-cmp-inbar-r .fs-agent-attach,
.fs-cmp-inbar-r .fs-agent-mic,
.fs-cmp-inbar-r .fs-agent-mode-ic,
.fs-cmp-inbar-r #fsAgentSend { width: 26px !important; height: 26px !important; min-height: 0; border-radius: 8px !important; border: none !important; box-sizing: border-box; flex: 0 0 auto; }
.fs-cmp-inbar-r .material-icons { font-size: 15px !important; }
.fs-cmp-inbar-r #fsAgentSend { border: none !important; background: var(--primary); color: #fff; cursor: pointer; display: grid; place-items: center; }
.fs-cmp-inbar-r #fsAgentSend:hover { background: var(--primary-2); }
/* Prompt-tool buttons share the compact row style; row wraps to stay within the editor width. */
.fs-cmp-inbar-r { flex-wrap: wrap; justify-content: flex-end; gap: 4px; row-gap: 4px; min-width: 0; }
.fs-cmp-ptools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.fs-cmp-inbar-r .fs-cmp-ptool { width: 26px; height: 26px; border: none; background: var(--surface-2); color: var(--text-muted); border-radius: 8px; cursor: pointer; display: grid; place-items: center; box-sizing: border-box; flex: 0 0 auto; }
.fs-cmp-inbar-r .fs-cmp-ptool:hover { background: var(--surface); color: var(--primary); }
.fs-agent-progress { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); width: 36px; height: 34px; border-radius: 9px; cursor: pointer; display: grid; place-items: center; }
.fs-agent-progress .material-icons { font-size: 18px; }
.fs-agent-progress:hover { color: var(--primary); border-color: var(--primary); }
.fs-cmp-busy .fs-agent-progress { color: var(--primary); border-color: var(--primary); }
.fs-cmp-busy .fs-agent-progress .material-icons { animation: fsCmpSpin .8s linear infinite; }
.fs-cmp-busy .fs-cmp-status-dot { animation: fsCmpSpin .8s linear infinite; }
@keyframes fsCmpSpin { to { transform: rotate(360deg); } }
button.fs-cmp-stat { border: none; background: none; font: inherit; cursor: pointer; }
button.fs-cmp-stat:hover { color: var(--primary); }
.fs-cmp-run { position: relative; }
.fs-cmp-runbtn { gap: 5px; }
.fs-cmp-runcaret { font-size: 14px; opacity: .7; }
.fs-cmp-runmenu { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 24; min-width: 150px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 30px rgba(15,15,45,.2); padding: 5px; display: flex; flex-direction: column; gap: 2px; }
.fs-cmp-runmenu[hidden] { display: none; }
.fs-cmp-runmenu button { display: flex; align-items: center; gap: 8px; border: none; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--text); text-align: left; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.fs-cmp-runmenu button:hover { background: var(--primary-soft); }
.fs-cmp-runmenu .material-icons { font-size: 15px; color: var(--primary); }
.fs-cmp-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fs-cmp-bar-l { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.fs-cmp-bar-l .fs-cmp-btn { min-width: 0; }
.fs-cmp-bar-l .fs-agent-modes { flex: 0 0 auto; }
/* Order the composer rows: tool launchers, the full-width editor, the button toolbar, the config/department/whitelabel row, then the status divider. */
.fs-agent-composer--v2 > .fs-cmp-tools { order: 0; }
.fs-agent-composer--v2 > .fs-cmp-ctx { order: 1; }
.fs-agent-composer--v2 > .fs-cmp-input { order: 2; }
.fs-agent-composer--v2 > .fs-cmp-inbar { order: 3; }
.fs-agent-composer--v2 > .fs-cmp-env { order: 4; }
.fs-agent-composer--v2 > .fs-cmp-cfg { order: 4; }
.fs-agent-composer--v2 > .fs-cmp-status { order: 5; }
.fs-cmp-tools { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex-wrap: nowrap; }
.fs-cmp-tool { width: 30px; height: 21px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); border-radius: 7px; cursor: pointer; display: grid; place-items: center; }
.fs-cmp-tool[data-tool] { position: relative; }
.fs-agent-app-badge { position: absolute; top: -6px; right: -6px; z-index: 2; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px; background: #e11d48; color: #fff; font-size: 9px; font-weight: 800; line-height: 15px; text-align: center; box-shadow: 0 0 0 2px var(--surface, #fff); pointer-events: none; }
.fs-cmp-tool:hover { color: var(--primary); border-color: var(--primary); }
.fs-cmp-tool .material-icons { font-size: 16px; }
.fs-cmp-tool.on { color: var(--primary); border-color: var(--primary); background: var(--primary-soft, rgba(99, 102, 241, .12)); }
.fs-cmp-tool--summary .material-icons { color: var(--primary); }
/* Consolidated window-control cluster: a single grouped set of small icon buttons. */
/* Window-control cluster: a horizontal, right-justified row above the chat text. */
.fs-cmp-winctl { display: inline-flex; flex-direction: row; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.fs-agent-composer--v2 > .fs-cmp-winctl { justify-self: end; order: 0; }
.fs-cmp-winctl .fs-winctl-btn { width: 28px; height: 26px; border: none; background: none; border-radius: 7px; }
.fs-cmp-winctl .fs-winctl-btn:hover { background: var(--primary-soft, rgba(99, 102, 241, .12)); border-color: transparent; }
.fs-cmp-winctl .fs-winctl-btn .material-icons { font-size: 16px; }
.fs-cmp-winctl .fs-winctl-btn[data-win="close"]:hover { color: #fff; background: var(--red, #e03131); }
/* In-page agent windows spawned by Clone / New Chat / New Tab (stay within this browser page). */
.fs-agwin-host { position: fixed; inset: 0; z-index: 5000; pointer-events: none; }
.fs-agwin { position: fixed; width: min(1120px, 92vw); height: min(940px, 92vh); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 24px 60px rgba(15, 15, 45, .35); display: flex; flex-direction: column; overflow: hidden; pointer-events: auto; }
.fs-agwin--max { left: 3vw !important; top: 3vh !important; width: 94vw; height: 94vh; }
.fs-agwin--min { height: auto; }
.fs-agwin--min .fs-agwin-body { display: none; }
.fs-agwin-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); cursor: move; -webkit-user-select: none; user-select: none; }
.fs-agwin-ic { font-size: 18px; color: var(--primary); flex: 0 0 auto; }
.fs-agwin-title { flex: 1 1 auto; min-width: 0; font-size: 12.5px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-agwin-btn { width: 28px; height: 26px; border: none; background: none; border-radius: 7px; display: grid; place-items: center; cursor: pointer; color: var(--text-muted); flex: 0 0 auto; }
.fs-agwin-btn:hover { background: var(--primary-soft, rgba(99, 102, 241, .12)); color: var(--text); }
.fs-agwin-btn.fs-agwin-x:hover { background: var(--red, #e03131); color: #fff; }
.fs-agwin-btn .material-icons { font-size: 16px; }
.fs-agwin-body { flex: 1 1 auto; min-height: 0; }
.fs-agwin-body--content { overflow: auto; background: var(--surface); }
.fs-agwin-frame { width: 100%; height: 100%; border: 0; display: block; background: var(--surface); }
.fs-agwin--content { width: min(560px, 82vw); height: min(520px, 74vh); }
/* Frameless clone / new-chat windows: no header bar; a slim transparent strip at the top drags the window. */
.fs-agwin--frameless .fs-agwin-drag { position: absolute; top: 0; left: 0; right: 0; height: 14px; z-index: 4; cursor: move; }
/* A visible close button (the outer header is gone) sits in the top-right corner. */
.fs-agwin--frameless .fs-agwin-fclose { position: absolute; top: 7px; right: 7px; z-index: 6; width: 26px; height: 26px; border: none; border-radius: 7px; background: var(--surface-2); color: var(--text-muted); display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 3px rgba(20,20,50,.12); }
.fs-agwin--frameless .fs-agwin-fclose:hover { background: var(--red, #e03131); color: #fff; }
.fs-agwin--frameless .fs-agwin-fclose .material-icons { font-size: 16px; }
/* Drag-to-resize handles on every edge and corner (hidden when maximized). */
.fs-agwin-rs { position: absolute; z-index: 3; }
.fs-agwin--max .fs-agwin-rs { display: none; }
.fs-agwin-rs-e { top: 10px; bottom: 10px; right: 0; width: 6px; cursor: ew-resize; }
.fs-agwin-rs-w { top: 10px; bottom: 10px; left: 0; width: 6px; cursor: ew-resize; }
.fs-agwin-rs-s { left: 10px; right: 10px; bottom: 0; height: 6px; cursor: ns-resize; }
.fs-agwin-rs-n { left: 10px; right: 10px; top: 0; height: 6px; cursor: ns-resize; }
.fs-agwin-rs-se { right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; }
.fs-agwin-rs-sw { left: 0; bottom: 0; width: 14px; height: 14px; cursor: nesw-resize; }
.fs-agwin-rs-ne { right: 0; top: 0; width: 14px; height: 14px; cursor: nesw-resize; }
.fs-agwin-rs-nw { left: 0; top: 0; width: 14px; height: 14px; cursor: nwse-resize; }
/* Embedded chat view (clone / new-chat windows): show only the agent panel, not the site chrome. */
.fs-embed .sidebar,
.fs-embed .topbar,
.fs-embed .view-head,
.fs-embed .tabs:not(.settings-nav),
.fs-embed .fs-agent-fab { display: none !important; }
/* Cloned / new-chat windows (embedded agent) hide the account avatar. */
.fs-embed .fs-agent-avrow { display: none !important; }
.fs-embed .main { width: 100%; }
.fs-embed .content { padding: 0 !important; }
/* Panels contain only the selected content — drop the top gap left by the hidden tab bar / header. */
.fs-embed .view { padding-top: 0 !important; }
.fs-embed .view > .tab-panel:first-child,
.fs-embed .content > :first-child { margin-top: 0 !important; }

/* Workspace loading shroud — brief full-screen overlay while a page/datasets initialize. */
.fs-shroud { position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--bg, #0e1020); transition: opacity .4s ease; }
.fs-shroud.fs-shroud-hide { opacity: 0; pointer-events: none; }
.fs-shroud-spin { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--border, #2a2d44); border-top-color: var(--primary, #4361ee); animation: fsShroudSpin .8s linear infinite; }
.fs-shroud-txt { font-family: Inter, 'Segoe UI', Arial, sans-serif; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted, #9aa0b4); }
@keyframes fsShroudSpin { to { transform: rotate(360deg); } }
.fs-embed .fs-shroud { display: none !important; }

/* Translucent panels (Appearance toggle): show the appearance/leather backdrop beneath loaded panels. */
.fs-glass .desk-win { background: color-mix(in srgb, var(--surface) 74%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.fs-glass .desk-win-bar { background: color-mix(in srgb, var(--surface-2) 66%, transparent); }
.fs-glass .desk-win-body,
.fs-glass .desk-win-body iframe { background: transparent; }
.fs-glass body.fs-float-content .content { background: color-mix(in srgb, var(--surface) 80%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
/* Embedded panel pages become see-through so the desk backdrop shows in the content gaps. */
.fs-embed.fs-glass body,
.fs-embed.fs-glass .main,
.fs-embed.fs-glass .content { background: transparent !important; }

/* Hide the auto-populated department nav tab bar (script.js adds html.fs-hide-nav-tabs
   by folder; it wraps the bar in .tabs-wrap and it links to sibling .html pages).
   Content tabsets (#hash / no href) stay visible. */
.fs-hide-nav-tabs .tabs-wrap:has(a.tab[href*=".html"]) { display: none !important; }
.fs-embed .fs-agent-panel--max { left: 0 !important; top: 0 !important; width: 100vw !important; height: 100vh !important; max-width: none !important; max-height: none !important; border-radius: 0; }
/* Clone / new-chat windows: let the composer fill the width (drop the readability cap) and hide the swarm status footer. */
.fs-embed .fs-agent-panel--max .fs-agent-composer--v2 { max-width: none; }
.fs-embed .fs-agent-swarm { display: none !important; }
/* View-only embed (rail modal pages): show just the active popup content, hide the chat chrome + duplicate popup header. */
.fs-embed-view .fs-agent-head,
.fs-embed-view .fs-agent-body,
.fs-embed-view .fs-agent-prompts,
.fs-embed-view .fs-agent-a2a,
.fs-embed-view .fs-agent-composer,
.fs-embed-view .fs-agent-foot,
.fs-embed-view .fs-agent-foot-cfg,
.fs-embed-view .fs-agent-swarm { display: none !important; }
.fs-embed-view .fs-apps,
.fs-embed-view .fs-email,
.fs-embed-view .fs-cal,
.fs-embed-view .fs-notif,
.fs-embed-view .fs-fb,
.fs-embed-view .fs-agent-media,
.fs-embed-view .fs-agent-graph { position: absolute !important; inset: 0 !important; }
.fs-embed-view .fs-apps-hd,
.fs-embed-view .fs-email-hd,
.fs-embed-view .fs-cal-hd,
.fs-embed-view .fs-notif-hd,
.fs-embed-view .fs-fb-hd,
.fs-embed-view .fs-agent-media-hd,
.fs-embed-view .fs-agent-graph-hd { display: none !important; }
/* Hide the Org Graph view's own header when embedded as a modal (the tool view already has one). */
.fs-embed-view .fs-graph-head { display: none !important; }
/* Configuration Explorer window content. */
.fs-xp { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.fs-xp-head { padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.fs-xp-row { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 3px 0; color: var(--text); }
.fs-xp-k { flex: 0 0 78px; color: var(--text-muted); font-weight: 700; }
.fs-xp-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-xp-tree { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 8px 6px 12px; scrollbar-width: thin; }
.fs-xp-folder, .fs-xp-file { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 7px; font-size: 12.5px; color: var(--text); white-space: nowrap; }
.fs-xp-folder { color: var(--text-soft); font-weight: 700; }
.fs-xp-folder .material-icons, .fs-xp-file .material-icons { font-size: 16px; color: var(--text-soft); flex: 0 0 auto; }
.fs-xp-file .fs-xp-nm { overflow: hidden; text-overflow: ellipsis; }
.fs-xp-file:hover { background: var(--surface-2); }
.fs-xp-file.on { background: var(--primary-soft); color: var(--primary); }
.fs-xp-file.on .material-icons { color: var(--primary); }
.fs-xp-badge { margin-left: auto; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); border: 1px solid var(--primary); border-radius: 999px; padding: 1px 7px; }
.fs-xp-empty { padding: 16px; font-size: 12.5px; color: var(--text-muted); text-align: center; }
.fs-cmp-bar-r { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.fs-cmp-bar-r .fs-agent-mic { width: 36px; height: 34px; }
.fs-cmp-bar-r #fsAgentSend { border: none; background: var(--primary); color: #fff; width: 36px; height: 34px; border-radius: 9px; cursor: pointer; display: grid; place-items: center; }
.fs-cmp-bar-r #fsAgentSend:hover { background: var(--primary-2); }
.fs-cmp-bar-r #fsAgentSend .material-icons { font-size: 18px; }
.fs-cmp-status { display: flex; align-items: center; gap: 14px; padding-top: 6px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.fs-cmp-stat { display: inline-flex; align-items: center; gap: 5px; }
.fs-cmp-stat .material-icons { font-size: 14px; opacity: .85; }
.fs-cmp-status-dot { margin-left: auto; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary); }
.fs-agent-panel--max .fs-agent-composer--v2 { max-width: 860px; margin-left: auto; margin-right: auto; width: 100%; }
.fs-agent-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); flex-shrink: 0; }
.fs-agent-mark .material-icons { font-size: 20px; }
.fs-agent-head h4 { font-size: 14px; font-weight: 800; margin: 0; }
.fs-agent-head .sub { font-size: 11.5px; color: var(--text-soft); }
.fs-agent-actions { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; row-gap: 4px; min-width: 0; }
/* Fixed left-to-right order of the agent view buttons (window controls keep default order 0, so they trail). */
.fs-agent-actions #fsAgentView { order: -6; }
.fs-agent-actions #fsAgentAppsBtn { order: -5; }
.fs-agent-actions #fsAgentNotifBtn { order: -4; }
.fs-agent-actions #fsAgentMail { order: -3; }
.fs-agent-actions #fsAgentCalBtn { order: -2; }
.fs-agent-actions #fsAgentFbBtn { order: -1; }
.fs-agent-ico { border: none; background: none; color: var(--text-soft); cursor: pointer; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.fs-agent-ico:hover { background: var(--surface-2); color: var(--text); }
.fs-agent-ico .material-icons { font-size: 20px; }
.fs-agent-depts { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.fs-agent-depts .fs-dept-ic { font-size: 18px; color: var(--text-soft); flex-shrink: 0; }
.fs-dept-select { flex: 1; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.fs-dept-select:focus { outline: none; border-color: var(--primary); }
.fs-agent-launch { display: flex; align-items: center; gap: 9px; margin: 10px 14px 0; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); font-size: 13px; font-weight: 700; box-shadow: 0 6px 16px rgba(20, 20, 50, .18); }
.fs-agent-launch:hover { filter: brightness(1.06); }
.fs-agent-launch .fs-agent-launch-lbl { flex: 1; }
.fs-agent-launch .material-icons { font-size: 19px; }
.fs-agent-launch .fs-agent-launch-go { opacity: .85; }

/* ---------------- Floating agent: avatar + compact Voice/Avatar settings ---------------- */
.fs-agent-fic { display: inline-grid; place-items: center; }
/* 3D face avatar toggle on the floating button + canvas fill */
.fs-agent-3d-toggle { position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 7px rgba(20, 20, 50, .28); z-index: 2; transition: transform .12s, background .12s, color .12s; }
.fs-agent-3d-toggle:hover { transform: scale(1.1); color: var(--primary); border-color: var(--primary); }
.fs-agent-3d-toggle.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.fs-agent-3d-toggle .material-icons { font-size: 14px; }
.fs-agent-cast { position: absolute; left: -3px; bottom: -3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 7px rgba(20, 20, 50, .28); z-index: 2; transition: transform .12s, background .12s, color .12s; }
.fs-agent-cast:hover { transform: scale(1.1); color: var(--primary); border-color: var(--primary); }
.fs-agent-cast.on { background: var(--primary); border-color: var(--primary); color: #fff; animation: fsCastPulse 1.6s ease-in-out infinite; }
.fs-agent-cast .material-icons { font-size: 13px; }
.fs-agent-fic canvas, .fs-agent-mark canvas, .fs-media-ava canvas { display: block; width: 100%; height: 100%; border-radius: inherit; }
.fs-agent-fic { width: 100%; height: 100%; }
.fs-agent-mark { overflow: hidden; }
.fs-agent-fab .fs-emoji { font-size: 22px; line-height: 1; }
.fs-agent-fab .fs-init { font-size: 15px; font-weight: 800; letter-spacing: .5px; }
.fs-agent-mark .fs-emoji { font-size: 20px; line-height: 1; }
.fs-agent-mark .fs-init { font-size: 13px; font-weight: 800; }
.fs-agent-body .ava.bot .fs-emoji { font-size: 15px; line-height: 1; }
.fs-agent-body .ava.bot .fs-init { font-size: 11px; font-weight: 800; }
body.fs-av-circle .fs-agent-mark { border-radius: 50%; }
.fs-agent-settings { display: flex; flex-direction: column; gap: 9px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.fs-agent-settings[hidden] { display: none; }
.fs-set-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--text); }
.fs-set-voice { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 6px 9px; font: inherit; font-size: 12px; }
.fs-set-seg { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.fs-set-seg button { flex: 1; border: none; background: none; color: var(--text-muted); font: inherit; font-size: 11.5px; font-weight: 700; padding: 5px 4px; border-radius: 6px; cursor: pointer; }
.fs-set-seg button.on { background: var(--primary); color: #fff; }
.fs-set-more { font-size: 11.5px; color: var(--primary); text-decoration: none; font-weight: 700; align-self: flex-start; }
.fs-set-more:hover { text-decoration: underline; }

/* Mic record button + recorded voice message */
.fs-agent-mic { border: 1px solid var(--border) !important; background: var(--surface-2) !important; color: var(--text-muted) !important; width: 40px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.fs-agent-mic:hover { color: var(--primary) !important; border-color: var(--primary) !important; }
.fs-agent-mic.rec { background: #e03131 !important; border-color: #e03131 !important; color: #fff !important; animation: fsMicPulse 1.2s ease-in-out infinite; }
.fs-agent-mic-wrap { position: relative; display: inline-flex; align-items: stretch; }
.fs-agent-mic-wrap .fs-agent-mic { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; width: 32px; }
.fs-agent-mic-eng { border: 1px solid var(--border); border-left: none; background: var(--surface-2); color: var(--text-muted); width: 20px; border-radius: 0 10px 10px 0; cursor: pointer; display: grid; place-items: center; padding: 0; }
.fs-agent-mic-eng:hover { color: var(--primary); border-color: var(--primary); }
.fs-agent-mic-eng .material-icons { font-size: 16px; }
.fs-agent-mic-wrap.has-eng .fs-agent-mic, .fs-agent-mic-wrap.has-eng .fs-agent-mic-eng { color: var(--primary) !important; border-color: var(--primary) !important; }
.fs-eng-menu { left: auto; right: 0; width: 240px; }
.fs-eng-menu .fs-eng-on { color: var(--primary); }
/* Keep the transcription-engine caret fused to the mic as one split control in every context.
   In the compact input bar the mic is borderless with an 8px radius, so the caret must match it. */
.fs-cmp-inbar-r .fs-agent-mic-wrap { align-items: stretch; }
.fs-cmp-inbar-r .fs-agent-mic-wrap .fs-agent-mic { border-radius: 8px 0 0 8px !important; }
.fs-cmp-inbar-r .fs-agent-mic-eng { width: 16px !important; height: 26px !important; border: none !important; background: var(--surface-2); border-radius: 0 8px 8px 0 !important; box-shadow: inset 1px 0 0 var(--border); }
.fs-cmp-inbar-r .fs-agent-mic-eng .material-icons { font-size: 14px !important; }
.fs-cmp-inbar-r .fs-agent-mic-wrap.has-eng .fs-agent-mic-eng { background: var(--primary-soft); box-shadow: inset 1px 0 0 var(--primary); }
/* Compact action bar keeps a bordered split control — match heights + radii to the 34px mic. */
.fs-cmp-bar-r .fs-agent-mic-wrap .fs-agent-mic { border-radius: 9px 0 0 9px !important; }
.fs-cmp-bar-r .fs-agent-mic-eng { height: 34px; border-radius: 0 9px 9px 0; }

@keyframes fsMicPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(224, 49, 49, .5); } 50% { box-shadow: 0 0 0 6px rgba(224, 49, 49, 0); } }
.fs-voice-msg { display: flex; align-items: center; gap: 8px; }
.fs-voice-msg .material-icons { font-size: 18px; opacity: .8; }
.fs-voice-msg audio { height: 34px; max-width: 190px; }

/* ---------------- Floating agent: A2A Context packaging ---------------- */
.fs-agent-attach-wrap { position: relative; display: flex; }
.fs-agent-attach { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); width: 40px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.fs-agent-attach:hover { color: var(--primary); border-color: var(--primary); }
.fs-agent-attach[aria-expanded="true"] { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.fs-attach-menu { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 20; width: 210px; max-height: min(320px, 60vh); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 34px rgba(15, 15, 45, .22); padding: 6px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.fs-attach-menu[hidden] { display: none; }
.fs-attach-menu::-webkit-scrollbar { width: 8px; }
.fs-attach-menu::-webkit-scrollbar-track { background: transparent; }
.fs-attach-menu::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid var(--surface); }
.fs-attach-menu::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.fs-attach-menu.fs-attach--sensors { width: 320px; overflow-y: auto; overflow-x: hidden; }
.fs-attach-menu > button { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; text-align: left; padding: 8px 9px; border-radius: 8px; cursor: pointer; }
.fs-attach-menu > button:hover { background: var(--primary-soft); color: var(--primary); }
.fs-attach-menu .material-icons { font-size: 19px; }
.fs-attach-lbl { display: flex; flex-direction: column; line-height: 1.2; }
.fs-attach-lbl small { font-size: 10.5px; font-weight: 600; color: var(--text-muted); }
.fs-attach-menu > button:hover .fs-attach-lbl small { color: var(--primary); }
.fs-attach-back { border-bottom: 1px solid var(--border) !important; border-radius: 8px 8px 0 0 !important; margin-bottom: 2px; flex: 0 0 auto; }
.fs-attach--sensors .fs-attach-back { position: sticky; top: 0; z-index: 2; margin: -6px -6px 4px; padding: 9px 12px; background: var(--surface); border-radius: 12px 12px 0 0 !important; }
.fs-attach-sensors { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.fs-attach-sensors button { display: flex; align-items: center; gap: 6px; min-width: 0; border: none; background: none; color: var(--text); font: inherit; font-size: 11.5px; font-weight: 600; text-align: left; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.fs-attach-sensors button:hover { background: var(--primary-soft); color: var(--primary); }
.fs-attach-sensors .material-icons { font-size: 16px; color: var(--text-muted); flex: 0 0 auto; }
.fs-attach-sensors button:hover .material-icons { color: var(--primary); }
.fs-attach-sname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.fs-agent-a2a { margin: 0 12px 2px; padding: 9px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.fs-agent-a2a[hidden] { display: none; }
.fs-a2a-head { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--text); }
.fs-a2a-head .material-icons { font-size: 17px; color: var(--primary); }
.fs-a2a-title { flex: 1; }
.fs-a2a-count { min-width: 20px; text-align: center; background: var(--primary); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 800; padding: 1px 7px; }
.fs-a2a-clear { border: none; background: none; color: var(--text-muted); font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; padding: 2px 4px; }
.fs-a2a-clear:hover { color: #e03131; text-decoration: underline; }
.fs-a2a-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fs-a2a-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 5px 6px 5px 7px; }
.fs-a2a-chip > .material-icons { font-size: 17px; color: var(--primary); }
.fs-a2a-thumb { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; }
.fs-a2a-chip-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.fs-a2a-chip-name { font-size: 11.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.fs-a2a-chip-sub { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.fs-a2a-x { border: none; background: none; color: var(--text-soft); cursor: pointer; display: grid; place-items: center; padding: 2px; border-radius: 6px; }
.fs-a2a-x:hover { background: var(--surface-2); color: #e03131; }
.fs-a2a-x .material-icons { font-size: 15px; }
.fs-a2a-pack { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: none; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 12.5px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); cursor: pointer; }
.fs-a2a-pack:hover { filter: brightness(1.06); }
.fs-a2a-pack .material-icons { font-size: 17px; }

/* A2A package preview inside a chat bubble */
.fs-a2a-pkg { display: flex; flex-direction: column; gap: 8px; }
.fs-a2a-pkg-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.fs-a2a-pkg-head .material-icons { font-size: 17px; color: var(--primary); }
.fs-a2a-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.fs-a2a-pill { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px 2px 6px; font-size: 10.5px; font-weight: 700; color: var(--text); }
.fs-a2a-pill .material-icons { font-size: 13px; color: var(--primary); }
.fs-a2a-json { margin: 0; max-height: 180px; overflow: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 9px 10px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; line-height: 1.5; color: var(--text); white-space: pre; }
.fs-a2a-pkg-acts { display: flex; gap: 8px; }
.fs-a2a-dl, .fs-a2a-copy { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 11.5px; font-weight: 700; text-decoration: none; padding: 6px 11px; border-radius: 9px; cursor: pointer; }
.fs-a2a-dl:hover, .fs-a2a-copy:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.fs-a2a-dl .material-icons, .fs-a2a-copy .material-icons { font-size: 15px; }
.fs-a2a-play, .fs-a2a-route-send { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 11.5px; font-weight: 700; padding: 6px 11px; border-radius: 9px; cursor: pointer; }
.fs-a2a-play:hover, .fs-a2a-route-send:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.fs-a2a-play .material-icons, .fs-a2a-route-send .material-icons { font-size: 15px; }
.fs-a2a-route { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.fs-a2a-route > .material-icons { font-size: 16px; color: var(--primary); }
.fs-a2a-model { flex: 1; min-width: 0; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }

/* Message mode lead-in + model/mode footer */
.fs-msg-pre { font-weight: 700; color: var(--text); margin-bottom: 5px; }
.fs-msg-foot { display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; font-size: 10.5px; font-weight: 700; color: var(--text-muted); opacity: .8; }
.fs-msg-foot .material-icons { font-size: 13px; }

/* Per-message token/cost meter + rolling session total */
.fs-msg-usage { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); font-size: 10px; font-weight: 700; color: var(--text-muted); }
.fs-msg-usage .fs-u-seg { display: inline-flex; align-items: center; gap: 3px; }
.fs-msg-usage .material-icons { font-size: 12px; opacity: .8; }
.fs-msg-usage .fs-u-cost { color: var(--text); font-weight: 800; }
.fs-msg-usage .fs-u-roll { color: var(--primary); font-weight: 800; white-space: nowrap; }

/* ---------------- Composer toolbar: working mode + model pickers ---------------- */
.fs-agent-composer { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 7px; padding: 8px 14px 12px; flex-shrink: 0; }
.fs-agent-composer > .fs-cmp-wrap { min-width: 0; }
.fs-agent-composer > .fs-cmp-wrap:first-child { flex: 0 0 auto; }
.fs-agent-composer > .fs-cmp-wrap + .fs-cmp-wrap { flex: 1 1 auto; min-width: 120px; }
.fs-agent-depts--cmp { padding: 0; border-bottom: none; gap: 4px; flex: 1 1 auto; min-width: 0; }
.fs-agent-depts--cmp .fs-dept-ic { display: none; }
.fs-agent-depts--cmp .fs-dept-select { flex: 1 1 auto; width: auto; min-width: 150px; padding: 7px 10px; font-size: 12.5px; font-weight: 700; border-radius: 9px; }
.fs-cmp-wrap { position: relative; }
.fs-cmp-btn { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; font-weight: 700; padding: 6px 8px; border-radius: 9px; cursor: pointer; }
.fs-cmp-btn:hover { border-color: var(--primary); color: var(--primary); }
.fs-cmp-btn[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.fs-cmp-ic { font-size: 16px; flex-shrink: 0; }
.fs-cmp-caret { font-size: 16px; opacity: .7; flex-shrink: 0; }
/* Static prefix label (Mode: / Config: / Whitelabel:) before a dropdown's dynamic value. */
.fs-cmp-pre { flex: 0 0 auto; color: var(--text-muted); font-weight: 700; }
/* Keep the prefix fixed-width inside the Config / Whitelabel / Department pills (whose value span uses ellipsis). */
.fs-cmp-cfg .fs-shop-btn .fs-cmp-pre, .fs-agent-foot-cfg .fs-shop-btn .fs-cmp-pre, .fs-cmp-env .fs-shop-btn .fs-cmp-pre,
.fs-agent-foot-cfg .fs-wl-btn .fs-cmp-pre, .fs-cmp-env .fs-wl-btn .fs-cmp-pre, .fs-cmp-input .fs-wl-btn .fs-cmp-pre,
.fs-agent-foot-cfg .fs-dept-btn .fs-cmp-pre, .fs-cmp-env .fs-dept-btn .fs-cmp-pre { flex: 0 0 auto; overflow: visible; }
.fs-cmp-lbl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-cmp-menu { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 24; width: 244px; max-height: min(340px, 62vh); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 38px rgba(15, 15, 45, .24); padding: 6px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.fs-cmp-menu::-webkit-scrollbar { width: 8px; }
.fs-cmp-menu::-webkit-scrollbar-track { background: transparent; }
.fs-cmp-menu::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 2px solid var(--surface); }
.fs-cmp-menu::-webkit-scrollbar-thumb:hover { background: var(--text-soft); }
.fs-cmp-menu[hidden] { display: none; }
.fs-cmp-menu--model { left: auto; right: 0; }
/* Purpose group header in the model menu. */
.fs-cmp-menu-grp { display: flex; align-items: center; gap: 6px; padding: 8px 8px 3px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.fs-cmp-menu-grp:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 8px; }
.fs-cmp-menu-grp .material-icons { font-size: 13px; color: var(--primary); }
.fs-cmp-menu > button { display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: none; color: var(--text); font: inherit; text-align: left; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.fs-cmp-menu > button:hover { background: var(--primary-soft); }
.fs-cmp-menu > button.on { background: var(--primary-soft); }
.fs-cmp-menu > button > .material-icons { font-size: 18px; color: var(--primary); flex-shrink: 0; }
.fs-cmp-fav { width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; }
.fs-cmp-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.fs-cmp-name { font-size: 12.5px; font-weight: 700; }
.fs-cmp-txt small { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-cmp-rate { display: inline-flex; align-items: center; gap: 2px; margin-top: 1px; font-weight: 700; color: var(--text-soft); }
.fs-cmp-rate .material-icons { font-size: 11px; opacity: .8; }
.fs-cmp-chk { margin-left: auto; font-size: 16px !important; color: var(--primary) !important; }

/* ---------------- Context playback modal ---------------- */
.fs-ctx-overlay { position: fixed; inset: 0; z-index: 210; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 15, 35, .58); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.fs-ctx-overlay.open { display: flex; animation: fsWizFade .2s ease; }
.fs-ctx-modal { position: relative; width: 460px; max-width: 100%; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 30px 80px rgba(15, 15, 45, .4); padding: 18px 18px 16px; animation: fsWizPop .25s cubic-bezier(.2, .8, .3, 1.1); }
.fs-ctx-close { position: absolute; top: 12px; right: 12px; border: none; background: none; color: var(--text-soft); cursor: pointer; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.fs-ctx-close:hover { background: var(--surface-2); color: var(--text); }
.fs-ctx-title { display: inline-flex; align-items: center; gap: 7px; font-size: 0.95em; font-weight: 800; color: var(--text); }
.fs-ctx-title .material-icons { color: var(--primary); }
.fs-ctx-modes { display: flex; gap: 5px; margin: 12px 0; }
.fs-ctx-modes button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font: inherit; font-size: 12px; font-weight: 700; padding: 7px 4px; border-radius: 9px; cursor: pointer; }
.fs-ctx-modes button .material-icons { font-size: 16px; }
.fs-ctx-modes button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.fs-ctx-stage { position: relative; display: grid; place-items: center; width: 100%; height: 240px; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.fs-ctx-stage--video { background: linear-gradient(160deg, #1c1e33, #0f1020); }
.fs-ctx-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fs-ctx-ph { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; font-weight: 700; text-align: center; padding: 12px; }
.fs-ctx-ph .material-icons { font-size: 54px; color: var(--primary); }
.fs-ctx-stage--video .fs-ctx-ph { color: #cfd4ff; }
.fs-ctx-ph--video .material-icons { color: #8ea2ff; }
.fs-ctx-audio { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text); }
.fs-ctx-audio .material-icons { font-size: 34px; color: var(--primary); }
.fs-ctx-audio-lbl { font-size: 12px; font-weight: 700; }
.fs-ctx-empty { color: var(--text-muted); font-size: 12.5px; }
.fs-ctx-cap { min-height: 40px; margin: 12px 2px 0; font-size: 12.5px; color: var(--text); line-height: 1.5; position: relative; }
.fs-ctx-pos { display: block; margin-top: 4px; font-size: 10.5px; color: var(--text-muted); font-weight: 700; }
.fs-ctx-ctrls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.fs-ctx-ctrls button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.fs-ctx-ctrls button:hover { background: var(--surface-2); }
.fs-ctx-ctrls button.primary { width: 50px; height: 50px; background: var(--primary); border-color: transparent; color: #fff; }
.fs-ctx-route { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--text-muted); }
.fs-ctx-route > .material-icons { font-size: 17px; color: var(--primary); }
.fs-ctx-route select { flex: 1; min-width: 0; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.fs-ctx-send { display: inline-flex; align-items: center; gap: 5px; border: none; border-radius: 9px; padding: 8px 13px; font: inherit; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); cursor: pointer; }
.fs-ctx-send:hover { filter: brightness(1.06); }
.fs-ctx-send .material-icons { font-size: 15px; }

/* Playback toggles (Audio / Video) as icon buttons in the composer */
.fs-agent-modes { display: flex; gap: 5px; }
.fs-agent-composer .fs-agent-modes { flex: 0 0 auto; }
.fs-agent-mode-ic { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); width: 34px; height: 32px; border-radius: 9px; cursor: pointer; display: grid; place-items: center; }
.fs-agent-mode-ic:hover { color: var(--primary); border-color: var(--primary); }
.fs-agent-mode-ic.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.fs-agent-mode-ic.muted { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.fs-agent-mode-ic .material-icons { font-size: 18px; }

/* Audio / Video media stage inside the floating agent */
.fs-agent-media { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 12px 16px; min-height: 0; overflow-y: auto; }
.fs-agent-media[hidden] { display: none; }
/* Inline variant: the player rendered inside the chat window below the conversation */
.fs-agent-media--inline { flex: none; min-height: 0; margin-top: 4px; padding: 16px 14px; gap: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.fs-agent-media--inline.video { border-radius: 14px; border-color: transparent; }
.fs-media-stage { display: flex; flex-direction: column; align-items: center; gap: 9px; width: 100%; }
.fs-media-ava { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); position: relative; flex-shrink: 0; }
.fs-media-ava .material-icons { font-size: 38px; }
.fs-media-ava .fs-emoji { font-size: 42px; line-height: 1; }
.fs-media-ava .fs-init { font-size: 30px; font-weight: 800; }
.fs-media-ava.ring::after { content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 3px solid var(--primary); opacity: .5; animation: fsMediaPulse 1.4s ease-out infinite; }
@keyframes fsMediaPulse { from { transform: scale(1); opacity: .55; } to { transform: scale(1.25); opacity: 0; } }
.fs-media-self { display: none; }
.fs-media-wave { display: flex; align-items: center; gap: 3px; height: 34px; }
.fs-media-wave span { width: 4px; border-radius: 3px; background: linear-gradient(var(--primary), var(--primary-2)); height: 8px; }
.fs-media-wave.live span { animation: fsMediaWave .9s ease-in-out infinite; }
.fs-media-wave span:nth-child(2){animation-delay:.1s}.fs-media-wave span:nth-child(3){animation-delay:.2s}.fs-media-wave span:nth-child(4){animation-delay:.3s}.fs-media-wave span:nth-child(5){animation-delay:.15s}.fs-media-wave span:nth-child(6){animation-delay:.25s}.fs-media-wave span:nth-child(7){animation-delay:.05s}.fs-media-wave span:nth-child(8){animation-delay:.35s}.fs-media-wave span:nth-child(9){animation-delay:.2s}
@keyframes fsMediaWave { 0%, 100% { height: 8px; } 50% { height: 30px; } }
.fs-media-cap { font-size: 12.5px; color: var(--text); text-align: center; line-height: 1.4; min-height: 28px; max-width: 300px; }
.fs-media-opts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.fs-media-seg { display: flex; gap: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.fs-media-seg button { border: none; background: none; color: var(--text-muted); font: inherit; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.fs-media-seg button.on { background: var(--primary); color: #fff; }
.fs-agent-media.video .fs-media-seg { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); }
.fs-agent-media.video .fs-media-seg button { color: #cfd4ff; }
.fs-agent-media.video .fs-media-seg button.on { background: var(--primary); color: #fff; }
.fs-media-ctrls { display: flex; gap: 10px; }
.fs-media-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.fs-media-btn:hover { background: var(--surface-2); }
.fs-media-btn#fsMediaPlay { background: var(--primary); border-color: transparent; color: #fff; }
/* Video variant: dark stage with a self tile */
.fs-agent-media.video { background: linear-gradient(160deg, #1c1e33, #0f1020); border-radius: 0; }
.fs-agent-media.video .fs-media-cap { color: #dfe3ff; }
.fs-agent-media.video .fs-media-stage { position: relative; }
.fs-agent-media.video .fs-media-ava { width: 78px; height: 78px; border-radius: 20px; }
.fs-agent-media.video .fs-media-self { display: grid; position: absolute; right: 4px; bottom: 4px; width: 60px; height: 44px; border-radius: 9px; background: #2a2c44; border: 1px solid rgba(255,255,255,.12); place-items: center; color: #9aa; }
.fs-agent-media.video .fs-media-self .material-icons { font-size: 20px; }
body.fs-av-circle .fs-media-ava { border-radius: 50%; }

/* Org work-distribution graph view (canvas) inside the floating agent */
.fs-agent-graph { flex: 1; display: flex; flex-direction: column; min-height: 220px; overflow: hidden; background: radial-gradient(circle at 50% 40%, var(--surface-2), var(--surface)); }
.fs-agent-graph[hidden] { display: none; }
.fs-graph-head { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface); flex: none; flex-wrap:wrap; }
.fs-graph-head-ic { font-size: 20px; color: var(--primary); }
.fs-graph-head h4 { margin: 0; font-size: 14px; }
.fs-graph-sub { font-size: 11px; color: var(--text-soft); flex: 1; }
.fs-graph-source-label { display:inline-flex; align-items:center; gap:4px; color:var(--text-soft); font-size:10px; font-weight:700; }
.fs-graph-source-label select, .fs-graph-dataset { max-width:130px; min-width:0; height:28px; padding:3px 6px; border:1px solid var(--border); border-radius:7px; background:var(--surface); color:var(--text); font:inherit; font-size:10px; }
.fs-graph-dataset[hidden] { display:none !important; }
.fs-graph-x { border: none; background: transparent; cursor: pointer; color: var(--text-muted); display: inline-flex; padding: 0; }
.fs-graph-x:hover { color: var(--text); }
.fs-graph-x .material-icons { font-size: 20px; }
.fs-graph-stage { flex: 1; position: relative; min-height: 0; overflow: hidden; }
.fs-agent-graph canvas { display: block; width: 100%; height: 100%; }
.fs-graph-legend { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 5px 10px; font-size: 10px; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.fs-glg { display: inline-flex; align-items: center; gap: 4px; }
.fs-glg i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.fs-graph-metrics { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.fs-graph-metrics:empty { display: none; }
.fs-gm { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; }
.fs-gm b { font-size: 12px; font-weight: 800; color: var(--primary); }
.fs-gm span { color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; font-size: 9px; }

/* ---------------- Get Started Wizard (centered modal) ---------------- */
.fs-wiz-overlay { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 15, 35, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.fs-wiz-overlay.open { display: flex; animation: fsWizFade .2s ease; }
@keyframes fsWizFade { from { opacity: 0; } to { opacity: 1; } }
.fs-wiz-modal { position: relative; width: 560px; max-width: 100%; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 30px 80px rgba(15, 15, 45, .4); padding: 22px 24px 20px; animation: fsWizPop .25s cubic-bezier(.2, .8, .3, 1.1); }
@keyframes fsWizPop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.fs-wiz-close { position: absolute; top: 12px; right: 12px; border: none; background: none; color: var(--text-soft); cursor: pointer; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.fs-wiz-close:hover { background: var(--surface-2); color: var(--text); }
.fs-wiz-head { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); }
.fs-wiz-head .material-icons { font-size: 18px; }
.fs-wiz-progress { display: flex; align-items: center; gap: 12px; font-size: 0.78em; color: var(--text-muted); margin: 12px 0 4px; }
.fs-wiz-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.fs-wiz-bar-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .35s ease; }
.fs-wiz-stage { min-height: 300px; display: grid; }
.fs-wiz-card { text-align: center; padding: 10px 6px 4px; animation: fsWizFade .3s ease; }
.fs-wiz-num { font-size: 0.72em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); }
.fs-wiz-ico { width: 116px; height: 116px; margin: 12px auto 4px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary-soft), transparent); border: 1px solid var(--border); }
.fs-wiz-ico .material-icons { font-size: 64px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.fs-wiz-title { font-size: 1.5em; font-weight: 800; letter-spacing: -.02em; margin: 8px 0 6px; color: var(--text); }
.fs-wiz-cap { font-size: 0.98em; color: var(--text-muted); margin: 0 auto 12px; max-width: 400px; line-height: 1.5; }
.fs-wiz-act { display: inline-flex; align-items: center; gap: 7px; margin: 4px 0 10px; padding: 9px 16px; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 0.92em; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.fs-wiz-act:hover { filter: brightness(1.06); }
.fs-wiz-act .material-icons { font-size: 18px; }
.fs-wiz-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.fs-wiz-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 0.9em; padding: 9px 16px; border-radius: 10px; cursor: pointer; }
.fs-wiz-btn:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.fs-wiz-btn:disabled { opacity: .4; cursor: not-allowed; }
.fs-wiz-btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; color: #fff; }
.fs-wiz-btn.primary:hover { filter: brightness(1.06); color: #fff; }
.fs-wiz-btn .material-icons { font-size: 18px; }
.fs-wiz-dots { display: flex; gap: 8px; align-items: center; }
.fs-wiz-dot { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; transition: transform .15s, background .15s; }
.fs-wiz-dot:hover { transform: scale(1.2); }
.fs-wiz-dot.active { background: var(--primary); border-color: var(--primary); transform: scale(1.25); }
.fs-wiz-dot.done { background: var(--primary-2); border-color: var(--primary-2); }
@media (max-width: 520px) { .fs-wiz-ico { width: 96px; height: 96px; } .fs-wiz-ico .material-icons { font-size: 54px; } .fs-wiz-title { font-size: 1.3em; } }
.fs-agent-body { flex: 1 1 auto; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 13px; min-height: 48px; }
.fs-agent-body { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.fs-agent-body::-webkit-scrollbar { width: 10px; }
.fs-agent-body::-webkit-scrollbar-track { background: transparent; }
.fs-agent-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
.fs-agent-body::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: content-box; }
.fs-agent-body::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.fs-agent-body .msg { max-width: 88%; }
.fs-agent-body .ava.bot { background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.fs-agent-body .ava.me { background: linear-gradient(135deg, #ff9a6b, #ff6b6b); }
.fs-agent-body .ava .material-icons { font-size: 18px; }
.fs-agent-prompts { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 14px 12px; flex-shrink: 0; }
.fs-agent-prompts:not(:empty) { border-bottom: 1px solid var(--border); }
/* Suggested prompt chips relocated inside the chat text box (above the textarea). */
.fs-cmp-input > .fs-agent-prompts { padding: 2px 2px 8px; margin-top: 2px; overflow: visible; justify-content: flex-end; }
.fs-cmp-input > .fs-agent-prompts:not(:empty) { border-bottom: none; }
/* Suggested prompts collapsed into a single dropdown. */
.fs-prompts-dd { position: relative; display: inline-flex; }
.fs-prompts-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; font-weight: 700; padding: 6px 8px; border-radius: 9px; cursor: pointer; }
.fs-prompts-toggle:hover { border-color: var(--primary); color: var(--primary); }
.fs-prompts-toggle > .material-icons { font-size: 16px; flex-shrink: 0; }
.fs-prompts-toggle > .material-icons.caret { margin-left: auto; opacity: .7; }
.fs-prompts-dd.open .fs-prompts-toggle { border-color: var(--primary); color: var(--primary); }
.fs-prompts-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 220px; max-width: 320px; max-height: 220px; overflow-y: auto; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md, 0 8px 24px rgba(20,20,50,.16)); scrollbar-width: thin; }
.fs-prompts-menu[hidden] { display: none; }
.fs-prompts-item { display: block; width: 100%; text-align: left; border: none; background: none; color: var(--text); font: inherit; font-size: 12.5px; padding: 8px 10px; border-radius: 7px; cursor: pointer; white-space: normal; }
.fs-prompts-item:hover { background: var(--surface-2); color: var(--primary); }
.fs-agent-field { display: flex; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--border); flex-shrink: 0; }
.fs-agent-field input { flex: 1; border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 13px; color: var(--text); }
.fs-agent-field input:focus { outline: none; border-color: var(--primary); }
.fs-agent-field > button { border: none; background: var(--primary); color: #fff; width: 40px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.fs-agent-field > button:hover { background: var(--primary-2); }

/* ---------------- Agent Studio (Copilot Studio-style) ---------------- */
.studio-bar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.studio-bar .studio-logo { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); flex-shrink: 0; }
.studio-bar .studio-logo .material-icons { font-size: 22px; }
.studio-bar .studio-name { font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.studio-bar .studio-meta { font-size: 12px; color: var(--text-soft); font-weight: 600; }
.studio-bar .studio-actions { margin-left: auto; display: flex; gap: 8px; }

.studio-layout { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.studio-main { min-width: 0; }

.studio-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 64px 24px; min-height: 380px; }
.studio-empty .studio-ic { width: 76px; height: 76px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 20px; color: var(--primary); background: linear-gradient(135deg, var(--primary-soft), var(--blue-soft)); box-shadow: var(--shadow-sm); }
.studio-empty .studio-ic .material-icons { font-size: 38px; }
.studio-empty h4 { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.studio-empty p { font-size: 13.5px; color: var(--text-muted); margin: 8px 0 20px; max-width: 440px; }
.studio-empty .row { justify-content: center; }

.studio-test { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; position: sticky; top: 92px; display: flex; flex-direction: column; height: 560px; }
.studio-test-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.studio-test-head .t { font-size: 14px; font-weight: 800; }
.studio-test-head .material-icons { font-size: 18px; color: var(--text-soft); }
.studio-test-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; }
.studio-test-foot { padding: 12px 14px; border-top: 1px solid var(--border); }
.studio-test-foot .field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.studio-test-foot .field input { flex: 1; border: none; background: none; outline: none; color: var(--text); font: inherit; font-size: 13px; }
.studio-test-foot .field .send { border: none; background: var(--primary); color: #fff; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.studio-test-foot .note { font-size: 11px; color: var(--text-soft); margin-top: 8px; line-height: 1.5; }

.studio-detail-row { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.studio-detail-row:last-child { border-bottom: none; }
.studio-detail-row .k { font-size: 12.5px; font-weight: 800; }
.studio-detail-row .v { font-size: 13.5px; color: var(--text-muted); }

.model-select { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 11px 14px; font-size: 13.5px; font-weight: 600; }
.model-select .material-icons { color: var(--text-soft); }

.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.channel-card { position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); padding: 16px; display: flex; align-items: center; gap: 12px; transition: transform .12s, box-shadow .12s; }
.channel-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.channel-card.disabled { opacity: .55; }
.channel-card .cn-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.channel-card .cn-ic .material-icons { font-size: 20px; }
.channel-card .cn-name { font-size: 13.5px; font-weight: 700; }
.channel-card .cn-type { font-size: 11.5px; color: var(--text-soft); font-weight: 600; }

@media (max-width: 1080px) { .studio-layout { grid-template-columns: 1fr; } .studio-test { position: static; height: 480px; } }
@media (max-width: 520px) { .fs-agent-panel:not(.fs-agent-panel--dock-right):not(.fs-agent-panel--dock-bottom) { right: 12px; left: 12px; width: auto; top: 12px; bottom: 12px; max-height: none; } }

/* ---------------- Static HTML site (no JavaScript) ----------------
   Submenus collapse/expand via a pure-CSS checkbox toggle (no scripts),
   the JS-only theme toggle is hidden, and the sidebar stacks (rather than
   sliding) on small screens so navigation works without scripts. */
.nav-cb { display: none; }
.nav-cb:checked + .nav-parent + .nav-sub { display: block; }
.nav-cb:checked + .nav-parent .nav-toggle .material-icons { transform: rotate(180deg); }
/* Pure-CSS dark theme toggle (no scripts): the header button is a label that
   flips a hidden checkbox; :root:has(...) then swaps the theme variables.
   State is per-page (no persistence without JavaScript). */
.theme-toggle-cb { display: none; }
/* In-page tabs are JS-driven; without scripts show every panel and let the
   tab bar act as in-page jump links. With scripts, only the active panel shows. */
html:not(.fs-js) .tab-panel { display: block; }
html:not(.fs-js) .tab-panel + .tab-panel { margin-top: 22px; }
@media (max-width: 860px) {
    .fs-js .sidebar { position: fixed; left: -280px; z-index: 100; transition: left .2s; box-shadow: var(--shadow-lg); }
    .fs-js .sidebar.open { left: 0; }
    .search { display: none; }
    .fs-js .nav-overlay {
        display: block; position: fixed; inset: 0; z-index: 90;
        background: rgba(10, 12, 25, .5);
        opacity: 0; pointer-events: none; transition: opacity .2s;
    }
    .fs-js .app.nav-open .nav-overlay { opacity: 1; pointer-events: auto; }

    /* Script-less fallback: stack the sidebar so navigation works without JS. */
    html:not(.fs-js) .app { flex-direction: column; }
    html:not(.fs-js) .app .sidebar { position: static; left: auto; width: auto; height: auto; }
}

/* ---------------- Delegation Poker ---------------- */
.dp-deck { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.dp-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.dp-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--dp-c, var(--primary)); }
.dp-card .dp-num { width: 30px; height: 30px; border-radius: 9px; background: var(--dp-c, var(--primary)); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 15px; }
.dp-card .dp-name { font-size: 14px; font-weight: 800; margin: 10px 0 6px; }
.dp-card p { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 0; }
.dp-card .dp-who { font-size: 11px; font-weight: 700; color: var(--text-soft); margin-top: 8px; display: block; }
.dp-l1 { --dp-c: #e5484d; } .dp-l2 { --dp-c: #e5844d; } .dp-l3 { --dp-c: #d1a01f; }
.dp-l4 { --dp-c: #8b5cf6; } .dp-l5 { --dp-c: #4d9ee5; } .dp-l6 { --dp-c: #2f9e6b; } .dp-l7 { --dp-c: #2ea043; }
.dp-lvl { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 20px; color: #fff; background: var(--dp-c, var(--primary)); white-space: nowrap; }
.dp-lvl .material-icons { font-size: 13px; }
.dp-scale { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

/* ---------------- CacheOps (caching layers) ---------------- */
.cache-stack { display: flex; flex-direction: column; gap: 12px; }
.cache-layer { display: grid; grid-template-columns: 176px 1fr 128px; gap: 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); position: relative; overflow: hidden; }
.cache-layer::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cl, var(--primary)); }
.cache-layer .cl-head { display: flex; align-items: center; gap: 11px; }
.cache-layer .cl-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: var(--cl, var(--primary)); flex-shrink: 0; }
.cache-layer .cl-name { font-size: 14px; font-weight: 800; }
.cache-layer .cl-sub { font-size: 11px; color: var(--text-soft); font-weight: 600; }
.cache-track { height: 28px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; position: relative; }
.cache-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; background: var(--cl, var(--primary)); display: flex; align-items: center; padding-left: 11px; color: #fff; font-size: 11px; font-weight: 800; white-space: nowrap; }
.cache-fill.cf-63 { width: 63%; }
.cache-fill.cf-26 { width: 26%; }
.cache-fill.cf-11 { width: 11%; }
.cache-fill.cf-1 { width: 4%; min-width: 34px; }
.cache-metric { text-align: right; }
.cache-metric b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.cache-metric span { font-size: 11px; color: var(--text-soft); font-weight: 700; }
.cl-browser { --cl: #16a34a; }
.cl-cdn { --cl: #2563eb; }
.cl-redis { --cl: #dc2626; }
.cl-db { --cl: #64748b; }
.cache-temp { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 20px; }
.cache-temp.warm { background: var(--green-soft); color: var(--green); }
.cache-temp.cool { background: var(--blue-soft); color: var(--blue); }
.cache-temp.hot { background: var(--red-soft); color: var(--red); }
.cache-temp.cold { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
@media (max-width: 720px) { .cache-layer { grid-template-columns: 1fr; gap: 10px; } .cache-metric { text-align: left; } }
