/* Calinote App Styles - matches landing page design tokens */

:root {
  --peach: #FFF0E6;
  --coral: #FF6B4A;
  --coral-light: #FF8A6F;
  --coral-dark: #E85A3A;
  --sage: #7BAE7F;
  --sage-light: #E8F3E9;
  --cream: #FFFAF5;
  --navy: #1A2744;
  --navy-light: #2D3F5E;
  --warm-gray: #6B6B6B;
  --light-gray: #F0F0ED;
  --text: #1A2744;
  --white: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(26,39,68,0.06);
  --shadow-md: 0 4px 12px rgba(26,39,68,0.08);
  --shadow-lg: 0 8px 24px rgba(26,39,68,0.12);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ===== NAV ===== */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,250,245,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(26,39,68,0.06);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--coral);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.nav-logo span { color: var(--sage); }

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

.nav-user {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}

.nav-link {
  font-size: 14px;
  color: var(--warm-gray);
  text-decoration: none;
  font-weight: 500;
}
.nav-link:hover { color: var(--coral); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-coral {
  background: var(--coral);
  color: white;
}
.btn-coral:hover { background: var(--coral-dark); transform: translateY(-1px); }

.btn-sage {
  background: var(--sage);
  color: white;
}
.btn-sage:hover { background: #6A9D6E; }

.btn-outline {
  background: transparent;
  color: var(--coral);
  border: 2px solid var(--coral);
  padding: 10px 22px;
}
.btn-outline:hover { background: var(--peach); }

.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 10px; }
.btn-full { width: 100%; }

/* ===== MAIN ===== */
.app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: calc(100vh - 60px);
}

/* ===== AUTH PAGES ===== */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 0;
  min-height: calc(100vh - 120px);
}

.auth-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}

.auth-card h1 {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}

.auth-sub {
  color: var(--warm-gray);
  font-size: 15px;
  margin-bottom: 28px;
  line-height: 1.5;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--warm-gray);
}
.auth-footer a { color: var(--coral); text-decoration: none; font-weight: 600; }

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  border: 2px solid var(--light-gray);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--text);
  transition: border-color 0.2s ease;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--coral);
  background: white;
}

.form-group textarea { resize: vertical; min-height: 60px; }

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%236B6B6B'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Role tabs */
.role-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--light-gray);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.role-tab {
  flex: 1;
  padding: 10px 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--warm-gray);
  cursor: pointer;
  transition: all 0.2s ease;
}
.role-tab.active {
  background: white;
  color: var(--coral);
  box-shadow: var(--shadow-sm);
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
}
.alert-error {
  background: #FEE;
  color: #C33;
  border: 1px solid #FCC;
}
.alert-success {
  background: var(--sage-light);
  color: #2A6B2E;
  border: 1px solid #C5DFC7;
}

/* ===== DASHBOARD ===== */
.dashboard {
  padding: 32px 0;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.dash-header h1 {
  font-family: 'Syne', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--navy);
}

.dash-sub {
  color: var(--warm-gray);
  font-size: 15px;
  margin-top: 4px;
}

/* ===== CHILD CARDS ===== */
.child-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.child-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border-radius: var(--radius-md);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.child-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.child-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--peach), var(--coral-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
}

.child-info {
  flex: 1;
}

.child-info h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 2px;
}

.child-age {
  font-size: 13px;
  color: var(--warm-gray);
}

.child-minder {
  font-size: 13px;
  color: var(--sage);
  font-weight: 500;
}

.child-arrow {
  font-size: 24px;
  color: var(--light-gray);
  font-weight: 300;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.empty-state.small { padding: 32px 20px; background: transparent; box-shadow: none; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}
.empty-state p { color: var(--warm-gray); font-size: 14px; margin-bottom: 4px; }
.empty-hint { color: var(--sage); font-size: 13px; }
.empty-state .btn { margin-top: 20px; }

/* ===== CHILD WALL ===== */
.child-wall {
  padding: 24px 0 40px;
}

.wall-header {
  margin-bottom: 28px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--warm-gray);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}
