/* === UpFlux Studio — builder styles =================================
   The "Studio" is a meta-tool for AEs. It uses the Nous palette + Geist
   so it sits alongside Nous visually, but introduces its own chrome.
   ===================================================================== */

* { box-sizing: border-box; }
html, body, #root {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: #FBFBFC;
    overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }

/* ==================================================================
   Layout shell
   ================================================================== */
.studio {
    display: grid;
    grid-template-rows: 52px 1fr;
    grid-template-columns: 420px 1fr;
    grid-template-areas:
        "topbar topbar"
        "panel  canvas";
    height: 100vh;
    width: 100vw;
    background: #FBFBFC;
}
.studio-topbar { grid-area: topbar; }
.studio-panel  { grid-area: panel; }
.studio-canvas { grid-area: canvas; }

/* ==================================================================
   Top bar
   ================================================================== */
.studio-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    padding: 0 16px;
    background: #FFFFFF;
    border-bottom: 1px solid #ECECEE;
    z-index: 2;
    gap: 12px;
}
.studio-topbar .left { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; }
.studio-topbar .center { display: flex; align-items: center; flex-shrink: 0; }
.studio-topbar .right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; min-width: 0; }

.studio-brand {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 6px;
    border-radius: 8px;
}
.studio-brand .mark-wrap {
    width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #11161D; color: white;
    border-radius: 6px;
    font-size: 12px; font-weight: 600; letter-spacing: -0.02em;
    font-family: var(--font-sans);
}
.studio-brand .name {
    font-size: 13px; font-weight: 500;
    color: var(--text-primary);
}
.studio-brand .name .dim { color: var(--text-secondary); font-weight: 400; }

.crumb-sep {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 4px;
}
.project-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    transition: background 120ms;
    white-space: nowrap;
}
.project-chip:hover { background: var(--surface-subtle); }
.project-chip:hover svg { opacity: 1 !important; }
.project-chip-input {
    background: #FFFFFF;
    border: 1px solid var(--nous-purple);
    box-shadow: 0 0 0 3px var(--nous-purple-tint);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    outline: 0;
    min-width: 220px;
    font-family: inherit;
}
.project-chip .industry {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--surface-subtle);
    color: var(--text-secondary);
    font-weight: 500;
}
.save-state {
    font-size: 11px;
    color: var(--text-muted);
    display: inline-flex; align-items: center; gap: 5px;
    margin-left: 4px;
    white-space: nowrap;
}
.save-state .pulse-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--success);
    animation: nous-pulse 2.4s ease-in-out infinite;
}

/* Screen tabs (center of top bar) */
.screen-tabs {
    display: flex; align-items: center; gap: 2px;
    padding: 3px;
    background: #F3F4F6;
    border-radius: 8px;
}
.screen-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 120ms;
    white-space: nowrap;
}
.screen-tab:hover:not(.active) { color: var(--text-primary); }
.screen-tab.active {
    background: #FFFFFF;
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.02);
}
.screen-tab .icon { display: inline-flex; opacity: 0.85; }

/* Top-right actions */
.tbtn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    background: transparent;
    transition: background 120ms, color 120ms;
    white-space: nowrap;
    flex-shrink: 0;
}
.tbtn:hover { background: var(--surface-subtle); color: var(--text-primary); }
.tbtn--primary {
    background: var(--nous-purple);
    color: #FFFFFF;
}
.tbtn--primary:hover { background: var(--nous-purple); filter: brightness(1.08); color: #FFFFFF; }
.tbtn--outline {
    background: transparent;
    color: var(--text-primary);
    box-shadow: inset 0 0 0 1px #E5E7EB;
}
.tbtn--outline:hover { background: var(--surface-subtle); }

.ae-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8E76E7 0%, #6D4ADD 100%);
    color: white;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
    margin-left: 4px;
}

/* ==================================================================
   Builder panel (left)
   ================================================================== */
.studio-panel {
    background: #FFFFFF;
    border-right: 1px solid #ECECEE;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.panel-head {
    padding: 14px 16px 12px;
    border-bottom: 1px solid #ECECEE;
}
.panel-head .title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.005em;
}
.panel-head .sub {
    font-size: 11.5px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 12px;
}
.progress-row {
    display: flex; align-items: center; gap: 10px;
}
.progress-bar {
    flex: 1; height: 4px;
    background: var(--surface-subtle);
    border-radius: 4px; overflow: hidden;
}
.progress-bar > span {
    display: block; height: 100%;
    background: var(--nous-purple);
    transition: width 240ms ease-out;
}
.progress-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.levels-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0 16px;
}

