/* Trackers kit — the look layer on top of Framework7's iOS theme.
 * Semantic colours only (they flip with dark mode); the per-app accent comes in
 * as --trk-accent from the page. */

:root {
  --trk-accent: #0a84ff;
  --trk-on-accent: #ffffff;
  --trk-bg: #f2f2f7;
  --trk-card: #ffffff;
  --trk-label: #000000;
  --trk-secondary: rgba(60, 60, 67, 0.6);
  --trk-separator: rgba(60, 60, 67, 0.18);
  --trk-fill: rgba(120, 120, 128, 0.12);
  --trk-ring-track: rgba(120, 120, 128, 0.16);
  --trk-warn: #ff9f0a;
  --trk-bad: #ff453a;
  --trk-good: #30d158;
  --f7-font-family: -apple-system, system-ui, "SF Pro Text", "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --trk-bg: #000000; --trk-card: #1c1c1e; --trk-label: #ffffff;
    --trk-secondary: rgba(235, 235, 245, 0.6); --trk-separator: rgba(84, 84, 88, 0.6);
    --trk-fill: rgba(120, 120, 128, 0.24); --trk-ring-track: rgba(120, 120, 128, 0.3);
  }
}
.dark {
  --trk-bg: #000000; --trk-card: #1c1c1e; --trk-label: #ffffff;
  --trk-secondary: rgba(235, 235, 245, 0.6); --trk-separator: rgba(84, 84, 88, 0.6);
  --trk-fill: rgba(120, 120, 128, 0.24); --trk-ring-track: rgba(120, 120, 128, 0.3);
}

.trk-accent { color: var(--trk-accent); }
/* Money's yellow needs dark text on it; blue and green take white. */
body.app-finance { --trk-on-accent: #000000; }
body.app-finance .button-fill { color: #000; }
.trk-muted { color: var(--trk-secondary); }
.trk-center { text-align: center; }
.trk-spacer { height: 120px; }

/* ---------- lock + launcher (plain pages, no Framework7) ---------- */
body.lock {
  margin: 0; min-height: 100vh; background: var(--trk-bg); color: var(--trk-label);
  font-family: -apple-system, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
.lock-wrap, .home-wrap {
  max-width: 420px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 64px) 24px 40px; text-align: center;
}
.lock-icon { width: 84px; height: 84px; border-radius: 19px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.lock-title { font-size: 34px; font-weight: 700; letter-spacing: .3px; margin: 16px 0 6px; }
.lock-sub { color: var(--trk-secondary); font-size: 17px; margin: 0 0 22px; line-height: 1.35; }
.lock-people { display: flex; gap: 16px; justify-content: center; }
.lock-person {
  display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--trk-card); color: var(--trk-label);
  border: 0; border-radius: 20px; padding: 20px 26px; font-size: 17px; font-weight: 600; min-width: 128px;
}
.lock-avatar {
  width: 64px; height: 64px; border-radius: 50%; background: var(--trk-accent); color: #000; display: grid; place-items: center;
  font-size: 28px; font-weight: 700;
}
#pin-input {
  width: 100%; box-sizing: border-box; font-size: 28px; letter-spacing: 10px; text-align: center; padding: 14px;
  border-radius: 14px; border: 0; background: var(--trk-card); color: var(--trk-label); outline: none;
}
.lock-err { color: var(--trk-bad); min-height: 22px; margin: 10px 0; }
.lock-actions { display: flex; flex-direction: column; gap: 12px; }
.lock-go {
  background: var(--trk-accent); color: #000; border: 0; border-radius: 14px; padding: 16px; font-size: 17px; font-weight: 600;
}
.lock-back { background: none; border: 0; color: var(--trk-accent); font-size: 17px; }
.lock-note { color: var(--trk-secondary); font-size: 13px; margin-top: 22px; }
.home-apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 12px; }
.home-app { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--trk-label); text-decoration: none; font-size: 15px; }
.home-app img { width: 72px; height: 72px; border-radius: 16px; box-shadow: 0 6px 18px rgba(0,0,0,.2); }

