.auto-topup-card {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.auto-topup-card-head,
.auto-topup-title-lockup,
.auto-topup-toggle {
  display: flex;
  align-items: center;
}

.auto-topup-card-head { justify-content: space-between; gap: 18px; }
.auto-topup-title-lockup { gap: 12px; }
.auto-topup-title-lockup h2 { margin: 3px 0 0; font-size: 20px; }
.auto-topup-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #c9d8e8;
  border-radius: 6px;
  color: var(--blue);
  background: #eef5fc;
}
.auto-topup-icon svg { width: 19px; height: 19px; }
.auto-topup-state {
  min-width: 68px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: #edf0f2;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}
.auto-topup-state.loading { color: var(--blue); background: #e2edf8; }
.auto-topup-state.enabled { color: white; background: var(--green); }
.auto-topup-state.disabled { color: var(--amber); background: #faecd8; }
.auto-topup-state.failed { color: var(--red); background: #f7e3e3; }

.auto-topup-layout {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(280px, .78fr) minmax(0, 1.42fr);
  gap: 26px;
}
.auto-topup-input-pane { min-width: 0; }
.auto-topup-input-pane textarea { min-height: 132px; }
.auto-topup-settings-pane {
  min-width: 0;
  padding-left: 26px;
  border-left: 1px solid var(--line);
}
.auto-topup-facts {
  margin: 0;
  padding: 14px 0;
  display: grid;
  grid-template-columns:
    minmax(150px, 1.35fr) minmax(76px, .6fr) minmax(82px, .65fr)
    minmax(165px, 1.4fr) minmax(105px, .9fr);
  gap: 12px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.auto-topup-facts div { min-width: 0; }
.auto-topup-facts dt { color: var(--muted); font-size: 12px; }
.auto-topup-facts dd {
  margin: 5px 0 0;
  min-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 650 13px/20px ui-monospace, monospace;
}
.auto-topup-form {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}
.auto-topup-form label { margin: 0; }
.auto-topup-form input[type="text"] { margin-top: 7px; }
.auto-topup-defaults {
  margin: 0;
  grid-column: 1 / span 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.auto-topup-defaults dt { color: var(--muted); font-size: 12px; }
.auto-topup-defaults dd {
  margin: 7px 0 0;
  font: 650 14px/20px ui-monospace, monospace;
}
.auto-topup-target-control dd {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auto-topup-form .auto-topup-target-control input {
  width: min(100%, 170px);
  min-width: 0;
  margin-top: 0;
  padding-block: 8px;
  font: 700 14px/20px ui-monospace, monospace;
}
.auto-topup-target-control span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 20px;
}
.auto-topup-toggle {
  min-height: 42px;
  grid-column: 1 / span 2;
  gap: 9px;
  cursor: pointer;
}
.auto-topup-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.auto-topup-toggle > span {
  width: 38px;
  height: 22px;
  position: relative;
  flex: 0 0 auto;
  border-radius: 11px;
  background: #b8bec5;
  transition: background 150ms ease;
}
.auto-topup-toggle > span::after {
  content: "";
  width: 16px;
  height: 16px;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: white;
  transition: transform 150ms ease;
}
.auto-topup-toggle input:checked + span { background: var(--green); }
.auto-topup-toggle input:checked + span::after { transform: translateX(16px); }
.auto-topup-toggle input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.auto-topup-toggle input:disabled + span { opacity: .5; cursor: not-allowed; }
.auto-topup-toggle strong { font-size: 13px; }
.auto-topup-form .primary { width: 100%; margin-top: 0; }
.auto-topup-result {
  min-height: 20px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  overflow-wrap: anywhere;
}
.auto-topup-result.success { color: var(--green-dark); }
.auto-topup-result.error { color: var(--red); }
.auto-topup-batch-list {
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}
.auto-topup-batch-item {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid #aab1b9;
  border-radius: 6px;
  background: #fafbfc;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
  overflow-wrap: anywhere;
}
.auto-topup-batch-item.running { border-left-color: var(--blue); color: var(--blue); }
.auto-topup-batch-item.enabled { border-left-color: var(--green); color: var(--green-dark); }
.auto-topup-batch-item.failed { border-color: #edcaca; border-left-color: var(--red); color: var(--red); background: #fffafa; }

@media (max-width: 1000px) {
  .auto-topup-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .auto-topup-card { padding: 20px; }
  .auto-topup-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .auto-topup-settings-pane { padding: 22px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .auto-topup-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auto-topup-facts dd { white-space: normal; overflow-wrap: anywhere; }
  .auto-topup-form { grid-template-columns: minmax(0, 1fr); }
  .auto-topup-defaults { grid-column: auto; }
  .auto-topup-toggle { grid-column: auto; }
}

/* Keep this secondary tool in the same warm, tactile console language. */
.auto-topup-card {
  border-color: var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 6px 0 #ddcfb2, 0 17px 34px var(--shadow-ink), inset 0 1px 0 #fff;
}
.auto-topup-icon {
  color: var(--gold-dark);
  border-color: #dfb95f;
  border-radius: 9px;
  background: var(--gold-soft);
  box-shadow: 0 3px 0 #d3ad56, inset 0 1px 0 #fffbe0;
}
.auto-topup-state {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #f3ecdd;
  box-shadow: 0 2px 0 #d8c9aa, inset 0 1px 0 #fff;
}
.auto-topup-state.loading { color: var(--blue); background: #e6f0fb; }
.auto-topup-state.enabled { border-color: var(--green-dark); background: var(--green); }
.auto-topup-state.disabled { color: var(--gold-dark); background: var(--gold-soft); }
.auto-topup-state.failed { color: var(--red-dark); background: #fde7e4; }
.auto-topup-settings-pane { border-left-color: var(--line); }
.auto-topup-batch-item {
  border-color: var(--line-strong);
  border-radius: 8px;
  background: var(--paper-warm);
  box-shadow: 0 2px 0 #dfd0b3;
}
