/* app.css — Qeydlər design system. Warm, spiritual, green. */
/* Fonts loaded via <link> in _base.html — no @import needed here */

/* ───────────── Tokens ───────────── */
:root {
  --hue: 150;
  --bg: oklch(0.967 0.014 92);
  --bg-2: oklch(0.935 0.02 92);
  --card: oklch(0.995 0.006 92);
  --card-2: oklch(0.955 0.014 92);
  --ink: oklch(0.275 0.02 145);
  --ink-2: oklch(0.46 0.02 140);
  --ink-3: oklch(0.62 0.016 135);
  --line: oklch(0.9 0.013 95);
  --line-2: oklch(0.86 0.016 95);
  --primary: oklch(0.55 0.088 var(--hue));
  --primary-strong: oklch(0.46 0.092 var(--hue));
  --primary-soft: oklch(0.95 0.032 var(--hue));
  --primary-soft-2: oklch(0.9 0.05 var(--hue));
  --on-primary: oklch(0.99 0.01 var(--hue));
  --accent: oklch(0.7 0.1 70);
  --accent-soft: oklch(0.93 0.05 75);
  --accent-ink: oklch(0.45 0.09 60);
  --danger: oklch(0.57 0.14 28);
  --danger-soft: oklch(0.94 0.04 30);
  --shadow-sm: 0 1px 2px oklch(0.4 0.03 140 / 0.06), 0 2px 8px oklch(0.4 0.03 140 / 0.06);
  --shadow-md: 0 4px 14px oklch(0.4 0.03 140 / 0.1), 0 1px 3px oklch(0.4 0.03 140 / 0.07);
  --shadow-lg: 0 14px 40px oklch(0.35 0.04 140 / 0.18);
  --r-card: 20px; --r-lg: 26px; --r-md: 15px; --r-sm: 11px; --r-pill: 999px;
}

body.dark {
  --bg: oklch(0.195 0.016 152);
  --bg-2: oklch(0.165 0.014 152);
  --card: oklch(0.245 0.018 152);
  --card-2: oklch(0.29 0.02 152);
  --ink: oklch(0.95 0.012 95);
  --ink-2: oklch(0.75 0.016 110);
  --ink-3: oklch(0.58 0.016 120);
  --line: oklch(0.32 0.015 152);
  --line-2: oklch(0.38 0.017 152);
  --primary: oklch(0.74 0.1 var(--hue));
  --primary-strong: oklch(0.82 0.1 var(--hue));
  --primary-soft: oklch(0.3 0.05 var(--hue));
  --primary-soft-2: oklch(0.37 0.055 var(--hue));
  --on-primary: oklch(0.17 0.025 152);
  --accent: oklch(0.79 0.095 74);
  --accent-soft: oklch(0.33 0.055 72);
  --accent-ink: oklch(0.82 0.09 76);
  --danger: oklch(0.68 0.14 30);
  --danger-soft: oklch(0.32 0.07 30);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.4);
  --shadow-lg: 0 14px 40px rgba(0,0,0,0.5);
}

/* ───────────── Base ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
}

/* ───────────── App shell ───────────── */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}

/* Content blocks that fill the shell */
.app > .scroll,
.app > .fade-in {
  flex: 1;
  min-height: 0;
}

/* Detail page wrappers */
.app > .fade-in {
  display: flex;
  flex-direction: column;
}

.scroll {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 0 18px 120px;
  flex: 1;
  min-height: 0;
}
.scroll::-webkit-scrollbar { width: 0; }

/* ───────────── App header ───────────── */
.app-header {
  padding: 16px 4px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.greet-hi { font-size: 13.5px; color: var(--ink-3); font-weight: 700; }
.greet-name { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-size: 26px; font-weight: 600; color: var(--ink); line-height: 1.1; }
.header-actions { display: flex; gap: 8px; align-items: center; }

/* Page title */
.page-head { padding: 14px 4px 14px; flex-shrink: 0; }
.page-kicker { font-size: 12.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary); }
.page-title { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-size: 30px; font-weight: 600; color: var(--ink); line-height: 1.08; margin-top: 2px; }
.page-sub { color: var(--ink-3); font-size: 14px; font-weight: 600; margin-top: 3px; }

