/* ========================================
   Global Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f5f5f7;
    color: #1d1d1f;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ========================================
   Top Navigation (Apple-style)
   ======================================== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(245,245,247,0.88);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(0,0,0,0.04);
    z-index: 100;
}

.top-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left {
    flex: 1;
    display: flex;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #1d1d1f;
}

.brand-mark {
    width: 24px;
    height: 24px;
    border-radius: 9px;
    background: radial-gradient(circle at 20% 20%, #f5a623, #f53794 60%, #4a90e2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
}

.brand-text {
    font-weight: 600;
    font-size: 18px;
}

.nav-center {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
}

.nav-link {
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: #86868b;
    padding: 6px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: #1d1d1f;
    background: rgba(0,0,0,0.05);
}

.nav-link.active {
    color: #1d1d1f;
    background: rgba(0,0,0,0.08);
}

.search-form {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.search-form input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border-radius: 10px;
    border: 1px solid #d2d2d7;
    background: #f5f5f7;
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-form input:focus {
    background: #fff;
    border-color: #0066cc;
    box-shadow: 0 0 0 4px rgba(0,102,204,0.1);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
}

.nav-logout {
    border: none;
    background: transparent;
    color: #86868b;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-logout:hover {
    color: #1d1d1f;
    background: rgba(0,0,0,0.05);
}

.nav-cta {
    padding-inline: 14px;
}

/* Family Switcher Dropdown */
.family-switcher {
    position: relative;
    display: inline-block;
    margin-right: 20px;
}

.switcher-btn {
    background: #f5f5f7;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    cursor: pointer;
    display: flex;
    align-items: center;
    white-space: nowrap;
    gap: 6px;
}

.switcher-btn:hover {
    background: #e8e8ed;
}

.switcher-btn .chevron {
    font-size: 10px;
    color: #86868b;
}

.switcher-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    min-width: 200px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
    z-index: 1000;
    padding: 6px;
    padding-top: 14px;
}

.switcher-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
    background: transparent;
}

.family-switcher:hover .switcher-dropdown,
.switcher-dropdown.show {
    display: block;
}

.switcher-item {
    display: block;
    padding: 10px 12px;
    color: #1d1d1f;
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
}

.switcher-item:hover {
    background: #0066cc;
    color: white;
}

.switcher-item.active {
    font-weight: 700;
    color: #0066cc;
}

.switcher-item.active:hover {
    color: white;
}

.switcher-divider {
    height: 1px;
    background: rgba(0,0,0,0.05);
    margin: 6px 0;
}

.create-new {
    color: #0066cc;
    font-weight: 500;
}

/* ========================================
   Main Content Area
   ======================================== */
main {
    padding-top: 130px; /* room for fixed nav with larger logo */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ========================================
   Hero Section (Landing Page)
   ======================================== */
.hero-wrapper {
    max-width: 980px;
    margin: 80px auto 60px;
    padding: 56px 64px;
    background: #ffffff;
    border-radius: 32px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.08);
}

.hero-title {
    font-size: 44px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
    text-align: center;
}

.hero-subtitle {
    font-size: 18px;
    font-weight: 400;
    color: #6e6e73;
    text-align: center;
    max-width: 520px;
    margin: 0 auto 28px;
}

.cta-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 2rem;
}

/* ========================================
   Feature Cards
   ======================================== */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 600px;
  margin: 0 auto;
}

.feature-card {
  padding: 32px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.feature-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.feature-card h3 {
  font-size: 22px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 12px;
  line-height: 1.2;
}

.feature-card p {
  font-size: 15px;
  line-height: 1.6;
  color: #6e6e73;
  margin: 0;
}

/* ========================================
   Buttons (Apple-style)
   ======================================== */
.btn {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 999px;
    border: none;
    background: #0071e3;
    color: white;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 8px 20px rgba(0, 113, 227, 0.25);
}

.btn-primary:hover {
    background: #0466cf;
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(0, 113, 227, 0.35);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.12);
    padding: 7px 18px;
    font-size: 14px;
    text-decoration: none;
    color: #1d1d1f;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(12px);
    transition: background 0.15s ease;
}

.btn-ghost:hover {
    background: #ffffff;
}

.btn-ghost.btn-danger {
    color: #d70015;
    border-color: rgba(215, 0, 21, 0.2);
}

