@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Colors - Crypto Security Utility Slate Theme */
  --bg-main: #0b0f17;       /* Very dark slate navy */
  --bg-card: #111823;       /* Slightly darker slate navy card */
  --bg-input: #1a202c;      /* Input background */
  --bg-panel: #070a0f;      /* Dark developer panel background */
  
  --border-color: #222d3d;  /* Clean charcoal border */
  --border-focus: #06b6d4;  /* Cyan focus */
  
  --primary: #06b6d4;        /* Cyan */
  --primary-hover: #0891b2;
  --primary-glow: rgba(6, 182, 212, 0.15);
  
  --secondary: #374151;      /* Charcoal secondary button bg */
  --accent-cyan: #06b6d4;    /* Cyan accent */
  --accent-emerald: #10b981; /* Emerald green accent */
  --accent-blue: #3b82f6;    /* Blue accent */
  
  --text-primary: #f3f4f6;   /* Off-white readable text */
  --text-secondary: #9ca3af; /* Gray secondary text */
  --text-muted: #6b7280;     /* Muted metadata text */
  
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 4px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Header Section */
header {
  text-align: center;
  margin-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.badge {
  font-size: 0.725rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

h1 {
  font-size: 2.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-weight: 400;
  line-height: 1.6;
}

/* Main Grid & Card */
.main-grid {
  display: flex;
  justify-content: center;
  margin-bottom: 4rem;
}

#generator-card {
  width: 100%;
  max-width: 1100px;
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

/* Segmented Control Word Count Picker */
.selector-group {
  margin-bottom: 1.75rem;
}

.label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.pill-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  width: fit-content;
}

.word-count-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.word-count-pill:hover {
  color: var(--text-primary);
}

.word-count-pill.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Security Notice Box */
.security-badge-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  font-size: 0.85rem;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.75rem;
}

.security-badge-container svg {
  flex-shrink: 0;
}

/* Primary Generate Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  color: #fff;
  width: 100%;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(6, 182, 212, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary.loading::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
}

.btn-secondary {
  background: var(--secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #4b5563;
  border-color: #4b5563;
}

.btn-success {
  background: var(--accent-emerald) !important;
  color: #fff !important;
  border-color: transparent !important;
}

.btn-danger {
  background: rgba(220, 38, 38, 0.1);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.3);
}

.btn-icon-only {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

/* Empty State Placeholders */
.empty-placeholder {
  text-align: center;
  padding: 4rem 2rem;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-placeholder svg {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-placeholder p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Generated Mnemonic Word Cards Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

@media(min-width: 540px) {
  .results-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media(min-width: 768px) {
  .results-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.word-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
  padding: 0.8rem 1.15rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  transition: all var(--transition-fast);
}

.word-card:hover {
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

.word-number {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: var(--text-muted);
  width: 28px;
  flex-shrink: 0;
  font-weight: 500;
}

.word-text {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* Actions Panel */
.actions-panel {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.actions-panel .btn {
  flex: 1 1 140px;
}

.clipboard-timer {
  font-size: 0.875rem;
  color: var(--accent-cyan);
  margin-top: 0.5rem;
  text-align: center;
  font-weight: 500;
}

/* Technical Details - Developer Panel format */
.tech-details {
  border-top: 1px solid var(--border-color);
  padding-top: 1.75rem;
}

.detail-row {
  margin-bottom: 1.25rem;
}

.detail-row:last-child {
  margin-bottom: 0;
}

.detail-label {
  display: block;
  font-size: 0.725rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  letter-spacing: 0.05em;
}

.detail-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--bg-panel);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--accent-cyan);
  word-break: break-all;
  border: 1px solid var(--border-color);
}

/* BIP44 Path Explorer Controls & Table */
.derivation-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 1.75rem;
  background: rgba(255, 255, 255, 0.01);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  align-items: flex-end;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.coin-select-item {
  flex: 2 1 340px;
}

.bip-select-item {
  flex: 1.2 1 220px;
}

.count-input-item {
  flex: 0 1 140px;
}

.btn-item {
  flex: 0 0 auto;
}

.field-value {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.9rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  height: 42px;
  width: 100%;
  transition: border-color var(--transition-fast);
}

.field-value:focus {
  border-color: var(--border-focus);
}

.control-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.control-select option {
  background-color: var(--bg-card);
  color: var(--text-primary);
}

.control-input {
  font-family: var(--font-mono) !important;
}

.control-btn {
  height: 42px;
  white-space: nowrap;
}

.derivation-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.1);
}

.derivation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.derivation-table th, .derivation-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.derivation-table th {
  background-color: rgba(0, 0, 0, 0.2);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.725rem;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.derivation-table tbody tr {
  transition: background-color var(--transition-fast);
}

.derivation-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.01);
}