/* ───────────── Cards ───────────── */
.card {
  background: var(--card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.card-pad { padding: 16px; }
.card-pad-sm { padding: 12px; }
.card-pad-xs { padding: 8px; }
.card-tap { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.card-tap:active { transform: scale(0.985); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }

/* Section header */
.sec-hd { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 10px; flex-shrink: 0; }
.sec-hd-l { display: flex; align-items: center; gap: 10px; }
.sec-hd-ic {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--primary-soft); color: var(--primary-strong);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sec-hd-ic svg { width: 18px; height: 18px; }
.sec-title { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-size: 18px; font-weight: 600; margin: 0; color: var(--ink); }
.sec-sub { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.sec-action {
  display: flex; align-items: center; gap: 4px;
  background: var(--primary-soft); color: var(--primary-strong);
  border: none; border-radius: var(--r-pill); padding: 6px 12px 6px 9px;
  font-family: 'Nunito', system-ui, sans-serif; font-size: 13px; font-weight: 800; cursor: pointer;
  transition: background .15s; text-decoration: none; white-space: nowrap;
}
.sec-action:active { background: var(--primary-soft-2); }
.sec-action svg { width: 16px; height: 16px; }

/* ───────────── Buttons ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: 'Nunito', system-ui, sans-serif; font-weight: 800; border: none; cursor: pointer;
  border-radius: var(--r-pill); transition: transform .12s, background .15s;
  white-space: nowrap; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn svg { flex-shrink: 0; }
.btn-md { padding: 12px 18px; font-size: 15px; }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }
.btn-full { width: 100%; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 4px 14px oklch(0.55 0.09 var(--hue) / 0.3); }
.btn-primary:active { background: var(--primary-strong); }
.btn-soft { background: var(--primary-soft); color: var(--primary-strong); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:active { background: var(--bg-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-outline { background: var(--card); color: var(--ink); border: 1.5px solid var(--line-2); }

.icon-btn {
  display: flex; align-items: center; justify-content: center; border: none;
  cursor: pointer; width: 40px; height: 40px; border-radius: 13px;
  color: var(--ink-2); transition: background .15s, transform .12s;
  background: transparent; text-decoration: none; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn-soft { background: var(--bg-2); color: var(--ink-2); }
.icon-btn-card { background: var(--card); border: 1px solid var(--line); color: var(--ink-2); }
.icon-btn-glass { background: color-mix(in oklab, var(--on-primary) 18%, transparent); color: var(--on-primary); }
.icon-btn svg { width: 20px; height: 20px; pointer-events: none; }

/* FAB */
.fab {
  position: fixed; right: 18px; bottom: 88px; z-index: 40;
  width: 58px; height: 58px; border-radius: 20px; border: none; cursor: pointer;
  background: var(--primary); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px oklch(0.5 0.1 var(--hue) / 0.45), 0 2px 6px rgba(0,0,0,0.15);
  transition: transform .15s; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.fab:active { transform: scale(0.92) rotate(90deg); }
.fab svg { width: 24px; height: 24px; pointer-events: none; }

/* ───────────── Chips / tags ───────────── */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: var(--r-pill);
  font-family: 'Nunito', system-ui, sans-serif; font-size: 13px; font-weight: 700;
  border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink-2);
  cursor: default; transition: all .14s;
}
.chip-tap { cursor: pointer; }
.chip-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-strong); }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 800;
}
.tag svg { width: 12px; height: 12px; }
.tag-neutral { background: var(--bg-2); color: var(--ink-2); }
.tag-primary { background: var(--primary-soft); color: var(--primary-strong); }
.tag-accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Status badge */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: var(--r-pill); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-plan { background: var(--accent-soft); color: var(--accent-ink); }
.status-plan .status-dot { background: var(--accent); }
.status-done { background: var(--primary-soft); color: var(--primary-strong); }
.status-done .status-dot { background: var(--primary); }

/* Date pill */
.datepill {
  width: 46px; height: 50px; border-radius: 14px;
  background: var(--primary-soft); color: var(--primary-strong);
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0;
}
.datepill-d { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-size: 20px; font-weight: 600; line-height: 1; }
.datepill-m { font-size: 10.5px; font-weight: 800; text-transform: uppercase; opacity: 0.8; margin-top: 1px; }
.datepill-big { width: 54px; height: 58px; }
.datepill-big .datepill-d { font-size: 24px; }
.datepill-accent { background: var(--accent-soft); color: var(--accent-ink); }

