:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d8dee8;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --danger: #b42318;
  --warning: #b54708;
  --radius: 7px;
  --control-height: 40px;
  --gap: 12px;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  min-height: var(--control-height);
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

button:hover {
  background: var(--primary-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.ghost {
  background: #eef2f7;
  color: var(--text);
}

button.ghost:hover {
  background: #e2e8f0;
}

button.danger {
  background: var(--danger);
}

button .button-icon,
.button-icon {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex: 0 0 auto;
}

button:has(.button-icon) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 44px);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-weight: 700;
}

.status-line {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-line.ok {
  color: var(--primary);
}

.status-line.bad {
  color: var(--danger);
}

.top-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(112px, 1fr));
  gap: 10px;
  align-items: center;
}

.top-actions button {
  width: 100%;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 18px clamp(18px, 4vw, 44px) 36px;
}

.database-page-layout {
  grid-template-columns: 1fr;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel.full {
  grid-column: 1 / -1;
}

.panel-stack,
.workflow-grid,
.card-column,
.work-column {
  display: grid;
  gap: 14px;
  align-content: start;
  align-self: start;
}

.panel-stack,
.workflow-grid {
  grid-column: 1 / -1;
}

.workflow-grid {
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
  align-items: start;
}

.task-panel {
  display: flex;
  flex-direction: column;
  align-self: start;
}

.task-panel .form-grid {
  flex: 1;
  align-content: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-panel .session-field {
  margin-top: 19px;
}

.task-panel #sessionText {
  min-height: 150px;
  height: auto;
}

.task-panel .auto-result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-panel .task-meta-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(140px, 0.72fr) minmax(130px, 0.62fr);
  gap: var(--gap);
  align-items: end;
}

.task-panel .task-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.35;
}

.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-title-row h2 {
  margin: 0;
}

.panel-title-row button {
  flex: 0 0 auto;
}

.panel-title-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.workbench-panel {
  border-color: #c7d7e8;
  background: linear-gradient(180deg, #fff 0%, #f9fbfd 100%);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--gap);
  margin: 10px 0 12px;
}

.stat-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
}

.stat-card span,
.mini-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.3;
}

.stat-card small,
.payment-card small,
.success-record small {
  color: var(--muted);
  font-size: 12px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e6f4f1;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  vertical-align: 2px;
}

.muted {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

label {
  display: grid;
  gap: 5px;
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

input,
select {
  min-height: var(--control-height);
}

textarea {
  resize: vertical;
}

.wide {
  grid-column: 1 / -1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.auto-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.auto-result-grid input[readonly] {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #344054;
  cursor: default;
}

.payment-panel {
  border-color: #b7ddd5;
}

.billing-panel {
  border-color: #b7ddd5;
  align-self: start;
}

.card-library {
  display: grid;
  gap: var(--gap);
  margin: 0 0 12px;
}

.payment-cards {
  display: grid;
  gap: var(--gap);
}

.billing-profile-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--gap);
  align-items: center;
  margin: 0 0 var(--gap);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #fbfcfe;
}

.billing-panel .billing-profile-card {
  margin: 0;
}

.standalone-billing-card {
  grid-template-columns: minmax(0, 1fr);
}

.billing-profile-card strong {
  display: block;
  margin: 2px 0 4px;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.billing-profile-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.current-card-wrap,
.backup-card-wrap {
  display: grid;
  gap: 8px;
}

.backup-card-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.backup-card-details:not([open]) > .backup-card-list {
  display: none;
}

.backup-card-details {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: #fbfcfe;
}

.backup-card-details[open] {
  background: #fff;
}

.backup-card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.backup-card-summary::-webkit-details-marker {
  display: none;
}

.backup-card-summary::after {
  content: "⌄";
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.backup-card-details[open] .backup-card-summary {
  margin-bottom: 8px;
}

.backup-card-details[open] .backup-card-summary::after {
  transform: rotate(180deg);
}

.mini-label {
  margin: 0;
}

.payment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--gap);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #fff;
}

.payment-card.is-selected {
  border-color: #78bfb2;
  box-shadow: inset 4px 0 0 var(--primary);
  background: #f8fffd;
}

.payment-card.backup-card {
  background: #fbfcfe;
}

.payment-card h3 {
  margin: 0;
  font-size: 15px;
}

.payment-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 5px;
}

.payment-card-title {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin: 0;
}

.payment-card.is-disabled-card {
  background: #f8fafc;
}

.payment-card.is-disabled-card .job-meta {
  color: var(--muted);
}

.card-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 52px;
  height: 24px;
  padding: 2px 6px 2px 3px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #dff3ed;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}

.panel-title-actions .order-intake-switch {
  min-width: 104px;
  height: 40px;
  padding: 4px 12px 4px 7px;
}

.panel-title-actions .order-intake-switch .card-switch-track {
  width: 34px;
  height: 20px;
}

.panel-title-actions .order-intake-switch .card-switch-knob {
  top: 3px;
  left: 17px;
  width: 14px;
  height: 14px;
}

.panel-title-actions .order-intake-switch.is-off .card-switch-knob {
  left: 3px;
}

.panel-title-actions .order-intake-switch .card-switch-text {
  min-width: 52px;
}

/* 换绑删卡总开关：与接单开关同款滑轨尺寸 */
.panel-title-actions .replacement-rebind-switch {
  min-width: 104px;
  height: 40px;
  padding: 4px 12px 4px 7px;
}
.panel-title-actions .replacement-rebind-switch .card-switch-track {
  width: 34px;
  height: 20px;
}
.panel-title-actions .replacement-rebind-switch .card-switch-knob {
  top: 3px;
  left: 17px;
  width: 14px;
  height: 14px;
}
.panel-title-actions .replacement-rebind-switch.is-off .card-switch-knob {
  left: 3px;
}
.panel-title-actions .replacement-rebind-switch .card-switch-text {
  min-width: 68px;
}

.card-switch:hover {
  transform: none;
}

.card-switch.is-off {
  background: #eef2f7;
  color: var(--muted);
}

.card-switch-track {
  position: relative;
  display: inline-flex;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: var(--primary);
  flex: 0 0 auto;
}

.card-switch.is-off .card-switch-track {
  background: #aab4c2;
}

.card-switch-knob {
  position: absolute;
  top: 2px;
  left: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s ease;
}

.card-switch.is-off .card-switch-knob {
  left: 2px;
}

.card-switch-text {
  min-width: 12px;
  text-align: center;
}

.payment-card-actions {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(92px, 1fr));
  gap: 8px;
  align-items: center;
}

.payment-card-actions button {
  min-height: 36px;
  padding: 7px 10px;
}

.card-success-count {
  font-weight: 700;
  color: var(--primary);
}

.card-success-count.is-full {
  color: var(--muted);
}

.limit-choice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fbfcfe;
}

.inline-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.inline-choice input {
  width: auto;
  min-height: 0;
}

.success-panel {
  border-color: #b7ddd5;
}

.success-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 0;
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.success-panel[open] .success-summary {
  margin-bottom: var(--gap);
}

.success-summary::-webkit-details-marker {
  display: none;
}

.success-summary::before {
  content: "▶";
  width: 14px;
  color: var(--text);
  font-size: 13px;
  line-height: 1;
}

.success-panel[open] .success-summary::before {
  content: "▼";
}

.success-panel-body {
  display: grid;
  gap: var(--gap);
}

.success-tools {
  display: grid;
  grid-template-columns: minmax(240px, 320px) auto;
  align-items: end;
  justify-content: end;
  gap: var(--gap);
}

.search-box {
  position: relative;
  display: block;
  min-width: 0;
}

.search-box input {
  width: 100%;
  padding-left: 34px;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  z-index: 1;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.search-icon svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.success-records {
  display: grid;
  gap: var(--gap);
}

.success-table-head {
  display: grid;
  grid-template-columns: minmax(100px, .8fr) minmax(190px, 1.5fr) minmax(60px, .5fr) minmax(60px, .5fr) minmax(90px, .7fr) minmax(90px, .7fr) minmax(130px, 1fr) minmax(130px, 1fr);
  gap: var(--gap);
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.success-record {
  display: grid;
  grid-template-columns: minmax(100px, .8fr) minmax(190px, 1.5fr) minmax(60px, .5fr) minmax(60px, .5fr) minmax(90px, .7fr) minmax(90px, .7fr) minmax(130px, 1fr) minmax(130px, 1fr);
  gap: var(--gap);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #fff;
}

.success-record h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

.success-record > span {
  color: #475467;
  font-size: 14px;
}

.record-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.record-pill.is-success {
  background: #dff4e7;
  color: #18794e;
}

.record-pill.is-pending {
  background: #fff1cc;
  color: #8a5a00;
}

.record-pill.is-failure {
  background: #fee4e2;
  color: #b42318;
}

.record-pill.is-neutral {
  background: #f0f1f3;
  color: #667085;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(480px, 100%);
}

.login-card h1 {
  margin: 6px 0 10px;
  font-size: 26px;
  letter-spacing: 0;
}

.login-form {
  display: grid;
  gap: var(--gap);
}

.profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.auto-parse-box textarea {
  min-height: 112px;
}

.auto-parse-actions {
  grid-template-columns: minmax(160px, 220px) 1fr;
  align-items: center;
}

.auto-parse-actions .muted {
  margin: 0;
}

.token-actions {
  display: flex;
  align-items: center;
  gap: var(--gap);
  flex-wrap: wrap;
}

.inline-status {
  margin: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: var(--gap);
}

.compact-head {
  align-items: center;
}

.compact-head h2 {
  margin-bottom: 0;
}

.worker-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.worker-slots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.worker-slot {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.worker-slot.is-idle {
  border-color: #9fd3c9;
  background: #f4fffb;
}

.worker-slot.is-running {
  border-color: #7fb8b0;
  box-shadow: inset 3px 0 0 var(--primary);
}

.worker-slot.is-warn {
  border-color: #ffd7a3;
  background: #fffbf5;
}

.worker-slot.is-error {
  border-color: #f4a6a0;
  background: #fff7f6;
}

.worker-slot.is-disabled {
  border-style: dashed;
  background: #f8fafc;
  opacity: 0.78;
}

.worker-slot-main {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.worker-slot-main strong,
.worker-slot small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-slot small {
  color: var(--muted);
  font-size: 12px;
}

.jobs {
  display: grid;
  gap: var(--gap);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.job {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--gap);
}

.job h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e6f4f1;
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
}

.badge-warn {
  background: #fff3e6;
  color: var(--warning);
}

.badge-neutral {
  background: #eef2f7;
  color: #475467;
}

.badge-bad {
  background: #fee4e2;
  color: var(--danger);
}

.queue-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: var(--gap);
}

.job-progress {
  display: grid;
  gap: 6px;
  margin-top: var(--gap);
  padding-top: var(--gap);
  border-top: 1px solid var(--line);
}

.job-progress strong {
  font-size: 13px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #e8edf3;
}

.progress-value {
  height: 100%;
  width: var(--progress, 5%);
  background: var(--primary);
  transition: width 0.2s ease;
}

.job-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
  align-content: start;
  width: min(420px, 42vw);
}

.job-actions button {
  min-height: 36px;
  padding: 7px 10px;
}

.job-actions .primary-next {
  grid-column: 1 / -1;
  min-height: 42px;
  font-weight: 800;
}

.pending-confirmations {
  display: grid;
  gap: 8px;
}

.pending-confirmation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, auto);
  gap: var(--gap);
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #f3c07f;
  border-radius: var(--radius);
  background: #fffaf3;
}

