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

:root {
  --peach: #FEF0E8;
  --coral: #F57B6C;
  --coral-light: #F7948A;
  --coral-dark: #E8505B;
  --sage: #7BAE7F;
  --sage-light: #E8F3E9;
  --cream: #FDF5F0;
  --navy: #1A3A52;
  --navy-light: #2D4F6E;
  --warm-gray: #6B6B6B;
  --light-gray: #F0F0ED;
  --text: #1A3A52;
  --white: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(26,58,82,0.06);
  --shadow-md: 0 4px 12px rgba(26,58,82,0.08);
  --shadow-lg: 0 8px 24px rgba(26,58,82,0.12);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

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

/* Prevent horizontal overflow at document level — ensures native Android
   time-picker dialogs (and all other content) stay within viewport bounds */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Open 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(253,245,240,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(26,58,82,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: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--coral);
  text-decoration: none;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.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: 'Open Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 24px;
  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: 20px; }
.btn-full { width: 100%; }

/* ===== INSTALL APP BUTTON (login page) ===== */
.btn-install-app {
  width: 100%;
  padding: 12px 20px;
  border-radius: 12px;
  border: 2px solid var(--navy);
  background: transparent;
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.18s ease, transform 0.15s ease;
}
.btn-install-app:hover {
  background: var(--peach);
  transform: translateY(-1px);
}
.btn-install-app .btn-install-icon {
  font-size: 16px;
  line-height: 1;
}

/* ===== 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: 'Poppins', 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: 'Open 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: 'Open 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: 'Poppins', 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: 'Poppins', 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;
}

/* ===== PROFESSIONAL SPACE ===== */
.pro-space-section {
  margin-top: 48px;
  padding: 32px 0;
  border-top: 2px solid var(--light-gray);
}

.pro-space-title {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}

.pro-space-subtitle {
  font-size: 14px;
  color: var(--warm-gray);
  margin-bottom: 24px;
  font-weight: 500;
}

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

.pro-space-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(135deg, #FEF2EC 0%, #FDF5F0 100%);
  border: 1px solid rgba(255, 107, 74, 0.15);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.pro-space-card:hover {
  border-color: var(--coral);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  background: linear-gradient(135deg, #FDE4D8 0%, #FEF0E8 100%);
}

.pro-space-icon {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}

.pro-space-card h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.pro-space-card p {
  font-size: 13px;
  color: var(--warm-gray);
  line-height: 1.5;
}

/* ===== 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: 'Poppins', 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: 'Poppins', sans-serif;
  font-size: 28px;
  font-weight: 800;
  flex-shrink: 0;
}

.wall-child-info h1 {
  font-family: 'Poppins', 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: 'Open 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: #E8505B; }
.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: #E8505B; }
.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;
  margin-right: 0;
}
/* When edit/delete buttons follow time, give them a small gap without margin-left: auto duplication */
.activity-time + .activity-edit-btn,
.activity-time + .activity-delete-btn {
  margin-left: 4px;
}
.activity-edit-btn + .activity-delete-btn {
  margin-left: 2px;
}

.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);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.author-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.4;
}

.author-parent {
  background: #E8F4FD;
  color: #1A73E8;
}

.author-assmat {
  background: #FEECE8;
  color: #F57B6C;
}

.author-family {
  background: #EAF4EC;
  color: #2E7D32;
}

/* ===== FAMILY SECTION ===== */
:root {
  --family-color: #4CAF50;
  --family-light: #E8F5E9;
}

.invite-badge-family {
  background: var(--family-light);
  color: #2E7D32;
}

.family-section {
  border-top: 2px solid var(--family-light);
}

.family-empty {
  font-size: 13px;
  color: var(--warm-gray);
  margin-bottom: 8px;
}

.family-member-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.family-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--family-light);
  border-radius: var(--radius-sm);
  transition: opacity 0.3s;
}

