/* ── Display font (headings, numbers, buttons) ─────────────
   Chosen in Settings → Udseende, set as <html data-font>. Files are
   self-hosted; the browser only downloads the one in use. */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/plus-jakarta-sans-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/nunito-latin.woff2) format('woff2');
}

/* ── Custom Properties ──────────────────────────────────── */
:root {
  --bg:            #F4F6F8;
  --surface:       #FFFFFF;
  --border:        #E2E8F0;
  --text-primary:  #1A202C;
  --text-muted:    #718096;
  --accent:        #6366f1;
  --accent-hover:  #4f46e5;
  --accent-2:      #818cf8;  /* lighter end of gradients */
  --tab-active:    var(--accent);
  --accent-soft:   color-mix(in srgb, var(--accent) 10%, var(--surface));
  --positive:      #16A34A;
  --negative:      #DC2626;
  --radius:        12px;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --font:          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Dark Mode ───────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:           #0F172A;
  --surface:      #1E293B;
  --border:       #334155;
  --text-primary: #F1F5F9;
  --text-muted:   #94A3B8;
  --accent:       #818cf8;
  --accent-hover: #6366f1;
  --positive:     #4ADE80;
  --negative:     #F87171;
  --shadow:       0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
}

[data-theme="dark"] .user-icon-btn:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); border-color: var(--tab-active); }
[data-theme="dark"] .nav-tab:hover:not(.active) { background: rgba(255,255,255,.07); }
[data-theme="dark"] .nav-tab.active  { box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus     { background: #1E293B; }
[data-theme="dark"] .confirm-no      { background: #2A0F0F; color: #F87171; border-color: #450A0A; }
[data-theme="dark"] .confirm-no:hover { background: #991B1B; color: #fff; }

/* ── Global utility ─────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 16px;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
}

/* ── Auth Gate ──────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  width: 100%;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 4px;
}
.auth-tab {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.auth-tab.active {
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.auth-success {
  font-size: 13px;
  color: var(--tab-active);
  text-align: center;
  line-height: 1.5;
}
.auth-forgot-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s;
  margin-top: -4px;
}
.auth-forgot-link:hover { color: var(--tab-active); }
.auth-forgot-link.hidden { display: none; }
.auth-recovery-intro {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Sign-out dropdown item */
.user-dropdown-signout { color: var(--negative) !important; }
.user-dropdown-signout svg { color: var(--negative) !important; }

[data-theme="dark"] .auth-tab.active { background: var(--surface); }

/* ── Password Gate ──────────────────────────────────────── */
.gate-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.gate-overlay.hidden { display: none; }
.gate-card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
  padding: 48px 40px 40px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.gate-title {
  font-size: 26px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.gate-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
  transition: border-color .15s;
}
.gate-input:focus { border-color: var(--tab-active); }
.gate-error {
  font-size: 13px;
  color: var(--negative);
  align-self: flex-start;
  margin-top: -4px;
}
.gate-error.hidden { display: none; }
.auth-password-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: -4px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.auth-password-hint.hidden { display: none; }
.gate-btn {
  width: 100%;
  margin-top: 4px;
  padding: 13px;
  font-size: 15px;
}

/* ── Overlay (modals) ───────────────────────────────────── */
.ob-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.ob-overlay.hidden { display: none; }
.ob-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 36px 40px 40px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text-primary); }
.btn-icon { padding: 6px 8px; line-height: 0; }
.btn-icon:disabled { opacity: .5; cursor: default; }
.spin { animation: spin .7s linear infinite; }
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 8px;
}

/* ── Card ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px 24px;
}

/* ── Confirm Modal ───────────────────────────────────────── */
.confirm-card {
  max-width: 380px;
  text-align: center;
}
.confirm-msg {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 28px;
}
.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.confirm-btn {
  flex: 1;
  min-width: 120px;
  justify-content: center;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
}
.confirm-yes {
  background: var(--tab-active);
  color: #fff;
  border-color: var(--tab-active);
}
.confirm-yes:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.confirm-extra {
  background: var(--surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.confirm-extra:hover { border-color: var(--accent); color: var(--accent); }
[data-theme="dark"] .confirm-extra { background: var(--surface); }
.confirm-no {
  background: #FEE2E2;
  color: #DC2626;
  border: 1.5px solid #FECACA;
}
.confirm-no:hover { background: #DC2626; color: #fff; }

/* ── Header ─────────────────────────────────────────────── */
header {
  background: var(--surface);
  color: var(--text-primary);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.header-brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.header-icon {
  width: 28px; height: 28px;
  flex-shrink: 0;
  color: var(--tab-active);
}
.header-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
header h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 7px;
}
.beta-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  line-height: 1;
  vertical-align: middle;
  flex-shrink: 0;
}
.header-family-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  line-height: 1;
  min-height: 1em;
}

/* ── User Menu ───────────────────────────────────────────── */
/* ── Notifications modal content ─────────────────────────── */
.notif-modal-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.notif-modal-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.notif-modal-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.notif-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.notif-modal-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.notif-modal-status {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
}

.user-menu-wrap { position: relative; }
.user-icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background .15s, border-color .15s, color .15s;
}
.user-icon-btn:hover {
  background: var(--accent-soft);
  border-color: var(--tab-active);
  color: var(--tab-active);
}
.user-icon-btn svg { width: 18px; height: 18px; }
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  min-width: 180px;
  padding: 6px;
  z-index: 500;
}
.user-dropdown.hidden { display: none; }
.user-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: var(--font);
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.user-dropdown-item:hover { background: var(--bg); }
.user-dropdown-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-muted); }

