:root {
  --brand: #2f6fed;
  --bg: #f7f8fb;
  --card-bg: #ffffff;
  --border: #e2e5ec;
  --text: #1c2233;
  --text-muted: #6b7280;
  --danger: #d64545;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  /* Clears the fixed .bottom-nav on mobile so page content never sits behind it;
     reset to 0 once .bottom-nav itself is hidden (see the 700px breakpoint below). */
  padding-bottom: 4rem;
}

.app-content { padding-bottom: 0.5rem; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}
.app-header h1 { margin: 0; font-size: 1.4rem; color: var(--brand); }
.header-actions { display: flex; align-items: center; gap: 0.75rem; }

.lang-switch { display: flex; gap: 0.35rem; }
.lang-link {
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
}
.lang-link.active { color: white; background: var(--brand); border-color: var(--brand); }
.centered-card .lang-switch { justify-content: center; margin-bottom: 1rem; }

/* Desktop tabs: hidden by default, shown at the 700px breakpoint (see bottom of file) —
   the mobile .bottom-nav below is the counterpart, shown by default and hidden there. */
.section-tabs {
  display: none;
  gap: 0.25rem;
  padding: 0 1.25rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}
.section-tab {
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
}
.section-tab.active { color: var(--brand); border-bottom-color: var(--brand); }

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 0.4rem 0;
  z-index: 10;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
}
.bottom-nav-icon { font-size: 1.3rem; }
.bottom-nav-item.active { color: var(--brand); }

button, .nav-btn {
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-size: 1rem;
  background: var(--brand);
  color: white;
}
.logout-btn { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.cancel-btn { background: var(--danger); }

#calendar-app { padding: 1rem; max-width: 900px; margin: 0 auto; }

.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.month-nav h2 { margin: 0; font-size: 1.15rem; }
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  text-decoration: none;
  font-size: 1.3rem;
}

.month-grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  table-layout: fixed;
}
.month-grid thead td {
  padding: 0.4rem 0;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}
.day-cell {
  position: relative;
  height: 3.2rem;
  vertical-align: top;
  border: 1px solid var(--border);
  padding: 0.25rem;
  cursor: pointer;
}
.day-cell:active { background: #eef1f8; }
.day-cell.other-month { color: #c3c8d4; }
.day-cell.today .day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--brand);
  color: white;
}
.day-number { font-size: 0.85rem; }
.day-family-dot {
  position: absolute;
  bottom: 0.3rem;
  right: 0.3rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

#book-panel:empty { margin: 0; }
.booking-form-card, .centered-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0;
}
.centered-card { max-width: 420px; margin: 3rem auto; text-align: center; }
.form-row { margin-bottom: 0.9rem; display: flex; flex-direction: column; gap: 0.3rem; }
.form-row label { font-size: 0.85rem; color: var(--text-muted); }
input, textarea {
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}
.form-error { color: var(--danger); font-weight: 600; }

.bookings-list { margin-top: 1.25rem; }
.bookings-list h2 { font-size: 1rem; color: var(--text-muted); }
.booking-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
.family-dot { width: 0.85rem; height: 0.85rem; border-radius: 50%; flex-shrink: 0; }
.booking-details { display: flex; flex-direction: column; flex: 1; gap: 0.15rem; }
.booking-family { font-weight: 600; }
.booking-dates { font-size: 0.85rem; color: var(--text-muted); }
.booking-note { font-size: 0.85rem; font-style: italic; color: var(--text-muted); }
.empty-state { color: var(--text-muted); }

.memo-page, .checklist-page { padding: 1rem; max-width: 600px; margin: 0 auto; }
.memo-row {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  margin-bottom: 0.5rem;
}
.memo-row-label { display: flex; align-items: center; gap: 0.65rem; flex: 1; cursor: pointer; }
.memo-row-new { gap: 0.5rem; }
.memo-row-new input { flex: 1; margin: 0; }
.memo-remove-row {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 1.1rem;
  padding: 0 0.4rem;
  cursor: pointer;
}
#memo-add-row { background: transparent; color: var(--brand); border: 1px dashed var(--border); width: 100%; margin-bottom: 0.75rem; }
.memo-save-btn { width: 100%; }

.checklist-list { padding-left: 1.25rem; }
.checklist-list li { margin-bottom: 0.6rem; line-height: 1.4; }

/* From ~tablet width up, give the grid room to breathe and enlarge the day cells. */
@media (min-width: 700px) {
  .day-cell { height: 5rem; padding: 0.5rem; }
  .day-number { font-size: 1rem; }
  .month-nav h2 { font-size: 1.4rem; }

  /* Swap the mobile bottom bar for desktop top tabs — see the .section-tabs /
     .bottom-nav rule comment above for why both are always rendered. */
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .section-tabs { display: flex; }
}