.family-member-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.family-member-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.family-member-email {
  font-size: 12px;
  color: var(--warm-gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.family-member-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.permission-toggle {
  display: flex;
  border-radius: 20px;
  overflow: hidden;
  border: 1.5px solid #B2DFDB;
}

.perm-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--warm-gray);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.perm-btn.active {
  background: var(--family-color);
  color: white;
}

.perm-btn:hover:not(.active) {
  background: var(--family-light);
  color: var(--navy);
}

.btn-revoke {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #ccc;
  background: white;
  color: var(--warm-gray);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}

.btn-revoke:hover {
  border-color: #e53935;
  color: #e53935;
  background: #FFEBEE;
}

/* Family invite permission choice */
.permission-choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.permission-option {
  cursor: pointer;
  display: block;
}

.permission-option input[type="radio"] {
  display: none;
}

.permission-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--light-gray);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.permission-card p {
  font-size: 12px;
  color: var(--warm-gray);
  margin-top: 2px;
}

.permission-option input[type="radio"]:checked + .permission-card {
  border-color: var(--family-color);
  background: var(--family-light);
}

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

.family-permission-badge {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.family-readonly-notice {
  background: var(--family-light);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  text-align: center;
}

.family-readonly-text {
  font-size: 14px;
  color: #2E7D32;
  font-weight: 500;
}

@media (max-width: 480px) {
  .family-member-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .family-member-controls {
    width: 100%;
    justify-content: space-between;
  }
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26,58,82,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: 'Poppins', 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: 'Poppins', 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: 'Open 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) {
  /* Mobile nav: keep row layout, shrink buttons to fit beside logo */
  .nav-inner { padding: 10px 12px; }
  .nav-logo { flex-shrink: 0; }
  .nav-right {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
  }
  .btn-premium {
    font-size: 11px;
    padding: 6px 10px;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
  }
  .nav-link { font-size: 12px; white-space: nowrap; }

  .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; }
  .pro-space-grid { grid-template-columns: 1fr; }
  .pro-space-card { padding: 20px 16px; }
  .pro-space-icon { font-size: 32px; }
}

/* ===== 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,58,82,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: 'Poppins', 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: 'Open Sans', sans-serif;
  transition: background 0.2s;
}

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

.pwa-dismiss-btn {
  background: transparent;
  color: rgba(255,255,255,0.5);
  border: none;
  font-size: 12px;
  cursor: pointer;
  font-family: 'Open 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,58,82,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: 800;
  font-family: 'Poppins', 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 RECAP STEP ===== */
.photo-recap-counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--warm-gray);
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.photo-recap-grid {
  /* Larger thumbnails in recap for better review on mobile */
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-bottom: 0;
}

.photo-max-msg {
  font-size: 12px;
  color: var(--coral);
  font-weight: 600;
  text-align: center;
  padding: 8px 0 4px;
}

.photo-recap-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: space-between;
  align-items: center;
}

.photo-recap-actions .btn-ghost {
  flex: 0 0 auto;
  padding: 10px 20px;
  font-size: 15px;
}

.photo-recap-actions .btn-coral {
  flex: 1;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
}

.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;
}

/* ===== PHOTO ATTACHMENT IN ACTIVITY FORMS ===== */
.photo-attach-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--light-gray);
}

.photo-attach-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.photo-attach-zone {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin-top: 8px;
}

.photo-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--light-gray);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  transition: all 0.2s ease;
  pointer-events: none;
}

.photo-attach-zone:hover .photo-attach-btn {
  background: var(--peach);
  color: var(--coral);
}

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

