/* CyberSnow Demo - Modern Minimalist Black & White Theme */

:root {
  --bg-primary: #050507;
  --bg-surface: #0e0e12;
  --bg-glass: rgba(18, 18, 24, 0.75);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 255, 255, 0.22);
  
  --text-primary: #f5f5f7;
  --text-secondary: #8e8e93;
  --text-muted: #52525b;

  --accent-white: #ffffff;
  --accent-glow: rgba(255, 255, 255, 0.12);
  --accent-ring: rgba(255, 255, 255, 0.06);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background Subtle Grid Texture */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 28px 36px;
}

/* ---------------- Floating Navbar Header ---------------- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: rgba(14, 14, 19, 0.78);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 8px 14px 8px 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(255, 255, 255, 0.02);
  position: relative;
  z-index: 100;
  transition: all 0.3s ease;
}

.app-header:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 255, 255, 0.03);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 32px;
  width: auto;
  max-width: 36px;
  object-fit: contain;
  display: block;
}

.brand-name {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent-white);
  user-select: none;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 9px;
}

.voice-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 12px 5px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  transition: all 0.25s ease;
}

.voice-pill:hover,
.voice-pill:focus-within {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.06);
}

.voice-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  user-select: none;
}

.voice-dropdown {
  background: transparent;
  color: var(--text-primary);
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  padding-right: 4px;
}

.voice-dropdown option {
  background: #121216;
  color: #f5f5f7;
  padding: 8px;
}

.timer-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.timer-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
}

.timer-value {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.3s ease;
}

/* Active status styling */
.status-pill.connected {
  border-color: var(--border-active);
  color: var(--accent-white);
}

.status-pill.connected .status-dot {
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.status-pill.listening .status-dot {
  animation: pulse-dot 1.5s infinite;
}

.status-pill.speaking {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.15);
}

.status-pill.speaking .status-dot {
  background: #ffffff;
  box-shadow: 0 0 12px #ffffff;
}

.status-pill.user-speaking {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.18);
  color: #38bdf8;
}

.status-pill.user-speaking .status-dot {
  background: #38bdf8;
  box-shadow: 0 0 12px #38bdf8;
  animation: pulse-dot 0.8s infinite;
}

/* ---------------- Main Visualizer ---------------- */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  position: relative;
}

.visualizer-stage {
  position: relative;
  width: 320px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ambient-glow {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Concentric Rings */
.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--accent-ring);
  transition: all 0.4s ease;
  pointer-events: none;
}

.ring-outer {
  width: 300px;
  height: 300px;
}

.ring-mid {
  width: 230px;
  height: 230px;
}

.ring-inner {
  width: 170px;
  height: 170px;
}

/* Dynamic State Animations for Rings */
.visualizer-stage.active .ring-outer {
  border-color: rgba(255, 255, 255, 0.12);
  animation: pulse-ring 4s infinite linear;
}

.visualizer-stage.active .ring-mid {
  border-color: rgba(255, 255, 255, 0.18);
  animation: pulse-ring 3s infinite linear reverse;
}

.visualizer-stage.active .ring-inner {
  border-color: rgba(255, 255, 255, 0.25);
  animation: pulse-ring 2s infinite linear;
}

.visualizer-stage.speaking .ambient-glow {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, transparent 75%);
}

/* Center Orb */
.orb-container {
  position: relative;
  z-index: 2;
  cursor: pointer;
}

.orb-core {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #d4d4d8 35%, #18181b 85%, #09090b 100%);
  box-shadow: 
    0 0 24px rgba(255, 255, 255, 0.2),
    inset 0 0 16px rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #050507;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.visualizer-stage:hover .orb-core {
  transform: scale(1.05);
  box-shadow: 
    0 0 35px rgba(255, 255, 255, 0.35),
    inset 0 0 20px rgba(255, 255, 255, 0.6);
}

.visualizer-stage.active .orb-core {
  box-shadow: 
    0 0 45px rgba(255, 255, 255, 0.4),
    inset 0 0 24px rgba(255, 255, 255, 0.8);
  animation: breathing 3s infinite ease-in-out;
}

.visualizer-stage.speaking .orb-core {
  animation: bounce-speaking 0.8s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
  box-shadow: 
    0 0 60px rgba(255, 255, 255, 0.6),
    inset 0 0 30px #ffffff;
}

.orb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

/* ---------------- Interaction Typography ---------------- */

.interaction-info {
  text-align: center;
  max-width: 480px;
}

.state-title {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent-white);
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.state-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  font-weight: 400;
}

/* ---------------- Realtime Waveform ---------------- */

