/* Side by Side: Trail (light) and Ember (dark) themes. */
:root {
  --bg: #ECE9E1; --card: #FAF8F3; --ink: #1F2119; --ink2: #45463C; --muted: #66665A;
  --line: #DCD8CC; --border: #CFCABD; --neutral: #EEEBE3; --field: #F3F0E8;
  --you: #4E6A36; --you-hover: #3D5429; --you-soft: #E4EAD9; --dot: #BAC8A6;
  --partner: #C4561A; --partner-text: #9A4212; --partner-soft: #F5E2D3;
  --good: #357549; --good-soft: #E0EEDF; --water: #2F6F7E; --water-soft: #E1EEF0;
  --macro2: #9A9784; --on-accent: #FFFFFF; --solid: #1F2119; --on-solid: #FFFFFF;
  --shadow: 0 8px 24px rgba(31, 33, 25, 0.12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141619; --card: #1F2226; --ink: #F2EFE9; --ink2: #C9CDD3; --muted: #9BA1A8;
    --line: #2C3035; --border: #3A3F45; --neutral: #2A2E33; --field: #272A2F;
    --you: #5EB0AE; --you-hover: #7CC4C2; --you-soft: #1B3433; --dot: #3E6665;
    --partner: #F08A3C; --partner-text: #F5A468; --partner-soft: #3A2618;
    --good: #6CCB8C; --good-soft: #1C3324; --water: #5BB8D6; --water-soft: #17303A;
    --macro2: #6B737F; --on-accent: #141619; --solid: #F2EFE9; --on-solid: #141619;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141619; --card: #1F2226; --ink: #F2EFE9; --ink2: #C9CDD3; --muted: #9BA1A8;
  --line: #2C3035; --border: #3A3F45; --neutral: #2A2E33; --field: #272A2F;
  --you: #5EB0AE; --you-hover: #7CC4C2; --you-soft: #1B3433; --dot: #3E6665;
  --partner: #F08A3C; --partner-text: #F5A468; --partner-soft: #3A2618;
  --good: #6CCB8C; --good-soft: #1C3324; --water: #5BB8D6; --water-soft: #17303A;
  --macro2: #6B737F; --on-accent: #141619; --solid: #F2EFE9; --on-solid: #141619;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 400 15px/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, .num { font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif; }
h1 { margin: 0; font-size: 34px; font-weight: 700; line-height: 1.05; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 20px; font-weight: 600; }
h3 { margin: 0; font-size: 18px; font-weight: 600; }
a { color: var(--you); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--you); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.shell { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding: 18px 16px 108px; display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }

/* header */
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.date { font-size: 13px; color: var(--muted); font-weight: 500; }

/* cards & rows */
.card { background: var(--card); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px;
  padding: 8px 12px; min-height: 56px; color: var(--ink); border: 0; width: 100%; text-align: left;
}
.ico { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--neutral); color: var(--ink2); }
.ico.you { background: var(--you-soft); color: var(--you); }
.ico.good { background: var(--good-soft); color: var(--good); }
.ico.partner { background: var(--partner-soft); color: var(--partner-text); }
.ico.water { background: var(--water-soft); color: var(--water); }
.t { font-size: 15px; font-weight: 600; line-height: 1.25; }
.d { font-size: 12.5px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.grow { flex: 1; min-width: 0; }

/* buttons */
.btn {
  height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--card); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--you); border-color: var(--you); color: var(--on-accent); }
.btn.solid { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.btn.big { height: 52px; font-size: 15.5px; font-weight: 700; width: 100%; }
.btn.danger { color: var(--partner-text); border-color: var(--partner); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--you); padding: 0 8px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.pill { height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; }
.pill.good { background: var(--good-soft); color: var(--good); }

/* segmented controls & chips */
.seg { display: flex; gap: 2px; background: var(--line); border-radius: 11px; padding: 2px; }
.seg > * {
  flex: 1; height: 34px; border: 0; border-radius: 9px; background: transparent; font-size: 12.5px; font-weight: 600;
  color: var(--ink2); display: flex; align-items: center; justify-content: center; padding: 0 8px; white-space: nowrap;
}
.seg > [aria-current="page"], .seg > [aria-pressed="true"] { background: var(--card); color: var(--ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card);
  font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; color: var(--ink);
}
.seg > a { color: var(--ink2); }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }
.types { display: flex; gap: 6px; }
.types .chip { flex: 1; padding: 0 4px; }

/* bars */
.segbar { display: grid; gap: 3px; }
.segbar i { height: 6px; border-radius: 3px; background: var(--line); }
.macro { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; margin-top: 6px; background: var(--neutral); }

