/* ===== MindfulReach Client Portal: matches mindfulreach.co ===== */
/* Matches mindfulreach.co: navy Playfair headings, Lato body, teal + terracotta */
:root {
  --bg: #FDFBF7; --card: #FFFFFF; --text: #2B333F; --head: #1F3B59; --muted: #66707F; --line: #EAE3D7; --raised: #F4EFE6;
  --teal: #4EB1AE; --teal-dark: #3A8F8C; --teal-soft: #D5EEEC; --terra: #B67056; --olive: #8C927B;
  --ok-fg: #2F7A77; --ok-bg: #DDF1EF; --wait-fg: #9A5A40; --wait-bg: #F6E6DE; --bad: #A6402B;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Lato", -apple-system, sans-serif;
  --r: 14px; --r-sm: 10px; --gap: 16px;
  --shadow: 0 1px 2px rgba(31,59,89,.05), 0 8px 24px rgba(31,59,89,.06);
  --side: 220px; --col: 1040px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1F30; --card: #172B40; --text: #E6EAF0; --head: #F4EFE6; --muted: #9AA7B8; --line: #26405A; --raised: #1D3550;
    --teal: #5FC4C0; --teal-dark: #7FD3CF; --teal-soft: #1E4A52; --terra: #D08A6F; --olive: #A9AE98;
    --ok-fg: #8FDCD7; --ok-bg: #173F44; --wait-fg: #F0B79F; --wait-bg: #43291F; --bad: #F2A08C;
    --shadow: 0 1px 2px rgba(0,0,0,.25), 0 8px 24px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased }
a { color: inherit }
input, textarea, select, button { font: inherit; color: inherit }

/* Login + centered states */
.center { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px }
.brand { font-family: var(--serif); font-weight: 700; font-size: 32px; color: var(--head) }
/* the logo file has wide padding built in, so it is drawn larger and trimmed */
.logo { height: 92px; width: auto; display: block; margin: -24px -18px }
.login .logo { height: 170px; margin: -40px auto -36px }
.login { width: 100%; max-width: 380px; padding: 32px 28px; text-align: center; display: flex; flex-direction: column; gap: 10px }
.login .cap { margin-top: -6px; margin-bottom: 10px; color: var(--teal-dark); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-size: 12px }
.login form { display: flex; flex-direction: column; gap: 10px }
.err { min-height: 1.5em; color: var(--bad); font-size: 14px; margin: 4px 0 0 }

/* Top bar */
.banner { background: var(--wait-bg); color: var(--wait-fg); font-size: 13px; padding: 8px 16px; display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap }
.banner label { white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; cursor: pointer }
.top { display: flex; align-items: center; gap: 16px; padding: 14px 24px; padding-top: calc(14px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line) }
.brand-sm { display: flex; align-items: center }
.top { background: var(--card) }
.who { flex: 1; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.switch { display: flex; align-items: center; gap: 8px }
.switch select { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 14px; max-width: 260px }

/* Shell */
.shell { display: flex }
.nav { width: var(--side); flex: none; padding: 24px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; align-self: flex-start }
.nav a { text-decoration: none; color: var(--muted); padding: 9px 12px; border-radius: 10px; font-size: 14.5px }
.nav a:hover { background: var(--raised); color: var(--head) }
.nav a.on { background: var(--teal-soft); color: var(--head); font-weight: 700 }
.main { flex: 1; min-width: 0; padding: 32px 32px 64px }
.wrap { max-width: var(--col); margin: 0 auto }

/* Type */
.label { font-family: var(--sans); font-weight: 700; font-size: 12.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--teal-dark) }
.label.h { font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--head) }
h1.verdict { font-family: var(--serif); font-weight: 700; font-size: 36px; line-height: 1.15; letter-spacing: -.5px; color: var(--head); margin: 10px 0 24px }
h1.verdict + .ctx { margin-top: -16px }
.ctx { color: var(--muted); margin: 0 0 24px; font-size: 15px }
.cap { color: var(--muted); font-size: 13px }
.note { color: var(--muted); font-size: 12.5px; margin-top: 2px }
.sec { margin: 32px 0 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px }
.link { color: var(--muted); font-size: 13px; text-decoration: none }

