/* STS Browser — ô proxy của bảng hồ sơ, hộp "Cập nhật proxy" (proxy_quick.js) và trang Kho proxy (proxy_pool.js).
   Chỉ dùng token của stc_theme.css => tự đổi theo Sáng/Tối. Lớp riêng: pxq-* (ô + hộp thoại), pxp-* (trang kho). */

/* ---- ô proxy trong bảng hồ sơ ---- */
.pxq-cell { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; min-width: 0; margin-left: -7px; padding: 4px 7px; border: 1px solid transparent; border-radius: var(--stc-r-ctl);
  background: transparent; color: var(--stc-text); font: inherit; font-size: 13.5px; line-height: 1.2; text-align: left; cursor: pointer; }
.pxq-cell.is-static { cursor: default; }
button.pxq-cell:hover { background: var(--stc-row-hover); border-color: var(--stc-border); }
button.pxq-cell:focus-visible { outline: 2px solid var(--stc-accent); outline-offset: 1px; }
.pxq-cell .pxq-pen { flex-shrink: 0; color: var(--stc-muted); opacity: 0; transition: opacity 120ms ease-out; }
button.pxq-cell:hover .pxq-pen, button.pxq-cell:focus-visible .pxq-pen { opacity: 1; }
.pxq-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pxq-main.is-ip, .pxq-num, .pxp-ip, .pxp-hp, .pxp-lat, .pxq-hp { font-variant-numeric: tabular-nums; }
.pxq-direct { color: var(--stc-muted); }
.pxq-type { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box;
  border-radius: var(--stc-r-ctl); font-size: 11px; font-weight: 700; letter-spacing: 0.02em; border: 1px solid currentColor; }
.pxq-type.is-s { color: var(--stc-info-text); background: color-mix(in srgb, var(--stc-info-text) 12%, transparent); }
.pxq-type.is-h { color: var(--stc-accent-text); background: var(--stc-accent-soft); }
.pxq-type.is-api { color: var(--stc-purple-text); background: color-mix(in srgb, var(--stc-purple-text) 12%, transparent); }
.pxq-cc { flex-shrink: 0; display: inline-block; padding: 0 5px; border-radius: 4px; border: 1px solid var(--stc-border); background: var(--stc-surface-2);
  color: var(--stc-text); font-size: 11px; font-weight: 600; line-height: 16px; letter-spacing: 0.03em; }
.pxq-pool { flex-shrink: 0; display: inline-flex; color: var(--stc-muted); }