/* ── Navigation ──────────────────────────────────────────── */
nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  justify-content: center;
  position: sticky;
  top: 64px;
  z-index: 10;
}
.nav-current-label { display: none; }
.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px; height: 42px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.burger-btn span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--surface);
  padding: 4px;
  border-radius: 50px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 20px;
  border-radius: 50px;
  border: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  white-space: nowrap;
}
.nav-tab svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-tab:hover:not(.active) { color: var(--text-primary); background: rgba(0,0,0,.05); }
.nav-tab.active {
  background: var(--tab-active);
  color: #fff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* ── Main Layout ─────────────────────────────────────────── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}
.page { display: none; }
.page.active { display: block; }

/* ── Calendar Page ───────────────────────────────────────── */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.cal-week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cal-week-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  /* Fixed width so the arrows don't move when the month name changes */
  width: 19em;
  white-space: nowrap;
  text-align: center;
}
.cal-nav-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 16px;
  transition: border-color .15s, background .15s, color .15s;
}
.cal-nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
[data-theme="dark"] .cal-nav-btn:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.cal-today-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color .15s, color .15s;
}
.cal-today-btn:hover { border-color: var(--accent); color: var(--accent); }
/* Scrollable wrapper — lets the grid breathe on narrow screens */
.cal-grid-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Fade-out hint on the right edge when scrollable */
  mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
  padding-bottom: 6px; /* room for scrollbar */
  margin-bottom: -6px;
}
/* Remove the fade when fully scrolled to the right */
.cal-grid-wrap.scroll-end {
  mask-image: none;
  -webkit-mask-image: none;
}
.cal-grid {
  display: grid;
  /* Each column is at least 130 px but grows to fill space */
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 8px;
  min-width: 700px; /* never collapse below a usable width */
}
.cal-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px 8px;
  min-height: 120px;
  min-width: 0; /* let the column compress */
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* Desktop: meta (day name + date) stacks on top naturally */
.cal-day-meta {
  flex-shrink: 0;
}
/* Events area fills remaining space */
.cal-day-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.cal-day.cal-today {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.cal-day-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.cal-day-date {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}
.cal-today .cal-day-date {
  color: var(--accent);
}
.cal-event {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: filter .12s;
  position: relative;
}
.cal-event:hover { filter: brightness(0.93); }
.cal-event-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-event-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.cal-event-delete {
  opacity: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 14px;
  color: inherit;
  transition: opacity .12s;
}
.cal-event:hover .cal-event-delete { opacity: 0.7; }

/* Event type colours — dark text on a soft tinted background */
.cal-event.type-activity  { background: var(--accent-soft); color: var(--text-primary); }
.cal-event.type-wfh       { background: #F0FDF4; color: var(--text-primary); }
.cal-event.type-dropoff   { background: #FFF7ED; color: var(--text-primary); }
.cal-event.type-pickup    { background: #FDF4FF; color: var(--text-primary); }
/* Dinner: grey background, no dot (icon is enough) */
.cal-event.type-dinner    { background: #F3F4F6; color: var(--text-primary); }
.cal-event.type-dinner .cal-event-dot { display: none; }

[data-theme="dark"] .cal-event.type-activity { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text-primary); }
[data-theme="dark"] .cal-event.type-wfh      { background: rgba(21,128,61,.18);  color: var(--text-primary); }
[data-theme="dark"] .cal-event.type-dropoff  { background: rgba(194,65,12,.18);  color: var(--text-primary); }
[data-theme="dark"] .cal-event.type-pickup   { background: rgba(126,34,206,.18); color: var(--text-primary); }
[data-theme="dark"] .cal-event.type-dinner   { background: rgba(255,255,255,.07); color: var(--text-primary); }
.cal-add-btn {
  width: 100%;
  padding: 4px 0;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 5px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  transition: border-color .12s, color .12s;
  margin-top: auto;
}
.cal-add-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Fixed rows (week + day view) ──────────────────────────
   Each day has the same rows: Hjemme, Aflevering, Afhentning,
   Aftaler, Aftensmad. In the week view the rows line up across
   the days (subgrid), and Aftaler takes the spare height. */
.cal-grid {
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  row-gap: 4px;
}
.cal-grid .cal-day {
  display: grid;
  grid-row: span 6;
  grid-template-rows: subgrid;
  gap: 4px;
}
.cal-slot { min-width: 0; }
.cal-slot-items { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-grid .cal-slot--wfh .cal-slot-items { flex-direction: row; flex-wrap: wrap; }
.cal-grid .cal-slot--wfh .cal-event { padding: 2px 6px; }
.cal-grid .cal-slot--wfh .cal-event-dot { display: none; }
.cal-grid .cal-slot--events .cal-slot-items { height: 100%; }
.cal-grid .cal-slot--dinner { padding-top: 4px; border-top: 1px solid var(--border); }

.cal-slot-add {
  width: 100%;
  padding: 4px 6px;
  background: none;
  border: 1px dashed color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 5px;
  font-family: var(--font);
  font-size: 11px;
  color: color-mix(in srgb, var(--text-muted) 75%, transparent);
  text-align: left;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.cal-slot-add:hover { border-color: var(--accent); color: var(--accent); }
/* The Aftaler button sits at the bottom of the free space */
.cal-slot-add.cal-add-btn { margin-top: auto; text-align: center; }

/* Day view: one card, a label in front of each row */
.cal-day-view .cal-slot {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.cal-day-view .cal-slot:first-child { border-top: none; padding-top: 0; }
.cal-day-view .cal-slot:last-child { padding-bottom: 0; }
.cal-day-view .cal-slot--events { min-height: 120px; }
.cal-slot-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  padding-top: 10px;
}
.cal-day-view .cal-slot-items { gap: 8px; }
.cal-slot-none { font-size: 14px; color: var(--text-muted); padding: 9px 0; }
.cal-day-view .cal-slot-add { padding: 10px 12px; font-size: 14px; border-radius: 8px; }
.cal-day-view .cal-slot-add.cal-add-btn { margin-top: 0; text-align: left; }
@media (max-width: 500px) {
  .cal-day-view .cal-slot { grid-template-columns: 1fr; gap: 6px; }
  .cal-slot-label { padding-top: 0; }
}

/* ── Cleaning Page ───────────────────────────────────────── */
.cleaning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cleaning-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
/* Week navigation bar (shared style with calendar) */
.cleaning-week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.cleaning-week-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 160px;
  text-align: center;
}
.week-nav-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  transition: border-color .15s, background .15s, color .15s;
}
.week-nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
[data-theme="dark"] .week-nav-btn:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.week-nav-today-btn {
  margin-left: 4px;
  padding: 0 12px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color .15s, background .15s, color .15s;
}
.week-nav-today-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
[data-theme="dark"] .week-nav-today-btn:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
/* Done-state card */
.cleaning-card--done {
  border-color: var(--positive, #22c55e);
  background: #f0fdf4;
}
[data-theme="dark"] .cleaning-card--done {
  border-color: #166534;
  background: rgba(34,197,94,.07);
}
.cleaning-not-done {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.cleaning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.cleaning-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px 14px 42px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .15s, opacity .15s;
  position: relative;
}
.cleaning-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.cleaning-card--dragging { opacity: .35; box-shadow: none !important; }
.cleaning-card--drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}
/* Drag handle */
.cleaning-drag-handle {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: var(--text-muted);
  opacity: 0;
  border-right: 1px solid var(--border);
  border-radius: 12px 0 0 12px;
  transition: opacity .15s;
  touch-action: none;
}
.cleaning-drag-handle:active { cursor: grabbing; }
.cleaning-card:hover .cleaning-drag-handle { opacity: 0.5; }
.cleaning-drag-handle:hover { opacity: 1 !important; background: var(--bg); }
/* Edit button */
.cleaning-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  border-radius: 4px;
  transition: color .12s;
  flex-shrink: 0;
}
.cleaning-edit-btn:hover { color: var(--accent); }
.cleaning-edit-btn svg { width: 15px; height: 15px; }
/* Inline edit form (replaces a card in the grid) */
.cleaning-edit-inline {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cleaning-edit-inline-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}
.cleaning-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.cleaning-card-info { flex: 1; min-width: 0; }
.cleaning-task-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.cleaning-room {
  font-size: 13px;
  color: var(--text-muted);
}
.cleaning-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  border-radius: 4px;
  transition: color .12s;
  flex-shrink: 0;
}
.cleaning-delete-btn:hover { color: var(--negative); }
.cleaning-delete-btn svg { width: 15px; height: 15px; }
.cleaning-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cleaning-freq-badge {
  padding: 2px 9px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-hover);
}
[data-theme="dark"] .cleaning-freq-badge { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.cleaning-member-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.cleaning-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cleaning-last-done {
  font-size: 12px;
  color: var(--text-muted);
}
.cleaning-done-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  color: var(--text-muted);
  transition: background .15s, border-color .15s, color .15s;
}
.cleaning-done-btn:hover {
  border-color: var(--positive);
  color: var(--positive);
  background: #F0FDF4;
}
.cleaning-done-today {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--positive);
}

.cleaning-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.cleaning-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 120px;
}
.cleaning-form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Shopping Page ───────────────────────────────────────── */
.shopping-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.shopping-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
.page-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 1;
  min-width: 0;
}

/* Store groups */
.shopping-store-group {
  margin-bottom: 20px;
}
.shopping-cat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 7px 14px 4px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.shopping-store-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 6px 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px 10px 0 0;
  border-bottom: none;
}
.shopping-store-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  padding: 1px 7px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.shopping-list {
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--border);
  border-radius: 0 0 10px 10px;
  overflow: hidden;
}
/* Category badge inline on item name */
.shopping-item-cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 5px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.shopping-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.shopping-item:last-child { border-bottom: none; }
.shopping-item.checked {
  opacity: 0.55;
}
.shopping-item.checked .shopping-item-name {
  text-decoration: line-through;
  color: var(--text-muted);
}
.shopping-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .12s, background .12s;
}
.shopping-check:hover { border-color: var(--accent); }
.shopping-item.checked .shopping-check {
  background: var(--positive);
  border-color: var(--positive);
}
.shopping-item-info { flex: 1; min-width: 0; }
.shopping-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.shopping-item-qty {
  font-size: 12px;
  color: var(--text-muted);
}
.shopping-item-delete,
.shopping-item-edit {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity .12s, color .12s;
}
.shopping-item:hover .shopping-item-delete,
.shopping-item:hover .shopping-item-edit { opacity: 1; }
.shopping-item-delete:hover { color: var(--negative); }
.shopping-item-edit:hover { color: var(--accent); }
.shopping-item-delete svg,
.shopping-item-edit svg { width: 14px; height: 14px; }

/* ── Today Page ─────────────────────────────────────────── */
.today-hero {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 16px;
  padding: 28px 24px 22px;
  color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 25%, transparent);
}

.today-date {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 12px;
}
.today-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  opacity: .9;
}
.today-week-badge {
  background: rgba(255,255,255,.2);
  border-radius: 50px;
  padding: 3px 10px;
  font-size: 13px;
}
.today-meta-sep { opacity: .6; }
.today-clock {
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .02em;
}
/* Two-column hero layout */
.today-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.today-hero-left { flex: 1; min-width: 0; }
/* Weather column on the right */
.today-weather-col {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
  min-width: 72px;
  min-height: 48px;
}
.today-weather-main {
  display: flex;
  align-items: center;
  gap: 5px;
}
.today-weather-emoji { font-size: 24px; line-height: 1; }
.today-weather-temp {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.today-weather-sub {
  font-size: 13px;
  font-weight: 500;
  opacity: .85;
}
.today-weather-city {
  font-size: 11px;
  opacity: .6;
}
.today-weather-rain {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  opacity: .85;
}
/* Spinner inside hero while fetching */
.today-weather-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sections */
.today-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}
.today-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.today-section-link {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  text-transform: none;
  letter-spacing: 0;
}
.today-section-link:hover { text-decoration: underline; }

