/* The existing ns-gp and ns-gp-ag scopes own the palette and theme selection. */
.ns-polish-2 {
    color: var(--ns-text);
    background: var(--ns-bg);
    font-family: var(--ns-font);
    min-width: 0;
}
.ns-polish-2 :is(h1, h2, h3, h4, button, input, select, textarea) { font-family: var(--ns-font); }
.ns-polish-2 :is(h1, h2, h3, h4) { color: var(--ns-text); }
.ns-polish-2 :is(input, select, textarea) { color: var(--ns-text); }
.ns-polish-2 :is(input, select, textarea)::placeholder { color: var(--ns-text-2); opacity: 1; }
.ns-polish-2 :is(button, a, input, select, textarea):focus-visible {
    outline: 2px solid var(--ns-gold-light);
    outline-offset: 3px;
}
.ns-polish-2 .directory-hero h1 { background: none; color: var(--ns-text); -webkit-text-fill-color: var(--ns-text); }
.ns-polish-2 .ns-voice-btn-primary { background: var(--ns-gold); color: var(--ns-on-accent); }
.ns-polish-2 .ns-voice-step-index { color: var(--ns-on-accent); }
.ns-polish-2 .ns-voice-step-dot:not(.is-active):not(.is-complete) .ns-voice-step-index { color: var(--ns-text); }
.ns-polish-2 .ns-draft-list li { background: var(--ns-card); }
@media (max-width: 575.98px) {
    .ns-polish-2 .ns-draft-bar button { width: 100%; }
    .ns-polish-2 .ns-draft-bar form { flex: 1 1 100%; }
}

/* Reconnect the names read by the existing design system and editor. */
.ns-polish-2, .ns-polish-2 .ea-edit-agent {
    --ns-bg-primary: var(--ns-bg);
    --ns-bg-secondary: var(--ns-surface);
    --ns-bg-tertiary: var(--ns-elevated);
    --ns-bg-elevated: var(--ns-card);
    --ns-bg-surface: var(--ns-card);
    --ns-text-primary: var(--ns-text);
    --ns-text-secondary: var(--ns-text-2);
    --ns-text-muted: var(--ns-text-2);
    --ns-border-primary: var(--ns-border-strong);
    --ns-border-subtle: var(--ns-border);
    --ns-accent: var(--ns-gold);
    --ns-accent-hover: var(--ns-gold-deep);
    --ns-accent-text: var(--ns-on-accent);
    --ea-bg-primary: var(--ns-bg);
    --ea-bg-secondary: var(--ns-card);
    --ea-bg-tertiary: var(--ns-surface);
    --ea-text-primary: var(--ns-text);
    --ea-text-secondary: var(--ns-text-2);
    --ea-text-muted: var(--ns-text-2);
    --ea-border: var(--ns-border);
    --ea-accent: var(--ns-gold);
    --ea-accent-hover: var(--ns-gold-deep);
    --ea-success: var(--ns-text);
}
.ns-polish-2 .ns-deploy-page {
    --ns-surface-2: var(--ns-elevated);
    --ns-surface-3: var(--ns-surface);
    --ns-text-soft: var(--ns-text-2);
    --ns-text-muted: var(--ns-text-2);
    --ns-indigo: var(--ns-gold);
    --ns-amber: var(--ns-gold);
    --ns-green: var(--ns-text);
    --ns-purple: var(--ns-text);
    --ns-blue: var(--ns-gold-light);
    --ns-shadow: none;
}
.ns-polish-2 .ns-test {
    --ns-test-bg: var(--ns-bg);
    --ns-test-panel: var(--ns-card);
    --ns-test-panel-soft: var(--ns-surface);
    --ns-test-border: var(--ns-border);
    --ns-test-text: var(--ns-text);
    --ns-test-muted: var(--ns-text-2);
    --ns-test-user: var(--ns-gold);
    --ns-test-agent: var(--ns-gold);
    --ns-test-success: var(--ns-text);
    --ns-test-danger: var(--ns-text);
    --ns-test-shadow: none;
    background: var(--ns-bg);
}
.ns-polish-2 :is(.ns-deploy-shell, .ns-deploy-card, .ns-deploy-panel, .ns-deploy-status-card,
    .ns-deploy-preview-card, .ns-deploy-code-card, .ns-deploy-install-card) {
    background: var(--ns-card);
    color: var(--ns-text);
}
.ns-polish-2 :is(.agent-sub-card-body, .agent-sub-card-header) {
    background: var(--ns-card);
    color: var(--ns-text);
    border-color: var(--ns-border);
}

