/* -------------------------------------------------------------
 * Early Utterance Tracker (UtteranceTracker)
 * Mobile-First Responsive Stylesheet (Smooth Touch Scrolling)
 * Version 4.0.0
 * ------------------------------------------------------------- */

:root {
  /* Colors */
  --bg-main: #090d16;
  --bg-card: rgba(18, 26, 46, 0.75);
  --bg-card-hover: rgba(26, 38, 66, 0.85);
  --border-color: rgba(99, 102, 241, 0.15);
  --border-color-active: rgba(99, 102, 241, 0.4);
  
  --primary: #6366f1; /* Indigo */
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent: #0d9488; /* Teal */
  --accent-glow: rgba(13, 148, 136, 0.3);
  
  --danger: #ef4444;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Fonts */
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Outfit', sans-serif;
  
  /* Radii & Dimensions */
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
  --nav-height: 68px;
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

a, button, input, select, textarea, .nav-item, .kbd-key, .tag-btn, .circle-tally-btn, .autocomplete-item {
  touch-action: manipulation;
}

html {
  background-color: var(--bg-main);
  height: 100%;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

body.dark-theme {
  background-attachment: fixed;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(13, 148, 136, 0.08) 0px, transparent 50%);
}

#app-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 14px calc(var(--nav-height) + 36px + env(safe-area-inset-bottom)) 14px;
  min-height: 100vh;
  position: relative;
}

/* Views Management */
.view {
  display: none;
  flex-direction: column;
  flex: 1;
  gap: 16px;
  opacity: 0;
  animation: fadeIn 0.25s ease forwards;
  overflow-y: visible;
}

.view.active {
  display: flex;
}

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

/* Headers */
.app-header {
  margin-bottom: 8px;
  text-align: left;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.logo-icon {
  color: var(--primary);
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary) 30%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.version-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 2px 8px;
  border-radius: 20px;
}

/* Cards & Panels */
.glass-panel, .card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  padding: 16px;
}

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

.panel-header h2, .card h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

/* Forms & Inputs */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.input-group label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

input[type="text"], input[type="date"], select, textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea {
  resize: vertical;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  user-select: none;
  touch-action: manipulation;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

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

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

.secondary-btn:active {
  background: rgba(255, 255, 255, 0.14);
}

.secondary-btn-sm {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  font-size: 12px;
}

.danger-btn-sm {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 6px 10px;
  font-size: 13px;
}

/* Clients Setup Layout */
.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .setup-grid {
    grid-template-columns: 1fr;
  }
}

.clients-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
}

.client-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}

.client-item:hover, .client-item:active {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--primary);
}

.client-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-round {
  width: 38px;
  height: 38px;
  border-radius: 19px;
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.client-meta h3 {
  font-size: 14px;
  font-weight: 600;
}

.client-meta p {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* Active Session Header */
.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.client-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-letter {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
}

.client-details h3 {
  font-size: 15px;
  font-weight: 600;
}

.client-details p {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* Sub-tabs Navigation inside Session View */
.session-tabs-nav {
  display: flex;
  background: rgba(9, 13, 22, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 4px;
  gap: 6px;
}

.sess-tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 10px 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.sess-tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

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

/* Session Panes Container */
.session-panes-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: visible;
}

.session-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
  overflow-y: visible;
  overflow-x: hidden;
}

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

/* Pane 1: Tally Board Entry Bar */
.quick-entry-bar {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  align-items: center;
}

.entry-field-word {
  flex: 1;
  position: relative;
}

.entry-field-word input {
  padding: 10px 32px 10px 10px;
  font-size: 14px;
}

.clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.entry-field-category {
  flex: 0 0 130px;
}

.entry-field-category select {
  padding: 10px 8px;
  font-size: 13px;
}

.entry-add-btn {
  flex: 0 0 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  border: none;
  border-radius: var(--border-radius-sm);
}

/* Quick Word Options & Checkbox */
.quick-vocab-options-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
}

.quick-save-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #fbbf24;
  cursor: pointer;
  user-select: none;
}