/* === Level card / accordion === */
.lvl {
    border-bottom: 1px solid #F0F0F2;
}
.lvl:last-child { border-bottom: 0; }
.lvl-head {
    width: 100%;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: transparent;
    text-align: left;
    transition: background 120ms;
}
.lvl-head:hover { background: #FAFAFB; }
.lvl.open .lvl-head { background: #FAFAFB; }

.lvl-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    background: var(--surface-subtle);
    color: var(--text-secondary);
    box-shadow: inset 0 0 0 1px #E5E7EB;
    transition: all 160ms;
}
.lvl.applied .lvl-num {
    background: var(--nous-purple);
    color: #FFFFFF;
    box-shadow: none;
}
.lvl.partial .lvl-num {
    background: var(--nous-purple-tint);
    color: var(--nous-purple);
    box-shadow: inset 0 0 0 1px var(--nous-purple-border);
}

.lvl-info { flex: 1; min-width: 0; }
.lvl-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1px;
    display: flex; align-items: center; gap: 6px;
}
.lvl-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--nous-purple);
    background: var(--nous-purple-tint);
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.lvl-blurb {
    font-size: 11.5px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.lvl-status {
    font-size: 10.5px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    margin-left: 2px;
}
.lvl.applied .lvl-status { color: var(--success); }
.lvl.partial .lvl-status { color: var(--nous-purple); }

.lvl-chevron {
    color: var(--text-muted);
    transition: transform 200ms;
    flex-shrink: 0;
}
.lvl.open .lvl-chevron { transform: rotate(180deg); }

.lvl-body {
    padding: 0 16px 18px 50px;
    animation: lvl-open 200ms ease-out;
}
@keyframes lvl-open {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === form controls inside levels === */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.field-hint {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.45;
}
.f-input {
    width: 100%;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 12.5px;
    color: var(--text-primary);
    outline: 0;
    transition: border-color 120ms, box-shadow 120ms;
}
.f-input:focus {
    border-color: var(--nous-purple);
    box-shadow: 0 0 0 3px var(--nous-purple-tint);
}
.f-input.with-prefix { padding-left: 8px; }
.f-input--mono { font-family: var(--font-mono); font-size: 11.5px; }

.f-row {
    display: flex; align-items: center; gap: 8px;
}
.f-row > .f-input { flex: 1; }

/* Logo upload */
.logo-drop {
    display: flex; align-items: center; gap: 12px;
    padding: 10px;
    background: #FAFAFB;
    border: 1px dashed #E0E1E5;
    border-radius: 8px;
    transition: all 120ms;
}
.logo-drop:hover { border-color: var(--nous-purple-border); background: var(--nous-purple-tint); }
.logo-preview {
    width: 44px; height: 44px;
    border-radius: 8px;
    background: var(--surface-subtle);
    border: 1px solid #E5E7EB;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-tertiary);
    font-size: 17px; font-weight: 600;
    letter-spacing: -0.02em;
    overflow: hidden;
    flex-shrink: 0;
}
.logo-drop .info { flex: 1; min-width: 0; }
.logo-drop .info .name { font-size: 12px; font-weight: 500; color: var(--text-primary); }
.logo-drop .info .sub { font-size: 11px; color: var(--text-muted); }
.logo-drop .replace {
    font-size: 11px; font-weight: 500;
    color: var(--nous-purple);
    background: transparent; padding: 4px 8px; border-radius: 4px;
}
.logo-drop .replace:hover { background: var(--nous-purple-tint); }

/* Color swatch picker */
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch {
    width: 28px; height: 28px;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
    transition: transform 120ms;
}
.swatch:hover { transform: scale(1.06); }
.swatch.active::after {
    content: '';
    position: absolute; inset: -3px;
    border-radius: 8px;
    box-shadow: 0 0 0 2px var(--nous-purple);
}
.swatch.custom {
    background: linear-gradient(135deg, #ef4444 0%, #f59e0b 25%, #22c55e 50%, #3b82f6 75%, #6D4ADD 100%);
}

/* Find & replace list */
.fr-list {
    display: flex; flex-direction: column;
    background: #FAFAFB;
    border: 1px solid #ECECEE;
    border-radius: 6px;
    overflow: hidden;
}
.fr-row {
    display: grid;
    grid-template-columns: 1fr 12px 1fr;
    align-items: center;
    padding: 7px 10px;
    font-size: 11.5px;
    border-top: 1px solid #ECECEE;
    background: #FFFFFF;
}
.fr-row:first-child { border-top: 0; }
.fr-from {
    color: var(--text-muted);
    text-decoration: line-through;
    font-family: var(--font-mono);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fr-arrow { color: var(--text-muted); font-size: 11px; text-align: center; }
.fr-to {
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Chip multiselect */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 9px 5px 8px;
    border-radius: 6px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 120ms;
}
.chip:hover { color: var(--text-primary); border-color: #D9D9DC; }
.chip.on {
    background: var(--nous-purple-tint);
    border-color: var(--nous-purple-border);
    color: var(--nous-purple);
}
.chip .chip-check {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--nous-purple);
    color: white;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 8px;
}

/* Persona pickers */
.personas {
    display: flex; flex-direction: column; gap: 6px;
}
.persona-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    text-align: left;
    transition: all 120ms;
    width: 100%;
}
.persona-row:hover { border-color: #D9D9DC; }
.persona-row.active {
    background: var(--nous-purple-tint);
    border-color: var(--nous-purple-border);
}
.persona-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 600; color: #FFFFFF;
    flex-shrink: 0;
}
.persona-info { flex: 1; min-width: 0; }
.persona-name { font-size: 12px; font-weight: 500; color: var(--text-primary); }
.persona-role { font-size: 11px; color: var(--text-secondary); }
.persona-name-input,
.persona-role-input {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 2px 5px;
    margin: -2px -5px;
    width: 100%;
    outline: 0;
    font-family: inherit;
    color: var(--text-primary);
    transition: background 120ms, border-color 120ms;
}
.persona-name-input { font-size: 12px; font-weight: 500; }
.persona-role-input { font-size: 11px; color: var(--text-secondary); }
.persona-row:hover .persona-name-input,
.persona-row:hover .persona-role-input {
    background: rgba(109, 74, 221, 0.05);
}
.persona-name-input:focus,
.persona-role-input:focus {
    background: #FFFFFF;
    border-color: var(--nous-purple);
    box-shadow: 0 0 0 2px var(--nous-purple-tint);
}
.persona-row .branch-tag {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Variables list (Level 4) */
.vars-list {
    display: flex; flex-direction: column; gap: 10px;
}
.var-item {
    border: 1px solid #ECECEE;
    border-radius: 8px;
    padding: 8px 10px;
    background: #FFFFFF;
}
.var-item--custom {
    background: var(--nous-purple-tint);
    border-color: var(--nous-purple-border);
}
.var-item-row {
    display: grid;
    grid-template-columns: minmax(110px, auto) 1fr auto;
    gap: 8px;
    align-items: center;
}
.var-name {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--nous-purple);
    background: var(--nous-purple-tint);
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    text-align: center;
}
.var-remove {
    width: 22px; height: 22px;
    border-radius: 4px;
    color: var(--text-muted);
    background: transparent;
    display: inline-flex; align-items: center; justify-content: center;
}
.var-remove:hover { background: var(--danger-bg); color: var(--danger); }
.var-usage {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
    margin-top: 6px;
    padding-left: 2px;
}
.var-usage-label {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 2px;
}
.var-usage-chip {
    font-size: 10px;
    background: var(--surface-subtle);
    color: var(--text-tertiary);
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 500;
}
.var-usage-chip code {
    font-family: var(--font-mono);
    background: rgba(255,255,255,0.7);
    padding: 0 3px;
    border-radius: 2px;
}

/* Hotspot list (Level 5) */
.hotspots { display: flex; flex-direction: column; gap: 6px; }
.hotspot-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 120ms;
}
.hotspot-card.selected {
    border-color: var(--nous-purple);
    box-shadow: 0 0 0 2px rgba(109, 74, 221, 0.08);
}
.hotspot-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
}
.hotspot-row:hover { background: #FAFAFB; }
.hotspot-row-actions {
    display: inline-flex; gap: 2px;
    opacity: 0.6;
    transition: opacity 120ms;
}
.hotspot-card:hover .hotspot-row-actions,
.hotspot-card.selected .hotspot-row-actions { opacity: 1; }
.hr-btn {
    width: 22px; height: 22px;
    border-radius: 4px;
    color: var(--text-muted);
    background: transparent;
    display: inline-flex; align-items: center; justify-content: center;
}
.hr-btn:hover { background: var(--surface-subtle); color: var(--text-primary); }
.hr-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.hr-btn--danger:hover { background: var(--danger-bg); color: var(--danger); }

.hotspot-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--nous-purple);
    color: #FFFFFF;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10.5px; font-weight: 600;
    flex-shrink: 0;
}
.hotspot-info { flex: 1; min-width: 0; }
.hotspot-text {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hotspot-meta {
    font-size: 10.5px;
    color: var(--text-muted);
    display: flex; align-items: center; gap: 6px;
    margin-top: 1px;
}
.hotspot-screen-badge {
    display: inline-flex; align-items: center;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--nous-purple);
    background: var(--nous-purple-tint);
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 2px;
}
.hotspot-type-pill {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--surface-subtle);
    color: var(--text-tertiary);
    font-weight: 500;
}
.hotspot-add {
    width: 100%;
    margin-top: 4px;
    padding: 7px 10px;
    border-radius: 6px;
    background: transparent;
    border: 1px dashed #E5E7EB;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 500;
    transition: all 120ms;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.hotspot-add:hover { color: var(--nous-purple); border-color: var(--nous-purple-border); background: var(--nous-purple-tint); }

/* Hotspot expanded edit form */
.hotspot-edit {
    padding: 12px;
    background: #FAFAFB;
    border-top: 1px solid #ECECEE;
}
.hotspot-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}
.hotspot-type-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 120ms;
    cursor: pointer;
}
.hotspot-type-btn:hover { color: var(--text-primary); border-color: #D9D9DC; }
.hotspot-type-btn.active {
    background: #FFFFFF;
    box-shadow: 0 0 0 2px rgba(109, 74, 221, 0.06);
}
.field-row-2 {
    display: grid; grid-template-columns: 1fr 100px;
    gap: 8px;
    margin-top: 10px;
}
.position-row {
    display: grid;
    grid-template-columns: 14px 1fr 40px 14px 1fr 40px;
    gap: 6px;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
}
.position-row input[type=range] {
    -webkit-appearance: none; appearance: none;
    height: 4px; border-radius: 2px;
    background: var(--surface-subtle);
    outline: 0;
}
.position-row input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--nous-purple);
    cursor: pointer;
}
.position-val {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-tertiary);
    text-align: right;
}

/* Toggle (used on level enable + various) */
.toggle {
    width: 28px; height: 16px;
    background: #D5D5D9;
    border-radius: 999px;
    position: relative;
    transition: background 120ms;
    flex-shrink: 0;
}
.toggle::after {
    content: '';
    position: absolute; top: 2px; left: 2px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: left 140ms;
}
.toggle.on { background: var(--nous-purple); }
.toggle.on::after { left: 14px; }
.toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
}
.toggle-row .label { font-size: 11.5px; color: var(--text-tertiary); }

/* Range slider */
.range-row {
    display: grid; grid-template-columns: 1fr auto; gap: 8px;
    align-items: center;
}
.range-row input[type=range] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 4px; border-radius: 2px;
    background: var(--surface-subtle);
    outline: 0;
}
.range-row input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--nous-purple);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.range-row .v {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 76px;
    text-align: right;
}

/* ==================================================================
   Preview canvas (right)
   ================================================================== */
.studio-canvas {
    background: #F4F5F7;
    background-image:
        radial-gradient(circle, #E5E7EB 1px, transparent 1px);
    background-size: 18px 18px;
    background-position: 0 0;
    display: flex; flex-direction: column;
    overflow: hidden;
    position: relative;
}
.canvas-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px;
    background: rgba(251, 251, 252, 0.7);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #ECECEE;
    flex-shrink: 0;
    z-index: 1;
}
.canvas-toolbar .left, .canvas-toolbar .right {
    display: flex; align-items: center; gap: 8px;
}
.layer-toggles {
    display: flex; align-items: center;
    background: #FFFFFF;
    border: 1px solid #ECECEE;
    border-radius: 6px;
    padding: 2px;
    gap: 1px;
}
.layer-pip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 120ms;
}
.layer-pip.on {
    background: var(--nous-purple-tint);
    color: var(--nous-purple);
}
.layer-pip .pip-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #D5D5D9;
}
.layer-pip.on .pip-dot { background: var(--nous-purple); }

.canvas-zoom {
    display: inline-flex; align-items: center;
    background: #FFFFFF;
    border: 1px solid #ECECEE;
    border-radius: 6px;
    overflow: hidden;
}
.canvas-zoom button {
    padding: 4px 8px;
    font-size: 11px;
    color: var(--text-secondary);
}
.canvas-zoom button:hover { background: var(--surface-subtle); color: var(--text-primary); }
.canvas-zoom .v {
    font-size: 11px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    padding: 4px 6px;
    min-width: 44px;
    text-align: center;
}