/* Cards + grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px }
.grid { display: grid; gap: var(--gap) }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)) }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)) }
.stack { display: grid; gap: var(--gap) }
.stat { border-top: 3px solid var(--teal) }
.stat .num { font-family: var(--serif); font-weight: 700; color: var(--head); font-size: 32px; line-height: 1.15; margin-top: 4px; font-variant-numeric: lining-nums tabular-nums }
.stat.na .num { font-family: var(--sans); font-size: 14px; color: var(--muted); margin-top: 8px }
.empty { color: var(--muted); font-size: 14.5px }
.empty b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px }
.update h3 { font-family: var(--serif); font-weight: 700; color: var(--head); font-size: 21px; margin: 4px 0 6px }
.update p { margin: 0; white-space: pre-wrap }

/* Lists */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden }
.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line); text-decoration: none; font-size: 15px }
.row:first-child { border-top: 0 }
a.row:hover { background: var(--raised) }
.row .t { flex: 1; min-width: 0 }
.row .t small { display: block; color: var(--muted); font-size: 13px }
.row .go { color: var(--muted); font-size: 13px; white-space: nowrap }
.chip { display: inline-flex; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--raised); color: var(--muted); white-space: nowrap }
.chip.ok { background: var(--ok-bg); color: var(--ok-fg) }
.chip.wait { background: var(--wait-bg); color: var(--wait-fg) }

/* Chart */
.chart { width: 100%; height: auto; display: block }
.chart .bar { fill: var(--teal-soft) }
.chart .bar.now { fill: var(--teal) }
.chart .bar-lbl { fill: var(--muted); font-size: 11px; font-family: var(--sans) }
.chart .bar-val { fill: var(--text); font-size: 13px; font-family: var(--sans); font-weight: 600 }

/* Forms + buttons */
.form { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--gap) }
input, textarea, select { border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-sm); padding: 11px 12px; font-size: 15px; width: 100% }
.switch select { width: auto }
textarea { min-height: 120px; resize: vertical }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 1px }
.act { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap }
.act .btn { margin-left: auto }
.btn { border: 1px solid var(--teal); background: var(--teal); color: #fff; border-radius: var(--r-sm); padding: 11px 20px; font-size: 15px; font-weight: 700; cursor: pointer }
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark) }
.btn.warm { background: var(--terra); border-color: var(--terra) }
.btn.ghost { background: transparent; color: var(--terra); border-color: var(--terra) }
.btn.ghost:hover { background: var(--wait-bg) }
.btn.wide { width: 100% }
.linkbtn { border: 0; background: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 6px }

.foot { max-width: var(--col); margin: 48px auto 0; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted) }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom)); background: var(--head); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; display: none; z-index: 50 }
.toast.on { display: block }
.fade { animation: fu .4s ease both }
@keyframes fu { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
@media (prefers-reduced-motion: reduce) { .fade { animation: none } }

/* Phone */
@media (max-width: 767px) {
  .top { padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); flex-wrap: wrap; gap: 8px 12px }
  .who { order: 3; flex-basis: 100% }
  .switch { order: 4; flex-basis: 100% }
  .switch select { flex: 1; max-width: none }
  .shell { flex-direction: column }
  .nav { width: auto; flex-direction: row; overflow-x: auto; padding: 10px 16px; gap: 6px; position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none }
  .nav::-webkit-scrollbar { display: none }
  .nav a { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px }
  .nav a.on { background: var(--teal); color: #fff; border-color: var(--teal) }
  .main { padding: 24px 16px calc(48px + env(safe-area-inset-bottom)) }
  h1.verdict { font-size: 28px }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .g3 > :first-child { grid-column: 1 / -1 }
  .stat .num { font-size: 26px }
}

/* Account picker (a client can own several accounts) */
.acctbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -8px 0 22px; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow) }
.acctbar label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0 }
.acctbar .cap { color: var(--teal-dark); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-size: 11.5px; white-space: nowrap }
.acctbar select { flex: 1; min-width: 0; max-width: 420px; background: var(--bg); font-weight: 700; color: var(--head) }
.acctbar b { color: var(--head) }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.row.here { background: var(--teal-soft) }
@media (max-width: 767px) { .g2 { grid-template-columns: minmax(0, 1fr) } .acctbar { margin-top: -4px } }