.derivation-table tbody tr:last-child td {
  border-bottom: none;
}

.path-cell {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 500;
}

.address-cell {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  color: var(--text-primary);
  word-break: break-all;
}

.table-input-group {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  width: 100%;
}

.table-field-value {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.825rem;
  outline: none;
  width: 100%;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.table-field-value:not([type="password"]) {
  background: rgba(0, 0, 0, 0.15);
  border: 1px dashed var(--border-color);
}

.toggle-privkey-btn, .copy-field-btn {
  flex-shrink: 0;
}

/* SEO content details */
.seo-content {
  margin-top: 4rem;
  border-top: 1px solid var(--border-color);
  padding-top: 3.5rem;
}

.seo-article {
  max-width: 840px;
  margin: 0 auto;
}

.seo-article h2 {
  font-size: 1.35rem;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  border: none;
  padding: 0;
}

.seo-article p {
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.seo-article ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.seo-article li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.seo-article strong {
  color: var(--text-primary);
}

/* Footer Section */
footer {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  margin-top: 4.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.generator-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: flex-end;
}

.language-select-item {
  flex: 1 1 240px;
}

.word-count-item {
  flex: 1 1 360px;
}

/* Modal Popup Layouts */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 15, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  visibility: visible;
  transition: all var(--transition-normal);
}

.modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-content {
  width: 90%;
  max-width: 440px;
  padding: 2rem;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

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

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition-fast);
  line-height: 1;
}

.close-btn:hover {
  color: var(--text-primary);
}

