/* ═══════════════════════════════════════════
   Our Little Memories — style.css
   Design system: warm, clean, whimsical
   Fonts: Nunito (UI) + Lora (titles/prompts)
═══════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  /* Rainbow */
  --rb: linear-gradient(90deg, #f4a0a0, #f4c97a, #f4e87a, #a8e6a0, #a0d4f4, #c0a8f4, #f4a8d4);

  /* Palette */
  --rose: #f4a0a0;   --rose-l: #fde8e8;   --rose-d: #b03030;
  --amber: #f4c97a;  --amber-l: #fff8e8;  --amber-d: #9a7000;
  --yellow: #f4e87a; --yellow-l: #fffde8;
  --mint: #a8e6a0;   --mint-l: #e8f8e8;   --mint-d: #2e7d32;
  --sky: #a0d4f4;    --sky-l: #e4f3fd;    --sky-d: #1565a8;
  --lav: #c0a8f4;    --lav-l: #ede7f6;    --lav-d: #5b2fa0;
  --pink: #f4a8d4;   --pink-l: #fde8f4;   --pink-d: #9b2064;
  --purple: #7b5ea7; --purple-l: #ede7f6;

  /* Neutral */
  --gray-page: #f0ede8;
  --gray-b: #efefef;
  --gray-b2: #e5e5e5;

  /* Text */
  --text: #1a1a1a;
  --text-m: #555;
  --text-mu: #aaa;
  --text-f: #ccc;
  --white: #fff;

  /* Border radius */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-full: 99px;

  /* Fonts */
  --font: 'Nunito', sans-serif;
  --font-s: 'Lora', serif;
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: var(--gray-page);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* ── App shell ── */
.app {
  width: 100%;
  max-width: 430px;
  height: 100vh;
  height: 100dvh;
  background: var(--white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Rainbow bar — always at top, non-negotiable */
.rb-bar {
  height: 5px;
  background: var(--rb);
  flex-shrink: 0;
}

/* ── Screen system ── */
.scr {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  background: var(--white);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  transform: translateX(20px);
}

.scr.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

/* ── Header ── */
.hdr {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--gray-b);
  flex-shrink: 0;
}

.hdr-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ht {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.hs {
  font-size: 12px;
  color: var(--text-mu);
  margin-top: 3px;
  font-weight: 500;
}

.back-btn {
  background: none;
  border: none;
  color: var(--purple);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
}

.hdr-gear {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--purple-l);
  border: 1.5px solid var(--lav);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Scrollable body ── */
.body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
}

.sec-lbl {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-mu);
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 14px 18px 8px;
}

/* ── Bottom nav ── */
.bnav {
  display: flex;
  justify-content: space-around;
  padding: 10px 0 max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--gray-b);
  flex-shrink: 0;
  background: var(--white);
}

.ni {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 2px 8px;
}

.ni-ico {
  width: 32px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border-radius: 8px;
}

.ni-lbl {
  font-size: 9px;
  color: var(--text-mu);
  font-weight: 700;
}

.ni.on .ni-lbl { color: var(--purple); }
.ni.on .ni-ico { background: var(--purple-l); }

/* ── Quick log grid ── */
.qgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 0 14px 14px;
}

.qbtn {
  border-radius: var(--r-md);
  padding: 13px 12px;
  border: 1.5px solid var(--gray-b);
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s;
  text-align: left;
}