/* The browser frame "device" */
.canvas-scroll {
    flex: 1; overflow: hidden;
    padding: 24px;
    display: flex;
    min-height: 0;
    min-width: 0;
}
.device-wrap {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
}
.browser-frame {
    width: 100%;
    max-width: 1320px;
    height: 100%;
    background: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 12px 32px rgba(15, 17, 26, 0.10),
        0 2px 8px rgba(15, 17, 26, 0.06),
        0 0 0 1px rgba(15, 17, 26, 0.05);
    display: flex; flex-direction: column;
    position: relative;
}
.browser-chrome {
    height: 36px;
    background: #F6F6F8;
    border-bottom: 1px solid #ECECEE;
    display: flex; align-items: center;
    padding: 0 12px;
    gap: 12px;
    flex-shrink: 0;
}
.traffic { display: flex; align-items: center; gap: 6px; }
.traffic span {
    width: 11px; height: 11px; border-radius: 50%;
    box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.08);
}
.traffic span:nth-child(1) { background: #FF5F57; }
.traffic span:nth-child(2) { background: #FEBC2E; }
.traffic span:nth-child(3) { background: #28C840; }
.browser-controls {
    display: flex; align-items: center; gap: 6px;
    color: var(--text-muted);
}
.browser-url {
    flex: 1;
    height: 22px;
    background: #FFFFFF;
    border: 1px solid #ECECEE;
    border-radius: 4px;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0 10px;
    font-size: 11.5px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}
.browser-url .lock { color: var(--success); }
.browser-url .path-dim { color: var(--text-muted); }
.browser-url .path-em { color: var(--nous-purple); }

.browser-body {
    flex: 1; overflow: hidden;
    position: relative;
    background: #FFFFFF;
}

/* The Nous app re-rendered inside browser-body. Override its full-viewport
   sizing so it lives inside the browser-body box. */
.browser-body .nous-app { height: 100%; width: 100%; }
.browser-body .nous-sidebar { height: 100%; padding: 12px 10px; }
.browser-body .nous-main { min-width: 0; overflow: hidden; }
.browser-body .nous-scroll { overflow-y: auto; overflow-x: hidden; }
.browser-body .chat-stream { padding: 18px 24px 8px; }
.browser-body .screen-pad { padding: 18px 22px; }
.browser-body .chat-home { padding: 0 24px; max-width: 640px; }
.browser-body .chat-home .greeting { font-size: 22px; margin-bottom: 24px; }
.browser-body .chat-home .mark { margin-bottom: 16px; }

/* Make Nous grids responsive when the preview frame is narrow */
.browser-body .grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.browser-body .grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.browser-body .nous-sidebar .lockup-text { font-size: 14px; }
.browser-body .kpi-card .value { font-size: 24px; }
.browser-body .bottleneck-row .step { width: 180px; font-size: 12px; }
.browser-body .bottleneck-row .val { width: 70px; font-size: 11.5px; }

/* Sidebar header: bell with badge + collapse icon */
.sidebar-actions {
    display: inline-flex; align-items: center; gap: 4px;
}
.sidebar-bell, .sidebar-collapse {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: transparent;
    color: var(--text-tertiary);
    display: inline-flex; align-items: center; justify-content: center;
    position: relative;
    transition: background 120ms, color 120ms;
}
.sidebar-bell:hover, .sidebar-collapse:hover {
    background: var(--surface-subtle);
    color: var(--text-primary);
}
.sidebar-bell .bell-badge {
    position: absolute;
    top: -2px; right: -2px;
    background: var(--nous-purple);
    color: #FFFFFF;
    font-size: 9.5px;
    font-weight: 600;
    padding: 0 4px;
    min-width: 14px; height: 14px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    line-height: 1;
    font-family: var(--font-sans);
}
.sidebar-bell .bell-dot {
    position: absolute;
    top: 8px; right: 0;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    border: 1.5px solid #FFFFFF;
}

/* Chat home — clickable category chips + expanded questions panel */
.browser-body .chat-home .category-chip {
    transition: all 120ms;
}
.browser-body .chat-home .category-chip.active {
    background: var(--nous-purple-tint);
    border-color: var(--nous-purple-border);
    color: var(--nous-purple);
}
.browser-body .chat-home .category-chip.active .icon { color: var(--nous-purple); }

.category-panel {
    margin-top: 14px;
    width: 100%;
    max-width: 680px;
    background: #FFFFFF;
    border: 1px solid var(--surface-elevated);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
    animation: cat-panel-in 200ms ease-out;
}
@keyframes cat-panel-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}
.category-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    background: var(--nous-purple-tint);
    border-bottom: 1px solid var(--nous-purple-border);
}
.category-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--nous-purple);
}
.category-panel-close {
    width: 22px; height: 22px;
    border-radius: 4px;
    color: var(--text-muted);
    background: transparent;
    font-size: 18px;
    line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.category-panel-close:hover { background: rgba(255,255,255,0.6); color: var(--text-primary); }
.category-questions {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 260px;
    overflow-y: auto;
}
.category-question {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #F3F4F6;
    cursor: pointer;
    transition: background 120ms;
}
.category-question:last-child { border-bottom: 0; }
.category-question:hover { background: var(--surface-subtle); }
.category-question .qid {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--nous-purple);
    font-weight: 500;
}
.category-question .qlabel {
    font-size: 13px;
    color: var(--text-primary);
}

/* Chat thread bar with back-to-home button */
.chat-thread-bar {
    padding: 8px 24px 0;
    max-width: 880px;
    margin: 0 auto;
    width: 100%;
}
.chat-back-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px 4px 6px;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    transition: background 120ms, color 120ms;
}
.chat-back-btn:hover { background: var(--surface-subtle); color: var(--text-primary); }