.back-link:hover { color: var(--coral); }

.wall-child-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wall-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--peach), var(--coral-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  flex-shrink: 0;
}

.wall-child-info h1 {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
}

.wall-age {
  font-size: 14px;
  color: var(--warm-gray);
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
  margin-bottom: 28px;
}

.quick-actions h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  background: white;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.action-btn:active { transform: translateY(0); }

.action-icon { font-size: 28px; line-height: 1; }
.action-btn span:last-child {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
}

.action-meal:hover { border-color: var(--coral); }
.action-nap:hover { border-color: #8B7EC8; }
.action-activity:hover { border-color: var(--sage); }
.action-diaper:hover { border-color: #5BADE0; }
.action-note:hover { border-color: var(--navy); }
.action-health:hover { border-color: #E85A3A; }
.action-photo:hover { border-color: var(--coral); }

/* ===== INVITE SECTION ===== */
.invite-section {
  background: white;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.invite-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.invite-list { margin-bottom: 8px; }

.invite-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--light-gray);
}
.invite-item:last-child { border-bottom: none; }

.invite-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.invite-status-dot.accepted { background: var(--sage); }
.invite-status-dot.pending { background: #F5A623; }

.invite-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--sage-light);
  color: var(--sage);
}
.invite-badge.pending {
  background: #FFF3E0;
  color: #F5A623;
}

/* ===== ACTIVITY FEED ===== */
.wall-feed-section {
  margin-top: 8px;
}

.wall-feed-section > h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.date-group { margin-bottom: 24px; }

.date-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--warm-gray);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-left: 4px;
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-card {
  display: flex;
  gap: 14px;
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
  border-left: 4px solid var(--light-gray);
}

.activity-meal { border-left-color: var(--coral); }
.activity-nap { border-left-color: #8B7EC8; }
.activity-activity { border-left-color: var(--sage); }
.activity-diaper { border-left-color: #5BADE0; }
.activity-note { border-left-color: var(--navy-light); }
.activity-health { border-left-color: #E85A3A; }
.activity-photo { border-left-color: var(--coral); }

.activity-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.activity-body { flex: 1; min-width: 0; }

.activity-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.activity-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

.activity-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--light-gray);
  color: var(--warm-gray);
}

.activity-time {
  font-size: 12px;
  color: var(--warm-gray);
  margin-left: auto;
}

.activity-content {
  font-size: 14px;
  color: var(--navy-light);
  line-height: 1.5;
  margin-bottom: 4px;
}

.activity-author {
  font-size: 12px;
  color: var(--warm-gray);
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26,39,68,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn 0.2s ease;
}

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

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-card {
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 28px 24px 36px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

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

.modal-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--light-gray);
  border-radius: 50%;
  font-size: 20px;
  color: var(--warm-gray);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--peach); color: var(--coral); }

/* ===== INVITE RESULT ===== */
.invite-result {
  margin-top: 20px;
  padding: 16px;
  background: var(--sage-light);
  border-radius: var(--radius-sm);
}

