/* ── Header bar ── */
.nc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.25);
    padding: 6px 12px;
    margin-bottom: 0;
    flex-shrink: 0;
    min-height: 0;
}

.nc-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nc-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--primary-cyan);
    letter-spacing: 3px;
    text-shadow: 0 0 8px var(--primary-cyan), 0 0 16px rgba(var(--primary-rgb), 0.25);
    white-space: nowrap;
}

.nc-status {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.nc-status .status-dot {
    width: 8px;
    height: 8px;
}

.nc-status-label {
    font-family: var(--font-display);
    font-size: 0.5rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--success-green);
    text-shadow: 0 0 6px rgba(var(--success-rgb), 0.3);
}

/* ── Tab navigation ── */
.nc-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    justify-content: center;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    color: var(--text-dim);
    padding: 5px 14px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.2s ease;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn:hover {
    color: var(--primary-cyan);
    border-color: var(--primary-cyan);
    background: rgba(var(--primary-rgb), 0.08);
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.12);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.15), rgba(var(--accent-rgb), 0.08));
    color: var(--primary-cyan);
    border-color: var(--primary-cyan);
    box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.2), inset 0 0 8px rgba(var(--primary-rgb), 0.06);
    text-shadow: 0 0 6px rgba(var(--primary-rgb), 0.4);
}

.tab-btn::before {
    display: none;
    content: attr(data-icon);
}

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

.nc-btn-logout {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid rgba(var(--danger-rgb), 0.3);
    color: var(--danger-red, #f87171);
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    text-transform: uppercase;
}

.nc-btn-logout:hover {
    background: rgba(var(--danger-rgb), 0.12);
    border-color: var(--danger-red, #f87171);
    box-shadow: 0 0 8px rgba(var(--danger-rgb), 0.2);
}

/* ── Responsive: collapse labels to icons when tight ── */
@media (max-width: 1100px) {
    .nc-title { font-size: 0.8rem; letter-spacing: 2px; }
    .tab-btn { padding: 5px 10px; font-size: 0.6rem; letter-spacing: 1px; }
}

@media (max-width: 850px) {
    .tab-btn { padding: 6px 10px; font-size: 0.85rem; letter-spacing: 0; }
    .tab-btn .tab-label { display: none; }
    .tab-btn::before { display: inline; }
    .nc-title { font-size: 0.7rem; letter-spacing: 1px; }
}

@media (max-width: 550px) {
    .nc-header { flex-wrap: wrap; gap: 6px; padding: 4px 8px; }
    .nc-header-brand { width: 100%; justify-content: flex-start; }
    .nc-tabs { width: 100%; justify-content: center; }
    .nc-header-actions { position: absolute; top: 6px; right: 10px; }
    .tab-btn { padding: 5px 8px; font-size: 0.8rem; }
    /* Mode toggles: icons only at mobile */
    .mode-label { display: none; }
    .mode-icon { display: inline; }
    /* Logout: icon only at mobile */
    .nc-logout-label { display: none; }
    .nc-logout-icon { display: inline-block; }
}

/* ── Old .tabs class (kept for any remaining references) ── */
.tabs {
    display: flex;
    gap: 6px;
    border: none;
    margin: 0;
    padding: 0;
}

/* ── Tab content ── */
.tab-content {
    display: none;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.tab-content.has-scrollbar {
    padding-right: 5px;
}

.tab-content.active {
    animation: fadeIn 0.4s ease;
}

/* ── Legacy header (override if still used by base template) ── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: var(--border-highlight);
    padding-bottom: 0;
    margin-bottom: 0;
}

h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--primary-cyan);
    letter-spacing: 3px;
    text-shadow: 0 0 8px var(--primary-cyan), 0 0 16px rgba(var(--primary-rgb), 0.25);
}

/* ── Grids ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
    padding-top: 5px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding-top: 5px;
}

/* ── Webchat navigation rail ── */
.nc-rail {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: rgba(var(--surface-rgb), 0.6);
    border-right: 1px solid rgba(var(--primary-rgb), 0.18);
    overflow: hidden;
    min-height: 0;
}

.nc-rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px 8px 10px;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.08);
    flex-shrink: 0;
    cursor: w-resize;
    outline: none;
    user-select: none;
}

.nc-rail-head:hover {
    background: rgba(var(--primary-rgb), 0.04);
}

.nc-rail-head:focus-visible {
    box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.5);
}

.nc-rail-head:hover .nc-rail-icon-btn {
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.3);
    background: rgba(var(--primary-rgb), 0.06);
}

.nc-rail-head:hover .nc-rail-brand-name {
    text-shadow: 0 0 8px rgba(var(--primary-rgb), 0.55);
}

.nc-rail-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.nc-rail-mark {
    width: 18px;
    height: 18px;
    border: 1px solid var(--primary-cyan);
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.25), rgba(var(--accent-rgb), 0.1));
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.35), inset 0 0 6px rgba(var(--primary-rgb), 0.25);
    transform: rotate(45deg);
    flex-shrink: 0;
}

.nc-rail-brand-name {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--primary-cyan);
    text-shadow: 0 0 6px rgba(var(--primary-rgb), 0.35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nc-rail-icon-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.nc-rail-icon-btn:hover {
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.3);
    background: rgba(var(--primary-rgb), 0.06);
}

.nc-rail-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 6px;
    min-height: 0;
}

/* Primary action group: New Session / Locate / Scratchpad / Console */
.nc-rail-actions {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 2px 10px 2px;
    border-bottom: 1px dashed rgba(var(--primary-rgb), 0.08);
    margin-bottom: 8px;
}

.nc-rail-action-wrap {
    width: 100%;
    position: relative;
}

.nc-rail-action {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    padding: 7px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    text-align: left;
    transition: all 0.15s ease;
}

.nc-rail-action:hover {
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.22);
    background: rgba(var(--primary-rgb), 0.05);
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.1);
}

.nc-rail-action svg {
    flex-shrink: 0;
    opacity: 0.75;
}

.nc-rail-action:hover svg {
    opacity: 1;
}

.nc-rail-action-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nc-rail-action-hint {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0;
    color: rgba(var(--text-dim-rgb), 0.6);
    text-transform: none;
    flex-shrink: 0;
    visibility: hidden;
}

.nc-rail-action:hover .nc-rail-action-hint {
    visibility: visible;
}

/* Group container (Vaults / Sessions) */
.nc-rail-group {
    margin-top: 4px;
}

.nc-rail-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px 4px 10px;
    position: relative;
}

.nc-rail-group-title {
    font-family: var(--font-display);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: rgba(var(--primary-rgb), 0.55);
}

.nc-rail-group-action {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    padding: 2px;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    transition: all 0.15s ease;
}

.nc-rail-group:hover .nc-rail-group-action {
    visibility: visible;
}

.nc-rail-group-action:hover {
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.25);
    background: rgba(var(--primary-rgb), 0.06);
}

.nc-rail-group-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0 2px;
}

.nc-rail-bucket-label {
    font-family: var(--font-display);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: rgba(var(--primary-rgb), 0.55);
    padding: 4px 10px 2px 10px;
}

/* Session row: item link + hover-reveal menu button */
.nc-rail-item-row {
    position: relative;
    display: flex;
    align-items: stretch;
}

.nc-rail-item {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 4px;
    text-decoration: none;
    background: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 0;
    border: 1px solid transparent;
}

.nc-rail-item:hover {
    background: rgba(var(--primary-rgb), 0.06);
    border-color: rgba(var(--primary-rgb), 0.18);
    color: var(--primary-cyan);
}

.nc-rail-item-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.nc-rail-item-menu {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    padding: 2px;
    border-radius: 3px;
    cursor: pointer;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.nc-rail-item-row:hover .nc-rail-item-menu {
    visibility: visible;
}

.nc-rail-item-menu:hover {
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.3);
    background: rgba(var(--primary-rgb), 0.1);
}

