/* ========================================================
   CSS VARIABLES & RESET
======================================================== */
:root {
  --font: 'Nunito', sans-serif;
  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --surface2: #F0F2FF;
  --border: #E8EAF2;
  --text: #1A1D2E;
  --text2: #5A5F7A;
  --text3: #9BA2C0;
  /* HET accenttoken. Elk thema zet --accent; al het interactieve chroom
     (checkboxes, actieve tabs en pills, +knoppen, actieve iconen) verwijst
     hiernaar, rechtstreeks of via --primary, dat er een alias van is.
     Kleuren die GEEN accent zijn blijven eraf: categorie- en ledenkleuren
     zijn inhoud, success/warning/danger zijn betekenis. */
  --accent: #5C6EF8;
  --primary: var(--accent);
  --primary-light: #EEF0FF;
  --success: #22C55E;
  --success-light: #DCFCE7;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --col-highlight: rgba(92, 110, 248, 0.2);
  --primary-shadow: rgba(92, 110, 248, .35);
  --warning-text: #92400E;
  --success-text: #15803D;
  --streak-from: #FF6B35;
  --streak-to: #F7931E;
  --streak-shadow: rgba(255, 107, 53, .25);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-height: 50px;
  --header-height: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 8px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* Theme overrides loaded from separate CSS files:
   - theme-dark.css: Dark mode (auto + explicit)
   - theme-slimhuishouden.css: Slim Huishouden brand theme
*/

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; touch-action: pan-x pan-y; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font); }

/* ========================================================
   UTILITIES
   Gedeelde bouwstenen die eerder als inline style op meerdere
   plekken herhaald werden. Gebruik deze in plaats van nieuwe
   inline styles, zodat de opmaak op een plek beheerd wordt.
======================================================== */

/* Tonen/verbergen via classList in plaats van element.style.display */
.hidden { display: none !important; }

/* Flex-hulpjes. Bewust gescheiden: min-width:0 laat een flex-item
   krimpen tot onder zijn inhoud, wat je lang niet altijd wilt. */
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }

/* Knop over de volle breedte. flex:none is nodig omdat .btn zelf
   flex:1 heeft binnen een .btn-group. */
.btn-full {
  width: 100%;
  flex: none;
}

/* Gedempte toelichtingstekst onder een veld of als lege-staat melding */
.hint-text {
  font-size: 12px;
  color: var(--text3);
}

/* Klein bijschrift onder een voortgangsbalk of statistiek */
.stat-caption {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
}

/* Neutrale variant van een sectiekop, voor secties die geen
   categoriekleur hebben (zie ook categoryTintStyle() in helpers.js).
   Dubbele class voor genoeg specificiteit boven .category-header.

   De :active-variant staat er bewust bij. Deze regels vervingen een inline
   style, en een inline style won ook van .category-header:active (die verderop
   staat en dezelfde specificiteit heeft). Zonder deze tweede selector zouden
   deze koppen ineens een indruk-effect krijgen dat ze eerder niet hadden. */
.category-header.category-header-neutral,
.category-header.category-header-neutral:active {
  background: var(--surface2);
  border-color: var(--border);
}

/* ========================================================
   INLOGSCHERM
   Dekt de hele app af zolang er geen sessie is.
======================================================== */
#auth-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-logo {
  font-size: 44px;
  text-align: center;
  line-height: 1;
}

.auth-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}

.auth-sub {
  font-size: 14px;
  color: var(--text2);
  text-align: center;
  margin-top: -8px;
  margin-bottom: 4px;
}

.auth-melding {
  font-size: 13px;
  line-height: 1.4;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.auth-melding.fout {
  background: var(--danger-light);
  color: var(--danger);
}
.auth-melding.info {
  background: var(--primary-light);
  color: var(--primary);
}

.auth-wissel {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  padding: 8px;
  text-align: center;
}

/* ========================================================
   APP LAYOUT
======================================================== */
#app {
  display: flex;
  flex-direction: column;
  /* Vast aan de viewport, niet 100dvh in de documentstroom. Op iOS kon het
     document verschuiven (adresbalk, toetsenbord, statusbalk in PWA-modus),
     waardoor de app als geheel omhoog stond: bovenin afgesneden en onder de
     navigatie een lege strook. Met position:fixed op de viewport kan dat
     structureel niet meer; de hoogte volgt uit inset:0. */
  position: fixed;
  inset: 0;
  max-width: var(--app-max-width, 430px);
  margin: 0 auto;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
}

#app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  /* PWA-modus laat de content onder de statusbalk/Dynamic Island doorlopen
     (viewport-fit=cover + black-translucent). Zonder deze ruimte valt de
     bovenkant van de header achter de statusbalk weg. In gewone Safari is de
     inset 0 en verandert er niets. */
  padding-top: var(--safe-top);
}

.header-week {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 210px;
  margin: 0 auto;
  min-height: 36px;
  padding: 0;
  position: relative;
}
.header-week .today-btn {
  position: absolute;
  right: calc(100% + 8px);
}
.header-week .week-info {
  flex: 1;
  text-align: center;
}
.header-week .week-label {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
}
.header-week .week-dates {
  font-size: 12px;
  color: var(--text3);
  margin-left: 4px;
}

.today-btn {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.today-btn:active { opacity: .7; }
.today-btn.hidden { display: none; }

.dev-refresh-btn {
  font-size: 16px;
  color: var(--text3);
  padding: 4px 8px;
  border-radius: 8px;
  opacity: .5;
}
.dev-refresh-btn:active { opacity: 1; }

.header-simple {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
}

#app-header .header-title {
  flex: 1;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}


.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: transform .1s, background .1s;
}
.icon-btn:active { transform: scale(.92); background: var(--border); }

#main-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-content {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
}
.tab-content.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* ========================================================
   BOTTOM NAVIGATION
======================================================== */
#bottom-nav {
  height: calc(var(--nav-height) + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 8px 12px var(--safe-bottom);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
body.keyboard-open #bottom-nav {
  display: none;
}

.nav-item {
  flex: 1;
  /* Zonder min-width:0 weigert een flex-item te krimpen tot onder zijn inhoud
     en loopt een lang label over de rand in plaats van afgekapt te worden. */
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  transition: transform .1s;
}
.nav-item:active { transform: scale(.9); }

.nav-icon {
  width: 40px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: 10px;
  transition: background .2s;
}

.nav-item.active .nav-icon {
  background: var(--primary-light);
}
.nav-item.active .nav-cal-icon {
  background: none;
}

/* SVG nav icons */
.nav-svg-icon {
  color: var(--text3);
  transition: color .2s, background .2s;
}
.nav-svg-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}
.nav-item.active .nav-svg-icon {
  color: var(--primary);
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  transition: color .2s;
  /* Sinds de vakantiemodule staan er zes knoppen in plaats van vijf. Op een
     iPhone SE (375px, het minimum uit CLAUDE.md) is dat krap voor een lang
     label als "Instellingen". Niet afbreken naar twee regels, want dan wordt
     de hele balk hoger en verspringt de layout; liever afkappen. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Op smalle schermen wat compacter, zodat alle zes labels heel blijven */
@media (max-width: 420px) {
  #bottom-nav { padding-left: 4px; padding-right: 4px; }
  .nav-label { font-size: 10px; letter-spacing: -.2px; }
  .nav-icon { width: 34px; }
}
.nav-item.active .nav-label { color: var(--primary); }

/* Calendar icon with dynamic date */
.nav-cal-icon {
  position: relative;
  width: 40px;
  height: 28px;
  font-size: 20px !important;
}
.nav-cal-icon::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border: 2px solid var(--text3);
  border-radius: 4px;
  background: var(--surface);
}
.nav-cal-icon::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 7px;
  background: var(--text3);
  border-radius: 4px 4px 0 0;
}
.nav-item.active .nav-cal-icon::before {
  border-color: var(--primary);
}
.nav-item.active .nav-cal-icon::after {
  background: var(--primary);
}
.nav-cal-day {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 900;
  color: var(--text3);
  line-height: 1;
  margin-top: 4px;
}
.nav-item.active .nav-cal-day {
  color: var(--primary);
}