/* ===== PHOTO ACTION SHEET (mobile camera/gallery picker) ===== */
.photo-action-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,58,82,0.5);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.photo-action-sheet {
  background: white;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 420px;
  padding: 8px 0 env(safe-area-inset-bottom, 12px);
  animation: slideUp 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-action-header {
  text-align: center;
  padding: 14px 20px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--warm-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.photo-action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 24px;
  border: none;
  background: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.photo-action-btn:active {
  background: var(--peach);
}

.photo-action-btn .action-icon {
  font-size: 22px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light-gray);
  border-radius: 10px;
}

.photo-action-btn:first-of-type .action-icon {
  background: var(--peach);
}

.photo-action-cancel {
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px;
  padding: 14px;
  border: none;
  background: var(--light-gray);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--warm-gray);
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.photo-action-cancel:active {
  background: #ddd;
}

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

/* ===== BETA TEST BUTTON ===== */
.btn-beta-test {
  background: none;
  border: 1.5px solid rgba(123,174,127,0.6);
  color: #7BAE7F;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-beta-test:hover {
  background: #E8F3E9;
  border-color: #7BAE7F;
  color: #5a9060;
}

/* ===== PREMIUM / SUBSCRIPTION NAV =====  */
.btn-premium {
  background: linear-gradient(135deg, #F57B6C 0%, #F7A08A 100%);
  color: white;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  text-decoration: none;
  display: inline-block;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245,123,108,0.3);
  transition: all 0.2s ease;
}
.btn-premium:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245,123,108,0.4);
}
.nav-link-premium-active {
  color: var(--coral);
  font-weight: 700;
  font-size: 14px;
}

/* ===== UPGRADE BANNER ===== */
.upgrade-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #FEF0E8 0%, #FDE0D0 100%);
  border: 1.5px solid rgba(245,123,108,0.25);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.upgrade-banner-icon { font-size: 20px; flex-shrink: 0; }
.upgrade-banner-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.upgrade-banner-text strong { font-size: 14px; color: var(--navy); }
.upgrade-banner-text span { font-size: 12px; color: var(--warm-gray); }

/* ===== LOCKED ACTIVITY CARDS ===== */
.activity-locked {
  background: var(--white);
  border: 1.5px solid rgba(26,58,82,0.08);
}

.locked-photo-block {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 8px 0 6px;
  min-height: 100px;
}

.locked-photo-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 50px 50px;
  gap: 3px;
  filter: blur(10px);
  transform: scale(1.05);
}