.pending-confirmation strong {
  display: block;
  overflow-wrap: anywhere;
}

.pending-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.job.is-running {
  border-color: #8bc5bb;
  box-shadow: inset 4px 0 0 var(--primary);
}

.compact-empty {
  padding: 12px;
  text-align: left;
}

.database-panel {
  border-color: #bfd7e6;
}

.database-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.overview-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fbfcfe;
}

.overview-item span,
.detail-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overview-item strong,
.detail-field strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.wide-overview {
  grid-column: span 2;
}

.history-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(150px, 0.28fr) minmax(150px, 0.28fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.database-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 var(--gap);
}

.success-controls {
  grid-template-columns: minmax(240px, 1fr);
}

.license-controls {
  grid-template-columns: minmax(240px, 1fr);
}

.card-directory-controls {
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 0.32fr);
}

.database-view .card-directory-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 var(--gap);
}

.license-create-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: var(--gap);
  background: #fbfcfe;
}

.license-create-box h3,
.license-job-list h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.license-form,
.license-edit-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.license-form .wide,
.license-edit-form .wide {
  grid-column: 1 / -1;
}

.license-generated-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.license-generated-box[hidden] {
  display: none;
}

.license-generated-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.license-generated-head div {
  display: grid;
  gap: 3px;
}

.license-generated-head small {
  color: var(--muted);
  font-weight: 600;
}

.license-generated-box textarea {
  min-height: 128px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.65;
}

.license-edit-form {
  margin: 12px 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.license-job-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.database-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  gap: var(--gap);
  align-items: start;
}

.history-rows {
  display: grid;
  gap: 8px;
}

.history-row {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.license-row.is-used-up {
  padding-right: 76px;
}

.license-used-corner {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  background: #fee4e2;
  color: #b42318;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.history-row:hover,
.history-row.is-selected {
  border-color: #7fb8b0;
  background: #f2fbf8;
}

.history-main {
  display: grid;
  gap: 2px;
}

.history-main small,
.history-row > small {
  color: var(--muted);
}

.history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-tags span {
  border-radius: 999px;
  background: #eef2f7;
  padding: 3px 7px;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.card-directory-row .history-tags span:first-child {
  background: #e6f7f3;
  color: #0f766e;
}

.database-view .card-directory-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #edf0f5;
  border-radius: var(--radius);
  background: #fbfcfe;
}

.history-detail {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.detail-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.detail-title h3 {
  margin: 0;
  font-size: 16px;
}

.detail-title .muted {
  flex-basis: 100%;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 var(--gap);
}

.detail-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid #edf0f5;
  border-radius: var(--radius);
  padding: 8px;
  background: #fbfcfe;
}

.session-detail {
  margin-top: 10px;
}

.session-detail textarea {
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.session-detail button {
  margin-top: 8px;
}

.card-directory-cvv-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #d8ebe8;
  border-radius: var(--radius);
  background: #f7fcfb;
}

.card-directory-cvv-form small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 700;
}

.database-view .card-directory-modal-card {
  width: min(640px, calc(100vw - 28px));
}

.database-view .card-directory-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.database-view .card-directory-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-weight: 800;
}

.database-view .card-directory-checkbox-row input {
  width: auto;
}

.database-view .card-directory-limit-card label {
  display: grid;
  gap: 6px;
}

.history-message {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
}

.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 20px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.3);
}

.card-modal-card {
  width: min(860px, 100%);
}

.small-modal-card {
  width: min(520px, 100%);
}

.compact-modal-card {
  width: min(640px, 100%);
}

.modal-card h2 {
  margin: 4px 0 10px;
  font-size: 20px;
}

.confirmation-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.confirmation-summary span {
  color: var(--muted);
}

.warning-copy {
  margin: 12px 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--gap);
  margin-top: var(--gap);
}

.job-card-switch-options {
  display: grid;
  gap: 8px;
  max-height: min(380px, 48vh);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.job-card-switch-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.job-card-switch-option:hover:not(:disabled) {
  border-color: #9fcfc5;
  background: #f8fffd;
}

.job-card-switch-option.is-selected {
  border-color: #128276;
  background: #f0fdfa;
  box-shadow: inset 4px 0 0 var(--primary);
}

.job-card-switch-option:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.job-card-switch-dot {
  width: 15px;
  height: 15px;
  margin-top: 3px;
  border: 2px solid #b8c3d1;
  border-radius: 999px;
  background: #fff;
}

.job-card-switch-option.is-selected .job-card-switch-dot {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 4px #dff7f1;
}

.job-card-switch-option strong {
  display: block;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.job-card-switch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
}

.job-card-switch-meta em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.checklist {
  margin: 0;
  padding-left: 22px;
  line-height: 1.7;
  font-size: 14px;
}

.help-panel {
  padding: 0;
  overflow: hidden;
}

.help-panel summary {
  cursor: pointer;
  padding: 16px;
  font-size: 16px;
  font-weight: 800;
}

.help-panel .checklist {
  padding: 0 16px 16px 38px;
}

.feedback-logs {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}

.feedback-log-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.feedback-log-item strong {
  display: block;
  font-size: 14px;
}

.feedback-log-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.feedback-log-meta {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.feedback-log-meta span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--soft);
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  border-radius: var(--radius);
  padding: 9px 13px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 720px) {
  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .workflow-grid,
  .card-column,
  .work-column,
  .form-grid,
  .profile-actions,
  .token-actions,
  .auto-result-grid,
  .task-panel .task-meta-grid,
  .task-panel .task-action-row,
  .stats-grid,
  .worker-slots,
  .job,
  .job-actions,
  .pending-confirmation,
  .billing-profile-card,
  .database-overview,
  .history-controls,
  .database-layout,
  .detail-grid,
  .payment-card,
  .payment-card-actions,
  .success-record,
  .feedback-log-item {
    grid-template-columns: 1fr;
  }

  .feedback-log-meta {
    justify-content: flex-start;
  }

  .success-table-head {
    display: none;
  }

  .success-tools,
  .queue-tools,
  .top-actions,
  .license-generated-head,
  .license-form,
  .license-edit-form {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .success-tools > *,
  .queue-tools > *,
  .top-actions > *,
  .license-generated-head > * {
    width: 100%;
  }

  .license-generated-head {
    display: grid;
  }

  .database-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .wide-overview {
    grid-column: auto;
  }

  .job-actions {
    width: 100%;
  }

  .confirmation-summary {
    grid-template-columns: 1fr;
  }

  .token-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Complete database cockpit: isolated from the shared console layout. */
body.database-cockpit {
  --database-sidebar: #172630;
  --database-sidebar-soft: #223540;
  --database-canvas: #eef2f4;
  --database-accent: #0f806f;
  --database-accent-dark: #0b675b;
  --database-border: #d9e1e5;
  --database-attention: #b7791f;
  min-width: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--database-canvas);
}

.database-cockpit [hidden] {
  display: none !important;
}

.database-cockpit .database-sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: 208px;
  min-height: 100vh;
  flex-direction: column;
  gap: 24px;
  padding: 22px 14px 16px;
  overflow-y: auto;
  color: #eaf4f3;
  background: var(--database-sidebar);
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.12);
}

.database-cockpit .database-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 7px;
}

.database-cockpit .database-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--database-accent);
  font-size: 13px;
  font-weight: 900;
}

.database-cockpit .database-brand div {
  display: grid;
  gap: 3px;
}

.database-cockpit .database-brand strong {
  color: #fff;
  font-size: 16px;
}

.database-cockpit .database-brand small,
.database-cockpit .database-sidebar-foot small {
  color: #9eb3bd;
  font-size: 12px;
  line-height: 1.5;
}

.database-cockpit .database-navigation {
  display: grid;
  gap: 6px;
}

.database-cockpit .database-nav-item,
.database-cockpit .database-sidebar-link,
.database-cockpit .database-nav-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 42px;
  border: 1px solid transparent;
  color: #c9d8dd;
  background: transparent;
  text-align: left;
}

.database-cockpit .database-nav-item:hover,
.database-cockpit .database-nav-item:focus-visible,
.database-cockpit .database-sidebar-link:hover,
.database-cockpit .database-sidebar-link:focus-visible {
  color: #fff;
  background: var(--database-sidebar-soft);
}

.database-cockpit .database-nav-item[aria-current="page"] {
  border-color: rgba(111, 224, 204, 0.3);
  color: #fff;
  background: var(--database-accent);
}

.database-cockpit .database-nav-item > span:first-child {
  width: 20px;
  color: #87c8be;
  text-align: center;
}

.database-cockpit .database-nav-item[aria-current="page"] > span:first-child {
  color: #fff;
}

.database-cockpit .database-nav-toggle {
  display: none;
}

.database-cockpit .database-sidebar-foot {
  display: grid;
  gap: 9px;
  margin-top: auto;
  padding: 14px 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.database-cockpit .database-session-badge {
  color: #88d7ca;
  font-size: 12px;
  font-weight: 800;
}

.database-cockpit .database-sidebar-link {
  min-height: 36px;
  padding: 7px 0;
  font-size: 13px;
}

.database-cockpit .database-shell {
  display: block;
  width: calc(100% - 208px);
  min-width: 0;
  min-height: 100vh;
  height: auto;
  margin-left: 208px;
  overflow: visible;
}

.database-cockpit .database-topbar {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--database-border);
  background: rgba(255, 255, 255, 0.96);
}

.database-cockpit .database-topbar h1 {
  margin: 0;
  font-size: 21px;
}

.database-cockpit .database-top-actions,
.database-cockpit .database-tool-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.database-cockpit .database-workspace {
  display: grid;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 14px 18px 28px;
  overflow: visible;
}

.database-cockpit .database-workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.database-cockpit .database-workspace-head h2 {
  margin: 0;
  font-size: 20px;
}

.database-cockpit .database-heading-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-width: 0;
}

.database-cockpit .database-heading-copy .eyebrow {
  font-size: 11px;
  letter-spacing: 0.04em;
}

