/* Sono client profile. Same palette and type as the dashboard and landing page (black, white, Geist),
   but deliberately formal: grouped cards, label/value rows, no charts, no motion beyond focus states.
   Mobile-first; two columns (section index + cards) at >= 960px. */
@font-face { font-family: "Geist"; src: url("../../assets/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #000;
  --card: #0b0b0b;
  --line: #1f1f1f;
  --line-2: #2a2a2a;
  --fg: #fff;
  --text: #ececec;
  --muted: #9b9b9b;     /* 7.9:1 on black */
  --dim: #8a8a8a;       /* 5.9:1 on #0b0b0b */
  --field: #050505;
  --field-line: #3a3a3a;
  --err: #ff7b72;       /* 7.4:1 on black; always paired with text, never colour alone */
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pad: 18px;
  --r: 18px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); scroll-padding-top: 16px; }
body {
  margin: 0; min-height: 100svh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.5; font-feature-settings: "tnum" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden;
}
h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 10px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: #fff; color: #000; padding: 10px 14px; border-radius: 12px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

/* ---------- header (same as the dashboard) ---------- */
.top { padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: 14px; border-bottom: 1px solid #141414; }
.top-row { display: flex; align-items: center; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--fg); font-weight: 650; font-size: 17px; letter-spacing: -.02em; }
.brand-mark { width: 24px; height: 24px; }
.preview-pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 550; color: #d9d9d9;
  padding: 4px 10px 4px 9px; border-radius: 999px; border: 1px dashed #4a4a4a; background: rgba(255,255,255,.04); white-space: nowrap;
}
.pp-more { margin-left: -7px; }   /* no flex gap before the comma */
.pdot { width: 6px; height: 6px; border-radius: 50%; background: #bdbdbd; }
.top-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; min-height: 32px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: #cfcfcf; text-decoration: none; white-space: nowrap;
  padding: 0 12px; border: 1px solid #2c2c2c; border-radius: 999px; background: rgba(255,255,255,.03);
}
.pill:hover { color: #fff; border-color: #555; background: rgba(255,255,255,.08); }
.logout { margin: 0; }

/* ---------- page head ---------- */
.pf { padding-top: 14px; padding-bottom: 8px; outline: none; }
.crumbs { margin-bottom: 18px; }
.crumb-back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding-right: 8px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.crumb-back:hover { color: var(--fg); }
.crumb-back svg { width: 16px; height: 16px; margin-left: -3px; }
.pf-head { display: flex; align-items: center; gap: 14px; }
.pf-avatar {
  flex: none; width: 56px; height: 56px; border-radius: 50%; background: #fff; color: #000;
  display: grid; place-items: center; font-size: 23px; font-weight: 650; letter-spacing: -.02em;
}
.pf-head-text { min-width: 0; }
.pf h1 { font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -.035em; color: var(--fg); }
.pf-name { margin-top: 3px; font-size: 15px; color: var(--text); font-weight: 550; overflow-wrap: anywhere; }
.pf-meta { font-size: 13px; color: var(--muted); }
.pf-name:empty, .pf-meta:empty { display: none; }
.pf-intro { margin-top: 16px; max-width: 60ch; font-size: 14.5px; color: var(--muted); }
.pf-loading { color: var(--muted); padding: 24px 2px; }

/* notices (coming soon, errors) */
.pf-notice { margin-top: 18px; border: 1px solid var(--line-2); background: #111; border-radius: 14px; padding: 14px 16px; font-size: 14px; color: var(--text); }
.pf-notice strong { display: block; color: var(--fg); font-weight: 650; font-size: 15px; margin-bottom: 2px; }
.pf-notice p + p { margin-top: 6px; }
.pf-notice code { white-space: nowrap; font-family: inherit; font-weight: 600; color: var(--fg); background: #1c1c1c; border-radius: 6px; padding: 1px 6px; }

/* ---------- layout ---------- */
.pf-layout { margin-top: 22px; }
.pf-sections { display: grid; gap: 14px; min-width: 0; }
.pf-nav { display: none; }

/* ---------- section cards ---------- */
.pf-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 16px 6px; min-width: 0; scroll-margin-top: 16px; }
.pf-card.editing { border-color: #3a3a3a; padding-bottom: 18px; }
.pf-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pf-card h2 { font-size: 17px; font-weight: 650; letter-spacing: -.02em; color: var(--fg); outline: none; }
.pf-desc { margin-top: 3px; font-size: 13px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer; font-size: 15px; font-weight: 600; letter-spacing: -.01em;
  -webkit-tap-highlight-color: transparent; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { background: #e6e6e6; }
.btn-secondary { background: transparent; color: var(--fg); border-color: #3a3a3a; }
.btn-secondary:hover { border-color: #777; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-edit { flex: none; min-height: 36px; padding: 0 16px; font-size: 14px; background: transparent; color: var(--fg); border-color: #3a3a3a; }
.btn-edit:hover:not([disabled]) { border-color: #777; background: rgba(255,255,255,.04); }
.btn:focus-visible { border-radius: 999px; }

/* label/value rows */
.pf-rows > div { padding: 13px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.pf-rows > div:last-child { border-bottom: 0; }
.pf-rows + .pf-rows { border-top: 1px solid var(--line); }
.pf-rows dt { font-size: 13px; color: var(--muted); font-weight: 450; }
.pf-rows dd { margin-top: 2px; font-size: 15px; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.pf-rows dd.none { color: var(--dim); }
.pf-rows .pf-lock { display: block; margin-top: 3px; font-size: 12.5px; color: var(--dim); white-space: normal; }
.pf-sub { padding: 16px 0 4px; font-size: 13px; font-weight: 600; color: var(--fg); letter-spacing: -.005em; border-bottom: 1px solid var(--line); }
.pf-sub + .pf-rows > div:first-child { border-top: 0; }
.pf-note { padding: 13px 0; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.pf-note:last-child { border-bottom: 0; }
.pf-note a { color: var(--fg); text-underline-offset: 3px; }
/* compact rows (agreements): label and short answer on one line, also on phones */
.pf-rows.compact > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 11px 0; }
.pf-rows.compact dt { font-size: 14px; color: var(--text); }
.pf-rows.compact dd { margin-top: 0; flex: none; text-align: right; }
.pf-rows.compact dt { font-weight: 550; min-width: 0; }
.pf-agree-desc { display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; font-weight: 400; color: var(--muted); }
.yn { font-weight: 550; }
.yn-yes { color: var(--fg); }
.mark { display: inline-flex; align-items: center; gap: 6px; }
.mark svg { width: 15px; height: 15px; flex: none; }

/* status line under a card (Saved, etc.) */
.pf-status { font-size: 13.5px; color: var(--text); padding: 0 0 12px; display: flex; align-items: center; gap: 7px; }
.pf-status:empty { display: none; }
.pf-status svg { width: 15px; height: 15px; }

/* ---------- forms ---------- */
.pf-form { padding-top: 6px; }
.pf-errsum { margin: 12px 0 2px; border: 1px solid var(--err); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--fg); outline: none; }
.pf-errsum strong { display: block; font-weight: 650; }
.pf-errsum ul { margin-top: 4px; padding-left: 18px; list-style: disc; color: var(--text); }
.pf-errsum a { color: var(--fg); text-underline-offset: 3px; }
.pf-field { padding: 14px 0 0; }
.pf-field label, .pf-field .pf-label { display: block; font-size: 14px; font-weight: 550; color: var(--fg); }
.pf-opt { font-weight: 400; color: var(--muted); }
.pf-hint { margin-top: 1px; font-size: 13px; color: var(--muted); }
.pf-input {
  display: block; width: 100%; margin-top: 7px; min-height: 48px; padding: 11px 14px;
  background: var(--field); color: var(--fg); border: 1px solid var(--field-line); border-radius: 12px;
  font-size: 16px; line-height: 1.4; /* 16px: no iOS zoom on focus */
  -webkit-appearance: none; appearance: none;
}
textarea.pf-input { min-height: 96px; resize: vertical; }
select.pf-input {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23bdbdbd' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
}
input[type="time"].pf-input { color-scheme: dark; }
.pf-input:hover { border-color: #555; }
.pf-input:focus { outline: none; border-color: #fff; box-shadow: 0 0 0 1px #fff; }
.pf-input[aria-invalid="true"] { border-color: var(--err); }
.pf-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 1px var(--err); }
.pf-suffix { position: relative; max-width: 220px; }
.pf-suffix .pf-input { padding-right: 46px; }
.pf-suffix span { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); margin-top: 3.5px; color: var(--muted); font-size: 15px; pointer-events: none; }
.pf-short { max-width: 220px; }
.pf-err { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; font-size: 13.5px; color: var(--err); }
.pf-err:empty { display: none; }
.pf-err svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.pf-fixed { padding: 14px 0 0; }
.pf-fixed .pf-label { font-size: 14px; font-weight: 550; color: var(--fg); }
.pf-fixed .pf-val { margin-top: 2px; font-size: 15px; color: var(--text); white-space: pre-line; }
.pf-fixed .pf-lock { margin-top: 2px; font-size: 12.5px; color: var(--dim); }
.pf-actions { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 22px; }
.pf-actions .btn { width: 100%; }
.pf-formerr { margin-top: 12px; font-size: 14px; color: var(--err); }
.pf-formerr:empty { display: none; }

/* ---------- footer ---------- */
.foot { display: flex; flex-direction: column; gap: 6px; padding-top: 26px; padding-bottom: calc(26px + env(safe-area-inset-bottom)); font-size: 12.5px; color: var(--dim); }
.foot a { text-underline-offset: 3px; }
.foot a:hover { color: #fff; }
.sep { color: #555; margin: 0 6px; }
.foot-badge { display: inline-block; font-size: 11px; font-weight: 600; color: #cfcfcf; border: 1px dashed #4a4a4a; border-radius: 999px; padding: 1px 8px; margin-right: 4px; }

@media (max-width: 479px) { .pp-more { display: none; } }

/* ---------- tablet+ ---------- */
@media (min-width: 640px) {
  :root { --pad: 28px; }
  .pf-card { padding: 22px 24px 8px; }
  .pf-card.editing { padding-bottom: 22px; }
  .pf-rows > div { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); column-gap: 24px; align-items: baseline; }
  .pf-rows dt { font-size: 14px; }
  .pf-rows dd { margin-top: 0; }
  .pf-actions { flex-direction: row; justify-content: flex-end; }
  .pf-actions .btn { width: auto; min-width: 112px; }
}

/* ---------- desktop ---------- */
@media (min-width: 960px) {
  :root { --pad: 40px; }
  .top { padding-top: 22px; padding-bottom: 18px; }
  .pf { padding-top: 22px; }
  .crumbs { margin-bottom: 22px; }
  .pf-avatar { width: 72px; height: 72px; font-size: 30px; }
  .pf-head { gap: 20px; }
  .pf h1 { font-size: 36px; }
  .pf-intro { margin-top: 18px; }
  .pf-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 30px; }
  .pf-nav { display: block; position: sticky; top: 24px; }
  .pf-nav[hidden] { display: none !important; }
  .pf-nav a {
    display: block; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-size: 14.5px; font-weight: 500;
  }
  .pf-nav a:hover { color: var(--fg); background: #0e0e0e; }
  .pf-nav a[aria-current="true"] { color: var(--fg); background: #141414; }
  .pf-sections { gap: 18px; }
  .pf-rows > div { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); }
  .pf-rows.compact > div { display: grid; }
  .pf-rows.compact dt { color: var(--muted); }
  .pf-rows.compact dd { text-align: left; }
  .foot { flex-direction: row; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.still, .still * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
@media (forced-colors: active) { .pf-avatar { border: 1px solid CanvasText; } .btn-primary { border-color: ButtonText; } }

/* ---------- pending saves (Sono applies website edits within about a minute) ---------- */
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; }
.pf-pending { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: 12.5px; color: var(--muted); white-space: normal; }
.pf-rows > div.is-pending dd { color: var(--fg); }
.pf-status.is-pending { color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .pf-status.is-pending .dot, .pf-pending .dot { animation: pf-breathe 2.4s ease-in-out infinite; }
  @keyframes pf-breathe { 50% { opacity: .35; } }
}
/* stored value that isn't one of the options (free text from the intake) */
.pf-current { margin-top: 4px; font-size: 13px; color: var(--muted); }
.pf-current .v { color: var(--text); font-weight: 550; overflow-wrap: anywhere; }
/* "this replaces your current target" (target weight is free text in Sono) */
.pf-warn { margin: 16px 0 0; border: 1px solid #5a5a5a; background: #111; border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--text); outline: none; }
.pf-warn strong { display: block; color: var(--fg); font-weight: 650; }
.pf-warn p { margin-top: 2px; }