.locked-photo-blur-cell {
  border-radius: 4px;
  background: linear-gradient(135deg, #ffe0d0 0%, #ffd0e8 50%, #d0e8ff 100%);
}
.locked-photo-blur-cell:nth-child(2) { background: linear-gradient(135deg, #d0e8ff 0%, #e8d0ff 100%); }
.locked-photo-blur-cell:nth-child(3) { background: linear-gradient(135deg, #d0ffe8 0%, #fff0d0 100%); }
.locked-photo-blur-cell:nth-child(4) { background: linear-gradient(135deg, #ffd0ff 0%, #ffd0d0 100%); }

.locked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(253,245,240,0.80);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  padding: 12px;
  text-align: center;
}

.locked-activity-block {
  margin: 8px 0 6px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--peach) 0%, #f5e8ff 100%);
  padding: 14px 16px;
}

.locked-overlay-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.locked-padlock { font-size: 18px; flex-shrink: 0; }
.locked-label {
  font-size: 12px;
  color: var(--warm-gray);
  margin: 0 0 8px;
}
.locked-cta {
  display: inline-block;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 16px;
  text-decoration: none;
  white-space: nowrap;
}

/* ===== SUBSCRIPTION PAGE ===== */
.subscription-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.sub-header {
  text-align: center;
  margin-bottom: 36px;
}
.sub-header h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}
.sub-subtitle {
  font-size: 15px;
  color: var(--warm-gray);
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.plan-card {
  position: relative;
  background: var(--white);
  border: 1.5px solid rgba(26,58,82,0.10);
  border-radius: var(--radius-md);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.plan-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.plan-card-highlight {
  border-color: var(--coral);
  box-shadow: 0 4px 20px rgba(245,123,108,0.15);
}
.plan-card-active {
  border-color: var(--sage);
  background: var(--sage-light);
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--coral);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.plan-active-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sage);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

.plan-icon { font-size: 28px; }
.plan-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.plan-amount {
  font-size: 26px;
  font-weight: 800;
  color: var(--coral);
}
.plan-period {
  font-size: 14px;
  color: var(--warm-gray);
}
.plan-tagline {
  font-size: 13px;
  color: var(--warm-gray);
  margin: 0;
}
.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  flex: 1;
}
.plan-features li {
  font-size: 13px;
  color: var(--navy);
}

.sub-free-note {
  background: var(--sage-light);
  border: 1px solid rgba(123,174,127,0.3);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}
.sub-free-note p {
  font-size: 13px;
  color: var(--navy);
  margin: 0;
}

/* Subscribe form overlay */
.subscribe-form-container {
  position: fixed;
  inset: 0;
  background: rgba(26,58,82,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.subscribe-form-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.subscribe-form-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}

.payment-placeholder {
  background: var(--light-gray);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.payment-placeholder-icon { font-size: 32px; }
.payment-placeholder p { font-size: 14px; color: var(--navy); margin: 0; }
.payment-placeholder-sub { font-size: 12px; color: var(--warm-gray) !important; }

.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid rgba(26,58,82,0.15);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--navy);
  background: var(--white);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6B6B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

@media (max-width: 600px) {
  .plans-grid { grid-template-columns: 1fr; }
  .sub-header h1 { font-size: 22px; }
  .upgrade-banner { flex-wrap: wrap; }
}

/* Subscription checkout additions */
.sub-form-desc {
  font-size: 14px;
  color: var(--warm-gray);
  margin: -8px 0 0;
}
.sub-secure-note {
  font-size: 12px;
  color: var(--warm-gray);
  text-align: center;
  margin: -8px 0 0;
}
.plan-active-badge {
  background: var(--sage);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  display: inline-block;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ===== AD SLOTS (AdSense — free users only) ===== */
.ad-slot {
  width: 100%;
  min-height: 90px;
  margin: 8px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Prevent layout collapse if ad doesn't load */
  box-sizing: border-box;
}

.ad-slot ins.adsbygoogle {
  display: block;
  width: 100%;
  min-height: 50px;
}

/* Subtle placeholder while ad loads */
.ad-slot:empty::after,
.ad-slot ins:not([data-ad-status])::after {
  content: '';
  display: block;
  width: 100%;
  height: 90px;
  background: var(--light-gray);
}

@media (max-width: 480px) {
  .ad-slot {
    min-height: 60px;
    margin: 6px 0;
  }
}

/* ===== ACTIVITY FEED FILTER BAR ===== */
.feed-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 10px 0 10px;
  margin-bottom: 16px;
  /* Sticky below the top nav */
  position: sticky;
  top: 56px;
  z-index: 50;
  background: var(--cream);
  /* No flex-wrap — single horizontal line only */
  flex-wrap: nowrap;
}

.feed-filter-bar::-webkit-scrollbar { display: none; }

/* Fade hint on right edge — only after the first pill to avoid masking touch targets */
.feed-filter-bar::after {
  content: '';
  flex-shrink: 0;
  width: 24px;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--cream));
  position: sticky;
  right: 0;
}

.filter-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 99px;
  border: 1.5px solid rgba(245,123,108,0.25);
  background: var(--white);
  color: var(--navy);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  /* Ensure touch targets are large enough on mobile */
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
  -webkit-user-select: none;
  /* Subtle shadow for depth */
  box-shadow: 0 1px 3px rgba(26,58,82,0.04);
}

.filter-pill:hover {
  border-color: var(--coral);
  color: var(--coral);
  background: var(--peach);
}

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

.filter-pill.active {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--white);
  box-shadow: 0 2px 10px rgba(245,123,108,0.35);
}

.filter-pill.active:hover {
  background: var(--coral-dark);
  border-color: var(--coral-dark);
}

@media (max-width: 600px) {
  .feed-filter-bar {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 4px;
    gap: 6px;
  }
  .filter-pill {
    font-size: 12.5px;
    padding: 7px 13px;
  }
}

/* ===== ACCESS MEMBERS LIST (childminder view) ===== */
.access-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.access-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--light-gray);
  border-radius: 10px;
  gap: 10px;
  transition: opacity 0.3s;
}

