/* The desk tool. Module-scoped (dk-), built on the site.css primitives and variables only.
   Semantic rule from the design system: pastel is public, ink is sealed. The line about the
   unlinked wallet and the deposit QR are drawn in the seal colour; public data sits on paper. */

.dk { display: grid; gap: 16px; min-width: 0; }
.dk .state { white-space: normal; align-items: flex-start; max-width: 100%; }
.dk .state::before { margin-top: 5px; }
.dk-boot { justify-self: start; }

.dk-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: none; }
.dk-step { display: grid; gap: 10px; min-width: 0; }
.dk-step[data-state="locked"] { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.dk-step[data-state="locked"] .dk-title { color: var(--ink-3); }

.dk-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dk-n {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--v-soft); color: var(--v-text); font-size: 13px;
}
.dk-step[data-state="done"] .dk-n { background: var(--m-soft); color: var(--m-text); }
.dk-title { margin: 0; flex: 1 1 auto; min-width: 0; font: 500 17px/1.3 var(--sans); letter-spacing: -0.01em; }
.dk-chip { flex: none; white-space: nowrap; }
.dk-why { margin: 0; }
.dk-body { display: grid; gap: 12px; min-width: 0; }
.dk-body[hidden] { display: none; }

.dk-field { margin: 0; }
.dk-form { display: grid; gap: 12px; max-width: 34rem; }
.dk-actions { justify-content: flex-start; }
.dk-actions .btn { white-space: normal; text-align: center; }

.dk-legs { display: grid; gap: 6px; }
.dk-legrow { justify-content: flex-start; flex-wrap: nowrap; gap: 10px; min-width: 0; }
.dk-pick { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; cursor: pointer; }
.dk-pick input { width: 18px; height: 18px; flex: none; accent-color: var(--ink); }
.dk-name { color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dk-pct {
  width: 5.5em; min-height: 40px; padding: 6px 10px; flex: none;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink); font-size: 16px;
}
.dk-pct:disabled { opacity: 0.45; }
.dk-sum { margin: 0; color: var(--ink-2); font-size: 14px; }

.dk-addr, .dk-uri, .dk-secret { margin: 0; overflow-wrap: anywhere; word-break: break-all; font-size: 14px; }
.dk-bal, .dk-who { margin: 0; overflow-wrap: anywhere; }
.dk-secret { display: block; padding: 12px; border-radius: var(--r-sm); background: var(--seal); color: var(--on-seal); }
.dk-secret[hidden] { display: none; }

.dk-ack { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); max-width: 44rem; }
.dk-ack input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--ink); }
.dk-ack[hidden] { display: none; }

/* sealed: the wallet that pays is the thing this page keeps unlinked */
.dk-truth {
  margin: 0; padding: 12px 14px 12px 16px;
  border-radius: var(--r-sm); background: var(--v-mist);
  box-shadow: inset 3px 0 0 var(--seal);
  font-size: 14px; line-height: 1.5; color: var(--ink-2);
}
.dk-truth strong { color: var(--seal); font-weight: 600; }

.dk-out { display: grid; gap: 4px; }
.dk-out:empty { display: none; }
.dk-q { margin: 0; font-size: 15px; }

.dk-deposit:empty { display: none; }
.dk-dep { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 20px; align-items: start; }
.dk-dep__text { display: grid; gap: 6px; min-width: 0; }
.dk-dep__text .btn { justify-self: start; min-height: 38px; padding: 0 16px; font-size: 13px; }
.dk-label { margin: 6px 0 0; font: 500 12px/1.4 var(--sans); color: var(--ink-3); }
.dk-amt { margin: 0; font-size: 22px; color: var(--ink); }
.dk-qr { width: 100%; max-width: 200px; height: auto; display: block; border-radius: var(--r-sm); box-shadow: var(--ring); }
.dk-qr__bg { fill: var(--paper); }
.dk-qr__fg { fill: var(--seal); }

.dk-table { display: grid; gap: 8px; }
.dk-table:empty { display: none; }
.dk-legline, .dk-holdline {
  justify-content: flex-start; gap: 6px 14px; padding: 10px 12px;
  border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line);
}
.dk-legline .dk-ack { flex: 1 1 100%; }
.dk-legline .num { font-size: 14px; }
.dk-legstate { margin-left: auto; }
.dk-holdline { justify-content: space-between; }

.dk-log { margin: 0; padding-left: 20px; display: grid; gap: 4px; font: 400 13px/1.5 var(--mono); color: var(--ink-2); }
.dk-log:empty { display: none; }
.dk-log li[data-state="degraded"] { color: var(--err); }
.dk-log li[data-state="live"] { color: var(--m-text); }
.dk-log a { color: inherit; }

.dk-mix { margin: 0; font-size: 15px; }
.dk-err[hidden], .dk-line[hidden] { display: none; }

@media (max-width: 640px) {
  .dk-dep { grid-template-columns: minmax(0, 1fr); }
  .dk-qr { max-width: 220px; }
  .dk-legrow { flex-wrap: wrap; }
  .dk-title { font-size: 16px; }
}
