.agents-page [hidden] { display: none !important; }
#agent-import-warnings { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; display: grid; gap: 10px; }
.agent-import-warning { padding: 12px 14px; border: 1px solid #efcf8b; border-radius: 10px; background: #fff8e8; color: #72541e; overflow-wrap: anywhere; }
.agent-import-warning p { margin: 6px 0 0; font-size: 13px; }
#agent-import-warning-section h3 { font-size: 18px; margin-top: 18px; }
.agent-import-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 20px 0; }
.agent-import-toolbar span { font-size: 13px; color: #607c8d; }
.agents-page #agent-import-dialog { width: min(680px, calc(100vw - 28px)); }
#agent-import-title { font-size: 23px; }
#agent-import-status { margin-top: 18px; overflow-wrap: anywhere; }
#agent-import-errors { max-height: 240px; overflow-y: auto; padding-left: 24px; overflow-wrap: anywhere; }
#agent-import-dialog .modal-body { min-height: 0; overflow-y: auto; }
#agent-import-dialog .modal-content { max-height: calc(100dvh - 40px); }
#agent-import-dialog .modal-header, #agent-import-dialog .modal-footer { flex-shrink: 0; }
.agents-page .agent-status { margin: 20px 0; overflow-wrap: anywhere; }
.agents-page #session-status { padding: 20px; border-radius: 16px; }
.agents-page .agent-toolbar, .agents-page .skill-toolbar { display: flex; align-items: end; gap: 12px; margin: 24px 0 12px; }
.agents-page .agent-toolbar input { flex: 1; min-width: 0; }
.agents-page .agent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.agents-page .agent-card { border-radius: 18px; padding: 22px; min-width: 0; overflow-wrap: anywhere; }
.agents-page .agent-card h2 { font-size: 21px; margin: 10px 0; }
.agents-page .agent-card .agent-description { white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.agents-page .agent-card .agent-meta { color: #496677; font-size: 13px; }
.agents-page .agent-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; line-height: 1.4; }
.agents-page .agent-badge-enabled { background: #d1e7dd; color: #0f5132; }
.agents-page .agent-badge-disabled { background: #f8d7da; color: #842029; }
.agents-page .agent-card-actions, .agents-page .agent-pages { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.agents-page .agent-enabled-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agents-page .agent-enabled-field small { flex-basis: 100%; color: #496677; font-weight: 400; }
.agents-page .agent-pages { justify-content: center; margin: 20px 0; }
.agents-page dialog { width: min(920px, calc(100% - 24px)); max-width: 920px; max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #c5d8df; border-radius: 18px; background: #f4f9fc; color: #173448; }
.agents-page dialog::backdrop { background: rgba(15, 35, 50, .5); }
.agents-page dialog[open] { display: flex; flex-direction: column; }
.agents-page dialog > .modal-content { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.agents-page dialog .modal-header, .agents-page dialog .modal-footer { flex-shrink: 0; padding: 18px 22px; gap: 12px; }
.agents-page dialog .modal-title { font-size: 23px; }
.agents-page dialog .modal-body { overflow-y: auto; overscroll-behavior: contain; padding: 20px 22px; min-height: 0; }
.agents-page #agent-fields { min-width: 0; }
.agents-page .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.agents-page .wide { grid-column: 1 / -1; }
.agents-page textarea { resize: vertical; }
.agents-page .agent-config { margin-top: 28px; }
.agents-page .agent-config h3 { font-size: 19px; }
.agents-page .config-guidance { padding: 12px 14px; border-left: 4px solid #936600; border-radius: 8px; background: #fff3cd; color: #664d03; line-height: 1.6; }
.agents-page .config-option input:focus-visible { outline: 3px solid #0d6efd; outline-offset: 3px; }
.agents-page .config-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.agents-page .config-group { border: 1px solid #d9e6ec; border-radius: 12px; padding: 12px 14px; min-width: 0; }
.agents-page .config-group legend { font-size: 15px; padding: 0 6px; width: auto; }
.agents-page .config-options { display: flex; flex-direction: column; gap: 6px; }
.agents-page .config-option { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.agents-page .agent-roles { margin: 20px 0 28px; }
.agents-page .agent-roles h3 { font-size: 19px; }
.agents-page #role-fields { min-width: 0; }
.agents-page #role-options { max-height: 320px; overflow-y: auto; }
.agents-page .role-option { display: flex; align-items: baseline; gap: 10px; padding: 10px 4px; border-bottom: 1px solid #d9e6ec; overflow-wrap: anywhere; }
.agents-page .role-option input { flex-shrink: 0; }
.agents-page .role-option input:focus-visible { outline: 3px solid #0d6efd; outline-offset: 3px; }
.agents-page .agent-bindings { margin-top: 28px; }
.agents-page .agent-bindings h3 { font-size: 19px; }
.agents-page .skill-toolbar label:first-child { flex: 1; }
.agents-page .skill-toolbar label { min-width: 0; }
.agents-page .selected-skills { display: flex; flex-wrap: wrap; gap: 8px; }
.agents-page .selected-skill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid #bed5de; border-radius: 10px; max-width: 100%; overflow-wrap: anywhere; }
.agents-page .skill-option { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid #d9e6ec; overflow-wrap: anywhere; }
.agents-page .skill-option input { flex-shrink: 0; }
.agents-page #delete-dialog { max-width: 480px; }
.agent-icon-section { margin-bottom: 24px; padding: 18px; border: 1px solid #c9dce6; border-radius: 16px; background: #f7fbff; }
.agent-icon-section h3 { font-size: 19px; }
.agent-icon-tools { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
#agent-icon-preview, .agent-card-icon { display: block; width: 64px; height: 64px; object-fit: contain; padding: 0; border-radius: 18px; background: transparent; border: 0; }
.agent-card-icon { margin-bottom: 12px; }
#agent-icon-options h4 { font-size: 14px; margin: 16px 0 10px; color: #39556b; }
.agent-icon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.agent-icon-choice { display: flex; align-items: center; flex-direction: column; gap: 8px; border: 1px solid #d5e2ef; background: #fff; border-radius: 12px; padding: 12px 6px; font-size: 12px; color: #29465d; cursor: pointer; }
.agent-icon-choice img { display: block; width: 48px; height: 48px; object-fit: contain; padding: 0; background: transparent; border-radius: 13px; }
.agent-icon-choice:focus-visible { outline: 3px solid #387ce5; outline-offset: 3px; }
.agent-icon-choice:hover, .agent-icon-choice[aria-pressed="true"] { border-color: #387ce5; background: #eaf2ff; box-shadow: 0 0 0 1px #387ce5; }
#agent-icon-status { color: #375c84; margin-top: 10px; }
@media (max-width: 600px) {
    .agents-page .admin-shell { width: calc(100% - 28px); padding-top: 28px; }
    .agents-page .admin-shell header { align-items: start; flex-direction: column; }
    .agents-page .admin-shell h1 { font-size: 34px; }
    .agents-page .form-grid { grid-template-columns: 1fr; }
    .agents-page .agent-toolbar { flex-wrap: wrap; }
    .agents-page .agent-toolbar > label { width: 100%; }
    .agents-page dialog .modal-body { padding: 16px; }
    .agents-page .skill-toolbar { flex-wrap: wrap; }
}
