/* ==========================================================================
   BĄBELEK – MAŁE KROKI (Styl wizualny MVP v3.0 - Ultra Responsive iOS & Desktop)
   Domena: https://babelek.online | Kosakowo pod Gdynią
   Specjalna optymalizacja pod iPhone 16 (Dynamic Island, Safe Areas, Zero jitter)
   ========================================================================== */

:root {
  --bg-main: #FAF8F5;
  --bg-card: #FFFFFF;
  --bg-warm: #FFFDF9;
  
  --text-navy: #1B2A4A;
  --text-navy-light: #304165;
  --text-muted: #6B7A99;
  
  --brand-red: #E02B2B;
  --brand-red-dark: #B71C1C;
  --brand-red-light: #FDECEF;
  --brand-navy: #253968;
  --brand-navy-dark: #16223E;
  
  --pastel-pink: #FDEEEF;
  --pastel-blue: #EAF2FB;
  --pastel-mint: #E8F5EE;
  --pastel-yellow: #FEF7E6;
  --pastel-lavender: #F2EEFA;

  --border-light: #EDE7DD;
  --border-focus: #D0C6B8;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(27, 42, 74, 0.04);
  --shadow-md: 0 8px 24px rgba(27, 42, 74, 0.07);
  --shadow-lg: 0 16px 36px rgba(27, 42, 74, 0.12);

  --font-main: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bottom-nav-height: 64px;
  --sidebar-width: 270px;
}

/* ==========================================================================
   RESET & MOBILE-SAFE CONTAINER (Klucz do braku "pływania" na iPhone)
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  height: -webkit-fill-available;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: #F4F1EA;
  color: var(--text-navy);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  position: relative;
  touch-action: pan-y; /* Blokuje niepożądane pływanie horyzontalne na iOS */
}

/* ==========================================================================
   1. EKRAN LOGOWANIA (LOGIN)
   ========================================================================== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, #FAF8F5 0%, #F3EDE3 100%);
  width: 100%;
  box-sizing: border-box;
}

.login-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  width: 100%;
  max-width: 440px;
  padding: 28px 22px;
  text-align: center;
  box-sizing: border-box;
}

.login-logo {
  height: 52px;
  max-width: 100%;
  object-fit: contain;
  margin-bottom: 8px;
}

.login-tagline {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.login-form {
  text-align: left;
  margin-bottom: 20px;
}

.login-form .form-group {
  margin-bottom: 14px;
}

.login-form .form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-navy);
  margin-bottom: 6px;
}

.login-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-navy);
  background: #FFFFFF;
  outline: none;
  box-sizing: border-box;
}

.login-input:focus {
  border-color: var(--brand-navy);
}

.login-error {
  background: var(--brand-red-light);
  color: var(--brand-red-dark);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
  display: none;
}

.login-demo-box {
  background: var(--pastel-yellow);
  border: 1px dashed #D4A373;
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: left;
  margin-top: 18px;
}

.login-demo-box h4 {
  font-size: 12.5px;
  font-weight: 800;
  color: #78350F;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.demo-account-chip {
  background: #FFFFFF;
  border: 1px solid #E6BA88;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
}

.demo-account-chip:last-child {
  margin-bottom: 0;
}

.demo-account-chip:hover {
  border-color: var(--brand-navy);
  background: #FFFDF9;
}

.demo-account-info strong {
  font-size: 13px;
  display: block;
  color: var(--text-navy);
}

.demo-account-info span {
  font-size: 11.5px;
  color: var(--text-muted);
}

.demo-badge-fill {
  background: var(--brand-navy);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   2. ZINTEGROWANY NAGŁÓWEK MOBILNY (Zero pływania / jittera)
   ========================================================================== */
.top-unified-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  z-index: 100;
  background: #FFFFFF;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding-top: env(safe-area-inset-top, 0px); /* iPhone 16 Dynamic Island support */
}

