:root {
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-light: #38bdf8;
  --primary-hover: #0284c7;
  --primary-gradient: linear-gradient(135deg, #0284c7 0%, #0ea5e9 50%, #38bdf8 100%);
  --nav-gradient: linear-gradient(135deg, #0369a1 0%, #0284c7 50%, #0ea5e9 100%);
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-faint: #94a3b8;
  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #38bdf8;
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px -1px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 16px 36px -6px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  --shadow-xl: 0 24px 50px -12px rgba(15, 23, 42, 0.14);
  --shadow-glow: 0 8px 28px -4px rgba(2, 132, 199, 0.25);
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(105px + env(safe-area-inset-bottom, 0px));
  line-height: 1.5;
  position: relative;
  background-image: 
    radial-gradient(at 15% 15%, rgba(56, 189, 248, 0.05) 0px, transparent 50%),
    radial-gradient(at 85% 85%, rgba(2, 132, 199, 0.04) 0px, transparent 50%);
}
@media (min-width: 768px) {
  body {
    padding-bottom: 40px;
  }
}
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-gradient);
  min-height: 72px;
  padding: 10px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 30px -4px rgba(2, 132, 199, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform var(--transition-fast), filter var(--transition-fast);
}
.logo:hover {
  transform: scale(1.02);
}
.logo img {
  display: block;
  width: 150px;
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(2, 6, 23, 0.25));
}
.desktop-nav {
  display: none;
  gap: 20px;
  align-items: center;
}
@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
  }
}
.nav-group {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  padding: 5px 10px;
  gap: 10px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2), 0 4px 14px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.88);
  font-size: 19px;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}