.database-cockpit .database-heading-copy .muted,
.database-cockpit .database-workspace-head p:last-child {
  margin: 0;
}

.database-cockpit .database-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.database-cockpit .database-metric,
.database-cockpit .overview-item {
  display: grid;
  min-width: 0;
  min-height: 56px;
  align-content: center;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--database-border);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.035);
  text-align: left;
}

.database-cockpit .database-metric:hover,
.database-cockpit .database-metric:focus-visible {
  border-color: var(--database-accent);
  background: #f3fbf9;
}

.database-cockpit .database-metric span,
.database-cockpit .overview-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.database-cockpit .database-metric strong,
.database-cockpit .overview-item strong {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.database-cockpit .wide-overview {
  grid-column: span 2;
}

.database-cockpit .database-filter-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(2, minmax(140px, 0.28fr));
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--database-border);
  border-radius: 8px;
  background: #fff;
}

.database-cockpit .database-filter-row.success-controls {
  grid-template-columns: minmax(260px, 1fr) minmax(130px, 0.3fr) minmax(150px, 0.32fr);
}

.database-cockpit .database-more-filters {
  grid-column: 1 / -1;
  border-top: 1px solid #edf1f3;
  padding-top: 8px;
}

.database-cockpit .database-more-filters summary {
  width: fit-content;
  cursor: pointer;
  color: var(--database-accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.database-cockpit .database-more-filters summary span {
  display: inline-grid;
  min-width: 20px;
  min-height: 20px;
  margin-left: 3px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--database-accent);
  font-size: 11px;
}

.database-cockpit [data-active-filter-count]:empty {
  display: none;
}

.database-cockpit .database-more-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 9px;
}

.database-cockpit .database-filter-row.license-controls {
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(120px, 0.35fr));
}

.database-cockpit .database-filter-row.card-directory-controls {
  grid-template-columns: minmax(260px, 1fr) minmax(160px, 0.3fr);
}

.database-cockpit .database-tool-panel {
  margin: 0;
  padding: 11px 12px;
  border-color: var(--database-border);
  background: #fff;
}

.database-cockpit .database-license-batch-toolbar {
  padding: 9px 11px;
  border: 1px solid var(--database-border);
  border-radius: 8px;
  background: #fff;
}

.database-cockpit .database-license-batch-toolbar label,
.database-cockpit .database-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.database-cockpit .database-license-batch-toolbar input[type="checkbox"] {
  width: auto;
}

.database-cockpit .database-license-batch-toolbar input[type="number"] {
  width: 86px;
}

.database-cockpit .database-batch-result-slot:empty {
  display: none;
}

.database-cockpit .database-batch-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid #f0d99a;
  border-radius: 8px;
  background: #fffaf0;
}

.database-cockpit .database-batch-result ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0;
  padding-left: 20px;
}

.database-cockpit .license-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  padding: 0;
}

.database-cockpit .database-row-selector {
  display: grid;
  place-items: center;
  padding: 10px 4px 10px 10px;
}

.database-cockpit .database-row-selector input {
  width: auto;
}

.database-cockpit .database-row-main {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.database-cockpit .database-tool-head,
.database-cockpit .database-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.database-cockpit .database-tool-head h3,
.database-cockpit .database-panel-head h3 {
  margin: 0;
  font-size: 14px;
}

.database-cockpit .database-master-detail {
  display: grid;
  grid-template-columns: minmax(320px, 38%) minmax(0, 62%);
  align-items: start;
  gap: 12px;
}

.database-cockpit .database-list-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--database-border);
  border-radius: 8px;
  background: #fff;
}

.database-cockpit .database-detail-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--database-border);
  border-radius: 8px;
  background: #fff;
}

.database-cockpit .database-list-panel,
.database-cockpit .database-detail-panel {
  min-width: 0;
  overflow: visible;
}

.database-cockpit .database-panel-head {
  min-height: 48px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--database-border);
}

.database-cockpit .database-list-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 7px 11px;
  border-bottom: 1px solid #edf1f3;
  color: var(--muted);
  background: #fbfcfd;
  font-size: 11px;
  font-weight: 800;
}

.database-cockpit .database-list-scroll,
.database-cockpit .database-detail-scroll {
  min-height: 0;
  overflow: visible;
  overscroll-behavior: auto;
  scrollbar-gutter: auto;
}

.database-cockpit .database-list-scroll {
  padding: 8px;
}

.database-cockpit .database-detail-scroll {
  padding: 10px;
}

.database-cockpit .database-pagination {
  position: static;
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--database-border);
  color: var(--muted);
  background: #fbfcfd;
  font-size: 12px;
}

.database-cockpit .database-pagination > div {
  display: flex;
  gap: 6px;
}

.database-cockpit .database-pagination button {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.database-cockpit .history-detail {
  min-height: 100%;
  border: 0;
  padding: 0;
}

.database-cockpit .database-protected-note {
  border-radius: 999px;
  padding: 4px 8px;
  color: #0f766e;
  background: #e7f6f2;
  font-size: 11px;
  font-weight: 800;
}

.database-cockpit .database-license-batch-toolbar[hidden] {
  display: none;
}

.database-cockpit .history-main strong,
.database-cockpit .record-facts dd,
.database-cockpit .database-record-detail code {
  min-width: 0;
  overflow-wrap: anywhere;
}

.database-cockpit .database-primary-status,
.database-cockpit .database-current-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 7px;
  color: #0f766e;
  background: #e6f7f3;
  font-size: 12px;
  font-weight: 800;
}

.database-cockpit .history-row time,
.database-cockpit .detail-title time,
.database-cockpit .database-timeline time,
.database-cockpit .database-time-unknown {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.database-cockpit [data-investigation-row] .history-main,
.database-cockpit [data-investigation-match] .history-main {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
}

.database-cockpit [data-investigation-row] .history-main small,
.database-cockpit [data-investigation-match] .history-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.database-cockpit [data-investigation-row] .history-main time,
.database-cockpit [data-investigation-match] .history-main time {
  grid-column: 2;
  grid-row: 2;
}

.database-cockpit [data-investigation-row] .history-tags,
.database-cockpit [data-investigation-match] .history-tags {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.database-cockpit [data-investigation-row] .history-tags span,
.database-cockpit [data-investigation-match] .history-tags span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.database-cockpit .record-alert-summary {
  margin-bottom: 12px;
  padding: 12px;
  border-left: 4px solid #d97706;
  border-radius: 8px;
  background: #fff8eb;
}

.database-cockpit .record-alert-summary h4,
.database-cockpit .record-alert-summary p {
  margin: 0;
}

.database-cockpit .record-alert-summary p {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.database-cockpit .record-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.database-cockpit .record-facts > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--database-border);
  border-radius: 8px;
  background: #fbfcfd;
}

.database-cockpit .record-facts dt,
.database-cockpit .record-facts dd {
  margin: 0;
}

.database-cockpit .record-facts dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.database-cockpit .record-facts dd {
  font-weight: 750;
}

.database-full-token pre {
  margin: 8px 0 0;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.database-full-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
}

.database-full-details dd {
  user-select: text;
  overflow-wrap: anywhere;
}

.database-cockpit .database-secondary-actions,
.database-cockpit .database-secondary-protected-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  padding-top: 10px;
  border-top: 1px solid var(--database-border);
}

.database-cockpit .database-secondary-actions > a,
.database-cockpit .database-secondary-actions > button {
  color: var(--database-accent-dark);
  background: transparent;
}

.database-cockpit .database-timeline li {
  gap: 4px;
}

.database-cockpit .database-sensitive-result {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--database-accent) 28%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--database-accent) 7%, white);
}

.database-cockpit .database-sensitive-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.6fr) minmax(0, 1.6fr) auto;
  align-items: start;
  gap: 10px;
}

.database-cockpit .database-sensitive-row pre,
.database-cockpit .database-sensitive-row strong {
  min-width: 0;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.database-cockpit .database-audit-summary {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--database-border);
}

.database-cockpit .database-audit-summary dl {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
}

.database-cockpit .database-audit-summary dl > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.3fr);
  gap: 10px;
}

.database-cockpit .database-audit-summary dt,
.database-cockpit .database-audit-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.database-cockpit #databaseReauthStatus:not(:empty) {
  color: #a44b16;
}