/* Discovery question editor (Level 5) */
.discovery-cat {
    background: #FAFAFB;
    border: 1px solid #ECECEE;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}
.discovery-cat:last-child { margin-bottom: 0; }
.discovery-cat-head {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.discovery-count {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.discovery-list { display: flex; flex-direction: column; gap: 6px; }
.discovery-q-card {
    background: #FFFFFF;
    border: 1px solid #ECECEE;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 120ms;
}
.discovery-q-card.open {
    border-color: var(--nous-purple-border);
    box-shadow: 0 0 0 2px rgba(109, 74, 221, 0.05);
}
.discovery-q {
    display: grid;
    grid-template-columns: 44px 1fr 22px 22px 22px 22px;
    gap: 4px;
    align-items: center;
    padding: 6px;
}
.discovery-qid-input {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--nous-purple) !important;
    background: var(--nous-purple-tint) !important;
    border-color: transparent !important;
    padding: 4px !important;
}
.discovery-qid-input:focus {
    background: #FFFFFF !important;
    border-color: var(--nous-purple) !important;
}
.discovery-q .f-input { font-size: 12px; }

.hr-btn--has { color: var(--nous-purple); }
.hr-btn--has:hover { background: var(--nous-purple-tint); color: var(--nous-purple); }

/* Expanded answer editor */
.answer-editor {
    padding: 12px;
    background: #FAFAFB;
    border-top: 1px solid #ECECEE;
    display: flex; flex-direction: column;
    gap: 10px;
}
.ae-section { display: flex; flex-direction: column; gap: 6px; }
.ae-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex; justify-content: space-between; align-items: center;
    gap: 8px;
}
.ae-hint {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.ae-hint code { font-family: var(--font-mono); background: var(--surface-subtle); padding: 0 3px; border-radius: 2px; }
.ae-mini-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 7px;
    font-size: 10px;
    background: var(--nous-purple-tint);
    color: var(--nous-purple);
    border-radius: 4px;
}
.ae-mini-btn:hover { background: var(--nous-purple); color: #FFF; }

.ae-type-tabs {
    display: inline-flex;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 2px;
    gap: 1px;
}
.ae-type-tab {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px;
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 500;
    transition: all 120ms;
}
.ae-type-tab.active {
    background: var(--nous-purple-tint);
    color: var(--nous-purple);
}

.ae-kpis { display: flex; flex-direction: column; gap: 8px; }
.ae-kpi {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 8px;
    display: flex; flex-direction: column; gap: 5px;
}
.ae-kpi.highlight {
    border-color: var(--nous-purple-border);
    background: var(--nous-purple-tint);
}
.ae-kpi-row { display: grid; grid-template-columns: 1fr 22px 22px; gap: 4px; align-items: center; }
.ae-kpi-value { font-family: var(--font-mono); font-size: 13px; }

/* ==================================================================
   Answer artifact (rendered in chat thread)
   ================================================================== */
.answer-artifact { margin-top: 16px; }
.artifact-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 8px;
}
.artifact-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.005em;
}
.artifact-toolbar { display: inline-flex; gap: 8px; color: var(--text-muted); }
.artifact-tool {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 120ms;
}
.artifact-tool:hover { color: var(--nous-purple); }
.artifact-meta {
    display: flex; gap: 14px; align-items: center;
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--text-secondary);
}
.artifact-meta-active {
    padding: 4px 10px;
    background: var(--surface-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    font-weight: 500;
}
.artifact-meta-item:not(:first-child)::before { content: '·'; color: var(--text-muted); margin-right: 14px; }
.artifact-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.artifact-kpi {
    border: 1px solid var(--surface-elevated);
    border-radius: 8px;
    padding: 12px 14px;
    background: #FFFFFF;
}
.artifact-kpi--hl {
    border-color: var(--nous-purple);
    background: var(--nous-purple-tint);
}
.artifact-kpi-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.artifact-kpi--hl .artifact-kpi-label { color: var(--nous-purple); }
.artifact-kpi-value {
    font-size: 22px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 4px;
}
.artifact-kpi--hl .artifact-kpi-value { color: var(--nous-purple); }
.artifact-kpi-sub {
    font-size: 11.5px;
    color: var(--text-secondary);
    line-height: 1.35;
}
.answer-artifact--html {
    margin-top: 16px;
    border: 1px solid var(--surface-elevated);
    border-radius: 8px;
    overflow: hidden;
    background: #FFFFFF;
}

/* === Full HTML answer artifact (iframe) === */
.answer-artifact--iframe {
    margin-top: 18px;
    width: 100%;
    padding: 14px 14px 6px;
}
.artifact-open {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12.5px; font-weight: 500;
    color: var(--nous-purple);
    text-decoration: none;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 120ms;
}
.artifact-open:hover { background: var(--nous-purple-tint); }
.artifact-iframe-frame {
    width: 100%;
    border: 1px solid var(--surface-elevated);
    border-radius: 10px;
    background: #FFFFFF;
    display: block;
    margin-top: 4px;
}
/* Let HTML-report answers use the full chat column, not the text bubble width */
.msg-assistant-wrap:has(.answer-artifact--iframe) { max-width: 100%; }

/* Hotspot overlays */
.hotspot-overlay {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}
/* Hotspot pin — small, subtle by default */
.hotspot-pin {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--nous-purple);
    color: #FFFFFF;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9.5px; font-weight: 600;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.95), 0 2px 4px rgba(0,0,0,0.15);
    position: relative;
    transition: transform 120ms;
}
.hotspot-pin:hover { transform: scale(1.15); }
.hotspot-pin::before {
    content: '';
    position: absolute; inset: -4px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.18;
    animation: pin-pulse 1.8s ease-out infinite;
}
@keyframes pin-pulse {
    0% { transform: scale(0.9); opacity: 0.4; }
    100% { transform: scale(1.8); opacity: 0; }
}
.hotspot-callout {
    position: absolute;
    max-width: 230px;
    padding: 9px 12px;
    background: #1B1D24;
    color: #FFFFFF;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.45;
    box-shadow: 0 10px 24px rgba(0,0,0,0.16);
    pointer-events: auto;
}
.hotspot-callout .head {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #A595F5;
    margin-bottom: 2px;
    font-weight: 600;
}
.hotspot-callout .cta {
    margin-top: 8px;
    display: inline-block;
    background: var(--nous-purple);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #FFFFFF;
}
.hotspot-callout .arrow {
    position: absolute;
    width: 10px; height: 10px;
    background: #1B1D24;
    transform: rotate(45deg);
    bottom: -4px; left: 20px;
}
.hotspot-callout-close {
    position: absolute;
    top: 4px; right: 6px;
    width: 18px; height: 18px;
    border-radius: 4px;
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 16px;
    line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 120ms, color 120ms;
}
.hotspot-callout-close:hover { background: rgba(255,255,255,0.1); color: #FFFFFF; }
.hotspot-callout .head { padding-right: 20px; }

/* Persona switcher (overlay bottom-left of preview, low-intrusion) */
.persona-switcher {
    position: absolute;
    bottom: 12px; left: 12px;
    background: rgba(27, 29, 36, 0.92);
    backdrop-filter: blur(6px);
    color: #FFFFFF;
    padding: 5px 9px 5px 9px;
    border-radius: 999px;
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 10.5px;
    z-index: 6;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.persona-switcher .label { color: #A595F5; font-weight: 500; }
.persona-switcher .name { color: #FFFFFF; font-weight: 500; }
.persona-switcher .chev { opacity: 0.7; margin-left: 2px; }

/* Highlight ring for "find&replace just happened" effect */
.hl-flash {
    position: relative;
    animation: hl-flash 1.2s ease-out;
}
@keyframes hl-flash {
    0% { box-shadow: 0 0 0 4px rgba(109, 74, 221, 0.35); }
    100% { box-shadow: 0 0 0 4px rgba(109, 74, 221, 0); }
}

/* Variable highlight (Level 4) — when level 4 expanded, show vars as
   purple pills inline in preview text */
.var-pill {
    display: inline-block;
    padding: 0 5px;
    background: var(--nous-purple-tint);
    color: var(--nous-purple);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.88em;
    font-weight: 500;
    line-height: 1.5;
    box-shadow: inset 0 0 0 1px var(--nous-purple-border);
}
.var-resolved {
    background: var(--nous-purple-tint);
    padding: 0 3px;
    border-radius: 3px;
    color: var(--nous-purple);
    font-weight: 500;
}

/* ==================================================================
   Compose action footer
   ================================================================== */
.panel-foot {
    border-top: 1px solid #ECECEE;
    padding: 10px 16px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
    background: #FFFFFF;
}
.panel-foot .left-text {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}
.panel-foot .left-text .em { color: var(--text-primary); font-weight: 500; }

/* ==================================================================
   Mini KPI overlay change badge inside preview
   ================================================================== */
.kpi-card { position: relative; }
.kpi-card::after {
    content: 'editado';
    position: absolute;
    top: 8px; right: 8px;
    font-size: 9.5px;
    font-weight: 500;
    color: var(--nous-purple);
    background: var(--nous-purple-tint);
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 160ms;
    pointer-events: none;
}
.kpi-card.show-edit-flag::after { opacity: 1; }

/* ==================================================================
   Inline editing affordance (Editable component)
   ================================================================== */
.editable {
    display: inline;
    border-radius: 3px;
    transition: background 120ms, box-shadow 120ms;
    cursor: text;
}
/* Default state: visually invisible. The affordance only appears when
   edit mode is on, so the demo looks final to the prospect. */
.editable--on {
    background: rgba(109, 74, 221, 0.10);
    box-shadow: inset 0 -1px 0 rgba(109, 74, 221, 0.45);
    cursor: pointer;
    padding: 0 2px;
    margin: 0 -2px;
}
.editable--on:hover {
    background: rgba(109, 74, 221, 0.18);
    box-shadow: inset 0 0 0 1px var(--nous-purple);
}
.editable--input {
    font: inherit;
    color: inherit;
    background: #FFFFFF;
    border: 1px solid var(--nous-purple);
    box-shadow: var(--shadow-focus);
    border-radius: 3px;
    padding: 0 4px;
    outline: 0;
    line-height: inherit;
    letter-spacing: inherit;
    font-weight: inherit;
    margin: 0 -2px;
    vertical-align: baseline;
}
textarea.editable--input {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    line-height: 1.45;
    padding: 4px 6px;
}

.live-editable {
    outline: none;
    border-radius: 3px;
    transition: background 120ms, box-shadow 120ms;
    cursor: text;
}
.live-editable:hover {
    background: rgba(109, 74, 221, 0.08);
    box-shadow: inset 0 0 0 1px var(--nous-purple-border);
}
.live-editable:focus {
    background: #FFFFFF;
    box-shadow: 0 0 0 2px var(--nous-purple);
}

/* Slug loading / not-found screen */
.slug-loading {
    position: fixed; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px;
    background: #FBFBFC;
    text-align: center;
    padding: 24px;
}
.slug-loading-mark { opacity: 0.9; animation: slug-pulse 1.4s ease-in-out infinite; }
@keyframes slug-pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }
.slug-loading-text { font-size: 15px; color: var(--text-primary); font-weight: 500; }
.edit-mode-banner {
    position: absolute;
    bottom: 12px; left: 50%; transform: translateX(-50%);
    background: rgba(27, 29, 36, 0.92);
    color: #FFFFFF;
    padding: 6px 12px 6px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    display: inline-flex; align-items: center; gap: 8px;
    z-index: 7;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
.edit-mode-banner .em-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--nous-purple);
    box-shadow: 0 0 0 3px rgba(109,74,221,0.35);
    animation: nous-pulse 1.6s ease-in-out infinite;
}
.edit-mode-banner button {
    color: #A595F5;
    font-size: 11px;
    padding: 0 4px;
}

/* ==================================================================
   Process Mining screen
   ================================================================== */
.pm-screen { display: flex; flex-direction: column; gap: 16px; padding: 18px 22px 8px !important; }
.pm-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px;
}
.pm-cta {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--nous-purple);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(109,74,221,0.2), inset 0 0 0 1px rgba(255,255,255,0.06);
    transition: filter 120ms;
    white-space: nowrap;
    flex-shrink: 0;
}
.pm-cta:hover { filter: brightness(1.08); }

.pm-filters {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
}
.pm-filter {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 6px 4px 10px;
    border-radius: 6px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    font-size: 12.5px;
    color: var(--text-primary);
}
.pm-filter-x {
    width: 16px; height: 16px;
    border-radius: 4px;
    color: var(--danger);
    border: 1px solid #FCA5A5;
    font-size: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    line-height: 1;
}
.pm-filter-add {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px;
    border-radius: 6px;
    color: var(--text-secondary);
    background: transparent;
    border: 1px dashed #E5E7EB;
    font-size: 12px;
}
.pm-filter-add:hover { color: var(--nous-purple); border-color: var(--nous-purple-border); }

