/* Life Tracker — editorial, grown-up theme with a playful pulse.
   Fraunces (serif) for display, Inter for UI. Warm ivory ground, plum ink,
   raspberry accent; category colours are muted and sophisticated. */

:root {
  --bg: #FAF6F1;
  --ink: #2B2233;
  --muted: #8A7D91;
  --card: #FFFFFF;
  --line: #EAE1DA;
  --accent: #A83E68;
  --accent-soft: #F6E7EE;
  --gold: #9C7A22;
  --gold-soft: #F5EDDA;
  --sage: #6F9B84;
  --shadow: 0 1px 2px rgba(43, 34, 51, 0.05), 0 8px 24px rgba(43, 34, 51, 0.06);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ---------- decorative motifs ----------
   Celestial star field + floral/striped ornaments. Deliberately restrained:
   low-opacity, non-interactive, and never behind body text. */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    /* four-point sparkles, scattered */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 8 16 11 24 12C16 13 13 16 12 24C11 16 8 13 0 12C8 11 11 8 12 0Z' fill='%23A83E68' fill-opacity='0.13'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 8 16 11 24 12C16 13 13 16 12 24C11 16 8 13 0 12C8 11 11 8 12 0Z' fill='%236D7FA8' fill-opacity='0.14'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 8 16 11 24 12C16 13 13 16 12 24C11 16 8 13 0 12C8 11 11 8 12 0Z' fill='%23C9A227' fill-opacity='0.16'/%3E%3C/svg%3E"),
    /* soft daisies */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23C97B5D' fill-opacity='0.13'%3E%3Ccircle cx='12' cy='5.5' r='3.6'/%3E%3Ccircle cx='12' cy='18.5' r='3.6'/%3E%3Ccircle cx='5.5' cy='12' r='3.6'/%3E%3Ccircle cx='18.5' cy='12' r='3.6'/%3E%3C/g%3E%3Ccircle cx='12' cy='12' r='2.6' fill='%23C9A227' fill-opacity='0.2'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%239A7FB8' fill-opacity='0.12'%3E%3Ccircle cx='12' cy='5.5' r='3.6'/%3E%3Ccircle cx='12' cy='18.5' r='3.6'/%3E%3Ccircle cx='5.5' cy='12' r='3.6'/%3E%3Ccircle cx='18.5' cy='12' r='3.6'/%3E%3C/g%3E%3Ccircle cx='12' cy='12' r='2.6' fill='%23C9A227' fill-opacity='0.18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 6vw 14vh, 92vw 8vh, 88vw 62vh, 4vw 68vh, 95vw 34vh;
  background-size: 22px 22px, 15px 15px, 18px 18px, 26px 26px, 19px 19px;
}

/* candy-stripe rule used to break up headings */
.rule-stripe {
  height: 3px;
  border-radius: 3px;
  background: repeating-linear-gradient(
    115deg,
    var(--accent) 0 7px,
    transparent 7px 12px,
    var(--gold) 12px 19px,
    transparent 19px 24px,
    #6D7FA8 24px 31px,
    transparent 31px 36px);
  opacity: 0.5;
}
.greeting-block .rule-stripe { flex: 1; max-width: 260px; }