/* ========================================================
   WEEK VIEW
======================================================== */
.week-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  transition: background .1s, transform .1s;
}
.week-nav-btn:active { transform: scale(.9); background: var(--border); }

.week-progress-wrap {
  height: 3px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.week-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}

/* Week view layout: locked top + scrollable content */
#week-view {
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
  padding-bottom: 0;
}
.week-view-locked {
  flex-shrink: 0;
  background: var(--bg);
}
.week-view-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Day tabs */
#day-tabs {
  display: flex;
  padding: 10px 12px 6px;
  gap: 6px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
#day-tabs::-webkit-scrollbar { display: none; }

.day-tab {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all .15s;
  min-width: 46px;
}

.day-tab:active { transform: scale(.93); }

.day-tab-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
}

.day-tab-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--text2);
  line-height: 1;
}

.day-tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.day-tab.active {
  background: var(--primary);
}
.day-tab.active .day-tab-label,
.day-tab.active .day-tab-num { color: white; }
.day-tab.active .day-tab-dot { background: rgba(255,255,255,.5); }

.day-tab.has-tasks .day-tab-dot { background: var(--primary); }
.day-tab.all-done .day-tab-dot { background: var(--success); }
.day-tab.active.has-tasks .day-tab-dot { background: rgba(255,255,255,.8); }
.day-tab.today:not(.active) { background: var(--primary-light); }
.day-tab.today:not(.active) .day-tab-num { color: var(--primary); }

/* View mode toggle (Dag / Maand) */
.view-mode-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px 4px;
  background: var(--surface);
  position: relative;
}
.view-mode-toggle-wrap .dev-refresh-btn {
  position: absolute;
  right: 12px;
}
.view-mode-toggle {
  display: flex;
  position: relative;
  background: var(--bg);
  border-radius: 10px;
  padding: 3px;
  width: 210px;
}
.view-mode-btn {
  flex: 1;
  height: 32px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  background: none;
  z-index: 1;
  transition: color .2s;
  -webkit-tap-highlight-color: transparent;
}
.view-mode-btn.active { color: var(--primary); }
.view-mode-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(33.33% - 2px);
  height: 32px;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}

/* Month view */
.month-view-container {
}
#month-summary {
  background: var(--bg);
  padding: 8px 12px 0;
}
#month-summary .day-summary-row {
  position: static;
  padding: 2px 0 6px;
}
.month-header-scroll {
  background: var(--bg);
  overflow-x: hidden;
  padding: 0 12px;
}
.month-matrix-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 12px 80px;
}
.month-matrix-scroll::-webkit-scrollbar { display: none; }

.month-matrix-header {
  display: flex;
  align-items: center;
  padding: 4px 0;
  min-width: fit-content;
}
.month-matrix-task-col {
  min-width: 140px;
  max-width: 140px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .3px;
  padding: 0 8px;
}
.month-matrix-week-col {
  min-width: 38px;
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.month-week-num {
  font-size: 12px;
  font-weight: 800;
  color: var(--text2);
}
.month-week-dates {
  font-size: 10px;
  color: var(--text3);
}

.month-category-group { margin-bottom: 6px; }
.month-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 12px;
  background: var(--surface);
  border-radius: 10px;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  margin-bottom: 2px;
  position: relative;
  z-index: 3;
}
.month-category-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--border);
  color: var(--text3);
}

.month-task-row {
  display: flex;
  align-items: center;
  min-height: 34px;
  border-bottom: 1px solid var(--border);
  min-width: fit-content;
}
.month-task-row:last-child { border-bottom: none; }

.month-task-name {
  min-width: 140px;
  max-width: 140px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  padding: 4px 8px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.month-cell {
  min-width: 38px;
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text3);
  padding: 4px;
}
.month-cell.done { color: var(--success); font-weight: 800; }
.month-cell.pending { color: var(--warning); font-size: 10px; }
.month-cell.partial { color: var(--warning); font-size: 10px; font-weight: 700; }
/* Column highlight (current week in month, today in week) */
.month-matrix-week-col.current-week .month-week-num { color: var(--primary); font-weight: 800; }
.col-highlight-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1.5px solid var(--col-highlight);
  border-right: 1.5px solid var(--col-highlight);
  pointer-events: none;
  z-index: 2;
}
.col-highlight-overlay.with-top {
  border-top: 1.5px solid var(--col-highlight);
  border-radius: 6px 6px 0 0;
}
.col-highlight-overlay.with-bottom {
  border-bottom: 1.5px solid var(--col-highlight);
  border-radius: 0 0 6px 6px;
}
.col-highlight-spacer {
  height: 4px;
  min-width: fit-content;
}

/* Week matrix view */
.week-matrix-container {}
#week-matrix-summary {
  background: var(--bg);
  padding: 8px 12px 0;
}
#week-matrix-summary .day-summary-row {
  position: static;
  padding: 2px 0 6px;
}
.week-matrix-header-scroll {
  background: var(--bg);
  overflow-x: hidden;
  padding: 0 12px;
}
.week-matrix-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 12px 80px;
}
.week-matrix-scroll::-webkit-scrollbar { display: none; }

.week-matrix-header {
  display: flex;
  align-items: center;
  padding: 4px 0;
}
.week-matrix-task-col {
  width: 145px;
  min-width: 145px;
  max-width: 145px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .3px;
  padding: 0 8px;
}
.week-matrix-day-col {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.week-day-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text2);
}
.week-day-date {
  font-size: 10px;
  color: var(--text3);
}

.week-category-group { margin-bottom: 6px; }
.week-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 12px;
  background: var(--surface);
  border-radius: 10px;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  margin-bottom: 2px;
  position: relative;
  z-index: 3;
}
.week-category-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--border);
  color: var(--text3);
}

.week-task-row {
  display: flex;
  align-items: center;
  min-height: 34px;
  border-bottom: 1px solid var(--border);
}
.week-task-row:last-child { border-bottom: none; }

.week-task-name {
  width: 145px;
  min-width: 145px;
  max-width: 145px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  padding: 4px 8px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.week-task-name.clickable,
.month-task-name.clickable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.week-task-name.clickable:active,
.month-task-name.clickable:active {
  color: var(--primary);
}

.week-cell {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text3);
  padding: 4px;
}
.week-cell.done { color: var(--success); font-weight: 800; }
.week-cell.pending { color: var(--warning); font-size: 10px; }
.week-matrix-day-col.today .week-day-name { color: var(--primary); }

/* Task list */
.day-task-list {
  padding: 12px 16px 80px;
}