.waveform-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 38px;
  width: 220px;
  padding: 0 10px;
}

.wave-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.2);
  height: 4px;
  border-radius: 999px;
  transition: height 0.08s ease, background-color 0.2s ease;
}

.waveform-container.active .wave-bar {
  background: rgba(255, 255, 255, 0.8);
}

/* ---------------- Footer Controls ---------------- */

.app-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-bottom: 8px;
}

.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent-white);
  color: #050507;
  border: 1px solid transparent;
  padding: 15px 36px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.25);
  background: #ffffff;
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.primary-btn.active:hover {
  background: #1c1c22;
  border-color: rgba(255, 255, 255, 0.45);
}

/* ---------------- Call Recording ---------------- */

.call-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.record-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-active);
  padding: 14px 22px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.record-btn:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.04);
}

.record-btn:focus-visible,
.primary-btn:focus-visible {
  outline: 2px solid var(--accent-white);
  outline-offset: 3px;
}

.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff453a;
}

.record-btn.recording {
  border-color: rgba(255, 69, 58, 0.7);
  color: #ff6961;
  font-variant-numeric: tabular-nums;
}

.record-btn.recording .rec-dot {
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.rec-note {
  font-size: 0.8rem;
  color: #ff6961;
  text-align: center;
  max-width: 340px;
  line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
  .record-btn.recording .rec-dot { animation: none; }
}

.footer-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.divider {
  font-size: 0.6rem;
  opacity: 0.5;
}

/* ---------------- Keyframe Animations ---------------- */

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

@keyframes pulse-ring {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.02); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes breathing {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@keyframes bounce-speaking {
  0% { transform: scale(1); }
  100% { transform: scale(1.12); }
}

/* ---------------- Modular UI Additions ---------------- */

.hidden {
  display: none !important;
}

/* Mobile Menu Toggle Button (Hidden on Desktop) */
.mobile-menu-btn {
  display: none;
}

/* Nav Button Pills */
.nav-btn-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.nav-btn-pill:hover {
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
}

.nav-btn-pill.active {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.09);
}

.nav-pill-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-pill-badge.warning {
  background: rgba(255, 170, 0, 0.2);
  color: #ffb84d;
  border-color: rgba(255, 170, 0, 0.35);
}

/* User Pill & Logout */
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.user-name {
  color: var(--text-primary);
  font-weight: 500;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.logout-icon-btn:hover {
  color: #ff6b6b;
}

/* ========================================================
   1. LOGIN OVERLAY & CARD
   ======================================================== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 7, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(14, 14, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 38px 34px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(255, 255, 255, 0.03);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.login-brand-logo {
  height: 48px;
  width: auto;
  max-width: 52px;
  object-fit: contain;
  display: block;
}

.login-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}

.form-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 14px 12px 42px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.06);
}

.login-btn {
  margin-top: 6px;
  width: 100%;
  background: var(--accent-white);
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.login-btn:hover {
  background: #f0f0f2;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.login-status {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.28);
  color: #93c5fd;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.25s ease;
}

.login-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(147, 197, 253, 0.25);
  border-top-color: #93c5fd;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-error {
  background: rgba(255, 77, 77, 0.12);
  border: 1px solid rgba(255, 77, 77, 0.25);
  color: #ff8080;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: shake 0.35s ease-in-out;
}

.login-hint {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
}

.login-hint code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: monospace;
}

/* ========================================================
   2. RULES & GUIDELINES MODAL
   ======================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 7, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.25s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 660px;
  max-height: 88vh;
  background: rgba(14, 14, 18, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 50px rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
}

.modal-header {
  padding: 24px 28px 18px 28px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-title {
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 22px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(88vh - 180px);
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.guideline-item {
  display: flex;
  gap: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color 0.2s ease;
}

.guideline-item:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.guideline-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-white);
  flex-shrink: 0;
}

.guideline-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.guideline-heading {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.guideline-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.modal-footer {
  padding: 18px 28px 22px 28px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 14, 18, 0.98);
}

.accept-checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.accept-checkbox-group input[type="checkbox"] {
  accent-color: #ffffff;
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.accept-checkbox-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.accept-btn {
  background: var(--accent-white);
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 11px 22px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.accept-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.accept-btn:not(:disabled):hover {
  background: #f0f0f2;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* ========================================================
   3. LOGS DRAWER / MODAL
   ======================================================== */
.logs-card {
  width: 100%;
  max-width: 780px;
  max-height: 86vh;
}

.logs-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-btn-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.76rem;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.action-btn-sm:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--border-active);
}

.logs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-entry-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 14px 18px;
  transition: all 0.2s ease;
}

