/* Gifted App UI - Clean, Modern White Mode (AirVTing / Apple Shopping Aesthetic)
   Palette: Crisp Pure White (#FFFFFF), Subtle Cloud Gray (#F8FAFC), Slate Ink (#0F172A),
   Vibrant Electric Violet (#7928CA) and Energetic Coral Pink (#FF5E7E) accents.
*/
:root {
  --primary: #7928CA;
  --primary-gradient: linear-gradient(135deg, #7928CA 0%, #FF5E7E 100%);
  --accent: #FF5E7E;
  --accent-cyan: #0284C7;
  --accent-green: #10B981;
  --gold: #D97706;
  --gold-bg: rgba(217, 119, 6, 0.1);
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --card-elevated: #F8FAFC;
  --ink: #0F172A;
  --ink-secondary: #334155;
  --body: #64748B;
  --muted: #94A3B8;
  --border: #E2E8F0;
  --border-focus: #7928CA;
  --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 4px 16px rgba(121, 40, 202, 0.2);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: #F1F5F9;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 16px;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.phone {
  width: 420px;
  max-width: 100%;
  background: #FFFFFF;
  border-radius: 40px;
  padding: 12px;
  border: 1px solid #CBD5E1;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.screen {
  background: var(--bg);
  border-radius: 30px;
  overflow: hidden;
  height: 770px;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid #F1F5F9;
}

/* Header */
.appbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(120deg, #7928CA 0%, #FF5E7E 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.role-switch {
  display: flex;
  background: #F1F5F9;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}

.role-btn {
  border: none;
  background: transparent;
  color: var(--body);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 16px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.role-btn.on {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(121, 40, 202, 0.3);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wallet-pill {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-family: var(--font-display);
  transition: all 0.15s;
}

.wallet-pill:hover {
  background: #FEF3C7;
  border-color: #FCD34D;
}

.auth-icon-btn {
  background: #F8FAFC;
  border: 1px solid var(--border);
  color: var(--ink-secondary);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.auth-icon-btn:hover { background: #F1F5F9; }

/* Main Dynamic View */
.view {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 20px;
  position: relative;
  background: #FFFFFF;
}
.view::-webkit-scrollbar { width: 0; }

/* Dedicated Page / Screen Headers */
.page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.back-btn {
  background: #F1F5F9;
  border: 1px solid var(--border);
  color: var(--ink);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.15s;
}
.back-btn:hover { background: #E2E8F0; }

h2 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.4px;
}
h3 {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--ink);
  font-weight: 700;
  margin: 12px 0 6px;
}
.sub {
  color: var(--body);
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 12px;
}

/* Card Styling */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 15px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.card-elevated {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
}

/* Tabbar */
.tabbar {
  display: flex;
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  padding: 6px 4px 6px;
  z-index: 40;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}
.tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 4px 2px;
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: var(--font-body);
  transition: color 0.15s;
  overflow: hidden;
  box-sizing: border-box;
}
.tab svg {
  flex-shrink: 0;
}
.tab span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}
.tab.active {
  color: var(--primary);
}
.tab.active svg {
  stroke: var(--primary);
}

/* Form Controls & Inputs (Crisp White Styling) */
label {
  font-size: 12px;
  color: var(--ink-secondary);
  font-weight: 700;
  display: block;
  margin: 10px 0 5px;
  letter-spacing: 0.1px;
}
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  background: #FFFFFF;
  color: var(--ink);
  font-family: var(--font-body);
  transition: all 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(121, 40, 202, 0.12);
}
select {
  cursor: pointer;
  background-color: #FFFFFF;
}

/* Chips / Tag Buttons */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.chip {
  border: 1px solid var(--border);
  background: #F8FAFC;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 11.5px;
  cursor: pointer;
  color: var(--ink-secondary);
  font-family: var(--font-body);
  font-weight: 600;
  transition: all 0.15s ease;
}
.chip:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: var(--ink);
}
.chip.on {
  background: var(--primary-gradient);
  border-color: transparent;
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(121, 40, 202, 0.3);
}

/* Quick Time Selection Chips & Slots */
.quick-time-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 8px 0;
}
.quick-time-btn {
  background: #F8FAFC;
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s;
}
.quick-time-btn:hover {
  background: #F1F5F9;
  border-color: var(--primary);
  color: var(--primary);
}
.quick-time-btn.selected {
  background: #F5F3FF;
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.slots-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.slot-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.slot-tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: #F5F3FF;
  border: 1px solid #DDD6FE;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Action Buttons */
.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  background: var(--primary-gradient);
  color: #FFFFFF;
  font-family: var(--font-body);
  text-align: center;
  box-shadow: var(--shadow-glow);
  transition: transform 0.12s, filter 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:hover { filter: brightness(1.05); }
.btn.green {
  background: linear-gradient(135deg, #059669 0%, #10B981 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
  color: #FFFFFF;
  font-weight: 800;
}
.btn.small {
  display: inline-block;
  width: auto;
  padding: 7px 14px;
  font-size: 12px;
  border-radius: 20px;
}
.btn.ghost {
  background: #F8FAFC;
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.ghost:hover { background: #F1F5F9; }
.btn.outline {
  background: transparent;
  color: var(--body);
  border: 1px solid var(--border);
  box-shadow: none;
}

/* Tutor Card */
.tutor-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.tutor-card:hover {
  transform: translateY(-2px);
  border-color: #DDD6FE;
  box-shadow: 0 8px 20px rgba(121, 40, 202, 0.08);
}
.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7928CA 0%, #FF5E7E 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  flex-shrink: 0;
  border: 2px solid #FFFFFF;
  box-shadow: 0 4px 12px rgba(121, 40, 202, 0.2);
}
.tutor-info { flex: 1; min-width: 0; }
.tutor-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}
.fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 19px;
  color: #CBD5E1;
  transition: transform 0.15s, color 0.15s;
}
.fav-btn.favorited {
  color: var(--accent);
  transform: scale(1.15);
}
.header-fav-btn {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: #FFFFFF;
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.header-fav-btn:hover {
  background: #FFF1F2;
  border-color: #FECDD3;
  color: var(--accent);
  transform: scale(1.05);
}
.header-fav-btn:active {
  transform: scale(0.95);
}
.header-fav-btn.favorited {
  background: #FFF1F2;
  border-color: #FECDD3;
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(255, 94, 126, 0.2);
}
.status-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: #F5F3FF;
  color: var(--primary);
  border: 1px solid #DDD6FE;
  margin: 3px 0 5px;
}
.stars {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}
.stars small { color: var(--body); font-weight: 600; }
.avail-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #0369A1;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 6px;
}