/* Vault items */
.nc-rail-vault-item {
    padding: 4px 10px 4px 15px;
    margin-bottom: 2px;
}

.nc-rail-vault-name {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--primary-cyan);
    display: block;
    padding: 2px 0;
}

.nc-rail-vault-chats {
    padding-left: 5px;
}

.nc-rail-vault-dragover {
    background: rgba(var(--primary-rgb), 0.08);
    border-radius: 4px;
}

.nc-rail-vault-input {
    margin: 2px 10px 2px 15px;
    padding: 4px 8px;
    width: calc(100% - 25px);
    background: rgba(var(--surface-alt-rgb), 0.8);
    border: 1px solid rgba(var(--primary-rgb), 0.4);
    border-radius: 4px;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    outline: none;
}

.nc-rail-vault-input:focus {
    border-color: var(--primary-cyan);
}

/* Session time-group section labels */
.nc-rail-section-label {
    font-family: var(--font-display);
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 6px 10px 2px 10px;
}

.nc-section-today {
    color: rgb(var(--accent-rgb));
}

.nc-section-recent {
    color: var(--primary-cyan);
}

.nc-section-archived {
    color: var(--accent-yellow);
}

/* Archived accordion */
.nc-rail-accordion {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: color 0.15s ease;
}

.nc-rail-accordion:hover {
    color: var(--text-main);
}

.nc-rail-accordion-caret {
    display: inline-flex;
    transition: transform 0.2s ease;
}

.nc-rail-accordion-open .nc-rail-accordion-caret {
    transform: rotate(0deg);
}

.nc-rail-accordion:not(.nc-rail-accordion-open) .nc-rail-accordion-caret {
    transform: rotate(-90deg);
}

/* Active chat highlight */
.nc-rail-item-active {
    background: rgba(var(--primary-rgb), 0.08);
    border-left: 2px solid var(--primary-cyan);
}

/* Empty state */
.nc-rail-empty {
    padding: 8px 12px;
    font-size: 0.72rem;
    color: var(--text-dim);
    opacity: 0.6;
}

/* Context menu (triple-dot dropdown) */
.nc-rail-ctx-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 20;
    min-width: 100px;
    background: rgba(var(--surface-alt-rgb), 0.95);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(var(--shadow-rgb), 0.4);
    padding: 4px 0;
    animation: fadeIn 0.1s ease;
}

.nc-rail-ctx-item {
    display: block;
    width: 100%;
    padding: 6px 14px;
    background: none;
    border: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s ease;
}

.nc-rail-ctx-item:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

/* Rename inline input */
.nc-rail-rename-input {
    flex: 1;
    padding: 5px 8px;
    background: rgba(var(--surface-alt-rgb), 0.8);
    border: 1px solid rgba(var(--primary-rgb), 0.4);
    border-radius: 4px;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    outline: none;
    min-width: 0;
}

.nc-rail-rename-input:focus {
    border-color: var(--primary-cyan);
}

.nc-rail-ctx-danger:hover {
    background: rgba(var(--danger-rgb), 0.1);
    color: var(--danger-red);
}

.nc-rail-ctx-active {
    color: var(--primary-cyan);
}

.nc-sessions-menu {
    right: 0;
    left: auto;
}

/* Footer: operator profile stub */
.nc-rail-foot {
    padding: 8px 8px 10px 8px;
    border-top: 1px solid rgba(var(--primary-rgb), 0.08);
    flex-shrink: 0;
}

.nc-rail-operator {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    cursor: pointer;
    background: transparent;
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    color: var(--text-main);
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: all 0.15s ease;
}

.nc-rail-operator:hover {
    background: rgba(var(--primary-rgb), 0.05);
    border-color: rgba(var(--primary-rgb), 0.3);
    color: var(--primary-cyan);
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.12);
}

.nc-rail-operator-av {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--primary-cyan);
    cursor: pointer;
    background:
        radial-gradient(circle at 30% 30%, rgba(var(--accent-rgb), 0.6), rgba(var(--primary-rgb), 0.2) 60%, transparent 100%);
    box-shadow: 0 0 6px rgba(var(--primary-rgb), 0.4), inset 0 0 4px rgba(var(--primary-rgb), 0.3);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    line-height: 1;
}

.nc-rail-operator-name {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Rail compact (icon-only) mode ── */
.nc-rail-compact {
    width: 48px;
    cursor: default;
    padding: 8px 0;
    align-items: stretch;
    justify-content: space-between;
    outline: none;
    user-select: none;
}

.nc-rail-compact:focus-visible {
    box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.5);
}

.nc-rail-compact-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-top: 2px;
}

.nc-rail-compact-top .nc-rail-mark {
    margin-bottom: 8px;
}

.nc-rail-compact-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 6px;
}

.nc-rail-compact-slot {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    border: 1px solid transparent;
    border-radius: 4px;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.nc-rail-compact:hover .nc-rail-compact-slot {
    color: rgba(var(--primary-rgb), 0.75);
}

.nc-rail-compact-slot:hover {
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.35);
    background: rgba(var(--primary-rgb), 0.08);
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.15);
}

.nc-rail-compact .nc-rail-operator-av {
    width: 24px;
    height: 24px;
}

/* ── Model deck (top bar of the chat surface) ── */
.nc-deck {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px 8px 16px;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.15);
    background: rgba(var(--surface-rgb), 0.45);
    min-height: 0;
}

.nc-deck-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    flex: 1;
}

.nc-deck-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.nc-deck-pick {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-main);
    padding: 4px 10px 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: all 0.15s ease;
    max-width: 100%;
    min-width: 0;
}

.nc-deck-pick:hover {
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.3);
    background: rgba(var(--primary-rgb), 0.05);
    text-shadow: 0 0 8px rgba(var(--primary-rgb), 0.4);
}

.nc-deck-pick[aria-expanded="true"] {
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.4);
    background: rgba(var(--primary-rgb), 0.08);
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.15);
}

.nc-deck-pick-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.nc-deck-pick-caret {
    display: inline-flex;
    align-items: center;
    color: var(--text-dim);
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.nc-deck-pick[aria-expanded="true"] .nc-deck-pick-caret {
    transform: rotate(180deg);
    color: var(--primary-cyan);
}

.nc-deck-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
    background: rgba(var(--surface-alt-rgb), 0.98);
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(var(--shadow-rgb), 0.6), 0 0 12px rgba(var(--primary-rgb), 0.18);
    padding: 4px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nc-deck-menu-item {
    display: block;
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-main);
    padding: 7px 12px;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.12s ease;
    white-space: nowrap;
}

.nc-deck-menu-item:hover {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: rgba(var(--primary-rgb), 0.28);
    color: var(--primary-cyan);
}

.nc-deck-menu-item-on {
    color: var(--primary-cyan);
    background: rgba(var(--primary-rgb), 0.05);
    border-color: rgba(var(--primary-rgb), 0.2);
}

.nc-deck-menu-item-on::before {
    content: '◆ ';
    color: var(--primary-cyan);
    font-size: 0.7rem;
    margin-right: 4px;
    vertical-align: middle;
}

.nc-deck-attach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(var(--primary-rgb), 0.18);
    color: var(--text-dim);
    padding: 3px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.nc-deck-attach:hover {
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.45);
    background: rgba(var(--primary-rgb), 0.08);
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.2);
}

.nc-deck-pin {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 2px 6px 0 6px;
    margin-top: 1px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-transform: lowercase;
    transition: color 0.15s ease, text-shadow 0.15s ease;
}

.nc-deck-pin:hover {
    color: var(--primary-cyan);
    text-shadow: 0 0 6px rgba(var(--primary-rgb), 0.35);
    text-decoration: underline dotted;
}

.nc-deck-pin-active {
    color: rgb(var(--accent-rgb));
}