/* you + partner */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; background: var(--line); border-radius: 20px; overflow: hidden; }
.duo > * { background: var(--card); padding: 14px; display: flex; flex-direction: column; gap: 8px; color: var(--ink); }
.av { width: 30px; height: 30px; border-radius: 50%; color: var(--on-accent); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.invite { border: 1.5px dashed var(--border); background: transparent !important; justify-content: center; }

/* forms */
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
input.in, select.in, textarea.in {
  height: 46px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--field); padding: 0 12px;
  font-size: 16px; color: var(--ink); width: 100%; min-width: 0;
}
textarea.in { height: auto; padding: 10px 12px; }
input.in:focus, select.in:focus { border-color: var(--you); outline: none; }
.stepper { display: flex; border-radius: 12px; overflow: hidden; }
.stepper button { width: 46px; height: 46px; border: 0; background: var(--neutral); font-size: 20px; font-weight: 600; }
.stepper input { flex: 1; height: 46px; border: 0; background: var(--field); text-align: center; font: 700 20px "Barlow Condensed", system-ui, sans-serif; min-width: 0; color: var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink2); line-height: 1.4; }
.check input { width: 22px; height: 22px; accent-color: var(--you); margin: 0; flex: none; }

/* switch */
.switch { width: 40px; height: 24px; border-radius: 12px; background: var(--border); position: relative; flex: none; border: 0; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--card); transition: left 0.15s; }
.switch[aria-checked="true"], .switch.on { background: var(--you); }
.switch[aria-checked="true"]::after, .switch.on::after { left: 19px; }

/* list groups */
.list { border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; gap: 1px; background: var(--line); }
.li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 6px 14px; background: var(--card); font-size: 14px; font-weight: 600; }
.li small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.sh { margin: 6px 0 0; font: 600 12.5px Inter, sans-serif; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* gym */
.sets { display: flex; flex-wrap: wrap; gap: 6px; }
.set { height: 32px; padding: 0 10px; border-radius: 10px; background: var(--you-soft); font: 600 14px "Barlow Condensed", system-ui, sans-serif; display: inline-flex; align-items: center; gap: 6px; border: 0; color: var(--ink); }
.set.pr { background: var(--good-soft); }
.badge { font: 700 10.5px Inter, sans-serif; color: var(--on-accent); background: var(--good); border-radius: 4px; padding: 1px 5px; }
.suggest { position: absolute; left: 0; right: 0; top: 52px; z-index: 5; background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.suggest button { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border: 0; border-top: 1px solid var(--neutral); background: var(--card); text-align: left; font-size: 14.5px; }
.suggest button:first-child { border-top: 0; }
.suggest small { color: var(--muted); font-size: 12px; }
.tip { background: var(--you-soft); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.tip.water { background: var(--water-soft); }
.tip p { margin: 0; font-size: 13.5px; line-height: 1.45; }
.note { background: var(--partner-soft); border-radius: 14px; padding: 10px 12px; font-size: 13px; line-height: 1.4; color: var(--ink); }

/* charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text, .chart .axis-t { font: 10.5px Inter, sans-serif; fill: var(--muted); }
.chart .hit { fill: transparent; }
.key { display: flex; gap: 14px; font-size: 12px; color: var(--ink2); flex-wrap: wrap; }
.key span { display: flex; align-items: center; gap: 6px; }
.stat { font: 700 26px "Barlow Condensed", system-ui, sans-serif; line-height: 1.1; }
.up { color: var(--good); font-weight: 700; font-size: 13px; }
.empty { text-align: center; padding: 18px 8px; color: var(--muted); font-size: 13.5px; }

/* bottom nav */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs .in { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: 66px; }
nav.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
nav.tabs a[aria-current="page"] { color: var(--you); }

/* dialog */
dialog { border: 0; border-radius: 22px; padding: 0; background: var(--card); color: var(--ink); width: min(440px, calc(100vw - 24px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
dialog form { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.code { font: 700 22px/1.4 "Barlow Condensed", ui-monospace, monospace; letter-spacing: 0.08em; background: var(--field); border-radius: 14px; padding: 12px; text-align: center; word-break: break-word; user-select: all; }

/* onboarding */
.welcome { padding: 32px 20px 24px; display: flex; flex-direction: column; gap: 14px; max-width: 480px; margin: 0 auto; }
.logo { display: flex; align-items: center; }
.logo span { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 3px solid var(--bg); }
.toast { position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%); background: var(--solid); color: var(--on-solid); padding: 10px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; z-index: 30; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

/* Faith: verse of the day and the Bible reader */
.verse { color: inherit; text-decoration: none; gap: 6px; }
.scripture, .scripture-ch p { font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.6; color: var(--ink); margin: 0; }
.scripture-ch { gap: 8px; }
.scripture-ch sup { font: 600 11px Inter, sans-serif; color: var(--muted); margin-right: 4px; }
.scripture-ch p.hl { background: var(--you-soft); border-radius: 8px; margin: 0 -6px; padding: 2px 6px; }
.chgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.chgrid .chip { justify-content: center; }
