/* Scoped to the agent directory. Reference: white image-led skills gallery. */
#agents.jc.is-gallery{height:auto!important;min-height:100%!important;padding:0!important;display:block;background:#fff!important;border:0!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}
#agents.is-gallery::before{display:none!important}
#agents.is-gallery>.jc-topbar,#agents.is-gallery>.jc-body{display:none!important}
#agents:not(.is-gallery)>.ag-gallery{display:none}
#agents .ag-gallery{--ag-ink:#20252f;--ag-muted:#707783;--ag-line:#eaecf0;--ag-soft:#f4f4f6;--ag-accent:#5555dc;color:var(--ag-ink);width:100%;padding:4px 0 24px;box-sizing:border-box}
#agents .ag-gallery *{box-sizing:border-box}
#agents .ag-gallery ::selection{background:#e3e2fc;color:#29285d}
#agents .ag-toolbar{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:26px}
#agents .ag-toolbar h2{font-size:21px;font-weight:700;letter-spacing:0;line-height:1.4;margin:0 auto 0 0;white-space:nowrap}
#agents .ag-categories{display:flex;align-items:center;gap:2px;padding:4px;background:var(--ag-soft);border-radius:999px;max-width:100%;overflow-x:auto;scrollbar-width:thin;scrollbar-color:#c6c8d1 transparent}
#agents .ag-categories button{flex:none;min-height:38px;padding:7px 16px;background:none;border:none;border-radius:999px;color:#686f7b;font:inherit;font-size:14px;line-height:24px;white-space:nowrap;cursor:pointer;box-shadow:none}
#agents .ag-categories button[aria-pressed=true]{background:#fff;color:var(--ag-ink);font-weight:650;box-shadow:0 2px 5px #20252f0d}
#agents .ag-categories button:hover{color:#20252f;background:#fff}
#agents .ag-filters{display:flex;gap:10px;align-items:center}
#agents .ag-select{display:flex;align-items:center;position:relative;gap:8px;background:var(--ag-soft);border-radius:999px;padding:0 13px;margin:0;min-height:46px;color:#626976}
#agents .ag-select svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
#agents .ag-select select{padding:8px 0;margin:0;min-height:42px;width:auto;max-width:125px;border:0;background:transparent;box-shadow:none;color:#555d6a;font:inherit;font-size:14px;cursor:pointer}
#agents .ag-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:22px 20px;align-items:stretch}
#agents .ag-card{min-width:0;background:#fff;border:1px solid var(--ag-line);border-radius:16px;overflow:hidden;display:flex;flex-direction:column;transition:border-color .18s ease-out}
#agents .ag-card:hover{border-color:#b9bbc6}
#agents .ag-open{display:block;width:100%;padding:0;margin:0;border:0;border-radius:0;background:transparent;text-align:left;color:inherit;font:inherit;cursor:pointer;flex:1;min-height:0;box-shadow:none}
#agents .ag-cover{position:relative;display:block;aspect-ratio:16/9;overflow:hidden;background:#f1efea;isolation:isolate}
#agents .ag-cover img{display:block;width:100%;height:100%;object-fit:cover}
#agents .ag-cover-caption{position:absolute;inset:auto 0 0;display:flex;flex-direction:column;padding:14px 16px;gap:4px;background:#f8f4ecef;color:#28241e}
#agents .ag-cover-caption b{font-size:clamp(16px,1.25vw,24px);font-weight:750;line-height:1.22;letter-spacing:-.02em}
#agents .ag-cover-caption>span{font-size:11px;letter-spacing:.07em;line-height:1.4}
#agents .ag-cover-general .ag-cover-caption,#agents .ag-cover-video .ag-cover-caption,#agents .ag-cover-vlog .ag-cover-caption{display:none}
#agents .ag-cover-moments .ag-cover-caption{inset:14px auto auto 12px;background:#fff9ee;padding:12px;border-radius:2px;transform:rotate(-3deg)}
#agents .ag-cover-live .ag-cover-caption,#agents .ag-cover-pov .ag-cover-caption{background:#1e211fe6;color:#fff4df}
#agents .ag-cover-ad .ag-cover-caption{inset:12px 14px auto auto;background:#fff2b7;transform:rotate(3deg);padding:13px}
#agents .ag-cover-geo .ag-cover-caption{inset:0 0 auto;background:transparent;color:#594326}
#agents .ag-cover-business .ag-cover-caption{background:#efebe4}
#agents .ag-cover-hook img{filter:brightness(.55)}
#agents .ag-cover-hook .ag-cover-caption{inset:0;background:transparent;color:#fff;justify-content:center;align-items:center}
#agents .ag-cover-hook .ag-cover-caption b{font-size:clamp(28px,3.2vw,52px);color:#fff1ac}
#agents .ag-cover-local .ag-cover-caption{inset:0;background:#163934df;color:#fff9d9;justify-content:center;align-items:center}
#agents .ag-copy{display:block;padding:20px 19px 5px}
#agents .ag-title{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:17px;font-weight:700;line-height:1.5;color:var(--ag-ink)}
#agents .ag-description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:14px;font-weight:400;line-height:1.7;color:var(--ag-muted);margin-top:11px;min-height:48px}
#agents .ag-card-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 19px 14px;min-height:58px}
#agents .ag-type{display:flex;align-items:center;gap:6px;min-width:0;font-size:12px;color:var(--ag-muted)}
#agents .ag-type svg{width:17px;height:17px;stroke:currentColor;stroke-width:1.5;flex:none}
#agents .ag-save{display:flex;align-items:center;justify-content:center;position:relative;width:44px;min-width:44px;height:44px;min-height:44px;border:0;padding:0;background:none;cursor:pointer;box-shadow:none;border-radius:9px}
#agents .ag-save::before{content:'';width:38px;height:22px;border-radius:99px;background:#e6e7ec;transition:background .18s}
#agents .ag-save>span{position:absolute;width:16px;height:16px;border-radius:50%;background:#fff;left:6px;top:14px;transition:transform .18s ease-out}
#agents .ag-save[aria-checked=true]::before{background:var(--ag-accent)}
#agents .ag-save[aria-checked=true]>span{transform:translateX(16px)}
#agents .ag-gallery :is(button,select):focus-visible,#agents .ag-back:focus-visible{outline:3px solid #6262dc;outline-offset:3px}
#agents .ag-open:focus-visible{outline-offset:-4px}
#agents .ag-status{font-size:12px;line-height:1.6;color:var(--ag-muted);padding-top:22px;min-height:42px}
#agents .ag-empty{grid-column:1/-1;text-align:center;padding:76px 20px;color:var(--ag-muted)}
#agents .ag-empty strong{color:var(--ag-ink);font-size:20px}
#agents .ag-empty p{font-size:14px;line-height:1.7}
#agents .ag-empty button{background:#f2f2f6;border:1px solid #dddfe6;color:#393c49;min-height:44px;border-radius:10px;padding:10px 18px;cursor:pointer}
#agents .ag-back{margin-right:auto;white-space:nowrap}
@media(min-width:761px) and (max-width:1650px){#agents .ag-grid{grid-template-columns:repeat(4,minmax(0,1fr))}#agents .ag-toolbar{gap:12px}#agents .ag-categories{order:3;width:100%}#agents .ag-categories button{flex:1}}
@media(min-width:761px) and (max-width:1200px){#agents .ag-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}#agents .ag-categories button{padding-inline:13px;flex:none}}
@media(max-width:760px){#agents.jc.is-gallery{height:auto!important;min-height:70vh!important;padding:8px 0 24px!important}#agents .ag-toolbar{gap:14px;margin-bottom:20px}#agents .ag-toolbar h2{font-size:20px}#agents .ag-categories{order:3;width:100%;padding:3px;border-radius:12px}#agents .ag-categories button{min-height:40px;padding:8px 15px;font-size:14px}#agents .ag-filters{gap:6px}#agents .ag-select{min-height:40px;padding:0 10px;gap:5px}#agents .ag-select select{font-size:12px;min-height:40px;max-width:83px}#agents .ag-select svg{width:15px;height:15px}#agents .ag-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 12px}#agents .ag-card{border-radius:12px}#agents .ag-copy{padding:12px 11px 3px}#agents .ag-title{font-size:14px}#agents .ag-description{font-size:12px;line-height:1.65;min-height:40px;margin-top:7px}#agents .ag-card-footer{padding:0 9px 6px;gap:3px}#agents .ag-type{font-size:11px;gap:4px}#agents .ag-type svg{width:14px}#agents .ag-cover-caption{padding:9px;gap:3px}#agents .ag-cover-caption b{font-size:13px}#agents .ag-cover-caption>span{font-size:8px}#agents .ag-cover-moments .ag-cover-caption{inset:8px auto auto 8px;padding:7px}#agents .ag-cover-ad .ag-cover-caption{inset:8px 8px auto auto;padding:7px}#agents .ag-cover-hook .ag-cover-caption b{font-size:28px}#agents .ag-status{padding-top:17px}#agents .ag-back{font-size:12px!important}}
@media(max-width:350px){#agents .ag-grid{grid-template-columns:1fr}#agents .ag-filters{width:100%;justify-content:space-between}}
@media(prefers-reduced-motion:reduce){#agents .ag-gallery *{transition:none!important;animation:none!important}}
/* A card opens a readable introduction before entering the existing chat. */
#agents .ag-detail{width:min(920px,calc(100vw - 64px));max-width:none;max-height:calc(100dvh - 56px);margin:auto;padding:30px 34px 24px;border:0;border-radius:24px;background:#fff;color:var(--ag-ink);overflow:hidden;box-shadow:0 24px 80px #0002}
#agents .ag-detail[open]{display:flex;flex-direction:column}
#agents .ag-detail::backdrop{background:rgb(0 0 0 / 48%)}
#agents .ag-detail-header{display:flex;align-items:flex-start;gap:20px;flex:none;padding-bottom:24px}
#agents .ag-detail-heading{flex:1;min-width:0}
#agents .ag-detail-heading h2{font-size:27px;line-height:1.4;margin:0 0 10px;font-weight:750;overflow-wrap:anywhere}
#agents .ag-detail-heading p{margin:0;color:var(--ag-muted);font-size:14px;line-height:1.5}
#agents .ag-detail-actions{display:flex;align-items:center;gap:5px;white-space:nowrap;color:var(--ag-muted);font-size:13px}
#agents .ag-close{width:44px;height:44px;min-height:44px;border:0;background:none;padding:10px;border-radius:9px;cursor:pointer;color:#7c8390;box-shadow:none;margin-left:9px}
#agents .ag-close:hover{background:var(--ag-soft);color:var(--ag-ink)}
#agents .ag-close svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}
#agents .ag-detail-scroll{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#c6c8d1 transparent}
#agents .ag-detail-cover{overflow:hidden;border-radius:16px}
#agents .ag-detail-cover .ag-cover{width:100%;aspect-ratio:16/8;max-height:360px}
#agents .ag-detail-cover .ag-cover-caption b{font-size:34px}
#agents .ag-detail-cover .ag-cover-caption>span{font-size:15px}
#agents .ag-detail-cover .ag-cover-caption{padding:22px 28px;gap:7px}
#agents .ag-detail-cover .ag-cover-moments .ag-cover-caption{inset:28px auto auto 28px}
#agents .ag-detail-cover .ag-cover-hook .ag-cover-caption b{font-size:72px}
#agents .ag-detail-copy{padding-top:24px}
#agents .ag-detail-copy h3{font-size:14px;color:var(--ag-muted);line-height:1.5;font-weight:650;margin:0 0 9px}
#agents .ag-detail-copy p{font-size:16px;line-height:1.9;margin:0 0 22px;max-width:72ch;white-space:pre-wrap;overflow-wrap:anywhere}
#agents .ag-detail-footer{flex:none;padding-top:15px;background:#fff}
#agents #agentDetailNotice{display:block;font-size:13px;line-height:1.6;color:#686f7b}
#agents #agentDetailNotice:not(:empty){margin-bottom:12px}
#agents .ag-use{display:flex;width:100%;align-items:center;justify-content:center;gap:12px;border:0;border-radius:999px;background:#17191d;color:#fff;min-height:56px;padding:13px 22px;font:inherit;font-size:19px;font-weight:650;cursor:pointer;box-shadow:none}
#agents .ag-use svg{width:23px;height:23px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#agents .ag-use:hover{background:#333741}
#agents .ag-use:disabled{background:#e9eaed;color:#7e8490;cursor:not-allowed}
@media(max-width:760px){#agents .ag-detail{width:calc(100vw - 24px);max-height:calc(100dvh - 32px);padding:20px 18px 16px;border-radius:20px}#agents .ag-detail-header{gap:8px;flex-wrap:wrap;padding-bottom:17px}#agents .ag-detail-heading{flex-basis:100%;padding-right:28px}#agents .ag-detail-heading h2{font-size:21px;margin-bottom:8px}#agents .ag-detail-heading p{font-size:12px}#agents .ag-detail-actions{margin-left:auto;height:32px}#agents .ag-close{position:absolute;right:6px;top:8px;margin:0}#agents .ag-detail-cover{border-radius:12px}#agents .ag-detail-cover .ag-cover{aspect-ratio:16/9}#agents .ag-detail-cover .ag-cover-caption{padding:12px 14px}#agents .ag-detail-cover .ag-cover-caption b{font-size:20px}#agents .ag-detail-cover .ag-cover-caption>span{font-size:11px}#agents .ag-detail-cover .ag-cover-hook .ag-cover-caption b{font-size:44px}#agents .ag-detail-copy{padding-top:20px}#agents .ag-detail-copy p{font-size:14px;line-height:1.8;margin-bottom:19px}#agents .ag-detail-copy h3{font-size:13px}#agents .ag-detail-footer{padding-top:10px}#agents .ag-use{min-height:50px;font-size:17px}}
/* The directory guide lives in normal flow so it never covers a filter or card. */
body.ag-route:has(#agents.is-gallery)>.tour-help-btn{display:none!important}
#agents .ag-gallery-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-top:14px}
#agents .ag-gallery-footer .ag-status{padding:0;min-height:0}
#agents .ag-help{flex:none;min-height:44px;padding:10px 12px;border:0;background:transparent;color:#626976;box-shadow:none;font:inherit;font-size:12px;cursor:pointer;text-decoration:underline;text-underline-offset:4px;border-radius:8px}
#agents .ag-help:hover{background:var(--ag-soft)}

/* Individually generated covers already contain their typography. */
#agents .ag-cover-generated .ag-cover-caption{display:none!important}
#agents .ag-cover-generated img{filter:none!important;object-fit:contain}
#agents .ag-detail-cover .ag-cover-generated{width:100%;aspect-ratio:16/9;max-height:none}
/* Successful reply totals, not card-open counts. */
#agents .ag-heat{display:flex;align-items:center;gap:8px;min-width:0;font-size:12px;color:var(--ag-muted);flex-wrap:wrap;row-gap:2px}
#agents .ag-heat-label{display:flex;align-items:center;gap:5px;white-space:nowrap}
#agents .ag-heat-label svg{width:16px;height:18px;fill:none;stroke:#b56c3b;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
#agents .ag-heat-value{color:#575e6a;font-variant-numeric:tabular-nums;white-space:nowrap}
@media(max-width:760px){#agents .ag-heat{font-size:11px;column-gap:5px}#agents .ag-heat-label{gap:3px}#agents .ag-heat-label svg{width:13px;height:15px}}

/* A selected agent has its own chat surface; switching goes through the gallery. */
#agents:not(.is-gallery) #agentList,
#agents:not(.is-gallery) .jc-agentsel{display:none!important}
#agents .ag-chat-heading{display:block!important;order:1;flex:1 1 auto;min-width:0;max-width:none!important;margin:0!important;padding:0!important;color:var(--ink,#20252f)!important;font-size:16px!important;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#agents .ag-chat-heading>span{display:none!important}
#agents .ag-chat-heading>strong{font-size:inherit;font-weight:650}
#agents .jc-topbar .ag-back{order:0;margin-right:0!important}
#agents #chatExportBtn{order:2}
#agents #chatClearBtn{order:3}
@media(max-width:760px){
 #agents .jc-topbar{flex-wrap:wrap!important;gap:8px!important}
 #agents .ag-chat-heading{order:0;flex:1 0 100%;font-size:15px!important;white-space:normal;overflow-wrap:anywhere}
 #agents .jc-topbar .ag-back{order:1;margin-right:auto!important}
}

/* Single-surface filter controls; remove inherited native inset chrome. */
#agents .ag-filters{gap:10px}
#agents .ag-select{position:relative;display:block;padding:0;min-height:40px;background:#fff;border:1px solid #e5e7ec;border-radius:10px;color:#606875;transition:border-color .15s,background-color .15s}
#agents .ag-select:hover{border-color:#c5c9d2;background:#fafafb}
#agents .ag-select:focus-within{outline:2px solid #7773dc;outline-offset:2px;border-color:transparent}
#agents .ag-select>svg{position:absolute;left:13px;top:50%;transform:translateY(-50%);width:17px;height:17px;pointer-events:none;stroke-width:1.65}
#agents .ag-select::after{content:'';position:absolute;right:15px;top:calc(50% - 4px);width:6px;height:6px;border-right:1.5px solid #858b96;border-bottom:1.5px solid #858b96;transform:rotate(45deg);pointer-events:none}
#agents .ag-select select{display:block;appearance:none!important;-webkit-appearance:none!important;width:142px!important;max-width:none!important;min-height:40px!important;padding:9px 32px 9px 40px!important;margin:0!important;border:0!important;border-radius:10px!important;background:transparent!important;box-shadow:none!important;outline:none!important;font-family:inherit!important;font-size:14px!important;font-weight:500!important;line-height:22px!important;color:#3e4653!important;cursor:pointer}
#agents .ag-select select:focus-visible{outline:none!important}
#agents .ag-select:last-child select{width:136px!important}
@media(max-width:760px){
 #agents .ag-filters{gap:7px}
 #agents .ag-select{border-radius:9px;min-height:40px}
 #agents .ag-select>svg{left:10px;width:15px;height:15px}
 #agents .ag-select::after{right:12px;width:5px;height:5px}
 #agents .ag-select select{width:116px!important;padding:9px 23px 9px 30px!important;font-size:12px!important;border-radius:9px!important}
 #agents .ag-select:last-child select{width:116px!important}
}
