/* Trang Extensions (extensions_view.js) — lưới thẻ kiểu BitBrowser trong thế giới đen-vàng của STC. Chỉ dùng token của stc_theme.css. */
#view-extensions { overflow: auto; }
.ex-page { display: grid; gap: 14px; padding: 20px 24px 28px; max-width: 1400px; }
.ex-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ex-tabs { width: max-content; }
.ex-search, .ex-input { height: 36px; min-width: 260px; padding: 0 12px; border: 1px solid var(--stc-border-ctl); border-radius: var(--stc-r-ctl); background: var(--stc-input); color: var(--stc-text-strong); font: inherit; }
.ex-input { width: 100%; box-sizing: border-box; }
.ex-search:focus, .ex-input:focus { outline: 0; border-color: var(--stc-accent-text); }
.ex-cats { display: flex; flex-wrap: wrap; gap: 4px 18px; border-bottom: 1px solid var(--stc-border); margin-bottom: 14px; }
.ex-cat { padding: 8px 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--stc-muted); font: inherit; font-size: 13.5px; cursor: pointer; margin-bottom: -1px; }
.ex-cat:hover { color: var(--stc-text-strong); }
.ex-cat[aria-selected="true"] { color: var(--stc-accent-text); border-bottom-color: var(--stc-accent-text); font-weight: 600; }
.ex-cat:focus-visible { outline: 2px solid var(--stc-focus); outline-offset: 2px; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ex-card { display: flex; flex-direction: column; gap: 10px; min-height: 150px; padding: 16px; border: 1px solid var(--stc-border); border-radius: var(--stc-r-card); background: var(--stc-surface); }
.ex-card:hover { border-color: var(--stc-border-hover); }
.ex-card.off { opacity: .72; }
.ex-card-top { display: flex; align-items: center; gap: 12px; }
.ex-card-top > div { flex: 1; min-width: 0; }
.ex-card h3 { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--stc-text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-ico { flex: none; width: 36px; height: 36px; border-radius: 8px; object-fit: contain; }
.ex-ico-ph { display: inline-grid; place-items: center; background: var(--stc-accent-soft); color: var(--stc-accent-text); font-weight: 700; font-size: 16px; }
.ex-desc { flex: 1; margin: 0; font-size: 13px; line-height: 1.5; color: var(--stc-text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ex-bad { color: var(--stc-warn); }
.ex-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.ex-card-foot { flex-wrap: wrap; row-gap: 10px; }
.ex-card-foot .muted { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
.ex-card-foot:has(.ex-btns) .muted { flex-basis: 100%; }
.ex-btns { display: inline-flex; gap: 6px; flex: none; margin-left: auto; }
.ex-tag { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--stc-fill-2); color: var(--stc-muted); }
.ex-tag.ok { background: var(--stc-ok-soft); color: var(--stc-ok-text); }
.ex-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ex-note { margin: -4px 0 4px; font-size: 12.5px; }
.ex-switch { position: relative; flex: none; width: 36px; height: 20px; cursor: pointer; }
.ex-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ex-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--stc-fill-2); border: 1px solid var(--stc-border-ctl); transition: background .15s var(--stc-ease); }
.ex-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--stc-muted); transition: transform .15s var(--stc-ease), background .15s var(--stc-ease); }
.ex-switch input:checked + span { background: var(--stc-accent-soft); border-color: var(--stc-accent-text); }
.ex-switch input:checked + span::after { transform: translateX(16px); background: var(--stc-accent-text); }
.ex-switch input:focus-visible + span { outline: 2px solid var(--stc-focus); outline-offset: 2px; }
.ex-radio { display: flex; align-items: center; gap: 8px; margin: 8px 0; color: var(--stc-text); }
.ex-groups { display: grid; gap: 6px; max-height: 260px; overflow: auto; margin: 4px 0 8px 24px; }
.ex-groups label { display: flex; align-items: center; gap: 8px; color: var(--stc-text); }
@media (max-width: 760px) { .ex-page { padding: 14px 16px 22px; } .ex-search { min-width: 0; width: 100%; } }
@media (prefers-reduced-motion: reduce) { .ex-switch span, .ex-switch span::after { transition: none; } }