.access-member-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.access-member-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.access-member-email {
  font-size: 12px;
  color: var(--warm-gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.access-member-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-revoke-access {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  border: 1.5px solid #ccc;
  background: white;
  color: var(--warm-gray);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-revoke-access:hover {
  border-color: #e53935;
  color: #e53935;
  background: #FFEBEE;
}

/* Toast notification */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  max-width: 320px;
  text-align: center;
}

.toast-notification.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Danger button for confirmation modals */
.btn-danger {
  background: #e53935;
  color: white;
  border: none;
}

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

@media (max-width: 480px) {
  .access-member-item {
    padding: 8px 10px;
    gap: 8px;
  }
  .access-member-info {
    min-width: 0;
  }
  .access-member-controls {
    flex-shrink: 0;
  }
  .access-member-controls .invite-badge {
    font-size: 10px;
    padding: 2px 8px;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Pending invitation items in access section */
.pending-invite-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #FFF8F0;
  border-radius: 10px;
  gap: 10px;
  border: 1px dashed rgba(245, 166, 35, 0.3);
}

.pending-invite-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.pending-invite-email {
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pending-invite-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-cancel-invite {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  border: 1.5px solid #ccc;
  background: white;
  color: var(--warm-gray);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-cancel-invite:hover {
  border-color: #e53935;
  color: #e53935;
  background: #FFEBEE;
}

/* ===== LINK REQUESTS & PARENT CHILD CREATION ===== */
.alert-warning {
  background: #FFF8E1;
  color: #7B5800;
  border: 1px solid #FFE082;
}

.btn-ghost {
  background: transparent;
  color: var(--warm-gray);
  border: none;
  font-size: 14px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: color 0.2s;
}
.btn-ghost:hover { color: var(--dark); }

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

.link-requests-section {
  background: #FFF8F0;
  border: 1px solid #FFD9B0;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}
.link-requests-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 12px 0;
}
.link-request-card {
  background: white;
  border: 1px solid #F0D9C0;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.link-request-info {
  font-size: 14px;
  color: var(--dark);
  flex: 1;
}
.link-request-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.link-request-resolved {
  font-size: 14px;
  margin: 0;
  padding: 8px 0;
}
.link-request-accepted { color: #2A6B2E; }
.link-request-refused { color: #777; }

.pending-requests-section {
  margin-bottom: 20px;
}
.pending-requests-note {
  font-size: 14px;
  color: #7B5800;
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 0;
}

.duplicate-actions {
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Template actions row (below activity grid on child wall) */
.template-actions-row {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #f0f0f0;
  margin-top: 4px;
}

/* Toast notification */
.toast-notification {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a1a;
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  white-space: nowrap;
}
.toast-notification.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Template select item in apply modal */
.template-select-item:hover { background: #f5f5f5; }
.template-select-item:active { background: #fff3e0; }

/* ===== CUSTOM ACTIVITY OPTIONS ===== */

/* Wrapper that groups a custom chip + its delete button side by side */
.custom-chip-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* Custom chip — same visual as template-chip but with a subtle marker */
.custom-chip-wrap .template-chip.custom-chip {
  border-radius: 20px 0 0 20px;
  padding-right: 8px;
}

/* Delete button sits flush right of the chip */
.custom-chip-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--light-gray);
  border: 2px solid transparent;
  border-left: none;
  border-radius: 0 20px 20px 0;
  color: var(--warm-gray);
  font-size: 14px;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
  height: 100%;
  transition: all 0.15s ease;
  font-family: inherit;
}
.custom-chip-delete:hover {
  background: #FFEBEE;
  color: #e53935;
}
/* When the sibling chip is selected, match the delete button look */
.custom-chip-wrap .template-chip.custom-chip.selected ~ .custom-chip-delete,
.custom-chip-wrap .template-chip.custom-chip.selected + .custom-chip-delete {
  background: var(--coral-dark);
  color: white;
}

/* "Add option" section below each chip group */
.add-custom-opt-wrap {
  width: 100%;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-add-custom-opt {
  background: transparent;
  border: 1.5px dashed var(--coral);
  border-radius: 20px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Open Sans', sans-serif;
}
.btn-add-custom-opt:hover {
  background: var(--peach);
}

.add-custom-opt-input {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 200px;
}

.add-custom-opt-text {
  flex: 1;
  border: 1.5px solid var(--coral);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: 'Open Sans', sans-serif;
  color: var(--navy);
  outline: none;
  min-width: 0;
}
.add-custom-opt-text:focus {
  box-shadow: 0 0 0 3px rgba(245,123,108,0.15);
}

.btn-save-custom-opt {
  background: var(--coral);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-save-custom-opt:hover { background: var(--coral-dark); }

.btn-cancel-custom-opt {
  background: var(--light-gray);
  color: var(--warm-gray);
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  transition: background 0.15s;
}
.btn-cancel-custom-opt:hover { background: #e0e0e0; }

/* ===== ACTIVITY ACTION BUTTONS (EDIT / DELETE) ===== */
.activity-edit-btn,
.activity-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 6px;
  opacity: 0.45;
  transition: opacity 0.15s, background 0.15s;
  margin-left: auto;
  line-height: 1;
  flex-shrink: 0;
}
.activity-edit-btn + .activity-delete-btn {
  margin-left: 2px !important;
}
.activity-edit-btn:hover {
  opacity: 1;
  background: #e8f4fd;
}
.activity-delete-btn:hover {
  opacity: 1;
  background: #ffe5e0;
}
/* Ensure time doesn't push buttons off */
.activity-top .activity-edit-btn,
.activity-top .activity-delete-btn {
  margin-left: 0;
}

/* "Modifié" inline badge */
.activity-edited-badge {
  display: inline-block;
  font-size: 10px;
  color: var(--warm-gray);
  margin-left: 6px;
  font-style: italic;
  opacity: 0.75;
}
.activity-time {
  /* already has margin-left: auto — delete btn appears after time */
}

/* ===== ACTIVITY DETAIL MODAL ===== */
.activity-detail-card {
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.activity-detail-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.activity-detail-big-icon {
  font-size: 2rem;
  line-height: 1;
}

.activity-detail-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 0;
}

.activity-detail-content {
  margin: 12px 0 0;
}

.detail-content-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--navy);
  margin: 0;
  white-space: pre-wrap;
}

.activity-detail-photos {
  margin: 14px 0 0;
}

/* Large photo grid in detail view */
.detail-photo-grid {
  display: grid;
  gap: 6px;
}
.detail-photo-grid-1 { grid-template-columns: 1fr; }
.detail-photo-grid-2 { grid-template-columns: 1fr 1fr; }
.detail-photo-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.detail-photo-thumb {
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  aspect-ratio: 1;
  background: var(--light-gray);
}
.detail-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.15s;
}
.detail-photo-thumb:hover img { transform: scale(1.03); }

/* If there are more than 3 photos, rows wrap naturally */
.detail-photo-grid-4,
.detail-photo-grid-5 { grid-template-columns: 1fr 1fr 1fr; }

.activity-detail-author {
  margin-top: 16px;
  font-size: 12px;
  color: var(--warm-gray);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .activity-detail-card {
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    margin: 0;
    width: 100%;
  }
}

/* ===== CALCULATEUR DE RÉMUNÉRATION ASSMAT ===== */

.calc-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* Header */
.calc-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.calc-header-icon {
  font-size: 40px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 4px;
}

.calc-title {
  font-family: 'Poppins', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 4px;
  line-height: 1.2;
}

.calc-subtitle {
  font-size: 14px;
  color: var(--warm-gray);
  margin: 0;
}

.calc-view-toggle {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.calc-toggle-btn {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--navy);
  color: var(--navy);
  background: transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.calc-toggle-btn:hover {
  background: var(--navy);
  color: white;
}

.calc-toggle-active {
  background: var(--navy);
  color: white \!important;
}

/* Steps indicator */
.calc-steps {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
  gap: 0;
}

.calc-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.calc-step.calc-step-active {
  opacity: 1;
}

.calc-step.calc-step-done {
  opacity: 0.7;
}

.calc-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--light-gray);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  transition: background 0.3s, color 0.3s;
}

.calc-step-active .calc-step-num {
  background: var(--coral);
  color: white;
}

.calc-step-done .calc-step-num {
  background: var(--sage);
  color: white;
}

.calc-step span {
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

.calc-step-line {
  flex: 1;
  height: 2px;
  background: var(--light-gray);
  margin: 0 4px;
  margin-bottom: 20px;
}

/* Panel */
.calc-panel {
  background: white;
  border-radius: var(--radius-md);
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.calc-hidden {
  display: none \!important;
}

.calc-panel-title {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 24px;
}

/* Fields */
.calc-field-group {
  margin-bottom: 20px;
}

.calc-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
}

.calc-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--light-gray);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: 'Open Sans', sans-serif;
  color: var(--text);
  background: white;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.calc-input:focus {
  outline: none;
  border-color: var(--coral);
}

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

.calc-input-unit .calc-input {
  padding-right: 60px;
}

.calc-unit {
  position: absolute;
  right: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--warm-gray);
  pointer-events: none;
}

.calc-hint {
  font-size: 12px;
  color: var(--warm-gray);
  margin: 6px 0 0;
  line-height: 1.5;
}

.calc-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Rate toggle */
.calc-rate-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calc-toggle-rate {
  display: flex;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--light-gray);
  flex-shrink: 0;
}

.calc-rate-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  background: white;
  border: none;
  cursor: pointer;
  color: var(--warm-gray);
  transition: all 0.2s;
  font-family: 'Open Sans', sans-serif;
}

.calc-rate-active {
  background: var(--coral) \!important;
  color: white \!important;
}

/* Radio */
.calc-radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calc-radio-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--light-gray);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.calc-radio-item:has(input:checked) {
  border-color: var(--coral);
  background: rgba(245, 123, 108, 0.05);
}

.calc-radio-item input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--coral);
  flex-shrink: 0;
}