.database-cockpit .database-skeleton {
  min-height: 40px;
  padding: 10px;
  color: var(--muted);
  background: linear-gradient(90deg, #f5f7f8, #eef3f3, #f5f7f8);
}

.database-cockpit .card-directory-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.database-cockpit .card-directory-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.database-cockpit .card-directory-checkbox-row input {
  width: auto;
}

.database-cockpit .database-security-dialog,
.database-cockpit .database-danger-dialog,
.database-cockpit .card-directory-modal-card {
  width: min(640px, calc(100vw - 28px));
}

.database-cockpit .database-security-dialog form {
  display: grid;
  gap: 12px;
}

.database-cockpit .database-danger-dialog {
  border-top: 4px solid var(--danger);
}

.database-cockpit .database-danger-dialog .eyebrow {
  color: var(--danger);
}

.database-cockpit .database-danger-impact {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  padding: 10px 10px 10px 30px;
  border-radius: 8px;
  background: #fff7f7;
}

@media (max-width: 1120px) {
  .database-cockpit .database-sidebar {
    width: 184px;
  }

  .database-cockpit .database-shell {
    width: calc(100% - 184px);
    margin-left: 184px;
  }

  .database-cockpit .database-workspace {
    padding-inline: 14px;
  }

  .database-cockpit .database-filter-row.license-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .database-cockpit [data-investigation-row] .history-tags > span:nth-child(2),
  .database-cockpit [data-investigation-row] .history-tags > span:nth-child(5),
  .database-cockpit [data-investigation-match] .history-tags > span:nth-child(2),
  .database-cockpit [data-investigation-match] .history-tags > span:nth-child(5),
  .database-cockpit [data-success-row] .history-tags > span:nth-child(2),
  .database-cockpit [data-success-row] .history-tags > span:nth-child(5) {
    display: none;
  }

  .database-cockpit [data-investigation-row] .history-tags,
  .database-cockpit [data-investigation-match] .history-tags,
  .database-cockpit [data-success-row] .history-tags {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cockpit-page #workspace-records .success-table-head,
  .cockpit-page #workspace-records .success-record {
    grid-template-columns: minmax(56px, .7fr) minmax(100px, 1.25fr) minmax(44px, .5fr) minmax(44px, .5fr) minmax(60px, .7fr) minmax(60px, .7fr) minmax(92px, 1fr) minmax(92px, 1fr);
  }

  #recordsSuccessSlot,
  #workspace-records .success-panel,
  #workspace-records .success-panel-body,
  #workspace-records .success-tools,
  #workspace-records .success-records {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

}

@media (max-width: 900px) {
  .database-cockpit .database-master-detail {
    grid-template-columns: 1fr;
  }

  .database-cockpit .database-detail-panel {
    margin-top: 0;
  }

  .database-cockpit .record-facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .database-full-details {
    grid-template-columns: 1fr;
  }

  body.database-cockpit {
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .database-cockpit [data-investigation-row] .history-tags > span:nth-child(2),
  .database-cockpit [data-investigation-row] .history-tags > span:nth-child(5),
  .database-cockpit [data-investigation-match] .history-tags > span:nth-child(2),
  .database-cockpit [data-investigation-match] .history-tags > span:nth-child(5),
  .database-cockpit [data-success-row] .history-tags > span:nth-child(2),
  .database-cockpit [data-success-row] .history-tags > span:nth-child(5) {
    display: block;
  }

  .database-cockpit .database-sidebar {
    position: sticky;
    inset: 0 0 auto;
    width: 100%;
    min-height: 0;
    gap: 8px;
    padding: 9px 10px;
    overflow: visible;
  }

  .database-cockpit .database-brand,
  .database-cockpit .database-sidebar-foot {
    display: none;
  }

  .database-cockpit .database-nav-toggle {
    display: flex;
    min-height: 40px;
    color: #fff;
    background: var(--database-sidebar-soft);
  }

  .database-cockpit .database-navigation {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .database-cockpit .database-nav-item {
    min-height: 40px;
    justify-content: center;
    padding: 6px;
    font-size: 12px;
  }

  .database-cockpit .database-nav-item > span:first-child {
    display: none;
  }

  .database-cockpit .database-shell {
    display: block;
    width: 100%;
    height: auto;
    margin-left: 0;
    overflow: visible;
  }

  .database-cockpit .database-topbar {
    min-height: 68px;
    padding: 10px 12px;
  }

  .database-cockpit .database-topbar h1 {
    font-size: 19px;
  }

  .database-cockpit .database-top-actions button {
    min-height: 40px;
    padding: 6px 9px;
    font-size: 12px;
  }

  .database-cockpit .database-workspace {
    display: block;
    min-height: 0;
    padding: 13px 10px 30px;
    overflow: visible;
  }

  .database-cockpit .database-workspace > * + * {
    margin-top: 10px;
  }

  .database-cockpit .database-overview,
  .database-cockpit .database-filter-row,
  .database-cockpit .database-more-filter-grid,
  .database-cockpit .license-form,
  .database-cockpit .card-directory-form-grid {
    grid-template-columns: 1fr;
  }

  .database-cockpit .database-filter-row.success-controls,
  .database-cockpit .database-filter-row.license-controls,
  .database-cockpit #cardDirectoryView .database-filter-row.card-directory-controls,
  .database-cockpit #replacementCardDirectoryView .database-filter-row.card-directory-controls,
  .database-cockpit #auditFilters {
    grid-template-columns: 1fr;
  }

  .database-cockpit .wide-overview {
    grid-column: auto;
  }

  .database-cockpit .database-master-detail {
    display: block;
  }

  .database-cockpit .database-detail-panel {
    margin-top: 10px;
  }

  .database-cockpit .database-list-scroll,
  .database-cockpit .database-detail-scroll {
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .database-cockpit .database-pagination {
    position: static;
    flex-wrap: wrap;
  }

  .database-cockpit .database-pagination button {
    min-height: 40px;
  }

  .database-cockpit button,
  .database-cockpit summary {
    min-height: 40px;
  }
}

/* Database administrator login: same palette, independent from other login pages. */
body.database-login {
  --database-login-sidebar: #172630;
  --database-login-accent: #0f806f;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(110deg, rgba(23, 38, 48, 0.98) 0 34%, rgba(238, 242, 244, 0.96) 34% 100%),
    #eef2f4;
}

.database-login .database-login-shell {
  display: grid;
  width: min(880px, 100%);
  grid-template-columns: minmax(240px, 0.8fr) minmax(360px, 1.2fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.2);
}

.database-login .database-login-intro {
  display: grid;
  align-content: space-between;
  gap: 24px;
  padding: 34px 30px;
  color: #d8e4e7;
  background: var(--database-login-sidebar);
}

.database-login .database-login-intro h1 {
  margin: 8px 0 10px;
  color: #fff;
  font-size: 28px;
}

.database-login .database-login-intro p,
.database-login .database-login-intro small {
  color: #a9bdc5;
  line-height: 1.65;
}

.database-login .database-login-card {
  display: grid;
  align-content: center;
  gap: 12px;
  min-width: 0;
  padding: 38px;
}

.database-login .database-login-card h2 {
  margin: 3px 0 0;
  font-size: 24px;
}

.database-login .login-form {
  display: grid;
  gap: 14px;
}

.database-login .login-form button[type="submit"] {
  background: var(--database-login-accent);
}

@media (max-width: 720px) {
  body.database-login {
    padding: 12px;
    background: #eef2f4;
  }

  .database-login .database-login-shell {
    grid-template-columns: 1fr;
  }

  .database-login .database-login-intro {
    padding: 24px;
  }

  .database-login .database-login-card {
    padding: 26px 22px;
  }
}

.cockpit-page .compact-job {
  display: block;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
}

.cockpit-page .compact-job.needs-attention {
  border-color: #e6c675;
  background: #fffdf8;
}

.compact-job-row {
  display: grid;
  grid-template-columns: minmax(135px, 1.3fr) minmax(92px, 0.75fr) minmax(120px, 1fr) minmax(80px, 0.65fr) minmax(68px, 0.55fr) minmax(62px, 0.5fr) minmax(105px, auto) auto;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 9px 11px;
}

.compact-job-account {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.compact-job-account strong,
.compact-job-account small,
.compact-job-issue,
.compact-job-worker,
.compact-job-age,
.compact-job-card {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-job-row > .badge {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-job-account strong {
  font-size: 13px;
}

.compact-job-account small,
.compact-job-issue,
.compact-job-worker,
.compact-job-age,
.compact-job-card {
  color: var(--muted);
  font-size: 11px;
}

.compact-job-primary {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.compact-expand-button {
  min-width: 46px;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.compact-job-primary button {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 11px;
  white-space: nowrap;
}

.compact-job-primary .primary-next {
  color: #fff;
  border-color: var(--cockpit-accent);
  background: var(--cockpit-accent);
}

.compact-job-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #e5ebee;
  background: #f8fafb;
}

.compact-job-detail-group {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e1e8eb;
  border-radius: 7px;
  background: #fff;
}

.compact-job-detail-group h3 {
  margin: 0 0 7px;
  color: #36505a;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.compact-job-detail-group p {
  margin: 0;
}

.compact-job-actions {
  width: min(350px, 36vw);
  grid-template-columns: repeat(2, minmax(105px, 1fr));
}

.compact-job-actions button {
  min-height: 32px;
  font-size: 11px;
}

@media (max-width: 1100px) {
  .compact-job-row {
    grid-template-columns: minmax(0, 1fr) minmax(105px, 0.8fr) auto;
  }

  .compact-job-account {
    grid-row: 1 / span 2;
  }

  .compact-job-row > .badge {
    grid-column: 2;
    grid-row: 1;
  }

  .compact-job-issue {
    grid-column: 2;
    grid-row: 2;
  }

  .compact-job-worker,
  .compact-job-age,
  .compact-job-card {
    grid-row: 3;
  }

  .compact-job-primary {
    grid-column: 3;
    grid-row: 1;
  }

  .compact-expand-button {
    grid-column: 3;
    grid-row: 2 / span 2;
  }
}

@media (max-width: 720px) {
  .compact-job-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  .compact-job-row > .badge,
  .compact-job-issue,
  .compact-job-worker,
  .compact-job-age,
  .compact-job-card {
    grid-column: 1;
    grid-row: auto;
  }

  .compact-job-primary {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: stretch;
    flex-direction: column;
    justify-content: center;
  }

  .compact-expand-button {
    grid-column: 2;
    grid-row: 3 / span 3;
    align-self: center;
  }

  .compact-job-details {
    grid-template-columns: 1fr;
  }

  .compact-job-actions {
    width: 100%;
  }
}

/* Internal console task cockpit */
body.cockpit-page {
  --cockpit-sidebar: #172630;
  --cockpit-sidebar-soft: #223540;
  --cockpit-canvas: #eef2f4;
  --cockpit-accent: #0f806f;
  --cockpit-accent-dark: #0b675b;
  --cockpit-panel-border: #d9e1e5;
  margin: 0;
  min-width: 0;
  background: var(--cockpit-canvas);
  color: #172b34;
}

.cockpit-page [hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: grid;
  width: 218px;
  grid-template-rows: auto 1fr auto;
  padding: 22px 14px 18px;
  color: #aebdc5;
  background: var(--cockpit-sidebar);
  box-shadow: 8px 0 30px rgba(15, 23, 42, 0.08);
}

.sidebar-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 8px 22px;
  color: #fff;
}

.sidebar-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--cockpit-accent);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.sidebar-brand-copy {
  display: grid;
  gap: 2px;
}

.sidebar-brand-copy strong {
  font-size: 15px;
  letter-spacing: 0.05em;
}

.sidebar-brand-copy small {
  color: #8fa2ac;
  font-size: 11px;
}

.workspace-nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

.workspace-nav button {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  color: #aebdc5;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.workspace-nav button:hover,
.workspace-nav button:focus-visible {
  color: #fff;
  background: var(--cockpit-sidebar-soft);
}

.workspace-nav button[aria-current="page"] {
  color: #fff;
  background: var(--cockpit-accent);
}

.workspace-nav button span:first-child {
  font-size: 18px;
  text-align: center;
}

.sidebar-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 13px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12);
}

.app-stage {
  min-width: 0;
  margin-left: 218px;
}

.cockpit-page .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 92px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--cockpit-panel-border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 3px 16px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(12px);
}

.cockpit-page .topbar-copy h1 {
  margin: 2px 0 0;
  font-size: 24px;
  line-height: 1.15;
}

.cockpit-page .topbar .eyebrow {
  margin: 0;
  color: var(--cockpit-accent);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.system-status-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 7px;
}

.system-status-lines[role="status"] {
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid #dce6e4;
  border-radius: 999px;
  background: #f7faf9;
}

.cockpit-page .status-line {
  margin: 0;
  font-size: 12px;
}

.sidebar-toggle {
  display: none;
}

.cockpit-main {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 22px 26px 42px;
}

.workspace {
  min-width: 0;
}

.workspace-intro {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.workspace-intro h2,
.task-list-toolbar h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.workspace-intro p,
.task-list-toolbar p {
  margin: 0;
}

.workspace-actions,
.workspace-tabs,
.task-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.workspace-tabs {
  margin-bottom: 14px;
}

.supporting-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--cockpit-panel-border);
  border-radius: 9px;
  margin-bottom: 14px;
}

.supporting-stat {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 8px 12px;
  border: 0;
  border-right: 1px solid var(--cockpit-panel-border);
  border-radius: 0;
  background: #fff;
}

.supporting-stat:last-child {
  border-right: 0;
}

.supporting-stat span,
.supporting-stat small {
  color: var(--muted);
  font-size: 12px;
}

.supporting-stat strong {
  font-size: 18px;
}

#workspace-cards .payment-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.payment-card-content {
  min-width: 0;
}

.card-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(70px, 1fr));
  gap: 8px;
}

