/* Shared type and spacing scale. Loaded last to replace accumulated page overrides. */
:root{--text-caption:12px;--text-small:13px;--text-body:14px;--text-title:16px;--text-section:18px;--text-page:28px;--text-secondary:#737980;--text-tertiary:#858b92}
body.polished-ui{font-size:var(--text-body);line-height:1.6}
.polished-ui h1,.polished-ui .detail-hero h1{font-size:var(--text-page);font-weight:600;line-height:1.3;letter-spacing:-.5px}
.polished-ui h2,.polished-ui dialog h2{font-size:var(--text-section);font-weight:600;line-height:1.45}
.polished-ui h3,.polished-ui .app-tile h3,.polished-ui .store-copy strong{font-size:var(--text-title);font-weight:600;line-height:1.5}
.polished-ui .card .grow h2,.polished-ui .modal-head h2{font-size:var(--text-title)}
.polished-ui .small,.polished-ui small,.polished-ui .store-copy>small,.polished-ui .service-name,.polished-ui .catalog-note,.polished-ui .sidebar-caption{font-size:var(--text-caption);line-height:1.5;color:var(--text-tertiary)}
.polished-ui .page-heading p,.polished-ui .detail-hero p,.polished-ui .store-copy>span,.polished-ui .activity-row p,.polished-ui .field,.polished-ui details summary,.polished-ui .app-tile-bottom,.polished-ui .settings-row p{font-size:var(--text-small);line-height:1.6}
.polished-ui button,.polished-ui button.primary,.polished-ui .tabs button,.polished-ui .store-tabs button,.polished-ui .market-tools>.primary,.polished-ui .modal-foot button{font-size:var(--text-small);line-height:1.5}
.polished-ui nav button{font-size:var(--text-body)}
.polished-ui .activity-row b{font-size:var(--text-body)}
.polished-ui .activity-row>span:not(.small){font-size:var(--text-small)}
.polished-ui input:not([type=checkbox]):not([type=radio]),.polished-ui select,.polished-ui textarea,.polished-ui .search-field #market-search{font-size:var(--text-body)}
.polished-ui header{height:auto;min-height:30px;gap:12px;margin-bottom:28px;font-size:var(--text-caption)}
.polished-ui header .accent{display:block;flex-shrink:0}
.polished-ui .connection-chip{display:flex;align-items:center;gap:7px;padding:5px 8px;font-size:var(--text-caption);color:var(--text-secondary)}
.connection-chip i{width:6px;height:6px;border-radius:50%;background:currentColor}
.polished-ui #content{gap:28px}
.polished-ui .section-heading{margin-bottom:16px}
.polished-ui .setup-next{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px 22px;background:#f7f8fa;border:1px solid var(--border-soft);border-radius:12px}
.setup-next h2{margin-bottom:6px}.setup-next p{color:var(--text-secondary);font-size:13px}
@media(max-width:640px){:root{--text-page:24px}.polished-ui nav .nav-label{font-size:11px;line-height:1.4}.polished-ui aside{width:78px}.polished-ui nav button{padding:9px 2px}.polished-ui main{padding:20px 16px 36px}.polished-ui .setup-next{align-items:flex-start;flex-direction:column;gap:14px}.polished-ui header{align-items:center}.polished-ui #breadcrumb{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.polished-ui .connection-chip{padding:4px;font-size:12px}.polished-ui .journey-step{font-size:12px}.polished-ui .sidebar-bottom button{font-size:11px}}
/* Agent card hierarchy and a consistent twenty-avatar grid. */
.agent-cards{display:grid;gap:18px}
.polished-ui .agent-card{display:grid;gap:22px;padding:22px}
.agent-card-head{display:flex;align-items:center;gap:13px}
.polished-ui .agent-card h2{font-size:16px}
.agent-connection{font-size:12px;display:block;margin-top:3px}
.agent-card-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;border-top:1px solid var(--border-soft);padding-top:16px}
.agent-card-footer>span{font-size:12px;color:var(--text-secondary)}
.agent-app-preview{display:flex;gap:10px;flex-wrap:wrap}
.polished-ui .agent-app-chip{display:flex;align-items:center;gap:8px;border:0;background:#f7f8fa;padding:7px 10px;font-size:13px}
.agent-app-chip .brand-tile{width:22px;height:22px;flex-basis:22px;border:0;border-radius:5px;background:transparent}
.agent-app-chip .brand-tile img{width:20px;height:20px}
.agent-menu{position:relative;align-self:flex-start}
.polished-ui .agent-menu>summary{display:flex;justify-content:center;align-items:center;width:32px;height:32px;border-radius:8px;letter-spacing:2px;color:#747b82;font-size:14px}
.agent-menu>summary:before{display:none}.agent-menu>summary:hover{background:#f2f3f5}
.agent-menu-items{position:absolute;right:0;top:38px;width:180px;z-index:5;padding:6px;border:1px solid #e9ebee;border-radius:12px;background:#fff;box-shadow:0 8px 28px #20232612;display:grid;gap:2px}
.polished-ui .agent-menu-items button{text-align:left;border:0;background:transparent;padding:9px 10px}
.polished-ui .agent-menu-items button:hover{background:#f5f6f8}
.avatar-options{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;width:100%;max-width:340px;padding:3px;margin:0}
.avatar-choice{display:block;min-width:0;aspect-ratio:1}
.avatar-choice>span{box-sizing:border-box;width:100%;height:100%;aspect-ratio:1;max-height:none;border:1px solid transparent;border-radius:12px}
.avatar-choice svg{width:26px;height:26px}
.avatar-choice input:checked+span{border:1px solid #616b79;outline:2px solid #616b79;outline-offset:2px;box-shadow:none}
.avatar-choice input:focus-visible+span{outline:3px solid #333d4c;outline-offset:2px}
.avatar-choice:hover>span{border-color:#adb5bf}
@media(max-width:640px){.polished-ui .agent-card{padding:18px;gap:18px}.avatar-options{gap:10px;max-width:320px}.agent-card-footer{gap:8px}.agent-card-footer>span{font-size:12px}}

.polished-ui .agent-connect-link{border:0;background:transparent;box-shadow:none;padding:0;font-size:12px;color:#526b8a;line-height:inherit}.polished-ui .agent-connect-link:hover{text-decoration:underline}
.avatar-choice input:checked+span{border:2px solid #697586;outline:none;box-shadow:none}
.avatar-choice input:focus-visible+span{outline:2px solid #697586;outline-offset:3px}
/* Explicit primary action and accessible local icon upload. */
.polished-ui button.primary,.polished-ui button[data-action="new-agent"]{background:#252729;border:1px solid #252729;color:#fff;opacity:1}
.polished-ui button.primary:hover,.polished-ui button[data-action="new-agent"]:hover{background:#3b3e41;border-color:#3b3e41}
.polished-ui button.primary:disabled{opacity:.4}
.publish-icon-row{display:flex;align-items:center;gap:18px}
.publish-icon-preview{width:76px;height:76px;flex:0 0 76px;border:1px solid var(--border-control);border-radius:16px;display:flex;align-items:center;justify-content:center;background:#f7f8fa;color:#969da5;overflow:hidden}
.publish-icon-preview img{width:100%;height:100%;object-fit:contain;background:white}
.publish-icon-row>.stack{gap:8px;justify-items:start}
.upload-icon-control{position:relative;display:inline-flex;align-items:center;padding:7px 13px;border:1px solid var(--border-control);border-radius:10px;background:white;color:#34373a;font-size:13px;cursor:pointer;overflow:hidden}
.upload-icon-control:hover{background:#f5f6f8}.upload-icon-control:focus-within{outline:2px solid #9aa5b4;outline-offset:3px}
.upload-icon-control input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.polished-ui [data-action="remove-publish-icon"]{border:0;background:transparent;padding:0;color:#777f88;font-size:12px}
.submission-preview{display:flex;gap:12px;align-items:center}.submission-preview>img{width:40px;height:40px;border-radius:10px;object-fit:contain;border:1px solid var(--border-soft)}
/* Language remains available on every page. */
.polished-ui header #breadcrumb{margin-right:auto;min-width:0}
.language-switch{display:flex;align-items:center;flex-shrink:0}
.polished-ui .language-switch select{font-size:12px;border:1px solid var(--border-soft);background:#fff;border-radius:8px;padding:5px 7px;min-height:30px;width:auto;color:#5e666e;cursor:pointer}
html[lang=en] .polished-ui .sidebar-bottom button{white-space:normal}
html[lang=en] .polished-ui .agent-card-footer{flex-wrap:wrap}
html[lang=en] .polished-ui .page-heading{flex-wrap:wrap}
@media(max-width:640px){.polished-ui header{gap:7px;flex-wrap:wrap}.polished-ui header #breadcrumb{flex:1}.polished-ui .language-switch select{max-width:85px}html[lang=en] .polished-ui nav .nav-label{font-size:10px}html[lang=en] .polished-ui .connection-chip{font-size:11px}html[lang=en] .polished-ui .sidebar-bottom button{font-size:10px}}
/* One selector style for page filters, settings, language and dialogs. */
.polished-ui .select-native{display:none!important}
.select-control{display:inline-flex;position:relative;min-width:0;max-width:100%;vertical-align:middle}
.field>.select-control,.filter-grid .select-control{width:100%}
.polished-ui .select-trigger{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;min-height:40px;padding:9px 12px;border:1px solid #e6e8eb;border-radius:10px;background:#fff;color:#343a40;box-shadow:none;text-align:left;font-size:13px;line-height:20px;font-weight:400;transform:none;outline:none}
.select-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.select-trigger svg{width:16px;height:16px;flex:0 0 16px;fill:none;stroke:#8a9199;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s}
.polished-ui .select-trigger:hover{background:#fafbfc;border-color:#d7dce1}
.polished-ui .select-trigger[aria-expanded=true]{border-color:#a5afb9;background:#fff;outline:none;box-shadow:none}
.select-trigger[aria-expanded=true] svg{transform:rotate(180deg)}
.polished-ui .select-trigger:focus{outline:none;box-shadow:none}
.polished-ui .select-trigger:focus-visible{outline:2px solid #b4bfca;outline-offset:2px}
.polished-ui .select-trigger:disabled{opacity:.45;cursor:not-allowed}
.polished-ui .language-switch .select-trigger{min-height:32px;padding:5px 10px;font-size:12px;gap:12px;border-radius:8px}
.select-menu{position:fixed;z-index:10000;box-sizing:border-box;overflow-y:auto;overscroll-behavior:contain;padding:5px;border:1px solid #e8ebee;border-radius:12px;background:#fff;box-shadow:0 8px 28px #202b3914;color:#343a40;font-size:13px;line-height:1.5;text-align:left}
.select-menu [role=option]{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:36px;padding:8px 10px;border-radius:7px;cursor:pointer;overflow-wrap:anywhere}
.select-menu [role=option]:hover,.select-menu [role=option].highlighted{background:#f3f5f7}
.select-menu [aria-selected=true]{font-weight:500;color:#20262c}
.select-menu [aria-disabled=true]{opacity:.4;cursor:not-allowed}
.select-check{font-size:13px;color:#596b7d;flex-shrink:0}

/* Fluid avatar choices and a compact single action row per agent. */
.polished-ui .avatar-options{width:100%;max-width:none;grid-template-columns:repeat(auto-fit,minmax(48px,1fr));gap:12px;padding:3px}
.polished-ui .avatar-choice{width:100%;aspect-ratio:1}
.polished-ui .avatar-choice>span{width:100%;height:100%;max-height:none;aspect-ratio:1}
.polished-ui .agent-card{gap:16px;padding:20px}
.agent-card-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.agent-card-actions .agent-menu{align-self:center}
.polished-ui .agent-card-actions>.primary{padding:7px 12px}
.polished-ui .agent-card-head{flex-wrap:wrap;gap:12px}
.polished-ui .agent-card-head>.grow{min-width:80px;flex:1}
.polished-ui .agent-app-preview:empty{display:none}
@media(max-width:640px){.polished-ui .avatar-options{grid-template-columns:repeat(auto-fit,minmax(44px,1fr));gap:10px}.polished-ui .agent-card{padding:16px;gap:14px}.agent-card-actions{gap:4px}.polished-ui .agent-card-actions>.primary{padding:7px 10px}.polished-ui .agent-card-head>.grow{min-width:60px}.polished-ui .agent-card-head{gap:10px}}
/* Secondary menu precedes the right-aligned primary action. */
.agent-card-actions>.agent-menu{order:0}
.agent-card-actions>.primary{order:1}
/* Header utility order: language, then device connection. */
.polished-ui header #breadcrumb{order:0}
.polished-ui header .language-switch{order:1}
.polished-ui header .accent{order:2}
.access-app-list{display:grid;gap:12px}
.access-app{border:1px solid var(--border-soft);border-radius:12px;padding:16px;display:grid;gap:12px}
.access-app:has(.access-app-choice input:checked){border-color:#b5c0cb;background:#fafbfd}
.access-app-choice{display:flex;align-items:center;gap:12px;cursor:pointer}
.access-app-choice input{margin:0;flex:0 0 16px}
.access-app-choice .brand-tile{width:36px;height:36px;flex-basis:36px;border-radius:9px}
.access-app-choice .brand-tile img{width:23px;height:23px}
.access-app-choice strong{display:block;font-size:14px;font-weight:600}
.access-mode{display:block;font-size:12px;margin-top:2px}
.access-account-scope{display:flex;align-items:flex-start;flex-wrap:wrap;gap:8px 12px;padding-left:28px;font-size:13px}
.access-account-names{display:flex;flex-wrap:wrap;gap:5px 10px;flex:1;min-width:70px;color:#515b65}
.polished-ui .access-edit{padding:0;border:0;background:transparent;font-size:12px;color:#526b8a}
.access-warning{padding-left:28px;font-size:12px;color:#9d763b}
.access-capabilities{margin-left:28px}
.polished-ui .access-capabilities summary{font-size:12px}
.access-browse{display:flex;justify-content:flex-start}
@media(max-width:640px){.access-app{padding:13px}.access-account-scope{padding-left:0}.access-capabilities{margin-left:0}.access-warning{padding-left:0}}
/* Optical sizes: navigation 20, actions 16, detail indicators 14. */
.polished-ui nav .ui-icon{width:20px;height:20px;flex-basis:20px;color:#737b83}
.polished-ui nav .ui-icon svg,.polished-ui .sidebar-bottom .ui-icon svg{stroke-width:1.7}
.polished-ui nav button.active .ui-icon{color:#282f35}
.polished-ui .sidebar-bottom .ui-icon{width:19px;height:19px;flex-basis:19px}
.polished-ui .with-action-icon{display:inline-flex;align-items:center;justify-content:center;gap:7px}
.action-icon{display:inline-flex;width:16px;height:16px;flex:0 0 16px}
.action-icon svg{width:100%;height:100%}
.polished-ui .agent-menu>summary{letter-spacing:0;color:#89919a}
.agent-menu>summary .ui-icon{width:20px;height:20px;flex:0 0 20px}
.polished-ui .activity-row>span:last-child .ui-icon{width:14px;height:14px;flex-basis:14px;color:#9ba3ab}
.polished-ui .store-item>.icon-button .ui-icon{width:18px;height:18px;color:#7e8790}
.polished-ui .store-item>.icon-button:hover .ui-icon{color:#242b32}
.polished-ui .status-dot{font-size:0!important;width:6px;height:6px;display:inline-block;border-radius:50%;background:currentColor}
.polished-ui .brand-tile{box-shadow:none}
.polished-ui .brand-tile img{object-fit:contain}
.polished-ui .detail-back .with-action-icon{gap:4px}