/* Avatar */
.avatar {
  border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-weight: 600; flex-shrink: 0; letter-spacing: 0.02em;
}

/* Stat */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 13px 10px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
}
.stat-ic { color: var(--primary); margin-bottom: 5px; }
.stat-ic svg { width: 18px; height: 18px; }
.stat-v { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-size: 23px; font-weight: 600; color: var(--ink); line-height: 1.1; }
.stat-l { font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.stat-accent .stat-ic { color: var(--accent); }

/* Progress */
.prog { height: 7px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.prog-fill { height: 100%; background: var(--primary); border-radius: 999px; }

/* Empty state */
.empty { text-align: center; padding: 34px 20px; color: var(--ink-3); }
.empty-ic {
  display: inline-flex; width: 60px; height: 60px; align-items: center; justify-content: center;
  border-radius: 18px; background: var(--bg-2); color: var(--ink-3); margin-bottom: 12px;
}
.empty-ic svg { width: 28px; height: 28px; }
.empty-t { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-size: 16px; font-weight: 500; color: var(--ink-2); }
.empty-s { font-size: 13px; font-weight: 600; margin-top: 4px; max-width: 230px; margin-inline: auto; }

/* ───────────── Bottom nav ───────────── */
.bottomnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 45;
  padding: 6px 14px max(20px, env(safe-area-inset-bottom, 20px));
  display: flex; justify-content: space-around; align-items: stretch;
  background: color-mix(in oklab, var(--card) 88%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid var(--line);
}
.navitem {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px 2px; color: var(--ink-3); flex: 1;
  transition: color .15s; position: relative; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.navitem span { font-size: 10.5px; font-weight: 800; }
.navitem svg { width: 23px; height: 23px; }
.navitem-on { color: var(--primary); }
.navitem-on::before {
  content: ''; position: absolute; top: -6px;
  width: 26px; height: 3px; border-radius: 3px; background: var(--primary);
}

/* ───────────── Forms ───────────── */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field-lbl { font-size: 13.5px; font-weight: 800; color: var(--ink-2); }
.field-hint { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.input {
  font-family: 'Nunito', system-ui, sans-serif; font-size: 15px; font-weight: 600; color: var(--ink);
  background: var(--bg-2); border: 1.5px solid transparent;
  border-radius: var(--r-md); padding: 13px 14px;
  width: 100%; outline: none; transition: border-color .15s, background .15s;
  -webkit-appearance: none;
}
.input::placeholder { color: var(--ink-3); font-weight: 600; }
.input:focus { border-color: var(--primary); background: var(--card); }
textarea.input { resize: none; line-height: 1.5; }
select.input { cursor: pointer; }

/* Segmented control (radio buttons styled) */
.segmented { display: flex; gap: 4px; background: var(--bg-2); border-radius: var(--r-md); padding: 4px; }
.segmented input[type="radio"] { display: none; }
.segmented label {
  flex: 1; border: none; background: transparent;
  font-family: 'Nunito', system-ui, sans-serif; font-size: 13.5px; font-weight: 800;
  color: var(--ink-2); padding: 9px 6px; border-radius: 11px; cursor: pointer;
  transition: all .15s; text-align: center; display: block;
}
.segmented input[type="radio"]:checked + label {
  background: var(--card); color: var(--primary-strong); box-shadow: var(--shadow-sm);
}

/* Chip checkboxes */
.chip-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-checks input[type="checkbox"] { display: none; }
.chip-checks label {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: var(--r-pill);
  font-family: 'Nunito', system-ui, sans-serif; font-size: 13px; font-weight: 700;
  border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink-2);
  cursor: pointer; transition: all .14s;
}
.chip-checks input[type="checkbox"]:checked + label {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary);
}
.chip-checks label svg { width: 14px; height: 14px; }

/* Person picker */
.ppick { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.ppick input[type="checkbox"],
.ppick input[type="radio"] { display: none; }
.ppick-row {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px;
  border-radius: var(--r-md); border: 1.5px solid var(--line);
  background: var(--card); cursor: pointer; transition: all .14s; width: 100%;
  font-family: 'Nunito', system-ui, sans-serif; text-align: left;
}
.ppick-name { flex: 1; font-weight: 700; font-size: 14px; color: var(--ink); }
.ppick-check {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2);
  color: transparent; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ppick-row:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.ppick-row:has(input:checked) .ppick-check {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary);
}

/* ───────────── Sheet (bottom drawer) ───────────── */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 80;
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
.sheet-wrap.sheet-shown { pointer-events: all; opacity: 1; }
.sheet-backdrop {
  position: absolute; inset: 0;
  background: oklch(0.2 0.02 150 / 0.48);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.sheet {
  position: absolute; left: 50%; transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: 480px; bottom: 0;
  background: var(--bg); border-radius: 28px 28px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
  max-height: 88vh; max-height: 88dvh;
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform .26s cubic-bezier(.32,.72,.3,1);
}
.sheet-wrap.sheet-shown .sheet { transform: translateX(-50%) translateY(0); }
/* Form .sheet-body və .sheet-foot-u əhatə edir — flex zəncirini davam etdir ki,
   body scroll etsin və foot (submit) həmişə görünsün */
.sheet > form {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
}
.sheet-grab {
  width: 40px; height: 5px; border-radius: 3px;
  background: var(--line-2); margin: 10px auto 2px; cursor: pointer; flex-shrink: 0;
}
.sheet-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 10px 22px; flex-shrink: 0;
}
.sheet-hd h3 { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-size: 21px; font-weight: 600; margin: 0; color: var(--ink); }
.sheet-body { padding: 4px 22px 8px; overflow-y: auto; flex: 1; min-height: 0; }
.sheet-body::-webkit-scrollbar { width: 0; }
.sheet-foot {
  padding: 12px 22px max(16px, env(safe-area-inset-bottom, 16px));
  border-top: 1px solid var(--line);
  display: flex; gap: 10px; background: var(--bg); flex-shrink: 0;
}
.sheet-foot .btn { flex: 1; }

/* ───────────── Detail header ───────────── */
.detail-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 12px; flex-shrink: 0;
}
.detail-hd-accent {
  background: var(--primary); color: var(--on-primary); padding-bottom: 22px;
  border-radius: 0 0 24px 24px;
}
.detail-hd-accent .icon-btn { background: color-mix(in oklab, var(--on-primary) 18%, transparent); color: var(--on-primary); }
.detail-hd-accent .icon-btn-card { background: color-mix(in oklab, var(--on-primary) 18%, transparent); color: var(--on-primary); border-color: transparent; }
.detail-title { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-size: 19px; font-weight: 600; margin: 0; flex: 1; line-height: 1.15; }
.detail-hd-r { display: flex; gap: 6px; }

/* ───────────── Misc list rows ───────────── */
.row { display: flex; align-items: center; gap: 13px; }
.divider { height: 1px; background: var(--line); margin: 2px 0; }
.muted { color: var(--ink-3); }
.meta { font-size: 13px; color: var(--ink-3); font-weight: 700; }
.tnum { font-variant-numeric: tabular-nums; }

/* Note checkboxes */
.note-check {
  width: 23px; height: 23px; border-radius: 8px; border: 2px solid var(--line-2);
  background: var(--card); display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; color: var(--on-primary); transition: all .15s;
  border: none; padding: 0;
}
.note-check.on { background: var(--primary); outline: 2px solid var(--primary); }
.note-check svg { width: 13px; height: 13px; }
.note-del { border: none; background: none; color: var(--ink-3); cursor: pointer; padding: 4px; border-radius: 8px; display: flex; }
.note-del:active { background: var(--bg-2); }
.note-del svg { width: 15px; height: 15px; }

/* People list */
.person-card { display: flex; align-items: center; gap: 13px; }
.person-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.ind { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.ind svg { width: 12px; height: 12px; }
.ind-yes { background: var(--primary-soft); color: var(--primary-strong); }
.ind-mid { background: var(--accent-soft); color: var(--accent-ink); }
.ind-no { background: var(--bg-2); color: var(--ink-3); }

/* Search */
.searchbar {
  display: flex; align-items: center; gap: 9px; background: var(--bg-2);
  border-radius: var(--r-md); padding: 11px 14px; color: var(--ink-3); flex-shrink: 0;
}
.searchbar input {
  flex: 1; border: none; background: none; outline: none;
  font-family: 'Nunito', system-ui, sans-serif; font-size: 15px; font-weight: 600; color: var(--ink);
}
.searchbar input::placeholder { color: var(--ink-3); }
.searchbar svg { width: 19px; height: 19px; }

/* Info rows in detail */
.inforow { display: flex; align-items: center; gap: 12px; padding: 13px 0; }
.inforow + .inforow { border-top: 1px solid var(--line); }
.inforow-ic {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary-strong);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.inforow-ic svg { width: 19px; height: 19px; }
.inforow-l { flex: 1; }
.inforow-k { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.inforow-v { font-size: 15px; font-weight: 800; color: var(--ink); }

/* Timeline */
.tl { position: relative; padding-left: 26px; }
.tl::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 6px 0 14px; }
.tl-dot { position: absolute; left: -26px; top: 7px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); border: 3px solid var(--primary); }
.tl-date { font-size: 12px; font-weight: 800; color: var(--primary-strong); }
.tl-type { font-weight: 800; font-size: 14.5px; color: var(--ink); margin-top: 1px; }
.tl-note { font-size: 13.5px; color: var(--ink-2); font-weight: 600; margin-top: 2px; }

/* Detail hero */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 4px 0 6px; }
.hero .avatar { box-shadow: 0 6px 18px rgba(0,0,0,0.18); margin-bottom: 4px; }
.hero-name { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-size: 23px; font-weight: 600; }
.hero-sub { font-size: 13.5px; font-weight: 700; opacity: 0.85; }