/* Reuse the canonical 16136 Test Drive chrome mapping under this view scope. */
.ns-polish-2 :is(.ns-test__header, .ns-test__panel, .ns-test__sidebar-card, .ns-test__empty, .ns-test__room, .ns-test__ceiling,
    .ns-test__composer-shell) {
    background: var(--ns-card);
    border-color: var(--ns-border-strong);
    border-radius: var(--ns-radius);
    box-shadow: none;
    backdrop-filter: none;
}
.ns-polish-2 .ns-test__composer { background: var(--ns-card); }
.ns-polish-2 :is(.ns-test__badge, .ns-test__btn, .ns-test__chip, .ns-test__icon-btn, .ns-test__mini-badge, .ns-test__metric,
    .ns-test__future, .ns-test__try-card, .ns-test__signal, .ns-test__ceiling-keep) {
    background: var(--ns-surface);
    border-color: var(--ns-border-strong);
    color: var(--ns-text);
}
.ns-polish-2 :is(.ns-test__btn, .ns-test__chip, .ns-test__try-card, .ns-test__icon-btn):hover {
    background: var(--ns-elevated);
    border-color: var(--ns-border-strong);
    transform: none;
}
.ns-polish-2 .ns-test__btn.is-primary,
.ns-polish-2 .ns-test__btn--primary {
    background: transparent;
    border-color: var(--ns-border-strong);
    color: color-mix(in srgb, var(--ns-gold-light) 70%, var(--ns-text));
}
.ns-polish-2 .ns-test__bubble.is-agent,
.ns-polish-2 .ns-test__typing-bubble { background: var(--ns-surface); border-color: var(--ns-border); color: var(--ns-text); }
.ns-polish-2 .ns-test__bubble.is-user { background: color-mix(in srgb, var(--ns-gold) 5%, var(--ns-card)); border-color: var(--ns-border-strong); color: var(--ns-text); }
.ns-polish-2 .ns-test__bubble.is-error { background: var(--ns-surface); border-color: var(--ns-border-strong); color: var(--ns-text); }
.ns-polish-2 :is(.ns-test__nudge, .ns-test__offer) { background: var(--ns-surface); border-color: var(--ns-border-strong); }
.ns-polish-2 :is(.ns-test__toolbar, .ns-test__learning-optin, .ns-test__insight-section + .ns-test__insight-section) { border-color: var(--ns-border); }
.ns-polish-2 :is(.ns-test__try-icon, .ns-test__ceiling-icon, .ns-test__ceiling-keep i) { background: var(--ns-card); color: color-mix(in srgb, var(--ns-gold-light) 70%, var(--ns-text)); }
.ns-polish-2 .ns-test__textarea { color: var(--ns-text); background: transparent; }
.ns-polish-2 .ns-test__textarea::placeholder { color: var(--ns-text-2); }

.ns-polish-2 .ea-edit-agent .agent-main-card-body { background: var(--ns-card); }