.day-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 0;
  padding: 6px 16px 10px;
  background: var(--bg);
}
#day-summary-wrap {
  background: var(--bg);
}

.day-summary-text {
  font-size: 13px;
  color: var(--text3);
  font-weight: 600;
}

.hide-done-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  min-height: 34px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all .15s;
}
.hide-done-toggle svg,
.fold-all-toggle svg {
  flex-shrink: 0;
  display: block;
}
.hide-done-toggle.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.hide-done-label {
  white-space: nowrap;
}

/* Category SVG icon */
.cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 1px;
}
.cat-icon svg {
  width: 100%;
  height: 100%;
}

/* Mini calendar icon for category headers */
.cat-cal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 1px;
}
.cat-cal-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--cat-cal-color, var(--text3));
  border-radius: 3px;
  background: var(--surface);
}
.cat-cal-icon::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--cat-cal-color, var(--text3));
  border-radius: 3px 3px 0 0;
}
.cat-cal-day {
  position: relative;
  z-index: 1;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  margin-top: 5px;
  color: var(--cat-cal-color, var(--text));
}

.summary-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.fold-all-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  min-height: 34px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all .15s;
}

/* Member filter button & popup */
.member-filter-btn {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 10px;
  min-height: 34px;
  border-radius: 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text3);
  cursor: pointer;
  transition: all .15s;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.member-filter-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.member-filter-badge {
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.member-filter-popup {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.05);
  z-index: 100;
  min-width: 200px;
  padding: 6px 0;
  animation: filterPopIn .15s ease-out;
}
@keyframes filterPopIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.member-filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background .1s;
  -webkit-tap-highlight-color: transparent;
}
.member-filter-option:active {
  background: var(--bg);
}
.member-filter-option-emoji { font-size: 20px; width: 24px; text-align: center; }
.member-filter-option-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.member-filter-option-check {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  transition: all .15s;
}
.member-filter-option.active .member-filter-option-check {
  background: var(--primary);
  border-color: var(--primary);
}
.member-filter-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.category-group {
  margin-bottom: 12px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background .15s;
}
.category-header:active {
  background: var(--bg);
}


.category-name {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.category-name svg { width: 16px; height: 16px; flex-shrink: 0; }

.category-count {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--border);
  color: var(--text3);
}
.category-count.all-done {
  background: var(--success);
  color: white;
}

.category-chevron {
  font-size: 14px;
  color: var(--text3);
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.category-tasks {
  padding-top: 6px;
}

/* Task picker */
.picker-new-btn-wrap {
  padding: 12px 20px 0;
}
.picker-new-btn {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  color: var(--primary);
  background: var(--primary-light);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, transform 0.1s;
}
.picker-new-btn:active {
  transform: scale(0.97);
  background: var(--primary);
  color: #fff;
}
.picker-new-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0 16px;
}
.picker-new-dates-row {
  display: flex;
  gap: 12px;
}

.picker-search-wrap {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 5;
}

.picker-list {
  padding: 12px 16px 8px;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.confirm-task-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.confirm-task-icon {
  font-size: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-task-icon .cat-icon { width: 28px; height: 28px; }

.confirm-task-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.confirm-task-cat {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

/* Task item */
.task-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: stretch;
}

.task-just-added {
  animation: highlight-fade 1.5s ease-out;
}
@keyframes highlight-fade {
  0%   { box-shadow: 0 0 0 3px var(--primary); }
  100% { box-shadow: var(--shadow-sm); }
}

/* task-item-color removed — color now on checkbox circle */

.task-item-body {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 12px 12px 12px 10px;
  gap: 10px;
  min-height: 52px;
}

.task-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid var(--accent);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  cursor: pointer;
}

.task-check.done {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.task-check:active { transform: scale(.85); }

.task-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.task-item.completed .task-name {
  color: var(--text3);
  text-decoration: line-through;
  text-decoration-color: var(--text3);
}

.task-item.completed { opacity: .75; }

.task-meta {
  font-size: 11px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-options-btn {
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  font-size: 18px;
  cursor: pointer;
  transition: color .1s;
}
.task-options-btn:active { color: var(--text2); }

/* Swipe actions background */
.task-swipe-bg {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0 16px;
  transition: opacity .2s;
  pointer-events: none;
  opacity: 0;
}
.task-swipe-bg.left { background: var(--success); justify-content: flex-end; }
.task-swipe-bg.right { background: var(--danger-light); justify-content: flex-start; }

.empty-day {
  text-align: center;
  padding: 48px 24px;
  color: var(--text3);
}
.empty-day-icon { font-size: 48px; margin-bottom: 12px; }
.empty-day-text { font-size: 15px; font-weight: 600; }
.empty-day-sub { font-size: 13px; margin-top: 4px; }

/* ============================================================
   CATCH-UP BLOCK (Inhaalblok)
   ============================================================ */
.catchup-block {
  background: var(--surface);
  border: 1px dashed var(--warning);
  border-radius: var(--radius-sm);
  margin: 0 0 12px 0;
  overflow: hidden;
}
.catchup-action-btn {
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  cursor: pointer;
  touch-action: manipulation;
  min-height: 38px;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.catchup-action-btn.select,
.catchup-action-btn.deselect {
  color: var(--text3);
  background: var(--surface2);
  border: 1px solid var(--border);
  flex: 0 0 100px;
  font-size: 12px;
}
.catchup-action-btn.skip {
  color: white;
  background: var(--warning);
  border: 1px solid var(--warning);
}
.catchup-action-btn.done {
  color: white;
  background: var(--success);
  border: 1px solid var(--success);
}
.catchup-tasks {
  padding: 4px 0 6px 0;
}
.catchup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  touch-action: manipulation;
}
.catchup-item:last-child {
  border-bottom: none;
}
.catchup-item.selected {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}
.catchup-item.selected .catchup-task-name {
  color: var(--primary);
  font-weight: 600;
}
.catchup-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 14px 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.catchup-task-actions {
  display: contents;
}
.catchup-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.catchup-task-name {
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catchup-day-badge {
  font-size: 11px;
  color: var(--text3);
  background: var(--surface2);
  padding: 1px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}
/* toggle-option alignment in task options sheet */
.option-item.toggle-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Quick add task — aligned with .task-item */
.quick-add-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 10px;
  min-height: 52px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  margin-bottom: 6px;
  transition: border-color 0.15s;
}
.quick-add-row:focus-within {
  border-color: var(--primary);
}
.quick-add-input {
  flex: 1;
  border: none;
  padding: 0;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  outline: none;
}
.quick-add-input::placeholder {
  color: var(--text3);
}
.quick-add-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 18px;
  font-weight: 400;
  font-family: var(--font);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}
.quick-add-btn:active {
  transform: scale(0.9);
}

/* Quick-add autocomplete dropdown */
.quick-add-wrap {
  position: relative;
}
.quick-add-suggestions {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 20;
}
.quick-add-suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  min-height: 44px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.quick-add-suggestion:last-child {
  border-bottom: none;
}
.quick-add-suggestion:active,
.quick-add-suggestion.highlighted {
  background: var(--primary-light);
}
.qa-sug-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}
.qa-sug-icon .cat-icon { width: 18px; height: 18px; }
.qa-sug-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qa-sug-cat {
  font-size: 11px;
  color: var(--text3);
  font-weight: 500;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .quick-add-suggestion {
    min-height: 54px;
  }
}

/* FAB */
/* Center add button in bottom nav */
.nav-add {
  flex: none !important;
  width: 62px;
  position: relative;
  align-self: center;
  padding: 0 !important;
  gap: 0 !important;
}
.nav-add-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  /* Lichte en donkere rand afgeleid van het accenttoken zelf, zodat de knop
     zijn diepte houdt zonder een tweede kleur te introduceren. */
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--accent) 78%, white) 0%,
    var(--accent) 60%,
    color-mix(in srgb, var(--accent) 82%, black) 100%);
  color: white;
  font-size: 30px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 6px 20px var(--primary-shadow),
    0 2px 6px var(--primary-shadow),
    inset 0 1px 1px rgba(255, 255, 255, .2);
  margin-top: -26px;
  transition: transform .15s cubic-bezier(.4,0,.2,1), box-shadow .15s;
  border: 3px solid var(--surface);
}
.nav-add:active .nav-add-icon {
  transform: scale(.92);
  box-shadow:
    0 3px 10px var(--primary-shadow),
    0 1px 3px var(--primary-shadow);
}