.nc-deck-pin-active:hover {
    color: rgb(var(--accent-rgb));
    text-shadow: 0 0 6px rgba(var(--accent-rgb), 0.35);
}

.nc-deck-side {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nc-deck-initials {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(var(--accent-rgb), 0.25), rgba(var(--primary-rgb), 0.08) 60%, transparent 100%),
        rgba(var(--surface-alt-rgb), 0.9);
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
    border-radius: 50%;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.3), inset 0 0 6px rgba(var(--primary-rgb), 0.15);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.nc-deck-initials:hover {
    box-shadow: 0 0 14px rgba(var(--primary-rgb), 0.55), inset 0 0 8px rgba(var(--primary-rgb), 0.25);
    text-shadow: 0 0 6px rgba(var(--primary-rgb), 0.55);
    transform: scale(1.04);
}

/* ── Header target + logout ── */
.nc-header-target {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    white-space: nowrap;
    letter-spacing: 0.05em;
}

.nc-logout-btn {
    padding: 5px 14px;
    background: rgba(var(--hover-rgb), 0.1);
    border: 1px solid rgba(var(--hover-rgb), 0.4);
    border-radius: 4px;
    color: var(--accent-yellow);
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.nc-logout-btn:hover {
    background: rgba(var(--hover-rgb), 0.2);
    box-shadow: 0 0 12px rgba(var(--hover-rgb), 0.35);
    color: #ffb340;
}

[data-theme="standard"] .nc-logout-btn {
    background: rgba(209, 52, 56, 0.08);
    border-color: rgba(209, 52, 56, 0.3);
    color: #d13438;
}

[data-theme="standard"] .nc-logout-btn:hover {
    background: rgba(209, 52, 56, 0.15);
    box-shadow: none;
}

/* ── Session landing (empty-chat welcome view) ── */
.nc-landing {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    min-height: 0;
    overflow: auto;
    gap: 8px;
}

.nc-landing-hero {
    margin-bottom: 24px;
}

.nc-landing-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.nc-landing-badge {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--primary-cyan);
    border: 2px solid var(--primary-cyan);
    background:
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), rgba(var(--accent-rgb), 0.06)),
        rgba(var(--surface-rgb), 0.8);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.3), inset 0 0 12px rgba(var(--primary-rgb), 0.15);
    text-shadow: 0 0 8px rgba(var(--primary-rgb), 0.6);
    flex-shrink: 0;
}

.nc-landing-model {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-main);
    text-shadow: 0 0 12px rgba(var(--primary-rgb), 0.25);
    text-align: center;
    line-height: 1.2;
}

.nc-landing-tagline {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    text-align: center;
}

.nc-landing-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 90%;
    max-width: 90%;
    background: rgba(var(--surface-alt-rgb), 0.7);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    border-radius: 16px;
    padding: 10px 12px 10px 16px;
    box-shadow: 0 4px 20px rgba(var(--shadow-rgb), 0.4), 0 0 12px rgba(var(--primary-rgb), 0.08);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nc-landing-composer:focus-within {
    border-color: rgba(var(--primary-rgb), 0.5);
    box-shadow: 0 4px 24px rgba(var(--shadow-rgb), 0.5), 0 0 18px rgba(var(--primary-rgb), 0.15);
}

.nc-landing-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.4;
    resize: none;
    min-height: 24px;
    padding: 6px 0;
    overflow-y: hidden;
    cursor: text;
}

.nc-landing-input::placeholder {
    color: var(--text-dim);
    opacity: 0.6;
}

.nc-landing-dispatch {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: var(--primary-cyan);
    color: var(--bg-color);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.nc-landing-dispatch:hover {
    background: var(--primary-light);
    box-shadow: 0 0 14px rgba(var(--primary-rgb), 0.6);
    transform: scale(1.06);
}

.nc-landing-dispatch:active {
    transform: scale(0.96);
}

.nc-dispatch-cancel {
    background: rgba(var(--danger-rgb), 0.15);
    border: 1px solid rgba(var(--danger-rgb), 0.5);
    color: var(--danger-red);
    box-shadow: 0 0 10px rgba(var(--danger-rgb), 0.3), inset 0 0 6px rgba(var(--danger-rgb), 0.1);
}

.nc-dispatch-cancel:hover {
    background: rgba(var(--danger-rgb), 0.25);
    border-color: var(--danger-red);
    box-shadow: 0 0 18px rgba(var(--danger-rgb), 0.5), inset 0 0 10px rgba(var(--danger-rgb), 0.15);
    color: #fff;
}

.nc-landing-modes {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
    width: 90%;
}

/* ── Image attachment strip (above composer) ── */
.nc-image-strip {
    display: flex;
    gap: 8px;
    padding: 8px 5% 0;
    overflow-x: auto;
    overflow-y: visible;
    margin-bottom: 6px;
}

.nc-image-thumb-wrap {
    position: relative;
    flex-shrink: 0;
}

.nc-image-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(var(--primary-rgb), 0.25);
}

.nc-image-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(var(--danger-rgb), 0.85);
    color: #fff;
    border: none;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease;
}

.nc-image-remove:hover {
    background: var(--danger-red);
}

/* ── Attach button + drawer ── */
.nc-attach-wrap {
    position: relative;
    flex-shrink: 0;
}

.nc-attach-btn {
    background: transparent;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    color: var(--text-dim);
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.nc-attach-btn:hover {
    color: var(--accent-yellow);
    border-color: var(--accent-yellow);
    background: rgba(var(--hover-rgb), 0.08);
    box-shadow: 0 0 8px rgba(var(--hover-rgb), 0.2);
}

.nc-attach-drawer {
    position: absolute;
    bottom: 100%;
    left: -40px;
    margin-bottom: 8px;
    background: rgba(var(--surface-alt-rgb), 0.95);
    border: 2px solid var(--primary-cyan);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 0 16px rgba(var(--primary-rgb), 0.3), 0 8px 24px rgba(var(--shadow-rgb), 0.5);
    z-index: 10;
    min-width: 160px;
}

.nc-attach-option {
    display: block;
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 10px 18px;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    border-radius: 6px;
    transition: all 0.15s ease;
    letter-spacing: 0.5px;
}

.nc-attach-option:hover {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.25);
    text-shadow: 0 0 6px rgba(var(--primary-rgb), 0.3);
}

[data-theme="standard"] .nc-attach-drawer {
    background: #fff;
    border-color: #0078d4;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ── Images in user bubble ── */
.nc-bubble-images {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.nc-bubble-image {
    max-height: 160px;
    max-width: 240px;
    border-radius: 8px;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    object-fit: contain;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nc-bubble-image:hover {
    border-color: rgba(var(--primary-rgb), 0.4);
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.15);
}

/* ── Image viewer modal ── */
.nc-imgview-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

.nc-imgview-toolbar {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 10000;
}

.nc-imgview-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background 0.15s ease;
    padding: 0;
    font-family: var(--font-mono);
}

.nc-imgview-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.nc-imgview-btn-close {
    width: auto;
    padding: 0 14px;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
}

.nc-imgview-container {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    max-width: 95vw;
    max-height: 85vh;
}

.nc-imgview-img {
    transition: transform 0.15s ease;
    border-radius: 4px;
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
}

/* ── Chat control toggles (below composer) ── */
/* ── Avatar cropper ── */
.nc-avatar-cropper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.nc-avatar-cropper-empty {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nc-avatar-canvas {
    border-radius: 50%;
    border: 2px solid rgba(var(--primary-rgb), 0.2);
    box-shadow: 0 0 16px rgba(var(--primary-rgb), 0.1);
}

.nc-avatar-cropper-actions {
    display: flex;
    gap: 8px;
}

/* Avatar display in Account pane */
.nc-avatar-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
}

.nc-avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(var(--primary-rgb), 0.25);
    flex-shrink: 0;
}