.quick-save-label input[type="checkbox"] {
  accent-color: #f59e0b;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.vocab-backup-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* -------------------------------------------------------------
 * DYNAMIC TYPEAHEAD FILTER AUTOCOMPLETE DROPDOWN
 * ------------------------------------------------------------- */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #0b1120;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: var(--border-radius-md);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65), 0 4px 10px rgba(0, 0, 0, 0.4);
  max-height: 240px;
  overflow-y: auto;
  z-index: 120;
  list-style: none;
  padding: 4px;
  margin: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.autocomplete-dropdown.hidden {
  display: none;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  min-height: 44px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.12s ease;
  touch-action: manipulation;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item:active {
  background: rgba(56, 189, 248, 0.2);
}

.autocomplete-item.target-match {
  background: rgba(245, 158, 11, 0.12);
  border-left: 3px solid #f59e0b;
}

.ac-item-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.ac-word-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ac-word {
  font-weight: 700;
  font-size: 14px;
  color: #f8fafc;
}

.ac-phonemes {
  font-size: 11.5px;
  font-family: monospace;
  color: #94a3b8;
}

.star-target-btn {
  background: none;
  border: none;
  font-size: 13px;
  cursor: pointer;
  padding: 0 3px 0 0;
  color: var(--text-muted);
  opacity: 0.45;
  transition: all 0.15s ease;
  touch-action: manipulation;
  vertical-align: middle;
}

.star-target-btn.active-star {
  opacity: 1;
  color: #f59e0b;
  transform: scale(1.15);
}

/* Backup & Restore Action Card Styles */
.backup-action-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.backup-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.email-backup-btn,
.export-btn,
.import-btn-label,
.clear-vocab-btn {
  flex: 1;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  touch-action: manipulation;
}

.email-backup-btn {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: white;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

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

.danger-outline-btn {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.danger-outline-btn:active {
  background: rgba(239, 68, 68, 0.25);
  transform: scale(0.97);
}

.backup-safe-note {
  font-size: 11.5px;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  line-height: 1.4;
}

/* -------------------------------------------------------------
 * TALLY BOARD IPA PHONEMIC KEYBOARD & TOOLBAR
 * ------------------------------------------------------------- */
.ipa-entry-toolbar {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  touch-action: pan-y;
}

.ipa-toolbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ipa-toggle-btn {
  padding: 5px 10px;
  font-size: 12px;
  gap: 6px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
}

.ipa-toggle-btn.active {
  background: rgba(99, 102, 241, 0.3);
  border-color: var(--primary);
  color: #ffffff;
}

.ipa-frequent-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.ipa-chip-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  padding: 3px 7px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.1s ease;
}

.ipa-chip-btn:active {
  background: var(--primary);
  color: #ffffff;
  transform: scale(0.92);
}

.tally-ipa-keyboard {
  background: rgba(9, 13, 22, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  touch-action: pan-y;
  max-height: 360px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tally-kbd-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 0;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.tally-kbd-tab.active {
  color: #38bdf8;
  border-bottom: 2px solid #38bdf8;
}

.tally-kbd-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  touch-action: pan-y;
  scroll-margin-top: 40px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tally-kbd-panel:first-of-type {
  border-top: none;
  padding-top: 0;
}

.tally-ipa-key {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  color: #f8fafc;
  padding: 8px 0;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
  transition: all 0.1s ease;
}

.tally-ipa-key:active {
  background: var(--accent);
  transform: scale(0.92);
}

.ipa-tools-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr 1fr 0.8fr;
  gap: 4px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tally-ipa-tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  padding: 6px 2px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
}

.tally-ipa-tool-btn:active {
  background: rgba(99, 102, 241, 0.3);
  color: #ffffff;
  transform: scale(0.94);
}

/* Autocomplete suggestions */
.autocomplete-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 6px 0;
}

.autocomplete-item {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  touch-action: manipulation;
}

/* Session Tally Table */
.log-table-container {
  max-height: 380px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  background: rgba(9, 13, 22, 0.2);
}

.utterance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.utterance-table th {
  background: rgba(9, 13, 22, 0.6);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.utterance-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tally-action-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.circle-tally-btn {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.circle-tally-btn:active {
  background: var(--primary);
}

.trash-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

/* Pane 2: Details & Analysis Layout */
.session-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.quick-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  touch-action: pan-y;
}

.tag-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--border-radius-sm);
  font-size: 11.5px;
  font-weight: bold;
  cursor: pointer;
  touch-action: manipulation;
}

.tag-btn:hover, .tag-btn:active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
  border-color: var(--primary);
}

/* Phoneme Onscreen Keyboard */
.phoneme-keyboard {
  background: rgba(9, 13, 22, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 10px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  touch-action: pan-y;
  max-height: 360px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.keyboard-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 4px 0 6px;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: inherit;
}

.kbd-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 0;
  cursor: pointer;
  touch-action: manipulation;
}

.kbd-tab.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

.kbd-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  touch-action: pan-y;
  scroll-margin-top: 42px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.kbd-panel:first-of-type {
  border-top: none;
  padding-top: 0;
}

.phoneme-group span {
  font-size: 9.5px;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
  display: block;
}

.kbd-lang-note {
  font-size: 10px;
  font-style: italic;
  color: var(--text-muted);
  margin: -2px 0 2px;
}

.keys-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  touch-action: pan-y;
}

.kbd-key {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  padding: 8px 0;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
}

.kbd-key:active {
  background: var(--accent);
  transform: scale(0.92);
}

/* Analytics Stats Panel */
.stats-grid-layouts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.stat-category-box {
  background: rgba(9, 13, 22, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-md);
  padding: 12px;
}

.stat-category-box h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.analytic-summary-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-bar-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 500;
}

.stat-bar-bg {
  background: rgba(255, 255, 255, 0.05);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.stat-bar-fill {
  background: var(--primary);
  height: 100%;
  border-radius: 3px;
  transition: width 0.2s ease;
}

.stat-bar-fill.accent-bar {
  background: var(--accent);
}

.inventory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.inventory-tag {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: bold;
  border-radius: 4px;
}

.inventory-tag.vowel-tag {
  background: rgba(13, 148, 136, 0.1);
  border: 1px solid rgba(13, 148, 136, 0.25);
  color: #2dd4bf;
}

/* Completion Actions */
.completion-actions-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.completion-actions-group .btn {
  width: 100%;
}

/* Fixed Bottom Navigation Bar */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(9, 13, 22, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 14px;
  transition: all 0.15s;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: calc(var(--nav-height) + 10px);
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1000;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  border-left: 4px solid var(--primary);
  font-size: 12px;
}

.hidden {
  display: none !important;
}