/* ---------- app chrome ---------- */
.ios { --f7-navbar-large-title-font-size: 34px; }
.page { background: var(--trk-bg); }
.trk-fabs {
  position: fixed; z-index: 5000; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--f7-tabbar-icons-height, 80px) + env(safe-area-inset-bottom) + 6px);
  display: flex; gap: 16px;
}
.trk-fab {
  width: 64px; height: 64px; flex: 0 0 auto; border-radius: 50%; border: 0; background: var(--trk-accent); color: var(--trk-on-accent);
  box-shadow: 0 10px 28px rgba(0,0,0,.28), 0 2px 6px rgba(0,0,0,.2); display: grid; place-items: center;
  transition: transform .15s ease;
}
.trk-fab:active { transform: scale(.92); }
.trk-fab i { font-size: 30px; }
.page-content { padding-bottom: calc(var(--f7-tabbar-icons-height, 80px) + env(safe-area-inset-bottom) + 90px) !important; }
.trk-inbox-badge { position: absolute; top: -4px; right: -10px; }

.trk-toast .toast-content { border-radius: 16px; }

/* ---------- cards & tiles used by the app pages ---------- */
.trk-hero { padding: 4px 16px 0; }
.trk-hero h2 { font-size: 22px; margin: 0 0 4px; }
.trk-hero p { margin: 0; color: var(--trk-secondary); }
.trk-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 16px; }
.trk-tile { background: var(--trk-card); border-radius: 18px; padding: 14px; min-height: 76px; position: relative; overflow: hidden; }
.trk-tile .k { font-size: 13px; color: var(--trk-secondary); font-weight: 500; }
.trk-tile .v { font-size: 26px; font-weight: 700; letter-spacing: -.3px; margin-top: 4px; }
.trk-tile .s { font-size: 13px; color: var(--trk-secondary); margin-top: 2px; }
.trk-tile.wide { grid-column: span 2; }
.trk-tile .trk-spark { color: var(--trk-accent); position: absolute; right: 12px; bottom: 12px; opacity: .9; }
.trk-ring-label { font-size: 13px; font-weight: 700; fill: var(--trk-label); }
.trk-card { background: var(--trk-card); border-radius: 18px; margin: 12px 16px; padding: 16px; }
.trk-card h3 { margin: 0 0 6px; font-size: 17px; }
.trk-ai-card { background: linear-gradient(135deg, color-mix(in srgb, var(--trk-accent) 16%, var(--trk-card)), var(--trk-card)); }
.trk-ai-card .trk-ai-tag { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; font-weight: 600; color: var(--trk-accent); text-transform: uppercase; letter-spacing: .5px; }
.trk-ai-card .trk-ai-tag i { font-size: 14px; }
.trk-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--trk-fill); color: var(--trk-secondary); }
.trk-pill.accent { background: color-mix(in srgb, var(--trk-accent) 20%, transparent); color: var(--trk-accent); }
.trk-empty { text-align: center; color: var(--trk-secondary); padding-top: 40px; }
.trk-empty i { font-size: 48px; opacity: .5; }
.trk-bar { height: 8px; border-radius: 99px; background: var(--trk-ring-track); overflow: hidden; }
.trk-bar > span { display: block; height: 100%; background: var(--trk-accent); border-radius: 99px; }
.trk-row { display: flex; align-items: center; gap: 12px; }
.trk-grow { flex: 1; min-width: 0; }

/* ---------- capture sheet ---------- */
.trk-capture-sheet { height: auto !important; max-height: 94vh; border-radius: 22px 22px 0 0; background: var(--trk-card) !important; }
.trk-capture-sheet .sheet-modal-inner { height: auto; }
.trk-capture-sheet .page-content { position: relative; height: auto; max-height: 94vh; overflow: auto; padding: 8px 18px calc(env(safe-area-inset-bottom) + 16px) !important; box-sizing: border-box; }
/* Framework7 makes every <button> full width; only these small ones opt out. */
.trk-mode, .trk-thumb-x { width: auto; }
.trk-fab { width: 64px; }
.trk-mic { width: 76px; }
.trk-cap-head { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 10px; }
.trk-cap-title { font-size: 22px; font-weight: 700; }
.trk-cap-x i { font-size: 28px; color: var(--trk-secondary); }
.trk-modes { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.trk-mode {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px; border: 0; border-radius: 99px; padding: 8px 14px;
  background: var(--trk-fill); color: var(--trk-label); font-size: 15px; font-weight: 500;
}
.trk-mode i { font-size: 17px; }
.trk-mode.active { background: var(--trk-accent); color: var(--trk-on-accent); }
.trk-cap-hint { color: var(--trk-secondary); font-size: 14px; margin: 10px 0 4px; min-height: 18px; }
.trk-rec { display: flex; align-items: center; gap: 16px; margin: 10px 0; }
.trk-mic {
  width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--trk-accent); color: var(--trk-on-accent); flex: 0 0 auto;
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.2);
}
.trk-mic i { font-size: 34px; }
.is-recording .trk-mic { background: var(--trk-bad); color: #fff; animation: trkPulse 1.4s ease-in-out infinite; }
@keyframes trkPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,69,58,.5); } 50% { box-shadow: 0 0 0 14px rgba(255,69,58,0); } }
.trk-rec-meta { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.trk-wave { width: 100%; height: 40px; }
.trk-rec-time { font-variant-numeric: tabular-nums; color: var(--trk-secondary); font-size: 13px; }
.trk-rec-time:empty::before { content: 'Tap to talk. Say it however it comes out.'; }
.trk-live { font-size: 15px; line-height: 1.4; color: var(--trk-label); min-height: 0; max-height: 120px; overflow: auto; }
.trk-photos { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.trk-thumb { position: relative; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; }
.trk-thumb img { width: 100%; height: 100%; object-fit: cover; }
.trk-thumb-x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; padding: 0; }
.trk-thumb-x i { font-size: 12px; }
.trk-cap-row { display: flex; gap: 8px; margin: 6px 0 10px; }
.trk-chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 12px; background: var(--trk-fill); font-size: 15px; font-weight: 500; }
.trk-chip i { font-size: 18px; color: var(--trk-accent); }
.trk-cap-text {
  width: 100%; box-sizing: border-box; border: 0; border-radius: 14px; background: var(--trk-fill); color: var(--trk-label);
  padding: 12px; font: inherit; font-size: 17px; resize: none; margin-bottom: 12px;
}
.trk-cap-foot { font-size: 12px; color: var(--trk-secondary); text-align: center; margin: 10px 0 0; }

