/* ==========================================================================
   CAMPUSMATE — APPLE iOS 17/18 iMESSAGE DESIGN SYSTEM
   Authentic Cupertino Typography, Frosted Glass, Dynamic Bubbles & Sheets
   ========================================================================== */

:root {
  /* Apple System Accent Colors */
  --ios-blue: #007AFF;
  --ios-blue-dark: #0062CC;
  --ios-blue-gradient: linear-gradient(180deg, #1A8CFF 0%, #007AFF 100%);
  --ios-green: #34C759;
  --ios-red: #FF3B30;
  --ios-orange: #FF9500;
  --ios-teal: #30B0C7;
  --ios-purple: #AF52DE;

  /* System Backgrounds */
  --ios-bg: #FFFFFF;
  --ios-system-bg: #F2F2F7;
  --ios-secondary-bg: #E5E5EA;
  --ios-tertiary-bg: #F8F9FA;

  /* Message Bubbles */
  --bubble-sent-bg: linear-gradient(180deg, #1A8CFF 0%, #007AFF 100%);
  --bubble-sent-text: #FFFFFF;
  --bubble-received-bg: #E9E9EB;
  --bubble-received-text: #000000;

  /* Text & Labels */
  --text-dark: #000000;
  --text-primary: #000000;
  --text-secondary: rgba(60, 60, 67, 0.6);
  --text-muted: #8E8E93;
  --text-light: #8E8E93;

  /* Separators & Glass */
  --ios-separator: rgba(60, 60, 67, 0.14);
  --ios-border: rgba(60, 60, 67, 0.1);
  --ios-blur-header: rgba(246, 246, 246, 0.88);
  --ios-blur-input: rgba(246, 246, 246, 0.94);

  /* Shadows */
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.03);
  --sheet-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
  --modal-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);

  /* Compatibility Aliases */
  --primary-teal: #007AFF;
  --secondary-teal: #0A84FF;
  --accent-green: #34C759;
  --light-green-bubble: #007AFF;
  --white-bubble: #E9E9EB;
  --chat-bg: #FFFFFF;
  --app-bg: #F2F2F7;
  --tick-blue: #007AFF;
  --danger-red: #FF3B30;
  --warning-orange: #FF9500;
}

/* ==========================================================================
   APPLE iOS 18 DARK MODE THEME SYSTEM
   ========================================================================== */
[data-theme="dark"] {
  --ios-bg: #000000;
  --ios-system-bg: #1C1C1E;
  --ios-secondary-bg: #2C2C2E;
  --ios-tertiary-bg: #3A3A3C;
  --app-bg: #000000;
  --chat-bg: #000000;

  --bubble-received-bg: #26252A;
  --bubble-received-text: #FFFFFF;
  --white-bubble: #26252A;

  --text-dark: #FFFFFF;
  --text-primary: #FFFFFF;
  --text-secondary: rgba(235, 235, 245, 0.6);
  --text-muted: #8E8E93;
  --text-light: #98989D;

  --ios-separator: rgba(84, 84, 88, 0.45);
  --ios-border: rgba(84, 84, 88, 0.35);
  --ios-blur-header: rgba(28, 28, 30, 0.88);
  --ios-blur-input: rgba(28, 28, 30, 0.94);
}

[data-theme="dark"] body {
  background-color: #000000;
  color: #FFFFFF;
}

[data-theme="dark"] .screen,
[data-theme="dark"] .screen-view,
[data-theme="dark"] #app-viewport {
  background-color: #000000;
}

[data-theme="dark"] .app-bar {
  background-color: rgba(20, 20, 22, 0.85);
  border-bottom: 0.5px solid rgba(84, 84, 88, 0.4);
}

[data-theme="dark"] .brand-info h2 {
  color: #FFFFFF;
}

[data-theme="dark"] .user-chip {
  background-color: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

[data-theme="dark"] .tabs-bar {
  background-color: rgba(118, 118, 128, 0.24);
}

[data-theme="dark"] .tab-btn {
  color: #8E8E93;
}

[data-theme="dark"] .tab-btn.active {
  background: #2C2C2E;
  color: #FFFFFF;
}

[data-theme="dark"] .chats-search-section,
[data-theme="dark"] .friends-search-box {
  background: #000000;
}

[data-theme="dark"] .search-box {
  background: #1C1C1E;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .search-box input {
  color: #FFFFFF;
}

[data-theme="dark"] .inbox-cat-chip {
  background: #1C1C1E;
  color: #8E8E93;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .inbox-cat-chip.active {
  background: #007AFF;
  color: #FFFFFF;
}

[data-theme="dark"] .list-item {
  border-bottom-color: rgba(84, 84, 88, 0.3);
}

[data-theme="dark"] .list-item:hover,
[data-theme="dark"] .list-item:active {
  background-color: #1C1C1E;
}

[data-theme="dark"] .item-name {
  color: #FFFFFF;
}

[data-theme="dark"] .chat-header {
  background-color: rgba(20, 20, 22, 0.88);
  border-bottom-color: rgba(84, 84, 88, 0.4);
}

[data-theme="dark"] .chat-title-info h3 {
  color: #FFFFFF;
}

[data-theme="dark"] .messages-area {
  background-color: #000000;
}

[data-theme="dark"] .chat-input-bar {
  background-color: rgba(20, 20, 22, 0.94);
  border-top-color: rgba(84, 84, 88, 0.4);
}

[data-theme="dark"] .chat-input-pill,
[data-theme="dark"] .message-input-box {
  background: #1C1C1E;
  border-color: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .btn-ios-plus {
  background-color: #2C2C2E;
  color: #0A84FF;
}

[data-theme="dark"] .btn-ios-study {
  background-color: #2C2C2E;
}

[data-theme="dark"] #message-text-input {
  color: #FFFFFF;
}

[data-theme="dark"] .modal-card {
  background: #1C1C1E;
}

[data-theme="dark"] .modal-header {
  border-bottom-color: rgba(84, 84, 88, 0.4);
}

[data-theme="dark"] .modal-header h3 {
  color: #FFFFFF;
}

[data-theme="dark"] .profile-preview-card,
[data-theme="dark"] .settings-card-group,
[data-theme="dark"] .profile-hero-card,
[data-theme="dark"] .profile-info-section,
[data-theme="dark"] .profile-shared-media-section {
  background: #2C2C2E;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .profile-card-name,
[data-theme="dark"] .settings-field-title,
[data-theme="dark"] .settings-read-value,
[data-theme="dark"] .install-box-info strong,
[data-theme="dark"] .toggle-info strong {
  color: #FFFFFF;
}

[data-theme="dark"] .settings-modern-input-box {
  background: #1C1C1E;
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .settings-clean-input {
  color: #FFFFFF;
}

[data-theme="dark"] .settings-row-divider {
  background: rgba(84, 84, 88, 0.4);
}

[data-theme="dark"] .settings-install-box {
  background: #1C1C1E;
}

[data-theme="dark"] .profile-modal-card {
  background: #1C1C1E;
}

[data-theme="dark"] .profile-hero-name-row h2 {
  color: #FFFFFF;
}

[data-theme="dark"] .profile-action-btn {
  background: #2C2C2E;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .profile-info-row .info-val {
  color: #FFFFFF;
}

[data-theme="dark"] .shared-media-header h4 {
  color: #FFFFFF;
}

[data-theme="dark"] .media-tabs-bar {
  background: #1C1C1E;
}

[data-theme="dark"] .media-tab-btn.active {
  background: #3A3A3C;
  color: #FFFFFF;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: var(--app-bg);
  color: var(--text-dark);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   MAIN DEVICE WRAPPER & FLUID VIEWPORT
   ========================================================================== */
.screen {
  width: 100%;
  max-width: 520px;
  height: 100%;
  height: 100dvh;
  background-color: #FFFFFF;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
  .screen {
    border-radius: 32px;
    height: 92vh;
    max-height: 880px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.14);
  }
}

/* App Viewport Container (Houses Main and Chat Views with Native iOS Navigation) */
#app-viewport {
  position: relative;
  overflow: hidden;
  background-color: #FFFFFF;
}

.screen-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: #FFFFFF;
  overflow: hidden;
}

#main-screen {
  z-index: 10;
  transform: translateX(0);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), filter 0.32s ease;
  will-change: transform, filter;
}

#main-screen.chat-open {
  transform: translateX(-18%);
  filter: brightness(0.92);
  pointer-events: none;
}

#chat-screen {
  z-index: 25;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.32s ease;
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0);
  will-change: transform;
}

#chat-screen.open {
  transform: translateX(0);
  box-shadow: -10px 0 32px rgba(0, 0, 0, 0.12);
}

/* Global Ultra-Smooth Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.14);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   AUTH SCREEN (Cupertino Style)
   ========================================================================== */
#auth-screen {
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, #F2F2F7 0%, #FFFFFF 100%);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #FFFFFF;
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 0.5px solid var(--ios-border);
}

.auth-header {
  text-align: center;
  margin-bottom: 26px;
}

.logo-circle {
  width: 68px;
  height: 68px;
  background: var(--ios-blue-gradient);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.3);
}

.auth-header h1 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #000000;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.campus-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  background-color: #EBF3FF;
  color: #007AFF;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.campus-badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.campus-badge-row .campus-badge {
  margin-top: 0;
  font-size: 11px;
  padding: 3px 8px;
}

.auth-mode-segmented {
  display: flex;
  background: #E5E5EA;
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 18px;
  gap: 4px;
}

.auth-segment-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #8E8E93;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-segment-btn.active {
  background: #FFFFFF;
  color: #000000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.auth-method-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.method-chip {
  flex: 1;
  border: 1px solid var(--ios-border);
  background: #F2F2F7;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-medium);
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.method-chip.active {
  background: #EBF3FF;
  border-color: #007AFF;
  color: #007AFF;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-security-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F2F9F5;
  border: 1px solid #D1EAD8;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 4px;
}

.security-badge-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.security-badge-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.security-badge-text strong {
  font-size: 12px;
  color: #128C7E;
}

.security-badge-text span {
  font-size: 11px;
  color: #3C3C43;
  line-height: 1.35;
}

/* OTP Form Specific Styling */
.otp-header-info {
  text-align: center;
  margin-bottom: 12px;
  position: relative;
}

.btn-back-link {
  /* Its own line above the heading: absolutely positioned, it overlapped the title on phones */
  display: block;
  margin: 0 0 6px;
  background: none;
  border: none;
  color: #007AFF;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
}

.otp-header-info h3 {
  font-size: 18px;
  font-weight: 700;
  color: #000000;
}

.otp-sent-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.otp-wrapper {
  position: relative;
}

.otp-code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  letter-spacing: 8px !important;
  text-align: center !important;
  padding: 12px 14px !important;
}

.quick-fill-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #FFF8E6;
  border: 1px dashed #FFB800;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #8A6100;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.quick-fill-chip:active {
  transform: scale(0.98);
  background: #FFF0CC;
}

.otp-timer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px;
}

.otp-timer {
  font-size: 12.5px;
  color: #FF3B30;
  font-weight: 600;
}

.btn-resend-link {
  background: none;
  border: none;
  color: #007AFF;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-resend-link:disabled {
  color: #8E8E93;
  cursor: not-allowed;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #1C1C1E;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  font-size: 16px;
  color: var(--text-muted);
}

.input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 38px;
  background-color: #F2F2F7;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 16px;
  color: #000000;
  outline: none;
  transition: all 0.2s ease;
}

.input-wrapper input:focus {
  background-color: #FFFFFF;
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--ios-blue-gradient);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 13px 18px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.3);
  transition: transform 0.1s, opacity 0.15s;
}

.btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.privacy-note {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
  margin-top: 10px;
  padding: 8px 12px;
  background-color: #F2F2F7;
  border-radius: 10px;
}

/* ==========================================================================
   APP BAR & NAVIGATION (Apple Frosted Glass)
   ========================================================================== */
.app-bar {
  background: var(--ios-blur-header);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--ios-separator);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
  padding-top: max(10px, env(safe-area-inset-top, 10px));
}

.app-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.brand-info {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-width: 0;
}

.brand-info h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #000000;
  white-space: nowrap;
  line-height: 1.2;
}

.status-indicator {
  font-size: 11px;
  font-weight: 500;
  color: #34C759;
  white-space: nowrap;
}

.app-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--ios-blue);
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, background-color 0.15s, transform 0.1s;
}

.icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.icon-btn:active {
  opacity: 0.6;
  transform: scale(0.92);
}

.btn-logout-btn:hover svg {
  stroke: #FF3B30 !important;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(118, 118, 128, 0.12);
  padding: 3px 10px 3px 4px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  color: #000000;
}

.avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ios-blue-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* ==========================================================================
   TABS — iOS SEGMENTED CONTROL
   ========================================================================== */
.tabs-bar {
  display: flex;
  background-color: rgba(118, 118, 128, 0.12);
  border-radius: 10px;
  padding: 2px;
  margin: 6px 16px 10px;
  gap: 2px;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: #8E8E93;
  padding: 7px 4px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.2px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-btn.active {
  background: #FFFFFF;
  color: #000000;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tab-subtitle {
  display: none;
}

.badge {
  background-color: var(--ios-red);
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 10px;
}

/* ==========================================================================
   TAB CONTENT & LIST VIEWS
   ========================================================================== */
.tabs-container {
  flex: 1;
  overflow-y: auto;
  position: relative;
  background-color: #FFFFFF;
}

.tab-content {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding-bottom: 90px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.tab-content.active {
  display: block;
  animation: tabFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.list-view {
  display: flex;
  flex-direction: column;
}

/* SECTION DIVIDERS */
.section-divider {
  background-color: #F2F2F7;
  padding: 7px 16px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #8E8E93;
  border-top: 0.5px solid var(--ios-separator);
  border-bottom: 0.5px solid var(--ios-separator);
}

.section-divider.directory-divider {
  background-color: #F2F2F7;
  color: #8E8E93;
  margin-top: 8px;
}

.empty-inline-hint {
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text-muted);
  font-style: normal;
}

/* SEARCH BOX */
.section-actions-bar {
  padding: 10px 16px;
  background-color: #FFFFFF;
  border-bottom: 0.5px solid var(--ios-separator);
}

.search-box {
  display: flex;
  align-items: center;
  background-color: rgba(118, 118, 128, 0.12);
  border-radius: 10px;
  padding: 7px 12px;
  gap: 8px;
}

.search-icon {
  font-size: 14px;
  opacity: 0.7;
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 16px;
  width: 100%;
  color: var(--text-dark);
}

.search-box input::placeholder {
  color: #8E8E93;
}

/* LIST ITEM (CHATS & CONTACTS) */
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--ios-separator);
  cursor: pointer;
  transition: background-color 0.15s ease;
  background-color: #FFFFFF;
}

.list-item:hover, .list-item:active {
  background-color: #F2F2F7;
}

.avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ios-blue-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  position: relative;
  flex-shrink: 0;
}

.avatar-circle .online-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background-color: #34C759;
  border: 2px solid white;
  border-radius: 50%;
}

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

.item-top-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}