.log-entry-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.log-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.log-id-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.log-id {
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.log-status-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(52, 199, 89, 0.15);
  color: #4cd964;
  border: 1px solid rgba(52, 199, 89, 0.3);
}

.log-status-tag.timeout {
  background: rgba(255, 149, 0, 0.15);
  color: #ff9500;
  border-color: rgba(255, 149, 0, 0.3);
}

.log-time {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.log-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.log-voice-tag {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
}

.log-duration-pill {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.logs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

.logs-empty svg {
  opacity: 0.4;
}

/* ========================================================
   4. "TIME LEFT" POPOVER WIDGET
   ======================================================== */
.time-left-widget {
  position: absolute;
  top: calc(100% + 14px);
  right: 12px;
  width: 320px;
  background: rgba(14, 14, 18, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 30px rgba(255, 255, 255, 0.03);
  z-index: 500;
  animation: fadeInDown 0.2s ease-out;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.time-widget-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.time-widget-main-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.widget-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.widget-close-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.time-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.time-widget-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.time-widget-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.time-widget-content {
  display: flex;
  align-items: center;
  gap: 18px;
}

.meter-ring-container {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.meter-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.meter-bg-circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 6;
}

.meter-progress-circle {
  fill: none;
  stroke: var(--accent-white);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s ease;
}

.meter-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.time-widget-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.time-remaining-number {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.time-total-label {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.time-widget-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.reset-quota-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.reset-quota-btn:hover {
  color: var(--accent-white);
}

/* ========================================================
   5. TIME EXPIRED MODAL
   ======================================================== */
.expired-modal-card {
  max-width: 440px;
  text-align: center;
  padding: 34px 28px;
}

.expired-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 170, 0, 0.15);
  border: 1px solid rgba(255, 170, 0, 0.3);
  color: #ffaa00;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px auto;
}

.expired-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.expired-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}


/* --- Enhanced 2-Section Time Left Widget --- */
.time-left-widget {
  width: 345px;
  gap: 14px;
  padding: 20px;
}

.widget-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.widget-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-header-icon {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.widget-header-icon.access-icon {
  color: #64d2ff;
}

.widget-sub-hint {
  font-size: 0.69rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.widget-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 2px 0;
}

.portal-timer-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.25s ease;
}

.portal-timer-card:hover {
  border-color: rgba(100, 210, 255, 0.2);
  background: rgba(100, 210, 255, 0.03);
}

.portal-countdown-display {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: #64d2ff;
  text-shadow: 0 0 14px rgba(100, 210, 255, 0.25);
  transition: color 0.3s ease;
}

.portal-countdown-display.expired {
  color: #ff453a;
  text-shadow: 0 0 14px rgba(255, 69, 58, 0.25);
}

.portal-countdown-sub {
  font-size: 0.73rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.portal-progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 3px;
}

.portal-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0a84ff, #64d2ff);
  border-radius: 999px;
  transition: width 0.5s ease;
}

.portal-progress-bar.warning {
  background: linear-gradient(90deg, #ff9f0a, #ffd60a);
}

.portal-progress-bar.expired {
  background: #ff453a;
}

.time-widget-badge.access-badge.active {
  background: rgba(100, 210, 255, 0.12);
  color: #64d2ff;
  border: 1px solid rgba(100, 210, 255, 0.3);
}

.time-widget-badge.access-badge.warning {
  background: rgba(255, 159, 10, 0.12);
  color: #ff9f0a;
  border: 1px solid rgba(255, 159, 10, 0.3);
}

.time-widget-badge.access-badge.expired {
  background: rgba(255, 69, 58, 0.14);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.3);
}

/* ========================================================
   RESPONSIVE DESIGN SYSTEM (MOBILE, TABLET & HYBRID DEVICES)
   ======================================================== */

/* --- 1. Tablet & Small Laptop (1024px and below) --- */
@media (max-width: 1024px) {
  .app-container {
    padding: 20px 24px;
  }

  .app-header {
    padding: 8px 12px 8px 20px;
  }

  .header-status {
    gap: 6px;
  }

  .voice-pill {
    padding: 5px 10px 5px 12px;
  }

  .nav-btn-pill {
    padding: 6px 11px;
    font-size: 0.77rem;
    gap: 5px;
  }

  .timer-pill {
    padding: 5px 11px;
    font-size: 0.77rem;
  }

  .user-pill {
    padding: 5px 10px;
    font-size: 0.76rem;
  }

  .user-name {
    max-width: 85px;
  }

  .visualizer-stage {
    width: 290px;
    height: 290px;
  }

  .ring-outer {
    width: 275px;
    height: 275px;
  }

  .ring-mid {
    width: 210px;
    height: 210px;
  }

  .ring-inner {
    width: 155px;
    height: 155px;
  }
}

/* --- 2. Tablet Portrait & Large Mobile (768px and below) --- */
@media (max-width: 768px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .app-container {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 14px 16px;
    gap: 16px;
    justify-content: space-between;
  }

  /* Single-tier floating mobile header pill */
  .app-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-radius: 999px;
    padding: 8px 14px 8px 20px;
    position: relative;
    width: 100%;
  }

  .brand {
    justify-content: flex-start;
    width: auto;
  }

  .brand-logo {
    height: 28px;
    max-width: 30px;
  }

  .brand-name {
    font-size: 0.9rem;
    letter-spacing: 0.18em;
  }

  /* Hamburger Menu Toggle Button on Mobile */
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
  }

  .mobile-menu-btn:hover,
  .mobile-menu-btn.active {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.32);
    color: #fff;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.1);
  }

  /* Hidden by default on mobile, revealed as dropdown card when toggled */
  .header-status {
    display: none;
  }

  .header-status.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: auto;
    width: 270px;
    max-width: calc(100vw - 28px);
    background: rgba(14, 14, 20, 0.96);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    padding: 12px;
    gap: 8px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(255, 255, 255, 0.04);
    z-index: 600;
    transform-origin: top right;
    animation: fadeInDown 0.22s ease-out;
  }

  /* Full-width vertical rows inside the mobile dropdown */
  .header-status.mobile-open .voice-pill {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .header-status.mobile-open .voice-dropdown {
    font-size: 0.88rem;
  }

  .header-status.mobile-open .nav-btn-pill {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 0.86rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .header-status.mobile-open .timer-pill {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 0.86rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .header-status.mobile-open .user-pill {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 0.86rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .header-status.mobile-open .user-name {
    max-width: none;
  }

  /* Anchor Time Left widget directly below navbar header on mobile */
  .time-left-widget {
    position: absolute;
    top: calc(100% + 10px);
    bottom: auto;
    right: 0;
    left: auto;
    width: 320px;
    max-width: calc(100vw - 28px);
    margin: 0;
    max-height: calc(100dvh - 85px);
    overflow-y: auto;
    border-radius: 20px;
    z-index: 700;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(255, 255, 255, 0.04);
  }

  /* Main Stage & Visualizer */
  .main-content {
    gap: 24px;
    padding: 12px 0;
  }

  .visualizer-stage {
    width: 260px;
    height: 260px;
  }

  .ambient-glow {
    width: 210px;
    height: 210px;
  }

  .visualizer-stage.speaking .ambient-glow {
    width: 290px;
    height: 290px;
  }

  .ring-outer {
    width: 245px;
    height: 245px;
  }

  .ring-mid {
    width: 190px;
    height: 190px;
  }

  .ring-inner {
    width: 140px;
    height: 140px;
  }

  .orb-core {
    width: 105px;
    height: 105px;
  }

  .orb-icon svg {
    width: 28px;
    height: 28px;
  }

  .interaction-info {
    max-width: 100%;
    padding: 0 12px;
  }

  .state-title {
    font-size: 1.35rem;
    margin-bottom: 6px;
  }

  .state-subtitle {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  .waveform-container {
    width: 200px;
    height: 34px;
  }

  /* Footer & Action Button */
  .app-footer {
    width: 100%;
    gap: 12px;
    padding-bottom: 6px;
  }

  .primary-btn {
    width: 100%;
    max-width: 340px;
    padding: 14px 28px;
    min-height: 50px;
    font-size: 0.98rem;
  }

  .footer-hint {
    font-size: 0.72rem;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 0 10px;
  }

  /* Modals on Mobile & Tablet */
  .modal-backdrop {
    padding: 14px;
  }

  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: 90dvh;
    border-radius: 20px;
  }

  .modal-header {
    padding: 18px 20px 14px;
  }

  .modal-title {
    font-size: 1.15rem;
  }

  .modal-subtitle {
    font-size: 0.76rem;
  }

  .modal-body {
    padding: 16px 20px;
    max-height: calc(88dvh - 160px);
    gap: 12px;
  }

  .modal-footer {
    padding: 16px 20px 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .accept-btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .log-entry-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }

  .log-right {
    width: 100%;
    justify-content: space-between;
  }

  .login-overlay {
    padding: 14px;
  }

  .login-card {
    padding: 30px 22px;
    border-radius: 20px;
  }

  .form-input {
    font-size: 16px; /* Prevents auto-zoom on iOS Safari */
    padding: 12px 14px 12px 42px;
  }

  .login-btn {
    min-height: 48px;
  }
}

/* --- 3. Compact Mobile (480px and below) --- */
@media (max-width: 480px) {
  .app-container {
    padding: 10px 12px;
    gap: 14px;
  }

  .app-header {
    padding: 7px 10px 7px 16px;
    border-radius: 999px;
  }

  .brand-logo {
    height: 24px;
    max-width: 26px;
  }

  .brand-name {
    font-size: 0.82rem;
    letter-spacing: 0.16em;
  }

  .mobile-menu-btn {
    width: 34px;
    height: 34px;
  }

  .header-status.mobile-open {
    width: 250px;
    max-width: calc(100vw - 24px);
    padding: 10px;
    gap: 7px;
    border-radius: 18px;
  }

  .header-status.mobile-open .voice-pill,
  .header-status.mobile-open .nav-btn-pill,
  .header-status.mobile-open .timer-pill,
  .header-status.mobile-open .user-pill {
    padding: 9px 12px;
    font-size: 0.82rem;
  }

  .nav-pill-badge {
    font-size: 0.64rem;
    padding: 1px 5px;
  }

  .visualizer-stage {
    width: 220px;
    height: 220px;
  }

  .ambient-glow {
    width: 175px;
    height: 175px;
  }

  .visualizer-stage.speaking .ambient-glow {
    width: 240px;
    height: 240px;
  }

  .ring-outer {
    width: 210px;
    height: 210px;
  }

  .ring-mid {
    width: 165px;
    height: 165px;
  }

  .ring-inner {
    width: 120px;
    height: 120px;
  }

  .orb-core {
    width: 88px;
    height: 88px;
  }

  .orb-icon svg {
    width: 24px;
    height: 24px;
  }

  .state-title {
    font-size: 1.2rem;
  }

  .state-subtitle {
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .waveform-container {
    width: 175px;
    height: 30px;
  }

  .primary-btn {
    padding: 13px 22px;
    min-height: 48px;
    font-size: 0.94rem;
  }

  .login-card {
    padding: 24px 16px;
  }

  .login-title {
    font-size: 1.22rem;
  }

  .login-subtitle {
    font-size: 0.78rem;
  }

  .guideline-item {
    padding: 12px;
    gap: 10px;
  }

  .guideline-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
  }

  .guideline-title {
    font-size: 0.88rem;
  }

  .guideline-desc {
    font-size: 0.76rem;
  }

  .time-left-widget {
    padding: 16px 14px;
    gap: 12px;
    top: calc(100% + 8px);
    bottom: auto;
    right: 0;
    left: auto;
    width: 100%;
    max-width: 310px;
  }

  .portal-countdown-display {
    font-size: 1.18rem;
  }
}

/* --- 4. Foldables & Ultra-Narrow Phones (360px and below) --- */
@media (max-width: 360px) {
  .app-container {
    padding: 8px 10px;
  }

  .brand-name {
    font-size: 0.78rem;
  }

  .visualizer-stage {
    width: 190px;
    height: 190px;
  }

  .ring-outer {
    width: 180px;
    height: 180px;
  }

  .ring-mid {
    width: 140px;
    height: 140px;
  }

  .ring-inner {
    width: 100px;
    height: 100px;
  }

  .orb-core {
    width: 76px;
    height: 76px;
  }

  .portal-countdown-display {
    font-size: 1.05rem;
  }
}

/* --- 5. Mobile Landscape Orientation (height <= 580px) --- */
@media (max-height: 580px) and (orientation: landscape) {
  body {
    overflow-y: auto;
  }

  .app-container {
    height: auto;
    min-height: 100dvh;
    padding: 8px 16px;
    gap: 12px;
  }

  .app-header {
    padding: 6px 12px;
  }

  .main-content {
    gap: 10px;
    padding: 4px 0;
  }

  .visualizer-stage {
    width: 160px;
    height: 160px;
  }

  .ambient-glow {
    width: 130px;
    height: 130px;
  }

  .visualizer-stage.speaking .ambient-glow {
    width: 180px;
    height: 180px;
  }

  .ring-outer {
    width: 150px;
    height: 150px;
  }

  .ring-mid {
    width: 115px;
    height: 115px;
  }

  .ring-inner {
    width: 85px;
    height: 85px;
  }

  .orb-core {
    width: 64px;
    height: 64px;
  }

  .orb-icon svg {
    width: 20px;
    height: 20px;
  }

  .state-title {
    font-size: 1.05rem;
    margin-bottom: 2px;
  }

  .state-subtitle {
    font-size: 0.78rem;
  }

  .waveform-container {
    height: 24px;
    width: 150px;
  }

  .primary-btn {
    padding: 10px 20px;
    min-height: 42px;
    font-size: 0.88rem;
  }

  .footer-hint {
    display: none; /* Hide non-critical microcopy in landscape to save vertical viewport */
  }

  .modal-card {
    max-height: 94dvh;
  }

  .modal-body {
    max-height: calc(90dvh - 120px);
  }
}

/* --- 6. Touch Hardware Optimizations (Mobile / Tablet) --- */
@media (hover: none) {
  .primary-btn:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
  }

  .primary-btn:active {
    transform: scale(0.97);
    background: #e5e5ea;
  }

  .nav-btn-pill:hover,
  .voice-pill:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
  }

  .nav-btn-pill:active,
  .voice-pill:active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
  }
}

