/* ============================================================
   MELODY KEEPER — Mobile App CSS
   ============================================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
  --primary: #4A90E2;
  --primary-dark: #357ABD;
  --primary-light: rgba(74,144,226,0.12);
  --secondary: #D0021B;
  --accent: #F5A623;

  --bg: #F2F4F8;
  --surface: #FFFFFF;
  --surface-2: #F7F8FC;

  --text-primary: #1A1D2E;
  --text-secondary: #6B7280;
  --text-disabled: #B0B7C3;
  --text-on-primary: #FFFFFF;

  --divider: rgba(0,0,0,0.08);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  --app-bar-h: 56px;
  --bottom-nav-h: 64px;
  --fab-size: 56px;
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #1A1D2E;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; }

.hidden { display: none !important; }

/* ============================================================
   APP SHELL
   ============================================================ */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,0,0,0.5);
}

/* ============================================================
   APP BAR
   ============================================================ */
.app-bar {
  position: relative;
  z-index: 10;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.app-bar-content {
  height: var(--app-bar-h);
  display: flex;
  align-items: center;
  padding: 0 8px 0 4px;
  gap: 4px;
}

.app-bar-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-bar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 40px;
  justify-content: flex-end;
}

/* ============================================================
   SCREENS
   ============================================================ */
.screens-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(30px);
  transition: opacity var(--transition), transform var(--transition);
  overflow: hidden;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

.screen.slide-out {
  opacity: 0;
  transform: translateX(-30px);
}

.screen-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 12px 0;
  scroll-behavior: smooth;
}

.screen-scroll::-webkit-scrollbar { display: none; }

.detail-screen .screen-scroll {
  padding: 0;
}

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */
.bottom-nav {
  position: relative;
  z-index: 10;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--divider);
  height: var(--bottom-nav-h);
  flex-shrink: 0;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary);
  opacity: 0;
  transition: opacity var(--transition);
}

.nav-item:active::before { opacity: 0.06; }

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

.nav-icon { font-size: 22px !important; transition: transform var(--transition); }
.nav-item.active .nav-icon { transform: scale(1.1); }

.nav-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: font-weight var(--transition);
}

.nav-item.active .nav-label { font-weight: 700; }

/* Active indicator pill */
.nav-item.active::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

/* ============================================================
   FAB
   ============================================================ */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px);
  right: 16px;
  z-index: 20;
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(74,144,226,0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.fab:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(74,144,226,0.3);
}

.fab .material-icons-round {
  font-size: 26px;
  transition: transform 0.2s ease;
}

.fab.open .material-icons-round { transform: rotate(45deg); }

/* ============================================================
   ICON BUTTON
   ============================================================ */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: background var(--transition);
  flex-shrink: 0;
}

.icon-btn:active { background: var(--divider); }

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 4px 8px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.text-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.text-btn:active { background: var(--primary-light); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 14px 14px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon .material-icons-round { font-size: 22px; }

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

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
}

/* ============================================================
   WEEKLY CHART
   ============================================================ */
.weekly-chart-card {
  padding: 16px;
  margin-bottom: 4px;
}

.weekly-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 72px;
  gap: 6px;
}

.weekly-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.weekly-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--primary);
  opacity: 0.25;
  min-height: 4px;
  transition: height 0.4s cubic-bezier(.4,0,.2,1), opacity var(--transition);
}

.weekly-bar.has-data { opacity: 1; }
.weekly-bar.today { background: var(--accent); }

.weekly-days {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.weekly-day-label {
  flex: 1;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
}

.weekly-day-label.today { color: var(--accent); }

/* ============================================================
   QUICK ACTIONS
   ============================================================ */
.quick-actions-row {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}

.quick-action-btn {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  transition: background var(--transition), transform 0.12s ease;
}

.quick-action-btn:active {
  background: var(--primary-light);
  transform: scale(0.96);
}

.quick-action-btn .material-icons-round { font-size: 24px; }

/* ============================================================
   SESSION LIST ITEMS
   ============================================================ */
.list-item {
  background: var(--surface);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  padding: 12px 10px 12px 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background var(--transition), transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.list-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.15s;
}

.list-item:active::after { opacity: 0.04; }
.list-item:active { transform: scale(0.99); }

.list-item-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
  font-size: 20px;
}

.list-item-content { flex: 1; min-width: 0; }

.list-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-left: 8px;
  flex-shrink: 0;
}

.list-item-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.list-item-date {
  font-size: 11px;
  color: var(--text-disabled);
}

.list-item-chevron {
  color: var(--text-disabled);
  font-size: 18px !important;
  margin-left: 4px;
}

/* Instrument type color accents */
.avatar-string   { background: rgba(74,144,226,0.12); }
.avatar-keyboard { background: rgba(245,166,35,0.12); }
.avatar-wind     { background: rgba(80,200,120,0.12); }
.avatar-percussion { background: rgba(208,2,27,0.12); }
.avatar-electronic { background: rgba(138,43,226,0.12); }
.avatar-other    { background: rgba(100,100,100,0.10); }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar-wrap {
  margin-bottom: 8px;
}

.search-bar {
  background: var(--surface);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  padding: 0 4px 0 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}

.search-icon {
  font-size: 20px !important;
  color: var(--text-secondary);
  margin-right: 8px;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  height: 44px;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}

.search-input::placeholder { color: var(--text-disabled); }

.clear-search { color: var(--text-secondary); }

/* ============================================================
   FILTER CHIPS
   ============================================================ */
.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.chip.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(74,144,226,0.35);
}

