/* JenCoach brand skin (design system v0.3/DEC-028): fjord, mist, stone, one brass detail.
   Loaded last; brand surfaces plus scoped chat layout. */
:root{
  --fjord:#1E2A30;--mist:#E9ECEA;--stone:#C9CFCC;--sage:#7E9A8C;--brass:#B4935A;--rust:#9C5A48;
  --muted-fjord:#5B6669;--muted-mist:#A9B4B6;--fog:#E9ECEA;
  --pine:var(--fjord);--pine-soft:#2C3B42;--ink:var(--fjord);--muted:var(--muted-fjord);--line:var(--stone);
  --paper:var(--mist);--lime:var(--brass);--coral:var(--rust);--white:#F6F7F6;--radius:28px;
  font-family:'Golos Text',system-ui,-apple-system,'Segoe UI',sans-serif;font-size:15px;line-height:1.55;
  background:var(--mist);color:var(--fjord)
}
body{background:var(--mist)}
h1,h2,.session-duration,.stats strong,.week-facts strong,.week-date strong,.day-number,.coach-card h2,dialog h2{font-family:'Spectral',Georgia,serif;font-weight:300;letter-spacing:-.01em}
h3{font-weight:500;letter-spacing:-.01em}

/* Topographic contour texture on dark surfaces */
.coach-card,.day-card.selected,.chat-user{background-color:var(--fjord);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='160' viewBox='0 0 240 160'%3E%3Cg fill='none' stroke='%23E9ECEA' stroke-opacity='.07' stroke-width='1'%3E%3Cpath d='M-10 120C40 90 80 140 130 110S220 70 260 95'/%3E%3Cpath d='M-10 95C40 65 80 115 130 85S220 45 260 70'/%3E%3Cpath d='M-10 70C40 40 80 90 130 60S220 20 260 45'/%3E%3Cpath d='M-10 45C40 15 80 65 130 35S220-5 260 20'/%3E%3C/g%3E%3C/svg%3E")}

/* Brand mark: a quiet fjord tile with a brass dot instead of the old arrow */
.brand{font-family:'Spectral',Georgia,serif;font-size:17px;letter-spacing:0;font-weight:300;text-transform:none}
.brand small{font-family:'Golos Text',system-ui,sans-serif;font-size:11px;color:var(--muted)}
.brand-mark{background:var(--fjord);color:transparent;border-radius:12px;position:relative;overflow:hidden;font-size:0}
.brand-mark::after{content:'';position:absolute;width:8px;height:8px;border-radius:50%;background:var(--brass);right:9px;top:9px}
.brand-mark::before{content:'';position:absolute;left:6px;right:6px;bottom:9px;height:14px;border-top:1.6px solid var(--mist);border-radius:50% 50% 0 0;opacity:.85}

/* Surfaces */
.sidebar,.topbar{background:var(--mist);border-color:var(--stone)}
.api-card,.session-card,.week-board,.provider-card,.audit-card,.integration-intro,.day-card{background:#F6F7F6;border-color:var(--stone)}
.api-card{border-radius:28px}
.nav-item{color:var(--muted-fjord);border-radius:22px}
.nav-item:hover{background:#DFE3E1;color:var(--fjord)}
.nav-item.active{background:transparent;color:var(--fjord);font-weight:600}
.nav-item.active::after,.nav-dot{background:var(--brass)}
.nav-item.active::after{content:'';width:5px;height:5px;border-radius:50%;margin-left:6px;display:inline-block}

/* Buttons: pills, dark primary; brass reserved for the one "now" action */
.button{border-radius:999px;min-height:46px;padding:12px 20px;font-size:14px;font-weight:500;letter-spacing:0}
.primary{background:var(--fjord);color:var(--mist)}
.primary:hover{background:var(--pine-soft)}
.secondary{background:transparent;border-color:var(--stone);color:var(--fjord)}
.secondary:hover{background:#DFE3E1}
.button.danger{color:var(--rust);border-color:#D9BDB3;background:transparent}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,.api-shell textarea:focus-visible{outline:2px solid var(--brass);outline-offset:3px}

/* Forms */
input:not([type=checkbox]),select,.api-shell textarea{border-color:var(--stone);background:#F6F7F6;color:var(--fjord);border-radius:16px;font-size:15px}
input[type=checkbox]{accent-color:var(--fjord)}

/* Coach chat: calm, readable, Jen's turns on mist, the athlete's on fjord */
.coach-chat{background:#F6F7F6}
.chat-turn{border-radius:20px;background:var(--mist);color:var(--fjord);font-size:15px;line-height:1.5;box-shadow:none}
.chat-assistant span{font-family:'Spectral',Georgia,serif;font-size:14px;color:var(--brass)}
/* Athlete turns: dark bubble with light text. Specificity beats .chat-turn so text never matches the background. */
.chat-turn.chat-user{background-color:var(--fjord);color:var(--mist)}
.chat-turn.chat-user span{color:var(--muted-mist)}
.chat-turn.chat-user p{color:var(--mist)}
.coach-chat form{border-top-color:var(--stone)}
.voice-bar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:14px;padding:14px 16px;border:1px solid var(--stone);border-radius:24px;background:var(--mist)}
.voice-bar p,.voice-bar h3{flex-basis:100%;font-size:13px;color:var(--muted-fjord)}
.voice-record{background:var(--brass)!important;color:var(--fjord)!important;border-color:var(--brass)!important}
.voice-upload{font-size:13px;color:var(--muted-fjord);font-weight:400}

/* Status colours: sage = done / on the watch; no lime, no rainbow */
.status-dot,.local-status>span,.connection-status>span,.audit-dot,.tiny-square{background:var(--sage)}
.small-tag{background:#DFE3E1;color:var(--muted-fjord);border-radius:999px}
.delivery-result{background:#E4EAE6;border-color:var(--sage)}
.review-alert{background:#F1E6E1;border-color:#D9BDB3;color:var(--rust)}
#toast{background:var(--fjord);color:var(--mist);border-radius:999px}
dialog{border-radius:28px;border-color:var(--stone)}
dialog::backdrop{background:#1E2A3066}

/* Chat ergonomics (15.10): one scroll (the page), the feed fills the screen,
   the composer and the microphone stay pinned at the bottom. */
.coach-chat{display:flex;flex-direction:column;padding:12px 14px 0}
.coach-chat .chat-mode{order:0;margin:0 0 6px;font-size:11px}
.coach-chat .chat-history{order:1;max-height:none;overflow:visible;gap:10px;padding:4px 0 12px}
.coach-chat .chat-turn{max-width:86%;padding:10px 14px;scroll-margin-bottom:180px}
.coach-chat .chat-turn span{font-size:11px;font-family:'Golos Text',system-ui,sans-serif}
.coach-chat .chat-turn p{margin-top:2px}
.coach-chat .chat-assistant span{color:var(--brass)}
.coach-chat form{order:2;position:sticky;bottom:0;z-index:5;display:grid;grid-template-columns:1fr auto;gap:8px;align-items:end;margin:0 -14px;padding:10px 14px calc(10px + env(safe-area-inset-bottom));background:#F6F7F6;border-top:1px solid var(--stone)}
.coach-chat form>label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.coach-chat textarea{height:46px;min-height:46px;max-height:30vh;margin:0;padding:10px 14px;font-size:16px;border-radius:22px;resize:none}
.coach-chat form>button[type=submit]{min-height:44px;padding:10px 16px}
.coach-chat form [data-form-error]{grid-column:1/-1;margin:0;font-size:12px;color:var(--rust)}
.coach-chat form [data-form-error]:empty{display:none}
.coach-chat .voice-bar{grid-column:1/-1;margin:0;padding:0;border:0;background:none;gap:8px;align-items:center}
.coach-chat .voice-bar h3,.coach-chat .voice-bar p{flex-basis:auto;font-size:12px;margin:0}
.coach-chat .voice-bar .button{min-height:36px;padding:6px 14px;font-size:13px}
.coach-chat .voice-record{min-height:40px!important}
.coach-chat .voice-upload{font-size:12px}
.coach-chat .voice-upload{position:relative;text-decoration:underline;cursor:pointer}
.coach-chat .voice-upload input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}
@supports(field-sizing:content){.coach-chat textarea{height:auto;field-sizing:content}}
.coach-chat .voice-settings{background:none;border:0;color:var(--muted-fjord);text-decoration:underline;padding:4px!important}
.coach-chat .chat-retention{order:3;font-size:11px;margin:10px 0 4px}
.coach-chat>[data-action=context-revoke]{order:4;align-self:flex-start;background:none;border:0;min-height:0;padding:0 0 12px;font-size:12px;color:var(--muted-fjord);text-decoration:underline}
@media(max-width:600px){.coach-chat .chat-turn{max-width:90%;font-size:15px}}

/* Keep composer text comfortably usable on narrow and keyboard-height viewports. */
.coach-chat form{grid-template-columns:minmax(0,1fr) auto;min-width:0}
.coach-chat textarea{min-width:0;max-height:30dvh}
.coach-chat .voice-bar .button{min-height:44px}
.coach-chat .chat-history{min-width:0}

.coach-chat .chat-turn{scroll-margin-bottom:200px}
.coach-chat .chat-assistant span{color:var(--muted-fjord)}
/* Profile and proposal reuse the existing card, type and colour system. */
.fact-source{display:block;color:var(--muted-fjord);font-size:12px;margin:6px 0}
.me-fact{border-top:1px solid var(--stone);padding:16px 0}
.me-fact fieldset{margin:0;padding:0;border:0}
.me-fact select{width:100%;margin:8px 0}
.health-details{margin-top:20px}
.health-details summary{cursor:pointer}
.plan-proposal{margin:18px 0;border-color:var(--brass)}
.plan-proposal ul{padding-left:20px;line-height:1.8}
/* F-3: interface labels retain sentence case, including inherited prototype styles. */
.api-shell .eyebrow,.api-shell .small-tag,.api-shell .week-date span,
.api-shell .brand,.api-shell .nav-item{text-transform:none;letter-spacing:normal}
.watch-page pre{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit}

.me-memory-settings{border-bottom:1px solid var(--line);padding-bottom:24px;margin-bottom:24px}
.me-memory-settings summary{cursor:pointer;min-height:44px;padding:12px 0}
.profile-editor{scroll-margin-top:24px}