/* ==========================================================================
   7. CLINIC DASHBOARD & TOP NAVBAR EXTENSIONS
   ========================================================================== */

/* Full view screens (Demo and Dashboard) fill container properly */
.view-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

/* Top Navigation Bar Row (Navbar moved slightly left + Dashboard Button on right) */
.top-nav-bar-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  position: relative;
  z-index: 100;
}

/* Dedicated Dashboard Trigger Button */
.nav-dashboard-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 50px;
  background: rgba(14, 14, 19, 0.78);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0 18px;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(255, 255, 255, 0.02);
  white-space: nowrap;
  flex: 0 0 auto;
  flex-shrink: 0;
}

.nav-dashboard-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.nav-dashboard-trigger-btn:active {
  transform: scale(0.97);
}

/* Desktop Only: Ensure Demo Navbar retains its EXACT original size, padding, and single-line layout */
@media (min-width: 769px) {
  .top-nav-bar-row .app-header.demo-header {
    width: max-content;
    max-width: fit-content;
    flex: 0 0 auto;
    flex-shrink: 0;
    padding: 8px 14px 8px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
  }

  .top-nav-bar-row .app-header.demo-header .brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .top-nav-bar-row .app-header.demo-header .header-status {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    flex-wrap: nowrap;
  }

  .top-nav-bar-row .app-header.demo-header .voice-pill,
  .top-nav-bar-row .app-header.demo-header .nav-btn-pill,
  .top-nav-bar-row .app-header.demo-header .timer-pill,
  .top-nav-bar-row .app-header.demo-header .user-pill {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .top-nav-bar-row .app-header.demo-header .nav-btn-pill span,
  .top-nav-bar-row .app-header.demo-header .timer-pill span {
    white-space: nowrap !important;
  }

  .app-header.dashboard-header {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 8px 16px 8px 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .dash-top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .dash-tabs-bar {
    display: flex;
    align-items: center;
    gap: 8px;
  }
}

/* Dashboard Navigation Buttons & Pills Base */
.dash-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dash-back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.dash-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 6px 16px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dash-tab-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.dash-tab-btn.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.38);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.08);
}

