:root {
  --bg-base: #0a0a0a;
  --bg-surface: #0d0d0d;
  --bg-card: #151515;
  --bg-hover: #1a1a1a;
  --border-subtle: #1a1a1a;
  --border-default: #2a2a2a;
  --border-strong: #333;
  --text-primary: #e2e8f0;
  --text-secondary: #888;
  --text-muted: #666;
  --color-green: #4ade80;
  --color-red: #f87171;
  --color-orange: #f59e0b;
  --color-blue: #60a5fa;
  --color-purple: #a78bfa;
  --color-accent: #10b981;
  --font-mono: 'SF Mono', 'Cascadia Code', monospace;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: #b0b0b0;
}

.panel-section {
  background: #151515;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.sc-net-status-card {
  flex: 1;
  min-width: 200px;
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 0.75rem;
}

button {
  background: #1a6b3c;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
}

button:hover {
  background: #1f8148;
}

button:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
}

input,
textarea,
select {
  background: #1a1a1a;
  color: #e0e0e0;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0.5rem;
  width: 100%;
  font-family: monospace;
  font-size: 0.8rem;
}

select {
  width: auto;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 3rem;
}

.row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.output {
  background: #0d0d0d;
  border: 1px solid #222;
  border-radius: 4px;
  padding: 0.75rem;
  margin-top: 0.75rem;
  font-family: monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 2rem;
}

.label {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 0.25rem;
}

.pass {
  color: #4ade80;
}

.fail {
  color: #f87171;
}

#loading {
  text-align: center;
  padding: 2rem;
  color: #888;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#app {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.info-tip {
  position: relative;
  cursor: help;
  color: #666;
  font-size: 0.75rem;
}

.info-tip:hover {
  color: #999;
}

.info-tip .info-tip-text {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #e0e0e0;
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 0.5rem 0.65rem;
  border-radius: 4px;
  border: 1px solid #444;
  width: 220px;
  white-space: normal;
  z-index: 100;
  pointer-events: none;
}

.info-tip:hover .info-tip-text {
  display: block;
}

.net-bar .info-tip .info-tip-text {
  position: fixed;
  bottom: auto;
  top: auto;
  left: auto;
  transform: none;
  z-index: 1000;
}
.sc-net-status-card .info-tip .info-tip-text {
  left: 0;
  transform: none;
}

.dropzone {
  border: 2px dashed #333;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  color: #666;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: #1a6b3c;
  color: #4ade80;
}

.dropzone .file-info {
  color: #e0e0e0;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

hr {
  border: none;
  border-top: 1px solid #2a2a2a;
  margin: 1rem 0;
}

progress {
  width: 100%;
  height: 8px;
  appearance: none;
  border: none;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

progress::-webkit-progress-bar {
  background: #1a1a1a;
  border-radius: 4px;
}

progress::-webkit-progress-value {
  background: #1a6b3c;
  border-radius: 4px;
}

progress::-moz-progress-bar {
  background: #1a6b3c;
  border-radius: 4px;
}

/* Browser Chrome Bar */
#browser-chrome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #111;
  border-bottom: 1px solid #222;
  flex-shrink: 0;
  position: relative;
}

#gear-btn {
  background: none;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0.4rem 0.5rem;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}
#gear-btn:hover { color: #e0e0e0; border-color: #555; background: #1a1a1a; }