.nc-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.08);
    border: 2px dashed rgba(var(--primary-rgb), 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 0.65rem;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.nc-avatar-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.nc-avatar-actions {
    display: flex;
    gap: 6px;
}

.nc-profile-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.nc-profile-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── SafeInput (validated text input) ── */
.nc-safe-input-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.nc-safe-input {
    background: rgba(var(--surface-rgb), 0.8);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 4px;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 5px 8px;
    width: 100%;
}

.nc-safe-input:focus {
    outline: 1px solid var(--primary-cyan);
    outline-offset: -1px;
}

.nc-safe-input-error {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--danger-red);
    margin-top: 2px;
    padding: 0 2px;
}

[data-theme="standard"] .nc-safe-input {
    background: #fff;
    border-color: rgba(0, 120, 212, 0.2);
}

/* Mode toggle icon/label visibility — desktop: labels, mobile: icons */
.mode-icon { display: none; }
.mode-label { display: inline; }
.nc-logout-icon { display: none; }
.nc-logout-label { display: inline; }
.nc-logout-btn { display: flex; align-items: center; gap: 4px; }

.chat-controls {
    background: transparent;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    color: var(--text-dim);
    padding: 5px 14px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.2s ease;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.chat-controls:hover {
    color: var(--accent-yellow);
    border-color: var(--accent-yellow);
    background: rgba(var(--hover-rgb), 0.08);
    box-shadow: 0 0 8px rgba(var(--hover-rgb), 0.2);
}

/* ── Lane layout ── */
.nc-lanes-single {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-height: 0;
}

.nc-lanes-split {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: 98%;
    min-height: 0;
}

.nc-lane {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    min-height: 0;
}

.nc-lanes-split .nc-lane {
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    border-radius: 8px;
    padding: 8px;
}

.nc-lane-promote-bar {
    display: flex;
    justify-content: flex-end;
    padding: 4px 0;
}

.nc-lane-promote-btn {
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    border-radius: 4px;
    color: rgb(var(--accent-rgb));
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.nc-lane-promote-btn:hover {
    background: rgba(var(--accent-rgb), 0.18);
}

.nc-lane-label {
    font-family: var(--font-display);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(var(--primary-rgb), 0.5);
    padding: 4px 8px;
    margin-bottom: 4px;
}

/* ── Chat message list ── */
.nc-landing-messages-wrap {
    flex: 1;
    width: 90%;
    position: relative;
    min-height: 0;
    overflow: visible;
}

.nc-landing-messages {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 12px 10px 12px 0;
}

.nc-scroll-arrow {
    position: absolute;
    right: -40px;
    bottom: 12px;
    pointer-events: auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--surface-alt-rgb), 0.85);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    border-radius: 50%;
    color: var(--primary-cyan);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(var(--shadow-rgb), 0.3);
    transition: background 0.15s ease, transform 0.15s ease;
    animation: fadeIn 0.15s ease;
}

.nc-scroll-arrow:hover {
    background: rgba(var(--primary-rgb), 0.15);
    transform: scale(1.1);
}

.nc-scroll-arrow-up {
    bottom: auto;
    top: 12px;
}

/* ── Turn rows + avatars ── */
.nc-turn-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.nc-turn-bubble-area {
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.nc-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 10px;
}

.nc-avatar-user {
    border-radius: 50%;
    border: 1.5px solid rgba(var(--primary-rgb), 0.4);
    color: var(--primary-cyan);
    background: rgba(var(--primary-rgb), 0.08);
    overflow: hidden;
}

.nc-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Inner avatar variants for embedding in buttons/spans */
.nc-deck-initials-inner,
.nc-rail-av-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--primary-cyan);
}

.nc-deck-initials-inner {
    width: 28px;
    height: 28px;
    font-size: 0.65rem;
}

.nc-rail-av-inner {
    width: 24px;
    height: 24px;
    font-size: 0.55rem;
}

.nc-avatar-agent {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: none;
    color: rgb(var(--accent-rgb));
    background: rgba(var(--accent-rgb), 0.12);
}

/* ── Chat bubble (user message) ── */
.nc-bubble {
    width: 100%;
    position: relative;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    animation: fadeIn 0.2s ease;
}

.nc-bubble-toggle {
    position: absolute;
    top: 8px;
    right: 10px;
    background: rgba(var(--surface-alt-rgb), 0.85);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    border-radius: 4px;
    color: var(--primary-cyan);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 2px 8px;
    cursor: pointer;
    z-index: 2;
    transition: background 0.15s ease, color 0.15s ease;
}

.nc-bubble-toggle:hover {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary-light);
}

.nc-bubble-content-wrap {
    position: relative;
    overflow: hidden;
}

.nc-bubble-content-wrap[data-collapsed] {
    max-height: calc(1.4em * 10);
}

.nc-bubble-content {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-word;
}

.nc-bubble-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(to bottom, transparent, rgba(var(--surface-alt-rgb), 0.95));
    pointer-events: none;
}

/* ── Model name label (above agent bubble) ── */
.nc-agent-icon-column {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-shrink: 0;
    width: 50px;
    padding-top: 2px;
}

.nc-model-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.nc-model-label-text {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: rgb(var(--accent-rgb));
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nc-model-icon {
    display: inline-block;
    flex-shrink: 0;
    background-color: rgb(var(--accent-rgb));
}

[data-theme="standard"] .nc-model-icon {
    background-color: rgb(var(--accent-rgb));
}

.nc-model-icon-hex {
    width: 22px;
    height: 22px;
    font-size: 0.55rem;
}

.nc-modifier-badges {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
}

.nc-modifier-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.nc-modifier-badge:hover {
    opacity: 1;
}

/* ── Agent bubble (response) ── */
.nc-bubble-agent {
    border-color: rgba(var(--accent-rgb), 0.15);
    background: rgba(var(--accent-rgb), 0.05);
}

.nc-bubble-agent-content {
    /* No height limit — full response visible without internal scroll */
}

.nc-bubble-cursor {
    display: inline-block;
    width: 7px;
    height: 1.1em;
    background: var(--primary-cyan);
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: pulse 0.8s ease-in-out infinite;
}

.nc-bubble-error {
    margin-top: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    color: var(--danger-red);
    border: 1px solid rgba(var(--danger-rgb), 0.3);
    border-radius: 6px;
    background: rgba(var(--danger-rgb), 0.06);
}

.nc-bubble-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(var(--primary-rgb), 0.1);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
}

.nc-bubble-stats span {
    margin-top: 3px;
}

/* ── Stats info popover ── */
.nc-stats-info-wrap {
    position: relative;
    display: inline-flex;
}

.nc-stats-info-btn {
    background: transparent;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-dim);
    padding: 0;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.nc-stats-info-btn:hover {
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.4);
}

.nc-stats-popover {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: rgba(var(--surface-alt-rgb), 0.98);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 200px;
    box-shadow: 0 4px 16px rgba(var(--shadow-rgb), 0.4);
    z-index: 20;
    animation: fadeIn 0.1s ease;
}

.nc-stats-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 3px 0;
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.nc-stats-label {
    color: var(--text-dim);
    white-space: nowrap;
}

.nc-stats-value {
    color: var(--text-main);
    text-align: right;
    white-space: nowrap;
}

/* ── Locate popover ── */
.nc-locate-popover {
    position: fixed;
    width: 340px;
    max-height: 420px;
    background: rgba(var(--surface-alt-rgb), 0.98);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(var(--shadow-rgb), 0.6);
    display: flex;
    flex-direction: column;
    z-index: 200;
    animation: fadeIn 0.1s ease;
    backdrop-filter: blur(8px);
}

.nc-locate-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.12);
}

.nc-locate-input {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 4px;
    padding: 6px 10px;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    outline: none;
}

.nc-locate-input:focus {
    border-color: rgba(var(--primary-rgb), 0.5);
}