.nav-item.active {
  color: var(--primary);
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(0);
}
.nav-item:hover i {
  transform: scale(1.12);
}
.nav-item i {
  transition: transform var(--transition-fast);
}
.nav-unread-badge,
.nav-requests-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  line-height: 1;
  pointer-events: none;
  z-index: 20;
}
.camera-btn-desktop {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #ffffff;
  color: var(--primary-dark);
  padding: 9px 20px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.1px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 16px rgba(2, 6, 23, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: all var(--transition-fast);
  cursor: pointer;
}
.camera-btn-desktop i {
  font-size: 17px;
  color: #0ea5e9;
  transition: transform var(--transition-fast);
}
.camera-btn-desktop:hover {
  background: #f0f9ff;
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(2, 6, 23, 0.16);
}
.camera-btn-desktop:hover i {
  transform: scale(1.12) rotate(-6deg);
}
.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px 4px 5px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-full);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  user-select: none;
  color: #ffffff;
  font-family: var(--font-display);
  transition: all var(--transition-fast);
}
.user-profile-badge:hover,
.user-profile-badge[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.profile-chevron {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  margin-right: 4px;
  transition: transform 0.2s ease;
}
.user-profile-badge[aria-expanded="true"] .profile-chevron {
  transform: rotate(180deg);
}
.profile-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.profile-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-initial {
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
}
.profile-name {
  color: inherit;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.mobile-profile-wrap {
  display: flex;
  align-items: center;
}
.mobile-profile-circle {
  width: 38px;
  height: 38px;
  border: 2px solid #ffffff;
  padding: 0;
  cursor: pointer;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
}
@media (min-width: 768px) {
  .mobile-profile-wrap {
    display: none !important;
  }
}
.profile-dropdown-menu {
  position: absolute;
  top: calc(100% - 10px);
  right: 20px;
  min-width: 250px;
  max-width: 320px;
  width: max-content;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 16px 40px -4px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
  padding: 8px;
  z-index: 1000;
  animation: dropdown-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: top right;
  color: var(--text-main);
}
@media (max-width: 767px) {
  .profile-dropdown-menu {
    top: calc(100% - 6px);
    right: 14px;
  }
}
.profile-dropdown-menu[hidden] {
  display: none !important;
}
@keyframes dropdown-pop {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(-8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}
.dropdown-user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dropdown-user-details .profile-name {
  color: var(--text-main);
  font-size: 15px;
  font-weight: 700;
  white-space: normal;
  word-break: break-word;
}
.dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 0 6px;
}
.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: #334155;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  text-decoration: none;
}
.dropdown-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: #0ea5e9;
  transition: transform var(--transition-fast);
}
.dropdown-item:hover {
  background: #f0f9ff;
  color: var(--primary);
}
.dropdown-item:hover i {
  transform: scale(1.15);
}
.dropdown-item.item-danger {
  color: #e11d48;
}
.dropdown-item.item-danger i {
  color: #f43f5e;
}
.dropdown-item.item-danger:hover {
  background: #ffe4e6;
  color: #be123c;
}
.dropdown-item.item-admin {
  color: #0f172a;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  margin-bottom: 4px;
}
.dropdown-item.item-admin i {
  color: var(--primary);
}
.dropdown-item.item-admin:hover {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: var(--primary-dark);
}
.admin-pill-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--primary);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}
.container {
  max-width: 760px;
  margin: 28px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
@media (max-width: 640px) {
  .container {
    padding: 0 16px;
    margin: 16px auto;
    gap: 16px;
  }
}
@media (max-width: 360px) {
  .container {
    padding: 0 10px;
    margin: 12px auto;
  }
  .card {
    padding: 16px 12px;
    border-radius: var(--radius-lg);
  }
}
.dashboard-hero {
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  border: 1px solid rgba(186, 230, 253, 0.7);
  border-radius: var(--radius-xl);
  padding: 22px 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-greeting-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.greeting-time {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--primary);
}
.hero-user-name {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
}
.hero-tagline {
  color: var(--text-subtle);
  font-size: 13.5px;
  font-weight: 500;
  max-width: 500px;
  line-height: 1.45;
}
.hero-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
}
.status-pill {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulse-green 1.6s infinite;
}
@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 520px) {
  .quick-actions-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
.quick-action-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 15px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}
.quick-action-card:hover {
  transform: translateY(-3px);
  border-color: #7dd3fc;
  box-shadow: 0 8px 22px -4px rgba(2, 132, 199, 0.14), var(--shadow-sm);
}
.qa-icon-box {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 19px;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}
.qa-translate {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
}
.qa-chat {
  background: linear-gradient(135deg, #4f46e5 0%, #818cf8 100%);
}
.qa-dictionary {
  background: linear-gradient(135deg, #059669 0%, #34d399 100%);
}
.qa-community {
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
}
.qa-info {
  flex: 1;
  min-width: 0;
}
.qa-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.2px;
}
.qa-desc {
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: 2px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qa-arrow {
  color: var(--border-medium);
  font-size: 12px;
  transition: transform var(--transition-fast), color var(--transition-fast);
}
.quick-action-card:hover .qa-arrow {
  transform: translateX(4px);
  color: var(--primary);
}
.dashboard-main-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}
.dashboard-col-sotd,
.dashboard-col-chats {
  width: 100%;
}
.card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
  display: flex;
  flex-direction: column;
}
.sotd-card {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  border: 1px solid #e2e8f0;
  border-top: 4px solid var(--primary);
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.sotd-card:hover {
  transform: translateY(-3px);
  border-color: #7dd3fc;
  box-shadow: 0 10px 28px -6px rgba(2, 132, 199, 0.16), var(--shadow-md);
}
.sotd-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.sotd-header {
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  margin: 0;
}
.sotd-action-hint {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform var(--transition-fast);
}
.sotd-card:hover .sotd-action-hint {
  transform: translateX(3px);
}
.sotd-content {
  display: grid;
  /* The clips are 9:16 portrait, so the media track is a bounded fraction of
     the card rather than a fixed pixel size. It scales down with the card and
     can never blow up past the clamp ceiling on wide viewports. A square well
     is tall enough to read the signer without leaving the card lopsided. */
  grid-template-columns: minmax(0, 1fr) clamp(150px, 30%, 220px);
  align-items: center;
  gap: 24px;
  flex: 1;
}
@media (max-width: 640px) {
  .sotd-content {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .sotd-image {
    width: 100% !important;
    max-width: 190px !important;
    /* Stacked layout: just cap the width. The square aspect-ratio comes from
       the base .sotd-image rule, so it is deliberately not repeated here. */
    height: auto !important;
    margin: 0 auto;
  }
}
.sotd-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
/* Fills what used to be dead space beside the media, and gives the card
   something useful to read. Clamped so one long definition can never stretch
   the card or push the media out of alignment. */
.sotd-definitions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}
.sotd-definition {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sotd-definition-filipino {
  color: #64748b;
  font-style: italic;
}
.sotd-definitions:empty,
.sotd-definitions.is-hidden {
  display: none;
}
.sotd-terms-row {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
}
.sotd-term-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.term-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.sotd-text h2 {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
  line-height: 1.25;
}
#dailyFilipino {
  color: var(--primary);
}
.sotd-text p {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  background: #f0f9ff;
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 2px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #bae6fd;
  width: fit-content;
  transition: all var(--transition-fast);
}
.sotd-card:hover .sotd-text p {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateX(3px);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}
.sotd-text p i {
  font-size: 11.5px;
  transition: transform var(--transition-fast);
}
.sotd-card:hover .sotd-text p i {
  transform: translateX(3px);
}
.sotd-image {
  position: relative;
  /* Slightly wider than the 9:16 clips, so a little of the empty space above
     the signer is trimmed. object-position: bottom on the child means that
     trimmed space comes off the TOP only, keeping the head, body and hands.
     Measured headroom across the clips is ~11% (median), so 12.5% is about the
     most that can be removed uniformly without clipping the top of the head. */
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 9 / 14;
  background: radial-gradient(circle at 50% 30%, #1e293b 0%, #07111f 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 10px 28px -6px rgba(2, 132, 199, 0.25), 0 4px 12px rgba(11, 19, 41, 0.2);
  flex-shrink: 0;
  padding: 0;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}
.sotd-image::before {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: blur(24px);
  z-index: 0;
}
.sotd-card:hover .sotd-image {
  transform: translateY(-2px) scale(1.015);
  border-color: #38bdf8;
  box-shadow: 0 14px 34px -6px rgba(2, 132, 199, 0.35), 0 6px 18px rgba(11, 19, 41, 0.25);
}
.sotd-image img,
.sotd-image video {
  display: block;
  width: 100%;
  height: 100%;
  /* cover, not contain: the well is already close to the clip's own ratio, so
     cover fills it exactly with no bars. bottom-anchored so the only thing cut
     is the dead space above the signer, never their hands. */
  object-fit: cover;
  object-position: center bottom;
  border-radius: calc(var(--radius-lg) - 6px);
  background: transparent;
  opacity: 0;
  transition: opacity 0.3s ease;
  position: relative;
  z-index: 1;
}
.sotd-image.is-loaded img,
.sotd-image.is-loaded video {
  opacity: 1;
}
/* Shown when no source can be decoded, so a broken clip reads as a missing
   clip instead of an unexplained empty box. */
.sotd-media-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 44px;
  font-weight: 800;
  color: #64748b;
  background: #e2e8f0;
}
.sotd-media-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #38bdf8;
  background: rgba(7, 17, 31, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.sotd-media-pill i {
  font-size: 8.5px;
  color: #38bdf8;
}
.chats-card {
  height: auto;
}
.chats-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.chats-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chats-header-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #f0f9ff;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 14px;
}
.chats-header {
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  margin: 0;
}
.btn-view-all {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  transition: all var(--transition-fast);
}
.btn-view-all:hover {
  background: #e0f2fe;
  color: var(--primary-dark);
  transform: translateX(2px);
}
.home-chat-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  color: inherit;
  text-decoration: none;
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}
.chat-item:hover {
  background: #f8fafc;
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.chat-item.is-unread {
  border: 1.5px solid #38bdf8 !important;
  border-left: 4px solid var(--primary) !important;
  background: linear-gradient(90deg, #f0f9ff 0%, #ffffff 100%) !important;
  box-shadow: 0 4px 14px -2px rgba(2, 132, 199, 0.15) !important;
}
.chat-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.2);
  border: 2px solid #ffffff;
}
.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-info {
  flex: 1;
  min-width: 0;
}
.chat-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text-main);
  letter-spacing: -0.2px;
}
.chat-preview {
  color: var(--text-subtle);
  font-size: 13px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-time {
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  margin-left: auto;
  align-self: center;
  text-align: right;
}
.chat-item.is-unread .chat-time {
  color: var(--primary);
  font-weight: 700;
}
.unread-dot {
  width: 9px;
  height: 9px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
  flex-shrink: 0;
  display: none;
}
.chat-item.is-unread .unread-dot {
  display: inline-block !important;
}
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  background: var(--primary);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.chat-empty {
  color: var(--text-subtle);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  padding: 36px 20px;
  background: #f8fafc;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-subtle);
  margin-top: 10px;
}
.chat-empty[hidden],
[hidden] {
  display: none !important;
}
.loading-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  color: var(--text-faint);
}
.loading-state::before {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(2, 132, 199, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  content: '';
  box-sizing: border-box;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.chat-empty.loading-state {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}
.chat-empty.loading-state::after {
  content: 'Loading conversations...';
}
.media-loading {
  position: relative;
}
.media-loading::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  margin-left: -16px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  content: '';
  box-sizing: border-box;
  animation: spin 0.8s linear infinite;
  pointer-events: none;
  z-index: 2;
}
.media-loading.is-loaded::after {
  display: none !important;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.bottom-nav {
  position: fixed;
  z-index: 100;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 16px;
  right: 16px;
  max-width: 440px;
  margin: 0 auto;
  height: 64px;
  padding: 6px 14px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(2, 132, 199, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-full);
  box-shadow: 0 12px 36px -4px rgba(2, 132, 199, 0.4), 0 4px 12px rgba(0, 0, 0, 0.1);
  touch-action: manipulation;
  user-select: none;
}
@media (min-width: 768px) {
  .bottom-nav {
    display: none !important;
  }
}
@media (max-width: 480px) {
  .navbar {
    padding: 8px 16px;
    min-height: 62px;
  }
  .logo img {
    height: 30px;
    max-width: 130px;
  }
  .bottom-nav {
    left: 10px;
    right: 10px;
    height: 60px;
    padding: 4px 10px;
  }
  .bottom-nav > a {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  .profile-dropdown-menu {
    max-width: calc(100vw - 24px);
    right: 10px;
  }
}
@supports (padding-top: env(safe-area-inset-top)) {
  .navbar {
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
  }
}
.bottom-nav > a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
}
.bottom-nav > a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
}
.bottom-nav > a:not(.camera-btn).active {
  color: var(--primary);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}
.bottom-nav > a .nav-unread-badge,
.bottom-nav > a .nav-requests-badge {
  top: 0px;
  right: 0px;
  border-color: #0284c7;
}
.camera-btn {
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  flex: 0 0 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  border: 5px solid #ffffff;
  border-radius: 50%;
  transform: translateY(-16px);
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.45);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}
.camera-btn i {
  font-size: 32px;
  line-height: 1;
  color: #ffffff;
}
.camera-btn:hover {
  transform: translateY(-18px) scale(1.04);
}
.settings-modal-backdrop {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
}
.settings-modal {
  position: relative;
  width: min(100%, 430px);
  padding: 28px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  color: var(--text-main);
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modal-pop {
  0% { opacity: 0; transform: scale(0.94) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.settings-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: var(--text-subtle);
  background: #f1f5f9;
  cursor: pointer;
  font-size: 14px;
  display: grid;
  place-items: center;
  transition: all var(--transition-fast);
}
.settings-modal-close:hover {
  background: #e2e8f0;
  color: var(--text-main);
}
.settings-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
}
.settings-user-info h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}
.settings-body {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  margin: 6px 0 2px;
}
.settings-option,
.settings-btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
}
.settings-btn-row {
  cursor: pointer;
  transition: all var(--transition-fast);
}
.settings-btn-row:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.settings-option-text strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-main);
}
.settings-option-text span {
  font-size: 12px;
  color: var(--text-subtle);
}
.switch-label {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.switch-label input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.22s ease;
  border-radius: 24px;
}
.switch-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.22s ease;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
.switch-label input:checked + .switch-slider {
  background-color: var(--primary);
}
.switch-label input:checked + .switch-slider::before {
  transform: translateX(20px);
}
.settings-feedback {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  display: none;
}
.settings-feedback.is-success {
  display: block;
  background: #dcfce7;
  color: #15803d;
}
.settings-feedback.is-error {
  display: block;
  background: #fee2e2;
  color: #b91c1c;
}
.edit-profile-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding: 10px;
  background: #f1f5f9;
  border-radius: 12px;
}
.edit-profile-form input {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  outline: 0;
}
.edit-profile-form input:focus {
  border-color: var(--primary);
}
.edit-profile-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.btn-small {
  padding: 6px 14px;
  border: 0;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.btn-small-primary {
  background: var(--primary);
  color: white;
}
.btn-small-secondary {
  background: #e2e8f0;
  color: #475569;
}
.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.settings-btn {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 14px;
  background: var(--primary-gradient);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
  transition: opacity 0.2s ease;
}
.settings-btn:hover {
  opacity: 0.92;
}
.logout-modal-backdrop {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
}
.logout-modal {
  position: relative;
  width: min(100%, 380px);
  padding: 32px 28px 26px;
  border-radius: 24px;
  text-align: center;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.logout-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: var(--text-subtle);
  background: #f1f5f9;
  cursor: pointer;
}
.logout-modal-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 18px;
  color: #ef4444;
  background: #fef2f2;
  font-size: 22px;
}
.logout-modal h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}
.logout-modal p {
  margin: 8px 0 22px;
  color: var(--text-subtle);
  font-size: 14px;
}
.logout-modal-actions {
  display: flex;
  gap: 10px;
}
.logout-modal-button {
  flex: 1;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.logout-keep {
  color: var(--text-main);
  background: #f1f5f9;
}
.logout-keep:hover {
  background: #e2e8f0;
}
.logout-confirm {
  color: #ffffff;
  background: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.logout-confirm:hover {
  background: #dc2626;
}
.incoming-call-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: callModalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.incoming-call-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: #0f172a;
  border-radius: 28px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 34px 24px 28px;
  text-align: center;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85), 0 0 40px rgba(2, 132, 199, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: callCardPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.incoming-call-avatar-pulse {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.incoming-call-avatar {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border: 3px solid #38bdf8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.incoming-call-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.incoming-call-avatar .avatar-initial {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
}
.incoming-ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #38bdf8;
  animation: callRipplePulse 1.8s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}
.incoming-ripple.r2 {
  animation-delay: 0.6s;
}
@keyframes callRipplePulse {
  0% { transform: scale(0.7); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}
@keyframes callModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes callCardPop {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.incoming-call-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.incoming-call-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: rgba(2, 132, 199, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 12px;
  font-weight: 700;
}
.incoming-caller-name {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
}
.incoming-call-subtitle {
  margin: 0;
  font-size: 13.5px;
  color: #94a3b8;
  font-weight: 500;
}
.incoming-call-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  width: 100%;
  margin-top: 8px;
}
.incoming-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
}
.incoming-action-btn i {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: transform var(--transition-fast);
}
.incoming-action-btn.decline i {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.45);
}
.incoming-action-btn.accept i {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.45);
  animation: acceptBtnPulse 1.4s infinite;
}
@keyframes acceptBtnPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.incoming-action-btn:hover i {
  transform: scale(1.1);
}
@keyframes modalBackdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
