/* Life App — shared components. Sections reference tokens only; no hardcoded colors here. */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.app { max-width: 440px; margin: 0 auto; min-height: 100vh; background: var(--bg); overflow-x: hidden; }
.serif { font-family: var(--font-serif); }

/* ── Top bar (section pages) ─────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top, 0)) 18px 12px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.topbar .back {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--hairline);
  color: var(--accent); text-decoration: none; flex: none;
}
.topbar h1 { font-family: var(--font-serif); font-weight: 500; font-size: 22px; color: var(--ink); flex: 1; }
.topbar .count { font-weight: 700; font-size: 11px; color: var(--accent-soft); letter-spacing: 0.06em; }

/* ── Cards & labels ──────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 15px 16px;
  box-shadow: var(--shadow);
}
.lbl {
  font-weight: 700; font-size: 9px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--sage);
}
.eyebrow {
  font-weight: 700; font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--blush);
}
.body { padding: 17px 18px 96px; display: flex; flex-direction: column; gap: 13px; }

/* ── Pills & chips ───────────────────────────────────────── */
.pill {
  font-weight: 700; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 7px; padding: 3px 8px;
  background: var(--chip-soft-bg); color: var(--chip-soft-text);
}
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  font-family: var(--font-sans); font-weight: 700; font-size: 12px;
  padding: 7px 13px; border-radius: 999px; white-space: nowrap; cursor: pointer;
  background: var(--surface); color: var(--ink-soft);
  border: 1px solid var(--hairline);
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--surface); }

/* ── Bloom (the FocusBloom signature). On sheets/toggles it's a plain on/off
   control (.done). On task rows it flags TODAY'S FOCUS — a separate idea
   from completion, which is the check-circle below. ── */
.bloom { width: 26px; height: 26px; flex: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bloom.small { width: 20px; height: 20px; }
.bloom svg { width: 100%; height: 100%; display: block; }
.bloom .petal { fill: none; stroke: var(--check-border); stroke-width: 1.5; transition: 0.18s; }
.bloom .core { fill: var(--check-border); transition: 0.18s; }
.bloom.done .petal, .bloom.flagged .petal { fill: var(--terracotta); stroke: var(--terracotta); }
.bloom.done .core, .bloom.flagged .core { fill: var(--bg); }

/* ── Check circle — the actual completion control ────────── */
.check-circle { width: 23px; height: 23px; flex: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.check-circle svg { width: 100%; height: 100%; display: block; }
.check-circle .ring { fill: none; stroke: var(--check-border); stroke-width: 1.6; transition: 0.18s; }
.check-circle .tick { fill: none; stroke: var(--surface); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: 0.18s; }
.check-circle.done .ring { fill: var(--sage); stroke: var(--sage); }
.check-circle.done .tick { opacity: 1; }

.rowline { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.rowline .t { flex: 1; font-size: 14px; font-weight: 600; color: var(--ink); }
.rowline.done .t { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--hairline-strong); }

/* ── Tile grid (home navigation) ─────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-top: 2px; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  cursor: pointer; background: none; border: none; padding: 0;
  font-family: inherit; text-decoration: none;
}
.tile .ic {
  width: 100%; height: 74px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: 0.15s;
}
.tile:active .ic { transform: scale(0.96); }
.tile span:last-child { font-weight: 600; font-size: 11px; color: var(--ink-soft); }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink); color: var(--bg);
  font-size: 13px; font-weight: 600; padding: 11px 18px; border-radius: 14px;
  opacity: 0; transition: 0.25s; pointer-events: none; z-index: 99;
  box-shadow: var(--shadow-lift);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── FAB ─────────────────────────────────────────────────── */
.fab {
  position: fixed; right: max(18px, calc(50% - 202px)); bottom: 26px; z-index: 30;
  width: 54px; height: 54px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: var(--surface);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lift); transition: 0.15s;
}
.fab:active { transform: scale(0.94); }

/* ── Modal sheet ─────────────────────────────────────────── */
.sheet-veil {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(58, 42, 46, 0.34);
  opacity: 0; pointer-events: none; transition: 0.22s;
}
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 41;
  width: 100%; max-width: 440px;
  transform: translateX(-50%) translateY(104%); transition: 0.26s ease;
  background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom, 0));
  max-height: 86vh; overflow-y: auto;
}
.sheet-open .sheet-veil { opacity: 1; pointer-events: auto; }
.sheet-open .sheet { transform: translateX(-50%) translateY(0); }
.sheet .grab { width: 38px; height: 4px; border-radius: 2px; background: var(--hairline-strong); margin: 4px auto 14px; }
.sheet h2 { font-family: var(--font-serif); font-weight: 500; font-size: 21px; margin-bottom: 14px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 700; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; font-family: var(--font-sans); font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm); padding: 11px 12px; outline: none; appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent-soft); }
.btn {
  width: 100%; border: none; cursor: pointer; font-family: var(--font-sans);
  font-weight: 700; font-size: 15px; padding: 14px; border-radius: 14px;
  background: var(--accent); color: var(--surface); margin-top: 6px;
}
.btn.quiet { background: none; color: var(--ink-soft); font-weight: 600; padding: 10px; margin-top: 2px; }

/* ── Wildflower bottom tab bar ───────────────────────────── */
.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 35;
  width: 100%; max-width: 440px;
  display: flex; align-items: center; justify-content: space-around;
  padding: 10px 8px calc(12px + env(safe-area-inset-bottom, 0));
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--hairline);
}
.tab { display: flex; align-items: center; justify-content: center; width: 44px; height: 34px; text-decoration: none;
       -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.tab-serif { font-family: var(--font-serif); font-style: italic; font-weight: 600; font-size: 27px; line-height: 1; }
.has-tabbar .body { padding-bottom: 120px; }
.has-tabbar .fab { bottom: calc(74px + env(safe-area-inset-bottom, 0)); }

/* ── Small helpers ───────────────────────────────────────── */
.empty { text-align: center; padding: 26px 18px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.55; }
.empty .serif { font-size: 17px; font-style: italic; color: var(--ink); display: block; margin-bottom: 6px; }
.divider { height: 1px; background: var(--hairline); border: none; margin: 2px 0; }
.tap { -webkit-tap-highlight-color: transparent; }
