/**
 * wallet-kit / wallet-ui
 *
 * The wallet dialogs, in the host's own language.
 *
 * Every colour, radius and face below is read from the host app's tokens with
 * a fallback, so the dialogs match whatever app embeds them — Odette's quiet
 * system today (revamp.css redefines the app's token names on body.v2, so this
 * sheet re-tones with it for free), ranger next — and still stand on their own
 * in a page that defines none of them. An earlier revision kept a private light
 * skin, a wallet as a distinct object the way Privy's is; it was retired for one
 * design language across the new UI.
 *
 * One structural rule survives every skin: a SUNKEN surface is a fact about
 * your money — an address, a balance, an amount. A RAISED surface is something
 * you can do.
 *
 * `.wk` is the dialog shell, on .modal-content. `.wk-in` carries the same
 * tokens without painting a shell, for a wallet section grafted into a host
 * dialog (the exchange route inside Odette's fund modal).
 *
 * Radii carry !important: Odette's app.css runs a desktop sweep that squares
 * every radius it does not allow-list, and DESIGN.md's answer for a new class
 * is exactly this. The shell's other !importants beat .odette-modal-content's.
 */

.wk, .wk-in {
  --wk-surface:    var(--card-bg, #0E1322);                    /* the panel tone: every modal */
  --wk-raise:      var(--v2-chip, #232C42);                    /* a control you can press */
  --wk-raise-hi:   var(--v2-chip-hover, #2C3752);
  --wk-sunken:     var(--panel-sunken, #070A11);               /* a fact about your money */
  --wk-line:       var(--border-color, rgba(255, 255, 255, .06));
  --wk-line-mid:   var(--border-light, rgba(255, 255, 255, .13));
  --wk-ink:        var(--text-primary, #F5F7FA);
  --wk-dim:        var(--text-secondary, #C2CBD8);             /* sentences */
  --wk-faint:      var(--text-muted, #7E8A9C);                 /* labels, notes, the address middle */
  --wk-primary:    var(--v2-primary-bg, #FDFDFD);              /* the one white button per surface */
  --wk-on-primary: var(--v2-ink, #0F1520);
  --wk-focus:      var(--primary, #7DD3FC);                    /* sky: the focus ring, links */
  --wk-danger:     var(--negative, #E86A62);
  --wk-sans:       var(--sans, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  --wk-mono:       var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  --wk-r-modal:    12px;                                       /* DESIGN.md rounded.modal */
  --wk-r-ctl:      6px;                                        /* buttons and fields */
  --wk-r-tag:      3px;
  color: var(--wk-ink);
  font-family: var(--wk-sans);
}

.wk {
  background: var(--wk-surface) !important;
  border: none !important;
  border-radius: var(--wk-r-modal) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .10) !important;
  overflow: hidden;
}

/* --- identity: the title alone on its line, one muted sentence under it --- */
.wk-head { padding: 16px 20px 0; position: relative; }
/* The mark stays in the markup for a host that wants it; this language does
   not — its modals open with the title alone, and the app hides its own header
   icons the same way. */
.wk-mark { display: none; }
.wk-title { font-size: 16px; font-weight: 600; letter-spacing: 0; margin: 0; line-height: 1.2; padding-right: 32px; }
.wk-sub { font-size: 12px; color: var(--wk-faint); line-height: 1.5; margin: 4px 0 0; }
.wk-close {
  position: absolute; top: 14px; right: 18px; width: 24px; height: 24px;
  border: none; border-radius: var(--wk-r-ctl) !important; background: transparent; color: var(--wk-dim);
  font-size: 14px; opacity: .6; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.wk-close:hover { opacity: 1; }
.wk-body { padding: 16px 20px 20px; font-size: 12px; }

/* --- the address: the thing people actually verify --------------------- */
.wk-addr {
  font-family: var(--wk-mono); font-size: 12px; line-height: 1.6; word-break: break-all;
  background: var(--wk-sunken); border-radius: var(--wk-r-ctl) !important; padding: 10px 14px; margin: 0 0 10px;
}
/* Ends carry the weight; the middle recedes because nobody checks the middle.
   nowrap on the ends so a break can only fall in the middle, never through the
   characters being compared. */
.wk-addr b { font-weight: 600; color: var(--wk-ink); white-space: nowrap; }
.wk-addr span { color: var(--wk-faint); font-weight: 400; }
.wk-addr-row { display: flex; align-items: stretch; gap: 8px; }
.wk-addr-row .wk-addr { flex: 1; margin-bottom: 0; }
.wk-addr-row .wk-btn { height: auto; }

/* --- rows: the wallet list ----------------------------------------------- */
.wk-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; margin-bottom: 6px; cursor: pointer;
  background: var(--wk-sunken); border: 1px solid transparent; border-radius: var(--wk-r-ctl) !important;
  color: inherit; font: inherit;
  transition: background .12s ease, border-color .12s ease;
}
.wk-row:hover { background: var(--wk-raise); }
.wk-row[aria-current="true"] { border-color: var(--wk-line-mid); }
.wk-row-glyph {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: var(--wk-r-ctl) !important;
  display: grid; place-items: center; font-size: 13px;
  background: var(--wk-raise); color: var(--wk-ink);
}
.wk-row-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wk-row-label { font-size: 12px; font-weight: 500; color: var(--wk-ink); }
.wk-row-desc { font-family: var(--wk-mono); font-size: 11px; color: var(--wk-faint); }
.wk-row-trail { margin-left: auto; display: flex; align-items: center; gap: 8px; }
/* A state is a word, never a chip: "Encrypted" / "Not encrypted" in the muted
   ink, no fill, no amber. Both spellings say what is true; neither shouts. */
.wk-tag { font-size: 11px; font-weight: 400; color: var(--wk-faint); }

/* --- actions: one button family, 30px, r6 ------------------------------ */
.wk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  box-sizing: border-box; height: 30px; padding: 0 12px; border-radius: var(--wk-r-ctl) !important;
  font: inherit; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
  cursor: pointer; border: 0; background: var(--wk-raise); color: var(--wk-ink);
  transition: background-color .12s ease, color .12s ease;
}
.wk-btn:hover { background: var(--wk-raise-hi); color: var(--wk-ink); }
/* the one white button per surface, at the modal's full-width commit size */
.wk-btn-primary { height: 38px; font-size: 13px; font-weight: 600; background: var(--wk-primary); color: var(--wk-on-primary); }
.wk-btn-primary:hover { background: #FFFFFF; color: var(--wk-on-primary); }
/* a quiet text action: choose one of these, not do a thing */
.wk-btn-quiet { background: transparent; color: var(--wk-dim); justify-content: flex-start; padding: 0 8px; }
.wk-btn-quiet:hover { background: var(--wk-raise); color: var(--wk-ink); }
.wk-btn-icon { width: auto; flex: 0 0 auto; }
.wk-btn + .wk-btn { margin-top: 6px; }
.wk-input + .wk-btn, .wk-field-row + .wk-btn, .wk-check + .wk-btn { margin-top: 12px; }
.wk-btn:disabled { opacity: .45; cursor: default; }
.wk-btn:focus-visible, .wk-input:focus-visible, .wk-row:focus-visible, .wk-close:focus-visible {
  outline: 2px solid var(--wk-focus); outline-offset: 2px;
}

/* --- fields: sunken, no stroke, the sky ring ---------------------------- */
.wk-label { display: block; font-size: 11px; font-weight: 500; color: var(--wk-faint); margin: 12px 0 4px; }
.wk-input {
  width: 100%; box-sizing: border-box; padding: 10px 14px; border-radius: var(--wk-r-ctl) !important;
  font: inherit; font-size: 13px; line-height: 1.2;
  background: var(--wk-sunken); border: 0; color: var(--wk-ink);
}
.wk-input::placeholder { color: var(--wk-faint); }
.wk-input:focus { outline: 2px solid var(--wk-focus); outline-offset: 2px; }
.wk-input.is-bad { box-shadow: inset 0 0 0 1px var(--wk-danger); }
.wk-input-mono { font-family: var(--wk-mono); font-size: 12px; }
select.wk-input { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237E8A9C' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.wk-field-row { display: flex; gap: 8px; align-items: stretch; }
.wk-field-row .wk-input { flex: 1; }
.wk-field-row .wk-btn { height: auto; }

/* --- notes and state: one muted sentence -------------------------------- */
.wk-note { font-size: 12px; color: var(--wk-faint); line-height: 1.5; margin: 10px 0 0; }
.wk-status { font-size: 12px; margin-top: 10px; line-height: 1.5; word-break: break-word; color: var(--wk-dim); }
.wk-status:empty { display: none; }
.wk-status.is-bad { color: var(--wk-danger); }
.wk-status a { color: var(--wk-focus); }
.wk-divider { border: none; height: 1px; background: var(--wk-line); margin: 16px 0 12px; opacity: 1; }
.wk-divider-label { font-size: 12px; color: var(--wk-faint); margin: 0 0 6px; }
.wk-check { display: flex; gap: 10px; align-items: flex-start; font-size: 12px;
  color: var(--wk-dim); line-height: 1.5; margin: 12px 0; cursor: pointer; }
.wk-check input { margin-top: 2px; flex: 0 0 auto; accent-color: var(--wk-focus); width: 14px; height: 14px; }
.wk-empty { font-size: 12px; color: var(--wk-faint); padding: 20px 0; text-align: center; }
.wk-foot { text-align: center; font-size: 11px; color: var(--wk-faint); margin: 16px 0 0; }
.wk-chains { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.wk-chain { font-size: 11px; color: var(--wk-faint); background: var(--wk-sunken);
  padding: 3px 8px; border-radius: var(--wk-r-tag) !important; }

/* --- a wallet section inside a host dialog ------------------------------ */
.wk-in .wk-btn-quiet { width: auto; margin: 4px 0 0 -8px; }
.wk-in .wk-addr-row { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  .wk-row, .wk-btn { transition: none; }
}
@media (max-width: 420px) {
  .wk-head { padding: 14px 16px 0; }
  .wk-body { padding: 14px 16px 16px; }
}