/* ========================================================
   TASKS VIEW
======================================================== */
.tasks-search-wrap {
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.search-input {
  width: 100%;
  height: 40px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  padding: 0 14px 0 40px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
  position: relative;
}
.search-input:focus { border-color: var(--primary); }

.search-wrap-inner {
  position: relative;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text3);
  pointer-events: none;
}

.tasks-list-section {
  padding: 12px 16px;
}

.tasks-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 10px;
}

.task-list-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: transform .1s;
  position: relative;
  overflow: hidden;
}
.task-list-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}
.task-list-item:active { transform: scale(.98); }

.task-list-item.task-disabled {
  opacity: .5;
}
.task-list-item.task-disabled .task-list-name {
  text-decoration: line-through;
}

.task-disabled-banner {
  background: var(--warning-light);
  color: var(--warning-text);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin: 0 0 12px;
}

.task-list-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}
.task-list-icon .cat-icon { width: 20px; height: 20px; }

.task-list-info { flex: 1; }
.task-list-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.task-list-cat {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  margin-bottom: 4px;
}

.schedule-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  margin-right: 4px;
  margin-bottom: 3px;
}
.schedule-badge.inactive {
  background: var(--bg);
  color: var(--text3);
}

.task-list-arrow {
  font-size: 18px;
  color: var(--text3);
  margin-top: 2px;
}

/* ========================================================
   STATS VIEW
======================================================== */
.stats-period-toggle-wrap {
  display: flex;
  justify-content: center;
  padding: 12px 16px 0;
}
.stats-period-toggle {
  position: relative;
  display: flex;
  background: var(--surface2);
  border-radius: 10px;
  padding: 2px;
  width: 210px;
}
.stats-period-btn {
  flex: 1;
  position: relative;
  z-index: 2;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  padding: 6px 0;
  cursor: pointer;
  transition: color .2s;
  border-radius: 8px;
}
.stats-period-btn.active {
  color: var(--primary);
}
.stats-period-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(33.33% - 2px);
  height: calc(100% - 4px);
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
  transition: transform .25s ease;
  z-index: 1;
}

.stats-hero {
  background: linear-gradient(135deg, var(--accent),
    color-mix(in srgb, var(--accent) 75%, black));
  margin: 12px 16px;
  border-radius: var(--radius);
  padding: 24px;
  color: white;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 4px 20px var(--primary-shadow);
}

.stats-ring-wrap {
  flex-shrink: 0;
  position: relative;
  width: 80px;
  height: 80px;
}

.stats-ring-svg {
  width: 80px;
  height: 80px;
  transform: rotate(-90deg);
}

.stats-ring-bg { fill: none; stroke: rgba(255,255,255,.25); stroke-width: 8; }
.stats-ring-fill { fill: none; stroke: white; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }

.stats-ring-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: white;
}

.stats-hero-info h2 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}
.stats-hero-info p {
  font-size: 13px;
  opacity: .8;
}
.stats-hero-nums {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}
.stats-num-item { }
.stats-num-val {
  font-size: 22px;
  font-weight: 900;
}
.stats-num-label {
  font-size: 11px;
  opacity: .75;
}

.stats-section {
  padding: 0 16px 4px;
}
.stats-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stats-section-title svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Streak card */
.stats-streak-card {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--streak-from), var(--streak-to));
  border-radius: var(--radius-sm);
  color: white;
  box-shadow: 0 2px 10px var(--streak-shadow);
}
.stats-streak-card.stats-streak-zero {
  background: var(--surface);
  color: var(--text2);
  box-shadow: var(--shadow-sm);
}
.stats-streak-flame {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--warning);
}
.stats-streak-flame svg { width: 24px; height: 24px; }
.stats-streak-zero .stats-streak-flame { color: var(--text3); }
.stats-streak-num {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}
.stats-streak-text {
  font-size: 14px;
  font-weight: 700;
}

/* Day productivity heatmap */
.stats-day-heatmap {
  display: flex;
  gap: 6px;
  padding: 12px 8px;
  justify-content: space-between;
}
.stats-day-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stats-day-bar {
  width: 100%;
  border-radius: 4px;
  min-height: 8px;
  transition: height .4s;
}
.stats-day-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
}
.stats-day-pct {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
}

/* Trend bars */
.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 60px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 12px 0;
  box-shadow: var(--shadow-sm);
}

.trend-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.trend-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--primary);
  opacity: .7;
  min-height: 3px;
  transition: height .4s;
}

.trend-bar-label {
  font-size: 9px;
  color: var(--text3);
  font-weight: 600;
}

.trend-bar-wrap.current .trend-bar { opacity: 1; background: var(--primary); }

/* Task performance cards */
.perf-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

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

.perf-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.perf-pct {
  font-size: 13px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
}

.perf-bar-bg {
  height: 5px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}

.perf-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .5s ease;
}

.overdue-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}
.overdue-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.overdue-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.overdue-when {
  font-size: 11px;
  font-weight: 600;
  color: var(--danger);
}

/* ========================================================
   FAMILY VIEW
======================================================== */
.family-section {
  padding: 0 16px 32px;
}
.family-hero-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0 12px;
}
.family-hero-compact-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--primary);
}
.family-hero-compact-icon svg { width: 24px; height: 24px; }
.family-hero-compact-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}
.family-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 20px 0 10px;
}
.family-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.family-feature-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.family-feature-card.active {
  cursor: pointer;
}
.family-feature-card.active:active {
  background: var(--surface2);
}
.family-feature-arrow {
  margin-left: auto;
  font-size: 20px;
  color: var(--text3);
  font-weight: 600;
}
.family-feature-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border-radius: 10px;
  color: var(--text2);
}
.family-feature-icon svg { width: 22px; height: 22px; }
.family-feature-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.family-feature-desc {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
  line-height: 1.4;
}