/* Private stylesheet chrome now reads the same tokens; layout and renderer rules stay in their original sheets. */
.ns-polish-2 .ns-deploy-shell { background: var(--ns-card); }
.ns-polish-2 .ns-deploy-eyebrow { color: color-mix(in srgb, var(--ns-gold-light) 70%, var(--ns-text)); }
.ns-polish-2 .ns-deploy-pill, .ns-polish-2 .ns-deploy-status-pill { background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-status-pill.is-ready { color: var(--ns-text); border-color: var(--ns-border-strong); background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-status-pill.is-attention { color: color-mix(in srgb, var(--ns-gold-light) 70%, var(--ns-text)); border-color: var(--ns-border-strong); background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-btn-primary { background: var(--ns-gold); color: var(--ns-on-accent); box-shadow: none; }
.ns-polish-2 .ns-deploy-btn-secondary { background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-step { background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-step-number { background: var(--ns-surface); color: color-mix(in srgb, var(--ns-gold-light) 70%, var(--ns-text)); }
.ns-polish-2 .ns-deploy-celebration { border: 1px solid var(--ns-border-strong); background: var(--ns-surface); color: var(--ns-text); }
.ns-polish-2 .ns-deploy-card.is-selected { border-color: var(--ns-border-strong); box-shadow: none; }
.ns-polish-2 .ns-deploy-card-icon { background: var(--ns-card); }
.ns-polish-2 .ns-deploy-card-icon.is-web { background: var(--ns-card); color: color-mix(in srgb, var(--ns-gold-light) 70%, var(--ns-text)); }
.ns-polish-2 .ns-deploy-card-icon.is-share { background: var(--ns-card); color: color-mix(in srgb, var(--ns-gold-light) 70%, var(--ns-text)); }
.ns-polish-2 .ns-deploy-card-icon.is-phone { background: var(--ns-card); color: var(--ns-text); }
.ns-polish-2 .ns-deploy-card-icon.is-sms { background: var(--ns-card); color: var(--ns-text); }
.ns-polish-2 .ns-deploy-card-status { background: var(--ns-card); }
.ns-polish-2 .ns-deploy-card-status.is-success { color: var(--ns-text); border-color: var(--ns-border-strong); background: var(--ns-card); }
.ns-polish-2 .ns-deploy-card-status.is-warning { color: color-mix(in srgb, var(--ns-gold-light) 70%, var(--ns-text)); border-color: var(--ns-border-strong); background: var(--ns-card); }
.ns-polish-2 .ns-deploy-readiness-item { background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-readiness-icon.is-ok { background: var(--ns-surface); color: var(--ns-text); }
.ns-polish-2 .ns-deploy-readiness-icon.is-warning { background: var(--ns-surface); color: var(--ns-text); }
.ns-polish-2 .ns-deploy-readiness-item a { color: color-mix(in srgb, var(--ns-gold-light) 70%, var(--ns-text)); }
.ns-polish-2 .ns-deploy-progress { background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-progress > span { background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-panel-tag { background: var(--ns-card); }
.ns-polish-2 .ns-deploy-tablist { background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-tab.is-active { background: var(--ns-surface); color: var(--ns-text); }
.ns-polish-2 .ns-deploy-code-surface { background: var(--ns-surface); border: 1px solid var(--ns-border-strong); }
.ns-polish-2 .ns-deploy-code { color: var(--ns-text); }
.ns-polish-2 .ns-deploy-token-tag { color: var(--ns-text); }
.ns-polish-2 .ns-deploy-token-attr { color: var(--ns-text); }
.ns-polish-2 .ns-deploy-token-string { color: var(--ns-text); }
.ns-polish-2 .ns-deploy-input, .ns-polish-2 .ns-deploy-url-input { background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-input:focus, .ns-polish-2 .ns-deploy-url-input:focus { border-color: var(--ns-border-strong); box-shadow: none; }
.ns-polish-2 .ns-deploy-toggle { background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-toggle.is-active { color: var(--ns-text); border-color: var(--ns-border-strong); background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-browser { background: var(--ns-surface); border: 1px solid var(--ns-border-strong); }
.ns-polish-2 .ns-deploy-browser-dot { background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-widget { background: var(--ns-surface); color: var(--ns-text); border: 1px solid var(--ns-border-strong); box-shadow: none; }
.ns-polish-2 .ns-deploy-widget.is-light { background: var(--ns-surface); color: var(--ns-text); }
.ns-polish-2 .ns-deploy-widget-head { color: var(--ns-text); }
.ns-polish-2 .ns-deploy-widget.is-light .ns-deploy-widget-head { color: var(--ns-text); }
.ns-polish-2 .ns-deploy-widget-bubble { background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-widget.is-light .ns-deploy-widget-bubble { background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-qr { background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-status-item { background: var(--ns-surface); }
.ns-polish-2 .ns-deploy-status-dot.is-success { box-shadow: none; }
.ns-polish-2 .ns-deploy-status-dot.is-warning { box-shadow: none; }
.ns-polish-2 .ns-deploy-status-dot.is-info { box-shadow: none; }
.ns-polish-2 .ns-deploy-coming-soon { color: var(--ns-text); background: var(--ns-surface); border: 1px solid var(--ns-border-strong); }
.ns-polish-2 .ns-deploy-note { background: var(--ns-surface); border: 1px solid var(--ns-border-strong); }
.ns-polish-2 .ns-test { background: var(--ns-surface); }
.ns-polish-2 .ns-test__badge { background: var(--ns-surface); border: 1px solid var(--ns-border-strong); }
.ns-polish-2 .ns-test__badge.is-status { background: var(--ns-surface); color: var(--ns-text); border-color: var(--ns-border-strong); }
.ns-polish-2 .ns-test__badge.is-status .ns-test__pulse { box-shadow: none; }
.ns-polish-2 .ns-test__btn { border: 1px solid var(--ns-border-strong); background: var(--ns-surface); }
.ns-polish-2 .ns-test__btn:hover, .ns-polish-2 .ns-test__chip:hover, .ns-polish-2 .ns-test__icon-btn:hover { color: var(--ns-text); }
.ns-polish-2 .ns-test__btn.is-primary { background: var(--ns-surface); border-color: var(--ns-border-strong); }
.ns-polish-2 .ns-test__future { background: var(--ns-surface); }
.ns-polish-2 .ns-test__toolbar { border-bottom: 1px solid var(--ns-border-strong); }
.ns-polish-2 .ns-test__icon-btn { background: var(--ns-surface); border: 1px solid var(--ns-border-strong); }
.ns-polish-2 .ns-test__chip { border: 1px solid var(--ns-border-strong); background: var(--ns-surface); }
.ns-polish-2 .ns-test__bubble.is-agent { background: var(--ns-surface); border-color: var(--ns-border-strong); }
.ns-polish-2 .ns-test__bubble.is-user { background: var(--ns-surface); border-color: var(--ns-border-strong); }
.ns-polish-2 .ns-test__bubble.is-error { background: var(--ns-surface); border-color: var(--ns-border-strong); }
.ns-polish-2 .ns-test__mini-badge { background: var(--ns-surface); border: 1px solid var(--ns-border-strong); }
.ns-polish-2 .ns-test__typing-bubble { background: var(--ns-surface); border: 1px solid var(--ns-border-strong); }
.ns-polish-2 .ns-test__dots span { background: var(--ns-surface); }
.ns-polish-2 .ns-test__insight-section + .ns-test__insight-section { border-top: 1px solid var(--ns-border-strong); }
.ns-polish-2 .ns-test__metric { background: var(--ns-surface); border: 1px solid var(--ns-border-strong); }
.ns-polish-2 .ns-test__metric strong { color: var(--ns-text); }
.ns-polish-2 .ns-test__nudge { background: var(--ns-surface); border: 1px solid var(--ns-border-strong); }
.ns-polish-2 .ns-test__composer { background: var(--ns-surface); }
.ns-polish-2 .ns-test__composer-shell { background: var(--ns-card); border: 1px solid var(--ns-border-strong); box-shadow: none; }
.ns-polish-2 .ns-test__textarea::placeholder { color: var(--ns-text-2); }
.ns-polish-2 .ns-test__send { background: var(--ns-surface); color: var(--ns-text); }
.ns-polish-2 0% { box-shadow: none; }
.ns-polish-2 70% { box-shadow: none; }
.ns-polish-2 100% { box-shadow: none; }
.ns-polish-2 .ea-edit-agent .agent-main-card-body { background: var(--ns-card); }
.ns-polish-2 .ea-edit-agent .agent-sub-card-header { background: var(--ns-card); }
.ns-polish-2 .ea-edit-agent .ea-agent-hero { background: var(--ns-surface); }
.ns-polish-2 .ea-edit-agent #go_section { background: var(--ns-surface); box-shadow: none; }
.ns-polish-2 .ea-edit-agent #go_section:hover { background: var(--ns-surface); }
.ns-polish-2 .ea-edit-agent #go_section:focus { box-shadow: none; }
.ns-polish-2 .ea-edit-agent #go_section optgroup { background: var(--ns-surface); }
.ns-polish-2 .ea-edit-agent #go_section option { background: var(--ns-surface); }
.ns-polish-2 .ea-edit-agent .ea-phase-group details, .ns-polish-2 .ea-edit-agent details.ea-advanced-group, .ns-polish-2 .ea-edit-agent .ea-advanced-group details { background: var(--ns-surface); }
.ns-polish-2 .ea-edit-agent details > summary { background: var(--ns-surface); }
.ns-polish-2 .ea-edit-agent .ea-badge-new { color: var(--ns-text); }
.ns-polish-2 .ea-edit-agent .ea-configured { box-shadow: none; }
.ns-polish-2 .ea-edit-agent input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), .ns-polish-2 .ea-edit-agent select, .ns-polish-2 .ea-edit-agent textarea, .ns-polish-2 .ea-edit-agent .form-control, .ns-polish-2 .ea-edit-agent .form-select { background: var(--ns-surface); }
.ns-polish-2 .ea-edit-agent input::placeholder, .ns-polish-2 .ea-edit-agent textarea::placeholder { color: color-mix(in srgb, var(--ea-text-muted) 82%, var(--ns-text) 18%); }
.ns-polish-2 .ea-edit-agent input:focus, .ns-polish-2 .ea-edit-agent select:focus, .ns-polish-2 .ea-edit-agent textarea:focus, .ns-polish-2 .ea-edit-agent .form-control:focus, .ns-polish-2 .ea-edit-agent .form-select:focus { background: var(--ns-surface); box-shadow: none; }
.ns-polish-2 .ea-edit-agent .ea-soul-editor { background: var(--ns-surface); }
.ns-polish-2 .ea-edit-agent .ea-skill-card { background: var(--ns-card); }
.ns-polish-2 .ea-edit-agent .ea-skill-install { color: var(--ns-text); }
.ns-polish-2 .ea-edit-agent .ea-heartbeat-config { background: var(--ns-surface); }
.ns-polish-2 .ea-edit-agent .ea-heartbeat-config .form-check-input { background-color: var(--ns-surface); }
.ns-polish-2 .ea-edit-agent .ea-heartbeat-config .form-check-input:focus { box-shadow: none; }
.ns-polish-2 .ea-security-status { background: var(--ns-surface); }
.ns-polish-2 .ea-edit-agent .ea-memory-panel { background: var(--ns-card); }
.ns-polish-2 .ea-edit-agent details.ea-advanced-group { border: 1px dashed color-mix(in srgb, var(--ea-border) 72%, var(--ns-border-strong) 28%); background: var(--ns-surface); }
.ns-polish-2 .ea-edit-agent details.ea-advanced-group[open] { background: var(--ns-surface); }
.ns-polish-2 .ea-edit-agent .ea-btn-talk { color: var(--ns-text); box-shadow: none; }
.ns-polish-2 .ea-edit-agent .ea-btn-talk:hover { color: var(--ns-text); }
.ns-polish-2 .ea-edit-agent .ea-btn-chat:hover { color: color-mix(in srgb, var(--ea-accent) 94%, var(--ns-text) 6%); }
.ns-polish-2 .ea-edit-agent .ea-btn-save { color: color-mix(in srgb, var(--ea-accent) 74%, var(--ns-text) 26%); }
.ns-polish-2 .ea-edit-agent .ea-btn-save:hover { color: var(--ns-text); }
.ns-polish-2 .ea-edit-agent .ea-btn-talk:focus-visible, .ns-polish-2 .ea-edit-agent .ea-btn-chat:focus-visible, .ns-polish-2 .ea-edit-agent .ea-btn-save:focus-visible { box-shadow: none; }
.ns-polish-2 .ea-edit-agent .modal .modal-content { background: var(--ns-surface); }
.ns-polish-2 .ea-edit-agent .modal .modal-header, .ns-polish-2 .ea-edit-agent .modal .modal-footer { background: var(--ns-card); }
.ns-polish-2 .ea-edit-agent .modal .modal-body { background: var(--ns-card); }
.ns-polish-2 .ea-edit-agent .modal .btn-close:focus { box-shadow: none; }

/* Portal dialogs use the same app token scope; protected scripts keep their original options. */
body:has(.ns-polish-2.ns-gp-ag) #main-content { background: var(--ns-bg); color: var(--ns-text); }
body:has(.ns-polish-2.ns-gp-ag) .swal2-popup {
    background: var(--ns-card);
    color: var(--ns-text);
    font-family: var(--ns-font);
    border: 1px solid var(--ns-border-strong);
    border-radius: var(--ns-radius);
}
body:has(.ns-polish-2.ns-gp-ag) :is(.swal2-title, .swal2-html-container) { color: var(--ns-text); }
body:has(.ns-polish-2.ns-gp-ag) .swal2-confirm { background: var(--ns-gold) !important; color: var(--ns-on-accent) !important; }
body:has(.ns-polish-2.ns-gp-ag) .swal2-cancel { background: var(--ns-surface) !important; color: var(--ns-text) !important; }

.ns-polish-2 .ns-profile__shell .text-white-50 { color: var(--ns-text-2) !important; }