.qr-security-warning {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #f87171;
  font-size: 0.8rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.qr-security-warning svg {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.qr-container-box {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 1.5rem;
  background: #fff;
  padding: 10px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.qr-container-box canvas {
  width: 100% !important;
  height: 100% !important;
}

.qr-blur-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(17, 24, 35, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
}

.qr-blur-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.qr-value-display {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-panel);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  word-break: break-all;
  text-align: center;
  border: 1px solid var(--border-color);
  max-height: 80px;
  overflow-y: auto;
}

/* Guide Page specific styles */
.back-link {
  align-self: flex-start;
  margin-bottom: 2rem;
  text-decoration: none;
  font-size: 0.9rem;
}

.guide-image {
  width: 100%;
  max-width: 680px;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin: 1.5rem auto 2.5rem;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.guide-step {
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2.5rem;
}

.guide-step:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.guide-step h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.step-num {
  background: var(--primary);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.guide-step p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.guide-step ul {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.guide-step li {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.security-warning-box {
  background: rgba(239, 68, 68, 0.04);
  border-left: 4px solid #ef4444;
  padding: 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 1.5rem;
}

.security-warning-box h4 {
  color: #f87171;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.security-warning-box p {
  margin-bottom: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* ============================================================
   MOBILE INTERFACE — Screens ≤ 767px
   App-like layout: sticky header + bottom nav + optimized cards
   ============================================================ */

@media (max-width: 767px) {

  /* --- Body & Root Overrides --- */
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
    overflow-x: hidden;
  }

  /* --- Mobile Top Bar --- */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(11, 15, 23, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.7rem 1rem;
    gap: 0.5rem;
  }

  .mobile-topbar-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-topbar-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.25);
    color: var(--accent-cyan);
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* --- Bottom Navigation Bar --- */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    background: rgba(7, 10, 15, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom));
    gap: 0;
  }

  .mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.45rem 0.25rem;
    cursor: pointer;
    transition: color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    min-height: 52px;
    border-radius: 10px;
  }

  .mobile-nav-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.75;
    flex-shrink: 0;
  }

  .mobile-nav-btn.active,
  .mobile-nav-btn:hover {
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.06);
  }

  .mobile-nav-btn.active svg {
    filter: drop-shadow(0 0 5px rgba(6, 182, 212, 0.45));
  }

  /* ============================
     CONTAINER & GENERAL LAYOUT
     ============================ */
  .container {
    padding: 0.85rem 0.85rem 1.5rem;
    max-width: 100%;
  }

  /* --- Header: Compact on mobile --- */
  header {
    margin-bottom: 1.25rem;
    text-align: center;
    padding: 0 0.25rem;
  }

  .header-badges {
    gap: 0.3rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .badge {
    font-size: 0.6rem;
    padding: 0.18rem 0.55rem;
  }

  h1 {
    font-size: 1.35rem;
    line-height: 1.25;
    margin-bottom: 0.45rem;
  }

  .subtitle {
    font-size: 0.82rem;
    line-height: 1.5;
  }

  /* --- Main Grid --- */
  .main-grid {
    margin-bottom: 2rem;
  }

  /* --- Glass Card --- */
  .glass-card {
    padding: 1.1rem 0.95rem;
    border-radius: 16px;
    border: 1px solid rgba(34, 45, 61, 0.9);
  }

  h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  /* ============================
     WORD COUNT PILL SELECTOR
     ============================ */
  .selector-group {
    margin-bottom: 1.25rem;
  }

  .pill-selector {
    width: 100%;
    display: flex;
    padding: 3px;
    gap: 2px;
    border-radius: 10px;
  }

  .word-count-pill {
    flex: 1;
    font-size: 0.72rem;
    padding: 0.6rem 0.2rem;
    text-align: center;
    border-radius: 7px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ============================
     SECURITY NOTICE
     ============================ */
  .security-badge-container {
    font-size: 0.75rem;
    padding: 0.7rem 0.85rem;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
    border-radius: 10px;
  }

  /* ============================
     GENERATE BUTTON
     ============================ */
  #generate-btn {
    font-size: 0.95rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    min-height: 50px;
  }

  /* ============================
     MNEMONIC WORD GRID — 3 column
     ============================ */
  .results-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.1rem;
  }

  .word-card {
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    gap: 0;
  }

  .word-number {
    font-size: 0.6rem;
    width: 18px;
    flex-shrink: 0;
  }

  .word-text {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* ============================
     ACTIONS PANEL — 2 column grid
     ============================ */
  .actions-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
  }

  .actions-panel .btn {
    width: 100%;
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
    justify-content: center;
    min-height: 44px;
    gap: 0.35rem;
  }

  /* Danger button spans full width */
  .actions-panel .btn-danger {
    grid-column: 1 / -1;
  }

  /* ============================
     TECHNICAL DETAILS
     ============================ */
  .tech-details {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
  }

  .detail-label {
    font-size: 0.65rem;
    margin-bottom: 0.3rem;
  }

  .detail-value {
    font-size: 0.72rem;
    padding: 0.55rem 0.75rem;
    word-break: break-all;
    line-height: 1.5;
  }

  /* ============================
     DERIVATION SECTION
     ============================ */
  .derivation-section {
    margin-top: 1.25rem !important;
    padding-top: 1.1rem !important;
  }

  .label {
    font-size: 0.68rem;
    margin-bottom: 0.6rem;
  }

  /* --- Derivation Controls: stacked --- */
  .derivation-controls {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.9rem;
    margin-top: 0.85rem;
    margin-bottom: 1rem;
    border-radius: 12px;
  }

  .control-item {
    width: 100%;
  }

  .coin-select-item,
  .bip-select-item,
  .count-input-item,
  .btn-item {
    flex: 1 1 100%;
  }

  .field-value {
    height: 44px;
    font-size: 0.875rem;
    border-radius: 10px;
  }

  .control-btn {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    font-size: 0.875rem;
  }

  .field-name {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
    display: block;
  }

  /* ============================
     DERIVATION TABLE → CARDS
     Transform table into stacked
     cards on mobile (CSS only)
     ============================ */

  /* Hide wrapper border/bg */
  .derivation-table-wrapper {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
  }

  /* Make table elements behave as blocks */
  .derivation-table,
  .derivation-table thead,
  .derivation-table tbody,
  .derivation-table tr,
  .derivation-table td,
  .derivation-table th {
    display: block;
    width: 100%;
  }

  /* Hide the table header row */
  .derivation-table thead {
    display: none;
  }

  /* Each table row = a card */
  .derivation-table tbody tr {
    background: rgba(17, 24, 35, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 0.6rem;
    padding: 0;
    overflow: hidden;
    transition: border-color var(--transition-fast);
  }

  .derivation-table tbody tr:hover {
    border-color: rgba(6, 182, 212, 0.25);
    background: rgba(17, 24, 35, 0.95);
  }

  /* Remove bottom border from last td */
  .derivation-table tbody tr td {
    border-bottom: 1px solid rgba(34, 45, 61, 0.6);
    padding: 0;
  }

  .derivation-table tbody tr td:last-child {
    border-bottom: none;
  }

  /* Each cell = a labeled row inside the card */
  .derivation-table td::before {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0.55rem 0.9rem 0;
    margin-bottom: 0.2rem;
  }

  /* Column labels via nth-child */
  .derivation-table td:nth-child(1)::before {
    content: "Derivation Path";
    color: var(--accent-cyan);
  }

  .derivation-table td:nth-child(2)::before {
    content: "Address";
  }

  .derivation-table td:nth-child(3)::before {
    content: "Private Key (WIF / Hex)";
  }

  /* Path cell content */
  .path-cell {
    display: block;
    font-size: 0.78rem;
    padding: 0 0.9rem 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--accent-cyan);
  }

  /* Address cell content */
  .address-cell {
    display: block;
    font-size: 0.75rem;
    padding: 0 0.9rem 0.65rem;
    word-break: break-all;
    white-space: normal;
    line-height: 1.5;
    color: var(--text-primary);
  }

  /* Private key cell */
  .derivation-table td:nth-child(3) {
    padding-bottom: 0.65rem;
  }

  .table-input-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.75rem 0;
    min-width: 0;
    overflow: hidden;
  }

  .table-field-value {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    min-width: 0;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-mono);
  }

  .toggle-privkey-btn,
  .copy-field-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
  }

  /* ============================
     EMPTY STATE
     ============================ */
  .empty-placeholder {
    padding: 2rem 1rem;
    border-radius: 12px;
  }

  .empty-placeholder svg {
    width: 36px;
    height: 36px;
  }

  /* ============================
     SEO SECTION
     ============================ */
  .seo-content {
    margin-top: 2rem;
    padding-top: 1.75rem;
  }

  .seo-article h2 {
    font-size: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
  }

  .seo-article p,
  .seo-article li {
    font-size: 0.82rem;
    line-height: 1.6;
  }

  /* ============================
     FOOTER
     ============================ */
  footer {
    padding: 1.5rem 0;
    margin-top: 2.5rem;
    font-size: 0.78rem;
  }

  /* ============================
     QR MODAL
     ============================ */
  .modal-content {
    width: 96%;
    max-width: 360px;
    padding: 1.25rem 1rem;
    border-radius: 18px;
  }

  .qr-container-box {
    width: 180px;
    height: 180px;
  }
}

/* ============================
   EXTRA-SMALL — ≤ 390px (iPhone SE etc.)
   ============================ */
@media (max-width: 390px) {
  h1 {
    font-size: 1.2rem;
  }

  .glass-card {
    padding: 0.9rem 0.8rem;
  }

  .word-count-pill {
    font-size: 0.65rem;
    padding: 0.5rem 0.1rem;
  }

  .results-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
  }

  .word-text {
    font-size: 0.78rem;
  }

  .actions-panel .btn {
    font-size: 0.72rem;
    padding: 0.65rem 0.35rem;
  }

  .path-cell,
  .address-cell,
  .table-field-value {
    font-size: 0.7rem;
  }
}

/* ============================
   HIDE MOBILE-ONLY ON DESKTOP
   ============================ */
@media (min-width: 768px) {
  .mobile-topbar,
  .mobile-bottom-nav {
    display: none !important;
  }
}