/* Wishlist */
.family-wishes {
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.family-wish-input-row {
  display: flex;
  align-items: center;
  padding: 8px 8px 8px 16px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.family-wish-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  padding: 8px 0;
}
.family-wish-input::placeholder {
  color: var(--text3);
}
.family-wish-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity .15s;
}
.family-wish-send:active {
  opacity: .7;
}
.family-wish-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border-bottom: 1px solid var(--border);
}
.family-wish-item:last-child {
  border-bottom: none;
}
.family-wish-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text3);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  transition: all .15s;
  padding: 0;
}
.family-wish-check.done {
  background: var(--success);
  border-color: var(--success);
  color: white;
}
.family-wish-text {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}
.family-wish-item.done .family-wish-text {
  text-decoration: line-through;
  color: var(--text3);
}
.family-wish-delete {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text3);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  transition: all .15s;
  padding: 0;
}
.family-wish-delete:active {
  background: var(--danger-light);
  color: var(--danger);
}
.family-wish-done-divider {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg);
}

/* ========================================================
   VACATION VIEW

   Gebouwd op de bestaande bouwstenen van de app, niet op
   eigen varianten:
     kaart      -> recept van .perf-card / .admin-card
     regel      -> recept van .task-item + .task-check
     toevoegen  -> recept van .quick-add-row
     tabbladen  -> recept van .view-mode-toggle
     keuzepil   -> recept van .tpd-chip
     balk       -> .perf-bar-bg / .perf-bar-fill (hergebruikt)
   Kleur zit alleen BINNEN de inhoud, nooit op een sectiekop.
======================================================== */
.vacation-section {
  padding: 0 16px 32px;
}

/* ---- Overzichtskaarten ---- */
.vac-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.vac-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.vac-card:active { background: var(--bg); }
.vac-card.archived { opacity: .6; }

.vac-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Zelfde vorm als .family-feature-icon, met de tint van de vakantie */
.vac-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  background: var(--primary-light);
  font-size: 20px;
  line-height: 1;
}

.vac-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vac-card-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Aftellen: standaard de neutrale badge van de app. Alleen wanneer het echt
   dringt krijgt hij kleur, net als de percentages in Prestaties. */
.vac-countdown {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  white-space: nowrap;
}
.vac-countdown.nu      { background: var(--warning-light); color: var(--warning-text); }
.vac-countdown.bezig   { background: var(--success-light); color: var(--success-text); }
.vac-countdown.voorbij { background: var(--border);        color: var(--text3); }

/* ---- Deelnemers ---- */
.vac-members {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}
.vac-member {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 2px solid var(--member-color, var(--border));
  font-size: 12px;
}
.vac-member-emoji { line-height: 1; }

/* ---- Voortgang: dezelfde regels als een prestatiekaart ---- */
.vac-bars {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vac-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vac-bar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  width: 60px;
  flex-shrink: 0;
}
.vac-bar-track {
  flex: 1;
  min-width: 0;
}
.vac-bar-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  width: 34px;
  text-align: right;
  flex-shrink: 0;
}

/* ---- Lege staat en archief ---- */
.vac-empty {
  text-align: center;
  padding: 32px 20px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin-top: 4px;
}
.vac-empty-icon { font-size: 34px; }
.vac-empty-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin: 8px 0 6px;
}
.vac-empty .hint-text { max-width: 300px; margin: 0 auto; }

.vac-archief-knop {
  display: block;
  margin: 16px auto 0;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}

/* ---- Werkscherm: volwaardige pagina, geen bottom sheet ---- */
.vac-werk-kop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0 12px;
}

.vac-terug {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  color: var(--text2);
  padding-bottom: 2px;
  -webkit-tap-highlight-color: transparent;
}
.vac-terug:active { background: var(--bg); }

/* Zoekveld met de oogknop ernaast (voltooide tonen of verbergen) */
.vac-zoekrij {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.vac-zoekrij .hide-done-toggle {
  flex-shrink: 0;
  min-height: 40px;
  min-width: 44px;
  justify-content: center;
  border-radius: 12px;
}

.vac-filterrij { margin-bottom: 10px; }

/* Melding in een categorie waarvan alles is ingepakt en verborgen */
.vac-alles-ingepakt {
  padding: 8px 12px 10px;
}
.vac-detail-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  background: var(--primary-light);
  font-size: 20px;
  line-height: 1;
}
.vac-detail-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vac-detail-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

/* ---- Tabbladen: het recept van .view-mode-toggle ---- */
.vac-tabs {
  display: flex;
  background: var(--bg);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 14px;
}
.vac-tab {
  flex: 1;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  cursor: pointer;
  transition: background .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}
.vac-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.vac-tab-telling { font-weight: 800; opacity: .7; }

.vac-tab-inhoud { min-height: 160px; }

/* ---- Categoriekeuze: het recept van .tpd-chip ---- */
.vac-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.vac-chip {
  padding: 6px 12px;
  border-radius: 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.vac-chip.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.vac-chip:active { transform: scale(.94); }

/* ---- Toevoegen: het recept van .quick-add-row ---- */
.vac-add-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  min-height: 52px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  margin-bottom: 14px;
  transition: border-color .15s;
}
.vac-add-row:focus-within { border-color: var(--primary); }
.vac-add-input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 0;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  outline: none;
}
.vac-add-input::placeholder { color: var(--text3); }
.vac-add-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  font-family: var(--font);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .1s;
}
.vac-add-btn:active { transform: scale(.9); }

.vac-leeg { text-align: center; padding: 18px 12px; }

/* ---- Regels: het recept van .task-item ---- */
.vac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 12px 12px;
  min-height: 52px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin-bottom: 6px;
}
.vac-item.done { opacity: .55; }
.vac-item.done .vac-item-name { text-decoration: line-through; }

.vac-check {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: transparent;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
  -webkit-tap-highlight-color: transparent;
}
.vac-check.done {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.vac-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.vac-qty { font-size: 12px; font-weight: 800; color: var(--text3); }

.vac-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text3);
}
.vac-item-member {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  background: var(--surface2);
  border-radius: 20px;
  padding: 1px 7px;
  border: 1px solid var(--member-color, var(--border));
}
.vac-deadline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
}
.vac-deadline.telaat { color: var(--danger); }
.vac-vast { font-size: 10px; }

.vac-item-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text3);
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
  font-family: var(--font);
}
.vac-item-btn:active { background: var(--bg); }

/* Aantal open regelzaken dat te laat is: kleur in de inhoud, niet op de kop */
.category-count.vac-telaat {
  background: var(--danger);
  color: #fff;
}

/* ---- Kiezers in het vakantieformulier ---- */
.vac-icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.vac-icon-option {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.vac-icon-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
/* ========================================================
   VAKANTIEBLOK IN DE DAGPLANNING

   Eigen klassen voor de regels, want .task-check en
   .task-options-btn worden in week-view.js document-breed
   gebonden aan handlers die hun taak in state.weekTasks
   opzoeken. De KOP volgt wel gewoon .category-header, zodat
   hij niet afwijkt van de categorieblokken eromheen.
======================================================== */
.vac-day-block { margin-bottom: 12px; }

.vac-day-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vac-day-title svg { width: 16px; height: 16px; flex-shrink: 0; }

.vac-day-tasks { padding-top: 6px; }

.vac-day-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 10px;
  min-height: 52px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin-bottom: 6px;
}
.vac-day-item.done { opacity: .55; }
.vac-day-item.done .vac-day-name { text-decoration: line-through; }

