@charset "utf-8";

/* ADB Panel — blue/white professional theme.
   Type: Space Grotesk (headings) · IBM Plex Sans (UI) · IBM Plex Mono (code).
   Flat surfaces, one royal-blue accent, one deep-navy terminal. No gradients
   on controls, no glassmorphism, no pill-everything. */

:root {
  --font-head: "Space Grotesk", ui-sans-serif, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #eef3fb;
  --surface: #ffffff;
  --surface-2: #f2f6fd;
  --border: #dbe4f3;
  --text: #0d2143;
  --ink: #0d2143;
  --muted: #59698a;
  --accent: #1b53e0;
  --accent-strong: #123fb4;
  --accent-tint: #e7eefe;
  --navy: #0b1c3b;

  --ok: #1c9a55;
  --warn: #b1741a;
  --err: #d5423a;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(13, 33, 67, .05), 0 12px 30px rgba(13, 33, 67, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 460px at 100% -12%, #e2ecfd 0%, rgba(226, 236, 253, 0) 62%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); letter-spacing: -.01em; }

/* --- form controls --- */
label {
  display: block;
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

input::placeholder { color: #9aabc6; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

button {
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 9px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .04s ease;
}

button:hover { background: var(--accent-strong); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-tint); }

button.small { padding: 6px 12px; font-size: 13px; }

button.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
  font-weight: 500;
}
button.ghost:hover { background: var(--surface-2); border-color: #bfd0ec; }

button.link {
  background: none;
  color: var(--accent);
  border: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
button.link:hover { text-decoration: underline; }

/* --- auth --- */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth .card {
  width: min(384px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 34px 30px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--accent);
}

.auth h1 { margin: 0 0 4px; font-size: 24px; font-weight: 700; }
.sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.auth button { width: 100%; margin-top: 6px; padding: 11px; }

.alert {
  background: color-mix(in srgb, var(--err) 9%, #fff);
  border: 1px solid color-mix(in srgb, var(--err) 40%, var(--border));
  color: var(--err);
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* --- top bar --- */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 13px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.02em;
  color: var(--ink);
}
.brand::before {
  content: "";
  width: 9px;
  height: 20px;
  border-radius: 3px;
  background: var(--accent);
}

.nav { display: flex; gap: 24px; flex: 1; }
.nav a {
  padding: 6px 1px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); border-bottom-color: var(--accent); }

.who { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.who form { margin: 0; }

/* --- layout --- */
.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: grid;
  gap: 20px;
}
/* Task List needs real room for an 8-column table side by side, twice. */
main.wrap.wrap-wide { max-width: 1700px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 11px;
}
.panel-head h2::before {
  content: "";
  width: 4px;
  height: 15px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.muted { color: var(--muted); font-size: 14px; }
.head-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- devices --- */
.devices { display: grid; gap: 10px; }

.device {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-wrap: wrap;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.device:hover { border-color: #bfd0ec; }
.device.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); background: #fff; }

.device .meta { flex: 1; min-width: 180px; }
.device .name { font-weight: 600; color: var(--ink); }
.device .serial { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.dot.device { background: var(--ok); }
.dot.offline, .dot.unauthorized { background: var(--warn); }
.dot.disconnected { background: var(--err); }

.chip {
  display: inline-block;
  padding: 3px 9px;
  background: var(--accent-tint);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  border-radius: 7px;
  font-size: 12px;
  color: var(--accent-strong);
  font-weight: 500;
  font-family: var(--font-mono);
}

/* --- command groups --- */
.groups { display: grid; gap: 18px; }
.group h3 {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--muted);
  font-weight: 600;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 9px; }

.cta {
  display: inline-flex;
  align-items: center;
  padding: 9px 15px;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .13s ease, border-color .13s ease, color .13s ease;
}
.cta:hover { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-strong); }
.cta .ico { display: none; }

.cta.unsupported {
  opacity: .4;
  cursor: not-allowed;
  text-decoration: line-through;
}
.cta.unsupported:hover { border-color: var(--border); background: var(--surface-2); color: var(--ink); }

/* --- output: the one deliberate dark surface --- */
.output {
  margin: 0;
  padding: 14px 16px;
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 10px;
  font: 12.5px/1.65 var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow: auto;
  color: #d7e3f8;
}
.output .err { color: #ff9a91; }
.shot { margin-top: 12px; max-width: 260px; border: 1px solid var(--border); border-radius: 10px; display: block; }

/* --- audit --- */
.audit { display: grid; gap: 3px; max-height: 240px; overflow: auto; }
.audit-row {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  padding: 6px 9px;
  border-radius: 7px;
  font-family: var(--font-mono);
}
.audit-row:nth-child(odd) { background: var(--surface-2); }
.audit-row .t { color: var(--muted); flex-shrink: 0; }
.audit-row .ev { font-weight: 600; flex-shrink: 0; min-width: 96px; color: var(--ink); }
.audit-row.bad .ev { color: var(--err); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.filters select { width: auto; margin-top: 0; flex: 0 1 auto; min-width: 150px; }

.task-columns { display: flex; gap: 18px; align-items: flex-start; }
.task-columns .task-col { flex: 1 1 0; min-width: 0; }
@media (max-width: 860px) {
  .task-columns { flex-direction: column; }
}

.tasks-wrap { max-height: 480px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.tasks-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 10px; font-family: var(--font-mono); }
.tasks-table th, .tasks-table td {
  padding: 4px 6px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tasks-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom: 1px solid var(--border);
}
.tasks-table tbody tr:nth-child(odd) { background: var(--surface-2); }
.tasks-table td.amt { text-align: right; font-weight: 600; }
.tasks-table td.amt.deposit { color: var(--ok); }
.tasks-table td.amt.withdraw { color: var(--warn); }
.tasks-table td.panel { color: var(--muted); }
.tasks-table td.bank { color: var(--muted); }
.tasks-table td.note { color: var(--muted); }
.tasks-table td.status { font-size: 9px; color: var(--muted); }
.tasks-table td.txid { font-size: 9px; color: var(--muted); }

/* --- dialogs --- */
dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  width: min(408px, 92vw);
  box-shadow: 0 24px 70px rgba(11, 28, 59, .28);
}
dialog::backdrop { background: rgba(11, 28, 59, .45); }
dialog h3 { margin: 0 0 16px; font-size: 18px; font-weight: 600; }
dialog menu { display: flex; justify-content: flex-end; gap: 8px; margin: 20px 0 0; padding: 0; }
dialog menu a.small {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 9px;
  border: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
}

.hint { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; line-height: 1.55; }
.hint b { color: var(--ink); font-weight: 600; }
code { font-family: var(--font-mono); font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

details summary { cursor: pointer; font-size: 13px; color: var(--muted); margin-top: 10px; }

/* --- QR dialog --- */
.qr {
  display: block;
  width: 260px;
  max-width: 100%;
  margin: 0 auto 14px;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  border: 1px solid var(--border);
}
#dlg-qr { width: min(420px, 94vw); }
#dlg-qr .output { max-height: 200px; font-size: 11px; margin-top: 8px; }

/* --- inline input + button --- */
.with-btn { display: flex; gap: 6px; align-items: stretch; margin-top: 6px; }
.with-btn input { margin-top: 0; flex: 1; min-width: 0; }
.with-btn button { flex-shrink: 0; white-space: nowrap; }

/* --- busy state --- */
.spinner {
  display: inline-block;
  width: 11px; height: 11px;
  border: 2px solid color-mix(in srgb, #fff 45%, transparent);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -1px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
button.busy { position: relative; opacity: .8; cursor: progress; }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.5s; } }

/* --- bank: flow cards --- */
.flows { display: grid; gap: 12px; }
.flow {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 16px;
}
.flow-head .name { font-weight: 600; color: var(--ink); }
.flow-head .serial { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 12px; }
.chain-sep { color: var(--muted); font-size: 12px; }
.chain .chip { font-family: var(--font-mono); }
.chain .step-wait { opacity: .7; }
.chain .step-screenshot { border-color: var(--accent); color: var(--accent-strong); }
.flow-tools { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- bank: step editor --- */
.steps-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 18px 0 10px;
}
.steps-head h4 { margin: 0; font-size: 14px; }
#steps { display: grid; gap: 10px; }

.step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 12px;
}
.step-idx {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.step-body { flex: 1; min-width: 0; }
.step-tools { display: flex; gap: 4px; flex-shrink: 0; }

button.icon { padding: 4px 9px; font-size: 12px; line-height: 1.2; }

.field { display: block; margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.field:last-child { margin-bottom: 0; }

.params {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0 10px;
}

.ask { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 11px; }
.ask input { width: auto; margin: 0; }

.cmd-extras { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.warn-line { margin: 6px 0 0; font-size: 12px; color: var(--warn); }

/* ===== Banks page — account-centric, clean & smooth ===================== */
.banks {
  max-width: 1040px;
  margin: 0 auto;
  padding: 30px 20px 64px;
}
.banks .view { animation: view-in .32s cubic-bezier(.22, 1, .36, 1) both; }
.banks .view[hidden] { display: none; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .banks .view { animation: none; } }

.banks-hero { margin: 4px 0 22px; }
.banks-hero h1 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 30px;
  letter-spacing: -.02em;
  color: var(--ink);
}
.banks-hero p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* --- account grid --- */
.acct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.acct-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  width: 100%;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(13, 33, 67, .04);
  cursor: pointer;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.acct-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}
.acct-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(27, 83, 224, .14);
}
.acct-card:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-tint); }
.acct-card:active { transform: translateY(-1px); }

.acct-badge {
  flex-shrink: 0;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
}
.acct-badge.lg { width: 58px; height: 58px; font-size: 18px; border-radius: 15px; }

.acct-body { flex: 1; min-width: 0; }
.acct-holder {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acct-bank { font-size: 13px; font-weight: 500; color: var(--accent-strong); margin-top: 2px; }
.acct-balance { font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--ink); margin-top: 8px; letter-spacing: -.01em; }
.acct-sub { font-size: 11.5px; color: var(--muted); margin-top: 5px; font-family: var(--font-mono); }
.acct-go {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 20px;
  transition: transform .18s ease, color .18s ease;
}
.acct-card:hover .acct-go { transform: translateX(3px); color: var(--accent); }

/* "add a card" tile */
.acct-add {
  justify-content: center;
  gap: 10px;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--surface-2);
  color: var(--accent-strong);
}
.acct-add::before { display: none; }
.acct-add:hover { background: var(--accent-tint); }
.acct-add-plus { font-family: var(--font-head); font-weight: 700; font-size: 22px; line-height: 1; }
.acct-add-label { font-family: var(--font-head); font-weight: 600; font-size: 15px; }

/* delete-account button in the detail header */
.acct-del {
  align-self: flex-start;
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 12.5px;
  background: transparent;
  color: var(--err);
  border: 1px solid color-mix(in srgb, var(--err) 35%, var(--border));
}
.acct-del:hover { background: color-mix(in srgb, var(--err) 8%, #fff); border-color: var(--err); }

/* --- account detail --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 6px 4px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 12px;
}
.back-link:hover { background: transparent; color: var(--accent); }
.back-link span { font-size: 17px; transition: transform .18s ease; display: inline-block; }
.back-link:hover span { transform: translateX(-3px); }

#detail-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.detail-info { flex: 1; min-width: 0; }
.detail-holder { font-family: var(--font-head); font-weight: 700; font-size: 22px; color: var(--ink); letter-spacing: -.01em; }
.detail-bank { font-size: 14px; color: var(--muted); margin-top: 2px; }
.detail-balance { margin-top: 8px; }
.detail-balance-num { font-family: var(--font-head); font-weight: 700; font-size: 22px; color: var(--accent-strong); }
.detail-balance-when { font-size: 12px; color: var(--muted); margin-left: 8px; }
.bind-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.bind-select {
  width: auto;
  margin: 0;
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: 9px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.action-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.action-tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(27, 83, 224, .14);
}
.action-tile:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-tint); }
.action-tile.active {
  border-color: var(--accent);
  background: var(--accent-tint);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.action-ico {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--accent-tint);
  color: var(--accent-strong);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
}
.action-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.action-label { font-family: var(--font-head); font-weight: 600; font-size: 16px; color: var(--ink); }
.action-desc { font-size: 12.5px; color: var(--muted); }

/* --- module slot (placeholder for now) --- */
.module-slot { margin-top: 18px; animation: view-in .3s cubic-bezier(.22, 1, .36, 1) both; }
.module-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 44px 24px;
  background: var(--surface-2);
  border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 18px;
}
.module-ico {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--accent-tint);
  color: var(--accent-strong);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 26px;
  margin-bottom: 4px;
}
.module-empty h3 { margin: 4px 0 0; font-family: var(--font-head); font-size: 18px; color: var(--ink); }
.module-empty p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 420px; line-height: 1.55; }
.soon-badge {
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-strong);
  background: var(--accent-tint);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
}