/* Today — to-do rows */
.today-todo-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.today-todo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
}
.today-todo-row--overdue {
  border-left: 3px solid var(--negative);
}
.today-todo-check {
  background: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  min-width: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .12s;
  padding: 0;
  color: var(--text-muted);
}
.today-todo-check:hover { border-color: var(--accent); color: var(--accent); }
.today-todo-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.today-todo-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.today-todo-overdue {
  font-size: 11px;
  font-weight: 600;
  color: var(--negative);
  background: rgba(220,38,38,.07);
  border-radius: 4px;
  padding: 1px 6px;
}
.today-todo-member {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Events */
.today-events-list { display: flex; flex-direction: column; gap: 10px; }
.today-event-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.today-event-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.today-event-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.today-event-type {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.today-event-title {
  font-size: 13px;
  color: var(--text-muted);
}
.today-event-time {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}
.today-event-member {
  font-size: 12px;
  font-weight: 600;
  margin-left: auto;
  white-space: nowrap;
}

/* Dinner */
.today-dinner-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.today-dinner-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.today-dinner-edit-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  color: var(--text-muted);
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.today-dinner-edit-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Cleaning */
.today-cleaning-list { display: flex; flex-direction: column; gap: 8px; }
.today-cleaning-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.today-cleaning-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
}

.today-cleaning-info { flex: 1; min-width: 0; }
.today-cleaning-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.today-cleaning-room {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}
.today-cleaning-member {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.today-done-btn {
  padding: 4px 12px;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  color: var(--text-muted);
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.today-done-btn:hover {
  border-color: var(--positive, #22c55e);
  color: var(--positive, #22c55e);
  background: #f0fdf4;
}

/* ── Settings Page ───────────────────────────────────────── */
.settings-page-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.settings-page-section h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.settings-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.member-info { flex: 1; min-width: 0; }
.member-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.member-color-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
  flex-shrink: 0;
}
.member-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  transition: color .12s, background .12s;
}
.member-delete-btn:hover { color: var(--negative); background: #FEF2F2; }
.member-delete-btn svg { width: 15px; height: 15px; }
.member-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  transition: color .12s, background .12s;
}
.member-edit-btn:hover { color: var(--accent); background: var(--accent-soft); }
.member-edit-btn svg { width: 15px; height: 15px; }

/* Member inline edit form */
.member-edit-inline {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: 10px;
  border: 1.5px solid var(--accent);
}
.member-edit-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.form-input-sm {
  height: 34px;
  font-size: 14px;
  padding: 0 10px;
}
.member-edit-colors {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.member-edit-color-opt {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .12s, border-color .12s;
  padding: 0;
}
.member-edit-color-opt:hover { transform: scale(1.15); }
.member-edit-color-opt--active {
  border-color: var(--text-primary);
  transform: scale(1.18);
}
.member-edit-actions {
  display: flex;
  gap: 8px;
}
.settings-empty {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 16px 0;
}

/* ── Add Event Modal ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-card {
  background: var(--surface);
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header-text { flex: 1; min-width: 0; }
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.modal-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 2px;
}
.modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 8px;
  display: flex;
  transition: color .12s, background .12s;
  flex-shrink: 0;
  margin-left: 12px;
}
.modal-close-btn:hover { color: var(--text-primary); background: var(--bg); }
.modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}
.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Calendar event member multi-picker */
.ev-member-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ev-member-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: border-color .12s, background .12s;
  white-space: nowrap;
}
.ev-member-chip:hover { border-color: var(--text-muted); }
.ev-member-empty {
  font-size: 13px;
  color: var(--text-muted);
}
.today-event-members {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}
.modal-form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.modal-form-row .modal-form-group {
  flex: 1;
  min-width: 0;      /* allow flex item to shrink below content size */
  overflow: hidden;  /* clip anything that still tries to escape */
}
/* Date and time inputs must be fully constrained on iOS */
input[type="date"].form-input,
input[type="time"].form-input {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
/* Wrapper that defeats iOS's native date-input minimum width.
   Setting width: 1px on the input forces the flex algorithm —
   not the native chrome — to control the rendered width. */
.date-input-wrap {
  display: flex;
  overflow: hidden;
  border-radius: 10px;
}
.date-input-wrap input[type="date"],
.date-input-wrap input[type="time"] {
  flex: 1;
  width: 1px;   /* key: overrides native iOS minimum */
  min-width: 0;
}
.modal-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.modal-type-select {
  font-size: 15px;
  font-weight: 600;
}
/* Title row with "Gem favorit" button */
.modal-title-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.modal-title-row .form-input { flex: 1; }

/* Dinner favorites */
.modal-dinner-favs { display: flex; flex-direction: column; gap: 10px; }
.dinner-fav-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.dinner-fav-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}
.dinner-fav-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 12px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.dinner-fav-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
[data-theme="dark"] .dinner-fav-chip:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.dinner-fav-remove {
  font-size: 14px;
  line-height: 1;
  color: var(--text-muted);
  opacity: .6;
  pointer-events: auto;
  padding: 0 2px;
  transition: opacity .12s;
}
.dinner-fav-remove:hover { opacity: 1; color: var(--negative); }
.dinner-fav-empty {
  font-size: 13px;
  color: var(--text-muted);
  align-self: center;
}
.dinner-add-fav-btn {
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1.5px dashed var(--border);
  background: none;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.dinner-add-fav-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Recurring event badge ──────────────────────────────── */
.cal-event-recur {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  font-size: 11px;
  opacity: .65;
  vertical-align: middle;
}
.cal-event.is-recurring {
  border-left: 2px solid var(--accent);
}

/* ── Recurring checkbox row ─────────────────────────────── */
.modal-recurring-group {
  margin-top: 4px;
}
.modal-recur-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  user-select: none;
}
.modal-recur-check {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Shared Form Inputs ─────────────────────────────────── */
.form-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
  transition: border-color .15s;
}
.form-input:focus { border-color: var(--accent); }
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
.form-select:focus { border-color: var(--accent); }

/* ── Settings toggle ─────────────────────────────────────── */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.settings-weather-current {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}
.settings-weather-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.settings-weather-form .form-input { flex: 1; }
.settings-weather-hint {
  font-size: 13px;
  margin-top: 8px;
  margin-bottom: 0;
}
.settings-weather-hint--ok    { color: var(--positive, #22c55e); }
.settings-weather-hint--error { color: var(--negative, #ef4444); }

/* ── iCal feeds (settings) ──────────────────────────────── */
.settings-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: -4px 0 14px;
  line-height: 1.5;
}
/* Room management in settings */
.settings-rooms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.settings-room-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.settings-room-delete {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  border-radius: 50%;
  transition: color .12s, background .12s;
}
.settings-room-delete:hover { color: var(--negative); background: rgba(239,68,68,.1); }
.settings-room-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.settings-room-add-row .form-input-sm { flex: 1; }

.ical-feeds-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.ical-feed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
}
.ical-feed-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ical-feed-info {
  flex: 1;
  min-width: 0;
}
.ical-feed-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.ical-feed-url {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}
.ical-feed-member-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 6px;
}
.ical-feed-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  line-height: 1;
}
.ical-emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ical-emoji-opt {
  font-size: 22px;
  background: none;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  padding: 3px 5px;
  line-height: 1;
  transition: background .1s, border-color .1s;
}
.ical-emoji-opt:hover   { background: var(--border); }
.ical-emoji-opt.selected { background: var(--border); border-color: var(--accent); }
.ical-feed-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color .12s;
  flex-shrink: 0;
}
.ical-feed-delete-btn:hover { color: var(--negative); }
.ical-feed-edit-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  padding: 6px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ical-feed-edit-btn:hover { color: var(--accent); }
.ical-feed-edit-btn svg { width: 16px; height: 16px; }
.ical-edit-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.ical-feed-delete-btn svg   { width: 16px; height: 16px; }
.ical-add-form {
  padding: 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ical-color-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ical-color-opt {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .12s, border-color .12s;
}
.ical-color-opt.selected,
.ical-color-opt:hover {
  transform: scale(1.25);
  border-color: var(--text-primary);
}
.ical-add-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.ical-add-hint--ok    { color: var(--positive, #22c55e); }
.ical-add-hint--error { color: var(--negative, #ef4444); }

/* ── Imported iCal events (calendar) ────────────────────── */
.cal-event--imported {
  border-radius: 6px;
  padding: 3px 6px;
}
.cal-ical-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  opacity: .55;
  flex-shrink: 0;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 44px; height: 24px;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 24px;
  transition: background .2s;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.toggle-switch input:checked + .toggle-slider { background: var(--tab-active); }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(20px); }

/* ── Mobile Nav ──────────────────────────────────────────── */
@media (max-width: 700px) {
  header { height: 56px; padding: 0 16px; }
  /* Bottom tab bar — thumb-friendly, app-like */
  nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0; right: 0;
    z-index: 150;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border-bottom: none;
    border-top: 1px solid var(--border);
  }
  .nav-current-label,
  .burger-btn { display: none !important; }
  .nav-tabs,
  .nav-tabs.open {
    display: flex;
    position: static;
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
    padding: 0;
    gap: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .nav-tab {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 2px 0;
    border-radius: 0;
    font-size: 11px;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-tab svg {
    width: 22px; height: 22px;
    box-sizing: content-box;
    padding: 4px 16px;
    border-radius: 16px;
    transition: background .2s, color .2s;
  }
  .nav-tab:hover:not(.active) { background: transparent; }
  .nav-tab.active,
  .nav-tab--prepper.active {
    background: transparent !important;
    color: var(--accent) !important;
    box-shadow: none;
  }
  .nav-tab.active svg {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    animation: tab-pop .35s cubic-bezier(.34,1.56,.64,1);
  }
  .nav-tab--prepper.active svg { background: rgba(251,191,36,.18); }
  /* ── Calendar: vertical stacked layout on mobile ── */
  .cal-grid-wrap {
    overflow-x: visible;
    mask-image: none;
    -webkit-mask-image: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }
  .cal-grid {
    grid-template-columns: 1fr;
    min-width: 0;
    gap: 6px;
  }
  .cal-day {
    flex-direction: row;
    align-items: flex-start;
    min-height: 0;
    padding: 10px 10px 10px 10px;
    gap: 10px;
  }
  .cal-day-meta {
    width: 44px;
    flex-shrink: 0;
    text-align: center;
    padding-top: 2px;
  }
  .cal-day-header {
    margin-bottom: 2px;
  }
  .cal-day-date {
    margin-bottom: 0;
  }
  .cal-day-events {
    border-left: 1px solid var(--border);
    padding-left: 10px;
  }
  .cal-add-btn {
    align-self: flex-start;
  }
  /* Week list: date on the left, the day's rows stacked on the right.
     Empty rows are hidden (the day view shows them all). */
  .cal-grid { grid-template-rows: none; }
  .cal-grid .cal-day {
    grid-row: auto;
    grid-template-rows: none;
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 4px;
  }
  .cal-grid .cal-day-meta { grid-row: 1 / span 5; }
  .cal-grid .cal-slot { grid-column: 2; }
  .cal-grid .cal-slot:not(.cal-slot--events):not(:has(.cal-event)) { display: none; }
  .cal-grid .cal-slot--dinner { border-top: none; padding-top: 0; }
  .cal-grid .cal-slot-items.cal-day-events { border-left: none; padding-left: 0; }
  .cal-grid .cal-slot-add.cal-add-btn { width: auto; align-self: flex-start; padding: 4px 10px; }
  .cal-day.cal-day-view { flex-direction: column; align-items: stretch; gap: 0; }
  .cleaning-grid { grid-template-columns: 1fr; }
  main { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); } /* room for the bottom tab bar */
}

/* ── Today: greeting, "who am I" and progress rings ──────── */
.today-greeting {
  font-size: 16px;
  font-weight: 600;
  opacity: .92;
  margin-bottom: 4px;
}
.today-me-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline dotted rgba(255,255,255,.6);
  text-underline-offset: 3px;
}
.today-me-ask {
  margin-top: 14px;
  background: rgba(255,255,255,.18);
  border: 1px dashed rgba(255,255,255,.5);
  border-radius: 10px;
  padding: 8px 12px;
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.today-me-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.today-me-picker.hidden { display: none; }
.today-me-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.14);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.today-me-chip.active { background: #fff; color: var(--accent); }

.today-rings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.today-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: var(--font);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform .15s;
}
.today-ring:active { transform: scale(.96); }
.today-ring-svg {
  position: relative;
  width: 56px; height: 56px;
  margin-bottom: 6px;
}
.today-ring-svg svg { transform: rotate(-90deg); display: block; }
.today-ring-track,
.today-ring-bar {
  fill: none;
  stroke-width: 6;
}
.today-ring-track { stroke: color-mix(in srgb, var(--ring) 16%, transparent); }
.today-ring-bar {
  stroke: var(--ring);
  stroke-linecap: round;
  stroke-dasharray: var(--circ);
  stroke-dashoffset: var(--off);
  animation: ring-fill .9s cubic-bezier(.22,1,.36,1);
}
@keyframes ring-fill { from { stroke-dashoffset: var(--circ); } }
.today-ring-center {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 800;
}
.today-ring.is-full .today-ring-center {
  color: var(--ring);
  font-size: 20px;
  animation: pop .45s .5s cubic-bezier(.34,1.56,.64,1) backwards;
}
.today-ring-label { font-size: 13px; font-weight: 700; }
.today-ring-sub   { font-size: 11px; color: var(--text-muted); font-weight: 500; }

/* ── Calendar views (dag / uge / måned) ──────────────────── */
.cal-view-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--border);
  gap: 2px;
}
.cal-view-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.cal-view-btn.active {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow);
}
.cal-grid .cal-day-meta { cursor: pointer; }
.cal-grid .cal-day-meta:hover .cal-day-date { color: var(--accent); }

/* Day view: one roomy card */
.cal-day.cal-day-view {
  min-height: 0;
  padding: 14px;
}
.cal-day-view .cal-day-events { gap: 8px; border-left: none; padding-left: 0; }
.cal-day-view .cal-event {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
}
.cal-day-view .cal-event-title { white-space: normal; }
.cal-day-view .cal-event-delete { opacity: .5; font-size: 16px; }
.cal-day-empty {
  margin: 4px 0 8px;
  font-size: 14px;
  color: var(--text-muted);
}

/* Month view: Apple-style grid of dates with event dots */
.cal-month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}
.cal-month-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 0 8px;
}
.cal-month-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0 8px;
  min-height: 56px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-family: var(--font);
  color: var(--text-primary);
  cursor: pointer;
  transition: background .12s;
}
.cal-month-cell.is-blank { cursor: default; }
button.cal-month-cell:hover { background: var(--bg); }
.cal-month-num {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 600;
}
.cal-month-cell.cal-today .cal-month-num {
  background: var(--accent);
  color: #fff;
}
.cal-month-dots {
  display: flex;
  gap: 3px;
  height: 6px;
}
.cal-month-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}
@media (max-width: 700px) {
  .cal-header { gap: 10px; }
  .cal-view-switch { width: 100%; }
  .cal-view-btn { flex: 1; }
  .cal-week-nav { flex: 1; justify-content: space-between; }
  .cal-week-label { width: auto; min-width: 0; white-space: normal; }
  .cal-month { padding: 6px; gap: 2px; }
  .cal-month-cell { min-height: 50px; padding: 4px 0 6px; }
}