/* bloom — stripe — star, under the greeting */
.rule-flourish { display: flex; align-items: center; gap: 9px; margin-top: 16px; }
.flourish-bloom, .flourish-star { flex: none; display: block; }
.flourish-bloom {
  width: 17px;
  height: 17px;
  background: var(--accent);
  opacity: 0.75;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='5.5' r='3.7'/%3E%3Ccircle cx='12' cy='18.5' r='3.7'/%3E%3Ccircle cx='5.5' cy='12' r='3.7'/%3E%3Ccircle cx='18.5' cy='12' r='3.7'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='5.5' r='3.7'/%3E%3Ccircle cx='12' cy='18.5' r='3.7'/%3E%3Ccircle cx='5.5' cy='12' r='3.7'/%3E%3Ccircle cx='18.5' cy='12' r='3.7'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center/contain no-repeat;
}
.flourish-star {
  width: 12px;
  height: 12px;
  background: var(--gold);
  opacity: 0.85;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 8 16 11 24 12C16 13 13 16 12 24C11 16 8 13 0 12C8 11 11 8 12 0Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 8 16 11 24 12C16 13 13 16 12 24C11 16 8 13 0 12C8 11 11 8 12 0Z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.auth-card .rule-stripe { margin: 0 auto 18px; max-width: 120px; opacity: 0.65; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

button { font-family: inherit; font-weight: 500; color: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-weight: 400; color: inherit; }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* ---------- sign-in screen ---------- */

.auth-screen {
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 56px 40px 44px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.auth-mark {
  width: 44px;
  height: 44px;
  margin: 0 auto 18px;
  border-radius: 13px;
  background: var(--accent);
  position: relative;
}
.auth-mark::after {
  content: '';
  position: absolute;
  left: 12px;
  top: 13px;
  width: 18px;
  height: 10px;
  border-left: 3px solid var(--bg);
  border-bottom: 3px solid var(--bg);
  transform: rotate(-45deg);
}
/* a small sparkle escaping the corner of the mark */
.auth-mark::before {
  content: '';
  position: absolute;
  right: -11px;
  top: -9px;
  width: 17px;
  height: 17px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 8 16 11 24 12C16 13 13 16 12 24C11 16 8 13 0 12C8 11 11 8 12 0Z' fill='%23C9A227'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

.brand-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 38px;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

.auth-tagline {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 17px;
  color: var(--muted);
  margin: 0 0 32px;
  line-height: 1.55;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.google-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(43, 34, 51, 0.3); }
.google-btn svg { background: #fff; border-radius: 50%; padding: 2px; }

.auth-hint { font-size: 13px; color: var(--muted); margin: 20px 6px 10px; line-height: 1.55; }

.demo-link { font-size: 14px; font-weight: 500; }

/* ---------- app chrome ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 22px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 246, 241, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand-name {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 20px;
}

.top-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.user-photo { width: 26px; height: 26px; border-radius: 50%; }

.link-btn { background: none; border: none; color: var(--accent); font-size: 13px; padding: 2px; }
.link-btn:hover { text-decoration: underline; }

.wrap { max-width: 760px; margin: 0 auto; padding: 30px 20px 120px; }

.greeting-block { margin: 4px 2px 22px; }
.greeting {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 34px;
  letter-spacing: -0.01em;
  margin: 6px 0 6px;
}
.summary { color: var(--muted); font-size: 15px; margin: 0; }
.summary strong { color: var(--accent); font-weight: 600; }

.demo-banner {
  background: var(--gold-soft);
  border: 1px solid #E3D5AE;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 18px;
}

/* ---------- view switcher ---------- */

.view-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  padding: 3px;
  margin-bottom: 22px;
}
.view-btn {
  border: none;
  background: none;
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
}
.view-btn[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 600; }

/* ---------- spotlight ---------- */

.spot-card {
  position: relative;
  background: linear-gradient(180deg, var(--accent-soft), var(--card) 120px);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 18px 8px;
  margin-bottom: 18px;
  overflow: hidden;
}
.spot-card.spot-due { background: linear-gradient(180deg, var(--gold-soft), var(--card) 120px); }
/* funky dashed stripe along the top edge */
.spot-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 9px, transparent 9px 17px);
  opacity: 0.55;
}
.spot-card.spot-due { border-left-color: var(--gold); }
.spot-card.spot-due::before { background: repeating-linear-gradient(90deg, var(--gold) 0 9px, transparent 9px 17px); }
.spot-head { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.spot-head h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.01em;
  margin: 0;
}
.spot-count {
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  min-width: 21px;
  padding: 2px 7px;
  text-align: center;
}
.spot-due .spot-count { background: var(--gold); }

.all-clear {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  background: linear-gradient(180deg, #EAF6EF, var(--card) 110px);
  border: 1px solid var(--line);
  border-left: 3px solid var(--sage);
  border-radius: 16px;
  padding: 18px 18px;
  margin-bottom: 18px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 17px;
  color: #3F6B54;
  overflow: hidden;
}
.all-clear::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--sage) 0 9px, transparent 9px 17px);
  opacity: 0.55;
}
.all-clear::after {
  content: '';
  flex: none;
  order: -1;
  width: 24px;
  height: 24px;
  background: var(--sage);
  opacity: 0.8;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='5.5' r='3.7'/%3E%3Ccircle cx='12' cy='18.5' r='3.7'/%3E%3Ccircle cx='5.5' cy='12' r='3.7'/%3E%3Ccircle cx='18.5' cy='12' r='3.7'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='5.5' r='3.7'/%3E%3Ccircle cx='12' cy='18.5' r='3.7'/%3E%3Ccircle cx='5.5' cy='12' r='3.7'/%3E%3Ccircle cx='18.5' cy='12' r='3.7'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ---------- category sections ---------- */

.cat {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
/* striped band across the top, in the section's own colour */
.cat::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: repeating-linear-gradient(115deg,
    var(--cat, var(--muted)) 0 9px,
    rgba(var(--cat-rgb, 138, 125, 145), 0.28) 9px 18px);
}
/* a bloom in the header band, behind the title — never over a task row */
.cat-head::after {
  content: '';
  position: absolute;
  right: -14px;
  top: -16px;
  width: 74px;
  height: 74px;
  pointer-events: none;
  opacity: 0.13;
  background: var(--cat, var(--muted));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='5' r='4.1'/%3E%3Ccircle cx='12' cy='19' r='4.1'/%3E%3Ccircle cx='5' cy='12' r='4.1'/%3E%3Ccircle cx='19' cy='12' r='4.1'/%3E%3Ccircle cx='7' cy='7' r='3.4'/%3E%3Ccircle cx='17' cy='17' r='3.4'/%3E%3Ccircle cx='17' cy='7' r='3.4'/%3E%3Ccircle cx='7' cy='17' r='3.4'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='5' r='4.1'/%3E%3Ccircle cx='12' cy='19' r='4.1'/%3E%3Ccircle cx='5' cy='12' r='4.1'/%3E%3Ccircle cx='19' cy='12' r='4.1'/%3E%3Ccircle cx='7' cy='7' r='3.4'/%3E%3Ccircle cx='17' cy='17' r='3.4'/%3E%3Ccircle cx='17' cy='7' r='3.4'/%3E%3Ccircle cx='7' cy='17' r='3.4'/%3E%3C/svg%3E") center/contain no-repeat;
}

.cat-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 13px 18px 12px;
  margin-top: 6px;
  overflow: hidden;
  background: rgba(var(--cat-rgb, 138, 125, 145), 0.085);
  border-bottom: 1.5px dashed rgba(var(--cat-rgb, 138, 125, 145), 0.4);
}
.cat-head > * { position: relative; z-index: 1; }
.cat-body { padding: 2px 18px 10px; position: relative; }
/* the section marker is a little four-point star in the section's colour */
.cat-dot-mark {
  flex: none;
  width: 13px;
  height: 13px;
  background: var(--cat, var(--muted));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 8 16 11 24 12C16 13 13 16 12 24C11 16 8 13 0 12C8 11 11 8 12 0Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 8 16 11 24 12C16 13 13 16 12 24C11 16 8 13 0 12C8 11 11 8 12 0Z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.cat-emoji { font-size: 19px; line-height: 1; }
.cat-head h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.01em;
  margin: 0;
}
/* how many things live in this section */
.cat-count {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: rgba(var(--cat-rgb, 138, 125, 145), 0.95);
  filter: saturate(0.8) brightness(0.85);
}

.badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 3px 9px;
}
.badge-overdue { background: var(--accent-soft); color: var(--accent); }
.badge-due { background: var(--gold-soft); color: var(--gold); }

/* add buttons live in the section header, in the section's own colour */
.cat-add {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(var(--cat-rgb, 138, 125, 145), 0.45);
  color: var(--ink);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  white-space: nowrap;
  transition: all 0.12s ease;
}
.cat-add:hover {
  background: var(--cat, var(--ink));
  border-color: var(--cat, var(--ink));
  color: #fff;
}

/* empty sections invite you in rather than just saying "nothing here" */
.cat-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 10px 0 12px;
  padding: 14px 16px;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(var(--cat-rgb, 138, 125, 145), 0.05);
  border: 1.5px dashed rgba(var(--cat-rgb, 138, 125, 145), 0.45);
  border-radius: 12px;
  transition: all 0.12s ease;
}
.cat-empty:hover { color: var(--ink); background: rgba(var(--cat-rgb, 138, 125, 145), 0.11); }
.cat-empty-bloom {
  flex: none;
  width: 20px;
  height: 20px;
  background: var(--cat, var(--muted));
  opacity: 0.75;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='5.5' r='3.7'/%3E%3Ccircle cx='12' cy='18.5' r='3.7'/%3E%3Ccircle cx='5.5' cy='12' r='3.7'/%3E%3Ccircle cx='18.5' cy='12' r='3.7'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='5.5' r='3.7'/%3E%3Ccircle cx='12' cy='18.5' r='3.7'/%3E%3Ccircle cx='5.5' cy='12' r='3.7'/%3E%3Ccircle cx='18.5' cy='12' r='3.7'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ---------- task rows ---------- */

.task {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 0;
  border-top: 1px solid #F3EDE7;
}
.task:first-of-type { border-top: none; }

.tick {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--cat, var(--muted));
  background: transparent;
  font-size: 16px;
  color: transparent;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.tick:hover { transform: scale(1.1); background: rgba(43, 34, 51, 0.03); }
.tick:active { transform: scale(0.92); }
.task.is-done-today .tick {
  background: var(--cat, var(--ink));
  border-color: var(--cat, var(--ink));
  color: #fff;
  animation: pop 0.35s ease;
}

.task-body { flex: 1; min-width: 0; }
.task-name { font-weight: 500; font-size: 15px; overflow-wrap: anywhere; }
.task.is-done-today .task-name { color: var(--muted); }
.task-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.task-meta .due-overdue { color: var(--accent); font-weight: 600; }
.task-meta .due-today { color: var(--gold); font-weight: 600; }
.task-meta .streak { color: var(--gold); font-weight: 600; }

.task-edit {
  flex: none;
  background: none;
  border: none;
  font-size: 14px;
  color: #C4B8CB;
  padding: 8px;
  border-radius: 8px;
}
.task-edit:hover { color: var(--ink); background: #F5F0EA; }

.task-cat-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cat, var(--muted));
  margin-right: 8px;
  white-space: nowrap;
}