.label-h {
  font-family: 'Nunito', system-ui, sans-serif; font-size: 12.5px; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-3); margin: 20px 2px 9px; display: block;
}

/* Animations */
.fade-in { animation: fadeUp .3s cubic-bezier(.3,.7,.4,1) both; }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ───────────── Charts ───────────── */
.barrow-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.barrow-lbl { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.barrow-lbl svg { width: 14px; height: 14px; }
.barrow-val { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-weight: 600; font-size: 15px; color: var(--ink); }
.barrow-track { height: 9px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.barrow-fill { height: 100%; border-radius: 999px; }
.fill-primary { background: var(--primary); }
.fill-accent { background: var(--accent); }

.rank {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-strong);
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-weight: 600; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ───────────── Messages ───────────── */
.msg { padding: 10px 14px; border-radius: var(--r-md); font-size: 13.5px; font-weight: 700; margin-bottom: 10px; }
.msg-success { background: var(--primary-soft); color: var(--primary-strong); }
.msg-error { background: var(--danger-soft); color: var(--danger); }

/* ───────────── Utils ───────────── */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.gap-sm { display: flex; gap: 9px; }
.gap-xs { display: flex; gap: 6px; }

/* ───────────── Desktop: phone-card on gradient stage ───────────── */
@media (min-width: 540px) {
  html, body {
    height: 100%;
  }
  body {
    background:
      radial-gradient(120% 80% at 50% -10%, oklch(0.93 0.04 145) 0%, transparent 60%),
      linear-gradient(160deg, oklch(0.9 0.025 90) 0%, oklch(0.85 0.03 145) 100%);
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }
  body.dark {
    background:
      radial-gradient(120% 80% at 50% -10%, oklch(0.3 0.04 150) 0%, transparent 55%),
      linear-gradient(160deg, oklch(0.16 0.02 150) 0%, oklch(0.12 0.015 150) 100%);
  }
  .app {
    width: 430px;
    max-width: 430px;
    flex-shrink: 0;
    box-shadow:
      0 0 0 1px oklch(0.8 0.03 130 / 0.4),
      0 0 0 1.5px oklch(0.97 0.01 90 / 0.3) inset,
      0 30px 80px oklch(0.35 0.04 140 / 0.25),
      0 8px 20px oklch(0.35 0.04 140 / 0.12);
    border-radius: 24px 24px 0 0;
  }
  .fab {
    /* Position 18px from right edge of centered 430px container */
    right: calc(50vw - 215px + 18px);
  }
  .bottomnav {
    max-width: 430px;
  }
  .sheet {
    max-width: 430px;
  }
}