.nav-btn {
  background: none;
  border: none;
  color: #777;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.3rem 0.35rem;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 3px;
}
.nav-btn:hover:not(:disabled) { color: #e0e0e0; background: #1a1a1a; }
.nav-btn:disabled { color: #555; cursor: default; opacity: 0.5; }

#gear-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0.75rem;
  z-index: 1000;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  min-width: 220px;
  padding: 0.5rem 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.gear-menu-header {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.gear-menu-sep {
  border: none;
  border-top: 1px solid #2a2a2a;
  margin: 0.25rem 0;
}
.gear-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 1rem;
  background: none;
  border: none;
  color: #ccc;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}
.gear-menu-item:hover { background: #252525; color: #fff; }
.gear-menu-item.active { background: #1a3a2a; color: #4ade80; }
.gear-menu-item:disabled { color: #555; cursor: not-allowed; }
.gear-menu-item:disabled:hover { background: none; }
.gear-menu-icon { width: 1.2em; text-align: center; flex-shrink: 0; }

#chrome-address-bar {
  flex: 1;
  width: auto;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0.45rem 0.6rem;
  font-family: monospace;
  font-size: 0.8rem;
  color: #ddd;
  min-width: 0;
}
#chrome-address-bar:focus { outline: none; border-color: #10b981; background: #222; }

#btn-go {
  background: #10b981;
  border: none;
  color: #fff;
  font-weight: bold;
  padding: 0.45rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  flex-shrink: 0;
}
#btn-go:hover { background: #059669; }

#btn-external-tab {
  background: #f59e0b;
  border: none;
  color: #fff;
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
#btn-external-tab:hover { background: #d97706; }

/* Viewport */
#viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #0a0a0a;
  min-height: 0;
}
.viewport-panel {
  display: none;
  position: absolute;
  inset: 0;
}
.internal-page {
  overflow-y: auto;
  padding: 2rem;
}
.internal-page-content {
  max-width: 800px;
  margin: 0 auto;
}

/* Tab Bar */
#tab-bar {
  display: flex;
  align-items: stretch;
  background: #0d0d0d;
  border-bottom: 1px solid #222;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 30px;
  scrollbar-width: none;
}
#tab-bar::-webkit-scrollbar { display: none; }
#tab-list {
  display: flex;
  align-items: stretch;
  min-width: 0;
}
.tab {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.4rem 0.25rem 0.7rem;
  background: #111;
  border-right: 1px solid #1a1a1a;
  cursor: pointer;
  white-space: nowrap;
  max-width: 180px;
  min-width: 40px;
  font-size: 0.72rem;
  color: #777;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  flex-shrink: 0;
}
.tab:hover { background: #1a1a1a; color: #ccc; }
.tab.active {
  background: #0a0a0a;
  color: #e0e0e0;
  border-bottom: 2px solid #10b981;
}
.tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.tab-close {
  background: none;
  border: none;
  color: #555;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0 0.15rem;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 3px;
}
.tab-close:hover { color: #ef4444; background: rgba(239,68,68,0.15); }
.tab.dragging { opacity: 0.4; }
.tab.drag-over { border-left: 2px solid #10b981; }
#tab-new {
  background: none;
  border: none;
  border-right: 1px solid #1a1a1a;
  color: #555;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.7rem;
  flex-shrink: 0;
}
#tab-new:hover { color: #10b981; background: #1a1a1a; }

/* Panels with network bar: flex column, bar stays fixed, content scrolls */
.internal-page.has-net-bar {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.internal-page.has-net-bar > .internal-page-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* Network Status Bar — inside scroll container, flush to top/sides */
.net-bar {
  margin: -2rem -2rem 1rem -2rem;
  padding: 0.3rem 0.75rem;
  background: #111;
  border-bottom: 1px solid #222;
  font-size: 0.75rem;
  color: #888;
  font-family: monospace;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  overflow: visible;
}
.net-bar .nb-dot { font-size: 10px; color: #555; }
.net-bar .nb-name { font-weight: 600; color: #ccc; }
.net-bar .nb-state { color: #888; }
.net-bar .nb-phase { color: #888; }
.net-bar .nb-relay { color: #666; }
.nb-idx { display: inline-flex; align-items: center; gap: 2px; }
.nb-sep {
  width: 1px;
  height: 12px;
  background: #333;
  flex-shrink: 0;
}

/* Status Bar */
#status-bar {
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  background: #111;
  border-top: 1px solid #222;
  font-size: 0.75rem;
  color: #666;
  font-family: monospace;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
#status-bar .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
}
#status-bar .status-dot.connected { background: #4ade80; }

/* History items (used in history panel) */
.history-item {
  font-size: 0.75rem;
  padding: 0.4rem;
  margin-bottom: 0.25rem;
  background: #151515;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.history-item:hover {
  background: #1a1a1a;
}

.history-item.active {
  background: #1a6b3c;
  border-color: #1f8148;
}

.history-item.downloaded {
  background: #0d3d20;
  border-color: #1a6b3c;
}

.history-item.downloaded:hover {
  background: #114d28;
}

.history-item.active.downloaded {
  background: #1a6b3c;
  border-color: #1f8148;
}

.history-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  cursor: pointer;
}

.history-delete {
  flex-shrink: 0;
}

/* Video-player controls: visible on hover or when paused. CSS :hover
   tracks the real pointer position so the UI comes back as soon as the
   mouse is inside, without needing JS mouseenter/leave bookkeeping. */
#video-container:hover #video-controls,
#video-container[data-paused="true"] #video-controls {
  opacity: 1 !important;
}

/* Browser progress bar (thin) */
#browser-progress {
  width: 100%;
  height: 3px;
  flex-shrink: 0;
  display: none;
  margin: 0;
}
#browser-progress::-webkit-progress-bar { background: #0a0a0a; border-radius: 0; }
#browser-progress::-webkit-progress-value { background: #10b981; border-radius: 0; }
#browser-progress::-moz-progress-bar { background: #10b981; border-radius: 0; }

/* Volume slider: custom styling so thumb visually spans the full track.
   The input is widened by thumb-width (12px) with negative margins so the
   thumb center can reach both edges of the visible 80px track. */
.vc-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 92px;
  height: 20px;
  background: transparent;
  outline: none;
  cursor: pointer;
  margin: 0 -2px;
}
.vc-vol-slider::-webkit-slider-runnable-track {
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 9999px;
}
.vc-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  cursor: pointer;
  margin-top: -4px;
}
.vc-vol-slider::-moz-range-track {
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 9999px;
}
.vc-vol-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  border: none;
  cursor: pointer;
}

/* Seek bar */
#vc-seekbar {
  flex: 1;
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}
#vc-seek-track {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  position: relative;
  overflow: visible;
  transition: height 0.15s;
}
#vc-seekbar:hover #vc-seek-track {
  height: 6px;
}
#vc-seek-buffered {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  width: 0%;
}
#vc-seek-played {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: #10b981;
  border-radius: 2px;
  width: 0%;
}
#vc-seek-thumb {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  transform: translate(-50%, -50%);
  left: 0%;
  opacity: 0;
  transition: opacity 0.15s;
}
#vc-seekbar:hover #vc-seek-thumb {
  opacity: 1;
}

