/* ==========================================================================
   THTD // TOO HARD TO DECRYPT
   Theme: Obsidian × Acid Lime
   Typography: JetBrains Mono + Plus Jakarta Sans
   ========================================================================== */

:root {
  /* Obsidian Palette */
  --bg-deep: #07080a;
  --bg-surface: #0e1015;
  --bg-surface-elevated: #141720;
  --bg-card: rgba(18, 21, 30, 0.75);
  --bg-input: #0a0c10;
  --border-subtle: #1c212d;
  --border-focus: #2d3548;

  /* Acid Lime Palette */
  --lime-primary: #d4ff00;
  --lime-hover: #b8e000;
  --lime-muted: rgba(212, 255, 0, 0.15);
  --lime-glow: rgba(212, 255, 0, 0.35);
  --lime-subtle: rgba(212, 255, 0, 0.05);

  /* Functional Status */
  --danger: #ff4757;
  --danger-muted: rgba(255, 71, 87, 0.15);
  --success: #2ed573;
  --success-muted: rgba(46, 213, 115, 0.15);

  /* Typography Colors */
  --text-main: #f3f5f8;
  --text-muted: #838c9e;
  --text-dark: #07080a;

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-lime: 0 0 25px rgba(212, 255, 0, 0.22);
  --shadow-card: 0 16px 40px -10px rgba(0, 0, 0, 0.65);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-deep);
}

body {
  min-height: 100vh;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Background Atmosphere */
.matrix-bg {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(212, 255, 0, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(212, 255, 0, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
}

.glow-1 {
  width: 450px;
  height: 450px;
  top: -100px;
  right: -50px;
  background: radial-gradient(circle, var(--lime-primary), transparent 70%);
}

.glow-2 {
  width: 500px;
  height: 500px;
  bottom: -150px;
  left: -100px;
  background: radial-gradient(circle, #38ef7d, transparent 70%);
  opacity: 0.12;
}

/* App Container */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 24px;
}

/* ASCII Banner */
.ascii-banner {
  display: flex;
  justify-content: flex-start;
  margin-bottom: -8px;
  overflow: hidden;
}

.ascii-art {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.15;
  color: var(--lime-primary);
  text-shadow: 0 0 10px rgba(212, 255, 0, 0.35);
  user-select: none;
  font-weight: 700;
}

/* Header */
.app-header {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--lime-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lime-primary);
  box-shadow: var(--shadow-lime);
}

.logo-icon svg {
  width: 26px;
  height: 26px;
}

.brand-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.neon-text {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--lime-primary);
  text-shadow: 0 0 15px rgba(212, 255, 0, 0.4);
}

.version-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.brand-subtitle {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-top: -2px;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

.security-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--lime-subtle);
  border: 1px solid rgba(212, 255, 0, 0.25);
  color: var(--lime-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--lime-primary);
  box-shadow: 0 0 10px var(--lime-primary);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px;
  border-radius: var(--radius-lg);
  gap: 6px;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 48px;
}

.tab-btn .tab-icon {
  width: 18px;
  height: 18px;
  transition: stroke 0.2s;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--lime-primary);
  border: 1px solid rgba(212, 255, 0, 0.3);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.tab-btn.active .tab-icon {
  stroke: var(--lime-primary);
}

/* Main Card */
.main-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
  flex: 1;
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Flow Panel */
.flow-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Drop Zone */
.drop-zone {
  position: relative;
  background: var(--bg-input);
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  transition: all 0.25s ease;
  cursor: pointer;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--lime-primary);
  background: rgba(212, 255, 0, 0.02);
  box-shadow: inset 0 0 20px rgba(212, 255, 0, 0.05);
}

.file-hidden-input {
  display: none;
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.drop-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lime-primary);
  border: 1px solid rgba(212, 255, 0, 0.2);
}

.drop-icon svg {
  width: 28px;
  height: 28px;
}

.drop-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.drop-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 480px;
}

.btn-browse {
  margin-top: 6px;
}

/* File Selected Card */
.file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--lime-primary);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-align: left;
  box-shadow: var(--shadow-lime);
}

.file-info-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.file-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.file-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  word-break: break-all;
}

.file-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--lime-primary);
  background: var(--lime-subtle);
  border: 1px solid rgba(212, 255, 0, 0.3);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.file-type {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  color: var(--danger);
  background: var(--danger-muted);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

/* Input Fields */
.input-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.input-group label .hint {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  padding-right: 65px;
}

.input-suffix {
  position: absolute;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--lime-primary);
  pointer-events: none;
}

input[type="text"], textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all 0.2s;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

input[type="text"]:focus, textarea:focus {
  border-color: var(--lime-primary);
  box-shadow: 0 0 14px rgba(212, 255, 0, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 50px;
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn-primary {
  background: var(--lime-primary);
  color: var(--text-dark);
  box-shadow: 0 4px 20px rgba(212, 255, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: var(--lime-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(212, 255, 0, 0.45);
}

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

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #1b202c;
  border-color: var(--border-focus);
}

.btn-lime-outline {
  background: transparent;
  border: 1px solid var(--lime-primary);
  color: var(--lime-primary);
}

.btn-lime-outline:hover {
  background: var(--lime-subtle);
  box-shadow: var(--shadow-lime);
}

.btn-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-chip:hover {
  color: var(--lime-primary);
  border-color: var(--lime-primary);
  background: var(--lime-subtle);
}

.action-footer {
  display: flex;
  flex-direction: column;
}

.action-footer .btn {
  width: 100%;
}

/* Processing State */
.processing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 16px;
}

.spinner-neon {
  width: 52px;
  height: 52px;
  border: 4px solid var(--border-subtle);
  border-top-color: var(--lime-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 15px rgba(212, 255, 0, 0.25);
}

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

.progress-bar-container {
  width: 100%;
  max-width: 400px;
  height: 6px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  width: 30%;
  height: 100%;
  background: var(--lime-primary);
  box-shadow: 0 0 10px var(--lime-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* Result Panel */
.result-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.result-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--lime-subtle);
  border: 1px solid rgba(212, 255, 0, 0.3);
  padding: 18px 20px;
  border-radius: var(--radius-md);
}

.success-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--lime-primary);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.success-icon svg {
  width: 22px;
  height: 22px;
}

.result-banner h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--lime-primary);
}