.pm-grid {
    display: flex; flex-direction: column;
    gap: 14px;
}
.pm-embed {
    border: 1px solid var(--surface-elevated);
    border-radius: var(--radius-card);
    overflow: hidden;
    background: #FFFFFF;
    margin-top: 4px;
}
.pm-embed-frame {
    width: 100%;
    height: 680px;
    border: 0;
    display: block;
    background: #FFFFFF;
}
.pm-embed-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
    line-height: 1.5;
}
.pm-map-wrap {
    background: #FFFFFF;
    border: 1px solid var(--surface-elevated);
    border-radius: var(--radius-card);
    position: relative;
    padding: 8px;
    min-height: 360px;
    background-image:
        radial-gradient(circle, #F0F2F5 1px, transparent 1px);
    background-size: 18px 18px;
    background-position: 0 0;
    overflow: hidden;
}
.pm-map-svg { width: 100%; aspect-ratio: 1080 / 580; height: auto; display: block; }
.pm-donut {
    position: absolute; bottom: 12px; right: 12px;
    background: rgba(255,255,255,0.95);
    border: 1px solid var(--surface-elevated);
    border-radius: 8px;
    padding: 8px 12px 8px 8px;
    display: flex; align-items: center; gap: 10px;
}
.pm-donut-cap {
    font-size: 13px;
    color: var(--nous-purple);
    font-weight: 500;
    font-family: var(--font-mono);
    display: flex; flex-direction: column;
}
.pm-donut-sub {
    font-family: var(--font-sans);
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.pm-side {
    background: #FFFFFF;
    border: 1px solid var(--surface-elevated);
    border-radius: var(--radius-card);
    display: flex; flex-direction: column;
    min-height: 0; overflow: hidden;
    max-height: 320px;
}
.pm-side-head {
    padding: 10px 12px;
    border-bottom: 1px solid var(--surface-elevated);
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
}
.pm-side-head .pm-select { flex: 0 0 200px; }
.pm-side-head .pm-side-axis { flex: 1; min-width: 0; max-width: 220px; }
.pm-select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--surface-elevated);
    border-radius: 6px;
    background: #FFFFFF;
    font-size: 12px;
    color: var(--text-primary);
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 26px;
}
.pm-side-axis {
    display: grid; grid-template-columns: repeat(3, 1fr);
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.pm-side-axis span:nth-child(1) { text-align: left; }
.pm-side-axis span:nth-child(2) { text-align: center; }
.pm-side-axis span:nth-child(3) { text-align: right; }
.pm-side-body {
    flex: 1; overflow-y: auto;
    padding: 4px 12px 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
}
.pm-var-row {
    display: grid;
    grid-template-columns: 30px 1fr 70px;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    font-size: 10px;
}
.pm-var-n {
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-align: right;
}
.pm-var-bar-wrap {
    height: 8px;
    background: transparent;
    overflow: hidden;
}
.pm-var-bar {
    display: block;
    height: 100%;
    border-radius: 2px;
}
.pm-var-time {
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    font-size: 9.5px;
    text-align: right;
}
.pm-var-other .pm-var-n { color: var(--text-tertiary); font-family: var(--font-sans); }

/* ==================================================================
   Modals (Share, Full Map)
   ================================================================== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 17, 26, 0.55);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
    padding: 24px;
    opacity: 1;
}
.modal {
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(15, 17, 26, 0.24);
    display: flex; flex-direction: column;
    overflow: hidden;
    opacity: 1;
}
.modal--wide { max-width: 1100px; max-height: 88vh; }
.modal-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--surface-elevated);
}
.modal-title { font-size: 16px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; }
.modal-sub   { font-size: 12px; color: var(--text-secondary); }
.modal-close {
    width: 28px; height: 28px;
    border-radius: 6px;
    color: var(--text-muted);
    background: transparent;
    display: inline-flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--surface-subtle); color: var(--text-primary); }
.modal-body { padding: 16px 22px; overflow-y: auto; }
.modal-body--map {
    padding: 12px;
    background-image:
        radial-gradient(circle, #F0F2F5 1px, transparent 1px);
    background-size: 18px 18px;
    flex: 1;
    min-height: 500px;
}
.modal-body--map .pm-map-svg { width: 100%; height: 100%; min-height: 500px; }
.modal-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--surface-elevated);
    background: #FAFAFB;
}

/* Share-modal specifics */
.share-section { margin-bottom: 18px; }
.share-section:last-child { margin-bottom: 0; }
.share-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.share-url-row {
    display: flex; align-items: center; gap: 8px;
}
.share-url {
    flex: 1;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 12px;
    background: var(--surface-subtle);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.share-url-input {
    flex: 1;
    width: 100%;
    padding: 9px 12px;
    background: var(--surface-subtle);
    border: 1px solid transparent;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-primary);
    outline: 0;
    transition: border-color 120ms, box-shadow 120ms;
}
.share-url-input:focus {
    border-color: var(--nous-purple);
    box-shadow: var(--shadow-focus);
    background: #FFFFFF;
}
.share-actions-row {
    display: flex; align-items: center; gap: 8px;
    margin-top: 8px;
}
.share-actions-row .share-hint { margin-top: 0; flex: 1; }
.share-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.45;
}
.share-options {
    display: flex; flex-direction: column; gap: 6px;
}
.share-opt {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid #ECECEE;
    text-align: left;
    transition: all 120ms;
}
.share-opt:hover {
    background: var(--nous-purple-tint);
    border-color: var(--nous-purple-border);
}
.share-opt-icon {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: var(--nous-purple-tint);
    color: var(--nous-purple);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.share-opt-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.share-opt-sub   { font-size: 11.5px; color: var(--text-secondary); margin-top: 1px; }
.share-prev {
    padding: 10px 12px;
    background: var(--nous-purple-tint);
    border-radius: 6px;
    font-size: 12.5px;
    color: var(--text-tertiary);
    line-height: 1.5;
    display: flex; align-items: flex-start; gap: 8px;
}

/* Edit-mode active state on the topbar button */
.tbtn--active {
    background: var(--nous-purple-tint);
    color: var(--nous-purple);
}
.tbtn--active:hover { background: var(--nous-purple-tint); color: var(--nous-purple); filter: brightness(0.96); }

/* ==================================================================
   Preview-only mode (fullscreen demo without studio chrome)
   ================================================================== */
.preview-mode {
    height: 100vh; width: 100vw;
    background: #F4F5F7;
    background-image:
        radial-gradient(circle, #E5E7EB 1px, transparent 1px);
    background-size: 18px 18px;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.preview-mode-bar {
    height: 44px;
    background: #FFFFFF;
    border-bottom: 1px solid #ECECEE;
    padding: 0 16px;
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.preview-mode-left, .preview-mode-right {
    display: flex; align-items: center; gap: 10px;
}
.preview-mode-canvas {
    flex: 1; padding: 24px;
    display: flex; align-items: stretch; justify-content: center;
    min-height: 0;
}
.preview-mode-canvas .browser-frame {
    max-width: 1480px;
}

/* Tooltip lite */
.help-dot {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--surface-subtle);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 600;
    cursor: help;
    margin-left: 4px;
}

/* ==================================================================
   Scrollbar polish
   ================================================================== */
.levels-list::-webkit-scrollbar, .canvas-scroll::-webkit-scrollbar,
.lib-screen::-webkit-scrollbar { width: 10px; height: 10px; }
.levels-list::-webkit-scrollbar-thumb, .canvas-scroll::-webkit-scrollbar-thumb,
.lib-screen::-webkit-scrollbar-thumb {
    background: #DDD; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box;
}
.levels-list::-webkit-scrollbar-thumb:hover, .canvas-scroll::-webkit-scrollbar-thumb:hover,
.lib-screen::-webkit-scrollbar-thumb:hover {
    background: #BBB; background-clip: padding-box; border: 2px solid transparent;
}

/* ==================================================================
   Login screen
   ================================================================== */
.login-screen {
    position: fixed; inset: 0;
    background: #FBFBFC;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.login-bg {
    position: absolute; inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, #E5E7EB 1px, transparent 1px);
    background-size: 24px 24px;
}
.login-grid-blob {
    position: absolute;
    top: 20%; left: 50%;
    width: 800px; height: 600px;
    margin-left: -400px;
    background: radial-gradient(circle, rgba(109, 74, 221, 0.10) 0%, transparent 60%);
    pointer-events: none;
}
.login-card {
    position: relative;
    width: 100%; max-width: 420px;
    background: #FFFFFF;
    border-radius: 14px;
    padding: 32px 36px 24px;
    box-shadow: 0 24px 64px rgba(15, 17, 26, 0.10), 0 0 0 1px #ECECEE;
    display: flex; flex-direction: column;
    gap: 14px;
}
.login-brand {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.login-brand .mark-wrap {
    width: 28px; height: 28px;
    background: #11161D; color: white;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 7px;
    font-size: 13px; font-weight: 600;
}
.login-title {
    font-size: 22px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin: 0;
}
.login-sub {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 8px;
}
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.login-field input {
    padding: 10px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background: #FFFFFF;
    outline: 0;
    transition: border-color 120ms, box-shadow 120ms;
}
.login-field input:focus {
    border-color: var(--nous-purple);
    box-shadow: 0 0 0 3px var(--nous-purple-tint);
}
.login-field.shake { animation: login-shake 0.36s ease-out; }
@keyframes login-shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
    100% { transform: translateX(0); }
}
.login-err {
    font-size: 12px;
    color: var(--danger);
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--danger-bg);
    padding: 8px 10px;
    border-radius: 6px;
}
.login-submit {
    width: 100%;
    justify-content: center;
    padding: 10px 16px !important;
    font-size: 14px !important;
    margin-top: 4px;
}
.login-foot {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid #F3F4F6;
    text-align: center;
}
.login-version {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ==================================================================
   Library screen
   ================================================================== */
.lib-screen {
    height: 100vh;
    background: #FBFBFC;
    padding: 24px 36px 48px;
    overflow-y: auto;
    overflow-x: hidden;
}
.lib-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 36px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ECECEE;
}
.lib-header-left, .lib-header-right {
    display: flex; align-items: center; gap: 12px;
}
.lib-header .studio-brand .mark-wrap {
    width: 28px; height: 28px;
    background: #11161D; color: white;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 7px;
    font-size: 13px; font-weight: 600;
    flex-shrink: 0;
}
.lib-header .studio-brand .name { font-size: 14px; font-weight: 500; }
.lib-header .studio-brand .name .dim { color: var(--text-tertiary); font-weight: 400; }
.lib-version-chip {
    padding: 3px 7px;
    background: var(--nous-purple-tint);
    color: var(--nous-purple);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    border-radius: 4px;
}

.lib-hero {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    max-width: 1280px;
}
.lib-h1 {
    font-size: 28px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.015em;
    margin: 0 0 6px;
}
.lib-sub {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    max-width: 520px;
}
.lib-new-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--nous-purple);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 500;
    transition: filter 120ms;
    white-space: nowrap;
}
.lib-new-btn:hover { filter: brightness(1.08); }