.vac-day-check {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: transparent;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
  -webkit-tap-highlight-color: transparent;
}
.vac-day-check.done {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.vac-day-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.vac-day-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text3);
}
.vac-day-badge {
  font-weight: 700;
  background: var(--surface2);
  border-radius: 20px;
  padding: 1px 8px;
}
.vac-day-telaat {
  font-weight: 800;
  color: var(--danger);
}

/* ========================================================
   ADMIN VIEW
======================================================== */
/* Admin panel */
.admin-section {
  padding: 16px;
}

.admin-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3);
  margin-bottom: 10px;
}

.admin-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.admin-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.admin-row:last-child { border-bottom: none; }
.admin-row:active { background: var(--bg); }

.admin-row-icon {
  font-size: 22px;
  width: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-row-icon .cat-icon { width: 22px; height: 22px; }

.admin-row-text { flex: 1; }
.admin-row-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.admin-row-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 1px;
}
.admin-row-arrow {
  font-size: 18px;
  color: var(--text3);
}

.admin-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

/* Regel die alleen informatie toont en dus niet aanklikbaar is */
.admin-row-static { cursor: default; }
.admin-row-static:active { background: transparent; }

.admin-row-danger .admin-row-label { color: var(--danger); }

/* Melding in plaats van een lijst, bv. wanneer beheerrechten ontbreken */
.admin-empty {
  padding: 28px 24px;
  text-align: center;
}
.admin-empty-icon { font-size: 34px; }
.admin-empty-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 8px 0 6px;
}
.admin-empty .hint-text { max-width: 320px; margin: 0 auto; }

/* ---- Category drag & drop ---- */
.cat-drag-list {
  padding: 0;
  position: relative;
}
.cat-drag-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transition: box-shadow .15s, opacity .15s;
  user-select: none;
  -webkit-user-select: none;
}
.cat-drag-row:last-child { border-bottom: none; }
.cat-drag-handle {
  font-size: 20px;
  color: var(--text3);
  cursor: grab;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  touch-action: none;
}
.cat-drag-handle:active { cursor: grabbing; }
.cat-drag-row .admin-row-text { flex: 1; cursor: pointer; }
.cat-drag-row .admin-row-arrow { cursor: pointer; font-size: 18px; color: var(--text3); }
.cat-dragging {
  opacity: 0.4;
}
.cat-touch-dragging {
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  opacity: 0.95;
}
.cat-drag-placeholder {
  background: var(--primary-light);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-sm);
  margin: 2px 0;
}

/* ---- Family member manager ---- */
.member-input-row {
  display: flex;
  align-items: center;
  padding: 8px 8px 8px 16px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.member-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  padding: 8px 0;
}
.member-input::placeholder { color: var(--text3); }

.member-list { padding: 0; }
.member-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.member-row:last-child { border-bottom: none; }
.member-row:active { background: var(--bg); }

.member-avatar {
  font-size: 28px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.member-name {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.member-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.member-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text3);
}

.member-editor-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 20px;
  justify-content: center;
}
.member-editor-avatar { font-size: 48px; }
.member-editor-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.emoji-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.emoji-swatch {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .1s;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--bg);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.emoji-swatch.selected {
  border-color: var(--primary);
  transform: scale(1.1);
  background: var(--primary-light);
}
.emoji-swatch:active { transform: scale(.9); }

.emoji-swatch.has-variants { position: relative; }
.emoji-swatch.has-variants::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 6px 6px;
  border-color: transparent transparent var(--text3) transparent;
}
.emoji-swatch.has-variants.selected::after {
  border-color: transparent transparent var(--primary) transparent;
}

.emoji-hint {
  font-size: 11px;
  color: var(--text3);
  margin-top: 6px;
}

.skin-tone-popup {
  position: fixed;
  display: flex;
  gap: 2px;
  background: var(--surface);
  border-radius: 24px;
  padding: 6px;
  box-shadow: 0 4px 24px rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.05);
  z-index: 300;
  transform: translateX(-50%) translateY(-100%);
  animation: skinToneIn .2s ease-out;
}
.skin-tone-popup.below {
  transform: translateX(-50%);
  animation: skinToneInBelow .2s ease-out;
}
.skin-tone-popup::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-style: solid;
  border-width: 6px 6px 0 6px;
  border-color: var(--surface) transparent transparent transparent;
}
.skin-tone-popup.below::after {
  bottom: auto;
  top: -6px;
  border-width: 0 6px 6px 6px;
  border-color: transparent transparent var(--surface) transparent;
}

@keyframes skinToneIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-100%) scale(.8); }
  to { opacity: 1; transform: translateX(-50%) translateY(-100%) scale(1); }
}
@keyframes skinToneInBelow {
  from { opacity: 0; transform: translateX(-50%) scale(.8); }
  to { opacity: 1; transform: translateX(-50%) scale(1); }
}

.skin-tone-option {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform .1s, background .1s;
  -webkit-tap-highlight-color: transparent;
}
.skin-tone-option:active {
  transform: scale(.85);
  background: var(--bg);
}

/* ---- Member assignment chips ---- */
.member-assign-section {
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border);
}
.member-assign-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.member-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.member-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 8px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.member-chip.selected {
  border-color: var(--member-color, var(--primary));
  background: color-mix(in srgb, var(--member-color, var(--primary)) 12%, transparent);
}
.member-chip:active { transform: scale(.93); }
.member-chip-emoji {
  font-size: 18px;
  line-height: 1;
}
.member-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
}
.member-chip.selected .member-chip-name {
  color: var(--text);
}

/* Task assignee avatars (inline on task card) */
.task-assignees {
  display: inline-flex;
  gap: 2px;
  margin-left: 6px;
  vertical-align: middle;
}
.task-assignee {
  font-size: 14px;
  line-height: 1;
}

/* ---- Schedule save choice overlay ---- */
.sched-save-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  align-items: flex-end;
  justify-content: center;
  z-index: 210;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
}
.sched-save-choice-panel {
  width: 100%;
  max-width: var(--app-max-width, 430px);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.sched-save-choice-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  padding: 16px 16px 8px;
}
.sched-save-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  transition: background .1s;
}
.sched-save-option:active { background: var(--bg); }
.sched-save-option-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.sched-save-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sched-save-option-text strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.sched-save-option-text span {
  font-size: 12px;
  color: var(--text3);
}
.sched-save-cancel {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text3);
  text-align: center;
}
.sched-save-cancel:active { background: var(--bg); }

/* ========================================================
   BOTTOM SHEET
======================================================== */
#sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
#sheet-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

#bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: var(--app-max-width, 430px);
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  z-index: 201;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  padding-bottom: calc(16px + var(--safe-bottom));
}
#bottom-sheet.open {
  transform: translateX(-50%) translateY(0);
}

.sheet-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  cursor: grab;
  touch-action: none;
}
.sheet-handle::before {
  content: '';
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

.sheet-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sheet-body {
  padding: 20px;
}

/* Form fields */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3);
  margin-bottom: 6px;
  display: block;
}