/* ── Checkmark SVG in checked shopping item ─────────────── */
.check-svg {
  width: 12px; height: 12px;
  stroke: #fff;
}

/* ── Household users panel ───────────────────────────────── */
.hu-member-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hu-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.hu-row--pending {
  opacity: .7;
  border-style: dashed;
}

.hu-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hu-avatar--pending {
  background: var(--text-muted);
}

.hu-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hu-email {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hu-you {
  font-size: 12px;
  color: var(--text-muted);
}

.hu-role {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

.hu-role-owner {
  background: #DCFCE7;
  color: #16A34A;
}

.hu-role-member {
  background: #DBEAFE;
  color: #1D4ED8;
}

[data-theme="dark"] .hu-role-owner {
  background: rgba(22, 163, 74, 0.2);
  color: #4ADE80;
}

[data-theme="dark"] .hu-role-member {
  background: rgba(29, 78, 216, 0.2);
  color: #93C5FD;
}

.hu-pending-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
  background: #FEF3C7;
  color: #D97706;
}

[data-theme="dark"] .hu-pending-badge {
  background: rgba(217, 119, 6, 0.2);
  color: #FCD34D;
}

.hu-remove-btn,
.hu-cancel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background .12s, color .12s;
}

.hu-remove-btn:hover,
.hu-cancel-btn:hover {
  background: var(--bg);
  color: var(--negative);
}