.card-facts > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.card-facts small {
  color: var(--muted);
  font-size: 11px;
}

.card-facts strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.card-facts .is-full strong {
  color: var(--bad);
}

.payment-card-list-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.payment-card-list-actions > button:not(.card-switch) {
  min-height: 36px;
}

.card-detail-actions {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.card-detail-actions summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.card-detail-body {
  display: flex;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.card-detail-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

#workspace-workers .worker-slots {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.worker-summary-counters {
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.worker-summary-counters > span {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 6px 9px;
  border-right: 1px solid var(--line);
}

.worker-summary-counters > span:last-child {
  border-right: 0;
}

.worker-summary-counters small {
  color: var(--muted);
  font-size: 11px;
}

.worker-summary-counters strong {
  font-size: 15px;
}

.worker-summary-counters.has-abnormal > span:last-child strong {
  color: var(--danger);
}

.worker-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 12px;
  margin: 2px 0 0;
}

.worker-facts div {
  min-width: 0;
}

.worker-facts dt {
  color: var(--muted);
  font-size: 11px;
}

.worker-facts dd {
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

#workspace-records .success-tools {
  grid-template-columns: minmax(200px, 1fr) minmax(90px, 120px) minmax(120px, 160px) auto;
  justify-content: stretch;
}

#workspace-records .success-table-head,
#workspace-records .success-record {
  grid-template-columns: minmax(90px, .8fr) minmax(180px, 1.5fr) minmax(60px, .5fr) minmax(60px, .5fr) minmax(88px, .75fr) minmax(88px, .75fr) minmax(130px, 1fr) minmax(130px, 1fr);
  gap: 8px;
}

#workspace-records .success-record {
  font-size: 12px;
}

.success-account,
#workspace-records .success-record code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-filter-tabs {
  display: flex;
  gap: 8px;
  padding: 16px 16px 0;
}

.log-filter-tabs button[aria-pressed="true"] {
  color: #fff;
  border-color: var(--cockpit-accent);
  background: var(--cockpit-accent);
}

.settings-compact-list {
  display: grid;
  gap: 8px;
  max-width: 980px;
}

.settings-compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 0;
  padding: 12px;
}

.settings-compact-row h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.settings-row-facts {
  display: flex;
  gap: 8px 20px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.settings-row-facts b {
  margin-right: 4px;
  color: var(--text);
}

.workspace-tabs button[aria-selected="true"],
.task-filter-tabs button[aria-pressed="true"] {
  color: #fff;
  border-color: var(--cockpit-accent);
  background: var(--cockpit-accent);
}

.cockpit-page .panel {
  border-color: var(--cockpit-panel-border);
  border-radius: 10px;
  box-shadow: 0 7px 20px rgba(15, 23, 42, 0.045);
}

#taskOverviewSlot .workbench-panel {
  margin-bottom: 14px;
}

#taskOverviewSlot .section-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

#taskOverviewSlot .section-head > div:first-child {
  display: none;
}

.task-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--cockpit-panel-border);
  border-radius: 8px;
}

.task-summary-item {
  display: grid;
  min-width: 0;
  min-height: 58px;
  justify-items: start;
  padding: 8px 12px;
  border: 0;
  border-right: 1px solid var(--cockpit-panel-border);
  border-radius: 0;
  color: #1a3039;
  background: #fff;
  box-shadow: none;
  text-align: left;
}

.task-summary-item:last-child {
  border-right: 0;
}

.task-summary-item:hover,
.task-summary-item:focus-visible {
  background: #f8fcfb;
}

.task-summary-item strong {
  margin: 1px 0;
  font-size: 18px;
}

.task-summary-attention {
  background: #fffdf7;
}

.task-summary-item span,
.task-summary-item small {
  color: var(--muted);
  font-size: 10px;
}

.task-cockpit-grid {
  display: grid;
  grid-template-columns: minmax(300px, .72fr) minmax(620px, 1.55fr);
  gap: 14px;
  align-items: start;
}

#taskComposerSlot .task-panel,
#taskQueueSlot .queue-panel {
  margin: 0;
}

#taskComposerSlot .task-panel h2 {
  margin-bottom: 14px;
}

#taskComposerSlot .task-meta-grid {
  grid-template-columns: 1fr 1fr;
}

#taskComposerSlot .task-meta-grid label:last-child {
  grid-column: 1 / -1;
}

#taskComposerSlot .task-action-row {
  grid-template-columns: minmax(145px, 1.2fr) minmax(90px, 0.8fr) auto;
}

.secondary-action {
  color: #28434d;
  border-color: #d8e1e5;
  background: #e8edef;
}

.task-queue-column {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--cockpit-panel-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(15, 23, 42, 0.045);
}

.task-list-toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 17px 12px;
  border-bottom: 1px solid #e6ecef;
}

#taskQueueSlot .queue-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#taskQueueSlot .queue-panel > .section-head {
  justify-content: flex-end;
  min-height: 42px;
  padding: 8px 14px;
  border-bottom: 1px solid #eef2f4;
}

#taskQueueSlot .queue-panel > .section-head > div:first-child {
  display: none;
}

#taskQueueSlot .jobs {
  max-height: 510px;
  overflow: auto;
  padding: 8px;
}

.task-attention-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.task-attention-grid .panel {
  margin: 0;
}

#workspace-cards > #cardsPaymentSlot,
#workspace-cards > #cardsReplacementSlot,
#workspace-cards > #billingProfileSlot,
#workspace-workers > #workersSlot,
#workspace-records > #recordsSuccessSlot,
#workspace-records > #recordsLogsSlot {
  margin-bottom: 14px;
}

#workspace-cards .payment-panel,
#workspace-cards .billing-panel,
#workspace-workers .worker-slots-panel,
#workspace-records .success-panel,
#workspace-records .help-panel {
  margin: 0;
}

#workspace-records details > summary {
  display: none;
}

#workspace-records .success-panel-body,
#workspace-records .feedback-logs {
  padding-top: 16px;
}

.settings-tools-panel {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  max-width: 820px;
  margin-bottom: 12px;
}

.settings-tools-panel h3,
.settings-tools-panel p {
  margin: 0;
}

.settings-tools-panel p {
  margin-top: 4px;
}

@media (max-width: 1180px) {
  .app-sidebar {
    width: 184px;
  }

  .app-stage {
    margin-left: 184px;
  }

  .task-cockpit-grid {
    grid-template-columns: minmax(300px, 0.9fr) minmax(430px, 1.2fr);
  }

  .cockpit-main {
    padding-inline: 18px;
  }
}

@media (max-width: 920px) {
  .task-cockpit-grid,
  .task-attention-grid {
    grid-template-columns: 1fr;
  }

  #taskQueueSlot .jobs {
    max-height: 560px;
  }

  .task-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-summary-item:nth-child(2) {
    border-right: 0;
  }

  .task-summary-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--cockpit-panel-border);
  }
}

@media (max-width: 720px) {
  .app-sidebar {
    width: min(82vw, 260px);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  .cockpit-page.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .cockpit-page.sidebar-open::after {
    position: fixed;
    z-index: 25;
    inset: 0;
    content: "";
    background: rgba(15, 23, 42, 0.42);
  }

  .app-stage {
    margin-left: 0;
  }

  .cockpit-page .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
    min-height: 78px;
    padding: 10px;
  }

  .sidebar-toggle {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    padding: 0;
  }

  .cockpit-page .topbar-copy {
    min-width: 0;
  }

  .cockpit-page .topbar .eyebrow {
    display: none;
  }

  .cockpit-page .topbar-copy h1 {
    margin-top: 0;
    font-size: 18px;
  }

  .cockpit-page .top-actions {
    display: flex;
  }

  .cockpit-page .top-actions button {
    min-height: 40px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .system-status-lines {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: 4px;
    box-sizing: border-box;
    border-radius: 6px;
  }

  .system-status-lines #workerStatus {
    display: none;
  }

  .system-status-lines #backendStatus {
    overflow-wrap: anywhere;
    line-height: 1.25;
  }

  .cockpit-main {
    padding: 14px 10px 30px;
  }

  .task-summary-strip,
  #taskComposerSlot .task-meta-grid,
  #taskComposerSlot .task-action-row,
  .task-cockpit-grid,
  .task-attention-grid {
    grid-template-columns: 1fr;
  }

  .workspace-intro,
  .task-list-toolbar,
  .settings-tools-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-actions,
  .workspace-tabs,
  .task-filter-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace-actions > *,
  .workspace-tabs > *,
  .task-filter-tabs > *,
  .settings-tools-panel > button {
    width: 100%;
  }

  .supporting-stat-strip,
  .worker-summary-counters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .supporting-stat:nth-child(2),
  .worker-summary-counters > span:nth-child(2) {
    border-right: 0;
  }

  .supporting-stat:nth-child(-n + 2),
  .worker-summary-counters > span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--cockpit-panel-border);
  }

  #workspace-cards .payment-card,
  #workspace-workers .worker-slots,
  #workspace-records .success-tools,
  #workspace-records .success-record,
  .settings-compact-row {
    grid-template-columns: 1fr;
  }

  .cockpit-page #workspace-records .success-record {
    grid-template-columns: 1fr;
  }

  .cockpit-page #workspace-records .success-record > :nth-child(4),
  .cockpit-page #workspace-records .success-record > :nth-child(6) {
    display: block;
  }

  .card-facts,
  .worker-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payment-card-list-actions,
  .card-detail-buttons,
  .log-filter-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .payment-card-list-actions > *,
  .card-detail-buttons > *,
  .log-filter-tabs > *,
  .settings-compact-row > button {
    width: 100%;
  }

  #workspace-records .success-table-head {
    display: none;
  }
}



/* ============================================================
   Meta 设计层 v2（2026-08-05 批 1.5 视觉对齐静态稿）
   只作用于操作台主页面（body.cockpit-page）；
   database.html / admin-login.html / worker.html 共用本文件但不受此层影响。
   依据：docs/操作台前端改版方案/preview/meta-tokens.css + preview.css
   ============================================================ */