/* ---------- review ---------- */
.trk-review .page-content { background: var(--trk-bg); }
.trk-summary { display: flex; gap: 8px; align-items: flex-start; font-size: 17px; font-weight: 600; margin-top: 18px; }
.trk-summary i { color: var(--trk-accent); font-size: 20px; margin-top: 1px; }
.trk-note { color: var(--trk-secondary); font-size: 15px; line-height: 1.45; margin-top: -8px; white-space: pre-line; }
.trk-draft { border-radius: 18px; margin: 12px 16px; background: var(--trk-card); box-shadow: none; overflow: hidden; }
.trk-draft.excluded { opacity: .45; }
.trk-draft-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 6px; }
.trk-draft-head .checkbox { margin-top: 3px; }
.trk-draft-titles { flex: 1; min-width: 0; }
.trk-draft-title { width: 100%; border: 0; background: none; font: inherit; font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--trk-label); padding: 0; outline: none; resize: none; overflow: hidden; display: block; }
.trk-draft-sub { font-size: 14px; color: var(--trk-secondary); margin-top: 2px; }
.trk-conf { flex: 0 0 auto; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .4px; }
.trk-conf.med { background: rgba(255,159,10,.18); color: var(--trk-warn); }
.trk-conf.low { background: rgba(255,69,58,.16); color: var(--trk-bad); }
.trk-fields { margin: 0 !important; --f7-list-bg-color: transparent; }
.trk-fields .item-content { padding-left: 14px; }
.trk-field-unsure .item-label { color: var(--trk-warn) !important; }
.trk-unsure { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--trk-warn); background: rgba(255,159,10,.16); border-radius: 6px; padding: 1px 5px; margin-left: 4px; }
.trk-input-unit { display: flex; align-items: center; }
.trk-input-unit input { flex: 1; }
.trk-unit { color: var(--trk-secondary); font-size: 15px; padding-left: 6px; }
.trk-why { padding: 0 14px 12px; font-size: 14px; color: var(--trk-secondary); }
.trk-why summary { list-style: none; cursor: pointer; color: var(--trk-accent); font-weight: 500; display: inline-flex; gap: 4px; align-items: center; }
.trk-why summary::-webkit-details-marker { display: none; }
.trk-why summary i { font-size: 14px; }
.trk-why p { margin: 6px 0 0; }
.trk-raw { font-size: 15px; }
.trk-raw audio { width: 100%; margin: 4px 0 8px; }
.trk-raw-text { margin: 6px 0; line-height: 1.4; }
.trk-raw-photos { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 8px; }
.trk-raw-photos img { height: 120px; border-radius: 12px; }
.trk-review-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px);
  background: linear-gradient(to top, var(--trk-bg) 70%, transparent);
}
.trk-review-content { padding-bottom: 140px !important; }

/* ---------- inbox list ---------- */
.trk-inbox-list .item-media i { font-size: 22px; }
.trk-inbox-list .item-title { white-space: normal; font-weight: 600; }