.qbtn:active { transform: scale(0.97); background: #fafafa; }

.qbtn.wide {
  grid-column: span 2;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.qico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.qlbl {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

.qdsc {
  font-size: 10px;
  color: var(--text-mu);
  font-weight: 500;
}

/* ── Divider ── */
.dvdr {
  height: 1px;
  background: var(--gray-b);
  margin: 0 14px 2px;
}

/* ── Memory cards ── */
.mc {
  margin: 0 14px 10px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--gray-b);
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.12s;
}

.mc:active { background: #fafafa; }

.mc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.mc-tag {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.mc-type { font-size: 10px; font-weight: 700; color: var(--text-mu); }
.mc-title { font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 3px; line-height: 1.3; }
.mc-text { font-size: 12px; color: var(--text-m); line-height: 1.55; margin-bottom: 5px; }
.mc-date { font-size: 10px; color: var(--text-f); font-weight: 600; }

/* Person badges */
.prow {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.pb {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

/* Fixed person badge colors — never change */
.pb-ev { background: #D4EDFF; color: #1565A8; }
.pb-jo { background: #E8F5E9; color: #2E7D32; }
.pb-ni { background: #FFF8E8; color: #9A7000; }
.pb-ju { background: #FDE8F4; color: #9B2064; }

/* ── This week band ── */
.week-band {
  margin: 0 14px 10px;
  border-radius: var(--r-md);
  background: var(--purple-l);
  border: 1.5px solid var(--lav);
  padding: 12px 14px;
}

.week-title {
  font-size: 10px;
  font-weight: 800;
  color: var(--lav-d);
  letter-spacing: .6px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.week-chips { display: flex; flex-wrap: wrap; gap: 5px; }

.wchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--white);
  border: 1px solid var(--lav);
  border-radius: var(--r-full);
  padding: 4px 10px;
  cursor: pointer;
}

.wchip-dot { width: 6px; height: 6px; border-radius: 50%; }
.wchip-txt { font-size: 10px; font-weight: 700; color: var(--text-m); }

/* ── PIN screen ── */
.pin-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(40px, 8vh) 24px 24px;
  flex: 1;
  overflow-y: auto;
}

.pin-rb {
  height: 4px;
  background: var(--rb);
  border-radius: 99px;
  width: 64px;
  margin-bottom: 28px;
}

.pin-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  text-align: center;
  font-family: var(--font-s);
  font-style: italic;
}

.pin-sub {
  font-size: 13px;
  color: var(--text-mu);
  text-align: center;
  margin-bottom: 28px;
  font-weight: 500;
}

.pin-profiles {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  width: 100%;
  max-width: 280px;
}

.pin-prof {
  flex: 1;
  border-radius: var(--r-md);
  border: 2px solid var(--gray-b);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.pin-prof.sel {
  border-color: var(--purple);
  background: var(--purple-l);
}

.pin-ava {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}

.pin-name { font-size: 13px; font-weight: 800; color: var(--text); }

.pin-dots {
  display: flex;
  gap: 14px;
  margin-bottom: 28px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--gray-b);
  transition: all 0.2s;
}

.pin-dot.on  { background: var(--purple); border-color: var(--purple); }
.pin-dot.err { background: var(--rose);   border-color: var(--rose-d); }

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 280px;
}

.pkey {
  border-radius: var(--r-md);
  border: 1.5px solid var(--gray-b);
  background: var(--white);
  padding: 15px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: background 0.1s, transform 0.1s;
  font-family: var(--font);
  user-select: none;
}

.pkey:active { background: var(--gray-page); transform: scale(0.95); }
.pkey.del    { font-size: 18px; color: var(--text-mu); }
.pkey.empty  { border: none; background: none; cursor: default; }

.pin-err {
  font-size: 12px;
  color: var(--rose-d);
  font-weight: 700;
  margin-top: 12px;
  min-height: 18px;
  text-align: center;
}

/* ── Entry form ── */
.fpad { padding: 16px 18px; }

.flbl {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-m);
  margin-bottom: 7px;
}

.flbl span { font-weight: 500; color: var(--text-f); }

.ppl-sel {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pp {
  padding: 7px 15px;
  border-radius: var(--r-full);
  border: 2px solid var(--gray-b);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-mu);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
  background: var(--white);
  user-select: none;
}

/* Selected person states — match badge colors */
.pp.s-ev { border-color: #1565A8; background: #D4EDFF; color: #1565A8; }
.pp.s-jo { border-color: #2E7D32; background: #E8F5E9; color: #2E7D32; }
.pp.s-ni { border-color: #9A7000; background: #FFF8E8; color: #9A7000; }
.pp.s-ju { border-color: #9B2064; background: #FDE8F4; color: #9B2064; }

.finput {
  width: 100%;
  border: 1.5px solid var(--gray-b);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  background: #fafafa;
  font-family: var(--font);
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 14px;
}

.finput:focus { border-color: var(--lav); background: var(--white); }

textarea.finput {
  resize: none;
  min-height: 100px;
  line-height: 1.6;
}

.date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.date-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-m);
  background: var(--white);
  border: 1.5px solid var(--gray-b);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  flex: 1;
}

.date-btn {
  font-size: 12px;
  font-weight: 800;
  color: var(--purple);
  cursor: pointer;
  white-space: nowrap;
  border: none;
  background: none;
  font-family: var(--font);
}

.override-note {
  font-size: 11px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.auto-note      { background: var(--purple-l); color: var(--lav-d); }
.override-note.overridden { background: var(--amber-l); color: var(--amber-d); }

.save-btn {
  width: 100%;
  padding: 15px;
  border-radius: var(--r-md);
  background: var(--purple);
  color: var(--white);
  font-size: 15px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  margin-top: 4px;
  transition: background 0.15s;
  letter-spacing: .3px;
}

.save-btn:active { background: #6a4f91; }
.save-btn.outline { background: var(--purple-l); color: var(--purple); }

/* ── Prompt screen ── */
.pcard {
  margin: 14px 14px 10px;
  border-radius: var(--r-lg);
  background: var(--purple-l);
  border: 1.5px solid var(--lav);
  padding: 18px;
}

.pcard-lbl {
  font-size: 10px;
  font-weight: 800;
  color: var(--lav-d);
  letter-spacing: .7px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.popts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.popt {
  background: var(--white);
  border: 1.5px solid var(--lav);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-m);
  cursor: pointer;
  font-family: var(--font-s);
  font-style: italic;
  line-height: 1.55;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
}

.popt:active,
.popt.sel { border-color: var(--purple); background: #faf8ff; color: var(--text); }

.p-own {
  background: none;
  border: 1.5px dashed var(--lav);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--lav-d);
  cursor: pointer;
  width: 100%;
  text-align: center;
  font-family: var(--font);
  margin-bottom: 4px;
}

.p-refresh {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mu);
  cursor: pointer;
  text-align: center;
  width: 100%;
  padding: 6px;
  font-family: var(--font);
}

.p-write {
  margin: 0 14px 14px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--lav);
  padding: 14px;
  background: var(--white);
}

.p-sel-q {
  font-size: 13px;
  font-family: var(--font-s);
  font-style: italic;
  color: var(--lav-d);
  margin-bottom: 12px;
  line-height: 1.6;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-b);
}

/* ── Confirmation screen ── */
.conf-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(40px, 8vh) 24px 24px;
  flex: 1;
}

.conf-rb {
  height: 4px;
  background: var(--rb);
  border-radius: 99px;
  width: 80px;
  margin-bottom: 24px;
}

.conf-ico    { font-size: 44px; margin-bottom: 16px; }
.conf-title  { font-size: 22px; font-weight: 600; color: var(--text); margin-bottom: 6px; font-family: var(--font-s); font-style: italic; text-align: center; }
.conf-sub    { font-size: 13px; color: var(--text-mu); text-align: center; margin-bottom: 28px; font-weight: 500; line-height: 1.6; }
.conf-card   { width: 100%; border-radius: var(--r-md); border: 1.5px solid var(--gray-b); padding: 16px; margin-bottom: 28px; }
.conf-btns   { display: flex; gap: 10px; width: 100%; }

.conf-btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font);
  border: none;
}

.conf-btn.pri { background: var(--purple); color: var(--white); }
.conf-btn.sec { background: var(--purple-l); color: var(--purple); }

/* ── Memories / filters ── */
.filter-row {
  display: flex;
  gap: 7px;
  padding: 10px 14px 6px;
  flex-wrap: wrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fpill {
  padding: 5px 13px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--gray-b);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mu);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.fpill.fa  { background: var(--purple-l); border-color: var(--purple); color: var(--purple); }
.fpill.fev { background: var(--sky-l);    border-color: var(--sky-d);  color: var(--sky-d);  }
.fpill.fjo { background: var(--mint-l);   border-color: var(--mint-d); color: var(--mint-d); }
.fpill.fni { background: var(--amber-l);  border-color: var(--amber-d);color: var(--amber-d);}
.fpill.fju { background: var(--pink-l);   border-color: var(--pink-d); color: var(--pink-d); }
.fpill.fty { background: var(--amber-l);  border-color: var(--amber-d);color: var(--amber-d);}

.surprise-btn {
  margin: 4px 14px 6px;
  width: calc(100% - 28px);
  padding: 11px;
  border-radius: var(--r-md);
  background: var(--amber-l);
  color: var(--amber-d);
  font-size: 13px;
  font-weight: 800;
  border: 1.5px solid var(--amber);
  cursor: pointer;
  font-family: var(--font);
}

/* ── Search ── */
.srch-wrap {
  margin: 12px 14px 10px;
  position: relative;
}

.srch-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-mu);
}

.srch-in {
  width: 100%;
  border: 1.5px solid var(--gray-b);
  border-radius: var(--r-sm);
  padding: 12px 14px 12px 38px;
  font-size: 14px;
  color: var(--text);
  background: #fafafa;
  font-family: var(--font);
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s;
}

.srch-in:focus { border-color: var(--lav); background: var(--white); }

.tag-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding: 0 14px 12px;
}