/* ---- 设计 token ---- */
body.cockpit-page {
  --cobalt: #0064e0;
  --cobalt-press: #0457cb;
  --cobalt-soft: #e3effc;
  --fb-blue: #1876f2;
  --ink-btn: #000000;
  --ink-deep: #0a1317;
  --ink: #1c1e21;
  --charcoal: #444950;
  --steel: #5d6c7b;
  --stone: #8595a4;
  --disabled: #bcc0c4;
  --canvas: #ffffff;
  --cloud: #f1f4f7;
  --hairline: #ced0d4;
  --hairline-soft: #dee3e9;
  --ok: #31a24c;
  --attention: #f2a918;
  --attention-soft: #fff6e0;
  --warn-banner: #f7b928;
  --critical: #e41e3f;
  --critical-strong: #f0284a;
  --line: var(--hairline-soft);
  --panel: #ffffff;
  --muted: var(--steel);
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  letter-spacing: -0.14px;
}

/* ---- 页面壳：白底，去掉灰底板 ---- */
body.cockpit-page .app-stage,
body.cockpit-page .cockpit-main { background: var(--canvas); }
body.cockpit-page .cockpit-main { padding: 24px; }
body.cockpit-page .workspace { display: grid; gap: 16px; align-content: start; }
body.cockpit-page .workspace[hidden] { display: none; }

/* ---- 侧边栏 ---- */
body.cockpit-page .app-sidebar {
  background: var(--canvas);
  border-right: 1px solid var(--hairline-soft);
  padding: 20px 16px;
}
body.cockpit-page .sidebar-brand { padding: 0 8px; display: flex; align-items: center; gap: 12px; }
body.cockpit-page .sidebar-brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--ink-btn); color: #fff;
  display: grid; place-items: center; font-size: 15px; font-weight: 800;
}
body.cockpit-page .sidebar-brand-copy strong { display: block; font-size: 16px; font-weight: 700; color: var(--ink-deep); }
body.cockpit-page .sidebar-brand-copy small { font-size: 12px; color: var(--stone); }
body.cockpit-page .workspace-nav { display: grid; gap: 6px; }
body.cockpit-page .workspace-nav button {
  display: flex; align-items: center; gap: 10px;
  height: 40px; min-height: 40px; padding: 0 16px;
  border: 0; border-radius: 100px;
  background: transparent; color: var(--steel);
  font-size: 14px; font-weight: 400; text-align: left; cursor: pointer;
}
body.cockpit-page .workspace-nav button span[aria-hidden="true"] { display: none; }
body.cockpit-page .workspace-nav button:hover { background: var(--cloud); color: var(--ink); }
body.cockpit-page .workspace-nav button[aria-current="page"] {
  background: var(--ink-deep); color: #fff; font-weight: 700;
}
body.cockpit-page .sidebar-footer {
  margin-top: auto; border-top: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 0 8px; font-size: 12px; color: var(--steel);
}
body.cockpit-page .sidebar-db-link {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; margin-bottom: 4px;
  border: 1px solid var(--hairline); border-radius: 100px;
  color: var(--ink-deep); font-size: 12px; font-weight: 700;
  text-decoration: none; white-space: nowrap; background: var(--canvas);
}
body.cockpit-page .sidebar-db-link:hover { border-color: var(--ink-deep); }
body.cockpit-page .online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }

/* ---- 顶栏：64px 白底 sticky，状态并成 cloud 横条 ---- */
body.cockpit-page .topbar {
  height: 64px; min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 24px;
  background: var(--canvas); border-bottom: 1px solid var(--hairline-soft);
  position: sticky; top: 0; z-index: 10;
}
body.cockpit-page .topbar .eyebrow { display: none; }
body.cockpit-page .topbar h1 { font-size: 24px; font-weight: 500; color: var(--ink-deep); line-height: 1.25; margin: 0; }
body.cockpit-page .top-actions { display: flex; align-items: center; gap: 12px; }
body.cockpit-page .system-status-lines {
  display: flex; align-items: center; gap: 18px;
  height: 36px; padding: 0 18px; margin: 0;
  background: var(--cloud); border-radius: 100px;
}
body.cockpit-page .status-line {
  display: flex; align-items: center; gap: 7px;
  margin: 0; font-size: 12px; color: var(--charcoal); white-space: nowrap;
  background: transparent; border: 0; padding: 0;
}
body.cockpit-page .status-line::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--stone); flex: 0 0 auto;
}
body.cockpit-page .status-line.ok::before { background: var(--ok); }
body.cockpit-page .status-line.bad { color: var(--critical); font-weight: 700; }
body.cockpit-page .status-line.bad::before { background: var(--critical); }

/* ---- 按钮（永远 pill） ---- */
body.cockpit-page button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 22px;
  border: 0; border-radius: 100px;
  background: var(--cobalt); color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 700; letter-spacing: -0.14px;
  cursor: pointer; white-space: nowrap;
  transition: background-color 150ms ease-out, border-color 150ms ease-out;
}
body.cockpit-page button:hover { background: var(--cobalt-press); }
body.cockpit-page button:disabled { background: var(--disabled); color: #fff; cursor: not-allowed; }
body.cockpit-page button.ghost {
  background: transparent; color: var(--ink-deep);
  border: 2px solid rgba(10, 19, 23, 0.12); padding: 7px 20px;
}
body.cockpit-page button.ghost:hover { background: transparent; border-color: rgba(10, 19, 23, 0.28); }
body.cockpit-page button.danger,
body.cockpit-page button[class*="danger"] { background: var(--critical); color: #fff; border: 0; }
body.cockpit-page button.danger:hover { background: var(--critical-strong); }
body.cockpit-page button.secondary-action {
  background: transparent; color: var(--ink-deep);
  border: 2px solid var(--ink-deep); padding: 7px 20px;
}
body.cockpit-page button.secondary-action:hover { background: transparent; border-color: var(--charcoal); color: var(--charcoal); }
body.cockpit-page button.btn-black,
body.cockpit-page #submitLicenseCreateBtn { background: var(--ink-btn); color: #fff; }
body.cockpit-page button.btn-black:hover,
body.cockpit-page #submitLicenseCreateBtn:hover { background: var(--charcoal); }
body.cockpit-page .btn-sm,
body.cockpit-page button.btn-sm { min-height: 30px; padding: 4px 14px; font-size: 12px; }
body.cockpit-page #refreshBtn {
  background: transparent; color: var(--ink-deep);
  border: 2px solid var(--ink-deep); min-height: 40px; padding: 7px 22px;
}
body.cockpit-page #refreshBtn:hover { background: transparent; border-color: var(--charcoal); color: var(--charcoal); }

/* ---- 徽标（实色 pill） ---- */
body.cockpit-page .badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 24px; padding: 4px 10px;
  border: 0; border-radius: 100px;
  font-size: 12px; font-weight: 700; line-height: 1.33; white-space: nowrap;
  background: var(--cloud); color: var(--steel);
}
body.cockpit-page .badge-ok { background: var(--ok); color: #fff; }
body.cockpit-page .badge-warn { background: var(--attention); color: #fff; }
body.cockpit-page .badge-bad { background: var(--critical); color: #fff; }
body.cockpit-page .badge-neutral { background: var(--cloud); color: var(--steel); }
body.cockpit-page .badge-info { background: var(--cobalt-soft); color: var(--cobalt-press); }

/* ---- pill tab（筛选 / 工作区 tab） ---- */
body.cockpit-page .task-filter-tabs button,
body.cockpit-page .workspace-tabs button,
body.cockpit-page .log-filter-tabs button {
  min-height: 34px; padding: 6px 16px;
  border: 1px solid var(--hairline); border-radius: 100px;
  background: var(--canvas); color: var(--ink);
  font-size: 14px; font-weight: 400;
}
body.cockpit-page .task-filter-tabs button:hover,
body.cockpit-page .workspace-tabs button:hover,
body.cockpit-page .log-filter-tabs button:hover { background: var(--cloud); }
body.cockpit-page .task-filter-tabs button[aria-pressed="true"],
body.cockpit-page .workspace-tabs button[aria-selected="true"],
body.cockpit-page .log-filter-tabs button[aria-pressed="true"] {
  background: var(--ink-deep); border-color: var(--ink-deep);
  color: #fff; font-weight: 700;
}

/* ---- 面板 / 卡片（hairline 边框，无阴影无灰底） ---- */
body.cockpit-page .panel {
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  box-shadow: none;
  padding: 20px 24px;
}
body.cockpit-page .section-head,
body.cockpit-page .panel-title-row,
body.cockpit-page .task-list-toolbar,
body.cockpit-page .workspace-intro {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
body.cockpit-page .section-head h2,
body.cockpit-page .panel-title-row h2,
body.cockpit-page .task-list-toolbar h2,
body.cockpit-page .workspace-intro h2,
body.cockpit-page .success-summary span,
body.cockpit-page .help-panel summary {
  font-size: 18px; font-weight: 700; color: var(--ink-deep); margin: 0;
}
body.cockpit-page .workspace-intro .muted,
body.cockpit-page .panel .muted,
body.cockpit-page .modal-card .muted { font-size: 12px; color: var(--stone); }
body.cockpit-page .eyebrow {
  font-size: 12px; font-weight: 400; color: var(--stone);
  letter-spacing: 0; text-transform: none; margin: 0 0 2px;
}
body.cockpit-page .step-badge {
  display: inline-flex; align-items: center; min-height: 22px; padding: 2px 10px;
  background: var(--cloud); color: var(--steel);
  border-radius: 100px; font-size: 11px; font-weight: 700;
}
body.cockpit-page .panel-title-actions,
body.cockpit-page .worker-head-actions,
body.cockpit-page .workspace-actions,
body.cockpit-page .queue-tools,
body.cockpit-page .success-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
body.cockpit-page .task-cockpit-grid { gap: 16px; }
body.cockpit-page .task-attention-grid { gap: 16px; }
body.cockpit-page .task-queue-column { display: grid; gap: 12px; align-content: start; }
body.cockpit-page .queue-panel { border: 0; padding: 0; }
body.cockpit-page .queue-panel .section-head { display: none; }
body.cockpit-page details.panel > summary {
  font-size: 18px; font-weight: 700; color: var(--ink-deep);
  padding: 0; margin-bottom: 12px;
}

/* ---- KPI 瓦片（24px 圆角 + 大数字） ---- */
body.cockpit-page .task-summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; border: 0; border-radius: 0; overflow: visible; background: transparent; }
body.cockpit-page .task-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
body.cockpit-page .supporting-stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
body.cockpit-page .task-summary-item,
body.cockpit-page .supporting-stat {
  border: 1px solid var(--hairline-soft); border-radius: 24px;
  background: var(--canvas); box-shadow: none;
  padding: 18px 22px; display: grid; gap: 6px;
  text-align: left; justify-items: start; min-width: 0;
}
body.cockpit-page .task-summary-item:hover,
body.cockpit-page .supporting-stat:hover { border-color: var(--hairline); background: var(--canvas); }
body.cockpit-page .task-summary-item span,
body.cockpit-page .supporting-stat span { font-size: 12px; font-weight: 700; color: var(--steel); }
body.cockpit-page .task-summary-item strong {
  font-size: 32px; font-weight: 500; color: var(--ink-deep);
  line-height: 1.28; font-variant-numeric: tabular-nums; margin: 0;
}
body.cockpit-page .supporting-stat strong {
  font-size: 24px; font-weight: 500; color: var(--ink-deep);
  line-height: 1.28; font-variant-numeric: tabular-nums;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.cockpit-page .task-summary-item small,
body.cockpit-page .supporting-stat small { font-size: 12px; color: var(--stone); }
body.cockpit-page .task-summary-attention {
  background: var(--attention-soft); border-color: var(--attention);
}
body.cockpit-page .task-summary-attention strong { color: var(--attention); }
body.cockpit-page .task-summary-attention small { color: var(--attention); }
@media (max-width: 1180px) {
  body.cockpit-page .task-summary-strip,
  body.cockpit-page .task-summary-grid,
  body.cockpit-page .supporting-stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- 表单（44px / 8px 圆角） ---- */
body.cockpit-page .form-grid { gap: 14px; }
body.cockpit-page .form-grid label {
  display: grid; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--charcoal);
}
body.cockpit-page input,
body.cockpit-page select,
body.cockpit-page textarea {
  width: 100%; border: 1px solid var(--hairline); border-radius: 8px;
  background: var(--canvas); color: var(--ink);
  font-family: inherit; font-size: 14px; letter-spacing: -0.14px;
  padding: 10px 12px; min-height: 44px;
}
body.cockpit-page textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
body.cockpit-page input:focus,
body.cockpit-page select:focus,
body.cockpit-page textarea:focus { outline: none; border: 2px solid var(--fb-blue); padding: 9px 11px; }
body.cockpit-page input::placeholder,
body.cockpit-page textarea::placeholder { color: var(--stone); }
body.cockpit-page input[readonly] { background: var(--cloud); border-color: transparent; color: var(--charcoal); }
body.cockpit-page #sessionText {
  background: var(--cloud); border: 0; border-radius: 8px;
  padding: 14px 16px; min-height: 148px;
}
body.cockpit-page #sessionText:focus { outline: 2px solid var(--fb-blue); border: 0; padding: 14px 16px; }
body.cockpit-page .task-action-row,
body.cockpit-page .profile-actions { display: flex; gap: 12px; flex-wrap: wrap; }
body.cockpit-page .task-meta-grid { gap: 14px; }

/* ---- 实时队列行（静态稿 queue-row 风格） ---- */
body.cockpit-page #jobs.jobs { display: grid; gap: 2px; background: transparent; border: 0; padding: 0; max-height: none; overflow: visible; }
body.cockpit-page .job.compact-job {
  border: 0; border-radius: 16px;
  background: transparent; box-shadow: none; padding: 0; margin: 0;
}
body.cockpit-page .job.compact-job:hover { background: var(--cloud); }
body.cockpit-page .job.compact-job.is-running { border: 0; }
body.cockpit-page .job.compact-job.needs-attention { background: var(--attention-soft); border: 0; }
body.cockpit-page .job.compact-job.needs-attention:hover { background: #ffefc9; }
body.cockpit-page .compact-job-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) auto minmax(120px, 1fr) auto auto auto auto auto;
  align-items: center; gap: 14px;
  padding: 11px 12px;
}
body.cockpit-page .compact-job-account strong { font-size: 14px; font-weight: 700; color: var(--ink); }
body.cockpit-page .compact-job-account small { display: block; font-size: 12px; color: var(--stone); margin-top: 2px; }
body.cockpit-page .compact-job-issue {
  font-size: 12px; color: var(--stone);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.cockpit-page .needs-attention .compact-job-issue { color: var(--attention); font-weight: 700; }
body.cockpit-page .compact-job-worker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--steel); white-space: nowrap; }
body.cockpit-page .compact-job-age { font-size: 12px; color: var(--stone); font-variant-numeric: tabular-nums; white-space: nowrap; }
body.cockpit-page .compact-job-card { font-size: 12px; color: var(--steel); white-space: nowrap; }
body.cockpit-page .compact-job-primary button { min-height: 30px; padding: 4px 14px; font-size: 12px; }
body.cockpit-page .compact-expand-button { min-height: 30px; padding: 4px 14px; font-size: 12px; }
body.cockpit-page .compact-job-details {
  margin: 0 12px 12px; padding: 12px 4px 4px;
  border-top: 1px dashed var(--hairline-soft);
  display: grid; gap: 12px;
}
body.cockpit-page .compact-job-detail-group h3 { font-size: 12px; font-weight: 700; color: var(--charcoal); margin: 0 0 6px; }
body.cockpit-page .compact-job-detail-group p { font-size: 13px; color: var(--steel); margin: 0; }
body.cockpit-page .job-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--steel); }
body.cockpit-page .compact-job-actions { display: flex; flex-wrap: wrap; gap: 8px; }
body.cockpit-page .compact-job-actions button { min-height: 30px; padding: 4px 14px; font-size: 12px; }