.rate-badge-box {
  text-align: right;
  flex-shrink: 0;
}
.rate-val {
  font-family: var(--font-display);
  color: var(--primary);
  font-size: 16px;
  font-weight: 800;
}
.rate-unit {
  color: var(--muted);
  font-size: 10px;
  display: block;
}

/* Schedule & Coins Clean Display */
.schedule-item {
  border-left: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.schedule-time {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}
.schedule-desc {
  font-size: 12.5px;
  color: var(--ink-secondary);
}
.coin-display {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--gold);
}

/* Live Classroom: Maximized Stage + Collapsible Chat */
.live-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: #090B10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  color: #FFFFFF;
}
.live-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(19, 21, 29, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 100;
  position: relative;
  flex-shrink: 0;
}
.live-topbar .btn {
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 101;
  min-height: 38px;
  min-width: 84px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.live-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 10px rgba(255, 94, 126, 0.4);
}
.rec-badge {
  background: #DC2626;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: rec-blink 1.2s ease-in-out infinite;
}
@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.stage-wrapper {
  flex: 1;
  min-height: 220px;
  position: relative;
  background: #05070A;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: flex 0.25s ease;
}
.stage-wrapper.expanded {
  flex: 1 0 auto;
}

/* Whiteboard Overlay Canvas */
.board-container {
  position: absolute;
  inset: 0;
  background: #FFFFFF;
  z-index: 30;
  display: flex;
  flex-direction: column;
}
.board-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}
.wb-color {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #94A3B8;
  cursor: pointer;
}
.wb-color.on { box-shadow: 0 0 0 2px var(--primary); }