.calc-radio-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.calc-radio-content strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

.calc-radio-content span {
  font-size: 12px;
  color: var(--warm-gray);
}

/* Actions */
.calc-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--light-gray);
}

/* Add child button */
.calc-add-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--coral);
  background: rgba(245, 123, 108, 0.04);
  color: var(--coral);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
  font-family: 'Open Sans', sans-serif;
}

.calc-add-btn:hover {
  background: rgba(245, 123, 108, 0.1);
}

/* Child card */
.calc-child-card {
  background: var(--peach);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
}

.calc-child-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calc-child-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}

.calc-child-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--warm-gray);
  font-size: 18px;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s;
}

.calc-child-remove:hover { color: var(--coral-dark); }

/* Result panel */
.calc-result-header {
  text-align: center;
  margin-bottom: 28px;
}

.calc-result-title {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 8px;
}

.calc-result-main {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.calc-result-big {
  text-align: center;
  background: var(--peach);
  border-radius: var(--radius-md);
  padding: 20px 32px;
}

.calc-result-big-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--warm-gray);
  margin-bottom: 6px;
}

.calc-result-big-value {
  font-family: 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--coral);
}

.calc-result-big-unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--warm-gray);
}

/* Line items */
.calc-section {
  margin-bottom: 20px;
}