/* Pasek demonstracyjny na samej górze */
.demo-bar {
  background: var(--brand-navy-dark);
  color: #FFFFFF;
  padding: 6px 12px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-bar::-webkit-scrollbar {
  display: none;
}

.demo-bar .demo-label {
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 11px;
}

.demo-pills {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.demo-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.demo-btn:hover, .demo-btn.active {
  background: #FFFFFF;
  color: var(--brand-navy);
  border-color: #FFFFFF;
}

.demo-btn-logout {
  background: var(--brand-red);
  border-color: var(--brand-red);
}
.demo-btn-logout:hover {
  background: var(--brand-red-dark);
  color: #FFFFFF;
}

/* Header mobilny */
.mobile-header {
  background: #FFFFFF;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  width: 100%;
  box-sizing: border-box;
  height: 52px;
}

@media (min-width: 992px) {
  .mobile-header {
    display: none; /* Na desktopie zastąpiony sidebar + topbar */
  }
}

.mobile-logo {
  height: 34px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

.header-child-badge {
  background: var(--pastel-blue);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-navy);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ==========================================================================
   3. STRUKTURA GŁÓWNA & DESKTOP SIDEBAR
   ========================================================================== */
#app-layout {
  display: flex;
  min-height: calc(100vh - 35px);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.desktop-sidebar {
  display: none; /* Ukryty na telefonach */
}

@media (min-width: 992px) {
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    background: #FFFFFF;
    border-right: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px;
    box-shadow: 2px 0 12px rgba(27, 42, 74, 0.03);
    z-index: 30;
    flex-shrink: 0;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    text-decoration: none;
  }

  .sidebar-logo {
    height: 44px;
    width: auto;
  }

  .sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
  }

  .sidebar-item button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-navy-light);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
  }

  .sidebar-item button:hover {
    background: var(--bg-warm);
    color: var(--brand-navy);
  }

  .sidebar-item button.active {
    background: var(--pastel-blue);
    color: var(--brand-navy);
    font-weight: 800;
  }

  .sidebar-item button .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
  }

  .sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
  }

  .user-card-sidebar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-warm);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
  }

  .user-avatar-round {
    width: 36px;
    height: 36px;
    background: #FFFFFF;
    border: 1.5px solid var(--border-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
  }

  .user-info-text strong {
    font-size: 13px;
    display: block;
    color: var(--text-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
  }

  .user-info-text span {
    font-size: 11px;
    color: var(--text-muted);
  }

  .btn-sidebar-logout {
    width: 100%;
    background: none;
    border: 1px solid var(--border-light);
    color: var(--brand-red);
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .btn-sidebar-logout:hover {
    background: var(--brand-red-light);
  }
}

/* ==========================================================================
   4. OBSZAR GŁÓWNY TREŚCI (RESPONSIVE)
   ========================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  min-width: 0; /* Kluczowe dla flexboxa, aby dzieci nie rozpychały strony */
  overflow-x: hidden;
}

/* Desktop Dashboard Header */
.desktop-topbar {
  display: none;
}

@media (min-width: 992px) {
  .desktop-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border-light);
  }

  .desktop-page-title h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--brand-navy);
  }

  .desktop-page-title p {
    font-size: 12.5px;
    color: var(--text-muted);
  }

  .desktop-quick-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }
}

/* Główny kontener zakładek */
.page-container {
  flex: 1;
  padding: 16px 14px calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 12px) + 20px);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

@media (min-width: 992px) {
  .page-container {
    padding: 32px;
    max-width: 1320px;
    margin: 0 auto;
  }
}

/* ==========================================================================
   5. DOLNA NAWIGACJA NA MOBILE (Z pełną obsługą paska iPhone 16)
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 10px);
  padding-top: 4px;
  background: rgba(255, 255, 255, 0.98);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 90;
  box-sizing: border-box;
  box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.04);
}

@media (min-width: 992px) {
  .bottom-nav {
    display: none; /* Ukryta na desktopie – jest sidebar */
  }
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  cursor: pointer;
  flex: 1 1 0;
  min-width: 0;
  padding: 4px 0;
  overflow: hidden;
}

.nav-item.active {
  color: var(--brand-red);
}

.nav-item .nav-icon {
  font-size: 19px;
  line-height: 1;
}

.nav-item span:last-child {
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 96%;
}

/* ==========================================================================
   6. KOMPONENTY I KARTY (Pełne dopasowanie do szerokości bez overflow)
   ========================================================================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
}

@media (min-width: 768px) {
  .card {
    padding: 20px;
    margin-bottom: 20px;
  }
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-navy);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.welcome-hero {
  background: linear-gradient(135deg, #FFFFFF 0%, var(--pastel-pink) 100%);
  border: 1px solid #F8D8DC;
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 18px;
  width: 100%;
  box-sizing: border-box;
}

.welcome-hero h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-navy);
  margin-bottom: 4px;
}

.mood-box {
  background: var(--pastel-yellow);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  width: 100%;
  box-sizing: border-box;
}

.mood-icon {
  width: 44px;
  height: 44px;
  background: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.moment-card {
  background: linear-gradient(135deg, #FFFFFF 0%, var(--pastel-mint) 100%);
  border: 1.5px solid #CDECDA;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}

.meal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #F3EFE9;
  gap: 8px;
}
.meal-row:last-child { border-bottom: none; }
.meal-name { font-size: 13.5px; font-weight: 700; color: var(--text-navy); }
.meal-status { font-size: 11.5px; font-weight: 800; padding: 3px 8px; border-radius: var(--radius-full); white-space: nowrap; flex-shrink: 0; }
.status-all { background: var(--pastel-mint); color: #1E6B47; }
.status-most { background: var(--pastel-blue); color: #1A5490; }
.status-half { background: var(--pastel-yellow); color: #8C590E; }
.status-few { background: var(--pastel-pink); color: var(--brand-red-dark); }

/* Sekcja Małe Kroki */
.steps-feature {
  background: #FFFFFF;
  border: 2px solid #253968;
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 18px;
  width: 100%;
  box-sizing: border-box;
}