.result-banner p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Phrase Section */
.phrase-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.phrase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.phrase-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.phrase-title svg {
  width: 18px;
  height: 18px;
  color: var(--lime-primary);
}

.phrase-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.words-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.word-chip {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  transition: all 0.2s;
  user-select: all;
}

.word-chip:hover {
  border-color: rgba(212, 255, 0, 0.4);
}

.word-index {
  color: var(--lime-primary);
  font-size: 0.75rem;
  font-weight: 800;
  min-width: 20px;
}

.word-val {
  color: var(--text-main);
  font-weight: 600;
  transition: filter 0.2s;
}

.word-val.masked {
  filter: blur(5px);
  user-select: none;
}

.phrase-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 71, 87, 0.08);
  border: 1px solid rgba(255, 71, 87, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: #ff9f9f;
  font-size: 0.82rem;
  line-height: 1.4;
}

.phrase-warning svg {
  width: 18px;
  height: 18px;
  color: var(--danger);
  flex-shrink: 0;
  margin-top: 1px;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.stat-val.highlight {
  color: var(--lime-primary);
  text-shadow: 0 0 10px rgba(212, 255, 0, 0.3);
}

.stat-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Keycard Canvas Section */
.keycard-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.keycard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.keycard-header h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
}

.keycard-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--lime-subtle);
  color: var(--lime-primary);
  border: 1px solid rgba(212, 255, 0, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.canvas-wrapper {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #000;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

#keycard-canvas {
  width: 100%;
  height: auto;
  display: block;
}

/* Downloads Bar */
.downloads-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.downloads-bar .btn {
  flex: 1;
  min-width: 220px;
}

/* ================= DECRYPT VIEW ================= */
.mnemonic-input-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mnemonic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 700;
}

.badge-neutral {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.badge-valid {
  background: var(--success-muted);
  color: var(--success);
  border: 1px solid var(--success);
}

.badge-invalid {
  background: var(--danger-muted);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.quick-paste-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

.quick-paste-box input {
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.words-input-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.word-input-slot {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  transition: all 0.2s;
}

.word-input-slot:focus-within {
  border-color: var(--lime-primary);
  box-shadow: 0 0 10px rgba(212, 255, 0, 0.15);
}

.word-input-slot.has-error {
  border-color: var(--danger);
}

.slot-index {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--lime-primary);
  min-width: 22px;
}

.slot-input {
  width: 100%;
  border: none !important;
  background: transparent !important;
  padding: 8px 4px !important;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-main);
  box-shadow: none !important;
}

/* Decrypted Meta Details */
.meta-details-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.meta-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-all;
}

.secret-note-box {
  background: var(--bg-input);
  border-left: 3px solid var(--lime-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--lime-primary);
}

.note-text {
  font-size: 0.92rem;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ================= ABOUT / SPECS VIEW ================= */
.specs-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.spec-hero h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.spec-hero p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.spec-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spec-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--lime-primary);
  letter-spacing: 0.08em;
}

.spec-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.spec-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.spec-stat {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--lime-primary);
  background: var(--lime-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.math-deep-dive {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.math-deep-dive h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.math-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
}

.math-box code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--lime-primary);
  line-height: 1.8;
}

/* Footer */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-brand {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--lime-primary);
}

.footer-sep {
  color: var(--border-focus);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: slideToast 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
}

.toast.toast-success {
  border-color: var(--lime-primary);
  color: var(--lime-primary);
}

.toast.toast-error {
  border-color: var(--danger);
  color: var(--danger);
}

@keyframes slideToast {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* ================= MOBILE RESPONSIVE MEDIA QUERIES ================= */
@media (max-width: 768px) {
  .app-container {
    padding: 16px 12px 32px;
    gap: 16px;
  }

  .main-card {
    padding: 20px 16px;
  }

  .brand-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .neon-text {
    font-size: 1.5rem;
  }

  .nav-tabs {
    flex-direction: row;
    padding: 4px;
  }

  .tab-btn {
    padding: 10px 8px;
    font-size: 0.82rem;
    min-height: 42px;
    gap: 6px;
  }

  .tab-btn .tab-icon {
    width: 15px;
    height: 15px;
  }

  .drop-zone {
    padding: 28px 16px;
  }

  .words-grid, .words-input-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .spec-grid {
    grid-template-columns: 1fr;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .downloads-bar {
    flex-direction: column;
  }

  .downloads-bar .btn {
    width: 100%;
    min-width: 0;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .words-grid, .words-input-grid {
    grid-template-columns: 1fr;
  }

  .phrase-actions {
    width: 100%;
    justify-content: space-between;
  }

  .phrase-actions .btn-chip {
    flex: 1;
    justify-content: center;
  }
}