.lib-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    max-width: 1280px;
}
.lib-filters {
    display: inline-flex; gap: 2px;
    padding: 3px;
    background: #F3F4F6;
    border-radius: 8px;
}
.lib-filter {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    transition: all 120ms;
}
.lib-filter:hover { color: var(--text-primary); }
.lib-filter.active {
    background: #FFFFFF;
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.lib-filter-count {
    font-size: 10.5px;
    color: var(--text-muted);
    background: var(--surface-subtle);
    padding: 1px 6px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}
.lib-filter.active .lib-filter-count {
    background: var(--nous-purple-tint);
    color: var(--nous-purple);
}
.lib-search {
    display: inline-flex; align-items: center; gap: 8px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 7px 12px;
    width: 320px;
    transition: border-color 120ms, box-shadow 120ms;
}
.lib-search:focus-within {
    border-color: var(--nous-purple);
    box-shadow: 0 0 0 3px var(--nous-purple-tint);
}
.lib-search input {
    flex: 1;
    border: 0;
    outline: 0;
    font-size: 13px;
    color: var(--text-primary);
    background: transparent;
}

.lib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    max-width: 1280px;
}
.lib-empty {
    margin-top: 24px;
    padding: 24px;
    background: #FFFFFF;
    border: 1px dashed #E5E7EB;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex; align-items: center; gap: 10px;
    justify-content: center;
}

/* Demo card */
.lib-card {
    background: #FFFFFF;
    border: 1px solid #ECECEE;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 140ms, box-shadow 140ms, transform 140ms;
    text-align: left;
    width: 100%;
    padding: 0;
    font-family: inherit;
}
.lib-card:hover {
    border-color: var(--nous-purple-border);
    box-shadow: 0 8px 24px rgba(15, 17, 26, 0.08), 0 2px 6px rgba(15, 17, 26, 0.04);
    transform: translateY(-2px);
}
.lib-card-cover {
    height: 96px;
    position: relative;
    display: flex; align-items: center; padding: 0 20px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    overflow: hidden;
}
.lib-card-cover-mono {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
    font-family: var(--font-sans);
    z-index: 1;
}
.lib-card-cover-pattern {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
.lib-card-kebab {
    position: absolute;
    top: 12px; right: 12px;
    width: 28px; height: 28px;
    border-radius: 6px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(4px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px;
    transition: background 120ms;
    z-index: 2;
}
.lib-card-kebab span {
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--text-tertiary);
}
.lib-card-kebab:hover { background: #FFFFFF; }
.lib-card-menu {
    position: absolute;
    top: 44px; right: 12px;
    width: 160px;
    background: #FFFFFF;
    border: 1px solid #ECECEE;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 17, 26, 0.12);
    z-index: 50;
    padding: 4px;
    display: flex; flex-direction: column;
    animation: lib-menu-in 140ms ease-out;
}
.lib-card { position: relative; overflow: visible; }
.lib-card-cover { overflow: visible; }
@keyframes lib-menu-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}
.lib-card-menu button {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px;
    border-radius: 4px;
    font-size: 12.5px;
    color: var(--text-primary);
    text-align: left;
    background: transparent;
}
.lib-card-menu button:hover { background: var(--surface-subtle); }
.lib-card-menu button.danger { color: var(--danger); }
.lib-card-menu button.danger:hover { background: var(--danger-bg); }
.lib-card-menu-divider {
    height: 1px;
    background: #ECECEE;
    margin: 4px 0;
}

.lib-card-body { padding: 14px 16px 14px; }
.lib-card-titlerow {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.lib-card-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.005em;
}
.lib-card-status {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.lib-card-status.st-draft  { background: #FEF3C7; color: #92400E; }
.lib-card-status.st-ready  { background: #DCFCE7; color: #166534; }
.lib-card-status.st-shared { background: var(--nous-purple-tint); color: var(--nous-purple); }
.lib-card-meta {
    display: flex; flex-direction: column; gap: 4px;
    margin-bottom: 10px;
}
.lib-card-meta-row {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}
.lib-card-meta-row svg { color: var(--text-muted); }
.lib-card-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    padding-top: 8px;
    border-top: 1px dashed #F3F4F6;
    line-height: 1.4;
}
.lib-card-foot {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #F3F4F6;
    display: flex; align-items: center; gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}
.lib-card-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8E76E7 0%, #6D4ADD 100%);
    color: white;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9.5px; font-weight: 600;
    flex-shrink: 0;
}
.lib-card-foot-text { flex: 1; }
.lib-card-foot-text strong { color: var(--text-tertiary); font-weight: 500; }
.lib-card-version-warn {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 9.5px;
    padding: 2px 5px;
    border-radius: 3px;
    background: #FEF3C7;
    color: #92400E;
    font-family: var(--font-mono);
    font-weight: 500;
}
.lib-card-views {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px;
    color: var(--text-muted);
}

/* "Add" tile */
.lib-card--add {
    background: transparent;
    border: 1px dashed #D5D5D9;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    padding: 32px 20px;
    min-height: 240px;
    cursor: pointer;
}
.lib-card--add:hover {
    background: var(--nous-purple-tint);
    border-color: var(--nous-purple);
    transform: translateY(-2px);
}
.lib-card-add-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--nous-purple-tint);
    color: var(--nous-purple);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
}
.lib-card--add:hover .lib-card-add-icon {
    background: var(--nous-purple);
    color: #FFFFFF;
}
.lib-card-add-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.lib-card-add-sub {
    font-size: 11.5px;
    color: var(--text-muted);
}

/* New demo modal — clone picker */
.newdemo-modes {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.newdemo-mode {
    display: flex; align-items: center; gap: 10px;
    padding: 12px;
    border-radius: 8px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    text-align: left;
    transition: all 120ms;
    cursor: pointer;
}
.newdemo-mode:hover { border-color: var(--nous-purple-border); }
.newdemo-mode.active {
    border-color: var(--nous-purple);
    background: var(--nous-purple-tint);
}
.newdemo-mode-icon {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: var(--nous-purple-tint);
    color: var(--nous-purple);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.newdemo-mode-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.newdemo-mode-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; line-height: 1.35; }

.newdemo-clone-list {
    display: flex; flex-direction: column;
    gap: 4px;
    max-height: 280px;
    overflow-y: auto;
}
.newdemo-clone-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    text-align: left;
    transition: all 120ms;
}
.newdemo-clone-item:hover { background: var(--surface-subtle); }
.newdemo-clone-item.active {
    background: var(--nous-purple-tint);
    border-color: var(--nous-purple-border);
}
.newdemo-clone-mono {
    width: 28px; height: 28px;
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600;
    flex-shrink: 0;
}
.newdemo-clone-info { flex: 1; min-width: 0; }
.newdemo-clone-name { font-size: 12.5px; font-weight: 500; color: var(--text-primary); display: block; }
.newdemo-clone-meta { font-size: 11px; color: var(--text-secondary); }

/* Topbar back button */
.studio-brand--btn {
    cursor: pointer;
    border: 0; background: transparent;
    transition: background 120ms;
}
.studio-brand--btn:hover {
    background: var(--surface-subtle);
}

/* Share modal: label hint + prod URL */
.share-label-hint {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-top: 2px;
}
.share-url-input--prod {
    color: var(--nous-purple) !important;
    background: var(--nous-purple-tint) !important;
    font-weight: 500;
}

/* Settings modal */
.settings-fields {
    display: flex; flex-direction: column;
    gap: 10px;
}
.settings-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-primary);
}
.settings-row span { color: var(--text-secondary); font-weight: 500; }
.settings-row input.f-input { padding: 9px 12px; font-size: 13px; }
.settings-show {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    padding-left: 192px;
    margin-top: 2px;
}
.settings-show input { accent-color: var(--nous-purple); }

