/* === 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 .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-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-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;
}

/* 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;
}

/* "Modo edição" floating banner shown in preview when on */
.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;
    flex: 1; min-height: 0;
}
.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;
}

/* ==================================================================
   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; }
}