.tag {
  padding: 5px 12px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* ── On this day ── */
.rb-div {
  height: 3px;
  background: var(--rb);
  border-radius: 99px;
  margin: 0 14px 14px;
  opacity: .5;
}

.yday {
  margin: 0 14px 10px;
  border-radius: var(--r-md);
  background: #fffbea;
  border: 1.5px solid var(--yellow);
  padding: 14px 16px;
  cursor: pointer;
}

.yday:active { background: #fff8d6; }

.yday-yr   { font-size: 11px; font-weight: 800; color: var(--amber-d); margin-bottom: 4px; }
.yday-title{ font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 3px; }
.yday-text { font-size: 12px; color: var(--text-m); line-height: 1.55; margin-bottom: 5px; }
.yday-meta { font-size: 10px; color: var(--text-f); font-weight: 600; }

.yday-empty {
  margin: 0 14px 10px;
  border-radius: var(--r-md);
  background: #fafafa;
  border: 1.5px solid var(--gray-b);
  padding: 24px;
  text-align: center;
  color: var(--text-mu);
  font-size: 13px;
  line-height: 1.7;
  font-weight: 500;
}

/* ── Memory detail ── */
.mdet { padding: 18px; }

.mdet-type  { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.mdet-lbl   { font-size: 11px; font-weight: 700; color: var(--text-mu); }
.mdet-title { font-size: 19px; font-weight: 800; color: var(--text); margin-bottom: 10px; font-family: var(--font-s); line-height: 1.35; }
.mdet-text  { font-size: 14px; color: var(--text-m); line-height: 1.85; margin-bottom: 18px; }

.mdet-meta {
  border-top: 1px solid var(--gray-b);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.meta-row { display: flex; align-items: flex-start; gap: 10px; }
.meta-lbl { font-size: 10px; font-weight: 700; color: var(--text-f); width: 80px; flex-shrink: 0; padding-top: 2px; }
.meta-val { font-size: 12px; font-weight: 600; color: var(--text-m); }

.edit-btn {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--purple-l);
  color: var(--purple);
  font-size: 13px;
  font-weight: 800;
  border: 1.5px solid var(--lav);
  cursor: pointer;
  font-family: var(--font);
}

.del-btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border-radius: var(--r-md);
  background: #fff0f0;
  color: var(--rose-d);
  font-size: 13px;
  font-weight: 800;
  border: 1.5px solid var(--rose);
  cursor: pointer;
  font-family: var(--font);
}

/* ── Settings ── */
.prof-card {
  margin: 0 14px 16px;
  border-radius: var(--r-md);
  background: var(--purple-l);
  border: 1.5px solid var(--lav);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.prof-ava {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}

.prof-name { font-size: 16px; font-weight: 800; color: var(--text); }
.prof-sub  { font-size: 11px; color: var(--lav-d); font-weight: 600; margin-top: 2px; }

.prof-sw {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--purple);
  border: 1.5px solid var(--purple);
  border-radius: var(--r-full);
  padding: 5px 12px;
  background: var(--white);
  cursor: pointer;
  font-family: var(--font);
}

.sset {
  margin: 0 14px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--gray-b);
  overflow: hidden;
}

.srow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-b);
  cursor: pointer;
}