.nc-locate-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 3px;
    transition: color 0.15s ease, background 0.15s ease;
}

.nc-locate-close:hover {
    color: var(--primary-cyan);
    background: rgba(var(--primary-rgb), 0.1);
}

.nc-locate-results {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.nc-locate-status {
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
}

.nc-locate-result {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 6px 14px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s ease;
}

.nc-locate-result:hover {
    background: rgba(var(--primary-rgb), 0.08);
}

.nc-locate-result-title {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nc-locate-result-date {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-dim);
}

/* ── Chat bubble action bar ── */
.nc-bubble-bar {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(var(--primary-rgb), 0.1);
    flex-wrap: wrap;
}

.nc-bubble-btn {
    background: transparent;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 4px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    padding: 3px 10px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.nc-bubble-btn:hover {
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.3);
    background: rgba(var(--primary-rgb), 0.06);
}

.nc-bubble-btn-stub {
    opacity: 0.4;
    cursor: default;
}

.nc-bubble-btn-stub:hover {
    color: var(--text-dim);
    border-color: rgba(var(--primary-rgb), 0.15);
    background: transparent;
}

.nc-bubble-btn-danger {
    color: var(--text-dim);
}

.nc-bubble-btn-danger:hover {
    color: var(--danger-red);
    border-color: rgba(var(--danger-rgb), 0.3);
    background: rgba(var(--danger-rgb), 0.06);
}

.nc-btn-primary {
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.4);
}

.nc-btn-primary:hover {
    background: rgba(var(--primary-rgb), 0.12);
}

/* ── Chat bubble inline edit ── */
.nc-bubble-edit-wrap {
    margin: 6px;
}

.nc-bubble-edit {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.4;
    resize: none;
    outline: none;
}

.nc-bubble-edit:focus {
    border-color: rgba(var(--primary-rgb), 0.5);
}

.nc-bubble-edit-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 6px;
}

/* ── Code blocks (agent response) ── */
.nc-code-block {
    margin: 8px 0;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(var(--surface-rgb), 0.9);
}

.nc-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px;
    background: rgba(var(--primary-rgb), 0.06);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.1);
}

.nc-code-lang {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-dim);
    text-transform: lowercase;
}

.nc-code-actions {
    display: flex;
    gap: 6px;
}

.nc-code-btn {
    background: transparent;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 4px;
    color: var(--primary-cyan);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 2px 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.nc-code-btn:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

.nc-code-content {
    margin: 0;
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-main);
    white-space: pre;
    overflow-x: auto;
}

.nc-code-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 4px 10px;
    background: rgba(var(--primary-rgb), 0.06);
    border-top: 1px solid rgba(var(--primary-rgb), 0.1);
}

.nc-code-hidden {
    opacity: 0.7;
}

/* ── Download banners (below agent response) ── */
.nc-download-banners {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(var(--primary-rgb), 0.1);
}

.nc-download-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    background: rgba(var(--primary-rgb), 0.04);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 8px;
    color: var(--primary-cyan);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.nc-download-banner:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.nc-download-all {
    background: rgba(var(--accent-rgb), 0.06);
    border-color: rgba(var(--accent-rgb), 0.2);
    color: rgb(var(--accent-rgb));
}

.nc-download-all:hover {
    background: rgba(var(--accent-rgb), 0.12);
    border-color: rgba(var(--accent-rgb), 0.35);
}

/* ── Thinking toggle (collapsed reasoning) ── */
.nc-thinking-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    margin-bottom: 6px;
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    border-radius: 6px;
    background: rgba(var(--accent-rgb), 0.06);
    color: rgba(var(--accent-rgb), 1);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.2s ease;
}

.nc-thinking-toggle:hover {
    background: rgba(var(--accent-rgb), 0.12);
}

.nc-thinking-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(var(--accent-rgb), 0.15),
        transparent
    );
    animation: thinkShimmer 2.5s ease-in-out infinite;
}

.nc-thinking-toggle .nc-thinking-caret {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 0.7rem;
}

.nc-thinking-toggle[data-expanded] .nc-thinking-caret {
    transform: rotate(90deg);
}

.nc-thinking-content {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-left: 2px solid rgba(var(--accent-rgb), 0.25);
    color: var(--text-dim);
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.nc-thinking-standby {
    padding: 8px 14px;
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    border-radius: 6px;
    background: rgba(var(--primary-rgb), 0.03);
    animation: pulse 2s ease-in-out infinite;
    text-align: center;
    letter-spacing: 0.5px;
}

@keyframes thinkShimmer {
    0%   { left: -100%; }
    50%  { left: 100%; }
    100% { left: 100%; }
}

/* ── Status indicator (agentic SSE events) ── */
.nc-status-indicator {
    margin-bottom: 6px;
}

.nc-status-latest {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 4px 8px;
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    border-radius: 6px;
    background: rgba(var(--accent-rgb), 0.04);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: rgb(var(--accent-rgb));
    transition: background 0.2s ease;
    position: relative;
    overflow: hidden;
}

.nc-status-latest:hover {
    background: rgba(var(--accent-rgb), 0.1);
}

.nc-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nc-status-dot-active {
    background: rgb(var(--accent-rgb));
    box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.6);
    animation: statusPulse 1.5s ease-in-out infinite;
}

.nc-status-dot-done {
    background: rgba(var(--text-dim-rgb), 0.4);
}

.nc-status-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.nc-status-shimmer {
    background: linear-gradient(
        90deg,
        rgb(var(--accent-rgb)) 0%,
        rgba(var(--primary-rgb), 1) 50%,
        rgb(var(--accent-rgb)) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: statusShimmer 2s ease-in-out infinite;
}

.nc-status-caret {
    font-size: 0.55rem;
    color: rgba(var(--text-dim-rgb), 0.5);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.nc-status-caret[data-expanded] {
    transform: rotate(90deg);
}

.nc-status-history {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    padding-left: 4px;
    border-left: 1px solid rgba(var(--accent-rgb), 0.15);
    margin-left: 7px;
}

.nc-status-history-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: rgba(var(--text-dim-rgb), 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes statusShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* ── Preferences overlay (modal) ── */
.nc-prefs-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--shadow-rgb), 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.15s ease;
}

.nc-prefs-shell {
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 820px;
    max-height: 80vh;
    background: var(--bg-panel);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(var(--shadow-rgb), 0.5), 0 0 20px rgba(var(--primary-rgb), 0.1);
    overflow: hidden;
}

.nc-prefs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px 18px;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.12);
    flex-shrink: 0;
}

.nc-prefs-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-main);
}

.nc-prefs-dismiss {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.nc-prefs-dismiss:hover {
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.3);
    background: rgba(var(--primary-rgb), 0.06);
}

.nc-prefs-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.nc-prefs-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 200px;
    flex-shrink: 0;
    padding: 10px 8px;
    border-right: 1px solid rgba(var(--primary-rgb), 0.1);
    overflow-y: auto;
}

.nc-prefs-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    padding: 7px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: left;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.nc-prefs-tab:hover {
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.2);
    background: rgba(var(--primary-rgb), 0.04);
}

.nc-prefs-tab-on {
    color: var(--primary-cyan);
    border-color: rgba(var(--primary-rgb), 0.3);
    background: rgba(var(--primary-rgb), 0.08);
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.1);
}

.nc-prefs-tab-label {
    flex: 1;
}

.nc-prefs-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    min-height: 0;
}

.nc-prefs-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    gap: 8px;
}

.nc-prefs-placeholder-key {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--primary-cyan);
}

.nc-prefs-placeholder-hint {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ── Prefs: Data Controls ── */
.nc-prefs-section-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-main);
    margin-bottom: 16px;
}

.nc-prefs-data-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.08);
}

.nc-prefs-data-label {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-main);
}