/* --- module: live runner --- */
.module-live {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.module-live h3 { margin: 0 0 6px; font-family: var(--font-head); font-size: 18px; color: var(--ink); }
.module-note { margin: 0 0 14px; font-size: 13px; color: var(--muted); line-height: 1.55; }
.module-live .run-btn { margin-bottom: 14px; }
.module-live .output { margin: 0; max-height: 320px; }
.saldo-result {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -.01em;
  color: var(--accent-strong);
  margin: 0 0 12px;
}

/* --- mutasi list --- */
.mutasi-box { margin-bottom: 12px; }
.mutasi-list { display: flex; flex-direction: column; }
.mutasi-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin: 12px 0 6px;
}
.mutasi-date:first-child { margin-top: 0; }
.mutasi-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.mutasi-namecol { display: flex; flex-direction: column; min-width: 0; }
.mutasi-name { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.mutasi-time { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 1px; }
.mutasi-amt { flex-shrink: 0; font-family: var(--font-mono); font-weight: 600; }
.mutasi-amt.in { color: var(--ok); }
.mutasi-amt.out { color: var(--ink); }

/* --- credentials editor --- */
.cred-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 18px;
}
.cred-title { margin: 0 0 12px; font-family: var(--font-head); font-size: 15px; color: var(--ink); }
.cred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0 12px;
}
.cred-field { display: block; margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.cred-input-wrap { position: relative; display: block; }
.cred-input-wrap input { padding-right: 40px; }
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
}
.pw-toggle:hover { background: transparent; color: var(--accent); }
.pw-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-tint); border-radius: 8px; }
.cred-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.cred-note { font-size: 12.5px; color: var(--err); }
.cred-hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* transfer confirmation modal */
.tf-confirm { margin: 6px 0 4px; }
.tf-lbl { font-size: 12px; color: var(--muted); margin-top: 10px; }
.tf-name { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--ink); }
.tf-sub { font-size: 13px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px; }
.tf-amt { font-family: var(--font-head); font-weight: 700; font-size: 26px; color: var(--accent-strong); margin-top: 2px; }