.srow:last-child { border-bottom: none; }
.srow:active     { background: #fafafa; }

.sr-l   { display: flex; flex-direction: column; gap: 2px; }
.sr-lbl { font-size: 13px; font-weight: 700; color: var(--text); }
.sr-val { font-size: 11px; color: var(--text-mu); font-weight: 500; }
.sr-arr { color: var(--text-f); font-size: 18px; }

/* Events card */
.ev-card {
  margin: 0 14px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--gray-b);
  padding: 14px 16px;
}

.ev-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-b);
}

.ev-item:last-of-type { border-bottom: none; }

.ev-dot   { width: 8px; height: 8px; border-radius: 50%; background: var(--lav); flex-shrink: 0; }
.ev-name  { font-size: 13px; font-weight: 700; color: var(--text); flex: 1; }
.ev-dates { font-size: 10px; color: var(--text-mu); font-weight: 600; }

.add-ev {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--r-sm);
  border: 1.5px dashed var(--gray-b);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-mu);
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  font-family: var(--font);
  background: none;
}

/* ── Debug screen ── */
.dbg-lbl {
  font-size: 10px;
  font-weight: 800;
  color: var(--purple);
  letter-spacing: .7px;
  text-transform: uppercase;
  padding: 12px 14px 4px;
}

.dbg-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-b);
}