.btn-ghost.btn-danger:hover {
    background: rgba(215, 0, 21, 0.06);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #d70015;
    color: white;
    border: none;
    border-radius: 980px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #b5000f;
}

.btn-secondary {
    background: white;
    color: #0071e3;
    border: 2px solid #0071e3;
}

.btn-secondary:hover {
    background: rgba(0, 113, 227, 0.05);
}

/* ========================================
   Timeline / Memories Grid
   ======================================== */
.timeline-grid {
    max-width: 1120px;
    margin: 40px auto 60px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.memory-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.memory-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.16);
}

.memory-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.memory-info {
    padding: 14px 16px 16px;
}

.memory-info h3 {
    font-size: 16px;
    margin: 0 0 4px;
}

.memory-info .date {
    font-size: 13px;
    color: #6e6e73;
    margin-bottom: 6px;
}

.memory-info .desc {
    font-size: 13px;
    color: #6e6e73;
}

/* ========================================
   Forms
   ======================================== */
.form-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.onboarding-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 24px;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    color: #1d1d1f;
}

.onboarding-card:hover {
    border-color: #0071e3;
    background: #f5f5f7;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

.onboarding-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.auth-card {
    max-width: 400px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0071e3;
}

input[type="file"] {
    margin: 8px 0 16px;
}

.help-text {
    font-size: 0.875rem;
    color: #888;
    margin-top: 0.5rem;
}

.ai-badge {
    color: #0071e3;
    font-weight: 500;
}

/* ========================================
   Flash Messages
   ======================================== */
.flash-message {
    background: #fff3cd;
    color: #856404;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #ffc107;
}

/* ========================================
   File Display
   ======================================== */
.file-preview,
.file-list {
    margin: 1rem 0;
}

.file-item {
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.file-type {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 0.5rem;
}

.file-type.photo { background: #e3f2fd; color: #1976d2; }
.file-type.audio_story { background: #fff3e0; color: #e65100; }
.file-type.document { background: #e8f5e9; color: #388e3c; }

.uploaded-files {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.uploaded-files h3 {
    margin-bottom: 0.75rem;
    color: #0071e3;
}

.uploaded-files ul {
    list-style: none;
}

/* ========================================
   Memory Detail Page
   ======================================== */
.memory-description {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
}

.memory-files h3 {
    margin-bottom: 1rem;
    color: #0071e3;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.file-card {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.file-preview-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.file-audio {
    padding: 1rem;
}

.file-audio audio {
    width: 100%;
}

.transcript {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e0e0e0;
}

.transcript h4 {
    font-size: 0.8rem;
    color: #0071e3;
    margin-bottom: 0.5rem;
}

.transcript p {
    font-size: 0.875rem;
    color: #555;
    line-height: 1.5;
}

.file-document {
    padding: 1rem;
}

.file-document a {
    color: #0071e3;
    text-decoration: none;
    word-break: break-word;
}

.file-name {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: #666;
    background: white;
    text-align: center;
}

/* Memory Files Grid */
.memory-files-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.memory-file-card {
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f5;
    width: 100%;
    max-width: 640px;
    margin-bottom: 20px;
}

/* Video frame container */
.video-frame {
    position: relative;
    width: 100%;
    background: #000;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-frame-player {
    width: 100%;
    height: auto;
    max-height: 70vh;
    display: block;
    object-fit: contain;
}

.file-preview-container {
    width: 100%;
    background: #f5f5f7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-preview-container img.memory-photo {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    cursor: pointer;
}

.inline-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.file-footer {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.file-name-label {
    font-size: 13px;
    color: #1d1d1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.file-download-btn {
    color: #0066cc;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
    text-decoration: none;
}

.file-download-btn:hover {
    opacity: 0.7;
}

/* Audio specific styling */
.audio-container {
    flex-direction: column;
    gap: 10px;
}

.audio-icon {
    font-size: 40px;
}

.inline-audio-player {
    width: 90%;
}

/* Generic file container */
.generic-container {
    flex-direction: column;
}

.generic-container .file-icon {
    font-size: 48px;
}

.memory-meta {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    font-size: 0.875rem;
    color: #888;
}

/* ========================================
   Auth Links
   ======================================== */
.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.auth-link a {
    color: #0071e3;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: #0071e3;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* ========================================
   Memory Thumbnail Icons
   ======================================== */
.doc-icon,
.audio-icon,
.placeholder-icon {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
}

.doc-icon {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.audio-icon {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.placeholder-icon {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
}

/* ========================================
   Empty States
   ======================================== */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    max-width: 480px;
    margin: 0 auto;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.8;
}

.empty-state-title {
    font-size: 24px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 12px;
}

.empty-state-text {
    font-size: 15px;
    line-height: 1.6;
    color: #6e6e73;
    margin-bottom: 0;
}

.empty-state-small {
    padding: 32px 24px;
    background: #f5f5f7;
    border-radius: 12px;
    text-align: center;
}

/* ========================================
   Filter Tags
   ======================================== */
.filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #e8f4fd;
    color: #0071e3;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-tag:hover {
    background: #d0e8fa;
}

.filter-tag a {
    margin-left: 6px;
    color: inherit;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.filter-tag a:hover {
    opacity: 1;
}

/* ========================================
   Search Highlight
   ======================================== */
.search-highlight {
    background: #fff9e6;
    border-left: 3px solid #ffcc00;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* ========================================
   Input Focus States
   ======================================== */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

/* ========================================
   Zoomable Image Lightbox
   ======================================== */
.zoomable-image {
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

.zoomable-image:hover {
    opacity: 0.9;
}

/* ========================================
   Image Lightbox (Fullscreen Photo View)
   ======================================== */
.image-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.image-lightbox.is-open {
    display: flex;
}

.image-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
}

.image-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.7);
}

.image-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: rgba(255,255,255,0.85);
    color: #1d1d1f;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.image-lightbox-close:hover {
    background: #ffffff;
}

/* ========================================
   Time Capsule - Memories list
   ======================================== */
.capsule-memories-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.capsule-memory-row {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    margin: 0;
}

.capsule-memory-row:hover {
    background: #f5f5f7;
}

.capsule-memory-row input[type="checkbox"] {
    margin: 3px 0 0 0;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.capsule-memory-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    text-align: left;
}

.capsule-memory-title {
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    line-height: 1.3;
}

.capsule-memory-date {
    font-size: 12px;
    color: #6e6e73;
    line-height: 1.3;
}

/* ========================================
   Upload Zone
   ======================================== */
.upload-zone {
  border: 2px dashed #d2d2d7;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-zone:hover {
  border-color: #0071e3;
  background: #f5f5f7;
}

.upload-zone.drag-over {
  border-color: #0071e3;
  background: rgba(0, 113, 227, 0.05);
  transform: scale(1.02);
}

.upload-zone-content {
  pointer-events: none;
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.8;
}

/* File Preview List */
.file-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.file-preview-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.file-preview-item:hover {
  background: #f5f5f7;
}

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

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

.file-preview-name {
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-size {
  font-size: 12px;
  color: #6e6e73;
  margin-top: 2px;
}

.file-preview-remove {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  border: none;
  background: #f5f5f7;
  color: #6e6e73;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.file-preview-remove:hover {
  background: #ff3b30;
  color: white;
}

/* ========================================
   Navigation - Mobile Fix
   ======================================== */

/* Mobile menu toggle button */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.mobile-menu-toggle span {
  width: 24px;
  height: 2px;
  background: #1d1d1f;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* ========================================
   Search & Filter Bar
   ======================================== */
.search-filter-bar {
  background: #f5f5f7;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 32px;
}

.search-box input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.search-filter-bar select {
  padding: 10px 16px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-filter-bar select:hover {
  border-color: #0071e3;
}

.search-filter-bar select:focus {
  outline: none;
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

/* ========================================
   Mobile Responsiveness
   ======================================== */

/* Mobile breakpoint */
@media (max-width: 768px) {
  
  /* Hide nav search on mobile */
  .nav-search {
    display: none !important;
  }
  
  /* Main content padding for mobile - nav is relative, not fixed */
  main {
    padding-top: 24px !important;
  }
  
  /* Typography adjustments */
  h1 {
    font-size: 28px !important;
  }
  
  h2 {
    font-size: 20px !important;
  }
  
  /* Container padding */
  .container {
    padding: 0 16px !important;
    margin: 24px auto !important;
  }
  
  /* Top nav container */
  .top-nav {
    position: relative;
    display: flex;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center !important;
    padding: 16px !important;
    gap: 0 !important;
  }
  
  /* Brand stays on left */
  .nav-left {
    flex: 0 0 auto;
  }
  
  .nav-brand {
    font-size: 18px;
  }
  
  .brand-logo {
    height: 120px !important;
  }
  
  .brand-text {
    font-size: 20px !important;
  }
  
  /* Show hamburger menu */
  .mobile-menu-toggle {
    display: flex;
  }
  
  /* Hide nav links by default on mobile */
  .nav-right {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    flex-direction: column;
    padding: 8px 0;
    z-index: 1000;
    width: 100% !important;
  }
  
  /* Show menu when open */
  .nav-right.mobile-menu-open {
    display: flex !important;
  }
  
  /* Hide nav-center search on mobile */
  .nav-center {
    display: none !important;
  }
  
  /* Main navigation in mobile menu */
  .main-nav {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }
  
  /* Nav links in mobile menu */
  .nav-link {
    width: 100%;
    padding: 14px 16px !important;
    border-bottom: 1px solid #f5f5f7;
    text-align: left;
    display: block;
    font-size: 16px;
    white-space: normal;
  }
  
  .nav-link:last-child {
    border-bottom: none;
  }
  
  .nav-link:hover {
    background: #f5f5f7;
  }
  
  /* Family switcher on mobile */
  .family-switcher {
    width: 100%;
    padding: 8px 16px;
    border-bottom: 1px solid #e0e0e0;
  }
  
  .family-switcher .switcher-btn {
    width: 100%;
    text-align: left;
  }
  
  /* Logout button on mobile */
  .nav-logout {
    width: 100%;
    padding: 14px 16px !important;
    text-align: left;
    border-top: 1px solid #e0e0e0;
  }
  
  /* Hero section */
  .hero-wrapper {
    padding: 40px 16px !important;
  }
  
  .hero-title {
    font-size: 32px !important;
  }
  
  .hero-subtitle {
    font-size: 16px !important;
  }
  
  /* Feature cards - stack on mobile */
  .feature-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  .feature-card {
    padding: 24px;
  }
  
  .feature-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
  }
  
  .feature-card p {
    font-size: 14px;
  }
  
  /* Timeline grid - single column on mobile */
  .timeline-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  /* Memory cards */
  .memory-card {
    padding: 16px !important;
  }
  
  /* Form cards */
  .form-card {
    padding: 24px 16px !important;
    margin: 0 !important;
  }
  
  /* Buttons */
  .btn-primary,
  .btn-ghost {
    width: 100%;
    text-align: center;
    padding: 14px 20px;
    font-size: 16px;
  }
  
  /* Header with button - stack on mobile */
  .container > div[style*="display: flex"][style*="justify-content: space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
  }
  
  .container > div[style*="display: flex"][style*="justify-content: space-between"] .btn-primary {
    width: 100%;
  }
  
  /* Memory detail - file grid */
  .file-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  /* File items */
  .file-item {
    padding: 12px !important;
  }
  
  .file-item img {
    max-width: 100%;
    height: auto;
  }
  
  /* Capsule detail - actions */
  div[style*="flex-direction: column"][style*="align-items: flex-end"] {
    width: 100%;
    align-items: stretch !important;
  }
  
  div[style*="flex-direction: column"][style*="align-items: flex-end"] .btn-ghost {
    width: 100%;
  }
  
  /* Onboarding cards - stack on mobile */
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  /* Back links */
  .back-link {
    font-size: 14px !important;
    margin-bottom: 16px !important;
  }
  
  /* Empty states */
  .empty-state {
    padding: 60px 16px !important;
  }
  
  .empty-state-icon {
    font-size: 48px !important;
  }
  
  .empty-state-title {
    font-size: 20px !important;
  }
  
  /* Family settings - member list */
  div[style*="width: 40px; height: 40px"] {
    width: 36px !important;
    height: 36px !important;
  }
  
  /* Capsule memories list */
  .capsule-memories-list {
    font-size: 14px;
  }
  
  .capsule-memory-title {
    font-size: 13px !important;
  }
  
  /* Form inputs */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="datetime-local"],
  textarea {
    font-size: 16px !important;
  }
  
  /* Image lightbox */
  .lightbox-content {
    max-width: 95% !important;
    max-height: 90% !important;
  }
  
  /* Download buttons */
  .download-btn {
    font-size: 13px !important;
    padding: 8px 12px !important;
  }
  
  /* Upload zone */
  .upload-zone {
    padding: 32px 16px;
  }
  
  .upload-icon {
    font-size: 40px;
  }
  
  .file-preview-item {
    padding: 10px;
  }
  
  /* Touch-friendly targets */
  a, button, input[type="submit"] {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-height: 20px;
  }
  
  /* Search filter bar mobile */
  .search-filter-bar {
    padding: 16px;
  }
  
  .search-filter-bar > div[style*="display: flex"] {
    flex-direction: column;
  }
  
  .search-filter-bar select,
  .search-filter-bar button {
    width: 100%;
  }
}

/* Small mobile (iPhone SE, etc.) */
@media (max-width: 375px) {
  
  h1 {
    font-size: 24px !important;
  }
  
  .hero-title {
    font-size: 28px !important;
  }
  
  .btn-primary,
  .btn-ghost {
    font-size: 15px;
    padding: 12px 16px;
  }
  
  .empty-state-icon {
    font-size: 40px !important;
  }
  
  .form-card {
    padding: 20px 12px !important;
  }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1024px) {
  
  .timeline-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .feature-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ========================================
   Likes & Comments
   ======================================== */
.like-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.like-button:hover {
  transform: scale(1.05);
}

.comment-item {
  background: #f5f5f7;
  padding: 16px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.comment-item:hover {
  background: #ebebed;
}

textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px 16px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  transition: all 0.2s ease;
}

textarea:focus {
  outline: none;
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

@media (max-width: 768px) {
  .comment-item p {
    padding-left: 0 !important;
    margin-top: 12px;
  }
}

/* ========================================
   Timestamp Tooltips
   ======================================== */
.comment-timestamp {
  cursor: help;
  position: relative;
  transition: color 0.2s ease;
}

.comment-timestamp:hover {
  color: #0071e3 !important;
}

.comment-timestamp[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 0;
  background: #1d1d1f;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 8px;
  opacity: 0;
  animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* ========================================
   Notification System
   ======================================== */
.notification-badge {
    display: inline-block;
    background: #ff3b30;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
}

.notification-banner {
    position: fixed;
    top: -100px;
    right: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 16px 20px;
    min-width: 320px;
    max-width: 400px;
    z-index: 10000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-banner.show {
    top: 80px;
}

.notification-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}

.notification-content strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.notification-content p {
    margin: 0;
    font-size: 14px;
    color: #86868b;
    line-height: 1.4;
}

.member-item.has-unread {
    font-weight: 600;
}

.member-item.has-unread .member-name {
    color: #007aff;
}

.member-item .unread-badge {
    background: #007aff;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
}

/* ========================================
   Access Control Styles
   ======================================== */
.access-form-wrapper {
    max-width: 600px;
}

.share-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.share-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f5f5f7;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.share-row:hover {
    background: #e8e8ed;
}

.share-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.member-avatar-small {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.share-name {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    color: #1d1d1f;
}

.you-badge {
    background: #0066cc;
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.permissions-note {
    background: #fff9e6;
    border-left: 3px solid #ffcc00;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.permissions-note p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #1d1d1f;
}

/* Shared with badge on detail page */
.shared-with-section {
    margin: 16px 0 24px 0;
}

.shared-with-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.badge-subtle {
    background: #f5f5f7;
    color: #1d1d1f;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.edit-access-link {
    color: #0066cc;
    font-size: 15px;
    text-decoration: none;
    font-weight: 500;
}

.edit-access-link:hover {
    text-decoration: underline;
}

/* ========================================
   Family Invite (Apple-style)
   ======================================== */
.invite-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr);
    gap: 32px;
    align-items: flex-start;
}

@media (max-width: 900px) {
    .invite-layout {
        grid-template-columns: 1fr;
    }
}

.invite-form-wrapper {
    width: 100%;
    max-width: 560px;
}

.apple-form {
    background: #ffffff;
    border-radius: 22px;
    padding: 32px 32px 28px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}

.form-field {
    margin-bottom: 24px;
}

.form-field label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.required {
    color: #ff3b30;
}

.form-field input[type="email"],
.form-field input[type="text"],
.form-field select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d2d2d7;
    border-radius: 11px;
    font-size: 16px;
    font-family: inherit;
    background: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0,102,204,0.16);
}

.field-hint {
    font-size: 13px;
    color: #86868b;
    margin-top: 6px;
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.invite-side-card {
    background: #f5f5f7;
    border-radius: 22px;
    padding: 24px 24px 20px;
    color: #1d1d1f;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.invite-side-card h3 {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 600;
}

.invite-side-card ul {
    margin: 0 0 16px;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.7;
    color: #3a3a3c;
}

.invite-side-card li {
    margin-bottom: 4px;
}

.invite-emoji {
    font-size: 32px;
    margin-bottom: 8px;
}

.invite-hint {
    font-size: 13px;
    color: #86868b;
    border-top: 1px solid #e5e5ea;
    padding-top: 10px;
    margin-top: 10px;
}

/* ========================================
   Pending Approvals
   ======================================== */
.pending-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pending-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.pending-header h3 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
}

.pending-meta {
    font-size: 14px;
    color: #86868b;
    margin: 0;
}

.pending-description {
    margin: 12px 0;
    font-size: 15px;
    line-height: 1.6;
    color: #1d1d1f;
}

.pending-files {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.pending-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
}

.pending-file-icon {
    width: 100px;
    height: 100px;
    background: #f5f5f7;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    text-align: center;
    padding: 8px;
}

.pending-more {
    width: 100px;
    height: 100px;
    background: #f5f5f7;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #86868b;
}

.pending-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.btn-approve {
    padding: 10px 20px;
    background: #34c759;
    color: white;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
}

.btn-approve:hover {
    background: #2fb350;
}

.btn-reject {
    padding: 10px 20px;
    background: #ff3b30;
    color: white;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
}

.btn-reject:hover {
    background: #e6342a;
}

.btn-reject-confirm {
    padding: 8px 16px;
    background: #ff3b30;
    color: white;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
}

.approval-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    background: #ff3b30;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    margin-left: 4px;
}

/* ========================================
   Family Members Section
   ======================================== */
.family-members-section {
    background: #ffffff;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.role-group {
    margin-bottom: 32px;
}

.role-group:last-child {
    margin-bottom: 0;
}

.role-group-title {
    font-size: 15px;
    font-weight: 600;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f7;
}

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

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    text-transform: uppercase;
}

.member-name {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 8px;
}

.member-email {
    font-size: 14px;
    color: #86868b;
    margin-top: 2px;
}

.you-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #f5f5f7;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #86868b;
}

.member-role-badge {
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.owner-badge {
    background: #ffeaa7;
    color: #d63031;
}

.parent-badge {
    background: #dfe6e9;
    color: #2d3436;
}

.grandparent-badge {
    background: #fab1a0;
    color: #d63031;
}

.member-badge {
    background: #74b9ff;
    color: #0984e3;
}

.kid-badge {
    background: #a29bfe;
    color: #6c5ce7;
}

.role-change-form {
    margin: 0;
}

.role-select {
    padding: 6px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.18s ease;
}

.role-select:hover {
    border-color: #0066cc;
}

.role-select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0,102,204,0.16);
}

.family-code-section {
    background: #ffffff;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.code-card {
    background: #f5f5f7;
    border-radius: 12px;
    padding: 20px;
}

.code-display {
    font-size: 24px;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    color: #1d1d1f;
    letter-spacing: 2px;
}

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

.btn-remove-member {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 59, 48, 0.4);
    background: transparent;
    color: #ff3b30;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-remove-member:hover {
    background: rgba(255, 59, 48, 0.06);
    border-color: #ff3b30;
    color: #ff3b30;
}

/* ========================================
   Center Page & Card Layouts
   ======================================== */
.center-page {
    min-height: calc(100vh - 60px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 120px 24px 48px;
}

.card {
    background: #ffffff;
    border-radius: 18px;
    padding: 40px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    max-width: 480px;
    width: 100%;
}

.card.wide {
    max-width: 640px;
}

.card h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1d1d1f;
}

.card p {
    color: #6e6e73;
    line-height: 1.6;
    margin-bottom: 8px;
}

.card .muted {
    font-size: 14px;
    color: #86868b;
}

.secondary-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #f5f5f7;
    color: #1d1d1f;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: background 0.18s ease;
}

.secondary-btn:hover {
    background: #e8e8ed;
}

/* ========================================
   Additional Mobile Responsiveness
   ======================================== */

@media (max-width: 768px) {
  /* Chat room mobile - full redesign for mobile */
  .chat-page-wrapper {
    padding: 8px !important;
  }
  
  .chat-container {
    flex-direction: column !important;
    height: calc(100vh - 100px) !important;
  }
  
  .chat-sidebar {
    width: 100% !important;
    height: auto !important;
    max-height: 120px !important;
    border-right: none !important;
    border-bottom: 1px solid #e8e8e8;
    overflow: hidden;
  }
  
  .chat-sidebar-header {
    display: none !important;
  }
  
  .member-list {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    padding: 12px 16px !important;
    gap: 16px !important;
    -webkit-overflow-scrolling: touch;
  }
  
  .member-section-title {
    display: none !important;
  }
  
  .member-item {
    flex-direction: column !important;
    padding: 8px !important;
    min-width: 60px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
  }
  
  .member-avatar {
    margin-right: 0 !important;
    margin-bottom: 4px !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 14px !important;
  }
  
  .member-info {
    text-align: center !important;
  }
  
  .member-name {
    font-size: 11px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
  }
  
  .member-status {
    display: none !important;
  }
  
  .chat-main {
    flex: 1 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  .chat-header {
    padding: 12px 16px !important;
  }
  
  .chat-header h2 {
    font-size: 16px !important;
  }
  
  .chat-header-actions {
    display: none !important;
  }
  
  .messages-container {
    flex: 1 !important;
    padding: 12px !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }
  
  .message {
    max-width: 85% !important;
  }
  
  .message-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 12px !important;
  }
  
  .chat-input-area {
    padding: 12px !important;
  }
  
  .chat-input-area textarea {
    font-size: 16px !important;
  }
  
  /* Settings pages mobile */
  .settings-section {
    padding: 20px 16px !important;
    margin-bottom: 16px !important;
  }
  
  .settings-menu {
    border-radius: 12px !important;
  }
  
  .settings-item {
    padding: 16px !important;
  }
  
  .stat-card {
    padding: 16px !important;
  }
  
  /* Inline flex grids to single column */
  [style*="display: grid"][style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Page headers with buttons - stack */
  [style*="display: flex"][style*="justify-content: space-between"][style*="align-items: center"] {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  
  /* Modal mobile */
  .modal-content {
    width: 95% !important;
    max-width: none !important;
    margin: 16px !important;
    padding: 20px !important;
  }
  
  /* Video call mobile */
  .video-grid {
    grid-template-columns: 1fr !important;
  }
  
  .video-controls {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  
  .video-controls button {
    flex: 1 !important;
    min-width: 60px !important;
  }
  
  /* Page headers mobile */
  .page-header h1 {
    font-size: 28px !important;
  }
  
  .page-subtitle {
    font-size: 15px !important;
  }
  
  .eyebrow-tag {
    font-size: 11px !important;
    padding: 5px 12px !important;
  }
  
  /* Invite code section mobile */
  .invite-code-box {
    padding: 16px !important;
    flex-direction: column !important;
    gap: 12px !important;
    text-align: center !important;
  }
  
  .invite-code {
    font-size: 20px !important;
  }
  
  /* Comments section mobile */
  .comments-section {
    padding: 16px !important;
  }
  
  /* Inline style overrides for common patterns */
  [style*="display: flex"][style*="gap: 24px"] {
    gap: 12px !important;
  }
  
  [style*="display: flex"][style*="gap: 32px"] {
    gap: 16px !important;
  }
  
  [style*="display: grid"][style*="gap: 24px"] {
    gap: 12px !important;
  }

  /* Disable hover transforms on touch devices */
  @media (hover: none) {
    .pending-card:hover,
    .memory-card:hover,
    .notification-item:hover {
      transform: none !important;
    }
  }
}

/* Extra small devices (iPhone SE, etc) */
@media (max-width: 375px) {
  .chat-sidebar {
    max-height: 100px !important;
  }
  
  .member-item {
    min-width: 50px !important;
  }
  
  .member-avatar {
    width: 36px !important;
    height: 36px !important;
  }
  
  .member-name {
    font-size: 10px !important;
    max-width: 50px !important;
  }
  
  .notification-icon {
    width: 32px !important;
    height: 32px !important;
  }
  
  .pending-avatar {
    width: 36px !important;
    height: 36px !important;
    font-size: 14px !important;
  }
  
  .pending-thumb-wrapper,
  .pending-file-icon,
  .pending-more {
    width: 56px !important;
    height: 56px !important;
  }
  
  .container {
    padding: 0 12px !important;
  }
}