.screen-share-box {
  position: absolute;
  inset: 0;
  background: #06080E;
  z-index: 25;
  display: flex;
  flex-direction: column;
}
.screen-share-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.85);
  font-size: 11.5px;
}

/* Compact Action Dock */
.action-dock {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: #141721;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 15;
}
.dock-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #E2E8F0;
  border-radius: var(--radius-md);
  padding: 6px 8px;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  min-width: 56px;
  transition: all 0.15s;
}
.dock-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Go Live staging dock — light theme so buttons are clearly visible */
.dock-light {
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  padding: 10px;
  gap: 8px;
}
.dock-light .dock-btn {
  background: #F5F3FF;
  border: 1px solid #DDD6FE;
  color: var(--primary);
  min-height: 48px;
  min-width: 70px;
  font-size: 10.5px;
}
.dock-light .dock-btn:hover {
  background: #EDE9FE;
}
.dock-light .dock-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(121, 40, 202, 0.3);
}
.dock-light .dock-btn span:first-child { font-size: 15px; }
.dock-btn.danger {
  background: #DC2626;
  border-color: #DC2626;
  color: #fff;
}

/* Collapsible Live Chat Header & Tray */
.chat-tray-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #181C28;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}
.chat-tray-header span {
  font-size: 11px;
  font-weight: 700;
  color: #CBD5E1;
}
.chat-tray-toggle {
  background: none;
  border: none;
  color: #38BDF8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
}

.live-chat-wrap {
  transition: height 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  overflow: hidden;
  background: #10131C;
}
.live-chat-wrap.collapsed {
  height: 0 !important;
  opacity: 0;
  pointer-events: none;
}
.live-chat {
  height: 110px;
  overflow-y: auto;
  padding: 8px 12px;
  font-size: 11.5px;
}
.chat-msg {
  margin-bottom: 5px;
  line-height: 1.4;
  color: #E2E8F0;
}
.chat-msg b { color: #38BDF8; }
.chat-file-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 4px;
  font-size: 10.5px;
  color: #38BDF8;
  text-decoration: none;
}

.live-composer {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: #181C28;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.live-composer input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 7px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}
.attach-menu-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #38BDF8;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.send-btn {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #0F172A;
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 12.5px;
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  max-width: 320px;
  font-weight: 600;
  border: 1px solid var(--primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 100;
}
.toast.show {
  transform: translateX(-50%);
  opacity: 1;
}

.empty {
  text-align: center;
  color: var(--body);
  padding: 30px 14px;
  font-size: 13px;
  line-height: 1.5;
}
table.rates {
  width: 100%;
  font-size: 12.5px;
  border-collapse: collapse;
}
table.rates td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-secondary);
}