.form-input {
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.form-input:focus { border-color: var(--primary); background: var(--surface); }

.form-select {
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.form-select:focus { border-color: var(--primary); }

.days-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.day-chip {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
}
.day-chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.day-chip:active { transform: scale(.9); }
.day-chip.mini {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

/* Times-per-day picker */
.times-per-day-picker {
  display: flex;
  gap: 6px;
}
.tpd-chip {
  padding: 6px 14px;
  border-radius: 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  transition: all .15s;
}
.tpd-chip.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.tpd-chip:active { transform: scale(.9); }

/* Advanced schedule section */
.sched-advanced-section {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
}

/* Roster editor */
.roster-day-picker {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.roster-occurrences {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.roster-occurrence {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.roster-occurrence.roster-single {
  background: transparent;
  padding: 0;
}
.roster-occ-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
}
.roster-members {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Occurrence label on task items */
.task-occ-label {
  font-size: 11px;
  color: var(--text3);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 6px;
  font-weight: 500;
  white-space: nowrap;
}

/* Multi-occurrence task item grouping */
.task-item.multi-occurrence {
  border-left: 2.5px solid var(--cat-color, var(--border));
}

/* Week matrix multi-occurrence cell */
.week-cell.multi {
  font-size: 10px;
  font-weight: 700;
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  flex: 1;
  height: 50px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform .1s, opacity .1s;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:active { transform: scale(.97); opacity: .9; }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px var(--primary-shadow);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text2);
  border: 1.5px solid var(--border);
}

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: none;
}

.btn-success {
  background: var(--success-light);
  color: var(--success-text);
}

/* Options menu */
.options-list {
  padding: 8px 0;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background .1s;
}
.option-item:active { background: var(--bg); }

.option-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text2);
}

.option-text { flex: 1; }
.option-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.option-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 1px;
}

.option-item.danger .option-icon { color: var(--danger); }
.option-item.danger .option-label { color: var(--danger); }

/* Toggle */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.toggle-label-group { }
.toggle-main { font-size: 15px; font-weight: 600; color: var(--text); }
.toggle-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }

.toggle-switch {
  width: 50px;
  height: 28px;
  border-radius: 14px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle-switch.on { background: var(--primary); }
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
  transition: transform .2s;
}
.toggle-switch.on::after { transform: translateX(22px); }

/* Toast */
#toast {
  position: fixed;
  bottom: calc(var(--kb-offset, 0px) + var(--nav-height) + var(--safe-bottom) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: white;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  transition: all .3s;
  white-space: nowrap;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.toast-action {
  background: rgba(255,255,255,.25);
  color: white;
  border: none;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* Loading */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Schedule info pill */
.freq-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}

/* Color picker */
/* Icon picker grid */
.icon-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.icon-swatch {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .1s, background .1s;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  color: var(--text2);
  background: var(--bg);
}
.icon-swatch svg { width: 100%; height: 100%; }
.icon-swatch.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.icon-swatch:active { transform: scale(.9); }

.color-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform .1s;
  border: 2px solid transparent;
}
.color-swatch.selected { border-color: var(--text); transform: scale(1.15); }
.color-swatch:active { transform: scale(.9); }

/* Schedule list item */
.schedule-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.schedule-item-task {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.schedule-item-detail {
  font-size: 12px;
  color: var(--text3);
}
.schedule-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.schedule-action-btn {
  min-width: 40px;
  min-height: 40px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity .1s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.schedule-action-btn svg { width: 18px; height: 18px; }
.schedule-action-btn:active { opacity: .7; }

/* Unified task editor: side-by-side layout */
.form-row {
  display: flex;
  gap: 12px;
}
.form-group-flex { flex: 1; }
.form-group-small { width: 90px; flex-shrink: 0; }

/* Unified task editor: sections */
.unified-schedules-header {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-bottom: 10px;
}
.unified-actions-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Schedule card */
.schedule-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.schedule-card-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.schedule-card-info { flex: 1; min-width: 0; }
.schedule-card-freq {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.schedule-card-days {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}
.schedule-card-dates {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}
.schedule-card-assign {
  display: inline-flex;
  gap: 2px;
  vertical-align: middle;
}
.sched-assign-mode-toggle {
  margin-top: 10px;
}
.schedule-card-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* Inline schedule form */
.schedule-card-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.inline-sched-form {
  overflow: hidden;
  min-width: 0;
}
#sched-form-new {
  margin-top: 8px;
}
#sched-form-new:not(:empty) {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1px solid var(--border);
}

/* Date fields side-by-side */
.form-row-dates {
  display: flex;
  gap: 10px;
  width: 100%;
  overflow: hidden;
}
.form-row-dates .form-group {
  flex: 1 1 0;
  min-width: 0;
  max-width: calc(50% - 5px);
}
.form-row-dates .form-input[type="date"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 0 6px;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}

/* Inline save choice */
.sched-save-choice-inline {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.sched-save-choice-inline .sched-save-choice-title {
  padding: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
}
.sched-save-choice-inline .btn-group {
  margin-top: 8px;
}

/* Section in tasks management */
.section-sticky {
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 8px 16px 4px;
  z-index: 4;
}

.chip-filter {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.chip-filter::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface);
  color: var(--text2);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all .15s;
}
.chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.chip:active { transform: scale(.93); }

/* Schedule overview in tasks tab */
.task-schedule-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

/* ========================================================
   THEME SELECTOR
======================================================== */
.public-settings-section {
  padding: 16px;
}
.settings-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3);
  margin-bottom: 12px;
}
.theme-selector {
  display: flex;
  gap: 12px;
}
.theme-card {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: border-color .2s, transform .1s;
  background: var(--surface);
}
.theme-card:active { transform: scale(.97); }
.theme-card.active {
  border-color: var(--primary);
}
.theme-preview {
  height: 52px;
  position: relative;
  overflow: hidden;
}
.theme-preview-bar {
  height: 14px;
}
.theme-preview-dots {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  justify-content: center;
}
.theme-preview-dots span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}
.theme-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}
.theme-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.theme-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ========================================================
   DYNAMIC CSS ANIMATIONS (from JS)
======================================================== */
@keyframes shake {
  0%,100%{transform:translateX(0)}
  20%{transform:translateX(-10px)}
  40%{transform:translateX(10px)}
  60%{transform:translateX(-8px)}
  80%{transform:translateX(8px)}
}

