.cpa-workbench { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 14px; color: var(--ink); }
.cpa-workbench > *, .cpa-card, .cpa-table-shell { min-width: 0; }
.cpa-live-dot i { width: 7px; height: 7px; background: #55c997; border-radius: 50%; box-shadow: 0 0 0 5px rgba(33, 159, 109, .1); }

.cpa-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.cpa-metrics article { position: relative; min-height: 116px; padding: 18px 19px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-soft); }
.cpa-metrics article::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; content: ""; background: #7b8da8; }
.cpa-metrics article.checked::before { background: var(--blue); }
.cpa-metrics article.alive::before { background: #20a870; }
.cpa-metrics article.quota::before { background: #8a62e8; }
.cpa-metrics article.dead::before { background: var(--red); }
.cpa-metrics span, .cpa-metrics small, .cpa-metrics strong { display: block; }
.cpa-metrics span { color: #6a7a91; font-size: 11px; font-weight: 700; }
.cpa-metrics strong { margin-top: 6px; color: #182840; font: 800 29px/1.05 var(--mono); }
.cpa-metrics .alive strong { color: var(--green); }
.cpa-metrics .quota strong { color: #7651d5; }
.cpa-metrics .dead strong { color: var(--red); }
.cpa-metrics small { margin-top: 7px; overflow: hidden; color: #96a3b5; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.cpa-card { padding: 25px; background: rgba(255, 255, 255, .97); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-soft); }
.cpa-section-head { display: flex; margin-bottom: 20px; align-items: flex-start; justify-content: space-between; gap: 22px; }
.cpa-section-head > div:first-child > span { color: var(--blue); font: 800 9px/1 var(--mono); letter-spacing: .14em; }
.cpa-section-head h3 { margin: 7px 0 3px; font-size: 18px; line-height: 1.3; letter-spacing: -.02em; }
.cpa-section-head p { margin: 0; color: var(--muted); font-size: 11px; }
.cpa-limit, .cpa-live-dot { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; color: #72839c; font: 750 9px/1 var(--mono); letter-spacing: .07em; }
.cpa-live-dot { color: var(--green); }

.cpa-import-grid { display: grid; grid-template-columns: minmax(340px, .9fr) minmax(420px, 1.35fr); gap: 14px; }
.cpa-dropzone { display: grid; min-height: 210px; padding: 24px; cursor: pointer; place-items: center; align-content: center; text-align: center; background: #f5f9ff; border: 1.5px dashed #b9cde8; border-radius: 15px; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.cpa-dropzone:hover, .cpa-dropzone.dragging { background: #edf5ff; border-color: var(--blue); transform: translateY(-1px); }
.cpa-upload-icon { display: grid; width: 44px; height: 44px; margin-bottom: 10px; color: var(--blue); background: #e0ecff; border-radius: 13px; place-items: center; font: 800 22px/1 var(--sans); }
.cpa-dropzone strong { font-size: 14px; }
.cpa-dropzone small { margin-top: 4px; color: #8594aa; font-size: 10px; }
.cpa-link-button { margin-top: 13px; padding: 7px 15px; color: var(--blue); background: #fff; border: 1px solid #c9daf1; border-radius: 9px; font-size: 10px; font-weight: 750; pointer-events: none; }
.cpa-paste-box { display: grid; min-height: 210px; padding: 16px; grid-template-rows: auto 1fr auto; gap: 8px; background: #f9fbfe; border: 1px solid var(--line-soft); border-radius: 15px; }
.cpa-paste-box label { color: #2f4059; font-size: 11px; font-weight: 750; }
.cpa-paste-box textarea { width: 100%; min-height: 134px; padding: 13px; resize: vertical; color: #20314b; background: #fff; border: 1px solid #cfdbeb; border-radius: 10px; outline: 0; font: 11px/1.7 var(--mono); transition: border-color .2s ease, box-shadow .2s ease; }
.cpa-paste-box textarea:focus { border-color: #7fa9f5; box-shadow: 0 0 0 3px rgba(36, 103, 237, .1); }
.cpa-paste-box small { color: #8b99ac; font-size: 9px; }
.cpa-file-rail { display: flex; min-height: 42px; margin-top: 12px; padding: 7px 10px; overflow-x: auto; align-items: center; flex-wrap: nowrap; gap: 7px; color: #8a98ac; background: #f8fafd; border: 1px solid var(--line-soft); border-radius: 11px; font-size: 10px; }
.cpa-file-chip { display: inline-flex; width: clamp(220px, 24vw, 360px); max-width: 82vw; min-width: 0; padding: 6px 8px 6px 10px; flex: 0 0 auto; align-items: center; gap: 7px; color: #40516b; background: #fff; border: 1px solid #d7e1ee; border-radius: 8px; white-space: nowrap; }
.cpa-file-chip b { min-width: 0; overflow: hidden; flex: 1 1 auto; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.cpa-file-chip small { flex: 0 0 auto; color: #93a0b2; font: 8px/1 var(--mono); white-space: nowrap; }
.cpa-file-chip button { padding: 0 2px; flex: 0 0 auto; color: #a04d58; background: none; border: 0; font-size: 15px; line-height: 1; }

.cpa-actions { display: flex; margin-top: 15px; align-items: center; flex-wrap: wrap; gap: 8px; }
.cpa-actions.compact { margin: 0; justify-content: flex-end; }
.cpa-button { min-height: 37px; padding: 8px 14px; color: #40516b; background: #fff; border: 1px solid #cfdbea; border-radius: 9px; font-size: 10px; font-weight: 750; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.cpa-button:hover:not(:disabled) { border-color: #9db7db; transform: translateY(-1px); }
.cpa-button:focus-visible, .cpa-filter-group button:focus-visible, .cpa-row-actions button:focus-visible { outline: 3px solid rgba(36, 103, 237, .22); outline-offset: 2px; }
.cpa-button:disabled { opacity: .42; }
.cpa-button.primary { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 8px 18px rgba(36, 103, 237, .18); }
.cpa-button.primary:hover:not(:disabled) { background: var(--blue-dark); }
.cpa-button.dark { color: #fff; background: #202d43; border-color: #202d43; }
.cpa-button.danger { color: #c44152; background: var(--red-soft); border-color: #f1cbd1; }
.cpa-button.ghost { background: #f8fafd; }

.cpa-config-grid { display: grid; grid-template-columns: 1.4fr 1.4fr repeat(3, minmax(120px, .8fr)); gap: 10px; }
.cpa-config-grid label { display: grid; gap: 6px; }
.cpa-config-grid label > span { color: #46566d; font-size: 10px; font-weight: 750; }
.cpa-config-grid select { width: 100%; min-height: 40px; padding: 0 32px 0 11px; color: #243650; background: #f8fafd; border: 1px solid #d1ddec; border-radius: 9px; outline: 0; font-size: 11px; }
.cpa-config-grid select:focus { border-color: #7fa9f5; box-shadow: 0 0 0 3px rgba(36, 103, 237, .1); }
.cpa-runbar { display: grid; margin-top: 18px; padding-top: 18px; align-items: end; grid-template-columns: minmax(320px, 1fr) auto; gap: 22px; border-top: 1px solid var(--line-soft); }
.cpa-progress > div:first-child { display: flex; margin-bottom: 7px; justify-content: space-between; gap: 16px; color: #6d7d93; font-size: 10px; }
.cpa-progress strong { color: #2d3e57; font: 750 10px/1 var(--mono); }
.cpa-progress-track { height: 7px; overflow: hidden; background: #e8eef6; border-radius: 10px; }
.cpa-progress-track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--blue), #70a5ff); border-radius: inherit; transition: width .35s ease; }

.result-head { align-items: center; }
.cpa-export-actions { display: flex; max-width: 760px; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.cpa-table-tools { display: flex; margin-bottom: 10px; align-items: center; justify-content: space-between; gap: 16px; }
.cpa-filter-group { display: flex; padding: 3px; overflow-x: auto; gap: 2px; background: #f0f4f9; border-radius: 9px; }
.cpa-filter-group button { min-height: 30px; padding: 5px 11px; color: #718097; background: transparent; border: 0; border-radius: 7px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.cpa-filter-group button.active { color: var(--blue); background: #fff; box-shadow: 0 3px 10px rgba(36, 66, 105, .09); }
.cpa-table-tools > span { color: #8794a7; font: 9px/1 var(--mono); }
.cpa-table-shell { overflow: auto; border: 1px solid #d9e3ef; border-radius: 13px; }
.cpa-table { width: 100%; min-width: 1280px; border-collapse: collapse; table-layout: fixed; }
.cpa-table th { position: sticky; z-index: 1; top: 0; padding: 11px 10px; color: #718096; text-align: left; background: #f5f8fc; border-bottom: 1px solid #dce5f0; font-size: 9px; font-weight: 800; letter-spacing: .02em; }
.cpa-table th:nth-child(1) { width: 240px; }
.cpa-table th:nth-child(2) { width: 90px; }
.cpa-table th:nth-child(3), .cpa-table th:nth-child(4), .cpa-table th:nth-child(5) { width: 100px; }
.cpa-table th:nth-child(6), .cpa-table th:nth-child(7) { width: 150px; }
.cpa-table th:nth-child(8) { width: 180px; }
.cpa-table th:nth-child(9) { width: 105px; }
.cpa-table td { padding: 12px 10px; vertical-align: middle; border-bottom: 1px solid #e8eef5; font-size: 10px; }
.cpa-table th:nth-child(9),
.cpa-table td:nth-child(9) {
  position: sticky;
  right: 0;
  background: #fff;
  border-left: 1px solid #e2e9f2;
  box-shadow: -12px 0 20px -20px rgba(28, 48, 78, .65);
}
.cpa-table th:nth-child(9) { z-index: 4; background: #f5f8fc; }
.cpa-table td:nth-child(9) { z-index: 2; }
.cpa-table tbody tr:last-child td { border-bottom: 0; }
.cpa-table tbody tr:hover { background: #fbfdff; }
.cpa-table tbody tr:hover td:nth-child(9) { background: #fbfdff; }
.cpa-identity { min-width: 0; }
.cpa-identity strong, .cpa-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpa-identity strong { color: #273953; font-size: 11px; }
.cpa-identity small { margin-top: 3px; color: #94a1b3; font-size: 8px; }
.cpa-plan { display: inline-flex; padding: 4px 7px; color: #5a4a9f; background: #f0edff; border-radius: 6px; font: 750 8px/1 var(--mono); text-transform: uppercase; }
.cpa-probe { display: inline-flex; padding: 5px 7px; align-items: center; gap: 5px; color: #7a889c; background: #f1f4f8; border-radius: 6px; font-size: 8px; font-weight: 750; }
.cpa-probe::before { width: 5px; height: 5px; content: ""; background: currentColor; border-radius: 50%; }
.cpa-probe.ok { color: #12875b; background: #e9f8f1; }
.cpa-probe.warn { color: #a56a09; background: #fff7e7; }
.cpa-probe.bad { color: #c04455; background: #fff0f2; }
.cpa-probe.idle { color: #8593a7; }
.cpa-quota-cell { min-width: 120px; }
.cpa-quota-cell > div { display: flex; margin-bottom: 5px; align-items: center; justify-content: space-between; gap: 7px; }
.cpa-quota-cell strong { color: #2c3e58; font: 750 9px/1 var(--mono); }
.cpa-quota-cell small { color: #97a3b4; font-size: 7px; white-space: nowrap; }
.cpa-quota-cell > span { display: block; height: 4px; overflow: hidden; background: #e8edf4; border-radius: 8px; }
.cpa-quota-cell > span i { display: block; height: 100%; background: #6a9cf4; border-radius: inherit; }
.cpa-quota-cell > span i.full { background: var(--red); }
.cpa-status { display: inline-flex; max-width: 170px; padding: 6px 8px; overflow: hidden; align-items: center; gap: 6px; border-radius: 7px; font-size: 8px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.cpa-status::before { width: 6px; height: 6px; flex: 0 0 auto; content: ""; border-radius: 50%; background: currentColor; }
.cpa-status.alive { color: #147b55; background: #e9f8f1; }
.cpa-status.quota { color: #6744bd; background: #f0edff; }
.cpa-status.dead { color: #bd3d4d; background: #fff0f2; }
.cpa-status.unknown { color: #9a660e; background: #fff6e4; }
.cpa-status.pending { color: #64758d; background: #eef2f7; }
.cpa-status-wrap { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 5px; }
.cpa-checked-time { color: #7f8da2; font: 8px/1.35 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cpa-row-actions { display: flex; gap: 5px; }
.cpa-row-actions button { padding: 5px 6px; color: #56708f; background: #fff; border: 1px solid #d5dfeb; border-radius: 6px; font-size: 8px; }
.cpa-row-actions button:last-child { color: #bb4655; }
.cpa-row-actions button:disabled { opacity: .45; }
.cpa-empty { display: grid; min-height: 180px; place-items: center; align-content: center; gap: 3px; color: #8695aa; text-align: center; }
.cpa-empty strong { color: #53647c; font-size: 12px; }
.cpa-empty span { font-size: 9px; }
.cpa-pagination { display: flex; margin-top: 11px; justify-content: flex-end; gap: 7px; }

@media (max-width: 1180px) {
  .cpa-metrics { grid-template-columns: repeat(3, 1fr); }
  .cpa-config-grid { grid-template-columns: repeat(3, 1fr); }
  .cpa-import-grid { grid-template-columns: 1fr; }
  .cpa-runbar { grid-template-columns: 1fr; }
  .cpa-actions.compact { justify-content: flex-start; }
  .result-head { align-items: flex-start; flex-direction: column; }
  .cpa-export-actions { max-width: none; justify-content: flex-start; }
}
@media (max-width: 720px) {
  .cpa-metrics { grid-template-columns: repeat(2, 1fr); }
  .cpa-metrics article { min-height: 100px; }
  .cpa-card { padding: 18px; }
  .cpa-section-head { flex-direction: column; gap: 10px; }
  .cpa-import-grid { display: block; }
  .cpa-paste-box { margin-top: 10px; }
  .cpa-config-grid { grid-template-columns: repeat(2, 1fr); }
  .cpa-table-tools { align-items: flex-start; flex-direction: column; }
  .cpa-filter-group { width: 100%; }
}
@media (max-width: 430px) {
  .cpa-metrics { grid-template-columns: 1fr 1fr; }
  .cpa-metrics article:first-child { grid-column: 1 / -1; }
  .cpa-config-grid { grid-template-columns: 1fr; }
  .cpa-actions.compact .cpa-button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .cpa-dropzone, .cpa-button, .cpa-progress-track i { transition: none; }
}