/* ---- hộp thoại ---- */
.pxq-modal { width: min(700px, 94vw); padding: 0; display: flex; flex-direction: column; max-height: 90vh; overflow: hidden; }
.pxq-modal.pxq-narrowmodal { width: min(620px, 94vw); }
.pxq-modal > * { padding-left: 22px; padding-right: 22px; }
.pxq-modal [hidden], #stc-proxy-pool [hidden] { display: none !important; }      /* lớp có display (grid/flex) không được thắng thuộc tính hidden */
.pxq-modal > .pxq-pane, .pxq-modal > .pxq-grid, .pxq-modal > .pxq-f, .pxq-modal > .pxq-testrow, .pxq-modal > p, .pxq-modal > #pi-res { flex-shrink: 0; }
.pxq-modal .pxq-pane { overflow-y: auto; flex: 1 1 auto; padding-top: 16px; padding-bottom: 6px; }
.pxq-head { display: flex; align-items: center; gap: 12px; padding-top: 18px; padding-bottom: 12px; }
.pxq-head h3 { margin: 0; flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; font-size: 18px; color: var(--stc-text-strong); }
.pxq-pname { font-weight: 500; color: var(--stc-muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pxq-x { flex-shrink: 0; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--stc-r-card); border: 1px solid transparent;
  background: transparent; color: var(--stc-muted); cursor: pointer; }
.pxq-x:hover { background: var(--stc-row-hover); border-color: var(--stc-border); color: var(--stc-text-strong); }
.pxq-x:focus-visible, .pxq-tabs button:focus-visible, .pxp-ib:focus-visible { outline: 2px solid var(--stc-accent); outline-offset: 1px; }
.pxq-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--stc-border); }
.pxq-tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 12px; color: var(--stc-muted); font-size: 14.5px; cursor: pointer; }
.pxq-tabs button:hover { color: var(--stc-text-strong); }
.pxq-tabs button[aria-selected="true"] { color: var(--stc-accent-text); border-bottom-color: var(--stc-accent); font-weight: 600; }
.pxq-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; margin-bottom: 12px; }
.pxq-f { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; min-width: 0; border: 0; padding: 0; }
.pxq-grid > .pxq-f { margin: 0; }
.pxq-modal > .pxq-f { padding-left: 22px; padding-right: 22px; }      /* ô nằm thẳng trong hộp (hộp thêm/nhập proxy): cùng lề với các khối khác */
.pxq-narrow { max-width: 240px; }
.pxq-l { font-size: 13px; font-weight: 600; color: var(--stc-text); padding: 0; }
.pxq-d { display: block; font-size: 12.5px; line-height: 1.45; color: var(--stc-muted); font-weight: 400; margin: 0; }
.pxq-modal textarea { min-height: 0; font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; resize: vertical; }
.pxq-modal input[type="text"]:focus, .pxq-modal select:focus, .pxq-modal textarea:focus { outline: none; border-color: var(--stc-accent); box-shadow: 0 0 0 3px var(--stc-accent-soft); }
.pxq-modal input[type="text"]:disabled { opacity: 0.5; cursor: not-allowed; }
.pxq-modal input::placeholder, .pxq-modal textarea::placeholder { color: var(--stc-dim); }
.pxq-inline { display: flex; gap: 8px; }
.pxq-inline input { flex: 1; min-width: 0; }
.pxq-testrow { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin: 4px 0 8px; min-height: 32px; }
.pxq-testrow > div { flex: 1; min-width: 220px; padding-top: 6px; }
.pxq-res { display: inline-flex; align-items: flex-start; gap: 7px; font-size: 13px; line-height: 1.45; margin: 0; }
.pxq-res svg { flex-shrink: 0; margin-top: 2px; }
.pxq-res.is-ok { color: var(--stc-ok-text); } .pxq-res.is-ok b { color: var(--stc-text-strong); font-weight: 600; }
.pxq-res.is-err { color: var(--stc-err-text); }
.pxq-res.is-warn { color: var(--stc-gold-text); }
.pxq-modes { margin-bottom: 12px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.pxq-modes legend { margin-bottom: 6px; grid-column: 1 / -1; }
.pxq-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--stc-border); border-radius: var(--stc-r-card); background: var(--stc-surface); cursor: pointer; }
.pxq-opt:hover { border-color: var(--stc-border-ctl); }
.pxq-opt:has(input:checked) { border-color: var(--stc-border-hover); background: var(--stc-fill-active); }
.pxq-opt:has(input:focus-visible) { outline: 2px solid var(--stc-accent); outline-offset: 1px; }
.pxq-opt input { margin: 2px 0 0; accent-color: var(--stc-accent); width: 16px; height: 16px; flex-shrink: 0; }
.pxq-opt b { display: block; font-weight: 600; font-size: 13.5px; color: var(--stc-text-strong); margin-bottom: 2px; }
.pxq-check { margin-bottom: 12px; }
.pxq-note { display: flex; gap: 9px; align-items: flex-start; margin: 4px 0 12px; padding: 10px 12px; border-radius: var(--stc-r-card); border: 1px solid var(--stc-border);
  background: var(--stc-surface-2); color: var(--stc-text); font-size: 13px; line-height: 1.5; }