.hu-invite-form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hu-invite-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.hu-invite-fields {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.hu-invite-fields .form-input {
  min-width: 0; /* allow email to shrink */
}

/* Role dropdown: show content width, don't stretch */
.hu-invite-fields select.form-input {
  width: auto;
}

@media (max-width: 480px) {
  .hu-invite-fields {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .hu-invite-fields input[type="email"] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  /* Stack side-by-side modal fields vertically on all phones */
  .modal-form-row {
    flex-direction: column;
    gap: 0;
  }
  /* Prevent iOS Safari from auto-zooming the viewport on input focus.
     iOS zooms whenever font-size < 16px — this stops that entirely,
     which also fixes the "inputs look too wide / zoom stuck" issue. */
  .modal-body input,
  .modal-body select,
  .modal-body textarea {
    font-size: 16px;
  }
}

.hu-invite-note {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.hu-invite-note--ok    { color: var(--positive); }
.hu-invite-note--error { color: var(--negative); }

/* What each role may do (under the invite form) */
.hu-roles { margin: 12px 0 0; display: grid; gap: 6px; }
.hu-roles-row {
  display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: start;
  padding: 8px 10px; border-radius: 10px; border: 1px solid transparent;
  opacity: .7; transition: opacity .15s, background .15s, border-color .15s;
}
.hu-roles-row.active { opacity: 1; background: var(--bg); border-color: var(--border); }
.hu-roles-row dt { margin: 0; }
.hu-roles-row dd { margin: 0; font-size: 13px; line-height: 1.4; color: var(--text-muted); }
.hu-roles-row.active dd { color: var(--text-primary); }
.onb-role-hint { font-size: 13px; margin: 8px 0 0; line-height: 1.4; }

.acct-skeleton {
  display: block; width: 60%; height: 22px; border-radius: 8px;
  background: linear-gradient(90deg, var(--border) 25%, color-mix(in srgb, var(--border) 40%, var(--surface)) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.2s ease-in-out infinite;
}
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.hu-spinner {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0;
}

/* ── To-do page ──────────────────────────────────────────── */
.todo-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.todo-page-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Item card */
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition: opacity .15s;
}

.todo-item--overdue {
  border-left: 3px solid var(--negative);
}

.todo-item--done {
  opacity: .55;
}

/* Checkbox button */
.todo-check {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, background .15s;
  padding: 0;
}

.todo-check:hover {
  border-color: var(--accent);
}

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

.todo-check--done svg {
  width: 13px;
  height: 13px;
  stroke: #fff;
}

/* Item body */
.todo-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.todo-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
}

.todo-item--done .todo-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.todo-member-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

.todo-deadline-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.todo-deadline--today {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  border-color: var(--accent);
}

.todo-deadline--overdue {
  background: rgba(220,38,38,0.08);
  color: var(--negative);
  border-color: var(--negative);
}

/* Delete button */
.todo-edit-btn,
.todo-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity .12s, color .12s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 6px;
}

.todo-edit-btn svg,
.todo-delete-btn svg { width: 15px; height: 15px; }

.todo-item:hover .todo-edit-btn,
.todo-item:hover .todo-delete-btn,
.todo-item:focus-within .todo-edit-btn,
.todo-item:focus-within .todo-delete-btn {
  opacity: 1;
}

.todo-edit-btn:hover   { color: var(--accent); }
.todo-delete-btn:hover { color: var(--negative); }

/* Done section */
.todo-done-section {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-done-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 0 2px;
}

/* Mobile tweaks */
@media (max-width: 600px) {

  .todo-edit-btn, .todo-delete-btn { opacity: 1; }
}

/* ── Prepper / Emergency preparedness ───────────────────── */
/* Toggle row inside dropdown — same look as other items, toggle on the right */
.user-dropdown-item--toggle { cursor: default; }
.user-dropdown-item--toggle:hover { background: var(--bg); }

.nav-tab--prepper { color: #b45309; }
.nav-tab--prepper.active { background: #fef3c7 !important; color: #92400e !important; }
[data-theme="dark"] .nav-tab--prepper { color: #fcd34d; }
[data-theme="dark"] .nav-tab--prepper.active { background: rgba(251,191,36,.15) !important; color: #fcd34d !important; }

.prepper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.prepper-header h2 { margin: 0; }

.prepper-infobox {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}
.prepper-infobox-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.prepper-infobox-title::-webkit-details-marker { display: none; }
.prepper-infobox-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 20px;
  border-radius: 12px;
  background: color-mix(in srgb, #f59e0b 14%, var(--surface));
}
.prepper-infobox-head { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prepper-infobox-heading { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.prepper-infobox-src { font-size: 12px; color: var(--text-muted); }
.prepper-progress { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.prepper-progress-text { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.prepper-progress-text strong { color: var(--text-primary); }
.prepper-progress-bar {
  width: 96px; height: 6px; border-radius: 99px; overflow: hidden;
  background: color-mix(in srgb, var(--text-muted) 18%, transparent);
}
.prepper-progress-bar span { display: block; height: 100%; border-radius: inherit; background: var(--positive); transition: width .3s; }
.prepper-infobox-chevron { color: var(--text-muted); flex-shrink: 0; transition: transform .2s; }
.prepper-infobox[open] .prepper-infobox-chevron { transform: rotate(180deg); }

.prepper-tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  padding: 4px 16px 16px;
}
.prepper-tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.prepper-tip:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.prepper-tip input { position: absolute; opacity: 0; pointer-events: none; }
.prepper-tip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.prepper-tip-icon { font-size: 22px; flex-shrink: 0; line-height: 1.2; }
.prepper-tip-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.prepper-tip-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.prepper-tip-text  { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }

/* Round check on the right of each tip */
.prepper-tip-checkmark {
  width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--text-muted) 45%, transparent);
  display: grid; place-items: center;
  transition: background .15s, border-color .15s;
}
.prepper-tip-checkmark::after {
  content: '';
  width: 5px; height: 10px;
  border: 2.5px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0;
  transition: opacity .15s;
}

/* Checked tip: soft green, no strike-through */
.prepper-tip--checked {
  background: color-mix(in srgb, var(--positive) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--positive) 35%, var(--border));
}
.prepper-tip--checked .prepper-tip-checkmark { background: var(--positive); border-color: var(--positive); }
.prepper-tip--checked .prepper-tip-checkmark::after { opacity: 1; }
[data-theme="dark"] .prepper-tip--checked .prepper-tip-checkmark::after { border-color: #0f172a; }
.prepper-tip--checked .prepper-tip-text { opacity: .75; }

@media (max-width: 560px) {
  .prepper-infobox-title { flex-wrap: wrap; }
  .prepper-progress { order: 3; flex-direction: row; align-items: center; width: 100%; padding-left: 52px; }
  .prepper-progress-bar { flex: 1; width: auto; }
  .prepper-tips-grid { padding: 4px 12px 12px; gap: 8px; }
}

.prepper-list { display: flex; flex-direction: column; gap: 8px; }

.prepper-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.prepper-item--expired  { border-left: 3px solid var(--negative); }
.prepper-item--expiring { border-left: 3px solid #f59e0b; }
.prepper-item-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.prepper-item-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.prepper-item-qty  { font-size: 12px; color: var(--text-muted); }
.prepper-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: 11px;
  flex-shrink: 0;
}
.prepper-item-location { color: var(--text-muted); }
.prepper-expiry        { color: var(--text-muted); }
.prepper-expiry--bad   { color: var(--negative); font-weight: 600; }
.prepper-expiry--soon  { color: #d97706; font-weight: 600; }
.prepper-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.prepper-edit-btn,
.prepper-delete-btn {
  background: none; border: none; cursor: pointer;
  padding: 4px; border-radius: 6px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: color .12s;
}
.prepper-edit-btn:hover   { color: var(--accent); }
.prepper-delete-btn:hover { color: var(--negative); }

/* ── Guest role badge ────────────────────────────────────── */
.hu-role-guest {
  background: rgba(245,158,11,0.12);
  color: #d97706;
}
[data-theme="dark"] .hu-role-guest {
  background: rgba(245,158,11,0.18);
  color: #fbbf24;
}

/* ── Role change select ──────────────────────────────────── */
.hu-role-select {
  font-size: 13px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
}

/* ── Guest readonly banner ───────────────────────────────── */
.guest-readonly-banner {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #d97706;
  margin-bottom: 16px;
}

/* ── Member avatar (photo or emoji) ─────────────────────── */
.member-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.member-avatar-preview {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  overflow: hidden;
}
.member-avatar-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
}
.member-avatar-upload-lbl {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1.5px solid var(--surface);
  transition: background .12s;
}
.member-avatar-upload-lbl:hover { background: var(--accent-hover); }

.cal-event-member {
  color: var(--text-muted);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: middle;
}

/* Dinner in the calendar opens the edit/move modal */
.cal-event[data-edit-dinner] { cursor: pointer; }
.cal-event[data-edit-dinner]:hover .cal-event-title { text-decoration: underline; text-underline-offset: 2px; }

/* Page titles are gone (the nav shows where you are) — header rows only hold actions */
.cleaning-header, .shopping-header, .todo-page-header, .prepper-header { justify-content: flex-end; }
@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  /* On touch devices the add buttons live in the + button, so these rows are empty */
  .cleaning-header, .todo-page-header, .prepper-header { display: none; }
  .shopping-header { margin-bottom: 12px; }
}

/* ── Empty states ────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state-emoji {
  width: 76px; height: 76px;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  margin-bottom: 14px;
  animation: empty-float 3.2s ease-in-out infinite;
}
@keyframes empty-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.empty-state-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.empty-state-text {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.45;
}
.empty-state-btn { margin-top: 16px; }

/* Compact version inside Today cards and the calendar day view */
.empty-state--compact {
  flex-direction: row;
  text-align: left;
  gap: 12px;
  padding: 10px 4px;
  border: none;
  background: transparent;
}
.empty-state--compact .empty-state-emoji {
  width: 42px; height: 42px;
  font-size: 22px;
  margin-bottom: 0;
  flex-shrink: 0;
  animation: none;
}
.empty-state-body { display: flex; flex-direction: column; align-items: inherit; }
.empty-state--compact .empty-state-body { flex: 1; min-width: 0; align-items: flex-start; }
.empty-state--compact .empty-state-title { font-size: 14px; margin-bottom: 1px; }
.empty-state--compact .empty-state-text  { font-size: 13px; }
.empty-state--compact .empty-state-btn   { margin: 0 0 0 auto; flex-shrink: 0; }
.empty-state--compact .empty-state-title { overflow-wrap: anywhere; }
.cal-day-empty { margin: 0; }

/* ── Floating add button (phones and touch tablets like iPad) ── */
.fab, .fab-menu, .fab-backdrop { display: none; }
@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  /* The + button replaces the page-header add buttons on touch devices */
  #shop-add-btn, #todo-add-btn, #show-add-task-btn, #prepper-add-btn { display: none; }

  .fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 18px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: 56px; height: 56px;
    border-radius: 18px;
    border: none;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent);
    cursor: pointer;
    z-index: 160;
    -webkit-tap-highlight-color: transparent;
    transition: transform .2s cubic-bezier(.34,1.56,.64,1);
    animation: pop .35s cubic-bezier(.34,1.56,.64,1);
  }
  .fab:active { transform: scale(.92); }
  .fab svg { transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
  .fab.is-open svg { transform: rotate(45deg); }
  .fab.hidden { display: none; }

  .fab-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.25);
    z-index: 155;
    animation: page-in .15s ease-out;
  }
  .fab-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    position: fixed;
    right: 18px;
    bottom: calc(150px + env(safe-area-inset-bottom));
    z-index: 160;
  }
  .fab-backdrop.hidden, .fab-menu.hidden { display: none; }
  .fab-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    cursor: pointer;
    animation: fab-item-in .22s cubic-bezier(.34,1.56,.64,1) backwards;
  }
  .fab-menu-item:nth-child(1) { animation-delay: .09s; }
  .fab-menu-item:nth-child(2) { animation-delay: .06s; }
  .fab-menu-item:nth-child(3) { animation-delay: .03s; }
  .fab-menu-emoji { font-size: 18px; }
}
@keyframes fab-item-in { from { opacity: 0; transform: translateY(10px) scale(.95); } }