.calc-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--warm-gray);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--light-gray);
}

.calc-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  gap: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.calc-line:last-child {
  border-bottom: none;
}

.calc-line-label {
  flex: 1;
}

.calc-line-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}

.calc-line-note {
  font-size: 12px;
  color: var(--warm-gray);
  margin-top: 2px;
}

.calc-line-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  flex-shrink: 0;
}

.calc-line-amount.negative {
  color: #E8505B;
}

.calc-line-amount.positive {
  color: var(--sage);
}

.calc-line-amount.zero {
  color: var(--warm-gray);
}

.calc-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--navy);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.calc-total-label {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
}

.calc-total-value {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: white;
}

.calc-employer-box {
  background: var(--sage-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 20px;
}

.calc-employer-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sage);
  margin-bottom: 12px;
}

/* Warnings */
.calc-warnings {
  background: #FFF3E0;
  border: 2px solid #FF9800;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 12px;
}

.calc-warning-item {
  font-size: 14px;
  color: #E65100;
  padding: 4px 0;
}

.calc-warning-item::before {
  content: '⚠️ ';
}

/* Outline button */
.btn-outline-navy {
  background: transparent;
  border: 2px solid var(--navy);
  color: var(--navy);
}

.btn-outline-navy:hover {
  background: var(--navy);
  color: white;
}