/* Dashboard Badge in Header */
.dashboard-badge {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 2px 7px;
  border-radius: 6px;
  color: #e4e4e7;
  margin-left: 6px;
  text-transform: uppercase;
}

.dashboard-nav-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Active Navigation Pill State */
.nav-btn-pill.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.38);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
}

/* Dashboard Body & Layout */
.dashboard-main-content {
  width: 100%;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.3s ease-out;
}

.dash-tab-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

/* Generic Dashboard Glass Card */
.dash-card {
  background: rgba(14, 14, 19, 0.76);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 22px 26px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.dash-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Clinic Hero Card */
.clinic-hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 24px 30px;
  background: linear-gradient(135deg, rgba(22, 22, 30, 0.85) 0%, rgba(12, 12, 16, 0.9) 100%);
}

.clinic-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.clinic-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0;
}

.clinic-plan-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e4e4e7;
}

.clinic-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 3px 9px;
  border-radius: 999px;
}

.clinic-status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.clinic-subtext {
  font-size: 0.86rem;
  color: #a1a1aa;
  margin: 0;
}

.clinic-meta-pills {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 8px 14px;
  border-radius: 12px;
}

.meta-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #71717a;
}

.meta-val {
  font-size: 0.8rem;
  font-weight: 500;
  color: #e4e4e7;
}