/* Registration Wizard */
.wizard-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 0;
}
.wizard-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.wizard-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #333;
  transition: background 0.2s;
}
.wizard-dot.active {
  background: #10b981;
}
.wizard-dot.completed {
  background: #1a6b3c;
}
.wizard-step {
  display: none;
}
.wizard-step.active {
  display: block;
}
.wizard-back {
  background: none;
  border: none;
  color: #888;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.wizard-back::before {
  content: '\2190';
}
.wizard-back:hover {
  color: #e0e0e0;
}
.wizard-heading {
  font-size: 1.5rem;
  color: #e0e0e0;
  margin-bottom: 0.5rem;
}
.wizard-subtext {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.wizard-field {
  margin-bottom: 1rem;
}
.wizard-field .label {
  margin-bottom: 0.35rem;
}
.wizard-btn {
  background: #10b981;
  color: #fff;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.5rem;
}
.wizard-btn:hover {
  background: #059669;
}
.wizard-btn:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
}
.wizard-btn-secondary {
  background: #2a2a2a;
  color: #ccc;
  border: 1px solid #444;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}
.wizard-btn-secondary:hover {
  background: #333;
  color: #fff;
}
.wizard-status {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #0d0d0d;
  border: 1px solid #222;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
}
.wizard-status:empty {
  display: none;
}
.wizard-link {
  color: #60a5fa;
  word-break: break-all;
}
.wizard-success {
  text-align: center;
  padding: 1rem 0;
}
.wizard-success .wizard-heading {
  color: #4ade80;
}
.wizard-key-display {
  background: #0d0d0d;
  border: 1px solid #222;
  border-radius: 4px;
  padding: 0.75rem;
  font-family: monospace;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 1rem 0;
  text-align: left;
  line-height: 1.6;
}

/* Explorer panel */
#exp-utxo-body tr:hover td {
  background: #1a1a1a;
}

/* Wallet panel */
.wallet-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  border: 1px solid;
  transition: border-color 0.3s, color 0.3s;
}
.wallet-locked {
  border-color: #f87171;
  color: #f87171;
}
.wallet-unlocked {
  border-color: #4ade80;
  color: #4ade80;
}
#wallet-addresses table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
#wallet-addresses th {
  padding: 6px 8px;
  text-align: left;
  color: #888;
  background: #151515;
  position: sticky;
  top: 0;
}
#wallet-addresses td {
  padding: 6px 8px;
  border-top: 1px solid #1a1a1a;
  word-break: break-all;
}
#wallet-addresses tr:hover td {
  background: #1a1a1a;
}
#wallet-addresses .addr-link {
  color: #4ade80;
  cursor: pointer;
  text-decoration: none;
}
#wallet-addresses .addr-link:hover {
  text-decoration: underline;
}
/* --- Network Selector --- */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.section-header h2 {
  margin: 0;
}

.net-selector {
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #333;
  flex-shrink: 0;
}

.net-sel-btn {
  background: #1a1a1a;
  color: #888;
  border: none;
  border-right: 1px solid #333;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
  border-radius: 0;
  line-height: 1.2;
}

.net-sel-btn:last-child {
  border-right: none;
}

.net-sel-btn:hover {
  background: #252525;
  color: #ccc;
}

.net-sel-btn.active {
  background: #1a3a2a;
  color: #4ade80;
}