/* Responsive */
@media (max-width: 600px) {
  .calc-grid-2 {
    grid-template-columns: 1fr;
  }

  .calc-header {
    flex-wrap: wrap;
  }

  .calc-view-toggle {
    margin-left: 0;
    width: 100%;
  }

  .calc-toggle-btn {
    flex: 1;
    text-align: center;
  }

  .calc-result-big {
    padding: 16px 20px;
  }

  .calc-result-big-value {
    font-size: 26px;
  }

  .calc-actions {
    flex-direction: column-reverse;
  }

  .calc-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .calc-panel {
    padding: 20px 16px;
  }

  .calc-steps span {
    display: none;
  }

  .calc-step-line {
    margin-bottom: 10px;
  }
}

/* ===== PAYMENT PAGES — RESPONSIVE FIXES ===== */
/* Prevents horizontal overflow on all payment page content */
.pay-wrap {
  max-width: 100%;
  overflow-x: hidden;
}

/* 2-col form grid used in contract + hours add form */
.pay-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* 3-col form grid used in hours submit section */
.pay-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

/* Field with select + inline add button */
.pay-field-with-btn {
  display: flex;
  gap: 6px;
  align-items: center;
}
.pay-field-with-btn select {
  flex: 1;
  min-width: 0;
}
.pay-field-with-btn button {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Inputs inside payment grids should never overflow their cell */
.pay-grid-2 input,
.pay-grid-2 select,
.pay-grid-3 input,
.pay-grid-3 select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Pajemploi table wrapper for horizontal scroll */
.pay-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(26,58,82,0.08);
}
.pay-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}

/* Hours row — prevent long content from overflowing */
.pay-hour-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #FAFAFA;
  border-radius: 10px;
  margin-bottom: 6px;
}
.pay-hour-row > div:first-child {
  flex: 1;
  min-width: 0;
  font-size: 14px;
}
.pay-hour-row span {
  flex-shrink: 0;
}

/* Profile billing 2-col grid */
.pay-profil-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 480px) {
  /* Collapse 2-col grids to single column on mobile */
  .pay-grid-2 {
    grid-template-columns: 1fr;
  }

  /* Collapse 3-col grids to single column on mobile */
  .pay-grid-3 {
    grid-template-columns: 1fr;
  }

  /* Stack select + button vertically */
  .pay-field-with-btn {
    flex-wrap: wrap;
  }
  .pay-field-with-btn select {
    width: 100%;
  }
  .pay-field-with-btn button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Profile grid collapses to 1 col */
  .pay-profil-grid {
    grid-template-columns: 1fr;
  }

  /* Hours page header stacks */
  .pay-header-flex {
    flex-direction: column;
    align-items: stretch !important;
  }
  .pay-header-flex > div {
    width: 100%;
  }
  .pay-header-actions {
    justify-content: stretch;
    width: 100%;
  }
  .pay-header-actions input[type="month"] {
    flex: 1;
  }

  /* Pajemploi export header actions wrap */
  .pay-export-actions {
    flex-direction: column;
    width: 100%;
  }
  .pay-export-actions input,
  .pay-export-actions a {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  /* Hours page — prevent any child from overflowing the wrapper */
  .pay-wrap {
    overflow-x: hidden;
    max-width: 100%;
  }
  .pay-wrap button {
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
  }
  .pay-wrap input,
  .pay-wrap select,
  .pay-wrap textarea {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Submit section grid inputs full-width on mobile */
  .pay-grid-3 select,
  .pay-grid-3 input {
    width: 100%;
    min-width: 0;
  }
}

/* ===== MOBILE HEADER NAV — 2-line layout on small screens ===== */
@media (max-width: 500px) {
  .nav-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
