:root {
  --bg-darkest: #07080a;
  --bg-panel: #111318;
  --bg-card: rgba(22, 26, 34, 0.6);
  --border-glow: rgba(0, 243, 255, 0.15);
  --border-glow-heavy: rgba(0, 243, 255, 0.45);
  --cyan: #45f3ff;
  --violet: #8a2be2;
  --emerald: #00ff88;
  --danger: #ff3b30;
  --warning: #ffb300;
  --text-muted: #718096;
  --text-normal: #cbd5e0;
  --text-bright: #ffffff;
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 243, 255, 0.05);
}

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

body {
  background: radial-gradient(circle at 50% 50%, #151a24 0%, var(--bg-darkest) 100%);
  color: var(--text-normal);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

.workspace-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 450px);
  gap: 2.5rem;
  padding: 2rem;
  align-items: flex-start;
  max-width: 1000px;
  width: 100%;
}

/* ==========================================================================
   EXTENSION CONTAINER (WIZZ/BITPOCKET)
   ========================================================================== */
.wallet-extension-container {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 28px;
  width: 100%;
  max-width: 380px;
  height: 640px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--box-shadow);
  position: relative;
}

.wallet-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(11, 12, 16, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  z-index: 20;
}

.header-logo {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.5px;
}

.logo-beta {
  font-size: 0.65rem;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #000;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 2px;
}

.network-selector-wrapper select {
  background: #1e222b;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  color: var(--text-normal);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.network-selector-wrapper select:focus {
  border-color: var(--cyan);
}

/* Viewport & View Panels */
.wallet-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.wallet-view {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 18px;
  background: var(--bg-panel);
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.wallet-view.active {
  display: flex;
}

/* ==========================================================================
   VIEW 1: ONBOARDING Welcome Screen
   ========================================================================== */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  height: 100%;
}

.logo-glow {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: float-logo 4s ease-in-out infinite;
  text-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

.welcome-screen h2 {
  font-size: 1.4rem;
  color: var(--text-bright);
  margin-bottom: 6px;
}

.subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 2rem;
  padding: 0 10px;
}

.onboarding-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.or-separator {
  display: flex;
  align-items: center;
  color: #3b4252;
  font-size: 0.7rem;
  font-weight: 700;
  margin: 6px 0;
}

.or-separator::before, .or-separator::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.or-separator span {
  padding: 0 10px;
}

.onboarding-form textarea {
  background: #171b22;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  color: var(--text-bright);
  padding: 12px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}

.onboarding-form textarea:focus {
  border-color: var(--cyan);
}

/* ==========================================================================
   VIEW 2: DASHBOARD (Home Page)
   ========================================================================== */
.account-card {
  background: linear-gradient(135deg, rgba(22, 26, 34, 0.8) 0%, rgba(11, 13, 18, 0.8) 100%);
  border: 1px solid rgba(0, 243, 255, 0.08);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 16px;
}

.account-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.account-name {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.address-pill {
  background: #1a1e28;
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.address-pill:hover {
  background: #232a38;
  border-color: rgba(69, 243, 255, 0.2);
}

.address-pill span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--cyan);
}

.address-pill .copy-icon {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.balance-display {
  display: flex;
  flex-direction: column;
}

.usd-balance {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-bright);
}

.btc-balance {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Navigation Grid */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 20px;
}

.shortcut-btn {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.shortcut-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1c212c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: all 0.25s;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.shortcut-btn span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-normal);
}

.shortcut-btn:hover .shortcut-icon {
  transform: translateY(-2px);
  background: #252c3b;
  box-shadow: 0 4px 12px rgba(0, 243, 255, 0.1);
  border-color: rgba(69, 243, 255, 0.2);
}

