/* ═══════════════════════════════════════════════════════════
   tidy — soft & friendly: muted pastels, rounded, airy
   ═══════════════════════════════════════════════════════════ */

:root {
  --cream:      #FAF6EF;
  --cream-deep: #F3EDE1;
  --ink:        #3E4239;
  --ink-soft:   #7C8074;
  --ink-faint:  #A9AC9F;

  --sage:       #86A68F;
  --sage-soft:  #DCE8DD;
  --sage-tint:  #EEF4EE;
  --rose:       #D9A5A0;
  --rose-tint:  #F7E9E6;
  --butter:     #E9D8A6;
  --butter-tint:#FAF3DE;
  --sky:        #A8C3CF;
  --sky-tint:   #E7F0F3;
  --lilac:      #B9AECB;
  --lilac-tint: #EEEAF4;

  --card:       #FFFFFF;
  --line:       #EAE4D6;
  --danger:     #C97B72;

  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --shadow-soft: 0 1px 2px rgba(62,66,57,.04), 0 8px 24px rgba(62,66,57,.06);
  --shadow-lift: 0 2px 4px rgba(62,66,57,.05), 0 14px 34px rgba(62,66,57,.10);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Karla", -apple-system, sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }

body {
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* subtle atmosphere: two soft pastel washes */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(60% 40% at 85% -5%, var(--rose-tint) 0%, transparent 70%),
    radial-gradient(70% 45% at 5% 100%, var(--sage-tint) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 20px) 20px calc(var(--safe-bottom) + 100px);
}

.hidden { display: none !important; }

/* ── type ─────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
h2 { font-size: 28px; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--sage);
  margin-bottom: 2px;
}

/* ── auth ─────────────────────────────────────────────────── */
.auth-card {
  margin-top: 8vh;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 36px 26px 30px;
  text-align: center;
  animation: rise .5s ease both;
}
.brand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; color: var(--sage); }
.brand h1 { font-size: 40px; font-weight: 600; }
.tagline { color: var(--ink-soft); margin: 14px 0 28px; font-size: 15px; }

#auth-form { text-align: left; }
.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block; font-size: 12px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 7px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  font: inherit;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none;
}
.field input:focus { border-color: var(--sage); background: #fff; }
.field input::placeholder { color: var(--ink-faint); }

.form-error { color: var(--danger); font-size: 13.5px; min-height: 18px; margin: -6px 0 8px; }

.link-btn {
  background: none; border: none; font: inherit;
  color: var(--ink-soft); cursor: pointer; margin-top: 18px;
}
.link-btn strong { color: var(--sage); }

/* ── buttons ──────────────────────────────────────────────── */
.btn {
  font: inherit; font-weight: 700;
  border: none; border-radius: 999px;
  padding: 14px 22px; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  width: 100%;
  background: var(--sage); color: #fff;
  box-shadow: 0 6px 16px rgba(134,166,143,.35);
}
.btn-primary:disabled { opacity: .6; }
.btn-ghost { background: var(--cream-deep); color: var(--ink-soft); }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 50%; cursor: pointer; color: var(--ink);
  box-shadow: var(--shadow-soft);
  transition: transform .12s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }

/* ── topbar ───────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 22px;
  animation: rise .45s ease both;
}

/* ── today cards ──────────────────────────────────────────── */
.cards { display: flex; flex-direction: column; gap: 14px; }

.chore-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 22px 20px 18px;
  overflow: hidden;
  animation: rise .5s ease both;
}
.chore-card:nth-child(2) { animation-delay: .08s; }
.chore-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--accent, var(--sage));
}
.chore-card .area-chip {
  display: inline-block;
  font-size: 11.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
  background: var(--accent-tint, var(--sage-tint));
  color: var(--accent, var(--sage));
  margin-bottom: 12px;
}
.chore-card h3 { font-size: 21px; line-height: 1.25; margin-bottom: 4px; }
.chore-card .meta { font-size: 13px; color: var(--ink-faint); margin-bottom: 16px; }

.card-actions { display: flex; gap: 10px; }
.do-btn {
  flex: 1;
  font: inherit; font-weight: 700;
  padding: 12px; border: none; border-radius: 999px;
  background: var(--accent, var(--sage)); color: #fff;
  cursor: pointer;
  transition: transform .12s, opacity .2s;
}
.do-btn:active { transform: scale(.97); }
.snooze-btn {
  font: inherit; font-weight: 600;
  padding: 12px 16px;
  background: var(--cream-deep); color: var(--ink-soft);
  border: none; border-radius: 999px; cursor: pointer;
}

