* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  color-scheme: light;
  --bg: #fff;
  --card: #fff;
  --text: #000;
  --muted: #444;
  --line: #000;
  --primary: #000;
  --danger: #000;
  --accent: #000;
  --ok: #000;
  --disabled: #777;
}
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.5;
}
header, main {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 18px 16px;
}
header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
header > div { min-width: 0; }
header a { flex: 0 0 auto; }
a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
h2, p { margin: 0; }
h2 { font-size: 1.08rem; }
code, textarea, .address-box { font-family: inherit; }
button, input, select, textarea { font: inherit; }
button, a.button {
  min-height: 44px;
  padding: 10px 14px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
button.primary, a.button.primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
button.danger { color: var(--danger); }
button:disabled { color: var(--disabled); background: #eee; border-style: dotted; cursor: default; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
}
textarea {
  min-height: 96px;
  resize: vertical;
  overflow-wrap: anywhere;
}
button:focus, a.button:focus, input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--line);
  outline-offset: 2px;
}
.ascii-title {
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.05;
}
.brand-subtitle, .hint, .footer { color: var(--muted); }
.notice {
  margin-bottom: 14px;
  padding: 12px;
  color: var(--text);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 0;
}
.tldr-details { border: 1px dashed var(--line); }
.tldr-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.tldr-body ol { margin: 0; padding-left: 1.25rem; }
.tldr-body li + li { margin-top: 6px; }
.app-shell { display: flex; flex-direction: column; gap: 14px; }
.panel {
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
}
.panel-header + .panel-body { margin-top: 16px; }
.payment-panel > .panel-header { margin-top: 16px; }
.payment-panel > .advanced-body,
.payment-panel > .payment-card { margin-top: 16px; }
.lede { margin-top: 8px; color: var(--muted); }
.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
}
.status-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--card);
}
body[data-phase="waiting_for_deposit"] .status-dot,
body[data-phase="building_sweep"] .status-dot,
body[data-phase="broadcasting_sweep"] .status-dot,
body[data-phase="sweep_broadcast"] .status-dot { background: var(--accent); }
body[data-phase="confirmed"] .status-dot { background: var(--ok); }
body[data-phase="failed"] .status-dot { background: var(--danger); }
.form-row, .payment-card, .payment-instructions, .advanced-body, .section-stack {
  display: grid;
  gap: 10px;
}
label { font-weight: 700; }
.actions, .recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.actions > *, .recovery-actions > * { flex: 1 1 150px; }
.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  margin-bottom: 16px;
}
.stage {
  min-width: 0;
}
.step {
  height: 6px;
  overflow: hidden;
  color: transparent;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
}
.step.done { background: var(--ok); }
.step.current { background: var(--accent); }
.step.failed { background: repeating-linear-gradient(45deg, #000 0 2px, #fff 2px 4px); }
.stage-label {
  display: block;
  margin-top: 7px;
  font-weight: 700;
  line-height: 1.25;
}
.stage-note {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.qr-wrap {
  display: grid;
  place-items: center;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
}
#qr {
  display: grid;
  min-height: 256px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}
#qr img, #qr svg {
  display: block;
  width: 256px;
  max-width: 100%;
  height: auto;
}
.address-box {
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0;
  overflow-wrap: anywhere;
}
.recovery-panel {
  margin-top: 16px;
  padding: 14px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 0;
}
.recovery-note { margin-top: 6px; color: var(--muted); }
.inline-secret { margin-top: 10px; }
.fee-settings {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
details {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
summary { cursor: pointer; font-weight: 700; }
.fee-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.fee-controls select { width: auto; max-width: 100%; }
.fee-controls input { width: 10rem; max-width: 100%; }
.help-panel { margin-top: 14px; }
.help-panel > .advanced-body { margin-top: 10px; }
.help-panel ol { margin: 0; padding-left: 1.25rem; }
.help-panel li + li { margin-top: 6px; }
.details dl {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0;
}
.details dt { color: var(--muted); font-weight: 700; }
.details dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
body:not(.has-active-payment) .post-create { display: none; }
body.has-active-payment .payment-panel { order: -1; }
body.has-detected-payment .payment-instructions { display: none; }
body.has-active-payment #setup-copy,
body.has-active-payment .form-row,
body.has-active-payment .pre-create-only { display: none; }
@media (max-width: 560px) {
  header { display: block; }
  header a { display: inline-block; margin-top: 8px; }
  .ascii-title { font-size: 0.7rem; }
  main { padding-top: 6px; }
  .panel { padding: 14px; }
  .details dl { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions, .recovery-actions { display: grid; }
  .actions > *, .recovery-actions > * { width: 100%; }
  .footer { display: grid; }
}
