:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  color: #1d2939;
  background: #f4f6f9;
  font-synthesis: none;
  --blue: #2563eb;
  --muted: #748094;
  --border: #e6eaf0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 18px;
  background: var(--blue);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    box-shadow 0.15s;
  white-space: nowrap;
}
button:hover {
  filter: brightness(0.96);
  box-shadow: 0 3px 10px #0f172a10;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #8fb5ff;
  outline-offset: 3px;
}
button.secondary {
  background: white;
  color: #344054;
  border-color: #dce2ea;
}
button.danger {
  color: #c33c40;
}
button.text-button {
  background: transparent;
  color: var(--blue);
  padding: 5px 0;
  box-shadow: none;
}
button.small-button {
  padding: 5px 10px;
  font-size: 12px;
}
button.selected {
  background: #eaf1ff;
  border-color: #93b7ff;
  color: #1e55c6;
}
.muted {
  color: var(--muted);
}
.small,
small {
  font-size: 12px;
}
.error {
  color: #c13c45;
  overflow-wrap: anywhere;
}
.error:empty {
  display: none;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #8693a8;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.8px;
  margin: 6px 0;
  font-weight: 700;
}
h2 {
  margin: 4px 0;
  font-size: 23px;
}
p {
  margin: 8px 0 16px;
}
.layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 232px;
  background: #101c30;
  color: #e8edf7;
  padding: 34px 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 2px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3c83f6, #37c1c1);
  color: white;
  font-size: 23px;
  box-shadow: 0 6px 16px #0284c71a;
}
.brand small {
  display: block;
  color: #73829b;
  font-size: 8px;
  letter-spacing: 1.6px;
  margin-top: 0;
}
.nav-label {
  font-size: 11px;
  color: #6f7e97;
  margin: 44px 14px 12px;
}
.sidebar nav {
  display: grid;
  gap: 8px;
}
.sidebar nav button {
  background: transparent;
  text-align: left;
  color: #9baac0;
  padding: 12px 15px;
  font-size: 17px;
  font-weight: 400;
  display: flex;
  gap: 12px;
}
.sidebar nav button span {
  font-size: 13px;
}
.sidebar nav button.active {
  color: white;
  background: #233a5a;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 25px 12px 0;
  font-size: 12px;
  color: #8b9bb2;
}
.sidebar-bottom p {
  margin: 10px 0 0;
}
.sidebar-bottom button {
  background: transparent;
  color: #9baac0;
  font-size: 12px;
  padding: 5px 0;
  font-weight: 400;
}
.online-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #35cba2;
  border-radius: 50%;
  margin-right: 6px;
}
.workspace {
  margin-left: 232px;
  width: calc(100% - 232px);
}
.topbar {
  height: 72px;
  border-bottom: 1px solid var(--border);
  background: #ffffffb3;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #8390a3;
}
.topbar b {
  font-weight: 500;
  color: #44516a;
}
#content {
  max-width: 1440px;
  padding: 24px 40px 60px;
  margin: auto;
}
.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.page-toolbar-actions {
  justify-content: flex-end;
}
.page-toolbar p {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0 0 25px;
}
.stat {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 4px #18284403;
}
.stat > span {
  font-size: 12px;
  display: block;
}
.stat strong {
  font-size: 30px;
  display: block;
  margin-top: 8px;
  line-height: 1.2;
  letter-spacing: -1px;
}
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 3px 12px #18284403;
  overflow: hidden;
}
.card-title {
  padding: 21px 24px;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid #eef0f5;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
th {
  font-size: 11px;
  color: #8290a5;
  background: #fafbfc;
  letter-spacing: 0.5px;
  font-weight: 500;
  padding: 13px 24px;
  white-space: nowrap;
}
td {
  padding: 20px 24px;
  border-top: 1px solid #f0f2f6;
  vertical-align: middle;
}
td strong {
  font-weight: 500;
}
td .small {
  margin-top: 5px;
  max-width: 320px;
}
tbody tr:hover {
  background: #fafcff;
}
.cell-sub {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 7px;
  font-size: 11px;
}
.badge {
  font-size: 10px;
  display: inline-flex;
  border-radius: 5px;
  padding: 2px 7px;
  background: #f1f3f7;
  color: #737f90;
  white-space: nowrap;
}
.badge-running {
  color: #2563eb;
  background: #edf3ff;
}
.badge-success,
.badge-completed {
  color: #16856c;
  background: #eaf8f1;
}
.badge-failed {
  color: #c5434d;
  background: #fff0f0;
}
.badge-paused,
.badge-waiting_credentials {
  color: #a97319;
  background: #fff7e7;
}
.empty {
  padding: 65px 20px;
  text-align: center;
  color: #8390a3;
}
.settings-card {
  max-width: 920px;
  margin-bottom: 22px;
}
.settings-form {
  padding: 25px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #526075;
}
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  border: 1px solid #dce2eb;
  border-radius: 7px;
  padding: 10px 12px;
  background: white;
  color: #27374c;
  outline: none;
}
input:focus,
textarea:focus,
select:focus {
  border-color: #70a2fb;
  box-shadow: 0 0 0 3px #2563eb10;
}
textarea {
  resize: vertical;
}
.wide {
  grid-column: 1/-1;
}
.notice {
  padding: 12px 15px;
  background: #f3f7fd;
  border: 1px solid #e5edf8;
  border-radius: 8px;
  font-size: 12px;
  color: #596f8b;
  overflow-wrap: anywhere;
}
.form-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}
.settings-card > p,
.settings-card > .resource-list {
  margin: 18px 25px;
}
.settings-card > button {
  margin: 0 25px 25px;
}
.resource-list {
  padding-left: 20px;
  color: #64748b;
  font-size: 12px;
}
.prompt {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  padding: 0 25px 20px;
}
.settings-card > summary,
.audit-card > summary {
  padding: 18px 25px;
  cursor: pointer;
  color: #61748c;
  font-size: 12px;
}
.batch-overview {
  padding: 23px 25px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 23px;
}
.batch-overview progress {
  width: 100%;
  height: 6px;
  accent-color: #2b75e8;
  border: none;
  border-radius: 8px;
}
.batch-overview progress::-webkit-progress-bar {
  background: #edf1f6;
  border-radius: 8px;
}
.batch-overview progress::-webkit-progress-value {
  background: #3578ec;
  border-radius: 8px;
}
.batch-overview p {
  width: 100%;
  margin: 0;
}
.preview-link {
  display: block;
  color: #2563eb;
  margin-top: 7px;
  text-decoration: none;
  font-size: 12px;
}
.preview-link:hover {
  text-decoration: underline;
}
.preview-button {
  background: transparent;
  padding: 0;
  border: 0;
  font-weight: inherit;
}
.preview-button:hover {
  box-shadow: none;
}
.audit-card {
  margin-top: 22px;
}
.audit-card p {
  padding: 0 25px;
  overflow-wrap: anywhere;
  color: #748094;
}
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
  background:
    radial-gradient(ellipse at 15% 10%, #e4edff, transparent 50%), #f4f6f9;
}
.auth-card {
  background: white;
  padding: 40px;
  width: 430px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 80px #1f355b0d;
}
.auth-card > .brand-mark {
  margin-bottom: 25px;
}
.auth-card h1 {
  font-size: 25px;
}
.auth-card .intro {
  font-size: 13px;
  margin-bottom: 25px;
}
.auth-card form {
  display: grid;
  gap: 18px;
}
.full {
  width: 100%;
}
.auth-foot {
  text-align: center;
  font-size: 11px;
  color: #a2acb9;
  margin: 25px 0 0;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 28px;
  width: 580px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  box-shadow: 0 24px 90px #0e1c3d30;
}
dialog::backdrop {
  background: #0e1c3d60;
  backdrop-filter: blur(3px);
}
#preview-dialog {
  width: min(1400px, calc(100vw - 32px));
  height: 90vh;
  height: 90dvh;
  max-height: 94dvh;
  padding: 0;
  overflow: hidden;
}
#preview-dialog[open] {
  display: flex;
  flex-direction: column;
}
.preview-heading {
  flex-shrink: 0;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.preview-heading h2 {
  margin: 0;
  font-size: 18px;
}
.preview-heading p {
  margin: 4px 0 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.preview-content {
  flex: 1;
  min-height: 0;
  position: relative;
  background: white;
}
.preview-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.preview-loading {
  position: absolute;
  top: 12px;
  left: 16px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 6px;
  background: #f4f6f9;
  pointer-events: none;
}
.modal-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
}
.icon-button {
  background: transparent;
  color: #8b96a6;
  font-size: 25px;
  padding: 0 8px;
}
.segmented {
  display: flex;
  gap: 25px;
  margin: 20px 0;
}
.segmented label,
.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.check {
  margin: 15px 0;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: #2563eb;
  width: 15px;
  height: 15px;
}
.account-list {
  max-height: 250px;
  overflow: auto;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.account-option {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f4;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.account-option strong {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.account-option small {
  display: block;
  font-weight: 400;
}
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 22px;
}
#toasts {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 100;
  display: grid;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
}
.toast {
  background: #16392f;
  color: #eefdf7;
  padding: 13px 20px;
  border-radius: 9px;
  box-shadow: 0 8px 35px #0c20372a;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.toast-error {
  background: #8c2e38;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1050px) {
  .sidebar {
    width: 195px;
    padding: 28px 14px;
  }
  .workspace {
    margin-left: 195px;
    width: calc(100% - 195px);
  }
  #content {
    padding: 22px 25px;
  }
  .topbar {
    padding: 0 25px;
  }
  .page-toolbar {
    align-items: flex-start;
  }
  .page-toolbar > .button-row {
    justify-content: flex-end;
  }
  td,
  th {
    padding-left: 18px;
    padding-right: 18px;
  }
}
@media (max-width: 720px) {
  .layout {
    display: block;
  }
  .sidebar {
    position: static;
    width: 100%;
    padding: 15px 18px;
    flex-direction: row;
    align-items: center;
    gap: 20px;
  }
  .brand {
    font-size: 18px;
    gap: 8px;
  }
  .brand small,
  .nav-label,
  .sidebar-bottom {
    display: none;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  .sidebar nav {
    margin-left: auto;
    display: flex;
    gap: 4px;
  }
  .sidebar nav button {
    padding: 8px;
    font-size: 14px;
    gap: 5px;
  }
  .sidebar nav button span {
    font-size: 12px;
  }
  .workspace {
    margin-left: 0;
    width: 100%;
  }
  .topbar {
    height: 50px;
    padding: 0 20px;
  }
  .timezone {
    font-size: 10px;
  }
  #content {
    padding: 18px 16px;
  }
  .page-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  h1 {
    font-size: 25px;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 15px 12px;
  }
  .stat strong {
    font-size: 25px;
  }
  .stat > span {
    font-size: 10px;
  }
  .card-title {
    padding: 18px;
  }
  .settings-form {
    padding: 18px;
    grid-template-columns: 1fr;
  }
  .wide {
    grid-column: auto;
  }
  .settings-card > p {
    margin: 18px;
  }
  .settings-card > button {
    margin-left: 18px;
  }
  .batch-overview {
    padding: 18px;
    gap: 10px;
  }
  .batch-overview > .muted {
    font-size: 12px;
  }
  .auth-card {
    padding: 28px;
  }
  td {
    min-width: 120px;
  }
  td:first-child {
    min-width: 210px;
  }
  .page-toolbar > .button-row {
    justify-content: flex-start;
  }
  dialog {
    padding: 22px;
  }
}

.account-details {
  margin-top: 10px;
  max-width: 360px;
}
.account-details summary {
  color: #597699;
  cursor: pointer;
  font-size: 11px;
}
.account-details p {
  margin: 7px 0;
  overflow-wrap: anywhere;
}
.usage-snapshot {
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f5f7fa;
  border-radius: 7px;
  padding: 10px;
  font-size: 11px;
  font-weight: 400;
}

@media (max-width: 720px) {
  .sidebar { flex-wrap: wrap; gap: 10px; }
  .sidebar-bottom { display: block; padding: 0; margin: 0; }
  .sidebar-bottom > :not(#logout) { display: none; }
  .sidebar-bottom { font-size: 0; }
  .sidebar-bottom #logout { font-size: 11px; padding: 6px; margin: 0; }
  .brand small { display: none; }
}

.account-results-table th:first-child,
.account-results-table td.account-id {
  width: 90px;
  min-width: 80px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.account-results-table td.account-name,
.retest-table td.account-name {
  min-width: 140px;
  max-width: 240px;
  overflow-wrap: anywhere;
}
.account-results-table td.account-email {
  min-width: 210px;
}
.quota-note {
  margin: 0;
  padding: 0 25px 16px;
}
.account-results-table .quota-cell {
  min-width: 175px;
  font-variant-numeric: tabular-nums;
}
.account-results-table .quota-cell .small {
  margin-top: 4px;
  white-space: normal;
}
.account-results-table .quota-value {
  white-space: nowrap;
}
#history-dialog {
  width: min(1440px, calc(100vw - 32px));
  padding: 0;
  max-height: 90dvh;
}
#history-dialog[open] {
  display: flex;
  flex-direction: column;
}
#history-content {
  min-height: 0;
  overflow: auto;
}
.history-note {
  margin: 0;
  padding: 16px 20px;
}
.history-table td {
  min-width: 130px;
  vertical-align: top;
}
.history-table .quota-cell {
  min-width: 175px;
}
.history-table .quota-cell .small {
  margin-top: 4px;
}
.history-table .quota-history,
.history-table .quota-expired {
  color: #997125;
}
.retry-account {
  margin-top: 10px;
}
.retry-reason {
  margin-top: 6px;
  max-width: 230px;
  white-space: normal;
}
.attempt-count {
  margin-top: 6px;
}
.account-results-table .result-cell,
.history-table .result-cell {
  min-width: 155px;
}
button.result-info-button {
  display: block;
  margin-top: 7px;
  padding: 0;
  font-size: 12px;
  white-space: nowrap;
}
#result-info-dialog {
  width: min(960px, calc(100vw - 32px));
  max-height: 85vh;
  max-height: 85dvh;
  padding: 0;
  overflow: hidden;
}
#result-info-dialog[open] {
  display: flex;
  flex-direction: column;
}
#result-info-text {
  margin: 0;
  padding: 20px;
  min-height: 100px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.7;
  background: #f8fafc;
}
#result-info-text:focus-visible {
  outline: 2px solid #8fb5ff;
  outline-offset: -2px;
}
.account-results-table .quota-history,
.account-results-table .quota-expired {
  color: #997125;
}
@media (max-width: 720px) {
  .quota-note { padding: 0 18px 14px; }
  .account-results-table .quota-cell { min-width: 155px; }
}