/* ---- 渠道徽标（API / 浏览器） ---- */
body.cockpit-page .channel-badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 9px;
  border-radius: 100px; font-size: 11px; font-weight: 700;
}
body.cockpit-page .channel-api { background: #efe7fd; color: #6c3fd4; }
body.cockpit-page .channel-browser { background: var(--cobalt-soft); color: var(--cobalt-press); }

/* ---- 卡片页（payment-card 行） ---- */
body.cockpit-page .payment-cards { display: grid; gap: 10px; }
body.cockpit-page .payment-card {
  border: 1px solid var(--hairline-soft); border-radius: 16px;
  background: var(--canvas); box-shadow: none; padding: 14px 18px;
}
body.cockpit-page .payment-card:hover { background: var(--cloud); }
body.cockpit-page .payment-card.is-selected {
  border-color: var(--hairline-soft);
  box-shadow: inset 3px 0 0 var(--cobalt);
}
body.cockpit-page .payment-card.is-selected:hover { background: var(--cobalt-soft); }
body.cockpit-page .payment-card.is-disabled-card { opacity: 0.62; }
body.cockpit-page .payment-card-title { font-size: 14px; font-weight: 700; color: var(--ink); }
body.cockpit-page .payment-card-list-actions { display: flex; gap: 8px; flex-wrap: wrap; }
body.cockpit-page .payment-card-list-actions button { min-height: 30px; padding: 4px 14px; font-size: 12px; }
body.cockpit-page .card-library { background: transparent; border: 0; padding: 0; }
body.cockpit-page .billing-profile-card {
  border: 1px solid var(--hairline-soft); border-radius: 16px;
  background: var(--canvas); padding: 16px 18px; box-shadow: none;
}
body.cockpit-page .mini-label { font-size: 12px; font-weight: 700; color: var(--steel); }

/* ---- 开关（toggle） ---- */
body.cockpit-page .card-switch { font-size: 14px; font-weight: 700; color: var(--ink); }
body.cockpit-page .card-switch-track { background: var(--hairline); border-radius: 100px; }
body.cockpit-page .card-switch.is-on .card-switch-track { background: var(--ok); }
body.cockpit-page .card-switch-knob { background: var(--canvas); }

/* ---- 执行器页 ---- */
body.cockpit-page .worker-slots { display: grid; gap: 10px; }
body.cockpit-page .worker-slots > * {
  border: 1px solid var(--hairline-soft); border-radius: 16px;
  background: var(--canvas); box-shadow: none; padding: 14px 18px;
}
body.cockpit-page .api-recent-list { display: grid; gap: 8px; }
body.cockpit-page .api-recent-list > * {
  border: 1px solid var(--hairline-soft); border-radius: 16px;
  background: var(--canvas); box-shadow: none; padding: 12px 16px;
}
body.cockpit-page #apiExecutorPanel .task-summary-grid { margin-bottom: 16px; }

/* ---- 记录页 ---- */
body.cockpit-page .success-records { display: grid; gap: 8px; }
body.cockpit-page .success-record {
  border: 1px solid var(--hairline-soft); border-radius: 16px;
  background: var(--canvas); box-shadow: none; padding: 14px 18px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}
body.cockpit-page .success-record:hover {
  background: var(--cloud);
  border-color: var(--hairline);
  box-shadow: 0 8px 22px rgba(20, 22, 26, 0.08);
  transform: translateY(-2px);
}
body.cockpit-page .success-record:focus-visible {
  outline: 3px solid var(--cobalt-soft);
  outline-offset: 2px;
  border-color: var(--fb-blue);
}
body.cockpit-page .search-box input { min-height: 40px; border-radius: 100px; padding-left: 36px; }
body.cockpit-page .compact-field select { min-height: 40px; }
body.cockpit-page .feedback-logs { display: grid; }
body.cockpit-page .feedback-logs > * {
  padding: 9px 4px; border-bottom: 1px solid var(--hairline-soft);
  font-size: 13px; color: var(--charcoal);
}
body.cockpit-page .feedback-logs > *:last-child { border-bottom: 0; }
body.cockpit-page .pending-confirmations { display: grid; gap: 8px; }
body.cockpit-page .pending-confirmations > *:not(.empty) {
  border: 1px solid var(--hairline-soft); border-radius: 16px;
  background: var(--canvas); padding: 12px 16px;
}

/* ---- 卡密管理 ---- */
body.cockpit-page .lic-toolbar {
  display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 12px;
}
body.cockpit-page .lic-toolbar input,
body.cockpit-page .lic-toolbar select { min-height: 44px; }
body.cockpit-page .lic-list { display: grid; gap: 8px; }
body.cockpit-page .lic-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 1fr) auto auto auto;
  align-items: center; gap: 18px;
  padding: 14px 18px;
  background: var(--canvas); border: 1px solid var(--hairline-soft); border-radius: 16px;
}
body.cockpit-page .lic-row:hover { background: var(--cloud); }
body.cockpit-page .lic-row.is-disabled { opacity: 0.62; }
body.cockpit-page .lic-main { min-width: 0; }
body.cockpit-page .lic-key { display: block; font-size: 14px; font-weight: 600; }
body.cockpit-page .lic-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--stone); }
body.cockpit-page .lic-plan { flex: 0 0 auto; }
body.cockpit-page .lic-quota { display: flex; align-items: center; gap: 8px; }
body.cockpit-page .lic-quota .num { font-variant-numeric: tabular-nums; font-weight: 700; }
body.cockpit-page .lic-quota small { color: var(--stone); }
body.cockpit-page .lic-meta { display: grid; gap: 2px; font-size: 12px; color: var(--steel); white-space: nowrap; }
body.cockpit-page .lic-actions { display: flex; gap: 8px; }