/* ========================================================
   TABLET (min-width 768px)
======================================================== */
@media (min-width: 768px) {
  :root {
    --app-max-width: 100%;
    --header-height: 56px;
    --nav-height: 64px;
  }

  /* Remove phone-frame shadow on tablet */
  #app {
    box-shadow: none;
  }

  /* Header - compact */
  #app-header {
    padding: 0 16px;
  }
  #app-header .header-title {
    font-size: 18px;
  }
  .week-nav-btn {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .week-label {
    font-size: 15px;
  }
  .week-dates {
    font-size: 12px;
  }

  /* Bottom nav - compact */
  #bottom-nav {
    padding: 0 20px var(--safe-bottom);
  }
  .nav-icon {
    width: 40px;
    height: 28px;
    font-size: 20px;
    border-radius: 10px;
  }
  .nav-cal-icon::before { width: 22px; height: 22px; }
  .nav-cal-icon::after { width: 22px; height: 7px; }
  .nav-cal-day { font-size: 11px; margin-top: 4px; }
  .nav-label {
    font-size: 11px;
  }

  /* View mode toggle - compact */
  .view-mode-toggle { width: 220px; }
  .header-week { width: 220px; }
  .view-mode-btn { height: 30px; font-size: 13px; }
  .view-mode-slider { height: 30px; }

  /* Month matrix - tablet */
  .month-matrix-task-col, .month-task-name { min-width: 160px; max-width: 160px; font-size: 12px; }

  /* Week matrix - tablet */
  .week-matrix-task-col, .week-task-name { min-width: 160px; max-width: 160px; font-size: 12px; }
  .week-matrix-day-col, .week-cell { min-width: 40px; }
  .month-matrix-week-col, .month-cell { min-width: 40px; }
  .month-cell { font-size: 13px; }
  .month-week-num { font-size: 11px; }
  .month-task-name { white-space: normal; }
  .month-category-header { min-height: 38px; padding: 6px 12px; }
  .week-category-header { min-height: 38px; }

  /* Today button - tablet */
  .today-btn { font-size: 13px; height: 30px; padding: 0 12px; }

  /* Day tabs - compact */
  #day-tabs {
    padding: 4px 16px 2px;
    gap: 4px;
    justify-content: center;
  }
  .day-tab {
    min-width: 42px;
    aspect-ratio: 1;
    padding: 2px;
    justify-content: center;
  }
  .day-tab-label {
    font-size: 10px;
  }
  .day-tab-num {
    font-size: 15px;
  }
  .day-tab-dot {
    width: 4px;
    height: 4px;
  }

  /* Day task list */
  .day-task-list {
    padding: 4px 16px 10px;
  }

  /* Summary row */
  .day-summary-row {
    padding: 4px 16px 4px;
  }
  .day-summary-text {
    font-size: 12px;
  }
  .hide-done-toggle, .fold-all-toggle {
    padding: 3px 8px;
    font-size: 11px;
  }

  /* Category tiles */
  .category-header {
    min-height: 40px;
    padding: 10px 12px;
    border-radius: 8px;
    gap: 8px;
  }
  .category-name {
    font-size: 13px;
  }
  .category-count {
    font-size: 11px;
    padding: 1px 6px;
  }
  .category-chevron {
    font-size: 12px;
    width: 16px;
  }
  .category-group {
    margin-bottom: 4px;
  }

  /* Task items - compact */
  .task-item {
    min-height: 32px;
    padding: 2px 6px 2px 0;
    margin-bottom: 2px;
    border-radius: 8px;
    box-shadow: none;
  }
  .task-item-body {
    min-height: 36px;
    padding: 6px 10px 6px 8px;
    gap: 8px;
  }
  .task-check {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 11px;
  }
  .task-name {
    font-size: 13px;
  }
  .task-meta {
    font-size: 10px;
  }
  .task-options-btn {
    font-size: 16px;
    width: 28px;
  }

  /* Task list items (takenbeheer) - compact */
  .task-list-item {
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 10px;
  }
  .task-list-icon {
    font-size: 18px;
  }
  .task-list-name {
    font-size: 14px;
  }
  .task-list-arrow {
    font-size: 18px;
  }

  /* Search */
  .tasks-search-wrap {
    padding: 10px 16px;
  }
  .search-input {
    height: 40px;
    font-size: 14px;
    border-radius: 10px;
  }

  /* Bottom sheet */
  #bottom-sheet {
    max-width: 480px;
    border-radius: 20px 20px 0 0;
  }
  .sheet-title {
    font-size: 17px;
    padding: 16px 20px 10px;
  }
  .sheet-body {
    padding: 16px 20px;
  }

  /* Forms */
  .form-label {
    font-size: 13px;
  }
  .form-input, .form-select {
    height: 42px;
    font-size: 15px;
    border-radius: 10px;
  }
  .form-group-small { width: 110px; }
  .btn {
    height: 44px;
    font-size: 15px;
    border-radius: 10px;
  }

  /* Task picker */
  .picker-search-wrap {
    padding: 10px 16px;
  }
  .picker-list {
    padding: 10px 16px 10px;
  }
  .confirm-task-preview {
    padding: 12px 16px;
    gap: 12px;
    border-radius: 10px;
  }
  .confirm-task-icon {
    font-size: 28px;
  }
  .confirm-task-name {
    font-size: 16px;
  }
  .confirm-task-cat {
    font-size: 12px;
  }

  /* Day chips in confirm sheet */
  .day-chip {
    width: 40px;
    height: 40px;
    font-size: 13px;
  }
  .tpd-chip { padding: 7px 16px; font-size: 14px; }
  .task-occ-label { font-size: 12px; padding: 2px 8px; }
  .roster-occ-label { font-size: 13px; }

  /* Options sheet */
  .option-item {
    min-height: 44px;
    padding: 10px 14px;
  }
  .option-icon {
    font-size: 18px;
  }
  .option-label {
    font-size: 15px;
  }
  .option-sub {
    font-size: 12px;
  }

  /* Stats */
  .stats-section {
    padding: 14px 16px;
    border-radius: 12px;
  }

  /* Vakantie: zelfde schaalfactor als de rest, ruimere touch targets */
  .vac-card-icon,
  .vac-detail-icon { width: 48px; height: 48px; font-size: 24px; }
  .vac-terug { width: 42px; height: 42px; font-size: 24px; }
  .vac-card-name { font-size: 17px; }
  .vac-card-sub  { font-size: 13px; }
  .vac-detail-name { font-size: 19px; }
  .vac-tab { height: 40px; font-size: 14px; }
  .vac-add-row,
  .vac-item,
  .vac-day-item { min-height: 60px; }
  .vac-check,
  .vac-day-check { width: 30px; height: 30px; font-size: 16px; }
  .vac-add-btn { width: 34px; height: 34px; font-size: 20px; }
  .vac-item-name,
  .vac-day-name { font-size: 15px; }
  .vac-item-btn { width: 40px; height: 40px; }
  .vac-icon-option { width: 54px; height: 54px; font-size: 26px; }
  .vac-chip { padding: 8px 14px; font-size: 13px; }

  /* Admin */
  .admin-section {
    padding: 16px;
  }

  /* Schedule badges */
  .schedule-badge {
    font-size: 11px;
    padding: 2px 8px;
  }

  /* Toast */
  #toast {
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 10px;
    max-width: 480px;
  }

  /* Empty state */
  .empty-day-icon { font-size: 44px; }
  .empty-day-text { font-size: 15px; }
  .empty-day-sub { font-size: 13px; }

  /* Catch-up block */
  .catchup-block { margin: 0 0 16px 0; }
  .catchup-task-name { font-size: 15px; }

  /* Week progress bar */
  .week-progress-wrap {
    height: 4px;
  }
}

/* ========================================================
   TABLET LANDSCAPE
======================================================== */
@media (min-width: 768px) and (orientation: landscape) {
  :root {
    --header-height: 52px;
    --nav-height: 56px;
  }

  /* In landscape, use horizontal space more efficiently */
  #day-tabs {
    justify-content: center;
    gap: 8px;
    padding: 6px 16px 4px;
  }
  .day-tab {
    min-width: 46px;
    aspect-ratio: 1;
  }

  /* Bottom sheet shorter in landscape */
  #bottom-sheet {
    max-height: 85vh;
  }
  .picker-list {
    max-height: 50vh;
  }

  /* Month matrix - landscape: use space for wider task col */
  .month-matrix-task-col, .month-task-name { min-width: 280px; max-width: 280px; }
  .month-matrix-week-col, .month-cell { min-width: 44px; }

  /* Week matrix - landscape */
  .week-matrix-task-col, .week-task-name { min-width: 280px; max-width: 280px; }
  .week-matrix-day-col, .week-cell { min-width: 44px; }

}
