/* Tactile, Fluid MD3 Components */
.md-icon-btn {
  width: 40px; height: 40px; border-radius: 999px; border: none;
  background: transparent; color: var(--text-var); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.16s var(--md-ease), transform 0.14s var(--md-ease);
}
.md-icon-btn:hover { background: var(--s-high); }
.md-icon-btn:active { background: var(--s-highest); transform: scale(0.9); color: var(--text); }

.md-btn {
  height: 40px; border: none; border-radius: 999px; padding: 0 18px;
  font-family: var(--md-font); font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--sec-c); color: var(--on-sec-c);
  transition: transform 0.14s var(--md-ease), opacity 0.15s, background 0.16s;
}
.md-btn.filled { background: var(--primary); color: var(--on-primary); }
.md-btn.danger { background: var(--err-c); color: var(--err); }
.md-btn:active { transform: scale(0.95); opacity: 0.88; }

.md-chip {
  height: 32px; border: 1px solid var(--outline); border-radius: 10px; padding: 0 12px;
  background: transparent; color: var(--text-var); font-family: var(--md-font);
  font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all 0.18s var(--md-ease);
}
.md-chip.active { background: var(--sec-c); color: var(--on-sec-c); border-color: transparent; font-weight: 600; }
.md-chip:active { transform: scale(0.94); }

.route-pill {
  height: 30px; border-radius: 999px; border: none; padding: 0 10px;
  background: var(--ok-c); color: var(--ok); font-family: var(--md-font);
  font-size: 11px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  transition: transform 0.15s var(--md-ease);
}
.route-pill:active { transform: scale(0.94); }

.md-field {
  width: 100%; height: 46px; padding: 0 14px; background: var(--s-mid); color: var(--text);
  border: 1px solid var(--outline); border-radius: 14px; font-family: var(--md-font);
  font-size: 14px; outline: none; margin-bottom: 10px;
  transition: border-color 0.16s;
}
.md-field:focus { border-color: var(--primary); border-width: 2px; }

.md-search {
  flex: 1; height: 44px; border-radius: 999px; background: var(--s-high);
  padding: 0 16px; display: flex; align-items: center; gap: 10px; color: var(--text-var);
}
.md-search input {
  width: 100%; border: none; background: transparent; outline: none;
  color: var(--text); font-size: 14px; font-family: var(--md-font);
}

.md-progress-track { width: 100%; height: 6px; border-radius: 999px; background: var(--s-highest); overflow: hidden; }
.md-progress-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.3s var(--md-ease); }

/* Floating Action Button (MD3) */
.md-fab {
  position: fixed; right: 20px; bottom: calc(92px + var(--safe-bottom)); z-index: 25;
  width: 56px; height: 56px; border-radius: 18px; border: none;
  background: var(--primary-c); color: var(--on-primary-c); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.36);
  transition: transform 0.18s var(--md-ease), box-shadow 0.18s;
}
.md-fab:active { transform: scale(0.9); }

/* Bottom Navigation Bar (Official MD3) */
.md-navbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: var(--s-low); padding: 8px 8px calc(10px + var(--safe-bottom));
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.md-nav-btn {
  border: none; background: none; color: var(--text-var); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-family: var(--md-font); font-size: 12px; font-weight: 500;
}
.md-nav-pill {
  width: 64px; height: 32px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s var(--md-ease), transform 0.16s var(--md-ease);
}
.md-nav-btn.active { color: var(--text); font-weight: 600; }
.md-nav-btn.active .md-nav-pill { background: var(--sec-c); color: var(--on-sec-c); }
.md-nav-btn:active .md-nav-pill { transform: scale(0.92); }

/* Bottom Sheet */
.md-sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.56); z-index: 50;
  display: none; align-items: flex-end; justify-content: center;
}
.md-sheet-backdrop.open { display: flex; }
.md-sheet {
  width: 100%; max-width: 560px; background: var(--s-low);
  border-radius: 28px 28px 0 0; padding: 12px 22px calc(24px + var(--safe-bottom));
  animation: sheetUp 0.22s var(--md-ease); max-height: 84vh; overflow-y: auto;
}
@keyframes sheetUp { from { transform: translateY(42px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.md-sheet-handle { width: 34px; height: 4px; border-radius: 2px; background: var(--outline); margin: 0 auto 16px; }

.md-snackbar {
  position: fixed; bottom: calc(96px + var(--safe-bottom)); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 80;
  white-space: nowrap;
}
.md-snackbar.show { opacity: 1; }