.nc-prefs-data-btn {
    padding: 5px 16px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.nc-prefs-data-btn-danger {
    background: rgba(var(--danger-rgb), 0.1);
    border: 1px solid rgba(var(--danger-rgb), 0.3);
    color: var(--danger-red);
}

.nc-prefs-data-btn-danger:hover {
    background: rgba(var(--danger-rgb), 0.2);
}

/* Confirm dialog overlay (inside prefs) */
.nc-prefs-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--shadow-rgb), 0.5);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.1s ease;
}

.nc-prefs-confirm-dialog {
    background: rgba(var(--surface-alt-rgb), 0.98);
    border: 1px solid rgba(var(--danger-rgb), 0.3);
    border-radius: 10px;
    padding: 24px 28px;
    max-width: 360px;
    box-shadow: 0 8px 24px rgba(var(--shadow-rgb), 0.5);
}

.nc-prefs-confirm-text {
    margin: 0 0 6px 0;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--danger-red);
}

.nc-prefs-confirm-sub {
    margin: 0 0 20px 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.nc-prefs-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.nc-prefs-confirm-btn {
    padding: 6px 20px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.nc-prefs-confirm-cancel {
    background: rgba(var(--hover-rgb), 0.1);
    border: 1px solid rgba(var(--hover-rgb), 0.35);
    color: var(--accent-yellow);
}

.nc-prefs-confirm-cancel:hover {
    background: rgba(var(--hover-rgb), 0.2);
}

.nc-prefs-confirm-delete {
    background: rgba(var(--danger-rgb), 0.15);
    border: 1px solid rgba(var(--danger-rgb), 0.4);
    color: var(--danger-red);
}

.nc-prefs-confirm-delete:hover {
    background: rgba(var(--danger-rgb), 0.3);
}

/* ── Toggle slider ── */
.nc-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    background: rgba(var(--text-dim-rgb), 0.25);
    border: 1px solid rgba(var(--text-dim-rgb), 0.3);
    border-radius: 11px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nc-toggle:hover {
    border-color: rgba(var(--primary-rgb), 0.4);
}

.nc-toggle-on {
    background: rgba(var(--primary-rgb), 0.25);
    border-color: rgba(var(--primary-rgb), 0.6);
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.2);
}

.nc-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-dim);
    transition: transform 0.2s ease, background 0.2s ease;
}

.nc-toggle-on .nc-toggle-knob {
    transform: translateX(18px);
    background: var(--primary-cyan);
}

/* ── Setting row ── */
.nc-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.06);
}

.nc-setting-label {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
}

/* ── Prefs pane (real content container) ── */
.nc-prefs-pane {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ── About pane ── */
.nc-about-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    padding: 8px 0;
}

.nc-about-label {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nc-about-value {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-main);
}

/* ── Setting dropdown row (reusable) ── */
.nc-setting-dropdown-row {
    flex-wrap: wrap;
}

.nc-setting-dropdown-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nc-setting-select {
    background: rgba(var(--surface-rgb), 0.8);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 4px;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 4px 8px;
    min-width: 200px;
    cursor: pointer;
}

.nc-setting-select:focus {
    outline: 1px solid var(--primary-cyan);
    outline-offset: -1px;
}

.nc-setting-action-btn {
    padding: 4px 14px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease;
    background: rgba(var(--primary-rgb), 0.1);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    color: var(--primary-cyan);
}

.nc-setting-action-btn:hover:not(:disabled) {
    background: rgba(var(--primary-rgb), 0.2);
}

.nc-setting-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Standard theme */
[data-theme="standard"] .nc-setting-select {
    background: #fff;
    border-color: rgba(0, 120, 212, 0.2);
}

[data-theme="standard"] .nc-setting-action-btn {
    background: rgba(0, 120, 212, 0.08);
    border-color: rgba(0, 120, 212, 0.2);
}

/* ── SecretField (reusable masked input) ── */
.nc-secret-field {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nc-secret-input {
    flex: 1;
    background: rgba(var(--surface-rgb), 0.8);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 4px;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 5px 8px;
    min-width: 0;
}

.nc-secret-input:focus {
    outline: 1px solid var(--primary-cyan);
    outline-offset: -1px;
}

.nc-secret-btn {
    background: transparent;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 4px;
    color: var(--text-dim);
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.nc-secret-btn:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-cyan);
}

/* ── KeyPairRow (reusable key-value pair) ── */
.nc-keypair-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.06);
}

.nc-keypair-name {
    width: 120px;
    flex-shrink: 0;
}

.nc-keypair-name-text {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-main);
    cursor: default;
    display: block;
    padding: 4px 0;
}

.nc-keypair-name-input {
    width: 100%;
    background: rgba(var(--surface-rgb), 0.8);
    border: 1px solid var(--primary-cyan);
    border-radius: 4px;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 3px 6px;
}

.nc-keypair-value {
    flex: 1;
    min-width: 0;
}

.nc-keypair-value-input {
    width: 100%;
    background: rgba(var(--surface-rgb), 0.8);
    border: 1px solid var(--primary-cyan);
    border-radius: 4px;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 5px 8px;
}

.nc-keypair-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.nc-keypair-btn {
    background: transparent;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 4px;
    color: var(--text-dim);
    padding: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.nc-keypair-btn:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-cyan);
}

.nc-keypair-btn-danger:hover {
    background: rgba(var(--danger-rgb), 0.15);
    color: var(--danger-red);
}

/* ── Account pane ── */
.nc-account-section {
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    border-radius: 8px;
    padding: 14px 16px;
    background: rgba(var(--surface-rgb), 0.5);
}

.nc-account-section-header {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--primary-cyan);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.1);
}

[data-theme="standard"] .nc-account-section {
    background: #f8f9fb;
    border-color: rgba(0, 120, 212, 0.12);
}

.nc-account-authkey {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
}

.nc-account-gen-btn {
    align-self: flex-start;
}

.nc-account-authkey-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.nc-account-expires {
    color: var(--text-dim);
}

.nc-account-expired {
    color: var(--danger-red);
    font-weight: 600;
}

.nc-account-no-key {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-dim);
    padding: 4px 0;
}

.nc-account-add-key {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 0 4px;
    margin-top: 4px;
    border-top: 1px solid rgba(var(--primary-rgb), 0.08);
}

.nc-account-add-key .nc-setting-select {
    flex: 1;
    min-width: 0;
}

/* Standard theme overrides */
[data-theme="standard"] .nc-secret-input,
[data-theme="standard"] .nc-keypair-name-input,
[data-theme="standard"] .nc-keypair-value-input {
    background: #fff;
    border-color: rgba(0, 120, 212, 0.2);
}

/* Per-mode active colors — Thinking: cyan, Concise: amber, Agentic: violet, Coding: green */
.chat-controls.active[data-mode="thinking"] {
    background: linear-gradient(135deg, rgba(0, 200, 220, 0.15), rgba(0, 200, 220, 0.05));
    color: #00d4e6;
    border-color: #00d4e6;
    box-shadow: 0 0 12px rgba(0, 200, 220, 0.2), inset 0 0 8px rgba(0, 200, 220, 0.06);
    text-shadow: 0 0 6px rgba(0, 200, 220, 0.4);
}

.chat-controls.active[data-mode="concise"] {
    background: linear-gradient(135deg, rgba(240, 180, 40, 0.15), rgba(240, 180, 40, 0.05));
    color: #f0b428;
    border-color: #f0b428;
    box-shadow: 0 0 12px rgba(240, 180, 40, 0.2), inset 0 0 8px rgba(240, 180, 40, 0.06);
    text-shadow: 0 0 6px rgba(240, 180, 40, 0.4);
}