.dbg-key {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-mu);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 2px;
}

.dbg-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-m);
  font-family: monospace;
  word-break: break-all;
}

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 24px;
  margin: 0 24px;
  max-width: 340px;
  width: 100%;
}

.modal-title { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.modal-body  { font-size: 13px; color: var(--text-m); line-height: 1.6; margin-bottom: 20px; font-weight: 500; }
.modal-btns  { display: flex; gap: 10px; }

.modal-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font);
  border: none;
}

.modal-btn.keep  { background: var(--purple-l); color: var(--purple); }
.modal-btn.leave { background: var(--purple);   color: var(--white);  }

/* Date picker modal */
.date-modal { max-width: 320px; }

.date-modal input[type=date] {
  width: 100%;
  border: 1.5px solid var(--gray-b);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  background: #fafafa;
  font-family: var(--font);
  outline: none;
  margin-bottom: 16px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 16px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #2d1f5e;
  color: var(--white);
  padding: 11px 22px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 999;
  font-family: var(--font);
  white-space: nowrap;
  max-width: 90vw;
}

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

/* ── Loading screen ── */
.loading {
  position: fixed;
  inset: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s;
}

.loading.gone { opacity: 0; pointer-events: none; }

.load-rb {
  height: 4px;
  background: var(--rb);
  border-radius: 99px;
  width: 64px;
  margin-bottom: 20px;
}

.load-title { font-size: 20px; font-weight: 600; color: var(--text); font-family: var(--font-s); font-style: italic; }
.load-sub   { font-size: 12px; color: var(--text-mu); margin-top: 6px; font-weight: 500; }

/* ── Sync bar ── */
.sync-bar {
  background: var(--purple-l);
  border-bottom: 1px solid var(--lav);
  padding: 6px 18px;
  font-size: 11px;
  font-weight: 700;
  color: var(--lav-d);
  display: none;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sync-bar.show { display: flex; }

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

/* ── Empty states ── */
.empty {
  text-align: center;
  padding: 48px 24px;
}

.empty-ico { font-size: 36px; margin-bottom: 12px; }
.empty-t   { font-size: 15px; font-weight: 800; color: var(--text-m); margin-bottom: 6px; }
.empty-s   { font-size: 13px; color: var(--text-mu); line-height: 1.6; font-weight: 500; }