/* Asset Tabs & Token List */
.assets-tabs-container {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tab-selectors {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 12px;
  gap: 16px;
}

.tab-sel {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding-bottom: 8px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.tab-sel.active {
  color: var(--text-bright);
}

.tab-sel.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

.tab-pane {
  display: none;
  flex-direction: column;
  max-height: 275px;
  overflow-y: auto;
}

.tab-pane.active {
  display: flex;
}

.token-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.token-row {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.token-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(69, 243, 255, 0.1);
  transform: translateX(2px);
}

.token-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  margin-right: 10px;
}

.token-avatar.logo-btc {
  background: rgba(247, 147, 26, 0.12);
  color: #f7931a;
  border: 1px solid rgba(247, 147, 26, 0.2);
}

.token-avatar.logo-rgba {
  background: rgba(138, 43, 226, 0.12);
  color: #b066ff;
  border: 1px solid rgba(138, 43, 226, 0.2);
}

.token-avatar.logo-rgbb {
  background: rgba(0, 243, 255, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(0, 243, 255, 0.2);
}

.token-details {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.token-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-bright);
}

.token-subtitle {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 1px;
  max-width: 140px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.token-values {
  text-align: right;
  display: flex;
  flex-direction: column;
}

.token-amt {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-bright);
}

.token-usd {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* NFT Gallery tab */
.nft-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.nft-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
}

.nft-preview-box {
  width: 100%;
  height: 90px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.nft-preview-box.nft-genesis {
  background: linear-gradient(135deg, rgba(69, 243, 255, 0.1), rgba(138, 43, 226, 0.1));
  border: 1px solid rgba(69, 243, 255, 0.15);
}

.nft-preview-box.nft-cryptopunk {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(69, 243, 255, 0.1));
  border: 1px solid rgba(0, 255, 136, 0.15);
}

.nft-title {
  font-size: 0.75rem;
  color: var(--text-bright);
  font-weight: 600;
}

.nft-id {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 1px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* ==========================================================================
   VIEW 3 & 4: SEND / RECEIVE SHEETS
   ========================================================================== */
.view-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.back-btn {
  background: transparent;
  border: none;
  color: var(--text-bright);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 4px;
}

.view-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* RGB Invoice parser output card */
.invoice-parse-card {
  display: none; /* Hidden by default */
  background: rgba(69, 243, 255, 0.03);
  border: 1px solid rgba(69, 243, 255, 0.15);
  border-radius: 12px;
  padding: 10px 14px;
  animation: fadeIn 0.3s;
}

.card-glow-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 6px;
}

.parse-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.parse-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}

.parse-row span:first-child {
  color: var(--text-muted);
}

.highlight-cyan {
  color: var(--cyan);
  font-weight: 600;
}
.highlight-green {
  color: var(--emerald);
  font-weight: 600;
}
.mono-txt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 160px;
}

.pin-auth-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.pin-auth-container label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.pin-auth-container input {
  background: #171b22;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 8px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 4px;
  text-align: center;
  outline: none;
}
.pin-auth-container input:focus {
  border-color: var(--cyan);
}

/* Receive Sheet Tab Options */
.receive-tabs {
  display: flex;
  background: #171b22;
  border-radius: 10px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.receive-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
}

.receive-tab-btn.active {
  background: #252e3d;
  color: var(--cyan);
}

.receive-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.25s;
}
.receive-pane.active {
  display: flex;
}

.address-qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 0;
}

.mock-qr {
  width: 140px;
  height: 140px;
  background: #fff;
  color: #000;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
  margin-bottom: 10px;
  border: 5px solid #fff;
}