/* KPI Cards Grid */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
}

.dash-kpi-card {
  background: rgba(14, 14, 19, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.dash-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

.kpi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #71717a;
  text-transform: uppercase;
}

.kpi-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #d4d4d8;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 4px 0 10px;
}

.kpi-primary-val {
  font-size: 2.1rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -0.03em;
}

.kpi-unit {
  font-size: 0.88rem;
  font-weight: 500;
  color: #a1a1aa;
}

.kpi-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.kpi-progress-fill {
  height: 100%;
  background: #ffffff;
  border-radius: 999px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.kpi-card-sub {
  font-size: 0.74rem;
  color: #a1a1aa;
}

.kpi-card-sub strong {
  color: #ffffff;
}

/* Secondary Two-Column Grid */
.dash-two-column-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dash-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.01em;
}

.dash-card-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
}

/* Outcome List */
.outcome-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.outcome-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.outcome-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.outcome-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-booked {
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.dot-info {
  background: #a1a1aa;
}

.dot-misc {
  background: #52525b;
}

.outcome-name {
  font-size: 0.82rem;
  color: #d4d4d8;
}

.outcome-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
}

/* Recent Calls Mini List */
.recent-calls-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.recent-call-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.call-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.call-session-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 6px;
  color: #ffffff;
}