/* ---------- calendar filter ---------- */

.cal-filter { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; align-items: center; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.12s ease;
}
.filter-chip .fc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cat, var(--muted)); }
.filter-chip:hover { border-color: var(--ink); color: var(--ink); }
.filter-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter-chip--all[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }

/* ---------- calendar (month) ---------- */

.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.cal-head h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 22px;
  margin: 0;
  flex: 1;
}
.cal-nav {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  line-height: 1;
}
.cal-nav:hover { border-color: var(--ink); }
.cal-today-btn {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
}
.cal-today-btn:hover { border-color: var(--ink); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cal-dow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
}
.cal-cell {
  min-height: 92px;
  padding: 6px;
  border-top: 1px solid #F3EDE7;
  border-left: 1px solid #F3EDE7;
  overflow: hidden;
}
.cal-cell:nth-child(7n + 8) { border-left: none; }
.cal-cell.is-out { background: #FBF8F4; }
.cal-cell.is-out .cal-daynum { color: #D4CBC2; }
.cal-daynum { font-size: 12px; font-weight: 600; color: var(--muted); display: inline-block; padding: 2px 5px; }
.cal-cell.is-today .cal-daynum {
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
}

.cal-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  font-size: 11.5px;
  padding: 2px 4px;
  border-radius: 6px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-chip:hover { background: #F5F0EA; }
.cal-chip .chip-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--cat, var(--muted)); }
.cal-chip.is-done { color: var(--muted); text-decoration: line-through; text-decoration-color: #C4B8CB; }
.cal-chip.is-overdue { color: var(--accent); font-weight: 600; }
/* birthdays get a star instead of a dot, and never look "overdue"-grim */
.cal-chip.is-birthday { font-weight: 600; }
.cal-chip.is-birthday .chip-dot {
  border-radius: 0;
  width: 9px;
  height: 9px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 8 16 11 24 12C16 13 13 16 12 24C11 16 8 13 0 12C8 11 11 8 12 0Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 8 16 11 24 12C16 13 13 16 12 24C11 16 8 13 0 12C8 11 11 8 12 0Z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.cal-chip-name { overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 10.5px; color: var(--muted); padding: 1px 4px; }

/* ---------- calendar (year) ---------- */

.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.year-month {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  text-align: left;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.year-month:hover { border-color: var(--ink); transform: translateY(-1px); }
.year-month.is-current { border-color: var(--accent); }
.year-month h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 16px; margin: 0 0 4px; }
.year-month .ym-count { font-size: 12.5px; color: var(--muted); }
.year-month .ym-dots { display: flex; gap: 4px; margin-top: 9px; min-height: 8px; flex-wrap: wrap; }
.year-month .ym-dots span { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- empty state ---------- */

.empty-state { text-align: center; padding: 52px 20px; }
.empty-state::before {
  content: '';
  display: block;
  width: 46px;
  height: 46px;
  margin: 0 auto 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23C97B5D' fill-opacity='0.55'%3E%3Ccircle cx='12' cy='5.5' r='3.7'/%3E%3Ccircle cx='12' cy='18.5' r='3.7'/%3E%3Ccircle cx='5.5' cy='12' r='3.7'/%3E%3Ccircle cx='18.5' cy='12' r='3.7'/%3E%3C/g%3E%3Ccircle cx='12' cy='12' r='3' fill='%23C9A227' fill-opacity='0.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}
.empty-state h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 26px; margin: 0 0 8px; }
.empty-state p { color: var(--muted); max-width: 400px; margin: 0 auto 24px; line-height: 1.6; }

/* ---------- buttons, fab ---------- */

.primary-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.primary-btn:hover { background: #93325A; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(168, 62, 104, 0.3); }

.ghost-btn {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 500;
}
.ghost-btn:hover { border-color: var(--ink); }

.danger-btn {
  background: none;
  border: 1px solid #E4C2CF;
  color: var(--accent);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 500;
}
.danger-btn:hover { background: var(--accent-soft); }

.fab {
  position: fixed;
  right: 24px;
  bottom: 32px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 26px;
  font-weight: 400;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 10px 26px rgba(43, 34, 51, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
  z-index: 30;
}
.fab:hover { transform: scale(1.06); background: var(--accent); }

/* ---------- modals ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(43, 34, 51, 0.4);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(43, 34, 51, 0.3);
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px 26px 22px;
  animation: rise 0.22s ease;
}
.modal-card h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 23px; margin: 0 0 16px; }
.modal-hint { font-size: 13px; color: var(--muted); margin: -8px 0 16px; line-height: 1.55; }
.field-note { font-size: 12px; color: var(--muted); margin: -10px 0 16px; line-height: 1.5; }

/* birthday modal gets a striped crown */
.modal-card--fancy { position: relative; overflow: hidden; }
.modal-card--fancy::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: repeating-linear-gradient(
    90deg,
    var(--accent) 0 10px, transparent 10px 18px,
    var(--gold) 18px 28px, transparent 28px 36px,
    #6D7FA8 36px 46px, transparent 46px 54px);
  opacity: 0.6;
}
.birthday-age {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 15px;
  color: var(--accent);
  margin: -8px 0 16px;
}

/* birthday rows: a star tick rather than a circle */
.task.is-birthday .tick {
  border: none;
  background: var(--cat, var(--muted));
  color: transparent;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 8 16 11 24 12C16 13 13 16 12 24C11 16 8 13 0 12C8 11 11 8 12 0Z'/%3E%3C/svg%3E") center/78% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 8 16 11 24 12C16 13 13 16 12 24C11 16 8 13 0 12C8 11 11 8 12 0Z'/%3E%3C/svg%3E") center/78% no-repeat;
  opacity: 0.45;
}
.task.is-birthday .tick:hover { opacity: 0.75; background: var(--cat, var(--ink)); }
.task.is-birthday.is-done-today .tick { opacity: 1; }
.task-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.task-note span {
  background: var(--gold-soft);
  color: var(--gold);
  border-radius: 999px;
  padding: 2px 9px;
  font-weight: 600;
  font-size: 11px;
}

.field { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.field input:not([type=radio]), .field select, .field textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #FDFBF9;
  padding: 11px 13px;
  font-size: 15px;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: transparent; }

.sched-field { border: none; padding: 0; margin: 0 0 16px; }
.sched-field legend { padding: 0; margin-bottom: 8px; }

.sched-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.12s ease;
}
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); }

.custom-sched {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
}
.field .custom-sched input { display: inline-block; width: 72px; margin-top: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 15px; background: #FDFBF9; }
.field .custom-sched select { display: inline-block; width: auto; margin-top: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 15px; background: #FDFBF9; }

.form-error { color: var(--accent); font-size: 13.5px; font-weight: 500; }

.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.spacer { flex: 1; }

/* sections editor rows */
.cat-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cat-dot {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--line);
  background: var(--cat, var(--muted));
}
.cat-dot:hover { transform: scale(1.1); }
.cat-row .cat-emoji-input { width: 50px; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 9px 4px; font-size: 16px; background: #FDFBF9; }
.cat-row .cat-name-input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 15px; background: #FDFBF9; }
.cat-del { flex: none; background: none; border: none; color: #C4B8CB; font-size: 16px; padding: 6px 8px; border-radius: 8px; }
.cat-del:hover:not(:disabled) { color: var(--accent); background: var(--accent-soft); }
.cat-del:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 30px rgba(43, 34, 51, 0.4);
  z-index: 50;
  animation: toast-rise 0.2s ease;
  max-width: min(92vw, 480px);
}
@keyframes toast-rise { from { transform: translate(-50%, 10px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.toast-undo { background: none; border: none; color: #E8B4CB; font-weight: 600; font-size: 13.5px; }
.toast-undo:hover { text-decoration: underline; }

/* ---------- confetti ---------- */

#confettiLayer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti-bit {
  position: fixed;
  left: 0;
  top: 0;
  width: 7px;
  height: 11px;
  border-radius: 2px;
  animation: burst var(--dur, 0.9s) cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}
.confetti-bit.is-dot { width: 7px; height: 7px; border-radius: 50%; }

@keyframes burst {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.7); opacity: 0; }
}

/* ---------- footer & keyframes ---------- */

.site-foot {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 14px 16px 26px;
}

@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

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

@media (max-width: 560px) {
  .greeting { font-size: 27px; }
  .topbar { padding: 12px 14px; }
  .user-chip span#userName { display: none; }
  .cal-cell { min-height: 64px; padding: 4px; }
  .cal-chip-name, .cal-more { display: none; }
  .cal-chip { width: auto; padding: 2px; }
  .cal-cell .cal-chips { display: flex; flex-wrap: wrap; gap: 2px; }
}