.chat-controls.active[data-mode="agentic"] {
    background: linear-gradient(135deg, rgba(160, 100, 240, 0.15), rgba(160, 100, 240, 0.05));
    color: #a064f0;
    border-color: #a064f0;
    box-shadow: 0 0 12px rgba(160, 100, 240, 0.2), inset 0 0 8px rgba(160, 100, 240, 0.06);
    text-shadow: 0 0 6px rgba(160, 100, 240, 0.4);
}

.chat-controls.active[data-mode="coding"] {
    background: linear-gradient(135deg, rgba(60, 200, 100, 0.15), rgba(60, 200, 100, 0.05));
    color: #3cc864;
    border-color: #3cc864;
    box-shadow: 0 0 12px rgba(60, 200, 100, 0.2), inset 0 0 8px rgba(60, 200, 100, 0.06);
    text-shadow: 0 0 6px rgba(60, 200, 100, 0.4);
}

/* ── Login page ── */
.nc-login-page {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0f;
    z-index: 1000;
}

.nc-login-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.nc-login-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 340px;
    padding: 32px 28px;
    background: rgba(12, 12, 18, 0.85);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(59, 130, 246, 0.1);
    backdrop-filter: blur(12px);
}

.nc-login-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 3px;
    text-align: center;
    color: #3b82f6;
    text-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.nc-login-subtitle {
    margin: 0 0 8px 0;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-align: center;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.nc-login-error {
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #f87171;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-align: center;
}

.nc-login-input {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    color: #f1f5f9;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.nc-login-input:focus {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.15);
}

.nc-login-input::placeholder {
    color: #64748b;
}

/* Override browser autofill background — force dark with light text. */
.nc-login-input:-webkit-autofill,
.nc-login-input:-webkit-autofill:hover,
.nc-login-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 40px #131320 inset !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    caret-color: #e2e8f0;
}

[data-theme="standard"] .nc-login-input:-webkit-autofill,
[data-theme="standard"] .nc-login-input:-webkit-autofill:hover,
[data-theme="standard"] .nc-login-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 40px #f5f7fa inset !important;
    -webkit-text-fill-color: #201f1e !important;
    border-color: rgba(0, 120, 212, 0.3) !important;
    caret-color: #201f1e;
}

.nc-login-submit {
    padding: 10px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 6px;
    color: #3b82f6;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.nc-login-submit:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.25);
    box-shadow: 0 0 14px rgba(59, 130, 246, 0.3);
}

.nc-login-submit:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Standard theme login overrides */
[data-theme="standard"] .nc-login-page {
    background: #f3f3f3;
}

[data-theme="standard"] .nc-login-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 120, 212, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="standard"] .nc-login-title {
    color: #0078d4;
    text-shadow: none;
}

[data-theme="standard"] .nc-login-subtitle {
    color: #605e5c;
}

[data-theme="standard"] .nc-login-input {
    background: #ffffff;
    border-color: rgba(0, 120, 212, 0.2);
    color: #201f1e;
}

[data-theme="standard"] .nc-login-input::placeholder {
    color: #a19f9d;
}

[data-theme="standard"] .nc-login-submit {
    background: #0078d4;
    border-color: #0078d4;
    color: #ffffff;
}

[data-theme="standard"] .nc-login-submit:hover:not(:disabled) {
    background: #106ebe;
}

/* ══════════════════════════════════════════════
   Standard (light) theme overrides
   Gradients + stronger bubble colors to break
   up the white and add visual warmth.
   ══════��═════════════════════════��═════════════ */

/* Kill the neon glow on the title in standard theme */
[data-theme="standard"] .nc-title {
    text-shadow: none;
    color: #0078d4;
}

[data-theme="standard"] .nc-header {
    background: linear-gradient(135deg, #f0f4f8, #e8eef5, #f0f4f8);
    border-bottom-color: rgba(0, 120, 212, 0.12);
}

/* Darker chat area background — less blinding white */
[data-theme="standard"] .nc-landing {
    background: #e4e8ed;
}

[data-theme="standard"] .nc-lane {
    background: #e4e8ed;
}

[data-theme="standard"] .nc-rail {
    background: linear-gradient(180deg, #eef2f7 0%, #f5f7fa 40%, #f0f3f7 100%);
    border-right-color: rgba(0, 120, 212, 0.1);
}

[data-theme="standard"] .nc-rail-head {
    background: rgba(0, 120, 212, 0.04);
}

[data-theme="standard"] .nc-rail-foot {
    background: rgba(0, 120, 212, 0.03);
}

/* User bubbles — soft blue tint */
[data-theme="standard"] .nc-bubble {
    background: #e8f0fe;
    border-color: rgba(0, 120, 212, 0.18);
}

[data-theme="standard"] .nc-model-label-text {
    color: rgb(var(--accent-rgb));
}

/* Agent bubbles — stronger teal-gray, punchy against darker background */
[data-theme="standard"] .nc-bubble-agent {
    background: #d8eded;
    border-color: rgba(0, 131, 143, 0.3);
}

/* Code blocks — slightly off-white for contrast */
[data-theme="standard"] .nc-code-block {
    background: #fafbfc;
    border-color: rgba(0, 120, 212, 0.12);
}

[data-theme="standard"] .nc-code-header,
[data-theme="standard"] .nc-code-footer {
    background: #f0f2f5;
}

/* Composer — subtle shadow in light mode */
[data-theme="standard"] .nc-landing-composer {
    background: #ffffff;
    border-color: rgba(0, 120, 212, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Thinking toggle */
[data-theme="standard"] .nc-thinking-toggle {
    background: #f0f7f7;
    border-color: rgba(0, 151, 167, 0.2);
    color: #0097a7;
}

[data-theme="standard"] .nc-thinking-toggle::before {
    background: linear-gradient(90deg, transparent, rgba(0, 151, 167, 0.1), transparent);
}

/* ── Prose (rendered markdown in agent bubbles) ── */
.nc-prose {
    white-space: normal;
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.nc-prose p {
    margin: 0 0 0.6em 0;
}
.nc-prose p:last-child {
    margin-bottom: 0;
}

.nc-prose h1, .nc-prose h2, .nc-prose h3,
.nc-prose h4, .nc-prose h5, .nc-prose h6 {
    color: var(--primary-cyan);
    font-weight: 700;
    margin: 0.8em 0 0.4em 0;
    line-height: 1.3;
}
.nc-prose h1 { font-size: 1.3em; }
.nc-prose h2 { font-size: 1.15em; }
.nc-prose h3 { font-size: 1.05em; }
.nc-prose h4 { font-size: 1.0em; }
.nc-prose h5 { font-size: 0.95em; }
.nc-prose h6 { font-size: 0.95em; }
.nc-prose h1:first-child, .nc-prose h2:first-child,
.nc-prose h3:first-child, .nc-prose h4:first-child,
.nc-prose h5:first-child, .nc-prose h6:first-child {
    margin-top: 0;
}

.nc-prose strong {
    font-weight: 700;
}

.nc-prose em {
    font-style: italic;
    color: var(--text-dim);
}

.nc-prose a {
    color: var(--primary-cyan);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.3);
    transition: border-color 0.2s;
}
.nc-prose a:hover {
    border-bottom-color: var(--primary-cyan);
}

/* Inline code — NOT fenced blocks (those go through CodeBlock) */
.nc-prose code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 3px;
    padding: 0.15em 0.35em;
}

.nc-prose ul, .nc-prose ol {
    padding-left: 1.6em;
    margin: 0.4em 0;
}
.nc-prose li {
    margin-bottom: 0.25em;
}
.nc-prose li:last-child {
    margin-bottom: 0;
}

.nc-prose blockquote {
    border-left: 3px solid rgba(var(--primary-rgb), 0.4);
    background: rgba(var(--primary-rgb), 0.04);
    margin: 0.5em 0;
    padding: 0.4em 0.8em;
}
.nc-prose blockquote p:last-child {
    margin-bottom: 0;
}

.nc-prose hr {
    border: none;
    border-top: 1px solid rgba(var(--primary-rgb), 0.2);
    margin: 0.8em 0;
}

.nc-prose table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.5em 0;
    font-size: 0.92em;
}
.nc-prose th, .nc-prose td {
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    padding: 0.35em 0.6em;
    text-align: left;
}
.nc-prose th {
    background: rgba(var(--primary-rgb), 0.1);
    font-weight: 700;
    color: var(--primary-cyan);
}

/* LaTeX math blocks — centered with horizontal scroll for wide formulas */
.nc-math-block {
    text-align: center;
    overflow-x: auto;
    margin: 0.6em 0;
    padding: 0.3em 0;
}

.nc-math-error {
    color: var(--danger-red, #ff003c);
    font-size: 0.85em;
}

/* ── Standard theme overrides for prose ── */
[data-theme="standard"] .nc-prose h1,
[data-theme="standard"] .nc-prose h2,
[data-theme="standard"] .nc-prose h3,
[data-theme="standard"] .nc-prose h4,
[data-theme="standard"] .nc-prose h5,
[data-theme="standard"] .nc-prose h6 {
    color: #0078d4;
}

[data-theme="standard"] .nc-prose a {
    color: #0078d4;
    border-bottom-color: rgba(0, 120, 212, 0.3);
}
[data-theme="standard"] .nc-prose a:hover {
    border-bottom-color: #0078d4;
}

[data-theme="standard"] .nc-prose code {
    background: rgba(0, 120, 212, 0.06);
    border-color: rgba(0, 120, 212, 0.12);
}

[data-theme="standard"] .nc-prose th {
    background: rgba(0, 120, 212, 0.08);
    color: #0078d4;
}

[data-theme="standard"] .nc-prose blockquote {
    border-left-color: rgba(0, 120, 212, 0.35);
    background: rgba(0, 120, 212, 0.03);
}

[data-theme="standard"] .nc-prose em {
    color: #555;
}

/* ── Mermaid diagram viewer ── */
.nc-mermaid-block {
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 6px;
    overflow: hidden;
    margin: 0.4em 0;
}

.nc-mermaid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: rgba(var(--primary-rgb), 0.06);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.15);
}

.nc-mermaid-viewport {
    overflow: hidden;
    min-height: 120px;
    max-height: 600px;
    position: relative;
    background: rgba(var(--surface-rgb), 0.5);
    user-select: none;
}

.nc-mermaid-canvas {
    transform-origin: 0 0;
    display: flex;
    justify-content: center;
    padding: 16px;
}

.nc-mermaid-canvas svg {
    max-width: 100%;
    height: auto;
}

/* Standard theme */
[data-theme="standard"] .nc-mermaid-block {
    border-color: rgba(0, 120, 212, 0.15);
}
[data-theme="standard"] .nc-mermaid-toolbar {
    background: #f0f2f5;
    border-bottom-color: rgba(0, 120, 212, 0.12);
}
[data-theme="standard"] .nc-mermaid-viewport {
    background: #fafbfc;
}

/* ── Live HTML preview ── */
.nc-live-preview {
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 8px;
    overflow: hidden;
    margin: 8px 0;
}

.nc-lp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px;
    background: rgba(var(--primary-rgb), 0.06);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.15);
}

