/* shadcn-style design tokens + components (vanilla CSS, no framework) */
:root {
  --background: #ffffff;
  --foreground: #0a0a0a;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --primary: #18181b;          /* near-black, like the Figma "Sign" buttons */
  --primary-foreground: #fafafa;
  --secondary: #f4f4f5;
  --secondary-foreground: #18181b;
  --accent: #f4f4f5;
  --radius: 10px;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --ring: #a1a1aa;
  --page-bg: #fafafa;
}

* { box-sizing: border-box; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--page-bg);
  color: var(--foreground);
  margin: 0;
  padding: 40px 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.shell { max-width: 540px; margin: 0 auto; }

/* ---- Card (modal-like) ---- */
.card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
  padding: 24px;
  margin-bottom: 16px;
}
.card-sm { padding: 16px 20px; }

.card-header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.card-title { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.card-desc { font-size: 13px; color: var(--muted-foreground); margin: 4px 0 0; }
.close-x {
  background: none; border: none; color: var(--muted-foreground); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.close-x:hover { background: var(--muted); }

.sep { height: 1px; background: var(--border); border: 0; margin: 16px 0; }

/* ---- Progress ---- */
.progress-row { display:flex; align-items:center; justify-content:space-between; margin: 16px 0 6px; }
.progress-label { font-size: 13px; font-weight: 500; }
.pill {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  background: var(--secondary); color: var(--secondary-foreground); border: 1px solid var(--border);
  font-weight: 500;
}
.progress-track { height: 8px; background: var(--muted); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); width: 0%; transition: width .25s ease; }
.helper { font-size: 12px; color: var(--muted-foreground); margin: 8px 0 4px; }

/* ---- Owner rows ---- */
.owner-list { margin-top: 8px; }
.owner-row {
  display:flex; align-items:center; gap:12px;
  padding: 14px 0; border-top: 1px solid var(--border);
}
.owner-row:first-child { border-top: 0; }
.wallet-ico {
  width: 32px; height: 32px; border-radius: 8px; background: var(--muted);
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0; align-self:flex-start;
}
.owner-main { flex: 1 1 auto; min-width: 0; }
.owner-addr { font-family: ui-monospace, "SF Mono", monospace; font-size: 13px; font-weight: 500;
              overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-name { font-size: 11px; color: var(--muted-foreground); margin-top: 1px; }
.owner-status { display:block; font-size: 11px; margin-top: 4px; }
/* push the action button to the right, vertically centered against the text block */
.owner-row .btn { margin-left: auto; align-self: center; flex-shrink: 0; }

/* ---- Buttons (shadcn-style) ---- */
.btn {
  font-size: 13px; font-weight: 500; padding: 8px 16px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .15s, opacity .15s;
}
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover:not(:disabled) { background: #2a2a2e; }
.btn-outline { background: var(--background); color: var(--secondary-foreground); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--muted); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ---- Status text ---- */
.ok { color: var(--green); }
.err { color: var(--red); }
.muted { color: var(--muted-foreground); }
code { font-family: ui-monospace, monospace; font-size: 12px; }

/* checkbox row */
.check-row { display:flex; align-items:center; gap:8px; font-size:12px; color: var(--muted-foreground); }
.check-row input { width: auto; }

/* output blocks */
.out {
  background: #0b0b0c; color: #e4e4e7; border-radius: 10px; padding: 12px 14px;
  font-family: ui-monospace, monospace; font-size: 12px;
  white-space: pre-wrap;          /* keep line breaks, but wrap long lines */
  word-break: break-all;          /* break long hex strings mid-token */
  overflow-wrap: anywhere;        /* belt-and-suspenders wrapping */
  margin: 6px 0 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  max-height: 280px; overflow: auto;
}
.out.ok  { color: #4ade80; }
.out.err { color: #f87171; }

/* prevent any child from widening the card (flex/grid min-content overflow guard) */
.card, .card-sm { min-width: 0; }

.toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom: 4px; }
.section-label { font-size: 12px; color: var(--muted-foreground); margin: 14px 0 4px; font-weight:500; }