.settings-feedback {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    margin-top: 12px;
}
.settings-feedback.ok { background: #DCFCE7; color: #166534; }
.settings-feedback.err { background: var(--danger-bg); color: var(--danger); }

.settings-about {
    list-style: none;
    margin: 0; padding: 0;
    display: flex; flex-direction: column;
    gap: 6px;
}
.settings-about li {
    font-size: 12.5px;
    color: var(--text-secondary);
    display: flex; align-items: center; gap: 6px;
}
.settings-about li strong {
    color: var(--text-primary);
    font-weight: 500;
    min-width: 200px;
    display: inline-block;
}
.settings-about li code {
    font-family: var(--font-mono);
    background: var(--nous-purple-tint);
    color: var(--nous-purple);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11.5px;
}

/* === Standard Answers Admin === */
.answers-admin { max-width: 760px; }
.answers-admin-body { display: flex; flex-direction: column; gap: 18px; }
.answers-cat { display: flex; flex-direction: column; gap: 6px; }
.answers-cat-head {
    display: flex; align-items: center; gap: 7px;
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-tertiary); margin-bottom: 2px;
}
.answers-cat-count {
    background: var(--surface-subtle); color: var(--text-secondary);
    border-radius: 999px; font-size: 10.5px; padding: 1px 7px; font-weight: 600;
}
.answer-row {
    border: 1px solid var(--surface-elevated); border-radius: 10px; background: #FFFFFF;
    overflow: hidden; transition: border-color 120ms;
    flex-shrink: 0;
}
.answer-row.open { border-color: var(--nous-purple-border); box-shadow: 0 2px 10px rgba(15,17,26,0.05); }
.answer-row-head {
    display: flex; align-items: center; gap: 11px; padding: 12px 14px; cursor: pointer;
}
.answer-row-head:hover { background: var(--surface-subtle); }
.answer-row-icon {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    background: var(--nous-purple-tint); color: var(--nous-purple);
    display: inline-flex; align-items: center; justify-content: center;
}
.answer-row-info { flex: 1; min-width: 0; }
.answer-row-label { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.answer-row-meta { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 1px; }
.answer-row-edit {
    padding: 14px; border-top: 1px solid var(--surface-elevated);
    background: #FAFBFC; display: flex; flex-direction: column; gap: 12px;
}
.ans-field { display: flex; flex-direction: column; gap: 5px; }
.ans-field > span { font-size: 11.5px; font-weight: 500; color: var(--text-primary); }
.ans-field .f-input { font-size: 12.5px; padding: 8px 10px; }
.ans-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answer-row-actions { display: flex; align-items: center; justify-content: space-between; }
.ans-remove {
    display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px;
    border-radius: 6px; font-size: 12px; color: var(--danger); background: transparent;
}
.ans-remove:hover { background: var(--danger-bg); }
.answers-empty { font-size: 12px; color: var(--text-muted); padding: 8px 4px; }
.ans-texthint { font-size: 12px; color: var(--text-muted); }
.ans-html-row { display: flex; gap: 8px; align-items: stretch; }
.ans-html-row .f-input { flex: 1; min-width: 0; }
.ans-attach-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 0 12px; height: auto;
    border: 1px solid var(--nous-purple-border);
    border-radius: 7px; background: var(--nous-purple-tint);
    color: var(--nous-purple); font-size: 12px; font-weight: 500;
    cursor: pointer; white-space: nowrap; transition: background 120ms;
}
.ans-attach-btn:hover { background: #EBE5FB; }
.ans-attach-btn--ghost {
    background: transparent; border-color: var(--surface-elevated);
    color: var(--text-muted); padding: 0 9px;
}
.ans-attach-btn--ghost:hover { background: var(--surface-subtle); color: var(--danger); }
.artifact-loading {
    padding: 40px 16px; text-align: center;
    font-size: 13px; color: var(--text-muted);
    background: var(--surface-subtle); border-radius: 10px;
}
.artifact-loading--err {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    color: var(--text-secondary); text-align: left;
}

/* === Agent media admin === */
.agent-media-card {
    border: 1px solid var(--surface-elevated); border-radius: 12px;
    background: #FFFFFF; padding: 16px; display: flex; flex-direction: column; gap: 14px;
}
.agent-media-head { display: flex; align-items: center; gap: 11px; }
.agent-media-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.agent-media-block { display: flex; flex-direction: column; gap: 7px; }
.agent-media-block-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-tertiary);
}
.agent-media-actions { display: flex; gap: 8px; }
.answers-note {
    display: flex; gap: 9px; align-items: flex-start;
    background: var(--nous-purple-tint); border-radius: 8px; padding: 12px 14px;
    font-size: 12px; color: var(--text-tertiary); line-height: 1.5;
}

/* ==================================================================
   Responsive: shrink/hide chrome on narrower viewports
   ================================================================== */
@media (max-width: 1480px) {
    .save-state { display: none; }
}
@media (max-width: 1340px) {
    .studio-topbar .left .crumb-sep { display: none; }
    .project-chip .industry { display: none; }
}
@media (max-width: 1280px) {
    .studio-topbar .right .tbtn:not(.tbtn--primary) span:not(.icon):not(.tbtn-label) { display: none; }
    .studio-topbar .right .tbtn { padding: 6px 8px; }
    .screen-tab { padding: 5px 8px; font-size: 11.5px; }
    .screen-tab .icon { display: none; }
}
@media (max-width: 1180px) {
    .studio { grid-template-columns: 380px 1fr; }
    .canvas-toolbar .right > span { display: none; }
}

/* =====================================================================
   PROSPECT SPLASH — entry screen for shared demo links
   ===================================================================== */