/* ── Splash (shown while the app starts) ─────────────────── */
.app-splash {
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
}
.app-splash-icon {
  width: 88px; height: 88px;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(30,27,75,.35), 0 0 0 1px rgba(255,255,255,.25);
  animation: pop .5s cubic-bezier(.34,1.56,.64,1);
}
.app-splash-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.01em;
  animation: page-in .4s .1s ease-out backwards;
}
.app-splash-dots { display: flex; gap: 6px; margin-top: 6px; }
.app-splash-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  animation: splash-dot 1s ease-in-out infinite;
}
.app-splash-dots span:nth-child(2) { animation-delay: .15s; }
.app-splash-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes splash-dot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

/* The login card gets the new app icon too */
.gate-logo-img { width: 56px; height: 56px; border-radius: 14px; }
.header-icon.header-icon-img { width: 32px; height: 32px; border-radius: 9px; }

/* ── Micro-interactions ──────────────────────────────────── */
@keyframes pop      { 0% { transform: scale(.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes pop-soft { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes tab-pop  { 0% { transform: scale(.85); } 100% { transform: scale(1); } }
@keyframes page-in  { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes strike   { from { background-size: 0 2px; } to { background-size: 100% 2px; } }
@keyframes draw     { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes leave    { to { opacity: 0; transform: translateX(28px); } }
@keyframes cal-from-right { from { opacity: 0; transform: translateX(32px); } }
@keyframes cal-from-left  { from { opacity: 0; transform: translateX(-32px); } }
@keyframes banner-in  { from { opacity: 0; transform: translate(-50%, -12px) scale(.96); } }
@keyframes banner-out { to   { opacity: 0; transform: translate(-50%, -12px) scale(.96); } }

/* Calendar: the next week/day/month slides in from the side you went to */
#page-calendar { overflow-x: clip; } /* no sideways scroll while sliding */
.cal-slide-next { animation: cal-from-right .3s cubic-bezier(.22,1,.36,1); }
.cal-slide-prev { animation: cal-from-left  .3s cubic-bezier(.22,1,.36,1); }

/* Message with the confetti when a ring is done */
.celebrate-banner {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  animation: banner-in .35s cubic-bezier(.34,1.56,.64,1);
}
.celebrate-banner.is-leaving { animation: banner-out .35s ease-in forwards; }

.page.active { animation: page-in .22s ease-out; }

/* Checkmark that draws itself in */
.check-draw {
  width: 13px; height: 13px;
  color: #fff;
  stroke-dasharray: 24;
  animation: draw .28s .05s ease-out backwards;
}

/* Circle fills with a bouncy pop */
.shopping-item.is-checking .shopping-check {
  background: var(--positive);
  border-color: var(--positive);
  animation: pop .35s cubic-bezier(.34,1.56,.64,1);
}
.todo-item.is-checking .todo-check,
.today-todo-row.is-checking .today-todo-check {
  background: var(--accent);
  border-color: var(--accent);
  animation: pop .35s cubic-bezier(.34,1.56,.64,1);
}

/* Line sweeps through the text */
.shopping-item.is-checking .shopping-item-name,
.todo-item.is-checking .todo-title,
.today-todo-row.is-checking .today-todo-title {
  width: fit-content;
  max-width: 100%;
  color: var(--text-muted);
  background: linear-gradient(currentColor, currentColor) no-repeat 0 55% / 100% 2px;
  animation: strike .28s ease-out;
  transition: color .2s;
}

/* Cleaning: card glows green, Today row slides away */
.cleaning-card.is-checking {
  border-color: var(--positive);
  animation: pop-soft .35s ease-out;
}
.today-cleaning-row.is-leaving { animation: leave .38s ease-in forwards; }
.today-cleaning-row.is-leaving .today-done-btn {
  background: var(--positive);
  border-color: var(--positive);
  color: #fff;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 10000;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* App feel: no double-tap zoom (pinch is blocked in app.js / viewport meta) */
html { touch-action: manipulation; }

/* ── Avatars ─────────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
  box-sizing: border-box;
  border-radius: 50%;
  border-style: solid;
  border-color: var(--av);
  background: color-mix(in srgb, var(--av) 16%, var(--surface));
  overflow: hidden;
  line-height: 1;
}
.avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.avatar-emoji { line-height: 1; }

.avatar-stack { display: inline-flex; align-items: center; vertical-align: middle; }
.avatar-stack .avatar { box-shadow: 0 0 0 1.5px var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: calc(-1 * var(--ov)); }

/* Top-right: my avatar instead of the generic person icon */
.user-icon-btn.has-avatar {
  padding: 0;
  border: none;
  background: none;
  transition: transform .15s;
}
.user-icon-btn.has-avatar:hover { background: none; transform: scale(1.06); }
.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.user-dropdown-header.hidden { display: none; }
.user-dropdown-who { min-width: 0; }
.user-dropdown-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.user-dropdown-email {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Display font ────────────────────────────────────────── */
:root                    { --font-display: 'Plus Jakarta Sans', var(--font); }
:root[data-font="system"] { --font-display: var(--font); }
:root[data-font="nunito"] { --font-display: 'Nunito', var(--font); }

header h1, .gate-title, .app-splash-name,
.today-greeting, .today-date, .today-clock, .today-week-badge,
.today-ring, .today-section-header, .today-dinner-text,
.nav-tab, .btn, .cal-view-btn, .cal-today-btn, .cal-week-label,
.cal-day-header, .cal-day-date, .cal-month-dow, .cal-month-num,
.cleaning-week-label, .empty-state-title, .modal-title,
.settings-page-section h2, .fab-menu-item, .user-dropdown-name,
.today-me-chip, .today-me-ask {
  font-family: var(--font-display);
}

/* Font picker (Settings → Udseende) */
.settings-row--stack { flex-direction: column; align-items: stretch; gap: 10px; }
.font-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.font-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 6px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.font-option:hover { border-color: var(--accent); }
.font-option.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.font-option-sample { font-size: 26px; font-weight: 800; line-height: 1.1; }
.font-option-name   { font-size: 13px; font-weight: 600; }
.font-option-hint   { font-size: 11px; color: var(--text-muted); font-family: var(--font); }

/* ── Theme colours (Settings → Udseende, <html data-accent>) ── */
:root[data-accent="blue"] { --accent: #2563eb; --accent-hover: #1d4ed8; --accent-2: #60a5fa; }
:root[data-theme="dark"][data-accent="blue"] { --accent: #60a5fa; --accent-hover: #3b82f6; }
:root[data-accent="teal"] { --accent: #0d9488; --accent-hover: #0f766e; --accent-2: #2dd4bf; }
:root[data-theme="dark"][data-accent="teal"] { --accent: #2dd4bf; --accent-hover: #14b8a6; }
:root[data-accent="green"] { --accent: #16a34a; --accent-hover: #15803d; --accent-2: #4ade80; }
:root[data-theme="dark"][data-accent="green"] { --accent: #4ade80; --accent-hover: #22c55e; }
:root[data-accent="orange"] { --accent: #ea580c; --accent-hover: #c2410c; --accent-2: #fb923c; }
:root[data-theme="dark"][data-accent="orange"] { --accent: #fb923c; --accent-hover: #f97316; }
:root[data-accent="pink"] { --accent: #db2777; --accent-hover: #be185d; --accent-2: #f472b6; }
:root[data-theme="dark"][data-accent="pink"] { --accent: #f472b6; --accent-hover: #ec4899; }
:root[data-accent="slate"] { --accent: #475569; --accent-hover: #334155; --accent-2: #94a3b8; }
:root[data-theme="dark"][data-accent="slate"] { --accent: #94a3b8; --accent-hover: #64748b; }

/* Colour picker */
.accent-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.accent-option {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--sw) 0%, var(--sw2) 100%);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px transparent;
  transition: transform .15s, box-shadow .15s;
}
.accent-option:hover { transform: scale(1.08); }
.accent-option.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }
.accent-option svg { opacity: 0; transition: opacity .15s; }
.accent-option.active svg { opacity: 1; animation: pop .3s cubic-bezier(.34,1.56,.64,1); }

/* ── Calendar day view: empty day fills the page ─────────── */
.cal-day.cal-day-view.is-empty {
  min-height: calc(100dvh - 300px);
  flex-direction: column;
  align-items: stretch;
}
.cal-day-view.is-empty .cal-day-events { flex: 1; justify-content: center; align-items: center; }
.cal-day-view.is-empty .empty-state { border: none; background: transparent; padding: 24px 12px; }
.cal-day-view.is-empty .empty-state-emoji { width: 96px; height: 96px; font-size: 48px; }
.cal-day-view.is-empty .empty-state-title { font-size: 20px; }
.cal-day-view.is-empty .cal-add-btn {
  width: auto;
  margin-top: 0;
  padding: 8px 22px;
  font-size: 13px;
  border-radius: 20px;
}
.only-mobile { display: none; }
@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  .only-mobile { display: inline; }
  /* The floating + button adds events on touch devices */
  .cal-day-view .cal-add-btn:not(.cal-slot-add) { display: none; }
}

/* ── Bottom sheets: dialogs slide up from the bottom on mobile ── */
@keyframes sheet-up  { from { transform: translateY(100%); } }
@keyframes sheet-dim { from { background: rgba(0,0,0,0); } }
@media (max-width: 700px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
    animation: sheet-dim .25s ease-out;
    backdrop-filter: none; /* blurring the page while the sheet slides makes it stutter */
  }
  .modal-card {
    position: relative;
    max-width: none;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: sheet-up .34s cubic-bezier(.22,1,.36,1);
    will-change: transform;
  }
  /* Grab handle */
  .modal-card::before {
    content: '';
    position: absolute;
    top: 8px; left: 50%;
    width: 40px; height: 5px;
    margin-left: -20px;
    border-radius: 3px;
    background: var(--border);
    z-index: 1;
  }
  .modal-header { padding-top: 26px; touch-action: none; }
  /* One way to close: swipe down (or tap outside) — no ✕ or "Annuller" */
  .modal-card .modal-close-btn,
  .modal-footer .btn-ghost { display: none; }
  .modal-footer .btn-primary { flex: 1; justify-content: center; text-align: center; padding-top: 12px; padding-bottom: 12px; }
}

/* Theme picker (Lys / Mørk / Automatisk) */
.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: var(--border);
}
.theme-option {
  border: none;
  background: transparent;
  padding: 8px 6px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.theme-option.active { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow); }
.settings-hint { font-size: 12px; color: var(--text-muted); }

/* Long event titles (e.g. imported calendars) truncate with … instead of
   stretching the day — flex children need min-width: 0 to shrink */
.cal-day-events { min-width: 0; }
.cal-event { min-width: 0; max-width: 100%; }
.cal-event-title { min-width: 0; }
.cal-event .cal-event-member { flex-shrink: 0; }

/* ── Undo toast ──────────────────────────────────────────── */
.undo-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 600;
  width: min(420px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 14px 16px;
  border-radius: 14px;
  background: #1E293B;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  overflow: hidden;
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform .3s cubic-bezier(.22,1,.36,1), opacity .25s;
  pointer-events: none;
}
[data-theme="dark"] .undo-toast { background: #F1F5F9; color: #0F172A; }
.undo-toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.undo-toast-msg {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.undo-toast-btn {
  flex-shrink: 0;
  border: none;
  border-radius: 9px;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
/* Countdown: the bar runs out, then the toast slides away */
.undo-toast-bar {
  position: absolute;
  left: 0; bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--accent);
  transform-origin: left center;
}
@keyframes undo-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (max-width: 700px) {
  .undo-toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  /* Lift the + button above the toast while it shows */
  .fab { transition: transform .3s cubic-bezier(.22,1,.36,1); }
  body.has-toast .fab { transform: translateY(-68px); }
}

/* ── Week view on iPad / desktop: all 7 days always fit ──── */
@media (min-width: 701px) {
  /* The calendar may use more of a wide screen than the other pages */
  main:has(#page-calendar.active) { max-width: 1240px; }

  .cal-grid-wrap { overflow-x: visible; mask-image: none; -webkit-mask-image: none; }
  .cal-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    min-width: 0;
    gap: 6px;
  }
  .cal-day { padding: 10px 6px 8px; }
  /* Narrow columns: let titles wrap instead of cutting them off */
  .cal-grid .cal-event { align-items: flex-start; padding: 4px 6px; }
  .cal-grid .cal-event-title {
    white-space: normal;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    line-height: 1.3;
  }
  .cal-grid .cal-event-dot { margin-top: 4px; }
  .cal-grid .cal-event-delete { opacity: 0; }
  .cal-grid .cal-event:hover .cal-event-delete { opacity: .7; }
  .cal-grid { min-height: calc(100dvh - 230px); }
}
/* Touch screens (iPad): no ✕ in the narrow week columns — delete from the day view */
@media (min-width: 701px) and (hover: none) {
  .cal-grid .cal-event-delete { display: none; }
}
@media (min-width: 701px) and (max-width: 900px) {
  .cal-grid .cal-event { font-size: 11.5px; gap: 4px; }
}

/* iPad: no bottom tab bar, so the + button sits lower and a bit larger */
@media (min-width: 701px) and (hover: none) and (pointer: coarse) {
  .fab { bottom: calc(28px + env(safe-area-inset-bottom)); right: 28px; width: 62px; height: 62px; }
  .fab-menu { bottom: calc(102px + env(safe-area-inset-bottom)); right: 28px; }
  .fab-menu-item { font-size: 16px; padding: 12px 18px 12px 14px; }
}

/* ── To-do categories ────────────────────────────────────── */
.todo-cat-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.todo-cat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 4px;
  white-space: nowrap;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.todo-cat-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}
[data-theme="dark"] .todo-cat-chip.active { color: var(--accent); }

.todo-group { display: flex; flex-direction: column; gap: 8px; }
.todo-group + .todo-group { margin-top: 12px; }
.todo-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px;
  font-family: var(--font-display);
}
.todo-group-emoji { font-size: 16px; }
.todo-group-name {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.todo-group-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--border);
  border-radius: 10px;
  padding: 1px 7px;
}

/* ── Count badge on nav tabs (overdue to-dos) ────────────── */
.nav-tab { position: relative; }
.nav-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--negative);
  color: #fff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-sizing: border-box;
}
.nav-badge.pop { animation: pop .4s cubic-bezier(.34,1.56,.64,1); }
.nav-tab.active .nav-badge { box-shadow: 0 0 0 2px var(--tab-active); }
@media (max-width: 700px) {
  /* Sits on the top-right corner of the tab icon */
  .nav-badge {
    position: absolute;
    top: -2px;
    left: calc(50% + 6px);
    box-shadow: 0 0 0 2px var(--surface);
  }
  .nav-tab.active .nav-badge { box-shadow: 0 0 0 2px var(--surface); }
}

/* ── Settings: your data & delete account ────────────────── */
.settings-inline-btn { align-self: flex-start; }
.settings-delete-btn { color: var(--negative); border-color: color-mix(in srgb, var(--negative) 35%, var(--border)); }
.settings-delete-btn:hover { background: color-mix(in srgb, var(--negative) 8%, transparent); }
.btn-primary.btn-delete { background: var(--negative); border-color: var(--negative); }
.btn-primary.btn-delete:disabled { opacity: .45; cursor: not-allowed; }
.delete-account-text { font-size: 14px; line-height: 1.5; color: var(--text-primary); margin: 0; }
.delete-account-error { font-size: 13px; color: var(--negative); margin: 0; }
.delete-account-error.hidden { display: none; }

/* ── Onboarding (first-run guide) ────────────────────────── */
.onb-screen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  overflow-y: auto;
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}
.onb-card {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 10px 40px rgba(0,0,0,.08);
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.onb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.onb-dots { display: flex; gap: 6px; }
.onb-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--border); transition: width .25s, background .25s; }
.onb-dot.done   { background: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.onb-dot.active { width: 22px; background: var(--accent); }
.onb-skip {
  border: none; background: none; cursor: pointer;
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  color: var(--text-muted);
}
.onb-skip:hover { color: var(--accent); }

.onb-step { animation: page-in .3s ease-out; display: flex; flex-direction: column; gap: 6px; padding: 8px 0 4px; }
.onb-emoji { font-size: 44px; line-height: 1; margin: 6px 0 4px; }
.onb-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.01em; margin: 0; color: var(--text-primary); }
.onb-sub { font-size: 15px; line-height: 1.5; color: var(--text-muted); margin: 0 0 10px; }
.onb-body { display: flex; flex-direction: column; gap: 12px; }
.onb-label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.onb-muted { color: var(--text-muted); }
.onb-error { font-size: 13px; color: var(--negative); margin: 4px 0 0; }
.onb-error.hidden { display: none; }

.onb-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); margin-top: 6px; }
.onb-footer .btn { padding: 11px 22px; font-size: 15px; }

.onb-add-row { display: flex; gap: 8px; }
.onb-add-row .form-input { flex: 1; min-width: 0; }
.onb-role { width: auto; flex-shrink: 0; }

.onb-members { display: flex; flex-direction: column; gap: 8px; }
.onb-members:empty { display: none; }
.onb-member {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 14px;
}
.onb-member-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onb-me-btn {
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text-muted);
  border-radius: 16px; padding: 5px 10px; font-family: var(--font-display); font-size: 12px; font-weight: 700; cursor: pointer;
  white-space: nowrap;
}
.onb-me-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.onb-remove { border: none; background: none; color: var(--text-muted); cursor: pointer; font-size: 15px; padding: 4px 6px; }

.onb-add { display: flex; flex-direction: column; gap: 8px; }
.onb-pickers { display: flex; flex-direction: column; gap: 8px; }
.onb-emoji-row, .onb-color-row { display: flex; flex-wrap: wrap; gap: 5px; }
.onb-emoji-opt {
  width: 36px; height: 36px; border-radius: 11px; font-size: 19px; padding: 0;
  border: 1.5px solid var(--border); background: var(--surface); cursor: pointer;
}
.onb-emoji-opt.active { border-color: var(--accent); background: var(--accent-soft); }
.onb-color-opt {
  width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px transparent;
}
.onb-color-opt.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text-primary); }

.onb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.onb-chip {
  padding: 8px 14px; border-radius: 20px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text-muted);
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
}
.onb-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text-primary); }
.onb-chip.active::before { content: '✓ '; color: var(--accent); }

.onb-guide { border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; }
.onb-guide summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.onb-guide ol { margin: 10px 0 4px 18px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; }
.onb-guide-note { font-size: 13px; color: var(--text-muted); line-height: 1.45; margin: 4px 0 0; }
.onb-cal-form { display: flex; flex-direction: column; gap: 8px; }
.onb-cal-form .btn, #onb-invite-btn { align-self: flex-start; }
.onb-feeds, .onb-invites { display: flex; flex-direction: column; gap: 6px; }
.onb-invites:empty { display: none; }
.onb-feed { padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }

@media (max-width: 700px) {
  .onb-screen { padding: calc(12px + env(safe-area-inset-top)) 0 0; align-items: stretch; }
  .onb-card { border-radius: 0; border: none; box-shadow: none; min-height: 100%; padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); }
  .onb-step { flex: 1; }
  .onb-footer { position: sticky; bottom: 0; background: var(--surface); padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
}

/* ── Password rules checklist ────────────────────────────── */
.pw-rules {
  list-style: none;
  margin: 2px 0 4px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  width: 100%;
  font-size: 12.5px;
  color: var(--text-muted);
}
.pw-rules.hidden { display: none; }
.pw-rules li { display: flex; align-items: center; gap: 6px; transition: color .2s; }
.pw-rules li::before {
  content: '';
  width: 14px; height: 14px; flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  box-sizing: border-box;
  transition: background .2s, border-color .2s;
}
.pw-rules li.ok { color: var(--positive); }
.pw-rules li.ok::before {
  border-color: var(--positive);
  background: var(--positive) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 9px no-repeat;
}

/* ── Swipe on list rows ──────────────────────────────────── */
/* Row background = action colour; ::after is a surface panel that slides
   with the content and covers the colour except the revealed strip;
   ::before is the icon in that strip. */
.shopping-item, .todo-item { position: relative; }
.swiping { overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.swiping.swipe-right { background: var(--positive) !important; }
.swiping.swipe-right.swipe-undo { background: var(--accent) !important; }
.swiping.swipe-left  { background: var(--negative) !important; }
.swiping > * { position: relative; z-index: 1; transform: translateX(var(--swipe-x, 0)); }
.swiping::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--surface);
  transform: translateX(var(--swipe-x, 0));
  z-index: 0;
}
.swiping::before {
  content: '';
  position: absolute;
  top: 50%;
  width: 24px; height: 24px;
  margin-top: -12px;
  background: center / 22px no-repeat;
  z-index: 0;
  opacity: .75;
  transition: transform .15s, opacity .15s;
}
.swiping.swipe-right::before { left: 18px;  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E"); }
.swiping.swipe-right.swipe-undo::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 4 1 10 7 10'/%3E%3Cpath d='M3.51 15a9 9 0 102.13-9.36L1 10'/%3E%3C/svg%3E"); }
.swiping.swipe-left::before  { right: 18px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6'/%3E%3Cpath d='M9 6V4a1 1 0 011-1h4a1 1 0 011 1v2'/%3E%3C/svg%3E"); }
.swiping.swipe-armed::before { opacity: 1; transform: scale(1.25); }
.swipe-settle > *, .swipe-settle::after { transition: transform .2s cubic-bezier(.22,1,.36,1); }
/* Checked shopping items are faded; keep the swipe colours strong */
.shopping-item.checked.swiping { opacity: 1; }
.shopping-item.checked.swiping > * { opacity: .55; }

/* Link-style item in the user menu (Administration) */
a.user-dropdown-item { text-decoration: none; color: inherit; }
.user-dropdown-item.hidden { display: none; }

/* "Send igen" on pending invitations */
.hu-resend-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  border-radius: 8px; padding: 4px 9px; font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font-display); white-space: nowrap;
}
.hu-resend-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Space between notification sections */
.notif-modal-row + .notif-modal-section-label,
#notif-prepper-section .notif-modal-section-label { margin-top: 18px; }