.nc-lp-viewport {
    position: relative;
    width: 100%;
    height: 420px;
    background: #fff;
}

.nc-lp-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Fullsize overlay — covers the entire webui window */
.nc-lp-fullsize-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    background: var(--bg-main, #0a0e14);
}

.nc-lp-fullsize-overlay .nc-lp-toolbar {
    flex-shrink: 0;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.2);
}

.nc-lp-fullsize-body {
    flex: 1;
    min-height: 0;
    background: #fff;
}

.nc-lp-fullsize-body .nc-lp-frame {
    width: 100%;
    height: 100%;
}

/* Standard (light) theme */
[data-theme="standard"] .nc-live-preview {
    border-color: rgba(0, 120, 212, 0.15);
}
[data-theme="standard"] .nc-lp-toolbar {
    background: #f0f2f5;
    border-bottom-color: rgba(0, 120, 212, 0.12);
}
[data-theme="standard"] .nc-lp-fullsize-overlay {
    background: #f5f6f8;
}

/* ── Scratchpad popover ── */
.nc-scratchpad-popover {
    min-width: 240px;
}

.nc-scratchpad-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--primary-cyan);
    flex: 1;
}

.nc-scratchpad-add {
    background: none;
    border: none;
    color: var(--primary-cyan);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.nc-scratchpad-add:hover {
    opacity: 1;
}

/* ── Scratchpad modal ── */
.nc-scratchpad-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nc-scratchpad-modal {
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
    background: var(--bg-panel, rgba(18, 18, 26, 0.95));
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nc-scratchpad-modal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.15);
    flex-shrink: 0;
}

.nc-scratchpad-modal-title {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    outline: none;
    padding: 4px 0;
}
.nc-scratchpad-modal-title::placeholder {
    color: var(--text-dim);
    opacity: 0.5;
}

.nc-scratchpad-modal-content {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 12px 16px;
    resize: none;
    outline: none;
    overflow-y: auto;
}
.nc-scratchpad-modal-content::placeholder {
    color: var(--text-dim);
    opacity: 0.4;
}

.nc-scratchpad-modal-preview {
    flex: 1;
    padding: 12px 16px;
    overflow-y: auto;
    color: var(--text-main);
}

.nc-scratchpad-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid rgba(var(--primary-rgb), 0.15);
    flex-shrink: 0;
}

.nc-scratchpad-save {
    color: var(--primary-cyan) !important;
    font-weight: 700 !important;
}

.nc-scratchpad-delete {
    color: var(--danger-red, #ff003c) !important;
}

.nc-code-btn.active {
    color: var(--primary-cyan);
    background: rgba(var(--primary-rgb), 0.15);
}

/* Standard theme overrides */
[data-theme="standard"] .nc-scratchpad-modal {
    background: #ffffff;
    border-color: rgba(0, 120, 212, 0.2);
}
[data-theme="standard"] .nc-scratchpad-modal-header,
[data-theme="standard"] .nc-scratchpad-modal-footer {
    border-color: rgba(0, 120, 212, 0.12);
}
[data-theme="standard"] .nc-scratchpad-title {
    color: #0078d4;
}
[data-theme="standard"] .nc-scratchpad-add {
    color: #0078d4;
}
[data-theme="standard"] .nc-scratchpad-save {
    color: #0078d4 !important;
}
[data-theme="standard"] .nc-scratchpad-delete {
    color: #d13438 !important;
}

/* ── Range slider (Interface pane) ── */
.nc-range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 160px;
    height: 6px;
    border-radius: 3px;
    background: rgba(var(--primary-rgb), 0.18);
    outline: none;
    cursor: pointer;
}
.nc-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-cyan);
    border: none;
    box-shadow: 0 0 6px rgba(var(--primary-rgb), 0.4);
    cursor: pointer;
}
.nc-range-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-cyan);
    border: none;
    box-shadow: 0 0 6px rgba(var(--primary-rgb), 0.4);
    cursor: pointer;
}
.nc-range-slider:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── Custom Theme Editor ── */
.nc-custom-theme-editor {
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    max-height: 50vh;
    overflow-y: auto;
}
.nc-theme-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}
.nc-theme-var-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.06);
}
.nc-theme-var-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
}
.nc-theme-var-row input[type="color"] {
    width: 36px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
}
.nc-theme-text-input {
    max-width: 180px;
    font-size: 0.7rem !important;
}
.nc-theme-rgba-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nc-opacity-slider {
    width: 80px !important;
}
.nc-theme-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(var(--primary-rgb), 0.12);
}
.nc-interface-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}
.nc-interface-row label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-main);
}
.nc-interface-row .nc-range-value {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
    min-width: 48px;
    text-align: right;
}