.splash-root {
    position: fixed;
    inset: 0;
    background: #FBFBFD;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}
.splash-dotgrid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(109, 74, 221, 0.10) 1.1px, transparent 1.1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 42%, #000 35%, transparent 100%);
            mask-image: radial-gradient(ellipse 80% 70% at 50% 42%, #000 35%, transparent 100%);
    pointer-events: none;
}
.splash-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 860px;
    padding: 48px 24px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.splash-brand { margin-bottom: 30px; }
.splash-logo { height: 26px; width: auto; display: block; opacity: 0.95; }

.splash-head { text-align: center; margin-bottom: 38px; max-width: 600px; }
.splash-title {
    font-size: 32px;
    font-weight: var(--fw-semibold);
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.15;
}
.splash-sub {
    margin-top: 12px;
    font-size: 16px;
    line-height: 1.55;
    color: var(--text-tertiary);
    font-weight: var(--fw-regular);
    text-wrap: pretty;
}
.splash-sub strong { color: var(--nous-purple-700); font-weight: var(--fw-semibold); }

.splash-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    width: 100%;
}
.splash-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 16px;
    background: var(--surface-default);
    border: 1px solid var(--surface-elevated);
    border-radius: var(--radius-panel);
    padding: 26px 24px 22px;
    cursor: pointer;
    transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
    font-family: inherit;
}
.splash-card:hover {
    border-color: var(--nous-purple-300);
    box-shadow: 0 8px 28px -12px rgba(109, 74, 221, 0.28);
    transform: translateY(-2px);
}
.splash-card:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.splash-card-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-card);
    background: var(--nous-purple-50);
    color: var(--nous-purple);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--nous-purple-border);
}
.splash-card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.splash-card-name {
    font-size: 18px;
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.splash-card-tag { font-size: 14px; color: var(--text-tertiary); line-height: 1.45; }
.splash-card-subtag {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 2px;
}
.splash-card-subtag--meta { display: inline-flex; align-items: center; gap: 6px; }
.splash-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: var(--fw-medium);
    padding: 10px 18px;
    border-radius: var(--radius-button);
    margin-top: 2px;
    transition: background 120ms ease, border-color 120ms ease;
}
.splash-cta--primary { background: var(--nous-purple); color: #FFFFFF; }
.splash-card:hover .splash-cta--primary { background: var(--nous-purple-600); }
.splash-cta--outline {
    background: transparent;
    color: var(--nous-purple-700);
    border: 1px solid var(--nous-purple-300);
}
.splash-card:hover .splash-cta--outline { border-color: var(--nous-purple); background: var(--nous-purple-50); }

.splash-foot {
    margin-top: 34px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

@media (max-width: 768px) {
    .splash-inner { padding: 36px 18px 28px; }
    .splash-title { font-size: 26px; }
    .splash-sub { font-size: 15px; }
    .splash-cards { grid-template-columns: 1fr; gap: 14px; }
    .splash-card { padding: 22px 20px 20px; }
}

/* =====================================================================
   GUIDED TOUR — floating step controller over the prospect preview
   ===================================================================== */
.tour-layer {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    display: flex;
    justify-content: center;
    padding: 0 16px 26px;
    pointer-events: none;
}
.tour-card {
    pointer-events: auto;
    width: 100%;
    max-width: 460px;
    background: var(--surface-default);
    border: 1px solid var(--surface-elevated);
    border-radius: var(--radius-panel);
    box-shadow: 0 18px 50px -12px rgba(19, 41, 76, 0.30);
    padding: 18px 20px 16px;
    font-family: var(--font-sans);
}
.tour-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tour-step-badge {
    font-size: var(--fs-caption);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    color: var(--nous-purple);
}
.tour-exit {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; color: var(--text-secondary);
    background: transparent; padding: 4px 6px; border-radius: var(--radius-button);
    transition: color 120ms, background 120ms;
}
.tour-exit:hover { color: var(--text-primary); background: var(--surface-subtle); }
.tour-card-title {
    font-size: 17px; font-weight: var(--fw-semibold);
    color: var(--text-primary); letter-spacing: -0.01em; line-height: 1.25;
}
.tour-card-text {
    margin-top: 6px; font-size: 13.5px; line-height: 1.5;
    color: var(--text-tertiary); text-wrap: pretty;
}
.tour-progress { display: flex; gap: 7px; margin: 14px 0; }
.tour-dot {
    width: 22px; height: 5px; border-radius: var(--radius-full);
    background: var(--surface-elevated); transition: background 140ms;
}
.tour-dot.done { background: var(--nous-purple-200); }
.tour-dot.active { background: var(--nous-purple); }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tbtn--ghost { background: transparent; color: var(--text-secondary); }
.tbtn--ghost:hover:not(:disabled) { background: var(--surface-subtle); color: var(--text-primary); }
.tbtn:disabled { opacity: 0.4; cursor: not-allowed; }
.tour-next { padding-left: 16px; padding-right: 16px; }

@media (max-width: 768px) {
    .tour-layer { padding: 0 10px 16px; }
    .tour-card { max-width: 100%; }
}

/* ===================================================================
   F5 — Drill-down panel · QW3 — Demo badge · F2 — Synthetic panel
   (Prioridade #1 · Demo Interativa Real · v1.3.0)
   =================================================================== */

/* the preview app is the positioning context for badge + drawer */
.nous-app { position: relative; }

/* ---- drillable affordances on existing KPIs ---- */
.vt-drillable { cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.vt-drillable:hover { box-shadow: 0 4px 16px rgba(109,74,221,0.12); border-color: var(--nous-purple-border); }
.vt-hero-card.vt-drillable:hover { transform: translateY(-1px); }
.vt-drill-hint {
    float: right; font-size: 10px; color: var(--nous-purple);
    opacity: 0; transition: opacity .15s; font-weight: 500;
}
.vt-hero-card.vt-drillable:hover .vt-drill-hint { opacity: 1; }
.vt-bar-row.vt-drillable:hover .vt-bar-label { color: var(--nous-purple); }
.artifact-kpi--drill { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.artifact-kpi--drill:hover { box-shadow: 0 3px 12px rgba(109,74,221,0.14); border-color: var(--nous-purple-border); }

/* ---- drill-down drawer ---- */
.dd-overlay {
    position: absolute; inset: 0; z-index: 60;
    background: rgba(17,22,29,0.28);
    display: flex; justify-content: flex-end;
    animation: dd-fade .16s ease;
}
@keyframes dd-fade { from { opacity: 0; } to { opacity: 1; } }
.dd-panel {
    width: min(460px, 86%); height: 100%;
    background: var(--surface-default);
    box-shadow: -8px 0 30px rgba(0,0,0,0.16);
    display: flex; flex-direction: column;
    animation: dd-slide .2s cubic-bezier(.2,.7,.3,1);
}
@keyframes dd-slide { from { transform: translateX(24px); opacity: .4; } to { transform: translateX(0); opacity: 1; } }
.dd-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--surface-subtle);
}
.dd-crumb { display: flex; align-items: center; gap: 5px; font-size: 13px; flex-wrap: wrap; color: var(--text-muted); }
.dd-crumb-link { background: none; border: none; padding: 0; cursor: pointer; color: var(--nous-purple); font-size: 13px; font-weight: 500; }
.dd-crumb-cur { color: var(--text-primary); font-weight: 600; }
.dd-close { background: none; border: none; cursor: pointer; color: var(--text-muted); display: inline-flex; padding: 4px; border-radius: 6px; }
.dd-close:hover { background: var(--surface-subtle); color: var(--text-primary); }
.dd-metricbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--surface-subtle); gap: 12px;
}
.dd-metric-toggle { display: inline-flex; background: var(--surface-subtle); border-radius: var(--radius-button); padding: 2px; }
.dd-mt { border: none; background: none; cursor: pointer; font-size: 12px; padding: 4px 12px; border-radius: 4px; color: var(--text-secondary); font-weight: 500; }
.dd-mt.active { background: var(--surface-default); color: var(--nous-purple); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.dd-total { text-align: right; }
.dd-total-label { display: block; font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.dd-total-value { display: block; font-size: 18px; font-weight: 700; color: var(--text-primary); font-family: var(--font-mono); }
.dd-body { flex: 1; overflow-y: auto; padding: 14px 16px 28px; }
.dd-dim-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.dd-dim {
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid var(--surface-subtle); background: var(--surface-default);
    border-radius: var(--radius-pill); padding: 5px 10px; font-size: 12px; cursor: pointer; color: var(--text-secondary);
}
.dd-dim.active { border-color: var(--nous-purple); color: var(--nous-purple); background: var(--nous-purple-tint); font-weight: 500; }
.dd-bars { display: flex; flex-direction: column; gap: 4px; }
.dd-bar-row {
    display: grid; grid-template-columns: 1.5fr 2fr auto auto 14px; align-items: center; gap: 8px;
    background: none; border: none; width: 100%; text-align: left; cursor: pointer;
    padding: 7px 6px; border-radius: 6px;
}
.dd-bar-row:hover { background: var(--nous-purple-50); }
.dd-bar-label { font-size: 12px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-bar-wrap { height: 8px; background: var(--surface-subtle); border-radius: 4px; overflow: hidden; }
.dd-bar { display: block; height: 100%; background: linear-gradient(90deg, var(--nous-purple-300), var(--nous-purple)); border-radius: 4px; }
.dd-bar-val { font-size: 12px; font-weight: 600; color: var(--text-primary); font-family: var(--font-mono); white-space: nowrap; }
.dd-bar-pct { font-size: 11px; color: var(--text-muted); width: 44px; text-align: right; }
.dd-bar-row > svg { color: var(--text-muted); }
.dd-foot-note { margin-top: 14px; font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.dd-foot-note svg { color: #10B981; }
.dd-back { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; cursor: pointer; color: var(--nous-purple); font-size: 12px; font-weight: 500; margin-bottom: 12px; padding: 0; }
.dd-list-title { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.dd-records { display: flex; flex-direction: column; gap: 4px; }
.dd-rec-row {
    display: grid; grid-template-columns: auto 1fr auto 14px; align-items: center; gap: 10px;
    background: var(--surface-default); border: 1px solid var(--surface-subtle); border-radius: 6px;
    padding: 8px 10px; cursor: pointer; width: 100%; text-align: left;
}
.dd-rec-row:hover { border-color: var(--nous-purple-border); background: var(--nous-purple-50); }
.dd-rec-id { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.dd-rec-sup { font-size: 12.5px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-rec-val { font-size: 12.5px; font-weight: 600; font-family: var(--font-mono); color: var(--text-primary); }
.dd-rec-row > svg { color: var(--text-muted); }
.dd-record-head { margin-bottom: 12px; }
.dd-record-id { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.dd-record-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.dd-tag { font-size: 10.5px; padding: 3px 8px; border-radius: var(--radius-pill); background: var(--surface-subtle); color: var(--text-secondary); }
.dd-tag--warn { background: #FEF3C7; color: #92400E; }
.dd-record-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.dd-rk { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; background: var(--surface-subtle); border-radius: 6px; }
.dd-rk span { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em; }
.dd-rk strong { font-size: 13px; color: var(--text-primary); }
.dd-tl-title { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; }
.dd-timeline { display: flex; flex-direction: column; gap: 0; border-left: 2px solid var(--nous-purple-100); margin-left: 6px; padding-left: 0; }
.dd-tl-row { display: flex; gap: 12px; padding: 0 0 16px 16px; position: relative; }
.dd-tl-dot { position: absolute; left: -7px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--nous-purple); border: 2px solid var(--surface-default); }
.dd-tl-label { font-size: 12.5px; color: var(--text-primary); font-weight: 500; }
.dd-tl-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.dd-action { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; background: var(--nous-purple-tint); color: var(--nous-purple); border: 1px solid var(--nous-purple-border); border-radius: var(--radius-button); padding: 8px 14px; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.dd-action:hover { background: var(--nous-purple-100); }

/* ---- QW3 — demo badge ---- */
.demo-badge-wrap { position: absolute; right: 14px; bottom: 14px; z-index: 55; }
.demo-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.92); backdrop-filter: blur(6px);
    border: 1px solid var(--surface-elevated); border-radius: var(--radius-full);
    padding: 6px 12px; font-size: 11px; font-weight: 500; color: var(--text-secondary);
    cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.demo-badge:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.14); transform: translateY(-1px); color: var(--text-primary); }
.demo-badge svg { color: var(--nous-purple); }
.demo-badge-pop {
    position: absolute; right: 0; bottom: calc(100% + 8px); width: 270px;
    background: var(--surface-default); border: 1px solid var(--surface-subtle);
    border-radius: var(--radius-panel); padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.16);
    animation: dd-fade .14s ease;
}
.demo-badge-pop-title { font-size: 12.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.demo-badge-pop p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin: 0 0 10px; }
.demo-badge-link { font-size: 12px; color: var(--nous-purple); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }

/* ---- QW2 — "mostrar mais" ---- */
.category-more {
    margin-top: 8px; background: none; border: none; cursor: pointer;
    color: var(--nous-purple); font-size: 12px; font-weight: 500; padding: 6px 0;
}
.category-more:hover { text-decoration: underline; }

/* ---- F2 — synthetic data panel (builder Level 2) ---- */
.synth-panel { border: 1px solid var(--nous-purple-border); background: var(--nous-purple-50); border-radius: var(--radius-card); padding: 12px; }
.synth-badge { margin-left: 8px; font-size: 10px; font-weight: 600; color: #fff; background: #10B981; border-radius: var(--radius-pill); padding: 2px 7px; vertical-align: middle; }
.synth-gen-btn {
    display: inline-flex; align-items: center; gap: 7px; width: 100%; justify-content: center;
    background: var(--nous-purple); color: #fff; border: none; border-radius: var(--radius-button);
    padding: 9px 14px; font-size: 12.5px; font-weight: 500; cursor: pointer; margin-bottom: 12px;
}
.synth-gen-btn:hover { background: var(--nous-purple-600); }
.synth-summary { display: flex; flex-direction: column; gap: 12px; }
.synth-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.synth-kpi { background: var(--surface-default); border-radius: 6px; padding: 8px; text-align: center; }
.synth-kpi span { display: block; font-size: 14px; font-weight: 700; color: var(--text-primary); font-family: var(--font-mono); }
.synth-kpi label { display: block; font-size: 9.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em; margin-top: 2px; }
.synth-block { background: var(--surface-default); border-radius: 6px; padding: 10px; }
.synth-block-title { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.synth-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 11.5px; }
.synth-row-name { flex: 1; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.synth-row-val { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); }
.synth-row-pct { font-family: var(--font-mono); color: var(--text-muted); width: 46px; text-align: right; }
.synth-row-cnpj { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
.synth-tag { font-size: 9.5px; font-weight: 700; width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; }
.synth-tag--a { background: var(--nous-purple); color: #fff; }
.synth-tag--b { background: var(--nous-purple-200); color: var(--nous-purple-800); }
.synth-tag--c { background: var(--surface-elevated); color: var(--text-secondary); }
.synth-foot { font-size: 10.5px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.synth-foot svg { color: #10B981; }

/* ---- badge toggle (builder Level 5) ---- */
.badge-toggle { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-primary); cursor: pointer; }
.badge-toggle input { width: 15px; height: 15px; accent-color: var(--nous-purple); }