/* attempt / lock line in the saldo module */
.attempt-line { margin: 0 0 12px; font-size: 13px; }
.attempt-line:empty { display: none; }
.attempt-line.warn { color: var(--warn); }
.attempt-line.locked { color: var(--err); font-weight: 600; }

@media (max-width: 560px) {
  .banks { padding: 22px 14px 48px; }
  #detail-head { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* --- bank: run results --- */
.runlog { display: grid; gap: 3px; }
.run-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); background: color-mix(in srgb, var(--ok) 9%, #fff); }
.chip.err { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, var(--border)); background: color-mix(in srgb, var(--err) 9%, #fff); }

.run-step {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 13px;
}
.run-step:nth-child(odd) { background: var(--surface-2); }
.run-step.failed { background: color-mix(in srgb, var(--err) 10%, #fff); }
.run-idx { color: var(--muted); font-size: 12px; min-width: 16px; font-family: var(--font-mono); }
.run-label { min-width: 150px; }
.run-ms { color: var(--muted); font-size: 12px; font-family: var(--font-mono); }
.run-out { color: var(--muted); font-family: var(--font-mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-out.err { color: var(--err); }

/* --- bank: screenshots --- */
.shotgrid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.shot-card { margin: 0; width: 160px; }
.shot-card img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: zoom-in;
  display: block;
}
.shot-card figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }

dialog.wide { width: min(520px, 94vw); }
.shot-full { width: 100%; border: 1px solid var(--border); border-radius: 10px; display: block; }

.pickwrap { max-height: 65vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
#pick-img { width: 100%; display: block; cursor: crosshair; }

/* --- toasts --- */
#toasts {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, 92vw);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 15px;
  border-radius: 11px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(11, 28, 59, .18);
  font-size: 13.5px;
  color: var(--ink);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast.info { border-left-color: var(--accent); }
.toast .ic { display: none; }

/* --- wizard --- */
#dlg-wizard { width: min(540px, 96vw); padding: 0; }
.wz-head { padding: 20px 24px 14px; border-bottom: 1px solid var(--border); }
.wz-head h3 { margin: 0 0 12px; font-size: 18px; }
.wz-steps { display: flex; gap: 6px; }
.wz-pip { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.wz-pip.done { background: var(--ok); }
.wz-pip.active { background: var(--accent); }
.wz-body { padding: 22px 24px; min-height: 150px; }
.wz-step-title { font-family: var(--font-head); font-weight: 600; font-size: 16px; margin: 0 0 4px; color: var(--ink); }
.wz-step-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; line-height: 1.55; }
.wz-body label { font-size: 13px; }
.wz-body ol { margin: 0 0 14px; padding-left: 20px; font-size: 13.5px; line-height: 1.7; }
.wz-body ol b { color: var(--ink); }
.wz-status { margin-top: 14px; font-size: 13px; min-height: 20px; display: flex; align-items: center; gap: 8px; }
.wz-status.err { color: var(--err); }
.wz-status.ok { color: var(--ok); }
.wz-foot {
  padding: 15px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.wz-qr { display: block; width: 220px; max-width: 100%; margin: 0 auto 12px; background: #fff; padding: 10px; border-radius: 10px; border: 1px solid var(--border); }
.wz-highlight { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 9px; animation: wz-pulse 1.4s ease-in-out infinite; }
@keyframes wz-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent); }
}
.wz-primary { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .wz-highlight { animation: none; } }

/* --- scrollbars --- */
.output::-webkit-scrollbar, .audit::-webkit-scrollbar, .pickwrap::-webkit-scrollbar { width: 10px; height: 10px; }
.output::-webkit-scrollbar-thumb { background: #2a3f68; border-radius: 6px; }
.audit::-webkit-scrollbar-thumb, .pickwrap::-webkit-scrollbar-thumb { background: #c6d4ec; border-radius: 6px; }

/* --- responsive --- */
@media (max-width: 640px) {
  .topbar { gap: 14px; padding: 12px 16px; }
  .nav { gap: 16px; }
  .wrap { padding: 18px 14px 48px; }
  .panel { padding: 16px; }
}

/* ===================== responsive / mobile web ===================== */

/* Tall dialogs (wizard, flow editor) scroll instead of overflowing the screen. */
dialog { max-height: 90dvh; overflow: auto; }

/* Wizard: fixed head/foot, scrolling middle, so Next/Back are always reachable.
   Scope the flex layout to [open] only — a bare `display:flex` would override the
   browser's `dialog:not([open]){display:none}` and render the closed wizard
   inline at the bottom of the page. */
#dlg-wizard[open] { max-height: 92dvh; display: flex; flex-direction: column; }
#dlg-wizard .wz-head, #dlg-wizard .wz-foot { flex: 0 0 auto; }
#dlg-wizard .wz-body { flex: 1 1 auto; overflow: auto; }
.wz-foot-right { display: flex; gap: 10px; }

@media (max-width: 640px) {
  /* 16px inputs stop iOS from zooming in on focus. */
  input, select, textarea { font-size: 16px; }

  .topbar { flex-wrap: wrap; gap: 10px 16px; padding: 12px 14px; }
  .brand { font-size: 16px; }
  .who { font-size: 12px; gap: 10px; }
  .nav { order: 3; width: 100%; gap: 20px; }

  .wrap { padding: 18px 14px 44px; gap: 16px; }
  .panel { padding: 16px 14px; }
  .panel-head { flex-wrap: wrap; }
  .panel-head h2 { font-size: 14px; }

  /* comfortable tap targets */
  .cta, button.small { min-height: 42px; }
  .device { padding: 12px 14px; }

  dialog { width: min(520px, 94vw); padding: 20px; border-radius: 14px; }
  dialog menu { flex-wrap: wrap; }
  dialog menu button, dialog menu a.small { flex: 1 1 auto; text-align: center; }

  #dlg-wizard { width: 96vw; }
  .wz-head { padding: 16px 18px 12px; }
  .wz-head h3 { font-size: 16px; }
  .wz-body { padding: 18px; }
  .wz-body ol { padding-left: 18px; }
  .wz-foot { padding: 14px 18px; }
  .wz-foot button { flex: 1 1 0; min-height: 46px; font-size: 15px; }
  .wz-qr, .qr { width: 200px; }

  /* bank page grids collapse to one column */
  .params { grid-template-columns: 1fr; }
  .shot-card { width: calc(50% - 6px); }
}

@media (max-width: 380px) {
  .nav { gap: 14px; }
  .wrap { padding: 14px 10px 38px; }
  .panel { padding: 14px 12px; }
  .cta-row { gap: 7px; }
}

/* Hide the native up/down spinner on number inputs (pairing/ADB port, etc.). */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