/* ── Min konto ───────────────────────────────────────────── */
.acct-section { display: flex; flex-direction: column; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.acct-section:last-child { border-bottom: none; padding-bottom: 0; }
.acct-heading {
  margin: 0; font-family: var(--font-display); font-size: 12px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted);
}
.acct-subhead { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-top: 4px; }
.acct-profile { display: flex; align-items: center; gap: 12px; }
.acct-avatar-empty {
  width: 44px; height: 44px; border-radius: 50%; background: var(--border);
  display: inline-flex; align-items: center; justify-content: center; font-size: 22px;
}
.acct-name { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--text-primary); }
.acct-email, .acct-role { font-size: 13px; color: var(--text-muted); }
.acct-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.acct-pw { display: flex; flex-direction: column; gap: 8px; }
.acct-pw.hidden { display: none; }
.acct-pw .btn { align-self: flex-start; }
.acct-msg { margin: 0; font-size: 13px; }
.acct-msg.hidden { display: none; }
.acct-msg.is-ok { color: var(--positive); }
.acct-msg.is-bad { color: var(--negative); }
.acct-muted { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.acct-plan { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acct-plan-badge { padding: 3px 10px; border-radius: 10px; font-size: 13px; font-weight: 700; }
.acct-plan-badge.is-ok    { background: color-mix(in srgb, var(--positive) 14%, transparent); color: var(--positive); }
.acct-plan-badge.is-trial { background: var(--accent-soft); color: var(--accent); }
.acct-plan-badge.is-bad   { background: color-mix(in srgb, var(--negative) 14%, transparent); color: var(--negative); }
.acct-plan-text { font-size: 14px; color: var(--text-primary); }
.acct-danger .acct-heading { color: var(--negative); }

/* ── Hjælp ───────────────────────────────────────────────── */
.help-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.help-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
  padding: 14px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; font-family: var(--font); color: var(--text-primary);
  transition: border-color .15s, transform .15s;
}
.help-card:hover { border-color: var(--accent); }
.help-card:active { transform: scale(.98); }
.help-card-icon { font-size: 26px; }
.help-card-title { font-family: var(--font-display); font-weight: 800; font-size: 15px; }
.help-card-text { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.help-section { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.help-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.help-message { min-height: 96px; resize: vertical; font-family: var(--font); }
.help-send { align-self: flex-start; }
.help-item { padding: 12px; border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; gap: 6px; }
.help-item + .help-item { margin-top: 8px; }
.help-item-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.help-item-msg { margin: 0; font-size: 14px; white-space: pre-wrap; color: var(--text-primary); }
.help-status { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 9px; background: var(--border); color: var(--text-muted); }
.help-status.is-answered { background: color-mix(in srgb, var(--positive) 14%, transparent); color: var(--positive); }
.help-reply { padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; }
.help-reply p { margin: 4px 0 0; white-space: pre-wrap; }
#help-modal .modal-card .modal-close-btn { display: flex; }   /* no "Annuller" here — keep ✕ */

/* Unread answer dot on Hjælp and the avatar */
.user-dropdown-item.has-dot span::after,
.user-icon-btn.has-dot::after {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--negative);
  margin-left: 6px;
  vertical-align: middle;
}
.user-icon-btn { position: relative; }
.user-icon-btn.has-dot::after { position: absolute; top: 0; right: 0; margin: 0; box-shadow: 0 0 0 2px var(--surface); }

/* ── Guided tour ─────────────────────────────────────────── */
.tour-root { position: fixed; inset: 0; z-index: 9500; }
.tour-spot {
  position: fixed;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, .62);
  transition: top .3s cubic-bezier(.22,1,.36,1), left .3s cubic-bezier(.22,1,.36,1),
              width .3s cubic-bezier(.22,1,.36,1), height .3s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
}
.tour-bubble {
  position: fixed;
  padding: 16px 16px 12px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s, transform .2s;
}
.tour-bubble.show { opacity: 1; transform: none; }
.tour-step { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.tour-title { font-family: var(--font-display); font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.tour-text { font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.tour-spacer { flex: 1; }
.tour-skip { border: none; background: none; color: var(--text-muted); font-size: 13px; cursor: pointer; padding: 4px 0; font-family: var(--font); }
