.button, .icon-button {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-weight: 650;
}
.button { padding: 0 13px; font-size: 12px; }
.icon-button { width: 36px; padding: 0; font-size: 17px; }
.button:hover, .icon-button:hover { border-color: var(--accent); }
.button-primary { color: #071313; background: var(--accent); border-color: var(--accent); }
html[data-theme="light"] .button-primary { color: #fff; }
.button-danger { color: var(--red); }
.button b { display: inline-grid; min-width: 17px; height: 17px; place-items: center; padding: 0 4px; color: #fff; background: var(--red); border-radius: 9px; font-size: 9px; }

.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-header { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 16px; }
.metric-card { position: relative; min-height: 126px; padding: 17px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.metric-label { color: var(--text-muted); font-size: 11px; font-weight: 650; }
.metric-value { margin-top: 10px; font-size: 27px; line-height: 1; font-weight: 760; font-variant-numeric: tabular-nums; }
.metric-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; color: var(--text-muted); font-size: 10px; }
.metric-delta { color: var(--green); }
.metric-bar { position: absolute; inset: auto 0 0; height: 3px; background: var(--metric-color, var(--accent)); }

.status-badge { display: inline-flex; min-height: 23px; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 3px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-badge::before { width: 6px; height: 6px; content: ""; background: currentColor; border-radius: 50%; }
.status-pending, .status-queued { color: var(--amber); background: var(--amber-soft); }
.status-usable, .status-online, .status-completed { color: var(--green); background: var(--green-soft); }
.status-unavailable, .status-offline, .status-failed { color: var(--red); background: var(--red-soft); }
.status-manual_review { color: var(--amber); background: var(--amber-soft); }
.status-running, .status-processing, .status-preliminary { color: var(--blue); background: var(--blue-soft); }
.status-paused, .status-stopped, .status-interrupted { color: var(--text-muted); background: var(--surface-muted); }
.status-pause_requested, .status-resume_requested, .status-stopping { color: var(--amber); background: var(--amber-soft); }

.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.field, .select-field, .search-field {
  height: 36px;
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: none;
}
.field:focus, .select-field:focus, .search-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.field, .select-field { padding: 0 10px; }
.search-field { width: min(300px, 100%); padding: 0 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-control { display: grid; gap: 6px; }
.form-control > span { color: var(--text-muted); font-size: 10px; font-weight: 650; }
.form-control textarea { min-height: 150px; resize: vertical; padding: 10px; background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: 5px; outline: none; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { color: var(--text-muted); background: var(--surface-muted); font-size: 9px; font-weight: 750; }
.data-table td { font-size: 12px; }
.data-table tr:last-child td { border-bottom: 0; }
.table-wrap { min-width: 0; overflow-x: auto; }
.entity { display: flex; min-width: 190px; align-items: center; gap: 10px; }
.entity-avatar { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 4px; font-size: 11px; font-weight: 800; }
.entity-copy { display: grid; min-width: 0; }
.entity-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.entity-copy small { color: var(--text-muted); font-size: 9px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }

.progress-track { display: block; width: 100%; height: 6px; overflow: hidden; background: var(--surface-muted); border-radius: 3px; }
.progress-fill { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .25s ease; }
.progress-cell { display: grid; min-width: 150px; gap: 6px; }
.progress-meta { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.split-chart { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.split-item { padding: 12px; background: var(--surface-muted); border-radius: 4px; }
.split-item i { display: block; height: 5px; margin-bottom: 10px; background: var(--chart-color); border-radius: 2px; }
.split-item strong { display: block; font-size: 19px; }
.split-item span { color: var(--text-muted); font-size: 9px; }
.activity-chart { display: flex; height: 190px; align-items: end; gap: 5px; padding-top: 20px; }
.activity-bar { min-width: 5px; flex: 1; height: var(--bar-height); background: var(--accent); border-radius: 2px 2px 0 0; opacity: .82; }
.activity-bar:nth-child(4n) { background: var(--green); }

.virtual-table { min-width: 1240px; }
.virtual-header, .virtual-row { display: grid; grid-template-columns: 54px minmax(250px, 2fr) 100px 120px 110px 110px 110px 142px 130px; align-items: center; }
.virtual-header { height: 38px; color: var(--text-muted); background: var(--surface-muted); border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 750; }
.virtual-header > span, .virtual-row > div { min-width: 0; padding: 0 12px; }
.virtual-viewport { position: relative; height: calc(100vh - 248px); min-height: 380px; overflow: auto; contain: strict; }
.virtual-spacer { position: relative; width: 100%; }
.virtual-window { position: absolute; inset: 0 0 auto; will-change: transform; }
.virtual-row { height: 64px; background: var(--surface); border-bottom: 1px solid var(--line); cursor: pointer; }
.virtual-row:hover { background: color-mix(in srgb, var(--accent-soft) 38%, var(--surface)); }
.product-thumb { width: 38px; height: 38px; object-fit: cover; background: var(--surface-muted); border-radius: 4px; }
.product-thumb-fallback { display: grid; width: 38px; height: 38px; place-items: center; color: var(--text-muted); background: var(--surface-muted); border-radius: 4px; }
.product-thumb-button { display: grid; width: 38px; height: 38px; padding: 0; overflow: hidden; background: transparent; border: 0; border-radius: 4px; cursor: zoom-in; }
.product-thumb-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.product-title-cell { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.product-title-cell .entity-copy { max-width: 100%; }
.product-time strong { font-size: 9px; font-weight: 650; }
.load-sentinel { padding: 14px; color: var(--text-muted); text-align: center; font-size: 10px; }

.tabs { display: flex; max-width: 100%; gap: 4px; padding: 4px; overflow-x: auto; background: var(--surface-muted); border-radius: 5px; }
.tab { flex: 0 0 auto; }
.tab { min-height: 30px; padding: 0 11px; background: transparent; border: 0; border-radius: 3px; color: var(--text-muted); font-size: 11px; font-weight: 650; }
.tab.is-active { color: var(--text); background: var(--surface-raised); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.config-layout { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr); gap: 14px; }
.keyword-ai-layout { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(0, 1.1fr); gap: 14px; }
.keyword-ai-wide { grid-column: 1 / -1; }
.form-span-2 { grid-column: 1 / -1; }
.check-control { display: flex; min-height: 38px; align-items: center; gap: 9px; padding: 8px 10px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 5px; }
.check-control input { width: 16px; height: 16px; accent-color: var(--accent); }
.keyword-candidate-list { max-height: 520px; overflow: auto; }
.keyword-candidate-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.manual-keyword-results { border-top: 1px solid var(--line); }
.manual-keyword-actions { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 13px; background: var(--surface-muted); }
.manual-keyword-actions label, .manual-keyword-row { display: flex; align-items: center; gap: 8px; }
.manual-keyword-actions label { color: var(--text-muted); font-size: 10px; }
.manual-keyword-actions input, .manual-keyword-row input { width: 14px; height: 14px; accent-color: var(--blue); }
.manual-keyword-list { display: grid; max-height: 280px; overflow: auto; }
.manual-keyword-row { min-height: 40px; padding: 7px 13px; border-bottom: 1px solid var(--line); font-size: 12px; }
.manual-keyword-row:last-child { border-bottom: 0; }
.resource-list { display: grid; max-height: 560px; overflow: auto; }
.resource-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; min-height: 48px; padding: 8px 13px; border-bottom: 1px solid var(--line); }
.resource-row-selectable { grid-template-columns: 18px minmax(0, 1fr) auto auto; }
.resource-check, .resource-select-all input { width: 14px; height: 14px; accent-color: var(--blue); }
.resource-bulk-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.resource-select-all { display: inline-flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: 10px; white-space: nowrap; }
.resource-bulk-actions .button { height: 30px; }
.resource-row:last-child { border-bottom: 0; }
.proxy-health-panel { display: grid; gap: 11px; padding: 13px 16px; background: var(--surface-muted); border-bottom: 1px solid var(--line); }
.proxy-health-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 4px; }
.proxy-health-summary > div { min-width: 0; padding: 8px 10px; background: var(--surface-raised); }
.proxy-health-summary span, .proxy-status small { display: block; color: var(--text-muted); font-size: 9px; }
.proxy-health-summary strong { display: block; margin-top: 3px; font-size: 13px; font-variant-numeric: tabular-nums; }
.proxy-health-summary .proxy-good { color: var(--green); }
.proxy-check-progress { display: grid; gap: 5px; }
.proxy-check-progress small { color: var(--text-muted); font-size: 9px; text-align: right; }
.proxy-check-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.proxy-check-actions .button { height: 31px; padding: 0 10px; font-size: 10px; }
.proxy-resource-list { max-height: 470px; }
.proxy-resource-row { min-height: 60px; }
.proxy-resource-row .entity-copy small { max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shopee-ck-layout { grid-template-columns: minmax(300px, .65fr) minmax(0, 1.35fr); }
.shopee-entry-tabs { flex-wrap: nowrap; }
.shopee-ck-list { max-height: 590px; }
.shopee-ck-row { grid-template-columns: 18px minmax(190px, 1fr) 120px auto 32px; min-height: 64px; }
.shopee-verification { grid-column: 2 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; padding-top: 8px; }
.shopee-verification img { grid-column: 1 / -1; display: block; width: min(100%, 520px); max-height: 260px; object-fit: contain; border: 1px solid var(--line-strong); border-radius: 5px; }
.ck-usage { display: grid; gap: 5px; min-width: 0; color: var(--text-muted); font-size: 9px; }
.ck-usage span { display: flex; justify-content: space-between; }
.ck-usage b { color: var(--text); }
.ck-usage i { display: block; height: 4px; overflow: hidden; background: var(--surface-muted); border-radius: 2px; }
.ck-usage u { display: block; height: 100%; background: var(--accent); text-decoration: none; }
.ck-alert { display: grid; gap: 3px; margin: 12px; }
.ck-alert span { overflow-wrap: anywhere; }
.proxy-status { display: grid; justify-items: end; gap: 3px; }
.switch { position: relative; width: 32px; height: 18px; padding: 0; background: var(--line-strong); border: 0; border-radius: 9px; }
.switch::after { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; content: ""; background: #fff; border-radius: 50%; transition: transform .16s; }
.switch.is-on { background: var(--green); }
.switch.is-on::after { transform: translateX(14px); }

.export-task { display: grid; gap: 10px; padding: 14px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius); }
.export-task + .export-task { margin-top: 10px; }
.export-task-head, .export-task-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.export-task h3 { max-width: 290px; margin: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.export-form { display: grid; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.export-form-head, .export-history-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.export-form-head h3, .export-history-head h3 { margin: 2px 0 0; font-size: 14px; }
.export-filter-summary { margin: 0; padding: 9px 11px; color: var(--text-muted); background: var(--surface-muted); border-radius: 4px; font-size: 10px; overflow-wrap: anywhere; }
.export-form-grid { gap: 10px; }
.option-group { min-width: 0; margin: 0; padding: 11px; border: 1px solid var(--line); border-radius: 5px; }
.option-group legend { padding: 0 5px; color: var(--text-muted); font-size: 10px; font-weight: 650; }
.check-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.check-option { display: grid; min-width: 0; cursor: pointer; }
.check-option input { position: absolute; opacity: 0; pointer-events: none; }
.check-option span { display: grid; height: 31px; place-items: center; background: var(--surface-muted); border: 1px solid transparent; border-radius: 4px; font-size: 10px; white-space: nowrap; }
.check-option input:checked + span { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); font-weight: 750; }
.check-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.toggle-option { display: flex; min-width: 0; align-items: center; gap: 9px; color: var(--text-muted); cursor: pointer; font-size: 11px; }
.toggle-option input { width: 15px; height: 15px; flex: 0 0 auto; accent-color: var(--accent); }
.bait-setting { display: grid; grid-template-columns: minmax(0, 1fr) 130px; align-items: end; gap: 12px; padding: 11px; background: var(--surface-muted); border-radius: 5px; }
.bait-price .field { width: 100%; }
.export-rules { display: flex; flex-wrap: wrap; gap: 6px; }
.export-rules span, .export-result-meta span { padding: 4px 7px; color: var(--text-muted); background: var(--surface-muted); border-radius: 3px; font-size: 9px; }
.export-submit { width: 100%; }
.export-history { display: grid; gap: 11px; padding-top: 18px; }
.export-result-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.export-empty { min-height: 120px; }
.batch-dialog { width: min(660px, calc(100vw - 24px)); }
.batch-group-content { display: grid; gap: 18px; }
.batch-group-form { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.25fr) 110px auto; align-items: end; gap: 10px; }
.shuffle-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.ai-workbench { gap: 18px; }
.ai-stage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.ai-stage-body { gap: 15px; }
.ai-stage-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 5px; }
.ai-stage-stats > div { min-width: 0; padding: 12px; background: var(--surface-raised); }
.ai-stage-stats span { display: block; overflow: hidden; color: var(--text-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ai-stage-stats strong { display: block; margin-top: 5px; font-size: 17px; font-variant-numeric: tabular-nums; }
.danger-text { color: var(--red); }
.ai-stage-progress { min-width: 0; }
.ai-stage-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.ai-stage-meta span { padding: 5px 7px; color: var(--text-muted); background: var(--surface-muted); border-radius: 3px; font-size: 9px; }
.ai-stage-meta b { color: var(--text); font-weight: 650; }
.ai-stage-actions { display: flex; gap: 8px; padding-top: 2px; }
.ai-stage-actions .button { min-width: 84px; }
.precision-config { align-items: end; }
.form-span { grid-column: 1 / -1; }
.precision-config .field { width: 100%; }
.config-submit .button { width: 100%; }
.api-target { display: grid; gap: 5px; min-width: 0; padding: 10px; background: var(--surface-muted); border-radius: 4px; }
.api-target span { color: var(--text-muted); font-size: 9px; }
.api-target code { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.api-endpoint-list { display: grid; }
.review-access { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px 14px; background: var(--surface-muted); border-bottom: 1px solid var(--line); }
.review-access > div:first-child { display: grid; }
.review-access span { color: var(--text-muted); font-size: 9px; }
.review-access strong { margin-top: 2px; font-size: 11px; }
.review-token-result { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) 36px; align-items: center; gap: 7px; }
.review-token-result code { min-width: 0; padding: 9px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; font-size: 9px; white-space: nowrap; }
.api-endpoint { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 45px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.api-endpoint:last-child { border-bottom: 0; }
.api-endpoint code { min-width: 0; overflow-wrap: anywhere; font-size: 10px; }
.api-method { display: inline-grid; height: 21px; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 3px; font-size: 8px; font-weight: 800; }
.api-method.method-post { color: var(--green); background: var(--green-soft); }
.empty-state { display: grid; min-height: 220px; place-items: center; padding: 24px; color: var(--text-muted); text-align: center; }
.empty-state strong { display: block; color: var(--text); font-size: 13px; }
.error-banner { padding: 11px 13px; color: var(--red); background: var(--red-soft); border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); border-radius: 4px; font-size: 11px; }
.skeleton { overflow: hidden; background: var(--surface-muted); border-radius: 3px; }
.toast { padding: 12px 14px; color: var(--text); background: var(--surface-raised); border: 1px solid var(--line-strong); border-left: 3px solid var(--green); border-radius: 4px; box-shadow: var(--shadow); font-size: 11px; }
.toast.is-error { border-left-color: var(--red); }

.detail-dialog { width: min(820px, calc(100vw - 24px)); max-height: min(760px, calc(100vh - 24px)); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px; box-shadow: var(--shadow); }
.product-detail-dialog { width: min(980px, calc(100vw - 24px)); }
.detail-dialog::backdrop { background: rgba(0,0,0,.62); }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.detail-head h2 { margin: 0; font-size: 15px; }
.detail-content { max-height: calc(100vh - 140px); overflow: auto; padding: 18px; }
.product-gallery { display: grid; gap: 12px; }
.product-gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product-gallery-head > div { display: flex; align-items: baseline; gap: 9px; }
.product-gallery-layout { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 14px; min-height: 360px; }
.product-gallery-preview { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; margin: 0; overflow: hidden; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 5px; }
.product-gallery-preview img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.product-gallery-preview figcaption { min-width: 0; padding: 9px 11px; overflow: hidden; color: var(--text-muted); background: var(--surface); border-top: 1px solid var(--line); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.product-gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); align-content: start; gap: 8px; max-height: 360px; padding-right: 3px; overflow: auto; }
.product-gallery-thumb { display: grid; min-width: 0; gap: 5px; padding: 5px; color: var(--text-muted); background: var(--surface-muted); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.product-gallery-thumb:hover, .product-gallery-thumb.is-active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.product-gallery-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.product-gallery-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface); border-radius: 2px; }
.product-gallery-thumb span { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.product-gallery-empty { min-height: 150px; border: 1px dashed var(--line-strong); }
.json-view { margin: 0; padding: 14px; overflow: auto; color: #b9d8d2; background: #0c1010; border-radius: 4px; font: 10px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.task-dialog { width: min(720px, calc(100vw - 24px)); }
.task-create-form { display: grid; gap: 16px; }
.task-create-form .field, .task-create-form .select-field { width: 100%; }
.task-create-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.shopee-task-note { padding: 10px 12px; color: var(--blue); background: var(--blue-soft); border-radius: 4px; font-size: 10px; }
.crawler-table { min-width: 1060px; }
.task-name { min-width: 190px; max-width: 290px; }
.job-actions { min-width: 142px; flex-wrap: nowrap; }
.job-actions .button { height: 31px; padding: 0 9px; white-space: nowrap; }
.error-count-button { min-width: 34px; height: 27px; padding: 0 7px; color: var(--text-muted); background: var(--surface-muted); border: 1px solid var(--line); border-radius: 4px; font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.error-count-button.has-errors { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.error-monitor-dialog { width: min(980px, calc(100vw - 24px)); }
.error-monitor-head .toolbar { flex-wrap: nowrap; }
.error-monitor-content { display: grid; gap: 14px; }
.error-monitor-content > .form-control { grid-template-columns: 88px minmax(0, 1fr); align-items: center; }
.error-monitor-content > .form-control .select-field { width: 100%; }
.error-monitor-summary { display: grid; grid-template-columns: .75fr 1fr minmax(180px, 2fr) .65fr; gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 5px; }
.error-monitor-summary > div { min-width: 0; padding: 11px 12px; background: var(--surface-raised); }
.error-monitor-summary span { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 9px; }
.error-monitor-summary strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.error-monitor-list { display: grid; max-height: min(500px, calc(100vh - 310px)); overflow: auto; border: 1px solid var(--line); border-radius: 5px; }
.error-log-item { min-width: 0; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.error-log-item:last-child { border-bottom: 0; }
.error-log-item header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: var(--text-muted); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.error-log-item pre { margin: 0; color: var(--red); font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.error-monitor-loading { min-height: 220px; display: grid; place-items: center; color: var(--text-muted); font-size: 11px; }
.error-monitor-empty { min-height: 180px; }
.error-monitor-empty small { display: block; margin-top: 6px; color: var(--text-muted); font-size: 9px; }

@media (max-width: 760px) {
  .toolbar { align-items: stretch; }
  .toolbar > * { flex: 1 1 140px; }
  .toolbar .icon-button { flex: 0 0 36px; }
  .form-grid, .config-layout, .keyword-ai-layout { grid-template-columns: 1fr; }
  .keyword-ai-wide, .form-span-2 { grid-column: 1; }
  .split-chart { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .check-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bait-setting { grid-template-columns: 1fr; }
  .batch-group-form, .shuffle-control { grid-template-columns: 1fr; }
  .ai-stage-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-stage-actions .button { min-width: 0; flex: 1; padding: 0 7px; }
  .virtual-viewport { height: calc(100vh - 302px); }
  .task-create-actions .button { flex: 1; }
  .error-monitor-content > .form-control { grid-template-columns: 1fr; }
  .error-monitor-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .error-monitor-list { max-height: calc(100vh - 380px); }
  .proxy-health-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proxy-check-actions .button { flex: 1 1 120px; }
  .proxy-resource-row .entity-copy small { max-width: 190px; }
  .shopee-ck-layout { grid-template-columns: 1fr; }
  .shopee-ck-row { grid-template-columns: 18px minmax(150px, 1fr) auto 32px; }
  .shopee-ck-row .ck-usage { grid-column: 2 / -1; }
  .shopee-verification { grid-template-columns: 1fr; }
  .product-gallery-layout { grid-template-columns: 1fr; min-height: 0; }
  .product-gallery-preview { height: min(320px, 70vw); }
  .product-gallery-thumbs { max-height: 220px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .ai-stage-grid { grid-template-columns: 1fr !important; }
}