/* ---- 卡密详情弹窗 ---- */
body.cockpit-page .lic-detail-card { width: min(720px, 100%); }
body.cockpit-page .lic-detail-body { display: grid; gap: 18px; }
body.cockpit-page .detail-list { display: grid; margin: 0; }
body.cockpit-page .detail-row {
  display: grid; grid-template-columns: 132px 1fr; gap: 12px;
  padding: 11px 4px; border-bottom: 1px solid var(--hairline-soft);
  font-size: 14px;
}
body.cockpit-page .detail-row:last-child { border-bottom: 0; }
body.cockpit-page .detail-row dt { color: var(--ink); font-weight: 700; }
body.cockpit-page .detail-row dd { margin: 0; color: var(--charcoal); overflow-wrap: anywhere; }
body.cockpit-page .lic-acc-title { font-size: 16px; font-weight: 700; color: var(--ink-deep); margin: 0; }
body.cockpit-page .lic-acc-list { display: grid; gap: 10px; }
body.cockpit-page .lic-acc {
  border: 1px solid var(--hairline-soft); border-radius: 16px;
  padding: 14px 16px; display: grid; gap: 8px;
}
body.cockpit-page .lic-acc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
body.cockpit-page .lic-acc-head strong { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
body.cockpit-page .lic-acc-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--steel); }
body.cockpit-page .lic-acc-msg { margin: 0; font-size: 12px; color: var(--charcoal); }
body.cockpit-page .lic-acc-snap { border-top: 1px dashed var(--hairline-soft); padding-top: 10px; }
body.cockpit-page .lic-snap-fields { display: grid; gap: 10px; }
body.cockpit-page .lic-snap-field { display: grid; gap: 4px; font-size: 12px; color: var(--stone); }
body.cockpit-page .lic-snap-field code {
  display: block; background: var(--cloud); border-radius: 8px;
  padding: 8px 10px; font-size: 12px; color: var(--ink);
  overflow-wrap: anywhere; max-height: 140px; overflow-y: auto;
}
body.cockpit-page .lic-snap-field .copy-btn { justify-self: start; margin-left: 0; }

/* ---- 模态框（24px 圆角） ---- */
body.cockpit-page .modal-card {
  border-radius: 24px; padding: 28px;
  border: 0; box-shadow: rgba(20, 22, 26, 0.3) 0 1px 4px;
}
body.cockpit-page .modal-card h2 { font-size: 24px; font-weight: 500; color: var(--ink-deep); margin: 0 0 6px; }
body.cockpit-page .modal-card .eyebrow { margin-bottom: 2px; }
body.cockpit-page .modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
body.cockpit-page .record-detail-card { width: min(920px, 100%); }
body.cockpit-page .record-detail-body { display: grid; gap: 22px; margin-top: 22px; }
body.cockpit-page .record-detail-status { display: flex; align-items: center; gap: 12px; color: var(--charcoal); }
body.cockpit-page .record-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
body.cockpit-page .record-detail-item {
  display: grid; grid-template-columns: 108px minmax(0, 1fr); align-items: start; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--hairline-soft); min-width: 0;
}
body.cockpit-page .record-detail-item > span { color: var(--stone); font-size: 13px; }
body.cockpit-page .record-detail-item > strong,
body.cockpit-page .record-detail-item > time,
body.cockpit-page .record-detail-item > code { color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
body.cockpit-page .record-detail-sensitive { grid-column: 1 / -1; }
body.cockpit-page .record-sensitive-value { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
body.cockpit-page .record-sensitive-value code {
  flex: 1; min-width: 0; max-height: 128px; overflow: auto; overflow-wrap: anywhere;
  padding: 9px 11px; border-radius: 10px; background: var(--cloud); color: var(--ink); font-size: 12px;
}
body.cockpit-page .record-sensitive-value button { min-height: 34px; padding: 6px 12px; flex: 0 0 auto; }
body.cockpit-page .record-flow-section { min-width: 0; }
body.cockpit-page .record-detail-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
body.cockpit-page .record-detail-section-head h3 { margin: 0; font-size: 16px; color: var(--ink-deep); }
body.cockpit-page .record-flow {
  display: flex; width: 100%; min-width: 0; margin: 18px 0 0; padding: 0 0 10px;
  overflow-x: auto; list-style: none;
}
body.cockpit-page .record-flow-step { position: relative; z-index: 0; flex: 1 0 108px; display: grid; justify-items: center; gap: 7px; text-align: center; }
body.cockpit-page .record-flow-step:not(:last-child)::after {
  content: ""; position: absolute; z-index: -1; top: 17px; left: calc(50% + 18px);
  width: calc(100% - 36px); height: 2px; background: var(--hairline-soft);
}
body.cockpit-page .record-flow-step.is-completed:not(:last-child)::after { background: var(--ok); }
body.cockpit-page .record-flow-node {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--hairline); background: var(--canvas); color: var(--stone); font-size: 12px; font-weight: 800;
}
body.cockpit-page .record-flow-step strong { font-size: 13px; color: var(--charcoal); }
body.cockpit-page .record-flow-step small { font-size: 11px; color: var(--stone); }
body.cockpit-page .record-flow-step.is-completed .record-flow-node { border-color: var(--ok); background: var(--ok); color: #fff; }
body.cockpit-page .record-flow-step.is-current .record-flow-node { border-color: var(--attention); background: var(--attention-soft); color: var(--warning); animation: record-flow-pulse 1.8s ease-in-out infinite; }
body.cockpit-page .record-flow-step.is-current strong { color: var(--warning); }
body.cockpit-page .record-flow-step.is-failed .record-flow-node { border-color: var(--critical); background: var(--critical); color: #fff; }
body.cockpit-page .record-flow-step.is-failed strong,
body.cockpit-page .record-flow-step.is-failed small { color: var(--critical); }
body.cockpit-page .record-flow-error { margin: 8px 0 0; padding: 12px 14px; border-radius: 12px; background: #fff0f3; color: var(--critical); font-size: 13px; line-height: 1.55; }
@keyframes record-flow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 169, 24, 0.22); }
  50% { box-shadow: 0 0 0 7px rgba(242, 169, 24, 0); }
}
body.cockpit-page #licenseCreatedKeys {
  width: 100%; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px; min-height: 96px; background: var(--cloud); border: 0; border-radius: 8px; padding: 12px;
}

/* ---- 空态 / 工具类 ---- */
body.cockpit-page .empty {
  background: var(--cloud); border-radius: 12px;
  color: var(--stone); padding: 22px; text-align: center; font-size: 14px;
}
body.cockpit-page .compact-empty { padding: 14px; }
body.cockpit-page .mono {
  font-family: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  font-size: 13px; letter-spacing: 0.2px;
}
body.cockpit-page .copy-btn {
  display: inline-flex; align-items: center; height: 22px;
  padding: 0 9px; margin-left: 6px; min-height: 22px;
  border: 1px solid var(--hairline); border-radius: 100px;
  background: var(--cloud); color: var(--steel);
  font-size: 11px; font-weight: 600; cursor: pointer; vertical-align: middle;
}
body.cockpit-page .copy-btn:hover { color: var(--cobalt); border-color: var(--cobalt); background: var(--cobalt-soft); }
body.cockpit-page .meter {
  display: inline-block; width: 110px; height: 10px;
  border-radius: 100px; background: var(--cloud); overflow: hidden;
}
body.cockpit-page .meter > i { display: block; height: 100%; border-radius: 100px; background: var(--cobalt); }
body.cockpit-page .meter.is-full > i { background: var(--attention); }
body.cockpit-page .toast {
  border-radius: 100px; background: var(--ink-deep); color: #fff;
  font-size: 14px; font-weight: 700; padding: 12px 22px;
}

/* ---- v2 截图验收修复 ---- */
/* 顶栏：标题靠左，刷新按钮不被原版 grid 拉宽 */
body.cockpit-page .topbar { justify-content: flex-start; }
body.cockpit-page .topbar-copy { margin-right: auto; }
body.cockpit-page .top-actions button { width: auto; }
/* 状态横条：强制单行（原版 fit-content + wrap 会竖排） */
body.cockpit-page .system-status-lines { width: auto; flex-direction: row; flex-wrap: nowrap; }
body.cockpit-page .status-line { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
/* 全局按钮规则不得把原本隐藏的元素显示出来 */
body.cockpit-page button[hidden] { display: none; }
body.cockpit-page .sidebar-toggle { display: none; }
@media (min-width: 721px) and (max-width: 1024px) {
  body.cockpit-page #workspace-records .success-table-head,
  body.cockpit-page #workspace-records .success-record {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.5fr) minmax(0, .6fr) minmax(0, .6fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }
  body.cockpit-page #workspace-records .success-record > * {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
@media (max-width: 720px) {
  body.cockpit-page .sidebar-toggle { display: inline-flex; }
  body.cockpit-page #workerStatus { display: none; }
  body.cockpit-page .system-status-lines { max-width: 46vw; }
  body.cockpit-page .record-detail-card { padding: 22px; }
  body.cockpit-page .record-detail-grid { grid-template-columns: 1fr; }
  body.cockpit-page .record-detail-sensitive { grid-column: auto; }
  body.cockpit-page .record-detail-section-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  body.cockpit-page .record-sensitive-value { flex-direction: column; }
  body.cockpit-page .record-sensitive-value button { align-self: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  body.cockpit-page .success-record { transition: none; }
  body.cockpit-page .record-flow-step.is-current .record-flow-node { animation: none; }
}

/* 开关按钮本体不能被全局按钮规则涂蓝 */
body.cockpit-page button.card-switch { background: var(--cloud); color: var(--ink); border: 0; }
body.cockpit-page button.card-switch:hover { background: var(--cloud); }
body.cockpit-page button.card-switch.is-on { background: #e6f4ea; }
body.cockpit-page button.card-switch.is-on .card-switch-text { color: var(--ink); }
/* 记录/数据库视图的历史行按钮保持文字行样式 */
body.cockpit-page button.history-row {
  background: transparent; color: inherit; border: 0;
  border-radius: 16px; padding: 11px 12px; min-height: 0;
  font-weight: 400; text-align: left; justify-content: flex-start;
}
body.cockpit-page button.history-row:hover { background: var(--cloud); }
body.cockpit-page button.history-row.is-selected { background: var(--cobalt-soft); box-shadow: inset 3px 0 0 var(--cobalt); }
