:root {
  color-scheme: light;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --blue: #2f6df6;
  --blue-soft: #d7e8ff;
  --green: #009a72;
  --red: #ff3f63;
  --amber: #f59e0b;
  --bg: #f6f8fb;
  --panel: #ffffff;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: #f8fafc;
}

.shell {
  width: min(1920px, calc(100vw - 32px));
  height: 100%;
  margin: 0 auto;
  padding: 10px 0;
}

.panel {
  overflow: hidden;
  min-height: 760px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(31, 49, 84, .13);
  border-radius: 26px;
}

.topbar {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
}

.topbar > div { min-width: 0; }

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

.hidden { display: none !important; }

.auth-screen {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 56px);
  position: relative;
  overflow: hidden;
}

.auth-screen::before,
.auth-screen::after {
  display: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(430px, calc(100vw - 32px));
  padding: 38px 32px 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 22px 36px rgba(15, 23, 42, .1), 0 8px 12px rgba(15, 23, 42, .06);
}

.auth-brand {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 4px;
  text-align: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 0;
  color: #000;
  background: transparent;
  box-shadow: none;
}

.brand-mark svg,
.platform-mark {
  fill: #eef2ff;
  stroke: #4063ff;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.brand-mark svg { width: 52px; height: 52px; }

.auth-subtitle {
  margin: 0 0 20px;
  color: #94a3b8;
  font-size: 15px;
  text-align: center;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f1f5f9;
}

.auth-tabs button {
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-weight: 800;
}

.auth-tabs button.active {
  color: #4f46e5;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

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

.login-form label {
  display: grid;
  gap: 7px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.field svg { width: 17px; height: 17px; color: #7790b2; flex: 0 0 auto; }

.field input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  font: inherit;
  color: var(--text);
  background: transparent;
}

.field-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: #64748b;
}

.remember { color: #64748b !important; }

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #4f46e5;
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 4px 14px rgba(79, 70, 229, .25);
}

.login-btn svg { width: 18px; height: 18px; }

.login-note {
  color: #8291a7;
  font-size: 12px;
  line-height: 1.6;
}

.text-link {
  display: inline;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4f46e5;
  font-weight: 850;
}

.admin-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(31, 49, 84, .12);
  overflow: hidden;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #ffffff;
  overflow: hidden;
}

.sidebar-logo, .sidebar-binding-stats, .sidebar-footer { flex-shrink: 0; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 22px;
  border-bottom: 1px solid var(--line);
}

.sidebar-logo .platform-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.sidebar-logo strong {
  display: block;
  font-size: 22px;
  line-height: 1.2;
}

.sidebar-logo span {
  display: none;
}

.admin-nav {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 8px;
  padding: 20px 14px;
  overflow-y: auto;
}

.advanced-nav { min-width: 0; }

.advanced-toggle .advanced-chevron {
  width: 17px;
  height: 17px;
  margin-left: auto;
  transition: transform .15s ease;
}

.advanced-toggle[aria-expanded="true"] .advanced-chevron { transform: rotate(180deg); }

.advanced-menu {
  display: grid;
  gap: 4px;
  margin: 4px 0 0 18px;
  padding: 5px 0 5px 8px;
  border-left: 1px solid var(--line);
}

.advanced-menu .feature-card { min-height: 42px; padding-left: 12px; font-size: 15px; }

.sidebar-binding-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 14px 14px;
}

.sidebar-stat {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: inherit;
  text-align: left;
  cursor: default;
}