.steps-quote {
  font-size: 14.5px;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-navy);
  background: var(--pastel-blue);
  padding: 14px 16px;
  border-left: 4px solid var(--brand-navy);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 14px 0;
  overflow-wrap: break-word;
}

.step-item {
  background: var(--bg-warm);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  width: 100%;
  box-sizing: border-box;
}

.step-item-title {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--brand-red-dark);
  margin-bottom: 4px;
}

.step-item-desc {
  font-size: 13.5px;
  color: var(--text-navy);
  font-weight: 600;
}

/* ==========================================================================
   7. TABELE ADMINISTRACYJNE (Pełna ochrona przed rozpychaniem ekranu)
   ========================================================================== */
.admin-table-wrapper {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
  box-sizing: border-box;
  margin-bottom: 20px;
}

.admin-table {
  width: 100%;
  min-width: 620px; /* Tabela przewija się płynnie wewnątrz kontenera */
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.admin-table th {
  background: #F8F6F0;
  padding: 12px 14px;
  font-weight: 800;
  color: var(--brand-navy);
  border-bottom: 1.5px solid var(--border-light);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #F2EEE6;
  color: var(--text-navy);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background-color: #FAF8F3;
}

.badge-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-published { background: var(--pastel-mint); color: #15803D; }
.badge-draft { background: var(--pastel-yellow); color: #B45309; }
.badge-missing { background: var(--pastel-pink); color: #B91C1C; }

.btn-action-small {
  background: var(--pastel-blue);
  color: var(--brand-navy);
  border: 1px solid #C8DEF7;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-right: 3px;
  white-space: nowrap;
}

.btn-action-danger {
  background: var(--pastel-pink);
  color: var(--brand-red-dark);
  border-color: #F8D8DC;
}

/* ==========================================================================
   8. SIATKI DESKTOP & WIDOKI
   ========================================================================== */
.desktop-grid-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}

@media (min-width: 992px) {
  .desktop-grid-2col {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
  }
}

.desktop-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
}

.stat-metric-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.stat-metric-card .label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stat-metric-card .number {
  font-size: 24px;
  font-weight: 800;
  color: var(--brand-navy);
}

.stat-metric-card .desc {
  font-size: 11px;
  color: var(--text-navy-light);
  margin-top: 2px;
}

/* Galeria */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  width: 100%;
}

.gallery-item {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.gallery-photo {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

.gallery-body { padding: 12px 14px; }

/* Przyciski i formularze */
.btn-primary {
  background: var(--brand-red);
  color: #FFFFFF;
  border: none;
  padding: 11px 18px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
}

.btn-primary:hover { background: var(--brand-red-dark); }

.btn-secondary {
  background: var(--pastel-blue);
  color: var(--brand-navy);
  border: 1px solid #C8DEF7;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  max-width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-navy);
  background: #FFFFFF;
  outline: none;
  box-sizing: border-box;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--brand-navy);
}

.chip-select-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.select-chip {
  background: var(--bg-warm);
  border: 1px solid var(--border-light);
  color: var(--text-navy);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.select-chip.active {
  background: var(--brand-navy);
  color: #FFFFFF;
  border-color: var(--brand-navy);
}

/* Modale */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  background: rgba(27, 42, 74, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  box-sizing: border-box;
}

.modal-content {
  background: #FFFFFF;
  max-width: min(540px, calc(100vw - 28px));
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  position: relative;
  box-shadow: var(--shadow-lg);
  box-sizing: border-box;
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: #F1EFE9;
  border: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

/* Toast */
.toast-msg {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 16px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-navy);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  z-index: 300;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  max-width: 90vw;
}

.tab-pane { display: none; width: 100%; }
.tab-pane.active { display: block; }