.pxq-modal > .pxq-note { margin-left: 22px; margin-right: 22px; }
.pxq-note svg { flex-shrink: 0; margin-top: 2px; color: var(--stc-info-text); }
.pxq-foot { display: flex; align-items: center; gap: 8px; padding-top: 14px; padding-bottom: 16px; border-top: 1px solid var(--stc-border); margin-top: 6px; flex-shrink: 0; }
.pxq-grow { flex: 1; }
.pxq-foot .pxq-d { max-width: 52%; }
.pxq-pooltool { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.pxq-pooltool .stc-search { min-width: 0; max-width: none; }
.pxq-pooltool .stc-search input { padding-left: 34px; }
.pxq-poollist { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; margin-bottom: 10px; padding: 2px; scrollbar-color: var(--stc-border) transparent; }
.pxq-pitem { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 3px; align-items: center; padding: 9px 12px; border: 1px solid var(--stc-border);
  border-radius: var(--stc-r-card); cursor: pointer; background: var(--stc-surface); }
.pxq-pitem:hover { border-color: var(--stc-border-ctl); }
.pxq-pitem.is-sel { border-color: var(--stc-border-hover); background: var(--stc-fill-active); }
.pxq-pitem:has(input:focus-visible) { outline: 2px solid var(--stc-accent); outline-offset: 1px; }
.pxq-pitem input { grid-row: 1 / span 2; accent-color: var(--stc-accent); width: 16px; height: 16px; margin: 0; }
.pxq-pmain, .pxq-pmeta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pxq-pmain .pxq-hp { color: var(--stc-text-strong); font-weight: 600; }
.pxq-pmeta { font-size: 12.5px; color: var(--stc-muted); flex-wrap: wrap; }
.pxq-muted { color: var(--stc-muted); }
.pxq-bad { color: var(--stc-err-text); }
.pxq-linked { color: var(--stc-text); }
.pxq-note-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.pxq-spin { animation: pxq-rot 0.9s linear infinite; }
@keyframes pxq-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pxq-spin { animation: none; } .pxq-cell .pxq-pen { transition: none; } }
.pi-sum { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.pi-errs { margin: 0; padding: 8px 12px 8px 28px; max-height: 140px; overflow-y: auto; border-radius: var(--stc-r-card); border: 1px solid var(--stc-border); background: var(--stc-surface-2);
  font-size: 12.5px; color: var(--stc-text); width: 100%; box-sizing: border-box; }
.pi-errs b { color: var(--stc-err-text); font-weight: 600; }
.pxq-modal #pd-msg { margin: 0 0 6px; color: var(--stc-text); line-height: 1.55; }
@media (max-width: 640px) { .pxq-grid, .pxq-modes { grid-template-columns: minmax(0, 1fr); } .pxq-foot .pxq-d { max-width: none; } }

/* ---- trang Kho proxy ---- */
#view-proxies.pxp-ready > .table-card { display: none; }      /* khối cũ (kiểm nhanh + danh sách proxy đang gắn) thay bằng kho; giữ nguyên mã cũ, chỉ ẩn */
#stc-proxy-pool .stc-page-head { padding-top: 22px; }
.pxp-head-act { display: flex; gap: 10px; }
.pxp-bulk { min-height: 34px; }
.pxp-grow { flex: 1; }
.pxp-sum { display: inline-flex; align-items: center; gap: 6px; color: var(--stc-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pxp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--stc-dim); display: inline-block; margin-left: 8px; }
.pxp-dot.ok { background: var(--stc-ok); } .pxp-dot.bad { background: var(--stc-err); }
.pxp-table td { height: 52px; }
.pxp-num-h, .pxp-num-c { text-align: right; }
.pxp-proxy, .pxp-geo, .pxp-notes { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pxp-hp { color: var(--stc-text-strong); font-weight: 600; white-space: nowrap; }
.pxp-user { color: var(--stc-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.pxp-rot { display: inline-flex; color: var(--stc-muted); }
.pxp-ip { color: var(--stc-text-strong); white-space: nowrap; }
.pxp-place { color: var(--stc-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.pxp-bad { display: inline-flex; align-items: center; gap: 6px; color: var(--stc-err-text); white-space: nowrap; }
.pxp-muted { color: var(--stc-muted); display: inline-flex; align-items: center; gap: 6px; }
.pxp-lat { color: var(--stc-text); white-space: nowrap; }
.pxp-lat.is-slow { color: var(--stc-gold-text); }
.pxp-linked { display: inline-block; padding: 2px 9px; border-radius: var(--stc-r-ctl); background: var(--stc-accent-soft); color: var(--stc-accent-text); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pxp-notes { flex-wrap: wrap; row-gap: 4px; max-width: 320px; }
.pxp-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; color: var(--stc-text); font-size: 13px; }
.pxp-tag { display: inline-block; padding: 1px 7px; border-radius: var(--stc-r-ctl); border: 1px solid var(--stc-border); background: var(--stc-surface-2); color: var(--stc-text); font-size: 12px; }
.pxp-acts { display: flex; gap: 4px; }
.pxp-ib { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--stc-r-card); border: 1px solid transparent; background: transparent;
  color: var(--stc-text); cursor: pointer; }
.pxp-ib:hover { background: var(--stc-row-hover); border-color: var(--stc-border); }
.pxp-ib.danger:hover { color: var(--stc-err); border-color: var(--stc-err); }
.pxp-empty { height: 160px; text-align: center; color: var(--stc-muted); }
.pxp-empty-in { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pxp-empty-in b { color: var(--stc-text-strong); font-size: 15px; }
.pxp-empty-act { display: flex; gap: 8px; margin-top: 6px; }
.pxp-empty-act .stc-btn2 svg, .pxp-head-act svg, .pxp-bulk svg { flex-shrink: 0; }