/* done state */
.chore-card.done { animation: pop-done .45s ease both; }
.chore-card.done h3 { text-decoration: line-through; color: var(--ink-faint); }
.chore-card.done .do-btn { background: var(--sage-tint); color: var(--sage); }

.empty {
  text-align: center; padding: 60px 20px;
  color: var(--ink-soft);
  animation: rise .5s ease both;
}
.empty-spark { font-size: 42px; color: var(--butter); margin-bottom: 14px; }

.offline-pill {
  margin: 22px auto 0; width: fit-content;
  font-size: 12.5px; font-weight: 700;
  color: var(--ink-soft);
  background: var(--butter-tint);
  border: 1.5px dashed var(--butter);
  padding: 8px 16px; border-radius: 999px;
}

/* ── all-chores list ──────────────────────────────────────── */
#chore-list { display: flex; flex-direction: column; gap: 10px; }

.list-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
  animation: rise .4s ease both;
}
.list-item .dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--accent, var(--sage)); }
.list-item .info { flex: 1; min-width: 0; }
.list-item .info strong { display: block; font-size: 15px; line-height: 1.3; }
.list-item .info small { color: var(--ink-faint); font-size: 12.5px; }
.list-item .snoozed-tag {
  font-size: 11px; font-weight: 700; color: var(--rose);
  background: var(--rose-tint); padding: 3px 9px; border-radius: 999px;
}
.list-item button {
  background: none; border: none; cursor: pointer;
  color: var(--ink-faint); padding: 8px; border-radius: 10px;
  font-size: 16px; line-height: 1;
}
.list-item button:active { background: var(--cream-deep); }

/* ── tab bar ──────────────────────────────────────────────── */
.tabbar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-bottom) + 14px);
  display: flex; gap: 4px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px;
  box-shadow: var(--shadow-lift);
  z-index: 50;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font: inherit; font-size: 11px; font-weight: 700;
  color: var(--ink-faint);
  background: none; border: none; border-radius: 999px;
  padding: 8px 22px 6px; cursor: pointer;
  transition: color .15s, background .15s;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--sage); background: var(--sage-tint); }

/* ── sheets ───────────────────────────────────────────────── */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(62,66,57,.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 90;
  animation: fade .2s ease both;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  margin: 0 auto; max-width: 480px;
  background: var(--card);
  border-radius: 28px 28px 0 0;
  padding: 10px 24px calc(var(--safe-bottom) + 26px);
  box-shadow: 0 -12px 40px rgba(62,66,57,.16);
  z-index: 100;
  animation: sheet-up .32s cubic-bezier(.32,.72,.25,1) both;
}
.sheet-grab { width: 42px; height: 5px; border-radius: 999px; background: var(--line); margin: 4px auto 18px; }
.sheet h3 { font-size: 24px; margin-bottom: 20px; }
.sheet-actions { display: flex; gap: 12px; margin-top: 6px; }
.sheet-actions .btn { flex: 1; }

/* segmented controls */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 9px 14px;
  background: var(--cream); color: var(--ink-soft);
  border: 1.5px solid var(--line); border-radius: 999px;
  cursor: pointer; transition: all .15s;
}
.seg button.on {
  background: var(--sage-tint); color: var(--sage);
  border-color: var(--sage);
}

.settings-rows { margin-top: 10px; }
.row-btn {
  width: 100%; font: inherit; font-weight: 700;
  text-align: left; padding: 15px 4px;
  background: none; border: none; border-top: 1.5px solid var(--line);
  color: var(--danger); cursor: pointer;
}

/* snooze menu */
.snooze-menu {
  position: fixed; z-index: 120;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  padding: 6px;
  display: flex; flex-direction: column; min-width: 190px;
  animation: pop-in .18s ease both;
}
.snooze-menu button {
  font: inherit; font-size: 14.5px; font-weight: 600;
  text-align: left; padding: 11px 14px;
  background: none; border: none; border-radius: 10px;
  color: var(--ink); cursor: pointer;
}
.snooze-menu button:active { background: var(--cream-deep); }
.snooze-menu button.danger { color: var(--danger); }

/* toast */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-bottom) + 92px);
  background: var(--ink); color: var(--cream);
  font-size: 14px; font-weight: 600;
  padding: 12px 22px; border-radius: 999px;
  box-shadow: var(--shadow-lift);
  z-index: 200;
  animation: toast-in .3s ease both;
}

/* ── animations ───────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes pop-done {
  0% { transform: scale(1); }
  40% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

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