/* Avatar with small combined edit chip (upload / change / remove) */
.avatar-wrap {
  position: relative;
  display: inline-block;
  margin: 0 auto 6px;
}
.avatar-wrap .avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-edit-chip {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.avatar-edit-chip:hover { transform: scale(1.12); background: #6420aa; }

/* Signed-out mode: on Sign In / Create Account screens, hide logged-in chrome */
body.auth-open .tabbar,
body.auth-open .wallet-pill,
body.auth-open .role-switch {
  display: none !important;
}

/* Demo-only chrome (admin testing): hidden on the real APK */
.demo-bar {
  display: flex; align-items: center; gap: 8px;
  background: #FFF7ED; border: 1px dashed #F59E0B;
  border-radius: 10px; padding: 6px 10px; margin: 8px 0;
  font-size: 11px; color: #92400E; font-weight: 600;
}
.demo-bar .btn { padding: 3px 10px; font-size: 10.5px; }

/* ============================================================
   APP MODE — real device / WebView fullscreen
   (app.js adds class "app-mode" to <body> when not in a
   desktop browser; removes the desktop phone frame)
   ============================================================ */
body.app-mode {
  padding: 0;
  background: var(--bg);
  align-items: stretch;
  display: block;
  min-height: 100dvh;
}
body.app-mode .phone {
  width: 100%;
  max-width: none;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: var(--bg);
}
body.app-mode .screen {
  height: 100vh;
  height: 100dvh;
  border: none;
  border-radius: 0;
}
body.app-mode::before,
body.app-mode::after {
  display: none;
}

/* Responsive Fallback: on mobile viewports (< 768px), always fill the screen edge-to-edge */
@media (max-width: 768px) {
  body {
    padding: 0 !important;
    background: var(--bg) !important;
    display: block !important;
    min-height: 100dvh !important;
  }
  .phone {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: var(--bg) !important;
  }
  .screen {
    height: 100vh !important;
    height: 100dvh !important;
    border: none !important;
    border-radius: 0 !important;
  }
}

/* ============================================================
   LIVE ROOM FULLSCREEN MODE (Zero chrome, zero overlapping tabs)
   ============================================================ */
body.live-open .appbar,
body.live-open .tabbar,
body.live-open .demo-bar {
  display: none !important;
}

body.live-open .screen {
  height: 100vh !important;
  height: 100dvh !important;
  background: #090B10 !important;
}

body.live-open .view {
  padding: 0 !important;
  margin: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  background: #090B10 !important;
}

body.live-open .live-container {
  height: 100% !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

/* Ensure stage-main takes full space so video fills the stage */
#stage-main {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Safe area padding for bottom tabbar on modern Android and iOS devices */
.tabbar {
  padding-bottom: max(6px, env(safe-area-inset-bottom, 6px)) !important;
}

.appbar {
  padding-top: max(10px, env(safe-area-inset-top, 10px)) !important;
}

/* v1.3.6: touch targets & safe-area on live topbar */
body.live-open .live-topbar {
  padding-top: max(12px, env(safe-area-inset-top, 12px)) !important;
  padding-bottom: 10px !important;
  min-height: 56px !important;
  position: relative !important;
  z-index: 1000 !important;
}
body.live-open .live-topbar .btn {
  min-height: 40px !important;
  min-width: 90px !important;
  font-size: 12.5px !important;
  padding: 8px 14px !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 1001 !important;
}

/* Find Tutor: Full-width Native Search Bar */
.tutor-search-wrap {
  margin-bottom: 14px;
}
.tutor-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  border-radius: 28px;
  padding: 4px 5px 4px 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  transition: all 0.2s ease;
}
.tutor-search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(121, 40, 202, 0.12), 0 4px 12px rgba(121, 40, 202, 0.08);
}
.tutor-search-icon {
  color: var(--muted);
  flex-shrink: 0;
  margin-right: 8px;
}
.tutor-search-bar:focus-within .tutor-search-icon {
  color: var(--primary);
}
.tutor-search-input {
  flex: 1;
  min-width: 0;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 8px 6px !important;
  font-size: 13.5px !important;
  font-weight: 500;
  color: var(--ink) !important;
  line-height: 1.4;
}
.tutor-search-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}
.tutor-search-clear {
  border: none;
  background: #F1F5F9;
  color: var(--body);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 6px;
  flex-shrink: 0;
}
.tutor-search-clear:hover {
  background: #E2E8F0;
  color: var(--ink);
}
.tutor-search-btn {
  border: none;
  border-radius: 20px;
  background: var(--primary-gradient);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 18px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(121, 40, 202, 0.25);
  transition: transform 0.1s ease, filter 0.15s ease;
  line-height: 1.2;
}
.tutor-search-btn:active {
  transform: scale(0.96);
}
.tutor-search-btn:hover {
  filter: brightness(1.06);
}
.tutor-search-hint {
  font-size: 11px;
  color: var(--body);
  margin-top: 6px;
  padding-left: 12px;
}