.call-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.call-id {
  font-size: 0.78rem;
  color: #e4e4e7;
  font-family: monospace;
}

.call-duration {
  font-size: 0.7rem;
  color: #71717a;
}

.call-status-pill {
  font-size: 0.68rem;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Appointments Section */
.dash-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(14, 14, 19, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 16px;
  min-width: 320px;
  color: #ffffff;
}

.filter-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.82rem;
  width: 100%;
}

.filter-search-box input::placeholder {
  color: #71717a;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-chips {
  display: flex;
  gap: 6px;
  background: rgba(14, 14, 19, 0.6);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-chip {
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: #a1a1aa;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip.active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.dash-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dash-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Appointments Table Card */
.appts-table-card {
  padding: 0;
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.83rem;
}

.dash-table th {
  padding: 14px 18px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #71717a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(20, 20, 26, 0.5);
  white-space: nowrap;
}

.dash-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
  color: #d4d4d8;
}

.dash-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.patient-name {
  font-weight: 600;
  color: #ffffff;
}

.td-phone code {
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #e4e4e7;
}

.date-chip {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 0.76rem;
  color: #ffffff;
  white-space: nowrap;
}

.status-chip {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.chip-confirmed {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.chip-cancelled {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.summary-preview {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #a1a1aa;
  font-size: 0.8rem;
}

.action-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.action-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

.table-loading,
.table-empty,
.table-error {
  text-align: center;
  padding: 36px 20px;
  color: #71717a;
  font-size: 0.86rem;
}

/* Patient Context Modal */
.dash-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.dash-modal-card {
  background: rgba(18, 18, 24, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  max-width: 580px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.25s ease-out;
}

.dash-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px;
}

.dash-modal-sub {
  font-size: 0.78rem;
  color: #a1a1aa;
  margin: 0;
}

.dash-modal-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dash-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.dash-modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
}

.ctx-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ctx-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #71717a;
  text-transform: uppercase;
}

.ctx-value {
  font-size: 0.85rem;
  color: #e4e4e7;
  line-height: 1.45;
}

.ctx-summary-box {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid #ffffff;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 0.84rem;
  color: #ffffff;
  line-height: 1.5;
}

.dash-modal-footer {
  padding: 14px 24px 20px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #000000;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dash-secondary-btn:hover {
  background: #e4e4e7;
  transform: translateY(-1px);
}

/* Media Queries for Dashboard Responsive Adjustments */
@media (max-width: 1024px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-two-column-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* ========================================================
     MOBILE: Demo Screen Navigation Bar Row
     ======================================================== */
  .top-nav-bar-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    position: relative;
    z-index: 100;
  }

  .top-nav-bar-row .app-header.demo-header {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px 12px 6px 16px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-radius: 999px;
    position: static;
  }

  .top-nav-bar-row .app-header.demo-header .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
  }

  .top-nav-bar-row .app-header.demo-header .brand-logo {
    height: 22px;
    max-width: 24px;
  }

  .top-nav-bar-row .app-header.demo-header .brand-name {
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    white-space: nowrap;
  }

  .top-nav-bar-row .app-header.demo-header .mobile-menu-btn {
    display: flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .top-nav-bar-row .app-header.demo-header .header-status {
    display: none;
  }

  .top-nav-bar-row .app-header.demo-header .header-status.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: rgba(14, 14, 20, 0.96);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    padding: 12px;
    gap: 8px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
    z-index: 600;
  }

  /* Dedicated Dashboard Trigger Button on Mobile */
  .nav-dashboard-trigger-btn {
    height: 44px;
    padding: 0 14px;
    font-size: 0.78rem;
    border-radius: 999px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  }

  /* ========================================================
     MOBILE: Dashboard Header (Adaptive Two-Tier Navigation)
     ======================================================== */
  .app-header.dashboard-header {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 14px !important;
    border-radius: 18px !important;
    background: rgba(14, 14, 19, 0.88) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  .dash-top-bar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .dash-top-bar .brand {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
  }

  .dash-top-bar .brand .brand-logo {
    height: 22px !important;
    max-width: 24px !important;
  }

  .dash-top-bar .brand .brand-name {
    font-size: 0.82rem !important;
    letter-spacing: 0.14em !important;
  }

  .dashboard-badge {
    font-size: 0.58rem !important;
    padding: 2px 6px !important;
    margin-left: 4px !important;
  }

  .dash-back-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    border-radius: 999px !important;
    padding: 6px 14px !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  .dash-tabs-bar {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: rgba(255, 255, 255, 0.04) !important;
    padding: 4px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .dash-tab-btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: 38px !important;
    border-radius: 10px !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    background: transparent !important;
    border: none !important;
    color: #a1a1aa !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    padding: 0 8px !important;
  }

  .dash-tab-btn.active {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35) !important;
  }

  .dash-tab-btn span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* ========================================================
     MOBILE: Dashboard Content Sections
     ======================================================== */
  .dashboard-main-content {
    margin-top: 14px;
    gap: 16px;
  }

  .dash-card {
    padding: 16px 18px;
    border-radius: 18px;
  }

  /* Hero Clinic Card */
  .clinic-hero-card {
    padding: 16px 18px;
    border-radius: 18px;
    gap: 14px;
    flex-direction: column;
    align-items: flex-start;
  }

  .clinic-title-row {
    gap: 8px;
    margin-bottom: 4px;
  }

  .clinic-name {
    font-size: 1.25rem;
  }

  .clinic-plan-badge {
    font-size: 0.68rem;
    padding: 3px 8px;
  }

  .clinic-status-badge {
    font-size: 0.66rem;
    padding: 2px 7px;
  }

  .clinic-subtext {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .clinic-meta-pills {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .meta-item {
    width: 100%;
    padding: 8px 12px;
  }

  /* Compact 2x2 KPI Grid */
  .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .dash-kpi-card {
    padding: 12px 14px;
    border-radius: 16px;
  }

  .kpi-label {
    font-size: 0.62rem;
  }

  .kpi-icon-wrap {
    width: 24px;
    height: 24px;
  }

  .kpi-icon-wrap svg {
    width: 13px;
    height: 13px;
  }

  .kpi-value-row {
    margin: 2px 0 6px;
  }

  .kpi-primary-val {
    font-size: 1.45rem;
  }

  .kpi-unit {
    font-size: 0.72rem;
  }

  .kpi-card-sub {
    font-size: 0.68rem;
    line-height: 1.25;
  }

  /* Secondary Grid (Single column on mobile) */
  .dash-two-column-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Appointments Filter Bar */
  .dash-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .filter-search-box {
    min-width: unset;
    width: 100%;
    padding: 8px 14px;
  }

  .filter-actions {
    justify-content: space-between;
    gap: 8px;
  }

  .filter-chips {
    gap: 4px;
    padding: 3px;
  }

  .filter-chip {
    padding: 5px 10px;
    font-size: 0.72rem;
  }

  .dash-refresh-btn {
    padding: 6px 12px;
    font-size: 0.72rem;
  }

  /* Appointments Table & Horizontal Scroll */
  .appts-table-card {
    border-radius: 18px;
  }

  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dash-table {
    min-width: 580px;
  }

  .dash-table th,
  .dash-table td {
    padding: 10px 14px;
    font-size: 0.78rem;
  }

  /* Patient Context Modal */
  .dash-modal-card {
    max-width: calc(100vw - 24px);
    width: 100%;
    max-height: 85vh;
    border-radius: 18px;
  }

  .dash-modal-header {
    padding: 14px 18px 12px;
  }

  .dash-modal-body {
    padding: 14px 18px;
    max-height: 55vh;
  }

  .dash-modal-footer {
    padding: 12px 18px 16px;
  }
}

/* --- Micro-Mobile Adjustments (480px and below) --- */
@media (max-width: 480px) {
  .nav-dashboard-trigger-btn {
    padding: 0 10px;
    font-size: 0.74rem;
    height: 40px;
  }

  .top-nav-bar-row .app-header.demo-header {
    height: 40px;
    padding: 4px 10px 4px 12px;
  }

  .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .dash-kpi-card {
    padding: 10px 12px;
  }

  .kpi-primary-val {
    font-size: 1.3rem;
  }
}