/* ============================================================
   GOALS
   ============================================================ */
.goals-summary-row {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  overflow: hidden;
}

.goals-summary-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
}

.goals-summary-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.goals-summary-lbl {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
}

.goals-summary-divider {
  width: 1px;
  background: var(--divider);
  margin: 12px 0;
}

.goal-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  margin-bottom: 10px;
}

.goal-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.goal-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.goal-info { flex: 1; min-width: 0; }

.goal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.goal-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.goal-actions {
  display: flex;
  gap: 2px;
}

.goal-progress-bar {
  height: 6px;
  background: var(--bg);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 6px;
}

.goal-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
}

.goal-progress-fill.completed { background: #34C759; }

.goal-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

.goal-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.goal-badge.active { background: rgba(74,144,226,0.12); color: var(--primary); }
.goal-badge.completed { background: rgba(52,199,89,0.12); color: #34C759; }

/* ============================================================
   INSTRUMENTS GRID
   ============================================================ */
.instruments-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.instrument-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.12s ease;
  position: relative;
}

.instrument-card:active { transform: scale(0.97); }

.instrument-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.instrument-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.instrument-card-type {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: capitalize;
}

.instrument-card-sessions {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

.instrument-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 0;
}

.instrument-card-actions .icon-btn {
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
}

/* ============================================================
   SESSION DETAIL
   ============================================================ */
.detail-hero {
  padding: 20px 16px 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.detail-hero-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.detail-hero-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.detail-hero-info { flex: 1; }

.detail-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

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

.detail-chips-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.detail-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  padding: 5px 10px 5px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-chip .material-icons-round { font-size: 15px !important; color: var(--primary); }

.detail-section {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 12px 12px 0;
  padding: 14px;
}

.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.detail-notes-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
}

.detail-fab-row {
  display: flex;
  gap: 10px;
  margin: 16px 12px 0;
}

.detail-fab-row .btn-primary,
.detail-fab-row .btn-danger-outline {
  flex: 1;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 32px;
  gap: 10px;
}

.empty-icon {
  font-size: 64px !important;
  color: var(--text-disabled);
  margin-bottom: 8px;
}

.empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-desc {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 220px;
  line-height: 1.6;
  margin-bottom: 4px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 24px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 8px rgba(74,144,226,0.35);
  transition: background var(--transition), transform 0.12s ease, box-shadow var(--transition);
}

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

.btn-primary.full-width { width: 100%; }

.btn-ghost {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: background var(--transition);
}

.btn-ghost:active { background: var(--divider); }

.btn-danger {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--secondary);
  color: white;
  font-size: 14px;
  font-weight: 600;
  transition: background var(--transition), transform 0.12s ease;
}

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

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--secondary);
  color: var(--secondary);
  font-size: 14px;
  font-weight: 600;
  transition: background var(--transition), transform 0.12s ease;
}

.btn-danger-outline:active {
  background: rgba(208,2,27,0.06);
  transform: scale(0.97);
}

/* ============================================================
   OVERLAY & BOTTOM SHEET
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 30;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity var(--transition);
}

.overlay.visible { opacity: 1; }

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 40;
  box-shadow: var(--shadow-lg);
  transition: transform 0.32s cubic-bezier(.4,0,.2,1);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.bottom-sheet.open {
  transform: translateX(-50%) translateY(0);
}

.bottom-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--divider);
  border-radius: var(--radius-full);
  margin: 10px auto 4px;
  flex-shrink: 0;
}

.bottom-sheet-header {
  display: flex;
  align-items: center;
  padding: 4px 8px 4px 16px;
  flex-shrink: 0;
}

.bottom-sheet-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.bottom-sheet-body {
  overflow-y: auto;
  padding: 8px 16px 24px;
  -webkit-overflow-scrolling: touch;
}

.bottom-sheet-body::-webkit-scrollbar { display: none; }

/* ============================================================
   FORMS
   ============================================================ */
.form-field {
  margin-bottom: 14px;
}

.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 0;
}

.form-row .form-field {
  flex: 1;
  margin-bottom: 14px;
  min-width: 0;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.required { color: var(--secondary); }

.form-input {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74,144,226,0.15);
  background: var(--surface);
}

.form-input.error {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(208,2,27,0.1);
}

.form-textarea { resize: vertical; min-height: 72px; }

.select-wrap {
  position: relative;
}

.form-select { padding-right: 32px; cursor: pointer; }

.select-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px !important;
  color: var(--text-secondary);
  pointer-events: none;
}

.field-error {
  display: block;
  font-size: 11px;
  color: var(--secondary);
  margin-top: 4px;
  font-weight: 500;
}

/* ============================================================
   DIALOG
   ============================================================ */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(2px);
}

.dialog {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px 20px 16px;
  width: 100%;
  max-width: 300px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: dialog-in 0.2s cubic-bezier(.4,0,.2,1);
}

@keyframes dialog-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.dialog-icon { margin-bottom: 12px; }

.dialog-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.dialog-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* ============================================================
   SNACKBAR
   ============================================================ */
.snackbar {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: #1A1D2E;
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 60;
  min-width: 200px;
  max-width: 340px;
  box-shadow: var(--shadow-lg);
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}

.snackbar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(16px);
}

.snackbar-msg { flex: 1; }

.snackbar-action {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   SKELETON LOADER
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--divider) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Scrollbar for desktop preview */
@media (min-width: 481px) {
  #app {
    border-radius: 32px;
    top: 16px;
    bottom: 16px;
    height: auto;
  }
}
