/* Client dashboard. One accent per client (--brand, set on each page); everything else shared.
   Simple first: big tap targets, plain words, one section on screen at a time. */
:root {
  --brand: #8a5a14; --ink: #16181d; --muted: #5b606d; --bg: #f5f3ee; --card: #fff; --line: #e8e3d8;
  --good: #1d7432; --good-bg: #e9f6ec; --bad: #a8241d; --bad-bg: #fcecea; --wait: #6f5200; --wait-bg: #fbf2d6;
  --tint: color-mix(in srgb, var(--brand) 8%, #fff);
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 6px 20px rgba(20, 20, 30, .05);
  --radius: 18px; --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-wrap: anywhere; }
body { font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
svg { width: 22px; height: 22px; flex: none; }
h1 { font-size: clamp(26px, 6vw, 38px); line-height: 1.1; letter-spacing: -.01em; }
h2 { font-size: 21px; line-height: 1.25; letter-spacing: -.005em; }
h3 { font-size: 15px; margin: 18px 0 8px; }
h3.first { margin-top: 0; }
h3.good { color: var(--good); } h3.bad { color: var(--bad); }
.muted { color: var(--muted); font-size: 15px; }
.kicker { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }

/* ---------- header ---------- */
.hero { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 72%, #000)); color: #fff;
  padding: calc(26px + env(safe-area-inset-top)) 16px 30px; }
.hero-in { max-width: 1040px; margin: 0 auto; display: flex; gap: 16px; align-items: center; }
.plate { width: 78px; height: 78px; border-radius: 20px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.plate img { max-width: 84%; max-height: 84%; object-fit: contain; }
.hello { font-size: 13px; font-weight: 600; opacity: .9; }
.hero .sub { font-size: 15px; opacity: .92; }

/* ---------- layout ---------- */
main { max-width: 1040px; margin: 0 auto; padding: 18px 16px calc(120px + env(safe-area-inset-bottom)); }
html { scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.panel { display: grid; gap: 16px; }
.js .panel { display: none; }
.js .panel.on { display: grid; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card > h2 + .muted, .card > .kicker + h2 { margin-top: 2px; }
.home-grid { display: grid; gap: 16px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; min-height: 48px; padding: 0 20px; border-radius: 12px;
  border: 1.5px solid var(--brand); color: var(--brand); background: #fff; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s; }
.btn.solid { background: var(--brand); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 20px; height: 20px; }
.acts { display: flex; gap: 10px; flex-wrap: wrap; }
.acts .btn { margin-top: 12px; }
.more { display: inline-flex; align-items: center; gap: 4px; margin-top: 14px; font-weight: 700; text-decoration: none; min-height: 44px; }
.more svg { width: 18px; height: 18px; transition: transform .2s var(--ease); }
.more:hover svg { transform: translateX(3px); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, #fff); outline-offset: 2px; border-radius: 8px; }

/* ---------- home ---------- */
.glance ul { list-style: none; display: grid; gap: 10px; margin-top: 12px; }
.glance li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--good-bg); }
.gl { font-weight: 600; }
.gv { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); }
.gv s { text-decoration-thickness: 1px; }
.gv svg { width: 16px; height: 16px; color: var(--good); }
.gv b, .gv strong { color: var(--good); font-size: 18px; }
.glance-big { font-size: 18px; margin-top: 8px; color: var(--muted); }
.glance-big b { font-size: 40px; color: var(--ink); }
.cta, .notify { display: flex; gap: 16px; align-items: flex-start; }
.cta { border-top: 4px solid var(--brand); }
.cta p, .notify p { color: var(--muted); font-size: 15px; margin-top: 2px; }
.cta-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--tint); color: var(--brand); display: grid; place-items: center; flex: none; }
.cta-icon svg { width: 26px; height: 26px; }
.notify .msg { font-size: 14px; color: var(--muted); margin-top: 8px; }
.menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.menu a { display: flex; flex-direction: column; gap: 4px; padding: 18px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); min-height: 132px; box-shadow: var(--shadow); transition: transform .25s var(--ease), border-color .2s, box-shadow .25s var(--ease); }
.menu a svg { width: 40px; height: 40px; padding: 8px; border-radius: 12px; background: var(--tint); color: var(--brand); margin-bottom: 6px; }
.menu a b { font-size: 17px; }
.menu a span { font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.menu a:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 45%, #fff); box-shadow: 0 10px 28px rgba(20, 20, 30, .09); }

/* ---------- numbers ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.tl { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); font-weight: 600; line-height: 1.3; }
.tl svg { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--tint); color: var(--brand); }
.tv { font-size: 32px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tv small { font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.tv.none { font-size: 17px; color: var(--muted); font-weight: 700; }
.ts { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.when { font-size: 12.5px; }
.bar { height: 8px; border-radius: 99px; background: #efebe2; overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--brand); transition: width 1.1s var(--ease); }
.chip { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #f1eee7; color: var(--muted); }
.chip.up { background: var(--good-bg); color: var(--good); } .chip.down { background: var(--bad-bg); color: var(--bad); }

/* ---------- this week ---------- */
ul.pairs { list-style: none; display: grid; gap: 8px; }
ul.pairs li { border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
ul.pairs.good li { background: var(--good-bg); } ul.pairs.bad li { background: var(--bad-bg); }
ul.pairs.bad span { font-size: 14px; color: var(--muted); }
ul.checks, ul.dots { list-style: none; display: grid; gap: 8px; }
ul.checks li, ul.dots li { padding-left: 28px; position: relative; }
ul.checks li::before { content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--good-bg);
  box-shadow: inset 0 0 0 1.5px var(--good); }
ul.checks li::after { content: ""; position: absolute; left: 7px; top: 6px; width: 5px; height: 9px; border: solid var(--good); border-width: 0 2px 2px 0; transform: rotate(45deg); }
ul.dots li::before { content: ""; position: absolute; left: 6px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }

/* ---------- goal ---------- */
.goal { background: linear-gradient(160deg, var(--tint), #fff 70%); border-color: color-mix(in srgb, var(--brand) 30%, #fff); }
.goal-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.goal-head svg { width: 52px; height: 52px; padding: 10px; border-radius: 16px; background: var(--brand); color: #fff; }
.goal .big { font-size: 20px; font-weight: 800; line-height: 1.3; }
.goal q { color: var(--brand); }
ol.steps { list-style: none; display: grid; gap: 14px; margin-top: 12px; }
ol.steps li { display: flex; gap: 12px; align-items: flex-start; }
ol.steps li span { width: 30px; height: 30px; border-radius: 50%; background: var(--tint); color: var(--brand); font-weight: 800; display: grid; place-items: center; flex: none; }
ol.steps li p { padding-top: 3px; }

/* ---------- what we changed ---------- */
.timeline { list-style: none; margin-top: 12px; display: grid; }
.timeline li { position: relative; padding: 0 0 18px 24px; display: flex; flex-direction: column; gap: 3px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: -6px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px var(--brand); }
.timeline time { font-size: 13px; color: var(--muted); }
.timeline span { font-size: 14px; color: var(--muted); }
.timeline em { font-style: normal; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; align-self: flex-start; margin-top: 4px; }
em.good { color: var(--good); background: var(--good-bg); } em.bad { color: var(--bad); background: var(--bad-bg); } em.wait { color: var(--wait); background: var(--wait-bg); }

/* ---------- reports ---------- */
.reports { list-style: none; display: grid; gap: 10px; margin-top: 14px; }
.reports a { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink);
  transition: border-color .2s, background .2s, transform .2s var(--ease); min-height: 64px; }
.reports a:hover { background: var(--tint); border-color: color-mix(in srgb, var(--brand) 40%, #fff); }
.reports a.month { border-color: color-mix(in srgb, var(--brand) 45%, #fff); background: var(--tint); }
.ri { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--tint); color: var(--brand); flex: none; }
.reports a.month .ri { background: var(--brand); color: #fff; }
.rt { display: flex; flex-direction: column; flex: 1; }
.rt small { color: var(--muted); font-size: 14px; }
.go { display: inline-flex; align-items: center; gap: 2px; color: var(--brand); font-weight: 700; font-size: 15px; }
.go svg { width: 18px; height: 18px; }

/* ---------- tab bar: bottom on phones, under the header on computers ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px; border-radius: 12px; color: var(--muted);
  text-decoration: none; font-size: 12px; font-weight: 600; min-height: 52px; transition: color .2s, background .2s; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, #fff); box-shadow: inset 0 -3px 0 var(--brand); }

.help { text-align: center; color: var(--muted); font-size: 14px; padding: 18px 0 6px; display: grid; gap: 4px; }

/* ---------- sign-in help ---------- */
.login { max-width: 440px; margin: 14vh auto; padding: 28px; text-align: center; }
.login h1 { font-size: 26px; margin-bottom: 12px; }
.login p { color: var(--muted); margin-bottom: 10px; }

/* ---------- motion: gentle, and off for people who ask for less ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.js .panel.on > *, .js .panel.on .home-grid > *, .js .panel.on .tiles > * { animation: rise .55s var(--ease) both; }
.js .panel.on > *:nth-child(2), .js .panel.on .home-grid > *:nth-child(2), .js .panel.on .tiles > *:nth-child(2) { animation-delay: .06s; }
.js .panel.on > *:nth-child(3), .js .panel.on .tiles > *:nth-child(3) { animation-delay: .12s; }
.js .panel.on > *:nth-child(4), .js .panel.on .tiles > *:nth-child(4) { animation-delay: .18s; }
.js .bar i { width: 0; }
.js .panel.on .bar i { width: var(--w); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .js .bar i { width: var(--w); } }

/* ---------- computers ---------- */
@media (min-width: 900px) {
  .hero { padding: 34px 24px 40px; }
  .plate { width: 92px; height: 92px; }
  .tabbar { position: sticky; top: 0; bottom: auto; display: flex; justify-content: center; gap: 6px; border-top: 0; border-bottom: 1px solid var(--line); padding: 8px 16px; }
  .tabbar a { flex-direction: row; gap: 8px; font-size: 15px; padding: 0 18px; min-height: 46px; }
  .tabbar a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--brand); }
  main { padding: 26px 24px 60px; }
  .home-grid { grid-template-columns: 1.3fr 1fr; align-items: start; }
  .menu, .tiles { grid-template-columns: repeat(4, 1fr); }
  .cta { flex-direction: column; }
  #s-week { grid-template-columns: 1.2fr 1fr; align-items: start; }
  #s-goal { grid-template-columns: 1fr 1.2fr; align-items: start; }
  #s-progress > .intro, #s-progress > .tiles { grid-column: 1 / -1; }
}
/* Phones: a slim header and tighter cards, so Home fits with little scrolling (Ben, 14 Oct) */
@media (max-width: 899px) {
  .hero { padding: calc(10px + env(safe-area-inset-top)) 16px 12px; }
  .hero-in { gap: 12px; }
  .plate { width: 68px; height: 46px; border-radius: 12px; box-shadow: 0 3px 10px rgba(0, 0, 0, .16); }
  .plate img { max-width: 90%; max-height: 86%; }
  .hello { display: none; }
  .hero h1 { font-size: 19px; line-height: 1.2; }
  .hero .sub { font-size: 13px; }
  main { padding-top: 12px; }
  .panel, .home-grid { gap: 12px; }
  .card { padding: 16px; }
  .glance ul { gap: 8px; margin-top: 10px; }
  .glance li { padding: 10px 12px; flex-wrap: wrap; row-gap: 4px; }
  .gl { min-width: 0; overflow-wrap: anywhere; }
  .gl { font-size: 15px; }
  .more { margin-top: 6px; }
  .cta, .notify { gap: 12px; }
  .cta-icon { width: 40px; height: 40px; border-radius: 12px; }
  .cta-icon svg { width: 22px; height: 22px; }
  .btn { margin-top: 10px; }
  .menu { gap: 10px; }
  .menu a { min-height: 0; padding: 14px; }
  .menu a svg { width: 34px; height: 34px; padding: 7px; margin-bottom: 4px; }
}
@media (max-width: 420px) { .tv { font-size: 28px; } }

/* Calls and forms: the numbers clients care about most, first on Progress (full row on phones, half on screens) */
.tile.wide { grid-column: 1 / -1; border-top: 3px solid var(--brand); }
@media (min-width: 900px) { .tile.wide { grid-column: span 2; } }
.tile.wide .tv { font-size: 40px; }