.item-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-time {
  font-size: 12.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.item-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-snippet {
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-snippet.status-online {
  color: #34C759;
  font-weight: 500;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-chat-inline {
  background-color: #F2F2F7;
  color: var(--ios-blue);
  border: none;
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-chat-inline:active {
  background-color: #E5E5EA;
}

/* ==========================================================================
   CAMPUS ROOMS / CHANNELS
   ========================================================================== */
.channels-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.channel-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  border: 0.5px solid var(--ios-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
}

.channel-card:active {
  transform: scale(0.98);
}

.channel-avatar {
  font-size: 28px;
  width: 48px;
  height: 48px;
  background-color: #F2F2F7;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.channel-info {
  flex: 1;
}

.channel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.channel-title h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

.channel-tag {
  background-color: #EBF3FF;
  color: var(--ios-blue);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
}

.channel-info p {
  font-size: 13px;
  color: var(--text-muted);
}

.btn-join {
  background-color: #F2F2F7;
  color: var(--ios-blue);
  border: none;
  padding: 8px 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   FLOATING ACTIONS
   ========================================================================== */
.floating-container {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

.btn-fab-sos {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--ios-red);
  color: white;
  border: none;
  border-radius: 28px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(255, 59, 48, 0.4);
  cursor: pointer;
  transition: transform 0.15s, background-color 0.2s;
  animation: pulse-sos 2.5s infinite;
}

@keyframes pulse-sos {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.btn-fab-add {
  pointer-events: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ios-blue-gradient);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4);
  cursor: pointer;
  transition: transform 0.15s;
}

.btn-fab-add:active {
  transform: scale(0.92);
}

/* ==========================================================================
   AUTHENTIC APPLE iMESSAGE CHAT VIEW
   ========================================================================== */
.chat-view {
  background-color: #FFFFFF;
  background-image: none; /* Pure clean Apple white */
}

/* iMessage Top Nav Bar */
.chat-header {
  background: var(--ios-blur-header);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--ios-separator);
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top, 10px)) max(14px, env(safe-area-inset-right, 14px)) 10px max(14px, env(safe-area-inset-left, 14px));
  flex-shrink: 0;
  z-index: 20;
}

.btn-back-ios {
  background: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ios-blue, #007AFF);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 12px 8px 6px;
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: opacity 0.15s;
  z-index: 10;
  position: relative;
}

.btn-back-ios:active {
  opacity: 0.6;
}

.btn-back-ios svg,
.btn-back-ios .back-text {
  pointer-events: none;
}

.btn-done-ios {
  background: none;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ios-blue, #007AFF);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: opacity 0.15s;
  z-index: 10;
  position: relative;
}

.btn-done-ios:active {
  opacity: 0.6;
}

.chat-header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.chat-header .avatar-circle {
  width: 36px;
  height: 36px;
  font-size: 15px;
  margin-bottom: 2px;
}

.chat-header-info h3 {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: #000000;
}

.partner-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.icon-btn-ios {
  background: none;
  border: none;
  color: var(--ios-blue);
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.icon-btn-ios:active {
  opacity: 0.6;
}

/* Messages Feed */
.messages-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  contain: content;
  transform: translateZ(0);
  will-change: scroll-position;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px; /* Tight iMessage bubble spacing */
  background: #FFFFFF;
}

/* ==========================================================================
   AUTHENTIC iMESSAGE BUBBLES
   ========================================================================== */
.message-bubble {
  max-width: 74%;
  padding: 9px 14px;
  font-size: 15.5px;
  line-height: 1.35;
  position: relative;
  display: flex;
  flex-direction: column;
  word-break: break-word;
  contain: layout style;
  transform: translateZ(0);
  animation: bubblePop 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

button, .btn-send-ios, .chat-item, .nav-btn, .avatar-circle, .list-item {
  touch-action: manipulation;
}

@keyframes bubblePop {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(6px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Sent Bubble: Vibrant Apple Blue Gradient */
.message-bubble.sent {
  align-self: flex-end;
  background: var(--bubble-sent-bg);
  color: var(--bubble-sent-text);
  border-radius: 19px 19px 4px 19px;
  box-shadow: 0 1px 2px rgba(0, 122, 255, 0.2);
}

/* Received Bubble: Clean Apple Light Gray */
.message-bubble.received {
  align-self: flex-start;
  background-color: var(--bubble-received-bg);
  color: var(--bubble-received-text);
  border-radius: 19px 19px 19px 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.message-sender-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--ios-blue);
  margin-bottom: 2px;
}

.message-image {
  max-width: 100%;
  border-radius: 14px;
  margin-bottom: 4px;
}

/* iMessage Delivery & Read Status */
.imessage-status {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  text-align: right;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.imessage-status.read {
  color: #34b7f1;
  font-weight: 600;
}

.msg-tick, .tick-icon {
  display: inline-block;
  font-size: 11px;
  line-height: 1;
  letter-spacing: -1.5px;
  user-select: none;
}
.msg-tick.pending, .tick-icon.pending {
  color: #8e8e93;
  opacity: 0.75;
  font-size: 10px;
  letter-spacing: normal;
}
.msg-tick.sent, .tick-icon.sent {
  color: #8e8e93;
}
.msg-tick.delivered, .tick-icon.delivered {
  color: #8e8e93;
}
.msg-tick.read, .tick-icon.read {
  color: #34b7f1;
}

/* ==========================================================================
   iMESSAGE INPUT BAR (iOS 17/18 Floating Capsule)
   ========================================================================== */
.chat-input-bar {
  background: var(--ios-blur-input);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--ios-separator);
  padding: 8px max(12px, env(safe-area-inset-right, 12px)) max(12px, env(safe-area-inset-bottom, 12px)) max(12px, env(safe-area-inset-left, 12px));
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Circular iOS Plus Attachment Button */
.btn-ios-plus {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #E5E5EA;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #007AFF;
  transition: transform 0.12s ease, background-color 0.15s ease;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}

.btn-ios-plus:hover {
  background-color: #DCDCE0;
}

.btn-ios-plus:active {
  transform: scale(0.92);
  background-color: #D1D1D6;
}

/* Capsule Text Input */
.message-input-box {
  flex: 1;
  background: #FFFFFF;
  border: 1px solid #D1D1D6;
  border-radius: 20px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.message-input-box:focus-within {
  border-color: var(--ios-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.message-input-box textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.35;
  height: 22px;
  min-height: 22px;
  max-height: 110px;
  color: #000000;
  background: transparent;
  padding: 0;
  overflow-y: auto;
  transition: height 0.12s ease;
}

.message-input-box textarea::placeholder {
  color: #8E8E93;
}

/* Iconic Apple Upward Arrow Send Button */
.btn-send-ios {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--ios-blue);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.18s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.35);
  transform: scale(1);
  opacity: 1;
}

.btn-send-ios:active {
  transform: scale(0.9);
}

.btn-send-ios.morph-hidden,
.btn-ios-mic.morph-hidden {
  display: none !important;
  transform: scale(0.4);
  opacity: 0;
  pointer-events: none;
}

/* Touch feedback across buttons and clickable items */
.btn-primary:active,
.btn-chat-inline:active,
.btn-add-inline:active,
.btn-accept-request:active,
.btn-decline-request:active,
.btn-back-ios:active,
.icon-btn-ios:active,
.btn-join:active,
.chip:active,
.channel-card:active {
  transform: scale(0.96);
  transition: transform 0.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ==========================================================================
   AUTHENTIC APPLE iOS 17/18 MODAL SHEETS & DIALOGS
   ========================================================================== */
.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 100000 !important;
  background-color: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  display: flex !important;
  align-items: flex-end; /* Slides up like authentic iOS Sheet */
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.32, 0.72, 0, 1),
              background-color 0.25s cubic-bezier(0.32, 0.72, 0, 1),
              backdrop-filter 0.25s ease,
              -webkit-backdrop-filter 0.25s ease;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-backdrop.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  background-color: rgba(0, 0, 0, 0.42) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: #FFFFFF;
  border-radius: 28px 28px 0 0;
  overflow: hidden;
  box-shadow: var(--sheet-shadow);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  max-height: 85vh;
}

.modal-backdrop.active .modal-card {
  transform: translateY(0);
}

@media (min-width: 540px) {
  .modal-backdrop {
    align-items: center;
    padding: 20px;
  }

  .modal-card {
    border-radius: 24px;
    box-shadow: var(--modal-shadow);
    transform: translateY(24px) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s ease;
    opacity: 0;
  }

  .modal-backdrop.active .modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* iOS Sheet Handle / Grabber */
.ios-sheet-handle {
  width: 40px;
  height: 5px;
  background: #C7C7CC;
  border-radius: 3px;
  margin: 10px auto 6px auto;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s, transform 0.15s;
}

.ios-sheet-handle:hover,
.ios-sheet-handle:active {
  background: #8E8E93;
  transform: scaleY(1.3);
}

.modal-header {
  padding: 12px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.5px solid var(--ios-separator);
}

.modal-header h3 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #000000;
}

/* Circular Close Button */
.btn-close-ios {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #E5E5EA;
  color: #8E8E93;
  border: none;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.15s;
}

.btn-close-ios:active {
  background-color: #D1D1D6;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.modal-instruction {
  font-size: 14px;
  color: var(--text-muted);
}

.modal-footer {
  padding: 12px 20px 20px;
}

.search-results {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #F2F2F7;
  border-radius: 14px;
}

.btn-add-inline {
  background-color: var(--ios-blue);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-add-inline:active {
  transform: scale(0.95);
}

/* ==========================================================================
   SAFETY MODAL (iOS Alert Style)
   ========================================================================== */
.safety-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.safety-card {
  border: 0.5px solid var(--ios-border);
  border-radius: 16px;
  padding: 16px;
  background-color: #F2F2F7;
}

.safety-card.highlight-danger {
  border-color: rgba(255, 59, 48, 0.3);
  background-color: #FFF2F2;
}

.safety-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #000000;
}

.safety-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.btn-danger {
  width: 100%;
  background-color: var(--ios-red);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.25);
  transition: transform 0.1s;
}

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

.btn-secondary {
  width: 100%;
  background-color: #E5E5EA;
  color: #000000;
  border: none;
  padding: 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.security-contact-box {
  background-color: #F2F2F7;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-call-direct, .btn-call-911 {
  display: block;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  padding: 11px;
  border-radius: 12px;
  font-size: 14px;
}

.btn-call-direct {
  background-color: #34C759;
  color: white;
}

.btn-call-911 {
  background-color: var(--ios-red);
  color: white;
}

/* ==========================================================================
   SHARE MODAL & TOP SHARE QR PILL
   ========================================================================== */
.campus-share-qr-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.12), rgba(0, 122, 255, 0.22));
  color: var(--ios-blue, #007AFF);
  border: 1px solid rgba(0, 122, 255, 0.35);
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.campus-share-qr-pill:hover,
.campus-share-qr-pill:active {
  background: var(--ios-blue, #007AFF);
  color: #FFFFFF;
  transform: scale(0.96);
  box-shadow: 0 3px 10px rgba(0, 122, 255, 0.3);
}

.campus-share-qr-pill svg {
  flex-shrink: 0;
}

.auth-share-qr-row {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.btn-auth-qr-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 122, 255, 0.1);
  color: #007AFF;
  border: 1px solid rgba(0, 122, 255, 0.25);
  border-radius: 18px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.btn-auth-qr-pill:hover,
.btn-auth-qr-pill:active {
  background: #007AFF;
  color: #FFFFFF;
  transform: scale(0.97);
}

.share-qr-modal-card {
  max-width: 400px;
  background: #FFFFFF;
  border-radius: 28px 28px 0 0;
  box-shadow: var(--sheet-shadow);
}

@media (min-width: 540px) {
  .share-qr-modal-card {
    border-radius: 24px;
    box-shadow: var(--modal-shadow);
  }
}

.share-qr-modal-body {
  padding: 14px 20px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.share-tab-segmented {
  display: flex;
  background: rgba(118, 118, 128, 0.12);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
}

.share-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #8E8E93;
  cursor: pointer;
  transition: all 0.18s ease;
}

.share-tab-btn.active {
  background: #FFFFFF;
  color: #000000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.share-qr-hero {
  background: linear-gradient(180deg, #F9FAFB 0%, #F3F4F6 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.share-qr-frame {
  width: 220px;
  height: 220px;
  background: #FFFFFF;
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.share-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.share-qr-meta h4 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: #000000;
}

.share-qr-meta p {
  margin: 0 0 6px;
  font-size: 13px;
  color: #8E8E93;
  line-height: 1.35;
}

.share-qr-campus-badge {
  display: inline-block;
  background: rgba(0, 122, 255, 0.1);
  color: #007AFF;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 8px;
}

.share-link-box {
  display: flex;
  gap: 8px;
}

.share-link-box input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 12px;
  font-size: 13.5px;
  background-color: #F2F2F7;
  color: #000000;
}

.btn-copy {
  background-color: var(--ios-blue);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}

.btn-copy:active {
  transform: scale(0.95);
  opacity: 0.9;
}

.share-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-share-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  border: none;
}

.btn-share-native {
  background: var(--ios-blue, #007AFF);
  color: #FFFFFF;
  box-shadow: 0 3px 12px rgba(0, 122, 255, 0.25);
}

.btn-share-native:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-share-download {
  background: rgba(118, 118, 128, 0.12);
  color: #000000;
}

.btn-share-download:hover,
.btn-share-download:active {
  background: rgba(118, 118, 128, 0.2);
}

.share-instructions {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

/* Dark mode adjustments */
[data-theme="dark"] .share-qr-modal-card {
  background: #1C1C1E;
}

[data-theme="dark"] .share-tab-segmented {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .share-tab-btn.active {
  background: #2C2C2E;
  color: #FFFFFF;
}

[data-theme="dark"] .share-qr-hero {
  background: #242426;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .share-qr-meta h4 {
  color: #FFFFFF;
}

[data-theme="dark"] .share-qr-meta p {
  color: #8E8E93;
}

[data-theme="dark"] .share-link-box input {
  background: #2C2C2E;
  color: #FFFFFF;
}

[data-theme="dark"] .btn-share-download {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

/* ==========================================================================
   PROACTIVE NOTIFICATION PERMISSION BANNER
   ========================================================================== */
.notif-permission-banner {
  margin: 10px 14px 12px;
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.08) 0%, rgba(88, 86, 214, 0.12) 100%);
  border: 1px solid rgba(0, 122, 255, 0.22);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 4px 18px rgba(0, 122, 255, 0.08);
  animation: slideDownBanner 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownBanner {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notif-banner-icon-col {
  flex-shrink: 0;
}

.notif-banner-bell-badge {
  width: 42px;
  height: 42px;
  background: #FFFFFF;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 122, 255, 0.2);
}

.notif-banner-text-col {
  flex: 1;
  min-width: 0;
}

.notif-banner-text-col h4 {
  margin: 0 0 3px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary, #000000);
}

.notif-banner-text-col p {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--text-muted, #666666);
  line-height: 1.4;
}

.notif-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-notif-allow {
  background: var(--ios-blue, #007AFF);
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
  transition: all 0.16s ease;
}

.btn-notif-allow:hover,
.btn-notif-allow:active {
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(0, 122, 255, 0.4);
}

.btn-notif-dismiss {
  background: rgba(118, 118, 128, 0.12);
  color: var(--text-muted, #666666);
  border: none;
  border-radius: 12px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
}

.btn-notif-dismiss:hover {
  background: rgba(118, 118, 128, 0.2);
}

[data-theme="dark"] .notif-permission-banner {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.14) 0%, rgba(88, 86, 214, 0.2) 100%);
  border-color: rgba(0, 122, 255, 0.35);
}

[data-theme="dark"] .notif-banner-bell-badge {
  background: #2C2C2E;
}

[data-theme="dark"] .notif-banner-text-col h4 {
  color: #FFFFFF;
}

[data-theme="dark"] .notif-banner-text-col p {
  color: #A0A0A5;
}

[data-theme="dark"] .btn-notif-dismiss {
  background: rgba(255, 255, 255, 0.12);
  color: #CCCCCC;
}

/* ==========================================================================
   EMPTY PLACEHOLDER
   ========================================================================== */
.empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.empty-icon {
  font-size: 52px;
  margin-bottom: 16px;
  opacity: 0.7;
}

.empty-placeholder h3 {
  font-size: 18px;
  margin-bottom: 6px;
  font-weight: 600;
}

.empty-placeholder p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  max-width: 280px;
}

/* ==========================================================================
   TOASTS (Apple Dynamic Island / Pill Style)
   ========================================================================== */
#toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
  width: 90%;
  max-width: 380px;
}

.toast {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: white;
  padding: 11px 18px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: slide-toast 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes slide-toast {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   FRIEND REQUESTS SECTION
   ========================================================================== */
.friend-requests-container {
  background-color: #F8F9FA;
  border-bottom: 0.5px solid var(--ios-separator);
  padding: 12px 16px;
  animation: fadeIn 0.3s ease;
}

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

.requests-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #1C1C1E;
}

.badge-count {
  background-color: var(--ios-red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.badge-tab-alert {
  position: absolute;
  top: 4px;
  right: 12px;
  background-color: var(--ios-red);
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 8px;
  border: 1px solid white;
}

.requests-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.request-card {
  display: flex;
  align-items: center;
  background: white;
  border: 0.5px solid var(--ios-border);
  border-radius: 14px;
  padding: 10px 12px;
  gap: 12px;
  box-shadow: var(--card-shadow);
}

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

.request-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-dark);
}

.request-major {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.request-actions {
  display: flex;
  gap: 6px;
}

.btn-accept-request {
  background-color: var(--ios-blue);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-decline-request {
  background-color: #F2F2F7;
  color: var(--text-muted);
  border: none;
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   FILTER CHIPS
   ========================================================================== */
.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-top: 8px;
  scrollbar-width: none;
}

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

.chip {
  background-color: #F2F2F7;
  border: none;
  color: #8E8E93;
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip.active {
  background-color: var(--ios-blue);
  color: white;
}

/* ==========================================================================
   TWITTER / X VERIFIED BLUE CHECKMARK
   ========================================================================== */
.partner-name-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.twitter-blue-tick {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(29, 155, 240, 0.25));
  transition: transform 0.15s ease;
}

.twitter-blue-tick:hover {
  transform: scale(1.15);
}

.header-blue-tick {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.list-item .twitter-blue-tick {
  margin-left: 4px;
}

/* ==========================================================================
   UNREAD MESSAGE INDICATOR BADGES
   ========================================================================== */
.unread-count-pill {
  background-color: var(--ios-blue);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  margin-left: 6px;
  box-shadow: 0 1px 4px rgba(0, 122, 255, 0.35);
  animation: popBadge 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popBadge {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.badge {
  background-color: var(--ios-blue);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 5px;
}

/* ==========================================================================
   VOICE RECORDING BAR & CONTROLS
   ========================================================================== */
.btn-ios-mic {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background-color: #E5E5EA;
  color: var(--ios-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.18s ease, background-color 0.15s;
}

.btn-ios-mic:hover {
  background-color: #D1D1D6;
}

.btn-ios-mic:active {
  transform: scale(0.9);
  background-color: #C7C7CC;
}

.voice-recording-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  border-radius: 20px;
  padding: 4px 12px;
  height: 38px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #FF3B30;
  font-variant-numeric: tabular-nums;
}

.pulsing-record-dot {
  width: 10px;
  height: 10px;
  background-color: #FF3B30;
  border-radius: 50%;
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 1; }
}

.audio-waves {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 18px;
}

.audio-waves span {
  width: 3px;
  height: 6px;
  background-color: #FF3B30;
  border-radius: 2px;
  animation: waveAnim 1.2s infinite ease-in-out;
}

.audio-waves span:nth-child(1) { animation-delay: 0.1s; }
.audio-waves span:nth-child(2) { animation-delay: 0.3s; }
.audio-waves span:nth-child(3) { animation-delay: 0.5s; }
.audio-waves span:nth-child(4) { animation-delay: 0.2s; }
.audio-waves span:nth-child(5) { animation-delay: 0.4s; }

@keyframes waveAnim {
  0%, 100% { height: 4px; }
  50% { height: 16px; }
}

.btn-cancel-record {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-send-record {
  background: #34C759;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(52, 199, 89, 0.4);
}

/* ==========================================================================
   VOICE MESSAGE BUBBLE PLAYER
   ========================================================================== */
.voice-bubble-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px;
  min-width: 170px;
}

.btn-play-voice {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.message-bubble.received .btn-play-voice {
  background: rgba(0, 0, 0, 0.08);
}

.btn-play-voice:hover {
  transform: scale(1.08);
}

.voice-waveform-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.voice-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.message-bubble.received .voice-progress-bar {
  background: rgba(0, 0, 0, 0.12);
}

.voice-progress-fill {
  height: 100%;
  width: 0%;
  background: #FFFFFF;
  border-radius: 2px;
  transition: width 0.1s linear;
}

.message-bubble.received .voice-progress-fill {
  background: var(--ios-blue);
}

.voice-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  opacity: 0.85;
}

/* ==========================================================================
   FILE ATTACHMENTS (VIDEOS, DOCS, PDF, ZIP)
   ========================================================================== */
.message-video {
  max-width: 100%;
  border-radius: 14px;
  display: block;
  margin-bottom: 6px;
  outline: none;
}

.file-attachment-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 4px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.message-bubble.received .file-attachment-card {
  background: rgba(0, 0, 0, 0.05);
}

.file-attachment-card:hover {
  background: rgba(255, 255, 255, 0.35);
}

.file-card-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.file-card-details {
  flex: 1;
  min-width: 0;
}

.file-card-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.file-card-size {
  font-size: 11px;
  opacity: 0.75;
}

.file-download-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================================================
   VOICE CALL MODALS (CUPERTINO CALL SHEET)
   ========================================================================== */
.call-sheet-card {
  width: 90%;
  max-width: 360px;
  background: #1C1C1E;
  color: #FFFFFF;
  border-radius: 28px;
  padding: 36px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideUpCall 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUpCall {
  0% { transform: translateY(60px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.call-avatar-wrapper {
  position: relative;
  margin-bottom: 18px;
}

.call-avatar {
  width: 80px;
  height: 80px;
  font-size: 32px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #007AFF;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.35);
  animation: pulseCallAvatar 2s infinite ease-in-out;
}

@keyframes pulseCallAvatar {
  0% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.5); }
  70% { box-shadow: 0 0 0 18px rgba(0, 122, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0); }
}

.call-sheet-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.call-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 24px;
}

.call-timer {
  font-size: 16px;
  font-weight: 600;
  color: #34C759;
  font-variant-numeric: tabular-nums;
  margin-bottom: 24px;
}

.call-actions-row, .active-call-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  width: 100%;
}

.btn-call-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-call-circle:hover {
  transform: scale(1.08);
}

.btn-call-circle.decline {
  background-color: #FF3B30;
  box-shadow: 0 6px 18px rgba(255, 59, 48, 0.4);
}

.btn-call-circle.accept {
  background-color: #34C759;
  box-shadow: 0 6px 18px rgba(52, 199, 89, 0.4);
  animation: shakeAccept 1.6s infinite ease-in-out;
}

@keyframes shakeAccept {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-10deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-5deg); }
  80% { transform: rotate(5deg); }
}

.call-btn-label {
  position: absolute;
  bottom: -20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
}

.btn-call-control {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.btn-call-control.muted {
  background: #FF9500;
}

.btn-call-control span {
  position: absolute;
  bottom: -18px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
}

/* ==========================================================================
   WHATSAPP-STYLE CONTACT PROFILE & SHARED MEDIA
   ========================================================================== */
.profile-modal-card {
  max-height: 92vh;
  background-color: #F2F2F7;
}

.profile-modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-hero-card {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.profile-avatar-lg {
  width: 84px !important;
  height: 84px !important;
  font-size: 36px !important;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.profile-hero-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.profile-hero-name-row h2 {
  font-size: 20px;
  font-weight: 700;
  color: #000000;
}

.profile-blue-tick {
  display: inline-flex;
  align-items: center;
}

.profile-handle {
  font-size: 14px;
  color: #8E8E93;
  margin-top: 2px;
}

.profile-online-status {
  font-size: 13px;
  color: var(--ios-green);
  font-weight: 600;
  margin-top: 6px;
}

/* Quick Actions Bar */
.profile-actions-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.profile-action-btn {
  flex: 1;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.profile-action-btn:active {
  transform: scale(0.95);
  background-color: #E5E5EA;
}

.profile-action-btn .action-icon {
  font-size: 20px;
}

.profile-action-btn .action-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ios-blue);
}

/* Academic Info */
.profile-info-section {
  background: #FFFFFF;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.profile-info-section h4 {
  font-size: 12px;
  font-weight: 700;
  color: #8E8E93;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.profile-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--ios-separator);
  font-size: 13.5px;
}

.profile-info-row:last-child {
  border-bottom: none;
}

.profile-info-row .info-label {
  color: #8E8E93;
  font-weight: 500;
}

.profile-info-row .info-val {
  color: #000000;
  font-weight: 600;
  text-align: right;
  max-width: 60%;
}

/* Shared Media Section */
.profile-shared-media-section {
  background: #FFFFFF;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

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

.shared-media-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: #000000;
}

.media-count-pill {
  background: #E5E5EA;
  color: #1C1C1E;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.media-tabs-bar {
  display: flex;
  background: #E5E5EA;
  border-radius: 10px;
  padding: 2px;
  margin-bottom: 12px;
}

.media-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #636366;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.media-tab-btn.active {
  background: #FFFFFF;
  color: #000000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shared-media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.shared-media-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.shared-media-thumb img,
.shared-media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shared-media-thumb:hover {
  transform: scale(1.03);
}

.video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.6);
  color: #FFFFFF;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.shared-files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shared-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #F2F2F7;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.shared-file-row:hover {
  background: #E5E5EA;
}

.shared-file-icon {
  font-size: 22px;
  flex-shrink: 0;
}

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

.shared-file-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #000000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shared-file-meta {
  font-size: 11.5px;
  color: #8E8E93;
  margin-top: 2px;
}

.shared-file-dl {
  font-size: 14px;
  opacity: 0.7;
  flex-shrink: 0;
}

.no-media-hint {
  text-align: center;
  padding: 20px;
  color: #8E8E93;
  font-size: 13px;
}

/* Fullscreen Lightbox */
.lightbox-backdrop {
  background-color: rgba(0, 0, 0, 0.92) !important;
  backdrop-filter: blur(15px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.btn-close-lightbox {
  position: absolute;
  top: -44px;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   CALL DETAILS IN CHAT HISTORY (WhatsApp / iOS Style)
   ========================================================================== */
.call-history-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  min-width: 210px;
}

.call-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.call-icon-circle.success {
  background: rgba(52, 199, 89, 0.18);
}

.call-icon-circle.missed {
  background: rgba(255, 59, 48, 0.18);
}

.call-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.call-title {
  font-size: 14px;
  font-weight: 600;
  color: inherit;
}

.call-subtitle {
  font-size: 11.5px;
  opacity: 0.75;
  margin-top: 2px;
}

.btn-call-back {
  background: rgba(0, 122, 255, 0.15);
  border: none;
  color: var(--ios-blue);
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.15s;
}

.message-bubble.sent .btn-call-back {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.btn-call-back:active {
  transform: scale(0.92);
}

/* ==========================================================================
   SETTINGS / MY PROFILE MODAL (APPLE iOS 18 DESIGN SYSTEM)
   ========================================================================== */
.settings-modal-card {
  max-height: 88vh;
  max-width: 520px;
  background: var(--ios-system-bg, #F2F2F7);
  border-radius: 28px 28px 0 0;
  box-shadow: var(--sheet-shadow);
}

@media (min-width: 540px) {
  .settings-modal-card {
    border-radius: 24px;
    max-height: 85vh;
  }
}

.settings-modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 1. Profile Hero Card */
.profile-preview-card {
  background: #FFFFFF;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  border: 0.5px solid rgba(0, 0, 0, 0.06);
}

.profile-card-cover {
  height: 64px;
  background: linear-gradient(135deg, #007AFF 0%, #5856D6 50%, #FF2D55 100%);
  opacity: 0.88;
}

.profile-card-content {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px 14px 20px;
  margin-top: -32px;
}

.settings-avatar-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
}

.settings-avatar-lg {
  width: 76px !important;
  height: 76px !important;
  font-size: 30px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
  color: white !important;
  border: 3.5px solid #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
}

.settings-avatar-camera-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #007AFF;
  border: 2px solid #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.settings-avatar-camera-btn:active {
  transform: scale(0.9);
  background: #0056cc;
}

.profile-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 36px;
}

.profile-card-name {
  font-size: 20px;
  font-weight: 700;
  color: #000000;
  letter-spacing: -0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.profile-card-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-tag-handle {
  font-size: 13px;
  font-weight: 600;
  color: #007AFF;
}

.profile-tag-badge {
  font-size: 11px;
  font-weight: 600;
  color: #34C759;
  background: rgba(52, 199, 89, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
}

.profile-avatar-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 14px 20px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.05);
}

.btn-pill-subtle-danger {
  background: rgba(255, 59, 48, 0.1);
  color: #FF3B30;
  border: none;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-pill-subtle-danger:active {
  transform: scale(0.94);
  background: rgba(255, 59, 48, 0.2);
}

/* 2. Grouped Cards */
.settings-card-group {
  background: #FFFFFF;
  border-radius: 18px;
  padding: 4px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  border: 0.5px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

.settings-group-header {
  padding: 12px 0 6px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #8E8E93;
}

.settings-row-item {
  padding: 10px 0 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-field-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-field-title {
  font-size: 15px;
  font-weight: 600;
  color: #000000;
}

.settings-field-desc {
  font-size: 12px;
  color: #8E8E93;
}

.settings-modern-input-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F2F2F7;
  border-radius: 12px;
  padding: 4px 6px 4px 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: border-color 0.15s, background-color 0.15s;
}

.settings-modern-input-box:focus-within {
  background: #FFFFFF;
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.settings-at-sign {
  color: #007AFF;
  font-size: 16px;
  font-weight: 700;
}

.settings-clean-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  color: #000000;
  padding: 8px 0;
  font-family: inherit;
}

.settings-clean-input::placeholder {
  color: #C7C7CC;
}

.btn-settings-save {
  background: #007AFF;
  color: #FFFFFF;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 15px;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
  white-space: nowrap;
}

.btn-settings-save:active {
  transform: scale(0.93);
  background: #0056cc;
}

.settings-row-divider {
  height: 0.5px;
  background: rgba(60, 60, 67, 0.1);
  margin: 2px 0;
}

/* Read-Only Academic Rows */
.settings-read-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.settings-read-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.settings-read-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-read-label {
  font-size: 12px;
  color: #8E8E93;
}

.settings-read-value {
  font-size: 15px;
  font-weight: 600;
  color: #000000;
}

/* Install Box */
.settings-install-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.install-box-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.install-box-info strong {
  display: block;
  font-size: 15px;
  color: #000000;
  margin-bottom: 2px;
}

.install-box-info p {
  font-size: 12px;
  color: #8E8E93;
  margin: 0;
  line-height: 1.35;
}

/* Danger / Sign Out Button */
.settings-card-danger {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
}

.btn-settings-danger-block {
  width: 100%;
  background: rgba(255, 59, 48, 0.08);
  color: #FF3B30;
  border: 1px solid rgba(255, 59, 48, 0.2);
  border-radius: 14px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-settings-danger-block:active {
  background: rgba(255, 59, 48, 0.18);
  transform: scale(0.98);
}

/* Avatar image support for all avatar elements */
.avatar-circle.has-image,
.avatar-sm.has-image {
  padding: 0;
  overflow: hidden;
  font-size: 0;
}

.avatar-circle.has-image img,
.avatar-sm.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Online pulse in profile */
@keyframes pulse-online {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.profile-online-status.is-online {
  animation: pulse-online 2s ease-in-out infinite;
}

/* ==========================================================================
   PUBLIC FREE APIS: WEATHER, STUDY TOOLS, JOKES, MOTIVATION, DICEBEAR
   ========================================================================== */

/* 1. Header Campus Weather Pill */
.campus-weather-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #E5E5EA;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  padding: 4px 11px;
  color: #1C1C1E;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.campus-weather-pill:hover {
  background: #D1D1D6;
  transform: translateY(-1px);
}

.campus-weather-pill:active {
  transform: scale(0.96);
}

.weather-pill-loc {
  background: #007AFF;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 6px;
  margin-left: 2px;
  letter-spacing: 0.4px;
}

/* 2. Daily Student Inspiration Quote Banner */
.motivation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #FFFFFF;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-left: 3.5px solid #007AFF;
  border-radius: 14px;
  margin: 10px 16px 8px 16px;
  padding: 10px 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.motivation-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.motivation-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.motivation-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.motivation-quote {
  font-size: 13px;
  font-style: italic;
  color: #1C1C1E;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.motivation-author {
  font-size: 11.5px;
  color: #8E8E93;
  font-weight: 500;
}

.btn-icon-subtle {
  background: #F2F2F7;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  color: #007AFF;
  font-size: 15px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-icon-subtle:hover {
  background: #E5E5EA;
  transform: rotate(180deg);
}

.btn-icon-subtle:active {
  transform: scale(0.92);
}

/* 3. Study Tools Button in Chat Bar */
.btn-ios-study {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #E8F8EE;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.12s ease, background-color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.btn-ios-study:hover {
  background: #D4F4DF;
  transform: scale(1.05);
}

.btn-ios-study:active {
  transform: scale(0.92);
  background: #C0ECD0;
}

/* 4. DiceBear Avatar Button in Profile Settings */
.settings-avatar-actions-row {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.btn-dicebear-pill {
  background: linear-gradient(135deg, #FF2D55, #AF52DE);
  color: #FFFFFF;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(175, 82, 222, 0.35);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-dicebear-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(175, 82, 222, 0.5);
}

.btn-dicebear-pill:active {
  transform: scale(0.95);
}

/* 5. Campus Weather Modal */
.weather-modal-card {
  max-width: 440px;
  background: #FFFFFF;
  border-radius: 28px 28px 0 0;
  box-shadow: var(--sheet-shadow);
}

@media (min-width: 540px) {
  .weather-modal-card {
    border-radius: 24px;
    box-shadow: var(--modal-shadow);
  }
}

.weather-modal-body {
  padding: 16px 20px 24px 20px;
}

.campus-selector-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 14px 2px;
  scrollbar-width: none;
}

.campus-selector-row::-webkit-scrollbar {
  display: none;
}

.campus-chip {
  background: #F2F2F7;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  color: #1C1C1E;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.campus-chip:hover {
  background: #E5E5EA;
  color: #000000;
}

.campus-chip.active {
  background: #007AFF;
  color: #FFFFFF;
  border-color: #007AFF;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.weather-hero {
  text-align: center;
  padding: 20px 16px;
  background: linear-gradient(180deg, #F0F7FF 0%, #E0EFFF 100%);
  border: 0.5px solid rgba(0, 122, 255, 0.15);
  border-radius: 18px;
  margin-bottom: 14px;
}

.weather-hero-emoji {
  font-size: 52px;
  line-height: 1;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
}

.weather-hero-temp {
  font-size: 44px;
  font-weight: 700;
  color: #000000;
  letter-spacing: -1px;
}

.weather-hero-condition {
  font-size: 16px;
  font-weight: 600;
  color: #007AFF;
  margin-top: 4px;
}

.weather-hero-campus {
  font-size: 13px;
  color: #8E8E93;
  margin-top: 4px;
  font-weight: 500;
}

.weather-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.weather-stat-box {
  background: #F2F2F7;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}

.stat-label {
  font-size: 11px;
  color: #8E8E93;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-val {
  font-size: 14.5px;
  font-weight: 700;
  color: #000000;
  margin-top: 4px;
  display: block;
}

.weather-advice-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #F0FDF4;
  border: 0.5px solid rgba(52, 199, 89, 0.3);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.advice-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.weather-advice-card p {
  font-size: 13px;
  color: #15803D;
  line-height: 1.4;
  margin: 0;
  font-weight: 500;
}

.btn-primary-block {
  width: 100%;
  background: #007AFF;
  color: #FFFFFF;
  border: none;
  border-radius: 14px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.3);
  transition: all 0.15s ease;
}

.btn-primary-block:hover {
  background: #006CE6;
}

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

/* 6. Study Tools Modal */
.study-modal-card {
  max-width: 480px;
  background: #FFFFFF;
  border-radius: 28px 28px 0 0;
  box-shadow: var(--sheet-shadow);
}

@media (min-width: 540px) {
  .study-modal-card {
    border-radius: 24px;
    box-shadow: var(--modal-shadow);
  }
}

.study-modal-body {
  padding: 16px 20px 24px 20px;
}

.study-subtitle {
  font-size: 13px;
  color: #8E8E93;
  margin: 0 0 16px 0;
  line-height: 1.45;
}

.study-tool-box {
  background: #F2F2F7;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}

.tool-title-row {
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 10px;
}

.study-input-row {
  display: flex;
  gap: 8px;
}

.study-input {
  flex: 1;
  background: #FFFFFF;
  border: 1px solid #D1D1D6;
  border-radius: 10px;
  color: #000000;
  padding: 9px 12px;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.study-input:focus {
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.study-input::placeholder {
  color: #8E8E93;
}

.btn-study-action {
  background: #007AFF;
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-study-action:hover {
  background: #006CE6;
}

.btn-study-action:active {
  transform: scale(0.95);
}

.btn-secondary-pill {
  background: #E5E5EA;
  border: none;
  color: #007AFF;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary-pill:hover {
  background: #D1D1D6;
}

.btn-secondary-pill:active {
  transform: scale(0.95);
}

.study-preview-card {
  margin-top: 12px;
  background: #FFFFFF;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.study-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.study-preview-title {
  font-size: 14px;
  font-weight: 700;
  color: #000000;
}

.study-preview-badge {
  font-size: 10px;
  background: rgba(0, 122, 255, 0.12);
  color: #007AFF;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
}

.study-preview-body {
  font-size: 12.5px;
  color: #3C3C43;
  line-height: 1.45;
  margin-bottom: 10px;
}

.study-btn-send {
  background: #34C759;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.study-btn-send:hover {
  background: #2EB14F;
}

.joke-preview-card {
  margin-top: 12px;
  background: #FFFBEB;
  border: 0.5px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 12px;
  font-size: 13.5px;
  color: #92400E;
}

.joke-setup {
  font-weight: 600;
  margin-bottom: 6px;
  color: #78350F;
}

.joke-punchline {
  color: #B45309;
  margin-bottom: 10px;
  font-style: italic;
}

.slash-commands-hint {
  background: #E8F8EE;
  border: 0.5px solid rgba(52, 199, 89, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  color: #15803D;
  margin-top: 12px;
  line-height: 1.45;
}

.slash-commands-hint code {
  background: rgba(52, 199, 89, 0.2);
  color: #166534;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: ui-monospace, Menlo, Monaco, monospace;
  font-size: 11.5px;
  font-weight: 600;
}

/* 7. Rich Chat Cards (Sent via slash commands or study tools) */
.study-card-bubble {
  border-radius: 14px;
  padding: 12px 14px;
  margin: 4px 0;
  background: #FFFFFF;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  max-width: 320px;
}

.message-bubble.sent .study-card-bubble {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: none;
}

.study-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.study-card-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 6px;
}

.tag-wiki { background: rgba(0, 122, 255, 0.15); color: #007AFF; }
.tag-book { background: rgba(175, 82, 222, 0.15); color: #AF52DE; }
.tag-joke { background: rgba(255, 149, 0, 0.15); color: #FF9500; }
.tag-weather { background: rgba(52, 199, 89, 0.15); color: #34C759; }
.tag-define { background: rgba(88, 86, 214, 0.15); color: #5856D6; }
.tag-convert { background: rgba(255, 45, 85, 0.15); color: #FF2D55; }
.tag-location { background: rgba(255, 149, 0, 0.15); color: #FF9500; }
.tag-advice { background: rgba(0, 199, 190, 0.15); color: #00C7BE; }
.tag-quote { background: rgba(245, 158, 11, 0.15); color: #D97706; }
.tag-meet { background: rgba(16, 185, 129, 0.15); color: #059669; }

.message-bubble.sent .tag-wiki { background: rgba(255, 255, 255, 0.25); color: #FFFFFF; }
.message-bubble.sent .tag-book { background: rgba(255, 255, 255, 0.25); color: #FFFFFF; }
.message-bubble.sent .tag-joke { background: rgba(255, 255, 255, 0.25); color: #FFFFFF; }
.message-bubble.sent .tag-weather { background: rgba(255, 255, 255, 0.25); color: #FFFFFF; }
.message-bubble.sent .tag-define { background: rgba(255, 255, 255, 0.25); color: #FFFFFF; }
.message-bubble.sent .tag-convert { background: rgba(255, 255, 255, 0.25); color: #FFFFFF; }
.message-bubble.sent .tag-location { background: rgba(255, 255, 255, 0.25); color: #FFFFFF; }
.message-bubble.sent .tag-advice { background: rgba(255, 255, 255, 0.25); color: #FFFFFF; }
.message-bubble.sent .tag-quote { background: rgba(255, 255, 255, 0.25); color: #FFFFFF; }
.message-bubble.sent .tag-meet { background: rgba(255, 255, 255, 0.25); color: #FFFFFF; }

/* Study Tabs Navigation */
.study-tabs-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  scrollbar-width: none;
}
.study-tabs-nav::-webkit-scrollbar {
  display: none;
}
.study-tab-btn {
  background: #E5E5EA;
  border: none;
  color: #1C1C1E;
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.study-tab-btn.active {
  background: #007AFF;
  color: #FFFFFF;
}

/* Currency Calculator Layout */
.currency-calc-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 8px;
}
.curr-input-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #8E8E93;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.study-select {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid #D1D1D6;
  border-radius: 10px;
  color: #000000;
  padding: 8px 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

/* Campus Pins Grid */
.campus-pins-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 8px;
}
.campus-pin-card {
  background: #FFFFFF;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.campus-pin-card:hover {
  background: #F0F7FF;
  border-color: #007AFF;
}
.campus-pin-info h5 {
  margin: 0 0 2px 0;
  font-size: 13px;
  color: #000000;
  font-weight: 600;
}
.campus-pin-info p {
  margin: 0;
  font-size: 11.5px;
  color: #8E8E93;
}
.btn-pin-share {
  background: #007AFF;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* QR Code Connect Modal */
.qr-modal-card {
  max-width: 380px;
  background: #FFFFFF;
  border-radius: 28px 28px 0 0;
  box-shadow: var(--sheet-shadow);
}
@media (min-width: 540px) {
  .qr-modal-card {
    border-radius: 24px;
    box-shadow: var(--modal-shadow);
  }
}
.qr-modal-body {
  padding: 16px 20px 24px 20px;
  text-align: center;
}
.qr-hero-card {
  background: linear-gradient(180deg, #F9FAFB 0%, #F3F4F6 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.qr-code-frame {
  width: 200px;
  height: 200px;
  background: #FFFFFF;
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-image-display {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.qr-user-info h4 {
  margin: 0 0 2px 0;
  font-size: 18px;
  font-weight: 700;
  color: #000000;
}
.qr-user-info p {
  margin: 0 0 6px 0;
  font-size: 13.5px;
  color: #007AFF;
  font-weight: 600;
}
.qr-tag {
  display: inline-block;
  background: rgba(0, 122, 255, 0.1);
  color: #007AFF;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
}
.qr-instruction {
  font-size: 12.5px;
  color: #8E8E93;
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.study-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #000000;
  margin-bottom: 4px;
  line-height: 1.3;
}

.message-bubble.sent .study-card-title {
  color: #FFFFFF;
}

.study-card-body {
  font-size: 12.5px;
  color: #3C3C43;
  line-height: 1.4;
  margin-bottom: 8px;
}

.message-bubble.sent .study-card-body {
  color: rgba(255, 255, 255, 0.9);
}

.study-card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #007AFF;
  text-decoration: none;
  font-weight: 600;
}

.message-bubble.sent .study-card-link {
  color: #FFFFFF;
  text-decoration: underline;
}

.study-card-link:hover {
  text-decoration: underline;
}

.study-card-weather-grid {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.study-card-weather-emoji {
  font-size: 36px;
  line-height: 1;
}

.study-card-weather-info {
  display: flex;
  flex-direction: column;
}

.study-card-weather-temp {
  font-size: 20px;
  font-weight: 700;
  color: #000000;
}

.message-bubble.sent .study-card-weather-temp {
  color: #FFFFFF;
}

.study-card-weather-desc {
  font-size: 12px;
  color: #64748B;
}

.message-bubble.sent .study-card-weather-desc {
  color: rgba(255, 255, 255, 0.85);
}

/* ==========================================================================
   DOCUMENT VIEWER & STUDY ARTICLE READER MODALS
   ========================================================================== */
.file-card-clickable {
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.15s ease;
  user-select: none;
}

.file-card-clickable:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.message-bubble.sent .file-card-clickable:hover {
  background: rgba(255, 255, 255, 0.28);
}

.file-card-clickable:active {
  transform: scale(0.98);
}

.file-action-badge {
  font-size: 11.5px;
  font-weight: 700;
  background: #007AFF;
  color: #FFFFFF;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 122, 255, 0.3);
}

.message-bubble.sent .file-action-badge {
  background: #FFFFFF;
  color: #007AFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.study-card-clickable {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
  user-select: none;
}

.study-card-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.message-bubble.sent .study-card-clickable:hover {
  background: rgba(255, 255, 255, 0.24);
}

.study-card-clickable:active {
  transform: scale(0.98);
}

.study-card-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
}

.message-bubble.sent .study-card-action-row {
  border-top-color: rgba(255, 255, 255, 0.2);
}

.btn-study-card-action {
  background: #007AFF;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.message-bubble.sent .btn-study-card-action {
  background: #FFFFFF;
  color: #007AFF;
}

.btn-study-card-action:active {
  transform: scale(0.95);
}

/* Document & Book Viewer Modal */
.document-viewer-card {
  max-width: 520px;
  background: #FFFFFF;
  border-radius: 28px 28px 0 0;
  box-shadow: var(--sheet-shadow);
  max-height: 90vh;
}

@media (min-width: 540px) {
  .document-viewer-card {
    border-radius: 24px;
    box-shadow: var(--modal-shadow);
  }
}

.doc-title-truncated {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 16px;
  font-weight: 700;
}

.doc-viewer-body {
  padding: 16px 20px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.doc-viewer-meta-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #F2F2F7;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
}

.doc-meta-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.doc-meta-details {
  flex: 1;
  min-width: 0;
}

.doc-meta-details h4 {
  font-size: 15px;
  font-weight: 700;
  color: #000000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-meta-details p {
  font-size: 12.5px;
  color: #8E8E93;
  margin-top: 2px;
}

.doc-viewer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-secondary-block {
  width: 100%;
  background: #E5E5EA;
  color: #007AFF;
  border: none;
  border-radius: 14px;
  padding: 12px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.btn-secondary-block:hover {
  background: #D1D1D6;
}

.btn-secondary-block:active {
  transform: scale(0.98);
}

.doc-preview-frame-wrap {
  width: 100%;
  height: 380px;
  border-radius: 14px;
  overflow: hidden;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  background: #F2F2F7;
  margin-top: 6px;
}

.doc-preview-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* Article Reader Modal */
.article-reader-card {
  max-width: 500px;
  background: #FFFFFF;
  border-radius: 28px 28px 0 0;
  box-shadow: var(--sheet-shadow);
  max-height: 88vh;
}

@media (min-width: 540px) {
  .article-reader-card {
    border-radius: 24px;
    box-shadow: var(--modal-shadow);
  }
}

.article-reader-body {
  padding: 18px 20px 24px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.article-reader-hero {
  border-bottom: 0.5px solid var(--ios-separator);
  padding-bottom: 12px;
}

.article-reader-badge {
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 122, 255, 0.12);
  color: #007AFF;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-bottom: 8px;
}

.article-reader-hero h2 {
  font-size: 20px;
  font-weight: 700;
  color: #000000;
  line-height: 1.3;
}

.article-byline {
  font-size: 13px;
  color: #8E8E93;
  margin-top: 4px;
}

.article-reader-content {
  font-size: 14.5px;
  line-height: 1.6;
  color: #1C1C1E;
  white-space: pre-wrap;
  background: #F9FAFB;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  padding: 14px 16px;
}

.article-reader-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

/* ==========================================================================
   CUPERTINO ATTACHMENT ACTION SHEET (Animated Spring Grid)
   ========================================================================== */
.attachment-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 990;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 1;
  transition: opacity 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.attachment-sheet-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.attachment-sheet-menu {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(25px);
  -webkit-backdrop-filter: saturate(180%) blur(25px);
  border-radius: 28px 28px 0 0;
  padding: 16px 20px 36px 20px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(0);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}

.attachment-sheet-backdrop.hidden .attachment-sheet-menu {
  transform: translateY(100%);
}

.attachment-sheet-title {
  font-size: 15px;
  font-weight: 700;
  color: #1C1C1E;
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: -0.2px;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 12px;
}

.attachment-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  border-radius: 16px;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.15s ease;
  user-select: none;
}

.attachment-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.attachment-item:active {
  transform: scale(0.92);
}

.attach-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease;
}

.attachment-item:hover .attach-icon-circle {
  transform: scale(1.06);
}

.attach-icon-circle.bg-blue { background: linear-gradient(135deg, #007AFF, #0056B3); }
.attach-icon-circle.bg-green { background: linear-gradient(135deg, #10B981, #059669); }
.attach-icon-circle.bg-purple { background: linear-gradient(135deg, #AF52DE, #7B2CBF); }
.attach-icon-circle.bg-orange { background: linear-gradient(135deg, #FF9500, #D97706); }
.attach-icon-circle.bg-amber { background: linear-gradient(135deg, #F59E0B, #D97706); }
.attach-icon-circle.bg-violet { background: linear-gradient(135deg, #8B5CF6, #6D28D9); }
.attach-icon-circle.bg-indigo { background: linear-gradient(135deg, #5856D6, #3730A3); }
.attach-icon-circle.bg-pink { background: linear-gradient(135deg, #FF2D55, #BE185D); }
.attach-icon-circle.bg-teal { background: linear-gradient(135deg, #00C7BE, #0F766E); }

/* GIF Picker Modal Styling */
.gif-picker-card {
  max-width: 480px;
  width: 95%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.gif-picker-body {
  padding: 12px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: calc(85vh - 70px);
}
.gif-search-bar-wrap {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 6px 12px;
  gap: 8px;
}
[data-theme="dark"] .gif-search-bar-wrap {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}
.gif-search-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
  padding: 4px 0;
}
.gif-search-clear {
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
}
.gif-quick-tags {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gif-quick-tags::-webkit-scrollbar {
  display: none;
}
.gif-tag-pill {
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
[data-theme="dark"] .gif-tag-pill {
  background: rgba(255, 255, 255, 0.08);
}
.gif-tag-pill.active, .gif-tag-pill:hover {
  background: #007AFF;
  color: #FFFFFF;
}
.gif-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  min-height: 220px;
  max-height: 400px;
  overflow-y: auto;
  border-radius: 8px;
}
.gif-grid-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.06);
  cursor: pointer;
  aspect-ratio: 4/3;
  transition: transform 0.12s ease;
}
.gif-grid-item:hover {
  transform: scale(0.98);
}
.gif-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gif-loading-state, .gif-empty-state {
  grid-column: span 2;
  text-align: center;
  padding: 40px 10px;
  color: var(--text-secondary);
  font-size: 13.5px;
}

.attachment-item span {
  font-size: 12px;
  font-weight: 600;
  color: #1C1C1E;
  text-align: center;
  line-height: 1.2;
}

/* ==========================================================================
   FLOATING TAPBACK REACTION POPOVER (iOS 17 & Google Messages Floating Glass)
   ========================================================================== */
.reaction-popover {
  position: absolute;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(190%) blur(24px);
  -webkit-backdrop-filter: saturate(190%) blur(24px);
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 36px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  animation: reactionPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center bottom;
  user-select: none;
}

.reaction-popover.hidden {
  display: none !important;
}

.reaction-emojis-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.reaction-actions-divider {
  width: 1px;
  height: 24px;
  background: rgba(0, 0, 0, 0.12);
}

.reaction-actions-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.reaction-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 14px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  font-size: 12px;
  font-weight: 600;
  color: #1C1C1E;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reaction-action-btn:hover {
  background: rgba(0, 122, 255, 0.12);
  color: #007AFF;
  transform: translateY(-1px);
}

.reaction-action-btn:active {
  transform: scale(0.94);
}

.reaction-action-btn.btn-action-delete:hover {
  background: rgba(255, 59, 48, 0.12);
  color: #FF3B30;
}

@keyframes reactionPop {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.reaction-emoji-btn {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reaction-emoji-btn:hover {
  transform: scale(1.35) translateY(-4px);
}

.reaction-emoji-btn:active {
  transform: scale(0.95);
}

/* Reactions attached to a message bubble */
.message-reactions-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  position: relative;
  z-index: 2;
}

.reaction-pill-badge {
  background: rgba(255, 255, 255, 0.9);
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  animation: bouncePill 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

@keyframes bouncePill {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.message-bubble.sent .reaction-pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.35);
}

/* Smooth Spring Micro-Interactions across the app */
button, input, textarea, .tab-btn, .channel-card, .chat-list-item, .friend-list-item {
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

button:active {
  transform: scale(0.96);
}

/* High Definition Scroll Smoothing */
.messages-area, .chats-list, .friends-list, .modal-body {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   IN-APP TOP DYNAMIC NOTIFICATION BANNER (Cupertino Dynamic Island)
   ========================================================================== */
.inapp-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  width: 92%;
  max-width: 440px;
  background: rgba(28, 28, 30, 0.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  color: #FFFFFF;
  border-radius: 20px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  z-index: 1000;
  cursor: pointer;
  animation: bannerSlideDown 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease;
}

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

@keyframes bannerSlideDown {
  0% { transform: translateX(-50%) translateY(-90px); opacity: 0; }
  100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.inapp-banner:active {
  transform: translateX(-50%) scale(0.97);
}

.inapp-banner-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #007AFF;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.inapp-banner-content {
  flex: 1;
  min-width: 0;
}

.inapp-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.inapp-banner-header strong {
  font-size: 13.5px;
  font-weight: 600;
  color: #FFFFFF;
}

.inapp-banner-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.inapp-banner-text {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   CONTACT PROFILE SAFETY & PRIVACY ACTIONS (Unfriend & Block)
   ========================================================================== */
.profile-safety-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 0.5px solid var(--ios-separator);
}

.btn-profile-unfriend, .btn-profile-block {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-profile-unfriend {
  background: #F2F2F7;
  color: #FF9500;
}

.btn-profile-unfriend:hover {
  background: #FFECC8;
}

.btn-profile-block {
  background: #FFF1F0;
  color: #FF3B30;
}

.btn-profile-block:hover {
  background: #FEE2E2;
}

.btn-profile-block.blocked {
  background: #E5E5EA;
  color: #007AFF;
}

/* ==========================================================================
   iOS SWITCH CONTROLS & SETTINGS TOGGLES
   ========================================================================== */
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
}

.settings-toggle-row:last-child {
  border-bottom: none;
}

.toggle-info strong {
  display: block;
  font-size: 13.5px;
  color: #000000;
  font-weight: 600;
}

.toggle-info small {
  display: block;
  font-size: 11.5px;
  color: #8E8E93;
  margin-top: 1px;
}

.ios-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 28px;
  flex-shrink: 0;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #E5E5EA;
  transition: 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 28px;
}

.ios-switch-slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.ios-switch input:checked + .ios-switch-slider {
  background-color: #34C759;
}

.ios-switch input:checked + .ios-switch-slider:before {
  transform: translateX(18px);
}

/* ==========================================================================
   BLOCKED STUDENTS LIST MANAGER
   ========================================================================== */
.settings-blocked-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.blocked-student-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #F9FAFB;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}

.blocked-student-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.blocked-student-name {
  font-size: 13px;
  font-weight: 600;
  color: #000000;
}

.blocked-student-handle {
  font-size: 11.5px;
  color: #8E8E93;
}

.btn-unblock-pill {
  background: #007AFF;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-unblock-pill:hover {
  background: #006CE6;
}

.settings-empty-hint {
  font-size: 12.5px;
  color: #8E8E93;
  margin: 4px 0;
  font-style: italic;
}

/* ==========================================================================
   APP INSTALLATION UI (PWA FOR IOS & ANDROID)
   ========================================================================== */
.campus-install-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(7, 94, 84, 0.12);
  color: #075E54;
  border: 1px solid rgba(7, 94, 84, 0.25);
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.campus-install-pill:hover,
.campus-install-pill:active {
  background: #075E54;
  color: #FFFFFF;
  transform: scale(0.96);
}

.settings-install-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F2F2F7;
  padding: 12px 14px;
  border-radius: 12px;
  margin-top: 4px;
}

.install-box-icon {
  font-size: 28px;
}

.install-box-info strong {
  display: block;
  font-size: 14px;
  color: #000;
}

.install-box-info p {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: #8E8E93;
  line-height: 1.35;
}

/* Install Modal Sheet */
.install-modal-card {
  max-width: 440px !important;
  border-radius: 24px 24px 0 0;
}

.install-modal-body {
  padding: 16px 20px 28px 20px;
}

.install-hero {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
}

.install-app-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 10px auto;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(7, 94, 84, 0.25);
}

.install-app-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.install-hero h4 {
  font-size: 18px;
  font-weight: 700;
  color: #000;
  margin: 0;
}

.install-hero-subtitle {
  font-size: 12.5px;
  color: #8E8E93;
  margin: 3px 0 8px 0;
}

.pwa-badge {
  display: inline-block;
  background: #E8F5E9;
  color: #2E7D32;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  letter-spacing: 0.02em;
}

/* Install Tabs Bar */
.install-tabs-bar {
  display: flex;
  background: #E5E5EA;
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 16px;
}

.install-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 7px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #8E8E93;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.install-tab-btn.active {
  background: #FFFFFF;
  color: #000000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Install Step Cards */
.install-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.install-step-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #F9FAFB;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
}

.step-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #075E54;
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content strong {
  display: block;
  font-size: 13.5px;
  color: #000;
  margin-bottom: 2px;
}

.step-content p {
  margin: 0;
  font-size: 12.5px;
  color: #666;
  line-height: 1.4;
}

.ios-icon-inline {
  display: inline-block;
  background: rgba(0, 122, 255, 0.12);
  color: #007AFF;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

/* ==========================================================================
   WHATSAPP-STYLE GROUPS & GROUP CHATS STYLES
   ========================================================================== */

/* Quick Actions Bar in Chats Tab */
.chats-quick-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 4px 14px;
}

.btn-quick-group-pill,
.btn-quick-chat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #FFFFFF;
  color: #1C1C1E;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-quick-group-pill {
  background: #E8F5E9;
  color: #075E54;
  border-color: rgba(7, 94, 84, 0.2);
}

.btn-quick-group-pill:hover,
.btn-quick-chat-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.btn-quick-group-pill:active,
.btn-quick-chat-pill:active {
  transform: scale(0.96);
}

/* Chat Item Group Badge */
.chat-group-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(7, 94, 84, 0.12);
  color: #075E54;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-left: 4px;
}

/* Sender Tag inside Group Messages (WhatsApp style) */
.group-sender-tag {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
  cursor: pointer;
}

/* System Message in Chat Bubbles */
.chat-system-message {
  display: flex;
  justify-content: center;
  margin: 10px 0;
  width: 100%;
}

.chat-system-pill {
  display: inline-block;
  background: rgba(0, 0, 0, 0.06);
  color: #666;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 12px;
  text-align: center;
  max-width: 85%;
  line-height: 1.35;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* ==========================================================================
   CREATE GROUP MODAL STYLES
   ========================================================================== */
.create-group-card,
.group-info-card,
.add-members-card {
  max-width: 480px;
  width: 95%;
  max-height: 90vh;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
}

.create-group-body,
.group-info-body,
.add-members-body {
  overflow-y: auto;
  padding: 14px 18px 24px 18px;
  -webkit-overflow-scrolling: touch;
}

/* Group Identity Header */
.group-identity-section {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #F9FAFB;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 16px;
  padding: 12px;
}

.group-avatar-picker-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
}

.group-avatar-preview {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.group-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.group-avatar-upload-btn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #007AFF;
  color: #FFFFFF;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.group-inputs-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-with-counter {
  position: relative;
  width: 100%;
}

.modern-text-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #FFFFFF;
  font-size: 14px;
  color: #000;
  outline: none;
  transition: border-color 0.2s;
}

.modern-text-input:focus {
  border-color: #007AFF;
}

.char-counter {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #8E8E93;
}

/* Theme Color Picker */
.group-theme-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 8px 12px;
  background: #F9FAFB;
  border-radius: 12px;
}

.picker-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #555;
}

.theme-colors-tray {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.color-dot.active {
  transform: scale(1.2);
  border-color: #000000;
}

/* Selected Member Chips */
.selected-chips-section {
  margin-top: 14px;
}

.chips-header {
  margin-bottom: 6px;
}

.chips-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #8E8E93;
}

.chips-horizontal-tray {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 2px;
  min-height: 38px;
}

.chips-empty-hint {
  font-size: 12px;
  color: #8E8E93;
  font-style: italic;
}

.selected-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #E8F5E9;
  color: #075E54;
  border: 1px solid rgba(7, 94, 84, 0.2);
  padding: 3px 8px 3px 4px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.selected-member-chip .chip-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #FFFFFF;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.selected-member-chip .chip-remove-btn {
  background: none;
  border: none;
  color: #075E54;
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

/* Classmates Selection List */
.group-members-picker-section {
  margin-top: 12px;
}

.small-search {
  margin-bottom: 8px;
}

.classmates-selection-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 4px;
  background: #FFFFFF;
}

.classmate-select-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.classmate-select-row:hover {
  background: #F2F2F7;
}

.classmate-select-row.selected {
  background: #E8F5E9;
}

.select-row-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #FFFFFF;
  font-size: 14px;
  flex-shrink: 0;
}

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

.select-row-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-row-sub {
  font-size: 11.5px;
  color: #8E8E93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-checkbox-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #C7C7CC;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.classmate-select-row.selected .select-checkbox-circle {
  background: #075E54;
  border-color: #075E54;
}

.classmate-select-row.selected .select-checkbox-circle::after {
  content: '✓';
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
}

/* ==========================================================================
   GROUP INFO DRAWER STYLES (WhatsApp-Style)
   ========================================================================== */
.group-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 0 10px 0;
}

.group-info-avatar-hero {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  margin-bottom: 10px;
}

.group-hero-title {
  font-size: 20px;
  font-weight: 700;
  color: #000;
  margin: 0;
}

.group-hero-meta {
  font-size: 13px;
  color: #8E8E93;
  margin: 2px 0 0 0;
}

.group-created-by {
  font-size: 11.5px;
  color: #A0A0A5;
  margin: 2px 0 0 0;
}

/* Group Description Card */
.group-desc-card {
  background: #F9FAFB;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 10px 14px;
  margin-top: 14px;
}

.desc-card-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #8E8E93;
  margin-bottom: 4px;
}

.group-desc-text {
  font-size: 13.5px;
  color: #333;
  line-height: 1.4;
  margin: 0;
}

/* Group Action Pills Row */
.group-action-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn-group-action-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  background: #F2F2F7;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #007AFF;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-group-action-pill:hover {
  background: #E5E5EA;
}

.btn-group-action-pill:active {
  transform: scale(0.98);
}

/* Participants Section in Group Info */
.group-participants-section {
  margin-top: 16px;
  background: #F9FAFB;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 12px;
}

.participants-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.admin-summary-tag {
  font-size: 11px;
  font-weight: 700;
  color: #075E54;
  background: #E8F5E9;
  padding: 2px 6px;
  border-radius: 6px;
}

.group-participants-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}

.participant-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: #FFFFFF;
}

.participant-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #FFFFFF;
  font-size: 13px;
  flex-shrink: 0;
}

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

.participant-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.participant-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-badge {
  font-size: 10px;
  font-weight: 700;
  background: #E8F5E9;
  color: #075E54;
  padding: 1px 5px;
  border-radius: 4px;
  border: 0.5px solid rgba(7, 94, 84, 0.3);
}

.participant-major {
  font-size: 11px;
  color: #8E8E93;
}

.participant-action-btn {
  background: none;
  border: none;
  color: #FF3B30;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.participant-action-btn:hover {
  background: #FFECEB;
}

/* Danger Zone */
.group-danger-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.btn-danger-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: #FFECEB;
  color: #FF3B30;
  border: 1px solid rgba(255, 59, 48, 0.2);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-danger-item:hover {
  background: #FFD8D6;
}

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

/* ==========================================================================
   GOOGLE MESSAGES: INBOX CATEGORIES & SEARCH
   ========================================================================== */
.chats-search-section {
  padding: 10px 14px 6px 14px;
  background: #FFFFFF;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.chats-search-section .search-box {
  margin-bottom: 8px;
}

.inbox-categories-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.inbox-categories-bar::-webkit-scrollbar {
  display: none;
}

.inbox-cat-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #E5E5EA;
  background: #F2F2F7;
  color: #3C3C43;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
}

.inbox-cat-chip:hover {
  background: #E5E5EA;
}

.inbox-cat-chip.active {
  background: #007AFF;
  color: #FFFFFF;
  border-color: #007AFF;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
}

.btn-quick-starred-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #FFF9E6;
  color: #B27B00;
  border: 1px solid #FFE58F;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-quick-starred-pill:hover {
  background: #FFF1B8;
  transform: translateY(-1px);
}

/* Chat Item Pinned State */
.chat-item.pinned {
  background: #F8FAFF;
  border-left: 3px solid #007AFF;
}

.chat-pin-icon {
  font-size: 12px;
  margin-left: 4px;
  vertical-align: middle;
  display: inline-block;
}

/* ==========================================================================
   GOOGLE MESSAGES: AI SMART REPLIES BAR
   ========================================================================== */
.smart-replies-bar {
  background: rgba(248, 248, 250, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid #E5E5EA;
  padding: 8px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  animation: slideDownIn 0.2s ease;
}

.smart-replies-bar::-webkit-scrollbar {
  display: none;
}

.smart-replies-track {
  display: flex;
  gap: 8px;
  align-items: center;
}

.smart-reply-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  background: #FFFFFF;
  color: #007AFF;
  border: 1px solid rgba(0, 122, 255, 0.3);
  border-radius: 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
}

.smart-reply-chip:hover {
  background: #EBF5FF;
  border-color: #007AFF;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 122, 255, 0.18);
}

.smart-reply-chip:active {
  transform: scale(0.96);
}

/* ==========================================================================
   GOOGLE MESSAGES: SCHEDULED MESSAGES (SEND LATER)
   ========================================================================== */
.scheduled-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #FFF9E6;
  border-top: 1px solid #FFE58F;
  border-bottom: 1px solid #FFE58F;
  font-size: 13px;
  color: #874D00;
  animation: slideDownIn 0.2s ease;
}

.scheduled-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.btn-scheduled-view {
  background: #FF9500;
  color: #FFFFFF;
  border: none;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-scheduled-view:hover {
  background: #E08500;
}

.schedule-modal-card {
  width: 92%;
  max-width: 440px;
  border-radius: 20px;
  background: #FFFFFF;
  padding: 20px;
}

.schedule-subtitle {
  font-size: 13px;
  color: #8E8E93;
  margin-bottom: 14px;
}

.schedule-draft-box {
  background: #F2F2F7;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.draft-tag {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: #8E8E93;
  letter-spacing: 0.5px;
}

.draft-text {
  font-size: 14px;
  color: #1C1C1E;
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.schedule-presets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.schedule-preset-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #F8F9FA;
  border: 1px solid #E5E5EA;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.schedule-preset-btn:hover {
  background: #F2F2F7;
  border-color: #D1D1D6;
}

.preset-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preset-icon {
  font-size: 20px;
}

.preset-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.preset-info strong {
  font-size: 14px;
  color: #1C1C1E;
}

.preset-info span {
  font-size: 12px;
  color: #8E8E93;
}

.preset-arrow {
  font-size: 18px;
  color: #C7C7CC;
}

.custom-schedule-section {
  border-top: 1px solid #E5E5EA;
  padding-top: 14px;
}

.section-divider-text {
  font-size: 11px;
  font-weight: 700;
  color: #8E8E93;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

/* ==========================================================================
   GOOGLE MESSAGES: MAGIC COMPOSE AI
   ========================================================================== */
.btn-ios-magic {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-ios-magic:hover {
  background: #F3E8FF;
  transform: scale(1.1);
}

.magic-compose-card {
  width: 92%;
  max-width: 480px;
  background: #FFFFFF;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 16px 40px rgba(175, 82, 222, 0.15);
}

.header-title-sparkle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-title-sparkle h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.sparkle-icon {
  font-size: 18px;
}

.magic-compose-subtitle {
  font-size: 13px;
  color: #8E8E93;
  margin-bottom: 14px;
}

.magic-input-wrapper {
  margin-bottom: 14px;
}

.magic-input-wrapper label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #8E8E93;
  margin-bottom: 4px;
  display: block;
}

.magic-input-wrapper textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #E5E5EA;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  background: #F8F9FA;
}

.magic-input-wrapper textarea:focus {
  outline: none;
  border-color: #AF52DE;
  background: #FFFFFF;
}

.magic-tones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.tone-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 6px;
  background: #F2F2F7;
  border: 1px solid #E5E5EA;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tone-btn:hover {
  background: #EBE5F5;
  border-color: #AF52DE;
}

.tone-btn.active {
  background: #F3E8FF;
  border-color: #AF52DE;
  box-shadow: 0 2px 8px rgba(175, 82, 222, 0.2);
}

.tone-emoji {
  font-size: 18px;
  margin-bottom: 4px;
}

.tone-name {
  font-size: 12px;
  font-weight: 600;
  color: #1C1C1E;
}

.tone-desc {
  font-size: 10px;
  color: #8E8E93;
  margin-top: 2px;
}

.magic-output-card {
  background: linear-gradient(135deg, #FBF8FF, #F5EEFF);
  border: 1px solid rgba(175, 82, 222, 0.25);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 16px;
}

.magic-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.badge-tone {
  padding: 3px 10px;
  background: #AF52DE;
  color: #FFFFFF;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.magic-output-text {
  font-size: 14px;
  line-height: 1.45;
  color: #1C1C1E;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   GOOGLE MESSAGES: STARRED MESSAGES SYSTEM
   ========================================================================== */
.starred-modal-card {
  width: 92%;
  max-width: 480px;
  background: #FFFFFF;
  border-radius: 20px;
  padding: 20px;
}

.starred-msg-card {
  background: #F8F9FA;
  border: 1px solid #E5E5EA;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: all 0.15s ease;
}

.starred-msg-card:hover {
  background: #F2F2F7;
  border-color: #D1D1D6;
}

.starred-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.starred-card-author {
  font-size: 12px;
  font-weight: 600;
  color: #007AFF;
}

.starred-card-time {
  font-size: 11px;
  color: #8E8E93;
}

.starred-card-body {
  font-size: 13px;
  color: #1C1C1E;
  line-height: 1.4;
  margin-bottom: 8px;
}

.starred-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-unstar-pill {
  background: #FFF1F0;
  color: #FF3B30;
  border: 1px solid #FFA39E;
  border-radius: 10px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  font-weight: 500;
}

/* Message Bubble Star Button & Star Icon */
.msg-star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: #C7C7CC;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.6;
  transition: all 0.15s ease;
  vertical-align: middle;
}

.msg-star-btn:hover {
  opacity: 1;
  color: #FF9500;
  transform: scale(1.15);
}

.msg-star-btn.starred {
  color: #FF9500;
  opacity: 1;
}

.msg-starred-indicator {
  color: #FF9500;
  font-size: 10px;
  margin-left: 3px;
  vertical-align: middle;
}

/* ==========================================================================
   GOOGLE MESSAGES: OTP & PIN 1-TAP COPY DETECTION
   ========================================================================== */
.otp-copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 4px 10px;
  background: #EBF5FF;
  color: #007AFF;
  border: 1px solid #BAE0FF;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.otp-copy-chip:hover {
  background: #BAE0FF;
}

.otp-copy-chip:active {
  transform: scale(0.96);
}

/* ==========================================================================
   RCS TYPING INDICATOR BUBBLE (GOOGLE MESSAGES STYLE)
   ========================================================================== */
.typing-bubble-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  padding: 0 12px;
  animation: fadeIn 0.2s ease;
}

.typing-bubble {
  background: #E9E9EB;
  border-radius: 18px 18px 18px 4px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing-bubble .dot {
  width: 6px;
  height: 6px;
  background: #8E8E93;
  border-radius: 50%;
  animation: rcsDotPulse 1.4s infinite ease-in-out;
}

.typing-bubble .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-bubble .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes rcsDotPulse {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* ==========================================================================
   GOOGLE MESSAGES & RCS: DOCKED QUOTED REPLY PREVIEW BAR
   ========================================================================== */
.reply-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(246, 246, 248, 0.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--ios-separator);
  border-bottom: 0.5px solid var(--ios-separator);
  gap: 12px;
  animation: slideUpReply 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.2s ease;
  z-index: 40;
}

.reply-preview-bar.hidden {
  display: none !important;
}

@keyframes slideUpReply {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.reply-preview-indicator {
  width: 3.5px;
  height: 36px;
  border-radius: 4px;
  background: var(--ios-blue);
  flex-shrink: 0;
}

.reply-preview-text-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.reply-preview-sender-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 650;
  color: var(--ios-blue);
}

.reply-preview-icon {
  font-size: 12px;
}

.reply-preview-snippet {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.btn-cancel-reply {
  background: none;
  border: none;
  padding: 6px;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-cancel-reply:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
  transform: scale(1.1);
}

/* ==========================================================================
   GOOGLE MESSAGES: IN-BUBBLE QUOTED MESSAGE CONTEXT
   ========================================================================== */
.message-quoted-preview {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.06);
  cursor: pointer;
  border-left: 3.5px solid var(--ios-blue);
  transition: all 0.15s ease;
  font-size: 12.5px;
  max-width: 100%;
  overflow: hidden;
  user-select: none;
}

.message-bubble.sent .message-quoted-preview {
  background: rgba(255, 255, 255, 0.22);
  border-left-color: #FFFFFF;
  color: #FFFFFF;
}

.message-quoted-preview:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.message-quoted-preview:active {
  transform: scale(0.98);
}

.quoted-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.quoted-sender {
  font-weight: 700;
  font-size: 11.5px;
  color: var(--ios-blue);
  margin-bottom: 2px;
}

.message-bubble.sent .quoted-sender {
  color: #FFFFFF;
}

.quoted-text {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-bubble.sent .quoted-text {
  color: rgba(255, 255, 255, 0.88);
}

/* Quote Flash Highlight (when tapping quoted header) */
@keyframes flashHighlightAnim {
  0% {
    box-shadow: 0 0 0 4px #FFD60A, 0 4px 18px rgba(255, 214, 10, 0.6);
    transform: scale(1.03);
  }
  50% {
    box-shadow: 0 0 0 2px #FFD60A, 0 2px 10px rgba(255, 214, 10, 0.3);
  }
  100% {
    box-shadow: none;
    transform: scale(1);
  }
}

.flash-highlight {
  animation: flashHighlightAnim 1.6s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

/* ==========================================================================
   SWIPE-TO-REPLY GESTURE PHYSICS
   ========================================================================== */
.message-bubble-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.message-bubble {
  position: relative;
  touch-action: pan-y;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.message-bubble.swiping {
  transition: none !important;
}

.swipe-reply-icon {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%) scale(0.6);
  opacity: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ios-blue);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 3px 10px rgba(0, 122, 255, 0.35);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 5;
}

.message-bubble-wrapper.swiping-active .swipe-reply-icon {
  opacity: 0.85;
  transform: translateY(-50%) scale(0.9);
}

.message-bubble-wrapper.swipe-ready .swipe-reply-icon {
  opacity: 1;
  transform: translateY(-50%) scale(1.15);
  background: #34C759; /* Apple green trigger confirmation */
  box-shadow: 0 4px 14px rgba(52, 199, 89, 0.45);
}

/* Reactions Pill Badge Active State */
.reaction-pill-badge.active {
  background: #007AFF !important;
  color: #FFFFFF !important;
  border-color: #007AFF !important;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.4);
}

.reaction-pill-badge.active .reaction-count {
  color: #FFFFFF !important;
}

.reaction-pill-badge:hover {
  transform: scale(1.1);
}

/* ==========================================================================
   CAMPUS CELEBRATIONS & SCREEN EFFECTS CANVAS OVERLAY
   ========================================================================== */
/* ==========================================================================
   CAMPUS CELEBRATIONS & SCREEN EFFECTS CANVAS OVERLAY
   ========================================================================== */
.screen-effects-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  z-index: 99999;
}

/* ==========================================================================
   OFFLINE MODE PERSISTENT CHAT NOTICE BANNER
   ========================================================================== */
.offline-chat-banner {
  background: rgba(142, 142, 147, 0.14);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 550;
  padding: 5px 12px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 0.5px solid var(--ios-separator);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.2s ease;
}

.offline-chat-banner.hidden {
  display: none !important;
}

.offline-dot {
  color: #FF9500;
  font-weight: bold;
}

/* ==========================================================================
   FEATURE EXPANSIONS: SEARCH, PINNED, LINK CARDS, MEDIA HUB, AUDIO SPEED
   ========================================================================== */

/* 1. In-Chat Inline Search Bar */
.in-chat-search-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-primary);
  border-bottom: 0.5px solid var(--ios-separator);
  padding: 6px 12px;
  animation: slideDown 0.18s ease;
  z-index: 10;
}
.in-chat-search-bar.hidden {
  display: none !important;
}
.in-chat-search-input-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  background: rgba(118, 118, 128, 0.12);
  border-radius: 10px;
  padding: 5px 10px;
}
.in-chat-search-input-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
}
.search-match-count {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}
.in-chat-search-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-search-arrow {
  background: transparent;
  border: none;
  color: #007AFF;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 6px;
}
.btn-search-arrow:active {
  background: rgba(0, 122, 255, 0.12);
}
.search-highlight {
  background: #FFE600 !important;
  color: #000000 !important;
  border-radius: 3px;
  padding: 0 2px;
}
.search-highlight-current {
  background: #FF9500 !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 0 2px #FF9500;
}

/* 2. Pinned Message Banner */
.pinned-messages-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 122, 255, 0.08);
  border-bottom: 0.5px solid rgba(0, 122, 255, 0.2);
  padding: 6px 14px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s ease;
  z-index: 9;
}
.pinned-messages-banner.hidden {
  display: none !important;
}
.pinned-banner-icon {
  font-size: 14px;
}
.pinned-banner-content {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}
.pinned-banner-content strong {
  color: #007AFF;
  margin-right: 4px;
}
.btn-unpin-pill {
  background: transparent;
  border: 1px solid rgba(0, 122, 255, 0.3);
  color: #007AFF;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  cursor: pointer;
}

/* 3. Rich Link Preview Card */
.rich-link-card {
  display: block;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.04);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 6px;
  max-width: 320px;
  transition: transform 0.15s ease, background 0.15s ease;
}
[data-theme="dark"] .rich-link-card {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}
.rich-link-card:active {
  transform: scale(0.98);
}
.rich-link-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
.rich-link-meta {
  padding: 8px 10px;
}
.rich-link-domain {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.rich-link-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rich-link-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* GitHub Rich Repo Card */
.github-repo-card {
  border-left: 3px solid #2da44e !important;
  background: rgba(0, 0, 0, 0.05);
}
[data-theme="dark"] .github-repo-card {
  background: rgba(255, 255, 255, 0.08);
  border-left-color: #3fb950 !important;
}
.github-repo-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 4px;
}
.github-icon {
  font-size: 16px;
}
.github-repo-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.github-badge {
  font-size: 10px;
  background: rgba(45, 164, 78, 0.15);
  color: #2da44e;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 600;
}
.github-desc {
  padding: 0 10px 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
}
.github-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 8px;
}
.github-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* 4. Voice Note Waveform & Speed Toggle */
.voice-speed-pill {
  background: rgba(0, 0, 0, 0.08);
  border: none;
  border-radius: 12px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  margin-left: 6px;
  transition: background 0.15s;
}
[data-theme="dark"] .voice-speed-pill {
  background: rgba(255, 255, 255, 0.15);
}
.voice-speed-pill:active {
  transform: scale(0.92);
}

/* 5. Shared Media Hub Modal */
.chat-media-card {
  max-width: 520px;
  height: 80vh;
  display: flex;
  flex-direction: column;
}
.chat-media-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.media-hub-tabs {
  display: flex;
  border-bottom: 0.5px solid var(--ios-separator);
  background: var(--bg-primary);
  padding: 4px 8px;
  gap: 4px;
}
.media-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.media-tab-btn.active {
  background: rgba(0, 122, 255, 0.12);
  color: #007AFF;
}
.media-hub-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.media-grid-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.media-grid-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.06);
  cursor: pointer;
}
.media-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 8px;
  border: 0.5px solid var(--ios-separator);
  text-decoration: none;
  color: inherit;
}
.media-list-item:active {
  background: rgba(118, 118, 128, 0.1);
}
.media-item-icon {
  font-size: 22px;
}
.media-item-info {
  flex: 1;
  min-width: 0;
}
.media-item-name {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-item-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* 6. Channel Group Divider */
.channel-group-divider {
  padding: 16px 4px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* ==========================================================================
   AUTHENTIC STANDALONE APP DISPLAY & NOTCH SAFE AREA SUPPORT (iOS & Android)
   ========================================================================== */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

/* Authentic Top Navigation Safe Area (Notch & Dynamic Island) */
.app-bar {
  padding-top: max(12px, env(safe-area-inset-top, 12px)) !important;
  padding-left: max(0px, env(safe-area-inset-left, 0px));
  padding-right: max(0px, env(safe-area-inset-right, 0px));
}

.chat-header {
  padding-top: max(12px, env(safe-area-inset-top, 12px)) !important;
  padding-left: max(14px, env(safe-area-inset-left, 14px)) !important;
  padding-right: max(14px, env(safe-area-inset-right, 14px)) !important;
}

/* Authentic Bottom Safe Area (iPhone Home Bar) */
.chat-input-bar {
  padding-bottom: max(12px, env(safe-area-inset-bottom, 12px)) !important;
  padding-left: max(10px, env(safe-area-inset-left, 10px)) !important;
  padding-right: max(10px, env(safe-area-inset-right, 10px)) !important;
}

#auth-screen {
  padding-top: max(24px, env(safe-area-inset-top, 24px)) !important;
  padding-bottom: max(24px, env(safe-area-inset-bottom, 24px)) !important;
  padding-left: max(16px, env(safe-area-inset-left, 16px)) !important;
  padding-right: max(16px, env(safe-area-inset-right, 16px)) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.auth-card {
  margin: auto 0;
}

#inapp-notification-banner {
  top: max(12px, env(safe-area-inset-top, 12px)) !important;
}

.modal-card {
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px)) !important;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.call-sheet-card {
  padding-top: max(28px, env(safe-area-inset-top, 28px)) !important;
  padding-bottom: max(28px, env(safe-area-inset-bottom, 28px)) !important;
}

/* Phone App Full-Bleed & Standalone Behavior */
@media (max-width: 768px), (display-mode: standalone), (display-mode: minimal-ui) {
  html, body {
    overscroll-behavior: none !important;
    overscroll-behavior-y: none !important;
    -webkit-overflow-scrolling: touch !important;
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    position: relative !important;
  }

  body {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    background-color: var(--ios-bg) !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
  }

  .screen,
  #app-viewport,
  #main-screen,
  #chat-screen {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    overflow-x: hidden !important;
  }

  /* Secondary header actions live in the More menu, so the phone top bar only holds three buttons */

  /* Compact user chip: clean circular avatar button */
  .user-chip {
    padding: 0 !important;
    background: transparent !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    border: none !important;
  }
  .user-chip #current-user-handle,
  .user-chip span:last-child {
    display: none !important;
  }
  .user-chip .avatar-sm {
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
    box-shadow: 0 1px 4px rgba(0, 122, 255, 0.3) !important;
  }

  .campus-weather-pill {
    padding: 4px 8px !important;
    font-size: 12px !important;
    gap: 4px !important;
  }
  .campus-weather-pill .weather-pill-loc {
    display: none !important;
  }

  /* Keep tabs bar properly fitted */
  .tabs-bar {
    margin: 4px 14px 8px !important;
  }
  .tab-btn {
    padding: 7px 4px !important;
    font-size: 12px !important;
  }

  /* Universal Prevention of iOS Safari Auto-Zoom */
  input,
  textarea,
  select {
    font-size: 16px !important;
  }

  /* Horizontal swipe for quick action pills on phone */
  .chats-quick-actions-bar {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    white-space: nowrap !important;
  }

  .chats-quick-actions-bar::-webkit-scrollbar {
    display: none !important;
  }

  .btn-quick-group-pill,
  .btn-quick-chat-pill,
  .btn-quick-starred-pill {
    flex-shrink: 0 !important;
  }

  /* Floating SOS action */
  .floating-container {
    bottom: max(16px, env(safe-area-inset-bottom, 16px)) !important;
    left: 14px !important;
    right: 14px !important;
  }
  .btn-fab-sos {
    padding: 10px 14px !important;
    font-size: 11.5px !important;
  }
  .btn-fab-sos .fab-sos-text {
    font-size: 11px !important;
  }
  .btn-fab-add {
    width: 48px !important;
    height: 48px !important;
  }
}

.is-standalone-app #btn-install-app {
  display: none !important;
}

.is-standalone-app .screen,
.is-standalone-app #app-viewport,
.is-standalone-app #main-screen,
.is-standalone-app #chat-screen {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  overflow-x: hidden !important;
}

/* ==========================================================================
   FRIENDS SUBTABS & REQUESTS ENHANCEMENTS
   ========================================================================== */
.friends-subtabs-nav {
  display: flex;
  background: var(--bg-card, #f0f2f5);
  padding: 4px;
  border-radius: 12px;
  margin: 10px 14px 6px;
  gap: 4px;
}

.friends-subtab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted, #8E8E93);
  cursor: pointer;
  transition: all 0.18s ease;
}

.friends-subtab-btn.active {
  background: var(--card-bg, #ffffff);
  color: var(--text-dark, #000000);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.subtab-badge-pill {
  background-color: var(--ios-red, #FF3B30);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.outgoing-request-card {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.02);
  border: 0.5px dashed var(--ios-border, #E5E5EA);
  border-radius: 12px;
  padding: 8px 12px;
  gap: 10px;
}

.btn-cancel-request {
  background: rgba(255, 59, 48, 0.1);
  color: var(--ios-red, #FF3B30);
  border: none;
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-cancel-request:hover {
  opacity: 0.8;
}

[data-theme="dark"] .friends-subtabs-nav {
  background: #1C1C1E;
}

[data-theme="dark"] .friends-subtab-btn.active {
  background: #2C2C2E;
  color: #FFFFFF;
}

[data-theme="dark"] .outgoing-request-card {
  background: rgba(255,255,255,0.04);
  border-color: #38383A;
}

[data-theme="dark"] .settings-backup-info-box {
  background: rgba(255,255,255,0.05) !important;
}

/* ==========================================================================
   FTUX (FIRST-TIME USER EXPERIENCE) ONBOARDING WIZARD
   ========================================================================== */
.onboarding-modal-card {
  width: 92%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 28px;
  background: var(--bg-card, #FFFFFF);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  padding: 24px 22px;
  animation: modalPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-header {
  text-align: center;
  margin-bottom: 20px;
}

.onboarding-badge-icon {
  font-size: 42px;
  margin-bottom: 6px;
  display: inline-block;
  animation: bounceSlow 2.5s infinite ease-in-out;
}

@keyframes bounceSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.onboarding-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main, #1C1C1E);
  margin-bottom: 6px;
}

.onboarding-header p {
  font-size: 13.5px;
  color: var(--text-muted, #8E8E93);
  line-height: 1.45;
  margin: 0;
}

.onboarding-avatar-section {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: var(--bg-subtle, #F2F2F7);
  border-radius: 18px;
  margin-bottom: 18px;
}

.onboarding-avatar-preview-wrap {
  position: relative;
  flex-shrink: 0;
}

.onboarding-avatar-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  background: #007AFF;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.3);
}

.onboarding-dice-btn {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  background: #FF9500;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  transition: transform 0.15s ease;
}

.onboarding-dice-btn:hover {
  transform: scale(1.1) rotate(15deg);
}

.onboarding-avatar-styles-bar {
  flex: 1;
}

.onboarding-section-subtitle {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted, #8E8E93);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 6px;
}

.onboarding-styles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.onboarding-style-chip {
  padding: 5px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(0,0,0,0.1);
  background: #FFFFFF;
  color: var(--text-main, #1C1C1E);
  cursor: pointer;
  transition: all 0.15s ease;
}

.onboarding-style-chip.active {
  background: #007AFF;
  color: #FFFFFF;
  border-color: #007AFF;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3);
}

.onboarding-fields-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.onboarding-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.onboarding-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #8E8E93);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.onboarding-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-color, rgba(0,0,0,0.1));
  background: var(--bg-input, #FFFFFF);
  color: var(--text-main, #1C1C1E);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.18s ease;
}

.onboarding-input:focus {
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.btn-onboarding-continue {
  width: 100%;
  padding: 13px 20px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #007AFF 0%, #0056B3 100%);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.35);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-onboarding-continue:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.btn-onboarding-continue:active {
  transform: scale(0.98);
}

/* Voice Dictation (Web Speech API) Mic Button */
.btn-dictation-mic {
  transition: color 0.2s ease, transform 0.2s ease;
}

.btn-dictation-mic.listening {
  color: #FF3B30 !important;
  animation: pulseDictation 1.2s infinite ease-in-out;
}

@keyframes pulseDictation {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 59, 48, 0.4)); }
  50% { transform: scale(1.22); filter: drop-shadow(0 0 8px rgba(255, 59, 48, 0.8)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 59, 48, 0.4)); }
}

[data-theme="dark"] .onboarding-modal-card {
  background: #1C1C1E;
}

[data-theme="dark"] .onboarding-avatar-section {
  background: #2C2C2E;
}

[data-theme="dark"] .onboarding-style-chip {
  background: #2C2C2E;
  color: #FFFFFF;
  border-color: #38383A;
}

[data-theme="dark"] .onboarding-input {
  background: #2C2C2E;
  color: #FFFFFF;
  border-color: #38383A;
}

/* Instagram-Style Friend Requests Modal & Cards */
.ig-requests-card {
  max-width: 500px;
  width: 100%;
  border-radius: 20px 20px 0 0;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 600px) {
  .ig-requests-card {
    border-radius: 20px;
    max-height: 80vh;
  }
}

.ig-requests-header {
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--ios-separator);
}

.ig-requests-tabs-bar {
  display: flex;
  background: var(--bg-secondary, #F2F2F7);
  padding: 4px;
  margin: 12px 16px 8px 16px;
  border-radius: 12px;
  gap: 4px;
}

.ig-subtab-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted, #8E8E93);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.ig-subtab-btn.active {
  background: var(--bg-card, #FFFFFF);
  color: var(--text-dark, #000000);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.ig-badge-pill {
  background: #FF3B30;
  color: white;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.ig-badge-pill.hidden {
  display: none;
}

.ig-requests-body {
  padding: 8px 16px 24px 16px;
  overflow-y: auto;
  flex: 1;
}

.ig-requests-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ig-request-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card, #FFFFFF);
  border-radius: 14px;
  border: 0.5px solid var(--ios-border, rgba(0,0,0,0.08));
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.ig-request-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  position: relative;
  flex-shrink: 0;
}

.ig-request-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.ig-request-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ig-request-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark, #000000);
  line-height: 1.2;
}

.ig-request-handle {
  font-size: 12px;
  color: var(--text-light, #8E8E93);
}

.ig-request-major {
  font-size: 11.5px;
  color: var(--text-muted, #666666);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ig-request-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-ig-confirm {
  background: #0095F6;
  color: white;
  border: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.2s ease;
}

.btn-ig-confirm:hover {
  opacity: 0.92;
}

.btn-ig-delete {
  background: var(--bg-hover, #EFEFEF);
  color: var(--text-dark, #000000);
  border: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-ig-delete:hover {
  background: #E5E5EA;
}

.btn-ig-confirmed {
  background: #34C759 !important;
  color: white !important;
  pointer-events: none;
}

.btn-ig-cancel {
  background: var(--bg-hover, #EFEFEF);
  color: #FF3B30;
  border: none;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

[data-theme="dark"] .ig-request-item {
  background: #1C1C1E;
  border-color: #2C2C2E;
}

[data-theme="dark"] .ig-requests-tabs-bar {
  background: #2C2C2E;
}

[data-theme="dark"] .ig-subtab-btn.active {
  background: #3A3A3C;
  color: #FFFFFF;
}

[data-theme="dark"] .btn-ig-delete,
[data-theme="dark"] .btn-ig-cancel {
  background: #2C2C2E;
  color: #FFFFFF;
}

.my-profile-banner-card {
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.my-profile-banner-card:active {
  transform: scale(0.985);
  background: var(--bg-hover, rgba(0, 0, 0, 0.04));
}

[data-theme="dark"] .my-profile-banner-card {
  background: #1C1C1E;
  border-color: #2C2C2E;
}




/* Login: college email domain status + passwordless flow steps */
.email-domain-status.is-valid { color: #128C7E; }
.email-domain-status.is-invalid { color: #d93025; }
.otp-flow-steps {
  margin: 4px 0 16px;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.85;
}
.otp-flow-steps li { margin-bottom: 4px; }

/* Settings: Data & Privacy facts wrap instead of truncating */
.privacy-fact-text {
  white-space: normal;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  opacity: 0.8;
}
#settings-data-privacy .settings-read-label {
  font-size: 14px;
  font-weight: 600;
  color: inherit;
  opacity: 1;
  text-transform: none;
}

/* Operational Metrics panel (admin-only) */
.ops-metrics-open-btn { margin: 12px 16px 16px; width: calc(100% - 32px); }
.ops-metrics-card { max-width: 860px; width: 100%; }
.ops-metrics-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.ops-metrics-status, .ops-metrics-footnote { font-size: 13px; opacity: 0.75; margin: 0; }
.ops-kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 600px) { .ops-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ops-kpi { border: 1px solid rgba(127, 127, 127, 0.25); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.ops-kpi-label { font-size: 12px; opacity: 0.7; }
.ops-kpi-value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ops-section-title { font-size: 14px; margin: 0; }
.ops-table-scroll { overflow-x: auto; }
.ops-cohort-table { border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; width: 100%; }
.ops-cohort-table th, .ops-cohort-table td { padding: 6px 8px; text-align: center; border: 1px solid rgba(127, 127, 127, 0.2); white-space: nowrap; }
.ops-cohort-table th:first-child, .ops-cohort-table td:first-child { text-align: left; }
.ops-cell-empty { opacity: 0.4; }
.ops-empty { text-align: center; opacity: 0.7; padding: 16px; }

/* Signup username picker: choose from generated handles */
.username-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.username-picker-label { font-size: 13px; font-weight: 600; }
.username-shuffle-btn {
  border: 1px solid var(--ios-secondary-bg);
  background: var(--ios-tertiary-bg);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.username-shuffle-btn:disabled { opacity: 0.5; cursor: default; }
.username-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 6px;
}
.username-option {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--ios-secondary-bg);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.username-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.username-option:has(input:checked) {
  border-color: var(--ios-blue);
  background: rgba(0, 122, 255, 0.1);
  color: var(--ios-blue);
  font-weight: 600;
}
.username-option:has(input:focus-visible) { outline: 2px solid var(--ios-blue); outline-offset: 2px; }

/* Settings username re-pick: confirm button on its own row under the options */
#settings-username-picker {
  margin-top: 10px;
}
#btn-confirm-username-change {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
}

/* Header "More" menu: secondary actions as full-width rows with 44px tap targets */
.app-bar-actions {
  position: relative;
}
.header-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1200;
  min-width: 220px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-primary, #FFFFFF);
  border: 1px solid rgba(60, 60, 67, 0.18);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.header-more-menu.hidden {
  display: none !important;
}
.header-more-menu .header-menu-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 10px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text-primary, #000000) !important;
  font-size: 15px !important;
  font-weight: 500;
  text-align: left;
  justify-content: flex-start;
  cursor: pointer;
}
.header-more-menu .header-menu-item.hidden {
  display: none !important;
}
.header-more-menu .header-menu-item:hover,
.header-more-menu .header-menu-item:focus-visible {
  background: rgba(118, 118, 128, 0.12) !important;
  outline: none;
}
.header-more-menu .header-menu-item svg {
  flex-shrink: 0;
}
.header-more-menu .campus-weather-pill .weather-pill-loc {
  display: inline !important;
}
.is-standalone-app .header-more-menu #btn-install-app {
  display: none !important;
}
[data-theme="dark"] .header-more-menu {
  background: #1C1C1E;
  border-color: rgba(84, 84, 88, 0.6);
}

/* Tap targets: at least 44px (Apple HIG 44pt; close to Android's 48dp) without changing the look */
.app-bar-actions .icon-btn,
.app-bar-actions .user-chip {
  min-width: 44px !important;
  min-height: 44px !important;
  justify-content: center;
}
.tabs-bar .tab-btn {
  min-height: 44px !important;
}
/* Chips keep their 36px pill look; an invisible 4px band above and below makes the hit area 44px */
.inbox-cat-chip,
.btn-quick-group-pill,
.btn-quick-chat-pill,
.btn-quick-starred-pill,
.filter-chips .chip {
  position: relative;
  min-height: 36px !important;
}
.inbox-cat-chip::after,
.btn-quick-group-pill::after,
.btn-quick-chat-pill::after,
.btn-quick-starred-pill::after,
.filter-chips .chip::after {
  content: '';
  position: absolute;
  inset: -4px 0;
}
/* The emergency button should be the easiest thing on screen to hit */
#fab-sos {
  min-height: 48px !important;
}

/* ==========================================================================
   WIDE SCREENS (laptops, desktops, landscape tablets): chat list and open chat side by side
   ========================================================================== */
.desktop-chat-placeholder {
  display: none;
}

@media (min-width: 900px) {
  html body #app-viewport.screen {
    width: 100% !important;
    max-width: 1440px !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Left pane: the chat list never slides or dims */
  html body #app-viewport #main-screen {
    right: auto !important;
    width: 380px !important;
    max-width: 380px !important;
    border-right: 1px solid rgba(60, 60, 67, 0.18) !important;
    transform: none !important;
    filter: none !important;
    pointer-events: auto !important;
  }

  /* Right pane: the open chat */
  html body #app-viewport #chat-screen {
    left: 380px !important;
    right: 0 !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
    box-shadow: none !important;
    transition: none !important;
  }

  .desktop-chat-placeholder {
    display: flex;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 380px;
    right: 0;
    z-index: 5;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    background: #F7F7F9;
    color: #6E6E73;
  }
  .desktop-chat-placeholder-inner {
    max-width: 360px;
  }
  .desktop-chat-placeholder-icon {
    font-size: 48px;
    margin-bottom: 12px;
  }
  .desktop-chat-placeholder h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: var(--text-primary, #000000);
  }
  .desktop-chat-placeholder p {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.45;
  }
  .desktop-chat-placeholder kbd {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid rgba(60, 60, 67, 0.3);
    border-radius: 5px;
    font-family: inherit;
    font-size: 12px;
    background: #FFFFFF;
  }
  [data-theme="dark"] .desktop-chat-placeholder {
    background: #000000;
    color: #98989D;
  }
  [data-theme="dark"] .desktop-chat-placeholder kbd {
    background: #1C1C1E;
    border-color: rgba(84, 84, 88, 0.6);
  }

  /* The open chat in the list */
  #chats-list .chat-item.is-active {
    background-color: rgba(0, 122, 255, 0.1);
  }
  [data-theme="dark"] #chats-list .chat-item.is-active {
    background-color: rgba(10, 132, 255, 0.22);
  }

  /* Hover feedback for mouse users */
  #chats-list .chat-item:hover:not(.is-active) {
    background-color: rgba(118, 118, 128, 0.08);
  }

  /* Comfortable reading width for message bubbles in a wide pane */
  #chat-screen .message-bubble,
  #chat-screen .msg-bubble {
    max-width: min(560px, 70%);
  }

  /* Drop zone shown while dragging files over the chat */
  #chat-screen.drag-over::after {
    content: 'Drop files to send';
    position: absolute;
    inset: 12px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--ios-blue, #007AFF);
    border-radius: 16px;
    background: rgba(0, 122, 255, 0.08);
    color: var(--ios-blue, #007AFF);
    font-size: 18px;
    font-weight: 600;
    pointer-events: none;
  }
}

@media (min-width: 1440px) {
  html body #app-viewport.screen {
    height: 94vh !important;
    max-height: 1000px !important;
    border-radius: 20px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.14) !important;
  }
}

/* iPhone "Add to Home Screen" card: sits above the bottom buttons, dismissible */
.ios-install-card {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  padding: 14px 40px 12px 16px;
  border-radius: 16px;
  background: #FFFFFF;
  border: 1px solid rgba(60, 60, 67, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary, #000000);
}
.ios-install-card p {
  margin: 4px 0 6px;
  color: #6E6E73;
}
.ios-install-card ol {
  margin: 0;
  padding-left: 20px;
}
.ios-install-card li {
  margin: 3px 0;
}
.ios-share-icon {
  display: inline-flex;
  vertical-align: -3px;
  color: var(--ios-blue, #007AFF);
}
.ios-install-close {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #8E8E93;
  font-size: 16px;
  cursor: pointer;
}
[data-theme="dark"] .ios-install-card {
  background: #1C1C1E;
  border-color: rgba(84, 84, 88, 0.6);
}
@media (min-width: 900px) {
  .ios-install-card {
    right: auto;
    width: 356px;
  }
}
@media (max-width: 899px) {
  /* Never cover an open chat on phones */
  #app-viewport:has(#chat-screen.open) .ios-install-card {
    display: none !important;
  }
}

/* ==========================================================================
   ACCESSIBILITY (WCAG 2.1 AA): visible focus, readable contrast, reduced motion
   ========================================================================== */
:focus-visible {
  outline: 3px solid #0062CC !important;
  outline-offset: 2px !important;
}
#chats-list .chat-item:focus-visible {
  outline-offset: -3px !important;
}

/* Light theme text that fell below 4.5:1 on white */
:root:not([data-theme="dark"]) .item-time,
:root:not([data-theme="dark"]) .item-snippet,
:root:not([data-theme="dark"]) .tick-icon:not(.read),
:root:not([data-theme="dark"]) .chips-empty-hint,
:root:not([data-theme="dark"]) .form-hint {
  color: #6E6E73;
}
:root:not([data-theme="dark"]) #connection-status.online {
  color: #1E7A34;
}
:root:not([data-theme="dark"]) .inbox-cat-chip.active,
:root:not([data-theme="dark"]) .filter-chips .chip.active {
  background-color: #0062CC !important;
  color: #FFFFFF !important;
}
:root:not([data-theme="dark"]) #fab-sos {
  background: #C9001A !important;
}

/* Students who turn off motion in their phone settings get instant transitions */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
:root:not([data-theme="dark"]) .tabs-bar .tab-btn:not(.active) {
  color: #6E6E73;
}
/* Notification permission banner buttons: first thing new students tap */
#btn-allow-notifications-banner,
#btn-dismiss-notifications-banner {
  min-height: 44px !important;
  min-width: 44px !important;
}

/* Third pane (1280px+): contact and group details dock beside the open chat instead of covering it */
@media (min-width: 1280px) {
  .modal-backdrop.is-docked,
  .modal-backdrop.is-docked.active {
    inset: auto !important;
    top: var(--dock-top, 0px) !important;
    right: var(--dock-right, 0px) !important;
    width: 360px !important;
    height: var(--dock-height, 100dvh) !important;
    padding: 0 !important;
    align-items: stretch !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 900 !important;
  }
  .modal-backdrop.is-docked .modal-card {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    border-radius: 0 !important;
    border-left: 1px solid rgba(60, 60, 67, 0.18);
    box-shadow: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .modal-backdrop.is-docked .ios-sheet-handle {
    display: none;
  }
  .modal-backdrop.is-docked .profile-modal-body,
  .modal-backdrop.is-docked .group-info-body {
    flex: 1;
    min-height: 0;
  }
  body.details-docked #app-viewport #chat-screen {
    right: 360px !important;
  }
}
@media (min-width: 1440px) {
  .modal-backdrop.is-docked .modal-card {
    border-radius: 0 20px 20px 0 !important;
  }
}

/* Dark mode: surfaces that stayed white (chat rows were white text on white) */
[data-theme="dark"] .tabs-container,
[data-theme="dark"] .list-item {
  background-color: #000000;
}
[data-theme="dark"] .btn-quick-chat-pill,
[data-theme="dark"] .smart-reply-chip {
  background: #1C1C1E;
  border-color: rgba(84, 84, 88, 0.6);
}
[data-theme="dark"] .btn-quick-chat-pill {
  color: #FFFFFF;
}
[data-theme="dark"] .smart-reply-chip {
  color: #409CFF;
}
[data-theme="dark"] .btn-quick-group-pill {
  background: rgba(48, 209, 88, 0.16);
  color: #30D158;
  border-color: rgba(48, 209, 88, 0.35);
}
[data-theme="dark"] .smart-replies-bar {
  background: rgba(28, 28, 30, 0.95);
  border-top-color: rgba(84, 84, 88, 0.6);
}
[data-theme="dark"] .media-count-pill {
  background: #3A3A3C;
  color: #FFFFFF;
}
[data-theme="dark"] .chat-header-info h3 {
  color: #FFFFFF;
}

/* ==========================================================================
   COLLECTION NOTICE (sign-in) & YOUR DATA (settings)
   ========================================================================== */
.collection-notice {
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background-color: var(--ios-system-bg);
  color: var(--text-primary);
  font-size: 12.5px;
  line-height: 1.45;
}

.collection-notice ul {
  margin: 8px 0 10px;
  padding-left: 18px;
}

.collection-notice li {
  margin-bottom: 4px;
}

.collection-notice-ack {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}

.collection-notice-ack input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.your-data-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
}

.btn-secondary-data {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--ios-blue);
  background: transparent;
  color: var(--ios-blue);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.delete-account-panel summary {
  color: var(--ios-red);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 0;
}

.delete-account-panel p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 6px 0 10px;
}

.delete-account-panel label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
}

.delete-account-panel input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid var(--ios-secondary-bg);
  background: var(--ios-bg);
  color: var(--text-primary);
  font-size: 15px;
}

/* ==========================================================================
   SIGN-IN SCREEN LAYOUT
   Centering a scrollable flex column with justify-content: center pushed the top of
   the form above the scroll area: the logo, title and Log In / Sign Up switch could
   not be reached on phones or desktops. Start at the top and let margin: auto centre
   the card only when there is room.
   ========================================================================== */
#auth-screen {
  justify-content: flex-start;
}

#auth-screen .auth-card {
  margin: auto;
  flex-shrink: 0;
}

.collection-notice {
  font-size: 12px;
}

/* Phones: the screen is the card, so drop the inner frame and give the form the width */
@media (max-width: 767px) {
  #auth-screen {
    padding-left: max(8px, env(safe-area-inset-left, 8px)) !important;
    padding-right: max(8px, env(safe-area-inset-right, 8px)) !important;
    background: #FFFFFF;
  }

  #auth-screen .auth-card {
    max-width: 100%;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 12px 12px 24px;
  }
}

/* Desktops: a wide two-column page (brand on the left, form on the right) instead of a phone frame */
@media (min-width: 960px) {
  #auth-screen.screen {
    max-width: 1040px;
    padding: 32px !important;
  }

  #auth-screen .auth-card {
    max-width: 960px;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    column-gap: 48px;
    align-items: start;
    padding: 40px 44px;
  }

  #auth-screen .auth-header {
    grid-column: 1;
    grid-row: 1 / span 3;
    position: sticky;
    top: 0;
    text-align: left;
    margin-bottom: 0;
    padding: 24px 0;
  }

  #auth-screen .auth-header .logo-circle {
    margin: 0 0 18px;
  }

  #auth-screen .auth-header h1 {
    font-size: 34px;
  }

  #auth-screen .campus-badge-row,
  #auth-screen .auth-share-qr-row {
    justify-content: flex-start;
  }

  #auth-screen .auth-mode-segmented,
  #auth-screen .auth-form {
    grid-column: 2;
  }

  /* The screen is already the frame; a second card border inside it looked boxed-in */
  #auth-screen .auth-card {
    border: none;
    box-shadow: none;
    background: transparent;
  }

  #auth-screen .auth-desktop-points {
    display: block;
  }
}

/* The sign-in screen is always light (like its #000 heading), so these use fixed colours, not theme vars */
.auth-desktop-points {
  display: none;
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #6E6E73;
}

.auth-desktop-points li {
  padding: 10px 0 10px 14px;
  border-left: 3px solid var(--ios-blue);
  margin-bottom: 12px;
}

.auth-desktop-points strong {
  color: #000000;
}

/* ========================================================
   Photo to PDF Document & Homework Scanner Styles
   ======================================================== */
.photopdf-dropzone {
  border: 2px dashed #007AFF;
  border-radius: 14px;
  background: rgba(0, 122, 255, 0.04);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.photopdf-dropzone:hover,
.photopdf-dropzone.dragover {
  background: rgba(0, 122, 255, 0.1);
  border-color: #0056B3;
  transform: scale(1.005);
}
.photopdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  padding: 4px;
  background: #E5E5EA;
  border-radius: 12px;
}
.photopdf-card {
  position: relative;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.photopdf-thumb-wrap {
  width: 100%;
  height: 95px;
  border-radius: 6px;
  overflow: hidden;
  background: #F2F2F7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photopdf-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.photopdf-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}
.photopdf-card-tools {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 6px;
  gap: 4px;
}
.photopdf-mini-btn {
  flex: 1;
  background: #F2F2F7;
  border: none;
  border-radius: 6px;
  padding: 4px 2px;
  font-size: 11px;
  cursor: pointer;
  color: #1C1C1E;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.photopdf-mini-btn:hover {
  background: #D1D1D6;
}
.photopdf-mini-btn.btn-del {
  color: #FF3B30;
}
.photopdf-mini-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