.sidebar-stat small { color: #64748b; font-size: 12px; font-weight: 800; white-space: nowrap; }
.sidebar-stat b { font-size: 24px; line-height: 1; }
.sidebar-stat span { color: #64748b; font-size: 10px; line-height: 1.25; white-space: nowrap; }
.sidebar-stat-success b { color: #2f855a; }
.sidebar-stat-failed b { color: #d14343; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.card-wallet-button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font: inherit;
  cursor: pointer;
}
.card-wallet-button svg { width: 17px; height: 17px; }
.card-wallet-button b { margin-left: auto; color: #345de3; }
.card-wallet-button:hover { background: #eef3ff; }
.card-wallet-button[hidden] { display: none; }
.card-wallet-details { display: grid; gap: 12px; min-width: min(360px, 75vw); }
.card-wallet-details p { margin: 0; }
.card-wallet-details input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.card-wallet-details textarea { width: 100%; min-height: 120px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; resize: vertical; }
.card-wallet-ledger { max-height: 180px; overflow: auto; color: #64748b; font-size: 13px; }
.card-wallet-ledger p { padding: 4px 0; border-bottom: 1px solid var(--line); }
dialog[open].card-redemption-modal {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 32px));
  margin: auto;
  overflow: hidden;
  border: 1px solid #dce4f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(24, 38, 65, .22);
}
.card-redemption-modal::backdrop { background: rgba(24, 38, 65, .34); backdrop-filter: blur(2px); }
.card-redemption-modal .modal-head { padding: 18px 22px; }
.card-redemption-modal .modal-head h2 { color: #202b3d; font-size: 18px; }
.card-redemption-modal .modal-body { padding: 22px; }
.card-redemption-form { display: grid; }
.card-redemption-input {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #d7dfeb;
  border-radius: 9px;
  background: #fbfcfe;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.card-redemption-input:focus-within {
  border-color: #4d6ff0;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(77, 111, 240, .12);
}
.card-redemption-input svg { width: 19px; height: 19px; flex: 0 0 auto; color: #7183a3; }
.card-redemption-input input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #202b3d;
  font: inherit;
  box-shadow: none;
}
.card-redemption-modal .modal-actions { padding: 0 22px 20px; }
.card-redemption-modal .modal-actions button { min-width: 88px; height: 38px; }
.card-redemption-modal .modal-actions .confirm { background: #4365e8; border-color: #4365e8; }
@media (max-width: 480px) {
  .card-redemption-modal .modal-head { padding: 16px 18px; }
  .card-redemption-modal .modal-body { padding: 18px; }
  .card-redemption-modal .modal-actions { padding: 0 18px 18px; }
}
dialog[open].card-admin-modal {
  width: min(760px, calc(100vw - 28px));
  max-height: min(88vh, 860px);
  overflow: hidden;
}
.card-admin-modal .modal-body { max-height: calc(88vh - 130px); overflow: auto; }
.card-admin-modal .card-wallet-details { min-width: 0; }
.card-admin-section { display: grid; gap: 12px; }
.card-admin-section h3, .card-batch-list h4 { margin: 0; color: #253047; font-size: 15px; }
.card-inventory-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.card-inventory-summary span, .card-inventory-breakdown span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  font-size: 13px;
}
.card-inventory-summary b { color: #345de3; }
.card-inventory-breakdown { display: flex; flex-wrap: wrap; gap: 6px; color: #64748b; }
.card-issue-controls { display: grid; grid-template-columns: minmax(110px, .7fr) minmax(100px, .7fr) auto; align-items: end; gap: 10px; }
.card-issue-controls label, .card-import-controls > label { display: grid; gap: 5px; color: #475569; font-size: 13px; font-weight: 750; }
.card-issue-controls select, .card-issue-controls input, .card-import-controls input {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font: inherit;
}
.card-issue-controls button, .card-import-controls button {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 800;
  cursor: pointer;
}
.card-issue-controls button.confirm { border-color: var(--blue); background: var(--blue); color: #fff; }
.card-issue-controls button:disabled, .card-import-controls button:disabled { opacity: .55; cursor: wait; }
.card-issue-custom[hidden], .card-issue-amount-hint[hidden] { display: none; }
.card-issue-controls .card-issue-custom { width: 100%; }
.card-issue-amount-hint { color: #718096; font-size: 11px; font-weight: 400; line-height: 1.4; }
.card-issue-result { display: grid; gap: 8px; padding: 12px; border: 1px solid #bcd0f6; border-radius: 8px; background: #f6f9ff; }
.card-issue-result[hidden] { display: none; }
.card-issue-result p { color: #52627a; font-size: 13px; }
.card-issue-result label { font-size: 13px; font-weight: 750; }
.card-issue-result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card-import-controls { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.card-import-controls p { color: #718096; font-size: 12px; }
.card-batch-list { display: grid; gap: 4px; max-height: 170px; overflow: auto; }
.card-batch-list p { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.card-batch-list small { color: #8995a8; white-space: nowrap; }

@media (max-width: 560px) {
  .card-issue-controls { grid-template-columns: 1fr 1fr; }
  .card-issue-controls button { grid-column: 1 / -1; }
  .card-batch-list p { flex-direction: column; gap: 2px; }
}

.session-card[hidden] { display: none; }

.session-card {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
}

.session-card span {
  color: #111827;
}

.session-card small {
  color: #64748b;
  font: inherit;
  font-size: 12px;
}

.sidebar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 16px;
  font-weight: 850;
}

.sidebar-logout:hover {
  border-color: #fecdd3;
  background: #fff8fa;
  color: var(--red);
}

.admin-main {
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #f8fafc;
}

.admin-panel {
  height: calc(100% - 32px);
  margin: 16px;
  min-height: 0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}

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

#taskPanel {
  display: flex;
  flex-direction: column;
  height: calc(100% - 32px);
  min-height: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 16px;
  padding: 0;
}

.dashboard-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border: 1px solid var(--line);
}

.summary-grid.compact {
  flex: 0 0 auto;
  padding-top: 22px;
}

.info-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.advanced-page {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 12px;
  overflow: auto;
  background: #f8fafc;
}

.advanced-top {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 12px;
  flex: 0 0 auto;
}

.advanced-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
}

.advanced-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.advanced-btn:hover { border-color: #9db6fb; color: #315fe7; background: #f4f7ff; }
.advanced-btn.primary { border-color: #4169f5; background: #4169f5; color: #fff; }
.advanced-btn.danger { border-color: #ffd0d9; background: #fff8fa; color: var(--red); }
.advanced-btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.advanced-config {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 9px 14px;
  min-height: 94px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.advanced-config p { flex: 1 1 100%; margin: 0; }
.advanced-config b { color: #4169f5; }
.advanced-config label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  color: #475569;
  font-weight: 800;
}

.advanced-config input,
.advanced-config select {
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 12px;
}

.advanced-config input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: #4169f5;
}

.change-config { gap: 8px 12px; }
.family-config { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; }
.family-config > label,
.family-config p { grid-column: 1 / -1; }

.icloud-config {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 0;
  padding: 0;
}

.icloud-plan {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 116px;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

.icloud-plan label { justify-content: space-between; }
.icloud-plan .advanced-check { justify-content: flex-start; }
.icloud-plan select { width: 180px; }
.icloud-info { padding: 12px 16px; }
.icloud-info p { margin: 0 0 5px; }
.icloud-info p:last-child { margin-bottom: 0; }
.icloud-info .icloud-tip b { color: #d97706; }

.country-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 48px;
  padding: 8px 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.country-toolbar label { display: inline-flex; align-items: center; gap: 6px; }
.country-toolbar > * { flex-shrink: 0; }
.country-toolbar select,
.country-tool {
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 12px;
}
.country-tool { display: inline-flex; align-items: center; gap: 5px; color: #4169f5; }
.country-tool svg { width: 14px; height: 14px; flex-shrink: 0; }
.country-toolbar input { width: 16px; height: 16px; accent-color: #4169f5; }
.country-note { color: #94a3b8; font-weight: 650; }
.country-top { margin-top: 10px; }
.country-configs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 10px; min-width: 0; }
.country-info { min-height: 116px; }
.country-info .country-tip b { color: #d97706; }
.country-tax { display: grid; grid-template-columns: 1fr; min-height: 116px; }
.country-tax > input,
.country-tax > div { width: 100%; }
.country-tax > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.country-tax input:disabled { background: #f1f5f9; color: #94a3b8; }

.advanced-table {
  position: relative;
  flex: 1 0 160px;
  min-height: 160px;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.advanced-table table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 11px;
}

.advanced-table th,
.advanced-table td { width: auto !important; }

.advanced-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 28px;
  padding: 0 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}

.advanced-table td {
  height: 26px;
  padding: 0 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid #edf2f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.advanced-table th:last-child,
.advanced-table td:last-child { border-right: 0; }
.advanced-table th:nth-child(1), .advanced-table td:nth-child(1) { width: 58px !important; text-align: center; }
.advanced-table th:nth-child(2), .advanced-table td:nth-child(2) { width: 220px !important; }
.advanced-table th:nth-child(3), .advanced-table td:nth-child(3) { width: 170px !important; }
.advanced-table th:last-child, .advanced-table td:last-child { width: 280px !important; }
.advanced-table.wide-table table { min-width: 1200px; }

.advanced-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 16px;
  font-weight: 700;
  pointer-events: none;
}

.feature-placeholder {
  display: grid;
  place-content: center;
  flex: 1;
  gap: 10px;
  min-height: 0;
  color: #64748b;
  text-align: center;
}

.feature-placeholder svg { width: 34px; height: 34px; margin: 0 auto; color: #4169f5; }
.feature-placeholder strong { color: #1e293b; font-size: 20px; }
.feature-placeholder span { font-size: 14px; }

.feature-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  text-align: left;
  font-size: 17px;
  font-weight: 800;
}

.feature-card:hover,
.feature-card.active {
  color: #4f46e5;
  background: #eef2ff;
  box-shadow: none;
}

.feature-card svg { width: 22px; height: 22px; color: currentColor; }
.feature-card strong { font-size: 16px; }
.feature-card span { color: currentColor; line-height: 1.55; }

.feature-card[data-view="backupManual"] { min-height: 66px; padding-top: 8px; padding-bottom: 8px; }
.feature-card[data-view="backupManual"],
#backupManualPanel .topbar h1 { color: #c62828; }
.feature-card[data-view="backupManual"]:hover,
.feature-card[data-view="backupManual"].active { background: #fff1f2; }
.backup-manual-label { display: grid; min-width: 0; gap: 2px; }
.backup-manual-warning { display: block; margin: 0; color: #c62828; font-size: 12px; font-weight: 700; line-height: 1.5; }
.backup-manual-mobile-warning { display: none; }

.mini-action {
  justify-self: start;
  width: fit-content;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #4f46e5;
  background: #eef2ff;
  font-weight: 800;
}

.mini-action.primary-mini {
  background: #4169f5;
  color: #ffffff;
}

.mini-action.success-mini {
  border-color: #55ad78;
  background: #55ad78;
  color: #ffffff;
}

.tool-btn.danger-soft {
  color: var(--red);
  border-color: #ffd0d9;
  background: #fff8fa;
}

.recent-box {
  flex: 1;
  min-height: 0;
  margin: 0 42px 32px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.section-head,
.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: calc(100% - 34px);
  margin-top: 12px;
  overflow-y: auto;
}

.compact-list div {
  display: grid;
  grid-template-columns: 120px 1fr 160px;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #64748b;
  background: #f8fafc;
  font-size: 15px;
}

.task-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 42px 18px;
}

.field.slim {
  width: 340px;
  min-height: 48px;
}

.task-filters select {
  height: 48px;
  min-width: 140px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-weight: 700;
  padding: 0 10px;
}

.progress-box {
  margin: 0 42px 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.progress-top {
  color: #64748b;
  font-size: 16px;
  font-weight: 800;
}

.progress-top strong { color: #4f46e5; }

.progress-track {
  overflow: hidden;
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #e2e8f0;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f46e5, #10b981);
  transition: width .22s ease;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 104px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #bfd4ff;
  border-radius: 999px;
  color: #1f55c8;
  background: #f4f8ff;
  font-size: 13px;
  font-weight: 700;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(47, 109, 246, .12);
}

.workspace {
  display: block;
  flex: 0 0 auto;
  padding: 0 0 10px;
}

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

button {
  font: inherit;
  cursor: pointer;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.25;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.tool-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.tool-btn:hover { transform: translateY(-1px); border-color: #b9c7dd; box-shadow: 0 8px 20px rgba(15, 23, 42, .08); }
.tool-btn.primary { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 8px 20px rgba(47, 109, 246, .26); }
.tool-btn.danger { color: var(--red); border-color: #ffd0d9; background: #fff8fa; }
.tool-btn.muted { color: #f19aab; border-color: #ffdbe2; background: #fffafa; }
.tool-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.thread-quick-control {
  display: inline-grid;
  grid-template-columns: auto 28px 42px 28px;
  align-items: center;
  gap: 4px;
  height: 42px;
  padding: 0 6px 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
}

.thread-quick-label {
  padding-right: 3px;
  font-size: 14px;
  font-weight: 800;
}

.thread-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #dbe3ef;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
}

.thread-step:hover {
  border-color: #9eb8f8;
  background: #f2f6ff;
  color: var(--blue);
}

.thread-step svg { width: 15px; height: 15px; }

.thread-quick-input {
  width: 42px;
  height: 28px;
  padding: 0 2px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  appearance: textfield;
}

.thread-quick-input::-webkit-inner-spin-button,
.thread-quick-input::-webkit-outer-spin-button { margin: 0; appearance: none; }

.thread-step:disabled,
.thread-quick-input:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.notice {
  position: relative;
  min-height: 176px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
  font-size: 15px;
  line-height: 1.5;
}

.notice strong { color: #2457d6; }
.notice .warn { color: var(--amber); }

.settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;
  margin: 0 126px 10px 0;
  color: #53637a;
}

.settings select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font: inherit;
  padding: 0 10px;
}

.segmented {
  display: inline-flex;
  overflow: hidden;
  height: 32px;
  border: 1px solid #9db8ff;
  border-radius: 8px;
}

.segmented button {
  min-width: 76px;
  border: 0;
  background: #fff;
  color: #334155;
  font-weight: 800;
}

.segmented button.active {
  color: #fff;
  background: #2f6df6;
}

.open-api-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-weight: 850;
}

input[type="number"] {
  width: 74px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 18px 42px 24px;
}

.summary-grid div {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 34px;
}

.detail-grid,
.audit-list {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 24px 32px 32px;
}

.detail-grid div,
.audit-list div {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.detail-grid svg { width: 28px; height: 28px; color: var(--green); }
.detail-grid strong,
.audit-list strong { font-size: 16px; }
.detail-grid span,
.audit-list span { color: var(--muted); line-height: 1.6; }

.table-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

th, td {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  height: 42px;
  background: #f8fafc;
  color: #475569;
  font-size: 15px;
}

td { font-size: 14px; }

th:nth-child(1), td:nth-child(1) { width: 4.5%; text-align: center; color: #8aa0bd; }
th:nth-child(2), td:nth-child(2) { width: 19%; }
th:nth-child(3), td:nth-child(3) { width: 13%; }
th:nth-child(4), td:nth-child(4) { width: 20%; }
th:nth-child(5), td:nth-child(5) { width: 20%; }
th:nth-child(6), td:nth-child(6) { width: 23.5%; border-right: 0; }

tbody tr:nth-child(odd),
tbody tr:nth-child(even),
tbody tr.active { background: #fff; }

#taskPanel tbody tr.selected-row td,
#accountPanel tbody tr.selected-row td,
#activationPanel tbody tr.selected-row td {
  background: #cde4ff !important;
  box-shadow: inset 0 1px #a7ccf8, inset 0 -1px #a7ccf8;
}
#taskPanel tbody, #accountPanel tbody { user-select: none; }
.row-context-menu {
  position: fixed;
  z-index: 10000;
  padding: 4px;
  min-width: 170px;
  max-width: calc(100vw - 16px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 24px #172b4d26;
}
.row-context-menu button {
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #c53045;
  text-align: left;
  cursor: pointer;
}
.row-context-menu button:hover, .row-context-menu button:focus-visible { background: #fff0f2; }
.row-context-menu button:disabled { opacity: .5; cursor: not-allowed; }
.row-context-menu .copy-selected-rows,
.row-context-menu .rerun-selected-rows { color: #2463eb; }
.row-context-menu .copy-selected-rows:hover,
.row-context-menu .copy-selected-rows:focus-visible,
.row-context-menu .rerun-selected-rows:hover,
.row-context-menu .rerun-selected-rows:focus-visible { background: #edf4ff; }
.selected-copy-result {
  width: 100%;
  min-height: 180px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
}

.table-wrap tbody tr.active-row td {
  background: #edf4ff;
}

.table-wrap th.active-column,
.table-wrap td.active-column {
  background: #dce9ff;
  color: #1d4ed8;
}

.table-wrap tbody tr.active-row td.active-column {
  background: #c8dcff;
}

.result {
  color: var(--green);
  font-weight: 850;
}

.pending { color: #7990ad; font-weight: 750; }
.running { color: #1f55c8; font-weight: 850; }
.failed { color: var(--red); font-weight: 850; }

.status-reason-trigger {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: help;
}

.status-reason-trigger:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 3px;
}

.status-reason-tooltip {
  position: fixed;
  z-index: 3000;
  width: max-content;
  max-width: min(360px, calc(100vw - 24px));
  padding: 9px 12px;
  border-radius: 6px;
  background: #1f2937;
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.24);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  pointer-events: none;
}

.failure-reason-text {
  margin: 0;
  color: #b42318;
  font-weight: 750;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.empty-state {
  position: absolute;
  left: 0;
  right: 0;
  top: 148px;
  color: #94a3b8;
  font-size: 19px;
  font-weight: 700;
  text-align: center;
}

.table-footer {
  position: static;
  flex: 0 0 auto;
  flex-wrap: wrap;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 42px;
  padding: 0 20px;
  border-top: 1px solid var(--line);
  color: #64748b;
  background: #fbfdff;
  font-size: 14px;
  font-weight: 750;
}

.table-footer .legend:first-of-type {
  margin-left: auto;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd5e1;
}

.running-dot i { background: #6597ff; }
.success-dot i { background: #74c993; }
.warning-dot i { background: #dfb249; }
.error-dot i { background: #df6978; }

.task-bottom-stats {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px 22px;
  min-height: 46px;
  margin-top: 8px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
}

.task-bottom-stats strong {
  color: #1e293b;
  font-size: 16px;
}

.task-bottom-stats span:nth-child(2) strong { color: #2f8f5b; }
.task-bottom-stats span:nth-child(3) strong { color: #d13f54; }
.task-bottom-stats span:nth-child(4) strong { color: #2f6df6; }
.task-bottom-stats span:nth-child(5) strong { color: #64748b; }
.task-bottom-stats .elapsed { margin-left: auto; }

#taskPanel .table-footer[hidden],
#taskPanel .task-bottom-stats[hidden] { display: none; }

.settings-layout {
  display: grid;
  flex: 1;
  min-height: 0;
  align-content: start;
  grid-template-columns: minmax(0, 1fr);
  padding: 24px;
  overflow: hidden;
}

.settings-layout.runtime-only {
  grid-template-columns: minmax(0, 920px);
  justify-content: center;
}

.settings-content {
  min-width: 0;
  width: 100%;
}

.settings-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.settings-action-row strong {
  display: block;
  color: #475569;
  font-size: 18px;
}

.settings-action-row span {
  display: block;
  margin-top: 3px;
  color: #94a3b8;
  font-size: 13px;
}

.setting-section {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.runtime-config-card {
  min-height: 278px;
  padding: 24px;
}

.section-title-row {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-title-row > span {
  color: #1e293b;
  font-size: 20px;
  font-weight: 900;
  flex-shrink: 0;
}

.section-title-row small {
  color: #94a3b8;
  font-size: 13px;
}

.setting-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.setting-grid.one {
  grid-template-columns: minmax(0, 1fr);
}

.setting-grid label {
  display: grid;
  min-width: 0;
  gap: 8px;
  color: #475569;
  font-size: 14px;
  font-weight: 800;
}

.setting-grid .check {
  display: flex;
  align-items: center;
  min-height: 42px;
}

.setting-grid input,
.setting-grid select,
.setting-grid textarea,
.key-row input {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #1e293b;
  font: inherit;
  padding: 0 12px;
}

.setting-grid textarea {
  min-height: 92px;
  padding: 12px;
  resize: vertical;
}

.muted-copy {
  margin-top: 12px;
  color: #94a3b8;
  font-size: 13px;
}

.manual-layout {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  grid-auto-rows: minmax(min-content, 1fr);
  gap: 18px;
  padding: 24px 32px 32px;
  overflow-y: auto;
}

.manual-layout > .setting-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.manual-result {
  flex: 1 0 180px;
  min-width: 0;
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.7;
  overflow-y: auto;
  overflow-wrap: anywhere;
}

.manual-result p {
  margin: 0 0 8px;
}

.manual-result .ok {
  color: #059669;
}

.manual-result .bad {
  color: #dc2626;
}

.manual-result .result {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #cbd7ff;
  border-radius: 8px;
  background: #f4f7ff;
  color: #315fe7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.manual-result-placeholder { color: #64748b; }
.manual-result-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.manual-result-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.25;
}
.manual-result-actions button span { font: inherit; color: inherit; }
.manual-result-actions button:hover:not(:disabled) { border-color: #9db6fb; color: #315fe7; background: #f4f7ff; }
.manual-result-actions button:disabled { cursor: not-allowed; opacity: .45; }
.manual-result-actions button svg { width: 14px; height: 14px; flex-shrink: 0; }

.bound-page {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 12px 28px 18px;
  background: #f8fafc;
  overflow: hidden;
}

.bound-filter-card,
.bound-data-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.bound-filter-card {
  flex: 0 0 auto;
  padding: 9px 10px;
}

.bound-searchbar,
.bound-actions,
.bound-status-tabs {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.bound-searchbar label,
.bound-searchbar select {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.bound-searchbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 210px;
  min-width: 0;
  padding: 0 9px;
  color: #94a3b8;
}

.bound-searchbar input,
.bound-searchbar select {
  border: 0;
  outline: 0;
  color: #1f2937;
  font-size: 12px;
  font-weight: 700;
}

.bound-searchbar input {
  width: 100%;
  min-width: 0;
}

.bound-searchbar select {
  width: 170px;
  padding: 0 12px;
  border: 1px solid var(--line);
}

.date-separator {
  color: #475569;
  font-weight: 900;
}

.bound-status-tabs {
  margin-top: 7px;
}

.bound-status-tabs button {
  height: 24px;
  padding: 0 12px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: #64748b;
  font-weight: 900;
}

.bound-status-tabs button.active {
  border-color: #4169f5;
  background: #4169f5;
  color: #ffffff;
}

.bound-refresh-result {
  min-height: 0;
  margin-top: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.bound-refresh-result:not(:empty) {
  margin-top: 10px;
}

.bound-refresh-result p {
  margin: 0;
  line-height: 1.55;
}

.bound-refresh-result .ok { color: #15803d; }
.bound-refresh-result .bad { color: #dc2626; }

.bound-data-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  margin-top: 10px;
  padding: 8px 10px;
  overflow: hidden;
}

.bound-actions {
  justify-content: space-between;
  margin-bottom: 6px;
}

.bound-actions .header-buttons {
  flex: 1 1 600px;
  min-width: 0;
}

.bound-actions .header-buttons .tool-btn {
  flex: 0 0 auto;
}

.bound-retry-hint {
  flex: 1 1 200px;
  min-width: 0;
  margin: 0;
  color: #ff0000;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.bound-counts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.bound-counts strong {
  color: #111827;
  font-size: 12px;
}

.bound-actions .tool-btn {
  height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 12px;
}

.bound-actions .tool-btn i {
  width: 14px;
  height: 14px;
}

.bound-filter-card .mini-action {
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
}

.bound-table {
  --bound-time-width: 172px;
  --bound-status-width: 80px;
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-gutter: stable;
  background: #ffffff;
}

.bound-table table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 60%;
}

.bound-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 26px;
  padding: 0 8px;
  background: #eef2f7;
  color: #334155;
  white-space: nowrap;
  text-align: left;
}

.bound-table td {
  height: 26px;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bound-table .col-time { width: 14%; }
.bound-table .col-status { width: 6%; }
.bound-table .col-index { width: 4%; }
.bound-table .col-account { width: 19%; }
.bound-table .col-password { width: 12%; }
.bound-table .col-api { width: 20%; }
.bound-table .col-phone { width: 10%; }
.bound-table .col-sms { width: 15%; }

.bound-table th.col-time,
.bound-table th.col-status,
.bound-table th.col-index,
.bound-table td.col-time,
.bound-table td.col-status,
.bound-table td.col-index {
  position: sticky;
}

.bound-table th.col-time,
.bound-table td.col-time {
  left: 0;
}

.bound-table th.col-status,
.bound-table td.col-status {
  left: var(--bound-time-width);
}

.bound-table th.col-index,
.bound-table td.col-index {
  left: calc(var(--bound-time-width) + var(--bound-status-width));
  box-shadow: 1px 0 0 #dde5f0;
}

.bound-table th.col-time,
.bound-table th.col-status,
.bound-table th.col-index {
  z-index: 6;
  background: #eef2f7;
}

.bound-table td.col-time,
.bound-table td.col-status,
.bound-table td.col-index {
  z-index: 4;
}

.bound-table tbody tr:nth-child(odd) td {
  background: #fff;
}

.bound-table tbody tr:nth-child(even) td {
  background: #fff;
}

.bound-table tbody tr.active-row td {
  background: #edf4ff;
}

.bound-table th.active-column,
.bound-table td.active-column {
  background: #dce9ff !important;
  color: #1d4ed8;
}

.bound-table tbody tr.active-row td.active-column {
  background: #c8dcff !important;
}

.bound-table td.col-status {
  text-align: center;
  font-weight: 900;
}

.bound-table th.col-status,
.bound-table th.col-index,
.bound-table th.col-time,
.bound-table td.col-time,
.bound-table td.col-index {
  text-align: center;
}

.bound-table td.col-time {
  overflow: visible;
  text-overflow: clip;
}

.bound-table td.col-status span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 9px;
}

.table-wrap th {
  position: relative;
}

.bound-table th { position: sticky; }

.table-wrap th,
.table-wrap td,
.bound-table th,
.bound-table td {
  min-width: 50px;
}

.column-resizer {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 20;
  width: 8px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.column-resizer::after {
  position: absolute;
  top: 20%;
  right: 3px;
  width: 2px;
  height: 60%;
  border-radius: 99px;
  background: transparent;
  content: "";
  transition: background .15s ease;
}

th:hover .column-resizer::after,
.column-resizer:focus-visible::after,
.column-resizer.resizing::after {
  background: #4169f5;
}

.bound-table::-webkit-scrollbar {
  width: 10px;
  height: 12px;
}

.bound-table::-webkit-scrollbar-track {
  background: #edf2f7;
  border-radius: 999px;
}

.bound-table::-webkit-scrollbar-thumb {
  background: #a8b4c7;
  border: 3px solid #edf2f7;
  border-radius: 999px;
}

.bound-table::-webkit-scrollbar-thumb:hover {
  background: #8796ad;
}

.bound-table td.col-status.result span {
  background: #dcfce7;
  color: #15803d;
}

.bound-table td.col-status.failed span {
  background: #fee2e2;
  color: #dc2626;
}

.bound-table td.col-status.pending span {
  background: #e0e7ff;
  color: #4f46e5;
}

.bound-table td.col-status.running span {
  background: #dbeafe;
  color: #2563eb;
}

.api-health-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  align-items: stretch;
  gap: 12px;
}

.api-health-row > div {
  display: grid;
  gap: 6px;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.api-health-row span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.api-health-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #1e293b;
  font-size: 15px;
}

.api-health-row .mini-action {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.api-health-row svg {
  width: 16px;
  height: 16px;
}

#taskPanel .table-wrap td.result,
#taskPanel .table-wrap td.running,
#taskPanel .table-wrap td.failed,
#taskPanel .table-wrap td.pending {
  display: table-cell;
}

#taskPanel .table-wrap th:nth-child(1),
#taskPanel .table-wrap td:nth-child(1) { width: 4.5%; }
#taskPanel .table-wrap th:nth-child(2),
#taskPanel .table-wrap td:nth-child(2) { width: 16%; }
#taskPanel .table-wrap th:nth-child(3),
#taskPanel .table-wrap td:nth-child(3) { width: 10%; }
#taskPanel .table-wrap th:nth-child(4),
#taskPanel .table-wrap td:nth-child(4) { width: 17%; }
#taskPanel .table-wrap th:nth-child(5),
#taskPanel .table-wrap td:nth-child(5) { width: 9%; }
#taskPanel .table-wrap th:nth-child(6),
#taskPanel .table-wrap td:nth-child(6) { width: 13%; border-right: 1px solid var(--line); }
#taskPanel .table-wrap th:nth-child(7),
#taskPanel .table-wrap td:nth-child(7) { width: 10%; border-right: 1px solid var(--line); }
#taskPanel .table-wrap th:nth-child(8),
#taskPanel .table-wrap td:nth-child(8) { width: 20.5%; border-right: 0; }

#taskPanel .table-wrap th {
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

#taskPanel .table-wrap td {
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.copy-result {
  overflow-wrap: anywhere;
  user-select: all;
}

.copy-link-btn {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font: inherit;
  font-weight: 800;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.copy-link-btn:hover {
  text-decoration: underline;
}

.copy-link-btn.copy-cell-value {
  color: inherit;
  font-weight: inherit;
}

@media (max-width: 1180px) {
  .advanced-top { grid-template-columns: minmax(0, 1fr); }
  .advanced-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bound-table table {
    min-width: 0;
  }

  .bound-table {
    --bound-time-width: 158px;
    --bound-status-width: 74px;
  }

  .bound-table th,
  .bound-table td {
    padding-left: 10px;
    padding-right: 10px;
  }
}

.bound-pager {
  display: flex;
  flex-wrap: wrap;
  flex: 0 0 auto;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 8px 0 0;
  font-size: 12px;
  color: #64748b;
  font-weight: 800;
}

.bound-pager span {
  margin-right: auto;
  color: #94a3b8;
}

.bound-pager button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: #94a3b8;
  font-weight: 900;
}

.tool-btn.success-soft {
  border-color: #54b47a;
  background: #55ad78;
  color: #ffffff;
}

.tool-btn.warning-soft {
  border-color: #e4a137;
  background: #e19a27;
  color: #ffffff;
}

.header-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
}

.icon-btn svg { width: 16px; height: 16px; }

dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  border: 0;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .28);
}

dialog::backdrop { background: rgba(15, 23, 42, .36); }

dialog[open].execute-confirm-modal {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 32px));
  margin: auto;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .26);
}

.execute-confirm-modal::backdrop {
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
}

.execute-confirm-modal .modal-body {
  order: 1;
  display: grid;
  place-items: center;
  padding: 28px 24px 12px;
}

.execute-confirm-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #eef3ff;
  color: var(--blue);
}

.execute-confirm-icon svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  stroke-width: 2.4;
}

.execute-confirm-modal .modal-head {
  order: 2;
  justify-content: center;
  padding: 0 24px 22px;
  border-bottom: 0;
}

.execute-confirm-modal .modal-head h2 {
  font-size: 22px;
  line-height: 1.2;
}

.execute-confirm-modal .modal-head .icon-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 0;
  background: transparent;
  color: #94a3b8;
}

.execute-confirm-modal .modal-actions {
  order: 3;
  justify-content: center;
  padding: 18px 24px 22px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.execute-confirm-modal .modal-actions button {
  width: 112px;
  height: 42px;
}

dialog[open].advanced-permission-modal {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 32px));
  margin: auto;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.advanced-permission-modal::backdrop {
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
}

.advanced-permission-modal .modal-head {
  justify-content: center;
  padding: 20px 24px 4px;
  border-bottom: 0;
}

.advanced-permission-modal .modal-head h2 { font-size: 21px; }
.advanced-permission-modal .modal-head .icon-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: transparent;
  color: #94a3b8;
}

.advanced-permission-modal .modal-body { padding: 16px 24px 22px; }
.permission-notice { display: grid; justify-items: center; gap: 12px; text-align: center; }
.permission-notice-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff5e8;
  color: #d97706;
}
.permission-notice-icon svg { width: 25px; height: 25px; }
.permission-notice p { margin: 0; color: #475569; font-size: 15px; font-weight: 750; }
.advanced-permission-modal .modal-actions {
  justify-content: center;
  padding: 15px 24px 20px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}
.advanced-permission-modal .modal-actions button { width: 112px; height: 40px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 { font-size: 18px; }
.modal-head .icon-btn { flex-shrink: 0; }
.modal-body { padding: 18px 20px; color: #475569; line-height: 1.75; }
.modal-body textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 20px 20px;
}

.modal-actions button {
  min-width: 86px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 800;
  white-space: nowrap;
}

.modal-actions .confirm { color: #fff; background: var(--blue); border-color: var(--blue); }
.modal-actions .danger { color: #b42318; background: #fff5f5; border-color: #f0a5a0; }
.activation-history-btn { grid-column: 1 / -1; }
#activationPanel .activation-mode { display: inline-flex; align-items: center; padding: 4px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; }
#activationPanel .advanced-page { min-width: 0; overflow-x: hidden; overflow-y: auto; }
#activationPanel .advanced-table { width: 100%; min-width: 0; }
#activationPanel .advanced-table table { width: 100%; min-width: 850px; }
#activationPanel .advanced-table th:nth-child(1),
#activationPanel .advanced-table td:nth-child(1) { width: 52px !important; }
#activationPanel .advanced-table th:nth-child(2),
#activationPanel .advanced-table td:nth-child(2) { width: 24% !important; }
#activationPanel .advanced-table th:nth-child(3),
#activationPanel .advanced-table td:nth-child(3) { width: 14% !important; }
#activationPanel .advanced-table th:nth-child(4),
#activationPanel .advanced-table td:nth-child(4) { width: auto !important; }
#activationPanel .advanced-table th:nth-child(5),
#activationPanel .advanced-table td:nth-child(5) { width: 26% !important; }
#activationPanel .advanced-table th:nth-child(6),
#activationPanel .advanced-table td:nth-child(6) { width: 176px !important; }
#activationPanel .advanced-empty { position: sticky; inset: auto; top: 26px; left: 0; display: flex; align-items: center; justify-content: center; width: 100%; height: calc(100% - 26px); min-height: 100px; padding: 20px; font-size: 14px; line-height: 1.6; text-align: center; white-space: normal; overflow-wrap: anywhere; }
#activationPanel .advanced-table th,
#activationPanel .advanced-table td { height: 26px; padding: 0 8px; line-height: 20px; vertical-align: middle; }
.activation-code-row { display: flex; align-items: center; gap: 6px; }
.activation-code-row input { width: 92px; min-width: 0; height: 22px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.activation-code-row input[aria-invalid="true"] { border-color: #dc2626; }
.activation-code-row .tool-btn { flex: 0 0 auto; height: 22px; padding: 0 6px; font-size: 12px; }
.activation-api-cell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
#activationPanel .activation-result { white-space: nowrap; font-weight: 700; }
#activationPanel .activation-result-summary { display: flex; align-items: center; gap: 3px; min-width: 0; }
#activationPanel .activation-result-summary strong { flex: 0 0 auto; }
#activationPanel .activation-failure-reason { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #dc2626; font-size: 11px; font-weight: 400; }
#activationPanel .activation-result-success { color: #16a34a; }
#activationPanel .activation-result-failure { color: #dc2626; }
.activation-sort-button { display: inline-flex; align-items: center; gap: 5px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; text-align: left; cursor: pointer; }
.activation-sort-button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }
.activation-sort-arrow { color: var(--blue); font-size: 12px; }
.activation-history-modal { width: min(1180px, calc(100vw - 24px)); }
.activation-history-table { max-height: 55vh; overflow: auto; }
.activation-history-table table { min-width: 1100px; }
.activation-history-table th, .activation-history-table td { padding: 8px; font-size: 12px; }
.activation-history-table th:nth-child(1), .activation-history-table td:nth-child(1) { width: 155px; text-align: left; color: inherit; }
.activation-history-table th:nth-child(2), .activation-history-table td:nth-child(2) { width: 220px; }
.activation-history-table th:nth-child(3), .activation-history-table td:nth-child(3) { width: 130px; }
.activation-history-table th:nth-child(4), .activation-history-table td:nth-child(4) { width: 220px; }
.activation-history-table th:nth-child(5), .activation-history-table td:nth-child(5) { width: 90px; }
.activation-history-table th:nth-child(6), .activation-history-table td:nth-child(6) { width: 220px; border-right: 1px solid var(--line); }
.activation-history-table th:nth-child(7), .activation-history-table td:nth-child(7) { width: 65px; border-right: 0; }
#activationPanel .activation-price { display: block; }
@media (max-width: 860px) {
  #activationPanel .advanced-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #activationPanel .advanced-btn { font-size: 12px; padding: 0 6px; }
  #activationPanel .advanced-btn span { display: inline; }
  #activationPanel .activation-config { max-height: none; }
}
.modal-actions button:has(svg), .modal-actions button:has(i) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; }
.modal-actions button svg { width: 16px; height: 16px; flex-shrink: 0; }
.system-delete-summary { margin: 0; }
.system-delete-summary dt { margin-top: 8px; color: #64748b; font-size: 13px; }
.system-delete-summary dd { margin: 0; overflow-wrap: anywhere; }
.system-delete-warning { color: #b42318; font-weight: 700; }

dialog.import-modal {
  width: min(940px, calc(100vw - 44px));
  border-radius: 24px;
}

.import-modal .modal-head {
  padding: 34px 42px 28px;
}

.import-modal .modal-head h2 {
  font-size: 26px;
}

.import-modal .modal-body {
  padding: 32px 76px 44px;
}

.import-modal .modal-actions {
  padding: 26px 64px 34px;
  border-top: 1px solid var(--line);
}

.import-modal .modal-actions button {
  min-width: 98px;
  height: 52px;
  border-radius: 16px;
  font-size: 20px;
}

.import-modal .modal-actions .confirm {
  min-width: 170px;
  background: #5cad7b;
  border-color: #5cad7b;
}

.import-form {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 22px 24px;
  align-items: center;
}

.import-form label {
  color: #475569;
  font-size: 20px;
  font-weight: 900;
  text-align: right;
}

.import-form label.required::before {
  content: "*";
  margin-right: 4px;
  color: #d34a3e;
}

.field-tags,
.import-form input,
.import-form textarea {
  width: 100%;
  border: 2px solid #dbe2ee;
  border-radius: 16px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 20px;
}

.field-stack {
  position: relative;
  min-width: 0;
}

.field-tags {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 116px;
  padding: 14px 18px;
}

.field-tags span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px;
  border: 1px solid #b9c6ff;
  border-radius: 999px;
  background: #eef2ff;
  color: #4457e8;
  font-weight: 900;
}

.field-tags button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #7d8df2;
  font: inherit;
  font-size: 22px;
  line-height: 1;
}

#importFieldInput {
  flex: 1 1 90px;
  min-width: 90px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 18px;
  outline: 0;
}

.field-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.field-suggestions button {
  height: 30px;
  padding: 0 12px;
  border: 1px solid #dbe2ee;
  border-radius: 999px;
  background: #ffffff;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.field-suggestions button:hover {
  border-color: #9db0ff;
  color: #4457e8;
}

.import-form input {
  height: 58px;
  padding: 0 24px;
}

.import-form textarea {
  min-height: 192px;
  padding: 22px 24px;
  resize: vertical;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 32px));
  overflow-wrap: anywhere;
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  background: #111827;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .24);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
  .shell { width: 100%; height: 100%; padding: 0; }
  .panel, .admin-layout { min-height: 0; border-radius: 0; }
  .admin-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 92px minmax(0, 1fr);
    height: 100%;
  }
  .admin-sidebar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    height: 92px;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
  }
  .sidebar-logo { padding: 0 13px; border-bottom: 0; }
  .sidebar-logo .platform-mark { width: 31px; height: 31px; }
  .sidebar-logo strong { display: none; }
  .admin-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 0; overflow: visible; }
  .advanced-nav { position: relative; }
  .advanced-toggle .advanced-chevron { display: none; }
  .advanced-menu {
    position: fixed;
    top: 94px;
    right: 8px;
    left: 8px;
    z-index: 200;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
  }
  .advanced-menu .feature-card { min-height: 40px; padding: 0; }
  .feature-card { justify-content: center; min-height: 48px; padding: 0; border-radius: 8px; }
  .feature-card span { display: none; }
  .feature-card[data-view="backupManual"] { min-height: 48px; padding: 0; }
  .topbar .backup-manual-mobile-warning { display: block; margin-top: 3px; }
  .feature-card svg { width: 20px; height: 20px; }
  .sidebar-footer { display: flex; align-items: center; margin: 0; padding: 0 12px; border-top: 0; }
  .card-wallet-button { width: auto; min-width: 70px; margin: 0 8px 0 0; padding: 6px; font-size: 12px; }
  .card-wallet-button span { display: none; }
  .card-wallet-button svg { width: 16px; height: 16px; }
  #cardGenerateBtn { min-width: 42px; width: 42px; justify-content: center; }
  .sidebar-binding-stats { display: none; }
  .session-card { display: none; }
  .sidebar-logout { width: 42px; height: 42px; padding: 0; }
  .sidebar-logout span { display: none; }
  .sidebar-logout svg { width: 20px; height: 20px; }
  .admin-main { height: 100%; min-height: 0; overflow: hidden; }
  .admin-panel, #taskPanel { height: calc(100% - 16px); min-height: 0; margin: 8px; }
  .advanced-page { padding: 8px; }
  .advanced-top { grid-template-columns: 1fr; gap: 8px; }
  .advanced-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .advanced-btn { min-height: 34px; padding: 0; font-size: 0; }
  .advanced-btn span { display: none; }
  .advanced-btn svg { width: 17px; height: 17px; }
  .advanced-config { max-height: 82px; min-height: 0; padding: 9px 10px; gap: 6px; overflow: auto; font-size: 12px; }
  .advanced-config p { display: none; }
  .icloud-config { display: grid; grid-template-columns: 1fr; max-height: 106px; padding: 0; overflow: auto; }
  .icloud-plan { min-height: 0; padding: 9px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .icloud-info { display: none; }
  .country-toolbar { gap: 7px; min-height: 42px; padding: 5px 7px; font-size: 12px; }
  .country-toolbar select, .country-tool { height: 30px; font-size: 11px; }
  .country-top { margin-top: 8px; }
  .country-configs { grid-template-columns: 1fr; gap: 6px; }
  .country-configs .country-tax { display: none; }
  .advanced-table { margin-top: 8px; }
  .advanced-empty { font-size: 13px; }
  .topbar { min-height: 50px; padding: 10px 12px; gap: 8px; }
  .topbar h1 { font-size: 20px; }
  .topbar p { display: none; }
  .topbar .header-buttons { width: auto; flex-wrap: nowrap; gap: 5px; }
  .topbar .header-buttons .tool-btn { height: 34px; padding: 0 8px; }
  .topbar .header-buttons .tool-btn span { display: none; }
  .topbar, .workspace, .summary-grid { padding-left: 12px; padding-right: 12px; }
  .workspace { padding-bottom: 8px; }
  .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tool-btn { height: 36px; padding: 0 8px; gap: 6px; font-size: 13px; }
  .tool-btn svg { width: 17px; height: 17px; }
  .toolbar .tool-btn, .thread-quick-control { width: 100%; }
  .thread-quick-control { height: 36px; justify-content: center; }
  #runBtn { grid-column: 1 / -1; }
  .task-filters { display: none; }
  .progress-box { display: none; }
  .table-wrap { border-radius: 8px; }
  .table-footer { min-height: 36px; padding: 0 12px; font-size: 12px; }
  .table-footer .legend { display: none; }
  .task-bottom-stats { min-height: 36px; gap: 4px 10px; margin-top: 6px; padding: 6px 10px; font-size: 12px; }
  .task-bottom-stats strong { font-size: 13px; }
  .task-bottom-stats .elapsed { margin-left: 0; }
  .summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding-top: 12px; padding-bottom: 12px; }
  .summary-grid div { padding: 10px 8px; }
  .summary-grid span { overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
  .summary-grid strong { font-size: 22px; }
  .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0 12px 12px; }
  .detail-grid div { align-items: center; gap: 6px; padding: 10px 6px; text-align: center; }
  .detail-grid svg { width: 20px; height: 20px; }
  .detail-grid strong { font-size: 13px; }
  .detail-grid span, .detail-grid .mini-action { display: none; }
  .recent-box { min-height: 0; margin: 0 12px 12px; padding: 12px; }
  .recent-box .mini-action { display: none; }
  .compact-list div { grid-template-columns: 1fr; padding: 8px; font-size: 12px; }
  .settings-layout { grid-template-columns: 1fr; padding: 8px; overflow-y: auto; }
  .settings-action-row { align-items: center; margin-bottom: 8px; padding: 12px; }
  .settings-action-row span { display: none; }
  .settings-action-row strong { font-size: 16px; }
  .settings-action-row .tool-btn { width: auto; height: 34px; }
  .runtime-config-card { min-height: 0; padding: 14px; }
  .runtime-config-card .section-title-row { margin-bottom: 10px; padding-bottom: 8px; }
  .runtime-config-card .section-title-row > span { font-size: 16px; }
  .runtime-config-card .section-title-row small { display: none; }
  .setting-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
  .setting-grid label { gap: 4px; font-size: 12px; }
  .setting-grid input { min-height: 32px; padding: 0 8px; font-size: 13px; }
  .setting-grid .check { grid-column: 1 / -1; min-height: 24px; font-size: 12px; }
  .manual-layout { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 8px; }
  .manual-layout > .setting-section { padding: 14px; }
  .manual-layout .section-title-row { gap: 8px; margin-bottom: 12px; padding-bottom: 10px; }
  .manual-layout .section-title-row > span { font-size: 16px; }
  .manual-layout .section-title-row small { font-size: 12px; }
  .manual-result { padding: 12px; font-size: 13px; }
  .bound-page { padding: 8px; overflow: hidden; }
  .bound-filter-card { padding: 10px; }
  .bound-searchbar { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; }
  .bound-searchbar label { width: auto; height: 34px; }
  .bound-searchbar label:nth-of-type(n+2), .bound-searchbar select, .date-separator { display: none; }
  .bound-searchbar .mini-action { height: 34px; padding: 0 10px; }
  .bound-status-tabs { gap: 6px; margin-top: 8px; }
  .bound-status-tabs button { height: 28px; padding: 0 10px; font-size: 12px; }
  .bound-data-card { min-height: 0; margin-top: 8px; padding: 8px; }
  .bound-actions { margin-bottom: 6px; }
  .bound-actions .header-buttons { display: flex; gap: 6px; }
  .bound-actions .tool-btn { height: 30px; padding: 0 8px; font-size: 12px; }
  .bound-actions .tool-btn span { display: none; }
  .bound-counts { gap: 4px 8px; font-size: 11px; }
  .bound-refresh-result:not(:empty) { max-height: 36px; margin-top: 6px; overflow: hidden; }
  .bound-table { min-height: 0; }
  .bound-pager { min-height: 32px; padding: 6px 0 0; font-size: 12px; }
  .bound-pager button { height: 30px; padding: 0 8px; }
}

@media (max-height: 820px) and (min-width: 861px) {
  .shell { padding: 10px 0; }
  .admin-layout, .admin-sidebar { min-height: 0; }
  #taskPanel { height: calc(100% - 32px); min-height: 0; margin: 16px; }
  .notice { min-height: 154px; font-size: 14px; line-height: 1.42; }
  .tool-btn { height: 38px; font-size: 15px; }
  .thread-quick-control { height: 38px; }
  .workspace { padding-bottom: 10px; }
  .empty-state { top: 122px; }
  .task-bottom-stats { min-height: 46px; margin-top: 10px; }
}

@media (max-width: 1260px) and (min-width: 861px) {
  .admin-layout { grid-template-columns: 224px minmax(0, 1fr); }
  .sidebar-logo { padding: 20px 16px; }
  .sidebar-logo strong { font-size: 19px; }
  .admin-nav { padding: 16px 10px; }
  .feature-card { min-height: 46px; padding: 0 12px; font-size: 15px; }
  .toolbar { gap: 7px; }
  .tool-btn { height: 40px; padding: 0 11px; font-size: 14px; }
  .thread-quick-control { height: 40px; }
  .task-bottom-stats { gap: 6px 14px; }
  .task-bottom-stats .elapsed { margin-left: 0; }
}

@media (max-width: 1100px) {
  #taskPanel th:nth-child(5),
  #taskPanel td:nth-child(5),
  #taskPanel th:nth-child(6),
  #taskPanel td:nth-child(6) { display: none; }
  #taskPanel .table-wrap th:nth-child(1),
  #taskPanel .table-wrap td:nth-child(1) { width: 7%; }
  #taskPanel .table-wrap th:nth-child(2),
  #taskPanel .table-wrap td:nth-child(2) { width: 20%; }
  #taskPanel .table-wrap th:nth-child(3),
  #taskPanel .table-wrap td:nth-child(3) { width: 12%; }
  #taskPanel .table-wrap th:nth-child(4),
  #taskPanel .table-wrap td:nth-child(4) { width: 20%; }
  #taskPanel .table-wrap th:nth-child(7),
  #taskPanel .table-wrap td:nth-child(7) { width: 15%; }
  #taskPanel .table-wrap th:nth-child(8),
  #taskPanel .table-wrap td:nth-child(8) { width: 26%; }
}

@media (max-width: 620px) {
  .bound-counts { display: none; }
  .task-bottom-stats span:nth-child(5) { display: none; }
  dialog[open].execute-confirm-modal { width: min(360px, calc(100vw - 24px)); }
  dialog.import-modal { width: calc(100vw - 24px); border-radius: 12px; }
  .import-modal .modal-head { padding: 16px; }
  .import-modal .modal-head h2 { font-size: 20px; }
  .import-modal .modal-body { padding: 16px; }
  .import-modal .modal-actions { padding: 14px 16px 16px; }
  .import-modal .modal-actions button { min-width: 86px; height: 38px; border-radius: 8px; font-size: 14px; }
  .import-form { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .import-form label { font-size: 14px; text-align: left; }
  .import-form input, .import-form textarea, .field-tags { min-width: 0; font-size: 14px; border-radius: 8px; }
  .import-form input { height: 40px; padding: 0 10px; }
  .import-form textarea { min-height: 140px; padding: 10px; }
  .field-tags { min-height: 88px; padding: 10px; gap: 8px; }
  .field-tags span { height: 32px; padding: 0 10px; gap: 6px; }
  #importFieldInput { height: 32px; font-size: 14px; }
}
.customer-management-modal { width: min(900px, calc(100vw - 32px)); }
.customer-create { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) 40px auto; gap: 12px; align-items: end; margin-bottom: 20px; }
.customer-create label { display: grid; gap: 6px; min-width: 0; }
.customer-create input { min-width: 0; width: 100%; height: 40px; border: 1px solid #dbe2ee; border-radius: 6px; padding: 8px; box-sizing: border-box; }
.customer-table { max-height: 400px; overflow: auto; }
.customer-table table { min-width: 580px; table-layout: auto; }
.customer-table th, .customer-table td { width: auto; white-space: nowrap; }
.customer-table td:first-child { min-width: 170px; max-width: 300px; overflow-wrap: anywhere; white-space: normal; }
.customer-table td:last-child { min-width: 190px; }
.customer-table .tool-btn { display: inline-flex; margin: 2px; }
@media (max-width: 600px) { .customer-create { grid-template-columns: minmax(0, 1fr) 40px; } .customer-create label { grid-column: 1 / -1; } .customer-create #createCustomerBtn { grid-column: 1; grid-row: 3; } }

.platform-login-notice { margin: 16px 0 20px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: #475569; background: #f8fafc; font-size: 12px; line-height: 1.65; text-align: left; }
.auth-screen .field-icon { min-width: 38px; padding: 0; white-space: nowrap; }

/* Local drafts remain usable while this instance's own providers are disabled. */
.provider-configuration-notice { flex: 0 0 auto; margin: 12px 16px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #f8fafc; color: #64748b; font-size: 12px; line-height: 1.6; }
.provider-configuration-notice[hidden] { display: none; }

/* Durable iCloud tools share the existing advanced workspace. */
.cloud-tool-config { min-width: 0; }
.cloud-tool-config p { overflow-wrap: anywhere; }
.cloud-tool-price { color: #59677d; }
.cloud-tool-price.unavailable { color: #a44c31; }
.cloud-tool-table { width: 100%; min-width: 0; }
.cloud-tool-table table { min-width: 1100px; table-layout: auto; }
#cloudStoragePanel .cloud-tool-table table { min-width: 1350px; }
#cloudRenewalPanel .cloud-tool-table table { min-width: 1500px; }
#contactPhonePanel .cloud-tool-table table { width: 100%; min-width: 1450px; table-layout: fixed; }
#contactPhonePanel .cloud-tool-table th:nth-child(4),
#contactPhonePanel .cloud-tool-table td:nth-child(4),
#contactPhonePanel .cloud-tool-table th:nth-child(6),
#contactPhonePanel .cloud-tool-table td:nth-child(6) {
  width: 220px !important;
  min-width: 0;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cloud-tool-table th, .cloud-tool-table td { white-space: nowrap; min-width: 100px; }
.cloud-tool-table th:first-child, .cloud-tool-table td:first-child { min-width: 44px; }
.cloud-tool-table th:last-child, .cloud-tool-table td:last-child { width: 70px !important; min-width: 70px; }
.cloud-tool-table .cloud-message-cell { white-space: normal; overflow-wrap: anywhere; min-width: 220px; max-width: 420px; }
.cloud-status { display: inline-block; font-weight: 600; color: #586c8a; }
.cloud-status.success { color: #278053; }
.cloud-status.bizFail, .cloud-status.networkError { color: #c04444; }
/* Execution history owns its scroll area; the title and actions stay in view. */
dialog[open].cloud-tool-history-modal {
  display: flex;
  flex-direction: column;
  width: min(1200px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  min-height: 0;
  overflow: hidden;
}
.cloud-tool-history-modal .modal-head,
.cloud-tool-history-modal .modal-actions { flex: 0 0 auto; }
.cloud-tool-history-modal .modal-head h2 { min-width: 0; overflow-wrap: anywhere; }
.cloud-tool-history-modal .modal-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.cloud-tool-history-modal .cloud-tool-history-table {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.cloud-tool-history-modal .cloud-tool-history-table:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.cloud-tool-history-modal .cloud-tool-history-records {
  width: 100%;
  min-width: 1040px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}
.cloud-tool-history-modal .cloud-tool-history-records th,
.cloud-tool-history-modal .cloud-tool-history-records td {
  width: auto;
  min-width: 0;
  padding: 11px 14px;
  border-right: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.6;
}
.cloud-tool-history-modal .cloud-tool-history-records th:last-child,
.cloud-tool-history-modal .cloud-tool-history-records td:last-child { border-right: 0; }
.cloud-tool-history-modal .cloud-tool-history-records thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  color: #475569;
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--line);
}
.cloud-tool-history-modal .cloud-tool-history-records .cloud-history-time {
  width: 176px;
  min-width: 176px;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.cloud-tool-history-modal .cloud-tool-history-records .cloud-history-account {
  width: 180px;
  min-width: 180px;
  max-width: 240px;
  overflow-wrap: anywhere;
}
.cloud-tool-history-modal .cloud-tool-history-records .cloud-history-state {
  width: 100px;
  min-width: 100px;
  white-space: nowrap;
}
.cloud-tool-history-modal .cloud-tool-history-records .cloud-history-message {
  min-width: 260px;
  max-width: 600px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.cloud-tool-history-modal .cloud-tool-history-records .cloud-history-charge {
  width: 72px;
  min-width: 72px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cloud-tool-history-modal .cloud-tool-history-records .cloud-history-detail {
  width: 160px;
  min-width: 160px;
}
.cloud-tool-history-modal .cloud-history-detail summary { color: var(--blue); cursor: pointer; white-space: nowrap; }
.cloud-tool-history-modal .cloud-history-detail pre {
  width: 100%;
  max-width: 100%;
  max-height: 280px;
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
}
.cloud-tool-history-modal .cloud-tool-history-pager {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  margin: 0;
  overflow-wrap: anywhere;
}
.cloud-tool-history-modal .modal-actions { padding: 14px 20px; border-top: 1px solid var(--line); background: #fff; }
@media (max-width: 620px) {
  dialog[open].cloud-tool-history-modal { width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 12px; }
  .cloud-tool-history-modal .modal-head { padding: 14px 16px; }
  .cloud-tool-history-modal .modal-body { gap: 10px; padding: 12px; }
  .cloud-tool-history-modal .modal-actions { gap: 8px; padding: 12px 16px; }
  .cloud-tool-history-modal .modal-actions button { flex: 1 1 calc(50% - 4px); min-width: 0; padding: 0 8px; }
}

/* Connected advanced operations retain the same queue and result layout. */
#subscriptionPanel .advanced-table table, #familyMembersPanel .advanced-table table, #familyInvitePanel .advanced-table table { min-width: 1450px; }
#icloudSubscriptionPanel .advanced-table table, #countryPanel .advanced-table table { min-width: 1100px; }
.cloud-tool-panel .advanced-table th { white-space: nowrap; }
#profileCodeWait { width: 72px; }
#cloudRenewalPanel .cloud-tool-config { display: flex; align-items: center; }

.renewal-card-settings { display: grid; gap: 14px; }
.renewal-card-settings p { margin: 0; color: #59677d; overflow-wrap: anywhere; }
.renewal-card-settings input { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid #d9e1ee; border-radius: 8px; }
.renewal-card-settings button { justify-self: start; }