.invite-link-box {
  background: white;
  border: 2px solid var(--sage);
  border-radius: 10px;
  padding: 12px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.invite-link-box input {
  flex: 1;
  border: none;
  font-size: 13px;
  color: var(--navy);
  background: transparent;
  outline: none;
  font-family: monospace;
}

.invite-link-box button {
  padding: 6px 14px;
  background: var(--sage);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== INVITATION PAGE ===== */
.invite-hero {
  text-align: center;
  margin-bottom: 24px;
}

.invite-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--peach), var(--coral-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 32px;
  font-weight: 800;
  margin: 0 auto 16px;
}

/* ===== ACTIVITY FORM FIELDS ===== */
.template-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.template-chip {
  padding: 8px 16px;
  background: var(--light-gray);
  border: 2px solid transparent;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.template-chip:hover { background: var(--peach); }
.template-chip.selected {
  background: var(--coral);
  color: white;
  border-color: var(--coral-dark);
}

/* ===== DESKTOP ===== */
@media (min-width: 769px) {
  .modal-overlay {
    align-items: center;
  }
  .modal-card {
    border-radius: var(--radius-lg);
    max-height: 80vh;
  }
  .action-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 480px) {
  .dash-header { flex-direction: column; align-items: flex-start; }
  .dash-header .btn { width: 100%; }
  .wall-child-info h1 { font-size: 24px; }
  .action-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .action-btn { padding: 12px 6px; }
  .action-icon { font-size: 24px; }
  .auth-card { padding: 28px 24px; }
  .nav-user { display: none; }
}

/* ===== LOADING SPINNER ===== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

/* ===== PWA INSTALL PROMPT ===== */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: var(--navy);
  border-radius: 16px 16px 0 0;
  padding: 16px 20px 24px;
  box-shadow: 0 -4px 24px rgba(26,39,68,0.2);
  animation: slideUpPwa 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 480px;
  margin: 0 auto;
}

@keyframes slideUpPwa {
  from { transform: translateY(120%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pwa-install-banner.pwa-hiding {
  animation: slideDownPwa 0.3s ease forwards;
}

@keyframes slideDownPwa {
  to { transform: translateY(120%); opacity: 0; }
}

.pwa-banner-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.pwa-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.pwa-banner-header h4 {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}

.pwa-banner-close {
  margin-left: auto;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.pwa-banner-close:hover {
  background: rgba(255,255,255,0.2);
  color: white;
}

.pwa-banner-text {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
  margin-bottom: 14px;
}

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

.pwa-install-btn {
  background: var(--coral);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: background 0.2s;
}

.pwa-install-btn:hover { background: #E85A3A; }

.pwa-dismiss-btn {
  background: transparent;
  color: rgba(255,255,255,0.5);
  border: none;
  font-size: 12px;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-decoration: underline;
  padding: 8px 4px;
}

.pwa-dismiss-btn:hover { color: rgba(255,255,255,0.8); }

/* ===== PHOTO GRID IN ACTIVITY CARD ===== */
.photo-grid {
  display: grid;
  gap: 4px;
  margin: 8px 0 6px;
  border-radius: 10px;
  overflow: hidden;
}
.photo-grid-1 { grid-template-columns: 1fr; max-width: 260px; }
.photo-grid-2 { grid-template-columns: 1fr 1fr; }
.photo-grid-3 { grid-template-columns: 1fr 1fr; }
.photo-grid-3 .photo-thumb:first-child { grid-column: span 2; }
.photo-grid-4 { grid-template-columns: 1fr 1fr; }

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--light-gray);
}
.photo-grid-1 .photo-thumb { aspect-ratio: 4/3; }

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
  display: block;
}
.photo-thumb:hover img { transform: scale(1.04); }

.photo-more-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,39,68,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: 800;
  font-family: 'Syne', sans-serif;
  z-index: 2;
}

/* ===== PHOTO UPLOAD MODAL ===== */
.photo-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--light-gray);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  text-align: center;
  min-height: 100px;
}
.photo-upload-zone:hover {
  border-color: var(--coral);
  background: var(--peach);
}

#photo-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.photo-upload-icon { font-size: 36px; line-height: 1; }
.photo-upload-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
}
.photo-upload-hint {
  font-size: 12px;
  color: var(--warm-gray);
}

.photo-upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.photo-preview-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--light-gray);
}
.photo-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-preview-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* ===== LIGHTBOX ===== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.lightbox-img {
  max-width: 96vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: white;
  border: none;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,0.3); }

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 600;
  background: rgba(0,0,0,0.4);
  padding: 4px 12px;
  border-radius: 20px;
}

/* ===== DESKTOP: 7-item action grid ===== */
@media (min-width: 769px) {
  .action-grid { grid-template-columns: repeat(7, 1fr); }
}