.qr-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.address-details-box {
  background: var(--bg-card);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.addr-title {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.copy-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copy-field .mono-txt {
  max-width: 250px;
  color: var(--cyan);
}

.copy-btn-small {
  background: #252e3d;
  border: none;
  color: var(--text-bright);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.copy-btn-small:hover {
  background: #2e3b4e;
}

/* RGB Invoice Generator output result */
.invoice-result-card {
  display: none;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 12px;
  border-radius: 12px;
  animation: fadeIn 0.3s;
}

.invoice-result-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.invoice-result-card textarea {
  background: #0f1218;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: var(--emerald);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 8px;
  resize: none;
  outline: none;
}

/* ==========================================================================
   VIEW 5 & 6: ACTIVITY & SETTINGS
   ========================================================================== */
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.tx-info {
  display: flex;
  flex-direction: column;
}

.tx-meta {
  color: var(--text-bright);
  font-size: 0.78rem;
  font-weight: 600;
}

.tx-details {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 2px;
  max-width: 180px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.tx-amount {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}

.tx-amount.in { color: var(--emerald); }
.tx-amount.out { color: #ff5252; }

.no-activity {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 3.5rem;
}

/* Settings Items */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.settings-item-meta {
  display: flex;
  flex-direction: column;
}

.settings-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-bright);
}

.settings-item-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.settings-item-desc.text-danger {
  color: var(--danger);
}

.seed-reveal-box {
  display: none;
  background: #0f1218;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  animation: fadeIn 0.3s;
}

.seed-reveal-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.seed-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--warning);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ==========================================================================
   VIEW 7: JS BRIDGE REQUEST SHEET MODAL
   ========================================================================== */
.wallet-sheet {
  position: absolute;
  bottom: -100%;
  left: 0;
  width: 100%;
  height: 82%;
  background: #14171e;
  border-top: 2px solid var(--cyan);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: bottom 0.35s cubic-bezier(0.32, 0.94, 0.6, 1);
  box-shadow: 0 -10px 30px rgba(0, 243, 255, 0.12);
}

.wallet-sheet.active {
  bottom: 0;
}

.sheet-header {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-header.bg-glow {
  background: linear-gradient(180deg, rgba(69, 243, 255, 0.04) 0%, transparent 100%);
}

.sheet-header h3 {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 700;
}

.sheet-body {
  padding: 14px 18px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dapp-origin-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 12px;
}

.dapp-icon {
  font-size: 1.2rem;
}

.dapp-meta {
  display: flex;
  flex-direction: column;
}

.dapp-url {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

.dapp-security-status {
  font-size: 0.6rem;
  color: var(--emerald);
}

.auth-message-card {
  background: #1a1e26;
  border: 1px solid rgba(0, 243, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
}

.auth-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.action-badge-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  background: rgba(69, 243, 255, 0.1);
  color: var(--cyan);
  border-radius: 10px;
  border: 1px solid rgba(69, 243, 255, 0.2);
}

.category-badge-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.auth-fields-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-raw-details {
  background: #0b0c10;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.auth-raw-details summary {
  padding: 6px 10px;
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.auth-raw-details pre {
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  overflow-x: auto;
  white-space: pre-wrap;
  color: var(--text-normal);
  border-top: 1px solid rgba(255, 255, 255, 0.02);
  max-height: 80px;
}

.auth-pin-entry {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-pin-entry label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.auth-pin-entry input {
  background: #0f1218;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 8px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 4px;
  text-align: center;
  outline: none;
}

.auth-sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.auth-sheet-actions button {
  flex: 1;
}

/* ==========================================================================
   DEVELOPER MONITOR BRIDGE LOGS PANEL
   ========================================================================== */
.bridge-diagnostic-panel {
  background: rgba(11, 13, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  width: 100%;
  max-width: 450px;
  height: 640px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.diagnostic-header {
  padding: 14px 18px;
  background: rgba(11, 13, 18, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.diagnostic-header h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-bright);
}

.diagnostic-console {
  flex: 1;
  padding: 16px;
  background: #050608;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  overflow-y: auto;
  line-height: 1.55;
}

.diag-line {
  margin-bottom: 8px;
  word-break: break-all;
}

.diag-line.system { color: #5c6c80; }
.diag-line.incoming { color: var(--cyan); }
.diag-line.approval { color: var(--warning); }
.diag-line.success { color: var(--emerald); }
.diag-line.error { color: var(--danger); }

/* ==========================================================================
   BUTTONS AND GENERAL UTILITIES
   ========================================================================== */
.btn {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan) 0%, #30a3ff 100%);
  color: #0b0c10;
  box-shadow: 0 4px 14px rgba(69, 243, 255, 0.15);
}
.btn-primary:hover {
  box-shadow: 0 4px 18px rgba(69, 243, 255, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #252b36;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.btn-secondary:hover {
  background: #2e3542;
}

.btn-outline {
  background: transparent;
  color: var(--cyan);
  border: 1px solid rgba(69, 243, 255, 0.25);
}
.btn-outline:hover {
  background: rgba(69, 243, 255, 0.05);
  border-color: var(--cyan);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-success {
  background: var(--emerald);
  color: #000;
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.15);
}
.btn-success:hover {
  box-shadow: 0 4px 16px rgba(0, 255, 136, 0.35);
}

.btn-block {
  width: 100%;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.68rem;
  border-radius: 6px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.form-group select, .form-group input {
  background: #171b22;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group select:focus, .form-group input:focus {
  border-color: var(--cyan);
}

/* Animations */
@keyframes slideIn {
  from { opacity: 0; transform: translateX(15px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes float-logo {
  0% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0); }
}

/* ==========================================================================
   DAPP BROWSER SANDBOX PANEL
   ========================================================================== */
.dapp-browser-sandbox {
  background: rgba(11, 13, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  height: 640px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.browser-header-bar {
  padding: 14px 18px;
  background: rgba(11, 13, 18, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.browser-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.browser-icon {
  font-size: 1rem;
}

.browser-title-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-bright);
}

.browser-status-badge {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.15);
  color: var(--cyan);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-address-bar {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  display: flex;
  gap: 8px;
  align-items: center;
}

.browser-url-field {
  flex: 1;
  background: #0f1218;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.75rem;
  color: var(--text-normal);
  font-family: var(--font-mono);
  outline: none;
  transition: all 0.2s;
}

.browser-url-field:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.1);
  color: var(--text-bright);
}

.browser-go-btn {
  background: var(--cyan);
  border: none;
  color: #000;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.browser-go-btn:hover {
  background: #00b8cc;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.browser-quick-links {
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  display: flex;
  gap: 6px;
}

.quick-link-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-link-btn:hover {
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-normal);
}

.quick-link-btn.active {
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.2);
  color: var(--cyan);
  font-weight: 600;
}

.browser-viewport {
  flex: 1;
  position: relative;
  background: #000;
}

#browser-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #07090e;
}

@media (max-width: 860px) {
  .workspace-wrapper {
    grid-template-columns: 1fr;
    align-items: center;
    padding: 1rem 0.5rem;
    gap: 1.5rem;
  }
  .bridge-diagnostic-panel {
    max-width: 380px;
    height: 350px;
  }
}

/* In-App DApp Browser View overrides */
#view-browser {
  padding: 0;
  overflow: hidden;
}

/* ==========================================================================
   CUSTOM DIALOG SYSTEM (OVERLAY & BOX)
   ========================================================================== */
.custom-dialog-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 8, 10, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 20px;
  border-radius: 28px; /* match container rounding */
}

.custom-dialog-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.custom-dialog-box {
  background: #121620;
  border: 1px solid rgba(0, 243, 255, 0.2);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 243, 255, 0.1);
  border-radius: 20px;
  width: 100%;
  max-width: 310px;
  padding: 20px;
  text-align: center;
  transform: scale(0.85);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.custom-dialog-overlay.active .custom-dialog-box {
  transform: scale(1);
}

.custom-dialog-icon {
  font-size: 2.2rem;
  margin-bottom: 2px;
}

.custom-dialog-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
}

.custom-dialog-message {
  font-size: 0.76rem;
  color: var(--text-normal);
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-line;
}

.custom-dialog-input-wrapper {
  margin: 4px 0;
}

.custom-dialog-pin-input {
  text-align: center;
  font-size: 1.2rem;
  letter-spacing: 0.5em;
  width: 100%;
  padding: 10px;
  background: #0b0c10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
  -webkit-text-security: disc;
}

.custom-dialog-pin-input:focus {
  border-color: var(--cyan);
}

.custom-dialog-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.custom-dialog-actions button {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.custom-dialog-actions .btn-primary {
  background: var(--cyan);
  color: #000;
}

.custom-dialog-actions .btn-primary:hover {
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

.custom-dialog-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-normal);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.custom-dialog-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