.net-sel-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* === Block Explorer Components === */

.block-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.block-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.block-card-title {
  font-size: 1.4rem;
  color: var(--text-primary);
  font-weight: 700;
}
.block-card-subtitle {
  color: var(--color-green);
  font-size: 0.85rem;
  font-weight: 600;
}
.block-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.block-card-hash {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

/* Transaction Card */
.txn-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  overflow: hidden;
  transition: border-color 0.2s;
}
.txn-card:hover { border-color: var(--border-strong); }
.txn-card.highlight { border-color: var(--color-accent); }

.txn-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  user-select: none;
}
.txn-card-header:hover { background: var(--bg-hover); }

.txn-card-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.txn-card-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.txn-type-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-transfer { background: var(--color-orange); }
.dot-contract { background: var(--color-green); }
.dot-resolution { background: var(--color-blue); }
.dot-attestation { background: var(--color-purple); }
.dot-miner { background: var(--color-orange); }

.txn-txid {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-right: 0.5rem;
}
.txn-txid:hover {
  color: var(--color-blue);
}
.txn-type-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.txn-summary {
  padding: 0 0.85rem 0.6rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.txn-body {
  display: none;
  padding: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}
.txn-card.expanded .txn-body { display: block; }

.txn-chevron {
  transition: transform 0.2s;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.txn-card.expanded .txn-chevron { transform: rotate(90deg); }

/* Flow diagram (for file contracts) */
.flow-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.85rem;
  align-items: start;
  margin-bottom: 1rem;
}
.flow-column {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.flow-item {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
}
.flow-center {
  padding: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 0.78rem;
  min-width: 180px;
}
.flow-center-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.flow-center-row {
  color: var(--text-secondary);
  padding: 2px 0;
}

/* Contract detail panel */
.contract-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-top: 0.75rem;
}
.contract-box-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}
.contract-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.contract-party {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.contract-party-header {
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
}
.contract-party-body {
  padding: 0.5rem 0.65rem;
  font-size: 0.72rem;
}
.contract-party-body div {
  padding: 2px 0;
  color: var(--text-secondary);
}
.contract-party-body span {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}
.contract-footer {
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* IO grid (inputs/outputs for transfers) */
.io-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.io-column-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.io-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  border-bottom: 1px solid var(--border-subtle);
}
.io-item:last-child { border-bottom: none; }
.io-addr {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  cursor: pointer;
}
.io-addr:hover { color: var(--color-green); }
.io-val { color: var(--text-primary); white-space: nowrap; }
.io-val.positive { color: var(--color-green); }
.io-val.negative { color: var(--color-red); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 600;
}
.badge-green { background: rgba(74,222,128,0.1); color: var(--color-green); border: 1px solid rgba(74,222,128,0.25); }
.badge-red { background: rgba(248,113,113,0.1); color: var(--color-red); border: 1px solid rgba(248,113,113,0.25); }
.badge-orange { background: rgba(245,158,11,0.1); color: var(--color-orange); border: 1px solid rgba(245,158,11,0.25); }
.badge-blue { background: rgba(96,165,250,0.1); color: var(--color-blue); border: 1px solid rgba(96,165,250,0.25); }
.badge-purple { background: rgba(167,139,250,0.1); color: var(--color-purple); border: 1px solid rgba(167,139,250,0.25); }

/* Detail key-value grid */
.detail-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 0.85rem;
  font-size: 0.75rem;
}
.detail-label { color: var(--text-secondary); white-space: nowrap; }
.detail-value { color: var(--text-primary); word-break: break-all; font-family: var(--font-mono); font-size: 0.7rem; }

/* Transaction Builder — UTXO selection */
.txb-utxo-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}
.txb-utxo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}
.txb-utxo-item:last-child { border-bottom: none; }
.txb-utxo-item:hover { background: var(--bg-hover); }
.txb-utxo-item.selected {
  background: rgba(16, 185, 129, 0.08);
  border-left-color: var(--color-accent);
}
.txb-utxo-item .utxo-left { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.txb-utxo-item .utxo-addr {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.txb-utxo-item .utxo-idx { color: var(--color-blue); font-size: 0.72rem; white-space: nowrap; }
.txb-utxo-item .utxo-val { color: var(--color-green); white-space: nowrap; font-weight: 600; }
.txb-utxo-item .utxo-meta { color: var(--text-muted); font-size: 0.68rem; white-space: nowrap; margin-left: 0.5rem; }

/* Transaction Builder — output rows */
.txb-output-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.txb-output-row input[type="text"] { flex: 1; }
.txb-output-row .txb-output-amount { width: 140px; flex: none; }