.retest-controls { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.retest-select-all { margin: 12px 0; }
.retest-table td { vertical-align: top; }
.retest-table td.account-email { overflow-wrap: anywhere; min-width: 180px; }
.retest-table td:nth-child(5), .retest-table td:nth-child(6) { min-width: 160px; }
.pending-retest { display: block; margin-top: 6px; }
.credential-check-summary {
  padding: 18px 22px;
  margin-bottom: 20px;
}
.credential-check-summary progress {
  width: 100%;
  height: 8px;
  accent-color: var(--blue);
}
.credential-check-summary p:last-child { margin-bottom: 0; }
.credential-check-table td { overflow-wrap: anywhere; }
.credential-check-table th:last-child { min-width: 180px; }

.detail-view-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: #eef2f7; }
.detail-view-switch button { padding: 6px 12px; font-size: 12px; border: 0; }
.detail-view-switch button.secondary { background: transparent; color: #718096; }
.detail-view-switch button.selected { background: white; color: var(--blue); box-shadow: 0 1px 4px #152a4712; }
.batch-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 24px; }
.gallery-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: white; box-shadow: 0 3px 12px #132d4806; }
.gallery-preview { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #f1f4f8; border-bottom: 1px solid var(--border); }
.gallery-frame { position: absolute; inset: 0 auto auto 0; width: 1024px; height: 768px; border: 0; transform-origin: top left; transform: scale(var(--gallery-scale, 0.28)); pointer-events: none; background: white; }
.gallery-open { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; padding: 0; background: transparent; color: #fff; box-shadow: none; }
.gallery-open:hover { filter: none; box-shadow: inset 0 0 0 2px #2563eb55; }
.gallery-open-label { position: absolute; bottom: 12px; right: 12px; padding: 5px 9px; border-radius: 6px; font-size: 11px; background: #152a47ce; opacity: 0; transition: opacity .15s; }
.gallery-open:hover .gallery-open-label, .gallery-open:focus-visible .gallery-open-label { opacity: 1; }
.gallery-loading { position: absolute; bottom: 12px; left: 12px; font-size: 12px; background: #ffffffed; color: var(--muted); padding: 4px 8px; border-radius: 6px; pointer-events: none; }
.gallery-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; color: var(--muted); font-size: 13px; }
.gallery-info { margin: 0; padding: 16px 18px 18px; display: grid; gap: 7px; }
.gallery-field { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 10px; align-items: baseline; font-size: 12px; }
.gallery-field dt { color: var(--muted); }
.gallery-field dd { margin: 0; overflow-wrap: anywhere; color: #344054; }
.gallery-field:nth-child(2) dd { font-size: 14px; font-weight: 600; color: #1d2939; }
.gallery-no-results { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .batch-gallery { gap: 16px; }
  .detail-view-switch button { padding: 6px 10px; }
}

/* Account workspace: stable previews with the three primary account actions. */
.gallery-actions { padding: 0 16px 12px; }
.gallery-actions button { flex: 1; }
.gallery-state { padding: 0 16px 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.execution-overview { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.execution-overview progress { flex: 1; min-width: 120px; }
.execution-overview .notice { flex-basis: 100%; }
